void QFESPIMB040CamParamStackConfigWidget2::on_btnSaveTemplate_clicked()
{
    if (opticsSetup->getStopRelease(0)) opticsSetup->getStopRelease(0)->stop();
    if (opticsSetup->getStopRelease(1)) opticsSetup->getStopRelease(1)->stop();
    QString tdir=ProgramOptions::getInstance()->getConfigValue("spimb040/templates_directory", ProgramOptions::getInstance()->getHomeQFDirectory()+"/acq_templates/").toString();
    QDir().mkpath(tdir);
    QString dir=ProgramOptions::getInstance()->getQSettings()->value("QFESPIMB040CamParamStackConfigWidget2/lasttemplatedir", tdir).toString();
    QString filename=qfGetSaveFileName(this, tr("save as template ..."), dir, tr("camera parameter stack configuration (*.cpsc)"))    ;
    if (!filename.isEmpty()) {
        bool ok=true;
        if (QFile::exists(filename)) {
            ok=false;
            if (QMessageBox::question(this, tr("save as template ..."), tr("The file\n  '%1'\nalready exists. Overwrite?").arg(filename), QMessageBox::Yes|QMessageBox::No, QMessageBox::No)==QMessageBox::Yes) {
                ok=true;
            }
        }
        if (ok) {
            QSettings set(filename, QSettings::IniFormat);
            storeSettings(set, "camera_param_stack_settings/");
            dir=QFileInfo(filename).absolutePath();
        }
    }
    ProgramOptions::getInstance()->getQSettings()->setValue("QFESPIMB040CamParamStackConfigWidget2/lasttemplatedir", dir);
    if (opticsSetup->getStopRelease(0)) opticsSetup->getStopRelease(0)->resume();
    if (opticsSetup->getStopRelease(1)) opticsSetup->getStopRelease(1)->resume();
}
示例#2
0
DialogBare::~DialogBare()
{
    // No need to delete worker, its self-destructing
    storeSettings();
    delete ui;
    delete port;
}
示例#3
0
void SettingsDialog::on_reloadCalendarListButton_clicked() {
    // we need to store the calendar backend
    storeSettings();

    OwnCloudService *ownCloud = new OwnCloudService(crypto, this);
    ownCloud->settingsGetCalendarList(this);
}
示例#4
0
void MessagesSettingsPage::actRemove()
{
    if (messageList->currentItem()) {
        delete messageList->takeItem(messageList->currentRow());
        storeSettings();
    }
}
示例#5
0
void SettingGuiWireup::onChannelChange( QString new_channel )
{
    if( !valid )
        return;

    if( current ) {
        emit storeSettings( current->getSettings(), last_channel );
    }

    last_channel = new_channel.toInt();

    PortSettingsPointer settings =
            channels->getPortSettings( last_channel );

    if( !settings )
        return;

    QString type_name = settings->getTypeName();
    current = type_to_builder.value( type_name );

    if( !current )
        return;

    port_type_combobox->setCurrentText( type_name );
    current->setSettings( settings );

    int idx = type_to_index.value( type_name );
    setCurrentIndex( idx );
}
示例#6
0
void MessagesSettingsPage::actAdd()
{
    bool ok;
    QString msg = QInputDialog::getText(this, tr("Add message"), tr("Message:"), QLineEdit::Normal, QString(), &ok);
    if (ok) {
        messageList->addItem(msg);
        storeSettings();
    }
}
示例#7
0
void TodoDialog::on_todoListSelector_currentIndexChanged(const QString &arg1) {
    Q_UNUSED(arg1);

    // store the todoListSelectorSelectedItem
    storeSettings();

    // reload the task list items
    reloadTodoList();
}
示例#8
0
LogWidget::LogWidget(QWidget *parent) :
        QFrame(parent)
#ifndef INTEGRATION_TESTS
        , ui(new Ui::LogWidget)
#endif
{
#ifndef INTEGRATION_TESTS
    connect(this, SIGNAL(destroyed(QObject*)),
            this, SLOT(onDestroyed(QObject*)));

    ui->setupUi(this);

    connect(ui->logTextEdit, SIGNAL(destroyed(QObject*)),
            this, SLOT(onDestroyed(QObject*)));

    ui->buttonFrame->hide();

    // init the log text edit search frame
    ui->logTextEdit->initSearchFrame(ui->logTextEditSearchFrame);

    // turn off markdown highlighting
    ui->logTextEdit->setHighlightingEnabled(false);

    // load the dialog settings
    QSettings settings;
    ui->debugCheckBox->setChecked(
            settings.value("LogWidget/debugLog", false).toBool());
    ui->infoCheckBox->setChecked(
            settings.value("LogWidget/infoLog", false).toBool());
    ui->warningCheckBox->setChecked(
            settings.value("LogWidget/warningLog", true).toBool());
    ui->criticalCheckBox->setChecked(
            settings.value("LogWidget/criticalLog", true).toBool());
    ui->fatalCheckBox->setChecked(
            settings.value("LogWidget/fatalLog", true).toBool());
    ui->statusCheckBox->setChecked(
            settings.value("LogWidget/statusLog", true).toBool());
    ui->scriptingCheckBox->setChecked(
            settings.value("LogWidget/scriptingLog", true).toBool());

    // store the settings if the dialog is closed or the checkboxes are clicked
    connect(ui->debugCheckBox, SIGNAL(clicked()), this, SLOT(storeSettings()));
    connect(ui->infoCheckBox, SIGNAL(clicked()), this, SLOT(storeSettings()));
    connect(ui->warningCheckBox, SIGNAL(clicked()),
            this, SLOT(storeSettings()));
    connect(ui->criticalCheckBox, SIGNAL(clicked()),
            this, SLOT(storeSettings()));
    connect(ui->fatalCheckBox, SIGNAL(clicked()), this, SLOT(storeSettings()));
    connect(ui->statusCheckBox, SIGNAL(clicked()), this, SLOT(storeSettings()));
    connect(ui->scriptingCheckBox, SIGNAL(clicked()),
            this, SLOT(storeSettings()));

    ui->logTextEdit->installEventFilter(this);
    ui->buttonFrame->installEventFilter(this);
#endif
}
示例#9
0
void Application::manageSettings()
{
    if ( settingsDialog.isVisible() )
        return;

    settingsDialog.setStationList( stationList );
    if ( settingsDialog.exec() == QDialog::Accepted )
    {
        stationList = settingsDialog.getStationList();
        storeSettings();
        updateStationsMenu();
    }
}
示例#10
0
LogWidget::LogWidget(QWidget *parent) :
        QFrame(parent)
#ifndef INTEGRATION_TESTS
        ,ui(new Ui::LogWidget)
#endif
{
#ifndef INTEGRATION_TESTS
    ui->setupUi(this);

    // init the log text edit search frame
    ui->logTextEdit->initSearchFrame(ui->logTextEditSearchFrame);

    // load the dialog settings
    QSettings settings;
    ui->debugCheckBox->setChecked(
            settings.value("LogWidget/debugLog", false).toBool());
    ui->infoCheckBox->setChecked(
            settings.value("LogWidget/infoLog", false).toBool());
    ui->warningCheckBox->setChecked(
            settings.value("LogWidget/warningLog", true).toBool());
    ui->criticalCheckBox->setChecked(
            settings.value("LogWidget/criticalLog", true).toBool());
    ui->fatalCheckBox->setChecked(
            settings.value("LogWidget/fatalLog", true).toBool());
    ui->statusCheckBox->setChecked(
            settings.value("LogWidget/statusLog", true).toBool());
    ui->scriptingCheckBox->setChecked(
            settings.value("LogWidget/scriptingLog", true).toBool());

    // store the settings if the dialog is closed or the checkboxes are clicked
    connect(ui->debugCheckBox, SIGNAL(clicked()), this, SLOT(storeSettings()));
    connect(ui->infoCheckBox, SIGNAL(clicked()), this, SLOT(storeSettings()));
    connect(ui->warningCheckBox, SIGNAL(clicked()),
            this, SLOT(storeSettings()));
    connect(ui->criticalCheckBox, SIGNAL(clicked()),
            this, SLOT(storeSettings()));
    connect(ui->fatalCheckBox, SIGNAL(clicked()), this, SLOT(storeSettings()));
    connect(ui->statusCheckBox, SIGNAL(clicked()), this, SLOT(storeSettings()));
    connect(ui->scriptingCheckBox, SIGNAL(clicked()),
            this, SLOT(storeSettings()));
#endif
}
示例#11
0
文件: dialog.cpp 项目: KipK/qupgrade
Dialog::~Dialog()
{
    storeSettings();
    delete ui;
    delete port;
}
示例#12
0
FuzzyTester::~FuzzyTester()
{
    storeSettings();
}
示例#13
0
/**
 * @brief SettingsDialog::on_connectButton_clicked
 */
void SettingsDialog::on_connectButton_clicked() {
    storeSettings();

    // start a connection test
    startConnectionTest();
}
示例#14
0
MAVLinkProtocol::~MAVLinkProtocol()
{
	storeSettings();

	_closeLogFile();
}
示例#15
0
void SettingsDialog::on_buttonBox_clicked(QAbstractButton *button) {
    if (button == ui->buttonBox->button(QDialogButtonBox::Ok)) {
        storeSettings();
    }
}
示例#16
0
void TodoDialog::on_showCompletedItemsCheckBox_clicked() {
    storeSettings();
    reloadTodoList();
}
示例#17
0
/* Options Dialog */
int btnDialog(struct pgEvent *btnevt) {
  struct pgEvent evt;
  pghandle wSampleTB,wOk,wCancel,wSetFont,wOptionBox,wTB;
  pghandle w24hour,wSeconds,wColon,wWeekDay,wDay,wMonth,wYear;
  struct clockData oldData;

  /* Save data in case of cancel */
  oldData = currentClock;

  /* Top-level widgets */

  pgEnterContext();
  pgDialogBox("Clock Preferences");

  wTB = pgNewWidget(PG_WIDGET_TOOLBAR,0,0);
  pgSetWidget(PGDEFAULT,
	      PG_WP_SIDE,PG_S_BOTTOM,
	      0);

  wSampleTB = pgNewWidget(PG_WIDGET_TOOLBAR,0,0);

  wOptionBox = pgNewWidget(PG_WIDGET_BOX,0,0);

  pgNewWidget(PG_WIDGET_SCROLL,PG_DERIVE_BEFORE,wOptionBox);
  pgSetWidget(PGDEFAULT,
	      PG_WP_BIND,wOptionBox,
	      0);

  /* Options */

  w24hour = pgNewWidget(PG_WIDGET_CHECKBOX,PG_DERIVE_INSIDE,wOptionBox);
  pgSetWidget(PGDEFAULT,
	      PG_WP_TEXT,pgNewString("24-hour clock"),
	      PG_WP_ON,currentClock.enable24hour,
	      0);
  wSeconds = pgNewWidget(PG_WIDGET_CHECKBOX,0,0);
  pgSetWidget(PGDEFAULT,
	      PG_WP_TEXT,pgNewString("Show seconds"),
	      PG_WP_ON,currentClock.enableSeconds,
	      0);
  wColon = pgNewWidget(PG_WIDGET_CHECKBOX,0,0);
  pgSetWidget(PGDEFAULT,
	      PG_WP_TEXT,pgNewString("Flash colon"),
	      PG_WP_ON,currentClock.flashColon,
	      0);
  wSetFont = pgNewWidget(PG_WIDGET_BUTTON,0,0);
  pgSetWidget(PGDEFAULT,
	      PG_WP_TEXT,pgNewString("Set Font"),
	      PG_WP_SIDE,PG_S_TOP,
	      0);
  wWeekDay = pgNewWidget(PG_WIDGET_CHECKBOX,0,0);
  pgSetWidget(PGDEFAULT,
	      PG_WP_TEXT,pgNewString("Show weekday"),
	      PG_WP_ON,currentClock.enableWeekDay,
	      0);
  wDay = pgNewWidget(PG_WIDGET_CHECKBOX,0,0);
  pgSetWidget(PGDEFAULT,
	      PG_WP_TEXT,pgNewString("Show day"),
	      PG_WP_ON,currentClock.enableDay,
	      0);
  wMonth = pgNewWidget(PG_WIDGET_CHECKBOX,0,0);
  pgSetWidget(PGDEFAULT,
	      PG_WP_TEXT,pgNewString("Show month"),
	      PG_WP_ON,currentClock.enableMonth,
	      0);
  wYear = pgNewWidget(PG_WIDGET_CHECKBOX,0,0);
  pgSetWidget(PGDEFAULT,
	      PG_WP_TEXT,pgNewString("Show year"),
	      PG_WP_ON,currentClock.enableYear,
	      /* Give the last one PG_S_ALL to avoid extra margin at the
	       * bottom of wCheckBoxBox
	       */
	      PG_WP_SIDE,PG_S_ALL,
	      0);

  /* Buttons */

  wCancel = pgNewWidget(PG_WIDGET_BUTTON,PG_DERIVE_INSIDE,wTB);
  pgSetWidget(PGDEFAULT,
	      PG_WP_TEXT,pgGetServerRes(PGRES_STRING_CANCEL),
	      PG_WP_SIDE,PG_S_RIGHT,
	      PG_WP_HOTKEY,pgThemeLookup(PGTH_O_POPUP_MESSAGEDLG,
					 PGTH_P_HOTKEY_CANCEL),
	      PG_WP_BITMAP,pgThemeLookup(PGTH_O_POPUP_MESSAGEDLG,
					 PGTH_P_ICON_CANCEL),
	      PG_WP_BITMASK,pgThemeLookup(PGTH_O_POPUP_MESSAGEDLG,
					  PGTH_P_ICON_CANCEL_MASK),
	      0);
  wOk = pgNewWidget(PG_WIDGET_BUTTON,PG_DERIVE_INSIDE,wTB);
  pgSetWidget(PGDEFAULT,
	      PG_WP_TEXT,pgGetServerRes(PGRES_STRING_OK),
	      PG_WP_SIDE,PG_S_RIGHT,
	      PG_WP_HOTKEY,pgThemeLookup(PGTH_O_POPUP_MESSAGEDLG,
					 PGTH_P_HOTKEY_OK),
	      PG_WP_BITMAP,pgThemeLookup(PGTH_O_POPUP_MESSAGEDLG,
					 PGTH_P_ICON_OK),
	      PG_WP_BITMASK,pgThemeLookup(PGTH_O_POPUP_MESSAGEDLG,
					  PGTH_P_ICON_OK_MASK),
	      0);

  /* Sample clock */

  currentClock.wClock = pgNewWidget(PG_WIDGET_FLATBUTTON,PG_DERIVE_INSIDE,
				    wSampleTB);
  pgSetWidget(PGDEFAULT,
	      PG_WP_SIDE,PG_S_ALL,
	      0);

  /* Run the dialog */
  for (;;) {
    mungeSettings();                /* New settings take effect */
    evt = *pgGetEvent();            /* Wait for an event */

    /* Set Font */
    if (evt.from == wSetFont) {
      pghandle fNew, fOld;
      fNew = pgFontPicker("Set Clock Font");
      if (fNew) {
	fOld = currentClock.fClockFont;
	/* Send new font handle to the main context */
	pgChangeContext(fNew,-1);
	/* Select new one, delete old one
	 * (unless this was the original font we entered with.
	 * Then, keep it around because we might cancel this dialog) */
	currentClock.fClockFont = fNew;
	if (fOld != oldData.fClockFont)
	  pgDelete(fOld);
      }
    }

    /* Cancel - revert everything */
    else if (evt.from == wCancel) {
      currentClock = oldData;
      break;
    }

    /* Done. Revert widget, delete old font */
    else if (evt.from == wOk) {
      if (oldData.fClockFont != currentClock.fClockFont)
	pgDelete(oldData.fClockFont);
      currentClock.wClock = oldData.wClock;
      break;
    }

    /* Set various flags */
    else if (evt.from == wColon)
      currentClock.flashColon ^= 1;
    else if (evt.from == w24hour)
      currentClock.enable24hour ^= 1;
    else if (evt.from == wSeconds)
      currentClock.enableSeconds ^= 1;
    else if (evt.from == wWeekDay)
      currentClock.enableWeekDay ^= 1;
    else if (evt.from == wDay)
      currentClock.enableDay ^= 1;
    else if (evt.from == wMonth)
      currentClock.enableMonth ^= 1;
    else if (evt.from == wYear)
      currentClock.enableYear ^= 1;
  }
  storeSettings();
  pgLeaveContext();
  mungeSettings();
  return 0;
}
示例#18
0
void TodoDialog::on_TodoDialog_finished(int result) {
    Q_UNUSED(result);

    storeSettings();
}
void MainWindow::closeEvent(QCloseEvent *event)
{
    storeSettings();
    event->accept();
}
示例#20
0
int main(int argc, char* argv[]) {
	
    // Parse command line arguments, use defaults when needed
    ArgumentStruct* args;
    args = parseArguments(argc, argv);
    
    // Struct to store response from CURL
    MessageStruct response;    
    struct tm* lastUpdated = getTime(&response, args->url);
    
    // Preapre response for re-use
    freeResponse(response);
    
    // Get RSS feed from server
    if (args->update) {
        // If we're either not refetching the same URL, or it has updates
        if (args->ignoreTimestamp || fetchingNewURL(args) ||
            args->previouslyFetchedURL == NULL || timeDiff(&(args->lastUpdated), lastUpdated)) {
                
            if(get(&response, args->url)) {
                printf("ERROR : Could not find feed at %s\n", args->url);
                
                freeArgs(args);
                
                return 1;
            }
        
            // Write result out to file
            if(storeFeed(response, args->dataFile, args->tempDirectory)) {
                printf("ERROR : Writing response to file (Running again should fix this)\n");
                
                freeArgs(args);
                
                return 1;
            }
        }
        else {
            printf("No updates for feed : %s\n", args->url);
            freeArgs(args);
            
            return 0;
        }
    }
    
    
    
    // Create array of article sturctures
    RSSFeed* feed = NULL;
    feed = parseFeed(args);
    
    // Display feed
    displayFeed(feed, args);
    storeSettings(args, feed);
    
    // Free everything that has been dynamically allocated
    freeFeed(feed);
    freeResponse(response);
    freeArgs(args);
    
    return 0;
}