#endif
_msgProcessorStatusWidget(new MsgProcessorStatusWidget(this)),
_coreConnectionStatusWidget(new CoreConnectionStatusWidget(Client::coreConnection(), this)),
#endif
_msgProcessorStatusWidget(new MsgProcessorStatusWidget(this)),
_coreConnectionStatusWidget(new CoreConnectionStatusWidget(Client::coreConnection(), this)),
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)));
#ifndef HAVE_KDE
# ifdef HAVE_QTMULTIMEDIA
QtUi::registerNotificationBackend(new QtMultimediaNotificationBackend(this));
#ifndef HAVE_KDE
# ifdef HAVE_QTMULTIMEDIA
QtUi::registerNotificationBackend(new QtMultimediaNotificationBackend(this));
// 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,
connect(lockAct, SIGNAL(toggled(bool)), SLOT(on_actionLockLayout_toggled(bool)));
coll->addAction("ToggleSearchBar", new Action(icon::get("edit-find"), tr("Show &Search Bar"), coll,
connect(lockAct, SIGNAL(toggled(bool)), SLOT(on_actionLockLayout_toggled(bool)));
coll->addAction("ToggleSearchBar", new Action(icon::get("edit-find"), tr("Show &Search Bar"), coll,
coll->addAction("ShowAwayLog", new Action(tr("Show Away Log"), coll,
this, SLOT(showAwayLog())));
coll->addAction("ToggleMenuBar", new Action(icon::get("show-menu"), tr("Show &Menubar"), coll,
coll->addAction("ShowAwayLog", new Action(tr("Show Away Log"), coll,
this, SLOT(showAwayLog())));
coll->addAction("ToggleMenuBar", new Action(icon::get("show-menu"), tr("Show &Menubar"), coll,
coll->addAction("ToggleStatusBar", new Action(tr("Show Status &Bar"), coll,
coll->addAction("ToggleStatusBar", new Action(tr("Show Status &Bar"), coll,
#ifdef HAVE_KDE
_fullScreenAction = KStandardAction::fullScreen(this, SLOT(onFullScreenToggled()), this, coll);
#ifdef HAVE_KDE
_fullScreenAction = KStandardAction::fullScreen(this, SLOT(onFullScreenToggled()), this, coll);
this, SLOT(on_actionDebugHotList_triggered())));
coll->addAction("DebugLog", new Action(icon::get("tools-report-bug"), tr("Debug &Log"), coll,
this, SLOT(on_actionDebugLog_triggered())));
this, SLOT(on_actionDebugHotList_triggered())));
coll->addAction("DebugLog", new Action(icon::get("tools-report-bug"), tr("Debug &Log"), coll,
this, SLOT(on_actionDebugLog_triggered())));
+ coll->addAction("ShowResourceTree", new Action(icon::get("tools-report-bug"), tr("Show &Resource Tree"), coll,
+ this, SLOT(on_actionShowResourceTree_triggered())));
coll->addAction("ReloadStyle", new Action(icon::get("view-refresh"), tr("Reload Stylesheet"), coll,
QtUi::style(), SLOT(reload()), QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_R)));
coll->addAction("ReloadStyle", new Action(icon::get("view-refresh"), tr("Reload Stylesheet"), coll,
QtUi::style(), SLOT(reload()), QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_R)));
_helpDebugMenu->addAction(coll->action("DebugMessageModel"));
_helpDebugMenu->addAction(coll->action("DebugHotList"));
_helpDebugMenu->addAction(coll->action("DebugLog"));
_helpDebugMenu->addAction(coll->action("DebugMessageModel"));
_helpDebugMenu->addAction(coll->action("DebugHotList"));
_helpDebugMenu->addAction(coll->action("DebugLog"));
// "All Buffers" is always the first dock created
if (_bufferViews.count() > 0)
return _bufferViews[0]->bufferView();
// "All Buffers" is always the first dock created
if (_bufferViews.count() > 0)
return _bufferViews[0]->bufferView();
}
BufferView *MainWin::activeBufferView() const
{
if (_activeBufferViewIndex < 0 || _activeBufferViewIndex >= _bufferViews.count())
}
BufferView *MainWin::activeBufferView() const
{
if (_activeBufferViewIndex < 0 || _activeBufferViewIndex >= _bufferViews.count())
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);
filter->setParent(_awayLog);
connect(_awayLog, SIGNAL(destroyed()), this, SLOT(awayLogDestroyed()));
_awayLog->setAttribute(Qt::WA_DeleteOnClose);
filter->setParent(_awayLog);
connect(_awayLog, SIGNAL(destroyed()), this, SLOT(awayLogDestroyed()));
_awayLog->setAttribute(Qt::WA_DeleteOnClose);
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
for (int i = start; i <= end; i++) {
QModelIndex idx = Client::messageModel()->index(i, ChatLineModel::ContentsColumn);
for (int i = start; i <= end; i++) {
QModelIndex idx = Client::messageModel()->index(i, ChatLineModel::ContentsColumn);
connect(net, SIGNAL(updatedRemotely()), this, SLOT(clientNetworkUpdated()));
connect(act, SIGNAL(triggered()), this, SLOT(connectOrDisconnectFromNet()));
connect(net, SIGNAL(updatedRemotely()), this, SLOT(clientNetworkUpdated()));
connect(act, SIGNAL(triggered()), this, SLOT(connectOrDisconnectFromNet()));
foreach(QAction *action, _networksMenu->actions()) {
if (!action->data().isValid()) // ignore stock actions
continue;
foreach(QAction *action, _networksMenu->actions()) {
if (!action->data().isValid()) // ignore stock actions
continue;
DebugMessageModelFilter *filter = new DebugMessageModelFilter(view);
filter->setSourceModel(Client::messageModel());
view->setModel(filter);
DebugMessageModelFilter *filter = new DebugMessageModelFilter(view);
filter->setSourceModel(Client::messageModel());
view->setModel(filter);