#include <QMessageBox>
#include <QStatusBar>
#include <QToolBar>
+#include <QInputDialog>
#ifdef HAVE_KDE4
# include <KHelpMenu>
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);
#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()));
#else
_settingsMenu->addAction(coll->action("ConfigureShortcuts"));
#endif
+ _settingsMenu->addAction(coll->action("ChangePassword"));
_settingsMenu->addAction(coll->action("ConfigureQuassel"));
+
_helpMenu = menuBar()->addMenu(tr("&Help"));
_helpMenu->addAction(coll->action("AboutQuassel"));
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);
+ }
+}
+
void MainWin::changeActiveBufferView(bool backwards)
{