connect(Client::messageModel(), SIGNAL(rowsInserted(const QModelIndex &, int, int)),
SLOT(messagesInserted(const QModelIndex &, int, int)));
connect(GraphicalUi::contextMenuActionProvider(),
connect(Client::messageModel(), SIGNAL(rowsInserted(const QModelIndex &, int, int)),
SLOT(messagesInserted(const QModelIndex &, int, int)));
connect(GraphicalUi::contextMenuActionProvider(),
- SIGNAL(showChannelList(NetworkId, const QString &)),
- SLOT(showChannelList(NetworkId, const QString &)));
+ SIGNAL(showChannelList(NetworkId,QString,bool)),
+ SLOT(showChannelList(NetworkId,QString,bool)));
- SIGNAL(showChannelList(NetworkId, const QString &)),
- SLOT(showChannelList(NetworkId, const QString &)));
+ SIGNAL(showChannelList(NetworkId,QString,bool)),
+ SLOT(showChannelList(NetworkId,QString,bool)));
connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showNetworkConfig(NetworkId)), SLOT(showNetworkConfig(NetworkId)));
connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showIgnoreList(QString)), SLOT(showIgnoreList(QString)));
connect(Client::instance(), SIGNAL(showIgnoreList(QString)), SLOT(showIgnoreList(QString)));
connect(Client::instance(), SIGNAL(dbUpgradeInProgress(bool)), SLOT(showMigrationWarning(bool)));
connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showNetworkConfig(NetworkId)), SLOT(showNetworkConfig(NetworkId)));
connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showIgnoreList(QString)), SLOT(showIgnoreList(QString)));
connect(Client::instance(), SIGNAL(showIgnoreList(QString)), SLOT(showIgnoreList(QString)));
connect(Client::instance(), SIGNAL(dbUpgradeInProgress(bool)), SLOT(showMigrationWarning(bool)));
connect(Client::coreConnection(), SIGNAL(startCoreSetup(QVariantList, QVariantList)), SLOT(showCoreConfigWizard(QVariantList, QVariantList)));
connect(Client::coreConnection(), SIGNAL(connectionErrorPopup(QString)), SLOT(handleCoreConnectionError(QString)));
connect(Client::coreConnection(), SIGNAL(startCoreSetup(QVariantList, QVariantList)), SLOT(showCoreConfigWizard(QVariantList, QVariantList)));
connect(Client::coreConnection(), SIGNAL(connectionErrorPopup(QString)), SLOT(handleCoreConnectionError(QString)));
// restore locked state of docks
QtUi::actionCollection("General")->action("LockLayout")->setChecked(s.value("LockLayout", false).toBool());
// restore locked state of docks
QtUi::actionCollection("General")->action("LockLayout")->setChecked(s.value("LockLayout", false).toBool());
- QTimer::singleShot(0, this, SLOT(doAutoConnect()));
-}
-
-
-MainWin::~MainWin()
-{
-}
-
+ Quassel::registerQuitHandler([this]() {
+ QtUiSettings s;
+ saveStateToSettings(s);
+ saveLayout();
+ // Close all open dialogs and the MainWin, so we can safely kill the Client instance afterwards
+ // Note: This does not quit the application, as quitOnLastWindowClosed is set to false.
+ // We rely on another quit handler to be registered that actually quits the application.
+ qApp->closeAllWindows();
+ });
//
// See https://doc.qt.io/qt-5/qkeysequence.html
coll->addAction("Quit", new Action(icon::get("application-exit"), tr("&Quit"), coll,
//
// See https://doc.qt.io/qt-5/qkeysequence.html
coll->addAction("Quit", new Action(icon::get("application-exit"), tr("&Quit"), coll,
// View
coll->addAction("ConfigureBufferViews", new Action(tr("&Configure Chat Lists..."), coll,
// View
coll->addAction("ConfigureBufferViews", new Action(tr("&Configure Chat Lists..."), coll,
void MainWin::showPasswordChangeDlg()
{
if(Client::isCoreFeatureEnabled(Quassel::Feature::PasswordChange)) {
void MainWin::showPasswordChangeDlg()
{
if(Client::isCoreFeatureEnabled(Quassel::Feature::PasswordChange)) {
}
else {
QMessageBox box(QMessageBox::Warning, tr("Feature Not Supported"),
tr("<b>Your Quassel Core does not support this feature</b>"),
}
else {
QMessageBox box(QMessageBox::Warning, tr("Feature Not Supported"),
tr("<b>Your Quassel Core does not support this feature</b>"),
+void MainWin::onExitRequested(const QString &reason)
+{
+ if (!reason.isEmpty()) {
+ QMessageBox box(QMessageBox::Critical,
+ tr("Fatal error"),
+ "<b>" + tr("Quassel encountered a fatal error and is terminated.") + "</b>",
+ QMessageBox::Ok);
+ box.setInformativeText("<p>" + tr("Reason:<em>") + " " + reason + "</em>");
+ box.exec();
+ }
+}
+
+
void MainWin::changeActiveBufferView(bool backwards)
{
if (_activeBufferViewIndex >= 0 && _activeBufferViewIndex < _bufferViews.count()) {
void MainWin::changeActiveBufferView(bool backwards)
{
if (_activeBufferViewIndex >= 0 && _activeBufferViewIndex < _bufferViews.count()) {
void MainWin::userAuthenticationRequired(CoreAccount *account, bool *valid, const QString &errorMessage)
{
Q_UNUSED(errorMessage)
void MainWin::userAuthenticationRequired(CoreAccount *account, bool *valid, const QString &errorMessage)
{
Q_UNUSED(errorMessage)
void MainWin::handleNoSslInClient(bool *accepted)
{
QMessageBox box(QMessageBox::Warning, tr("Unencrypted Connection"), tr("<b>Your client does not support SSL encryption</b>"),
void MainWin::handleNoSslInClient(bool *accepted)
{
QMessageBox box(QMessageBox::Warning, tr("Unencrypted Connection"), tr("<b>Your client does not support SSL encryption</b>"),
box.setInformativeText(tr("Sensitive data, like passwords, will be transmitted unencrypted to your Quassel core."));
box.setDefaultButton(QMessageBox::Ignore);
*accepted = box.exec() == QMessageBox::Ignore;
box.setInformativeText(tr("Sensitive data, like passwords, will be transmitted unencrypted to your Quassel core."));
box.setDefaultButton(QMessageBox::Ignore);
*accepted = box.exec() == QMessageBox::Ignore;
void MainWin::handleNoSslInCore(bool *accepted)
{
QMessageBox box(QMessageBox::Warning, tr("Unencrypted Connection"), tr("<b>Your core does not support SSL encryption</b>"),
void MainWin::handleNoSslInCore(bool *accepted)
{
QMessageBox box(QMessageBox::Warning, tr("Unencrypted Connection"), tr("<b>Your core does not support SSL encryption</b>"),
box.setInformativeText(tr("Sensitive data, like passwords, will be transmitted unencrypted to your Quassel core."));
box.setDefaultButton(QMessageBox::Ignore);
*accepted = box.exec() == QMessageBox::Ignore;
box.setInformativeText(tr("Sensitive data, like passwords, will be transmitted unencrypted to your Quassel core."));
box.setDefaultButton(QMessageBox::Ignore);
*accepted = box.exec() == QMessageBox::Ignore;
QMessageBox box(QMessageBox::Warning,
tr("Untrusted Security Certificate"),
tr("<b>The SSL certificate provided by the core at %1 is untrusted for the following reasons:</b>").arg(socket->peerName()),
QMessageBox box(QMessageBox::Warning,
tr("Untrusted Security Certificate"),
tr("<b>The SSL certificate provided by the core at %1 is untrusted for the following reasons:</b>").arg(socket->peerName()),
box.setInformativeText(errorString);
box.addButton(tr("Continue"), QMessageBox::AcceptRole);
box.setDefaultButton(box.addButton(tr("Show Certificate"), QMessageBox::HelpRole));
box.setInformativeText(errorString);
box.addButton(tr("Continue"), QMessageBox::AcceptRole);
box.setDefaultButton(box.addButton(tr("Show Certificate"), QMessageBox::HelpRole));
QMessageBox box2(QMessageBox::Warning,
tr("Untrusted Security Certificate"),
tr("Would you like to accept this certificate forever without being prompted?"),
QMessageBox box2(QMessageBox::Warning,
tr("Untrusted Security Certificate"),
tr("Would you like to accept this certificate forever without being prompted?"),
box2.setDefaultButton(box2.addButton(tr("Current Session Only"), QMessageBox::NoRole));
box2.addButton(tr("Forever"), QMessageBox::YesRole);
box2.exec();
box2.setDefaultButton(box2.addButton(tr("Current Session Only"), QMessageBox::NoRole));
box2.addButton(tr("Forever"), QMessageBox::YesRole);
box2.exec();
// on the client homescreen when no networks are connected.
QMessageBox box(QMessageBox::Information, tr("No network selected"),
QString("<b>%1</b>").arg(tr("No network selected")),
// on the client homescreen when no networks are connected.
QMessageBox box(QMessageBox::Information, tr("No network selected"),
QString("<b>%1</b>").arg(tr("No network selected")),
channelListDlg->setAttribute(Qt::WA_DeleteOnClose);
channelListDlg->setNetwork(netId);
if (!channelFilters.isEmpty()) {
channelListDlg->setChannelFilters(channelFilters);
}
channelListDlg->setAttribute(Qt::WA_DeleteOnClose);
channelListDlg->setNetwork(netId);
if (!channelFilters.isEmpty()) {
channelListDlg->setChannelFilters(channelFilters);
}
// prepare config dialog for new rule
if (!newRule.isEmpty())
qobject_cast<IgnoreListSettingsPage *>(dlg.currentPage())->editIgnoreRule(newRule);
// prepare config dialog for new rule
if (!newRule.isEmpty())
qobject_cast<IgnoreListSettingsPage *>(dlg.currentPage())->editIgnoreRule(newRule);
foreach(KActionCollection *coll, QtUi::actionCollections())
dlg.addCollection(coll, coll->property("Category").toString());
dlg.configure(true);
#else
foreach(KActionCollection *coll, QtUi::actionCollections())
dlg.addCollection(coll, coll->property("Category").toString());
dlg.configure(true);
#else