void PasswordChangeDialog::changePassword()
{
    QString opw = lineCurPas->text().trimmed();
    QString npw = linePass1->text().trimmed();

    if(!psqlSessionIsAdmin()){
        if(!psqlAuthenticate(m_role,opw)){
            QMessageBox::critical(this,tr("Error"),tr("La contrasena que introdujo es incorrecta.\nNingun cambio."));
            linePass1->clear();
            linePass2->clear();
            lineCurPas->selectAll();
            lineCurPas->setFocus();
            checkPasswords();
            return;
        }
    }

    setControlsEnabled(false);
    bool changed = psqlSetPassword(m_role,npw);
    setControlsEnabled(true);

    if(changed){
        QTimer::singleShot(0,this,SLOT(accept()));
    }else{
        QMessageBox::warning(this,tr("Error"),tr("Ocurrio un error intentando cambiar la contrasena.\nPor favor, intenta otra vez."));
    }
}
void StoreManageDialog::runCommand()
{
    QStringList args; args << "-v";
    args << "--root" << settings->loadStoreDirPath();

    QString command = ui->commandCombo->currentText();
    args << command;

    if (command == "clone")
    {
      QString version = ui->versionCombo->currentText();
      if ( version.isEmpty() )
      {
          log( tr("Error: version for cloning is empty!") );
          return;
      }
      else
      {
        args << version;
      }
    }

    setControlsEnabled(false);
    ui->log->clear();

    ttyhstore->setProgram( settings->loadStoreExePath() );
    ttyhstore->setArguments(args);
    ttyhstore->start();
}
Exemple #3
0
void Dialog::showResponse(const QString &s)
{
    setControlsEnabled(true);
    trafficLabel->setText(tr("Traffic, transaction #%1:"
                             "\n\r-request: %2"
                             "\n\r-response: %3")
                          .arg(++transactionCount).arg(requestLineEdit->text()).arg(s));
}
Exemple #4
0
void Dialog::transaction()
{
    setControlsEnabled(false);
    statusLabel->setText(tr("Status: Running, connected to %1.")
                         .arg(serialPortComboBox->currentText()));
    thread.transaction(serialPortComboBox->currentText(),
                       waitResponseSpinBox->value(),
                       requestLineEdit->text());
}
void Dialog::processTimeout()
{
    setControlsEnabled(true);
    trafficLabel->setText(tr("Traffic, transaction #%1:"
                             "\n\r-request: %2"
                             "\n\r-response: %3")
                          .arg(++transactionCount).arg(requestLineEdit->text()).arg(QString(response)));
    response.clear();
}
void StoreManageDialog::onError(QProcess::ProcessError error)
{
    Q_UNUSED(error);

    setControlsEnabled(true);

    QString message = ttyhstore->errorString();
    log( tr("Error: %1").arg(message) );
}
void Dialog::sendRequest()
{
    if (serial.portName() != serialPortComboBox->currentText()) {
        serial.close();
        serial.setPortName(serialPortComboBox->currentText());

        if (!serial.open(QIODevice::ReadWrite)) {
            processError(tr("Can't open %1, error code %2")
                         .arg(serial.portName()).arg(serial.error()));
            return;
        }
    }

    setControlsEnabled(false);
    statusLabel->setText(tr("Status: Running, connected to port %1.")
                         .arg(serialPortComboBox->currentText()));

    serial.write(requestLineEdit->text().toLocal8Bit());
    timer.start(waitResponseSpinBox->value());
}
Exemple #8
0
void MediaPlayer::init()
{
	kdebugf();

	// Initialization
	playerInfo = 0;
	playerCommands = 0;
	statusInterval = CHECK_STATUS_INTERVAL;

	// MediaPlayer menus in chats
	m_menu = new QMenu();
	popups[0] = m_menu->addAction(tr("Put formated string"), this, SLOT(insertFormattedSong()));
	popups[1] = m_menu->addAction(tr("Put song title"), this, SLOT(insertSongTitle()));
	popups[2] = m_menu->addAction(tr("Put song file name"), this, SLOT(insertSongFilename()));
	popups[3] = m_menu->addAction(tr("Send all playlist titles"), this, SLOT(insertPlaylistTitles()));
	popups[4] = m_menu->addAction(tr("Send all playlist files"), this, SLOT(insertPlaylistFilenames()));

	// Title checking timer
	timer = new QTimer(this);
	connect(timer, SIGNAL(timeout()), this, SLOT(checkTitle()));

	DockedMediaplayerStatus = 0;

	// Initial values of some object variables
	winKeyPressed = false;

	Changer = new MediaPlayerStatusChanger(this);
	m_statusChangerManager->registerStatusChanger(Changer);
	connect(m_statusChangerManager, SIGNAL(manualStatusAboutToBeChanged(StatusContainer*,Status)),
			this, SLOT(statusAboutToBeChanged()));

	setControlsEnabled(false);
	isPaused = true;

	Changer->changePositionInStatus((MediaPlayerStatusChanger::ChangeDescriptionTo)m_configuration->deprecatedApi()->readNumEntry("MediaPlayer", "statusPosition"));
	createDefaultConfiguration();
	configurationUpdated();
}
Exemple #9
0
void Dialog::processTimeout(const QString &s)
{
    setControlsEnabled(true);
    statusLabel->setText(tr("Status: Running, %1.").arg(s));
    trafficLabel->setText(tr("No traffic."));
}
void Dialog::processError(const QString &error)
{
    setControlsEnabled(true);
    statusLabel->setText(tr("Status: Not running, %1.").arg(error));
    trafficLabel->setText(tr("No traffic."));
}
void StoreManageDialog::onFinish(int exitCode)
{
    setControlsEnabled(true);
    log( tr("ttyhstore finished with code %1.").arg(exitCode) );
}