X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fnetworkmodelcontroller.cpp;h=a8946ede102e454f90b894571ed00ef25ca11481;hp=1259b6ae62d077092142df192959f6d0fcff0266;hb=ea81b32f0a4fdc203eb30e8327acde58de153179;hpb=9fc57dc2c000e80fb8bd746a090e2e8210e1278e diff --git a/src/uisupport/networkmodelcontroller.cpp b/src/uisupport/networkmodelcontroller.cpp index 1259b6ae..a8946ede 100644 --- a/src/uisupport/networkmodelcontroller.cpp +++ b/src/uisupport/networkmodelcontroller.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2013 by the Quassel Project * + * Copyright (C) 2005-2015 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -31,7 +32,6 @@ #include "buffermodel.h" #include "buffersettings.h" -#include "iconloader.h" #include "clientidentity.h" #include "network.h" #include "util.h" @@ -59,7 +59,7 @@ Action *NetworkModelController::registerAction(ActionType type, const QString &t } -Action *NetworkModelController::registerAction(ActionType type, const QPixmap &icon, const QString &text, bool checkable) +Action *NetworkModelController::registerAction(ActionType type, const QIcon &icon, const QString &text, bool checkable) { Action *act; if (icon.isNull()) @@ -307,6 +307,19 @@ void NetworkModelController::handleHideAction(ActionType type, QAction *action) { Q_UNUSED(action) + if (type == HideJoinPartQuit) { + bool anyChecked = NetworkModelController::action(HideJoin)->isChecked(); + anyChecked |= NetworkModelController::action(HidePart)->isChecked(); + anyChecked |= NetworkModelController::action(HideQuit)->isChecked(); + + // If any are checked, uncheck them all. + // If none are checked, check them all. + bool newCheckedState = !anyChecked; + NetworkModelController::action(HideJoin)->setChecked(newCheckedState); + NetworkModelController::action(HidePart)->setChecked(newCheckedState); + NetworkModelController::action(HideQuit)->setChecked(newCheckedState); + } + int filter = 0; if (NetworkModelController::action(HideJoin)->isChecked()) filter |= Message::Join | Message::NetsplitJoin; @@ -324,6 +337,7 @@ void NetworkModelController::handleHideAction(ActionType type, QAction *action) filter |= Message::Topic; switch (type) { + case HideJoinPartQuit: case HideJoin: case HidePart: case HideQuit: @@ -526,7 +540,7 @@ void NetworkModelController::handleNickAction(ActionType type, QAction *action) NetworkModelController::JoinDlg::JoinDlg(const QModelIndex &index, QWidget *parent) : QDialog(parent) { - setWindowIcon(SmallIcon("irc-join-channel")); + setWindowIcon(QIcon::fromTheme("irc-join-channel")); setWindowTitle(tr("Join Channel")); QGridLayout *layout = new QGridLayout(this);