connect(Client::coreConnection(), SIGNAL(handleSslErrors(const QSslSocket *, bool *, bool *)), SLOT(handleSslErrors(const QSslSocket *, bool *, bool *)));
#endif
+ connect(this, SIGNAL(changePassword(QString)), Client::instance(), SLOT(changePassword(QString)));
+
// Setup Dock Areas
setDockNestingEnabled(true);
setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
this, SLOT(showCoreConnectionDlg())));
coll->addAction("DisconnectCore", new Action(QIcon::fromTheme("network-disconnect"), tr("&Disconnect from Core"), coll,
Client::instance(), SLOT(disconnectFromCore())));
+ coll->addAction("ChangePassword", new Action(QIcon::fromTheme("dialog-password"), tr("Change &Password..."), coll,
+ this, SLOT(showChangePasswordDialog())));
coll->addAction("CoreInfo", new Action(QIcon::fromTheme("help-about"), tr("Core &Info..."), coll,
this, SLOT(showCoreInfoDlg())));
coll->addAction("ConfigureNetworks", new Action(QIcon::fromTheme("configure"), tr("Configure &Networks..."), coll,
#endif
coll->addAction("ConfigureQuassel", configureQuasselAct);
- QAction *changePasswordAct = new Action(QIcon::fromTheme("dialog-password"), tr("&Change password..."), coll,
- this, SLOT(showChangePasswordDialog()));
- coll->addAction("ChangePassword", changePasswordAct);
-
// Help
QAction *aboutQuasselAct = new Action(QIcon(":/icons/quassel.png"), tr("&About Quassel"), coll,
this, SLOT(showAboutDlg()));
_fileMenu = menuBar()->addMenu(tr("&File"));
static const QStringList coreActions = QStringList()
- << "ConnectCore" << "DisconnectCore" << "CoreInfo";
+ << "ConnectCore" << "DisconnectCore" << "ChangePassword" << "CoreInfo";
QAction *coreAction;
foreach(QString actionName, coreActions) {
#else
_settingsMenu->addAction(coll->action("ConfigureShortcuts"));
#endif
- _settingsMenu->addAction(coll->action("ChangePassword"));
_settingsMenu->addAction(coll->action("ConfigureQuassel"));
nextBufferView(); // fallback
}
+
void MainWin::showChangePasswordDialog()
{
- bool ok;
- QString newPassword = QInputDialog::getText(this, tr("Set new password"), tr("New password:"), QLineEdit::Password, QString(), &ok);
- if (ok && !newPassword.isEmpty()) {
- emit changePassword(newPassword);
+ if((Client::coreFeatures() & Quassel::PasswordChange)) {
+ bool ok;
+ QString newPassword = QInputDialog::getText(this, tr("Set Core Password"), tr("New password for your Quassel Core:"), QLineEdit::Password, QString(), &ok);
+ if (ok && !newPassword.isEmpty()) {
+ emit changePassword(newPassword);
+ }
+ }
+ else {
+ QMessageBox box(QMessageBox::Warning, tr("Feature Not Supported"),
+ tr("<b>Your Quassel Core does not support this feature</b>"),
+ QMessageBox::Ok, this);
+ box.setInformativeText(tr("You need a Quassel Core v0.12.0 or newer in order to be able to remotely change your password."));
+ box.exec();
}
}
coll->action("ConnectCore")->setEnabled(false);
coll->action("DisconnectCore")->setEnabled(true);
+ coll->action("ChangePassword")->setEnabled(true);
coll->action("CoreInfo")->setEnabled(true);
foreach(QAction *action, _fileMenu->actions()) {
connect(Client::backlogManager(), SIGNAL(messagesProcessed(const QString &)), this, SLOT(showStatusBarMessage(const QString &)));
}
- disconnect(this, SIGNAL(changePassword(QString)), Client::instance(), SLOT(changePassword(QString)));
- if (Client::internalCore()) {
- coll->action("ChangePassword")->setVisible(false);
- }
- else if((Client::coreFeatures() & Quassel::PasswordChange)) {
- connect(this, SIGNAL(changePassword(QString)), Client::instance(), SLOT(changePassword(QString)));
- coll->action("ChangePassword")->setEnabled(true);
- }
- else {
- coll->action("ChangePassword")->setEnabled(false);
- }
-
// _viewMenu->setEnabled(true);
if (!Client::internalCore())
statusBar()->showMessage(tr("Connected to core."));