Example #1
0
OptionsDialog::OptionsDialog(QWidget* parent) : QWidget(parent)
{
	ui.setupUi(this);

	connect(ui.OKButton, SIGNAL(clicked()), this, SLOT(acceptChanges()));
	connect(ui.ApplyButton, SIGNAL(clicked()), this, SLOT(applyChanges()));
	connect(ui.CancelButton, SIGNAL(clicked()), this, SLOT(revertAndClose()));

	QSettings settings;

	mMusicDirectory = settings.value("General/MusicDirectory").toString();
	mLyricsDirectory = settings.value("General/LyricsDirectory").toString();
	mCoversDirectory = settings.value("General/CoversDirectory").toString();
	mLoginAtStart = settings.value("Login/AutoLogin").toInt();
	mUseKanji = settings.value("General/UseKanji").toInt();

	if(settings.contains("General/OutputPlugin"))
		mOutputPlugin = settings.value("General/OutputPlugin").toString();
	else
		mOutputPlugin = tr("Null Output");

	ui.OutputPluginCombo->addItems(uApp->pluginManager()->pluginsList());

	revertChanges();
};
long
GNEVariableSpeedSignDialog::onCmdAccept(FXObject*, FXSelector, void*) {
    if (myStepsValids == false) {
        // write warning if netedit is running in testing mode
        if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
            WRITE_WARNING("Opening FXMessageBox of type 'warning'");
        }
        // open warning Box
        FXMessageBox::warning(getApp(), MBOX_OK, ("Error updating " + toString(SUMO_TAG_VSS) + " " + toString(SUMO_TAG_STEP)).c_str(), "%s",
                              (toString(SUMO_TAG_VSS) + " " + toString(SUMO_TAG_STEP) + "cannot be updated because there are invalid values").c_str());
        // write warning if netedit is running in testing mode
        if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
            WRITE_WARNING("Closed FXMessageBox of type 'warning' with 'OK'");
        }
        return 0;
    } else {
        // accept changes before closing dialog
        acceptChanges();
        // sort steps after finish
        myEditedAdditional->sortAdditionalChilds();
        // stop dialgo sucesfully
        getApp()->stopModal(this, TRUE);
        return 1;
    }
}
Example #3
0
void KstEventMonitorI::vectorChanged(const QString& strVector) {
  QString    			str;
  int							iButton;
  
  if( _bChanged ) {
    iButton = QMessageBox::information( this, 
                                        i18n("Accept changes?"),
                                        i18n("You have made changes to the event monitor entries for the vector %1\nDo you wish to accept or discard your changes?").arg( _strVector ),
                                        i18n("Accept"),
                                        i18n("Discard") );
    if( iButton == 0 ) {
      acceptChanges( );
    }
  }
  
  lineEditEquation->setText( "" );
  displayEvents( strVector );
  
  if( _eventMonitors.size( ) > 0 ) {
    enableEditing( TRUE );    
    
    tableEvents->setCurrentCell( 0, 0 );
  } else {
    enableEditing( FALSE );    
  }
  
  setChanged( FALSE );
}
Example #4
0
KstEventMonitorI::KstEventMonitorI(QWidget* parent,
                                           const char* name,
                                           bool modal,
                                           WFlags fl) :
  EventMonitor(parent, name, modal, fl) {
  QStringList	labels;

  _bSetWidths = FALSE;
  
  labels.append(i18n("Log as:"));
  labels.append(i18n("Expression:"));
  labels.append(i18n("Description:"));
  
  tableEvents = new KstEventTable( this, "tableEvents" );
  tableEvents->setNumRows( 0 );
  tableEvents->setNumCols( 3 );
  tableEvents->setReadOnly( TRUE );
  tableEvents->setSorting( FALSE );     
  tableEvents->setRowMovingEnabled( FALSE );
  tableEvents->setColumnLabels( labels );
  tableEvents->setSelectionMode( QTable::SingleRow );
  tableEvents->setEventMonitors( &_eventMonitors );
  layoutGrid->addWidget( tableEvents, 1, 0 );

  connect(vectorSelector, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
  connect(vectorSelectorEq, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
  connect( scalarSelectorEq, SIGNAL( newScalarCreated() ), this, SIGNAL(modified()));
  connect( buttonGroupLog, SIGNAL( clicked(int) ), this, SLOT( logChanged(int) ) );
  connect( checkBoxDebug, SIGNAL(clicked()), this, SLOT(logCheckChanged()));
  connect( Close, SIGNAL( clicked() ), this, SLOT( close() ) );
  connect( pushButtonAdd, SIGNAL( clicked() ), this, SLOT( addEvent() ) );
  connect( pushButtonDelete, SIGNAL( clicked() ), this, SLOT( deleteEvent() ) );
  connect( pushButtonAccept, SIGNAL( clicked() ), this, SLOT( acceptChanges() ) );
  connect( pushButtonDiscard, SIGNAL( clicked() ), this, SLOT( discardChanges() ) );
  connect( lineEditEquation, SIGNAL( textChanged(const QString&) ), this, SLOT( expressionChanged(const QString&) ) );
  connect( lineEditDescription, SIGNAL( textChanged(const QString&) ), this, SLOT( descriptionChanged(const QString&) ) );
  connect( tableEvents, SIGNAL( currentChanged(int, int) ), this, SLOT( changedEvent(int, int) ) );
  connect( tableEvents, SIGNAL( selectionChanged() ), this, SLOT( changedSelection() ) );
  connect( vectorSelector, SIGNAL( selectionChanged(const QString&) ), this, SLOT( vectorChanged(const QString&) ) );
  connect( vectorSelector, SIGNAL( newVectorCreated(const QString&) ), this, SLOT( vectorChanged(const QString&) ) );
  connect( vectorSelectorEq, SIGNAL( selectionChangedLabel(const QString&)), lineEditEquation, SLOT( insert(const QString&) ) );
  connect( scalarSelectorEq, SIGNAL( selectionChangedLabel(const QString&)), lineEditEquation, SLOT( insert(const QString&) ) );
  connect( pushButtonApply, SIGNAL( clicked() ), this, SLOT( apply() ) );
    
  languageChange( );
  
  setChanged( FALSE );
}
Example #5
0
void UatDialog::setUat(epan_uat *uat)
{
    QString title(tr("Unknown User Accessible Table"));

    uat_ = uat;

    ui->pathLabel->clear();
    ui->pathLabel->setEnabled(false);
    help_button_->setEnabled(false);

    if (uat_) {
        if (uat_->name) {
            title = uat_->name;
        }

        QString abs_path = gchar_free_to_qstring(uat_get_actual_filename(uat_, FALSE));
        ui->pathLabel->setText(abs_path);
        ui->pathLabel->setUrl(QUrl::fromLocalFile(abs_path).toString());
        ui->pathLabel->setToolTip(tr("Open ") + uat->filename);
        ui->pathLabel->setEnabled(true);

        uat_model_ = new UatModel(NULL, uat);
        uat_delegate_ = new UatDelegate;
        ui->uatTreeView->setModel(uat_model_);
        ui->uatTreeView->setItemDelegate(uat_delegate_);

        connect(uat_model_, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
                this, SLOT(modelDataChanged(QModelIndex)));
        connect(ui->uatTreeView, SIGNAL(currentItemChanged(QModelIndex,QModelIndex)),
                this, SLOT(viewCurrentChanged(QModelIndex,QModelIndex)));
        ok_button_->setEnabled(!uat_model_->hasErrors());

        if (uat_->help && strlen(uat_->help) > 0) {
            help_button_->setEnabled(true);
        }

        connect(this, SIGNAL(rejected()), this, SLOT(rejectChanges()));
        connect(this, SIGNAL(accepted()), this, SLOT(acceptChanges()));
    }

    setWindowTitle(title);
}
Example #6
0
void KstEventMonitorI::apply() {
  acceptChanges();
}