Exemplo n.º 1
0
bool PrefProxy::checkPrefix(bool save)
{
  QString appPath = QApplication::applicationDirPath();
  appPath.prepend(QString::fromUtf8("\""));
  appPath += QString::fromUtf8("\"");
  bool res;
  char *tmp_prefix = ltr_int_get_key("Global", "Prefix");
  if(tmp_prefix != NULL){
    res = true;
    prefix = QString::fromStdString(tmp_prefix);
  }else{
    res = false;
    prefix = QString::fromUtf8("");
  }
  if(res && (prefix == appPath)){
    //Intentionaly left empty
  }else{
    prefix = appPath;
    bool res = ltr_int_change_key("Global", "Prefix",appPath.toUtf8().constData());
    if(save){
      res &= savePrefs();
    }
    return res;
  }
  return true;
}
Exemplo n.º 2
0
void PrefProxy::SavePrefsOnExit()
{
  if(ltr_int_need_saving()){
    QMessageBox::StandardButton res;
    res = QMessageBox::warning(NULL, QString::fromUtf8("Linuxtrack"),
       QString::fromUtf8("Preferences were modified,") +
       QString::fromUtf8("Do you want to save them?"), 
       QMessageBox::Save | QMessageBox::Close, QMessageBox::Save);
    if(res == QMessageBox::Save){
      savePrefs();
    }
  }
}
Exemplo n.º 3
0
/** prefs */
void kweather::preferences()
{
    kdDebug(12004) << "prefs" << endl;

    savePrefs();

    if ( settingsDialog == 0 )
    {
      settingsDialog = new KCMultiDialog( this );
      connect( settingsDialog, TQT_SIGNAL( configCommitted() ), TQT_SLOT( slotPrefsAccepted() ) );

      settingsDialog->addModule( "kcmweather.desktop" );
      settingsDialog->addModule( "kcmweatherservice.desktop" );
    }

    settingsDialog->show();
    settingsDialog->raise();
}
Exemplo n.º 4
0
void
LookupPrefs::createLayout() {

    QSettings settings("DNSSEC-Tools", "Lookup");

    topLayout = new QVBoxLayout();
    formLayout = new QFormLayout();
    topLayout->addLayout(formLayout);
    formLayout->addRow("Log File Location", logLocation = new QLineEdit);
    logLocation->setText(settings.value("logPath", "").toString());

    QDialogButtonBox *buttonBox;
    buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok |
                                     QDialogButtonBox::Cancel,
                                     Qt::Horizontal, this);
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(savePrefs()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    topLayout->addWidget(buttonBox);
}
void
DnssecSystemTrayPrefs::setupWindow() {
    QSettings settings("DNSSEC-Tools", "dnssec-system-tray");
    QLabel *label;

    m_topLayout = new QVBoxLayout();
    m_topLayout->addLayout(m_formLayout = new QFormLayout());

    QHBoxLayout *hbox = new QHBoxLayout();
    m_logFile = new QTextEdit();
    hbox->addWidget(m_logFile);
    QPushButton *browserButton = new QPushButton(tr("Browse..."));
    hbox->addWidget(browserButton);
    connect(browserButton, SIGNAL(clicked()), this, SLOT(openBrowseWindow()));

    m_formLayout->addRow(tr("<p>Log File(s) to Watch<br /><i>(either bind-named, unbound or libval logs)</i></p>"), hbox);
    m_formLayout->addRow(new QLabel(""), label = new QLabel(""));
    QFont font = label->font();
    font.setItalic(true);
    label->setFont(font);
    m_logFile->setText(m_logFileList.join("\n"));

    m_formLayout->addRow(tr("Number of Log Messages to Keep"), m_logNumber = new QSpinBox());
    m_logNumber->setRange(1, 1000);
    m_logNumber->setValue(settings.value("logNumber", 5).toInt());

    m_formLayout->addRow(tr("Show still-running warning on close:"),
                         m_stillRunningWarning = new QCheckBox());
    m_stillRunningWarning->setChecked(settings.value("stillRunningWarning", true).toBool());

    QDialogButtonBox *buttonBox;
    buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok |
                                     QDialogButtonBox::Cancel,
                                     Qt::Horizontal, this);
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(savePrefs()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    m_topLayout->addWidget(buttonBox);

    setLayout(m_topLayout);
    setMinimumSize(640,400);
}
Exemplo n.º 6
0
void SWDialog::cancelButton_pressed()
{
	savePrefs();
	reject();
}
Exemplo n.º 7
0
void SWDialog::okButton_pressed()
{
	savePrefs();
	accept();
}