void ProviderWindow::saveAction()
{

try
{
	if(record != NULL)
		dbwrite();

	if(record != NULL)
	{
		if(record->getType() == PROVIDER_NEW)
			emit newComplete();
		else
			emit editComplete();

		delete record;
		record = NULL;
	}
	close();
}
catch(pqxx::broken_connection)
{
		DBErrorWindow *dialog = new DBErrorWindow(this, database);
		dialog->setAttribute(Qt::WA_DeleteOnClose,true);

		connect(dialog,SIGNAL(reconnected()),this,SLOT(saveAction()));

		dialog->exec();
}



}
kXneurApp::addUserAction::addUserAction(QString nm, QString key, QString cmd, QWidget *parent) :QDialog(parent),ui(new Ui::addUserAction)
{
    ui->setupUi(this);
    ui->txtActionName->setText(nm);
    ui->lblHotKey->setText(key);
    ui->txtCommandAction->setText(cmd);
    connect(ui->cmdSave, SIGNAL(clicked()), SLOT(saveAction()));
    connect(ui->cmdCancel,SIGNAL(clicked()),SLOT(cancelAction()));
}
void EditActionDialog::slotAccepted()
{
    saveAction();

    qCDebug(KLIPPER_LOG) << "Saving dialogue state";
    KConfigGroup grp = KSharedConfig::openConfig()->group("EditActionDialog");
    KWindowConfig::saveWindowSize(windowHandle(), grp);
    grp.writeEntry("ColumnState",
                    m_ui->twCommandList->horizontalHeader()->saveState().toBase64());
    accept();
}
Example #4
0
void XxxForm::createActions(void) {
	connect(statusTimer, SIGNAL(timeout()), this, SLOT(timerStatusAction()));

	connect(nextPushButton, SIGNAL(released()), this, SLOT(nextAction()));
	connect(previousPushButton, SIGNAL(released()), this,
			SLOT(previousAction()));

	connect(savePushButton, SIGNAL(released()), this, SLOT(saveAction()));
	connect(saveAndContinueSavingPushButton, SIGNAL(released()), this, SLOT(
			saveAndContinueSavingAction()));
	connect(removePushButton, SIGNAL(released()), this, SLOT(removeAction()));
	connect(cancelPushButton, SIGNAL(released()), this, SLOT(cancelAction()));
}
Example #5
0
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: saveAction(); break;
        }
        _id -= 1;
    }
    return _id;
}
Example #6
0
StateManagerWindow::StateManagerWindow() {
  layout = new QVBoxLayout;
  layout->setMargin(Style::WindowMargin);
  layout->setSpacing(Style::WidgetSpacing);
  setLayout(layout);

  list = new QTreeWidget;
  list->setColumnCount(2);
  list->setHeaderLabels(QStringList() << "Slot" << "Description");
  list->setAllColumnsShowFocus(true);
  list->sortByColumn(0, Qt::AscendingOrder);
  list->setRootIsDecorated(false);
  list->resizeColumnToContents(0);
  layout->addWidget(list);

  infoLayout = new QHBoxLayout;
  layout->addLayout(infoLayout);

  descriptionLabel = new QLabel("Description:");
  infoLayout->addWidget(descriptionLabel);

  descriptionText = new QLineEdit;
  infoLayout->addWidget(descriptionText);

  controlLayout = new QHBoxLayout;
  layout->addLayout(controlLayout);

  spacer = new QWidget;
  spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
  controlLayout->addWidget(spacer);

  loadButton = new QPushButton("Load");
  controlLayout->addWidget(loadButton);

  saveButton = new QPushButton("Save");
  controlLayout->addWidget(saveButton);

  eraseButton = new QPushButton("Erase");
  controlLayout->addWidget(eraseButton);

  connect(list, SIGNAL(itemSelectionChanged()), this, SLOT(synchronize()));
  connect(list, SIGNAL(itemActivated(QTreeWidgetItem*, int)), this, SLOT(loadAction()));
  connect(descriptionText, SIGNAL(textEdited(const QString&)), this, SLOT(writeDescription()));
  connect(loadButton, SIGNAL(released()), this, SLOT(loadAction()));
  connect(saveButton, SIGNAL(released()), this, SLOT(saveAction()));
  connect(eraseButton, SIGNAL(released()), this, SLOT(eraseAction()));

  synchronize();
}
void ProviderWindow::setupConnections()
{
// signals and slots connections

	// Standard Actions for buttons
	connect( cancelButton, SIGNAL( clicked() ), this, SLOT( cancelAction() ) );
	connect( saveButton, SIGNAL( clicked() ), this, SLOT( saveAction() ) );
	connect (deleteButton, SIGNAL( clicked() ), this, SLOT( deleteAction() ) );
	// These to connects are for detecting if the ok/save button should be
	// activated. 
	connect( lastnameEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( activatesaveButton() ) );
	connect( firstnameEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( activatesaveButton() ) );

	// Detects if the signature on file checkbox changed, and if so
	// runs sofchanged() to activate or deactivate signature on file date box.
	connect (sofCheckBox, SIGNAL( stateChanged(int) ), this, SLOT( sofchanged() ) );


}
Example #8
0
void ThemeConfig::removeThemeClicked()
{
    if (!configUi->themesListView->currentIndex().isValid()) {
        return;
    }

    const QString path = configUi->themesListView->currentIndex().data(ThemesModel::PathRole).toString();
     KAuth::Action saveAction(QStringLiteral("org.kde.kcontrol.kcmsddm.uninstalltheme"));
    saveAction.setHelperId("org.kde.kcontrol.kcmsddm");
    saveAction.addArgument(QStringLiteral("filePath"), path);
    auto job = saveAction.execute();
    if (!job->exec()) {
        configUi->messageWidget->setMessageType(KMessageWidget::Warning);
        configUi->messageWidget->setText(job->errorString());
        configUi->messageWidget->animatedShow();
    } else {
        emit themesChanged();
    }
}
Example #9
0
bool AutomaticLoginSettings::setAutoLoginUser(const QString& username)
{
    KAuth::Action saveAction(QString("org.kde.kcontrol.kcmsddm.save"));
    saveAction.setHelperId("org.kde.kcontrol.kcmsddm");
    QVariantMap args;

    args["sddm.conf"] = SDDM_CONFIG_FILE;
    args["sddm.conf/Autologin/User"] = username;

    saveAction.setHelperId("org.kde.kcontrol.kcmsddm");
    saveAction.setArguments(args);

    auto job = saveAction.execute();
    if (!job->exec()) {
        qDebug() << "fail" << job->errorText();
        return false;
    }

    m_autoLoginUser = username;
    return true;
}
Example #10
0
void ThemeConfig::installFromFileClicked()
{
    QPointer<QFileDialog> dialog(new QFileDialog(this));
    dialog->exec();
    QStringList files = dialog->selectedFiles();
    if (files.count() == 1) {
        QString file = files.first();
        KAuth::Action saveAction(QStringLiteral("org.kde.kcontrol.kcmsddm.installtheme"));
        saveAction.setHelperId("org.kde.kcontrol.kcmsddm");
        saveAction.addArgument(QStringLiteral("filePath"), file);
        auto job = saveAction.execute();
        if (!job->exec()) {
            configUi->messageWidget->setMessageType(KMessageWidget::Warning);
            configUi->messageWidget->setText(job->errorString());
            configUi->messageWidget->animatedShow();
        } else {
            emit themesChanged();
        }
    }

    delete dialog.data();
}
void ProviderWindow::deletewindowInactive()
{
	provideractiveCheckBox->setChecked(false);
	saveAction();
}