projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
modernize: Use override instead of virtual
[quassel.git]
/
src
/
uisupport
/
networkmodelcontroller.cpp
diff --git
a/src/uisupport/networkmodelcontroller.cpp
b/src/uisupport/networkmodelcontroller.cpp
index
6d2409f
..
69797bc
100644
(file)
--- a/
src/uisupport/networkmodelcontroller.cpp
+++ b/
src/uisupport/networkmodelcontroller.cpp
@@
-1,5
+1,5
@@
/***************************************************************************
/***************************************************************************
- * Copyright (C) 2005-201
6
by the Quassel Project *
+ * Copyright (C) 2005-201
8
by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-18,6
+18,8
@@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
+#include "networkmodelcontroller.h"
+
#include <QComboBox>
#include <QDialogButtonBox>
#include <QGridLayout>
#include <QComboBox>
#include <QDialogButtonBox>
#include <QGridLayout>
@@
-28,21
+30,20
@@
#include <QMessageBox>
#include <QPushButton>
#include <QMessageBox>
#include <QPushButton>
-#include "networkmodelcontroller.h"
-
#include "buffermodel.h"
#include "buffersettings.h"
#include "buffermodel.h"
#include "buffersettings.h"
+#include "client.h"
#include "clientidentity.h"
#include "clientidentity.h"
+#include "clientignorelistmanager.h"
+#include "icon.h"
#include "network.h"
#include "util.h"
#include "network.h"
#include "util.h"
-#include "clientignorelistmanager.h"
-#include "client.h"
NetworkModelController::NetworkModelController(QObject *parent)
: QObject(parent),
_actionCollection(new ActionCollection(this)),
NetworkModelController::NetworkModelController(QObject *parent)
: QObject(parent),
_actionCollection(new ActionCollection(this)),
- _messageFilter(
0
),
- _receiver(
0
)
+ _messageFilter(
nullptr
),
+ _receiver(
nullptr
)
{
connect(_actionCollection, SIGNAL(actionTriggered(QAction *)), SLOT(actionTriggered(QAction *)));
}
{
connect(_actionCollection, SIGNAL(actionTriggered(QAction *)), SLOT(actionTriggered(QAction *)));
}
@@
-174,7
+175,7
@@
void NetworkModelController::removeBuffers(const QModelIndexList &indexList)
}
QString msg;
if (inactive.count()) {
}
QString msg;
if (inactive.count()) {
- msg = tr("Do you want to delete the following buffer(s) permanently?",
0
, inactive.count());
+ msg = tr("Do you want to delete the following buffer(s) permanently?",
""
, inactive.count());
msg += "<ul>";
int count = 0;
foreach(BufferInfo info, inactive) {
msg += "<ul>";
int count = 0;
foreach(BufferInfo info, inactive) {
@@
-192,7
+193,7
@@
void NetworkModelController::removeBuffers(const QModelIndexList &indexList)
if (inactive.count() != indexList.count())
msg += tr("<br>Active channel buffers cannot be deleted, please part the channel first.");
if (inactive.count() != indexList.count())
msg += tr("<br>Active channel buffers cannot be deleted, please part the channel first.");
- if (QMessageBox::question(
0
, tr("Remove buffers permanently?"), msg, QMessageBox::Yes|QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) {
+ if (QMessageBox::question(
nullptr
, tr("Remove buffers permanently?"), msg, QMessageBox::Yes|QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) {
foreach(BufferInfo info, inactive)
Client::removeBuffer(info.bufferId());
}
foreach(BufferInfo info, inactive)
Client::removeBuffer(info.bufferId());
}
@@
-237,9
+238,9
@@
void NetworkModelController::actionTriggered(QAction *action)
void NetworkModelController::handleNetworkAction(ActionType type, QAction *)
{
if (type == NetworkConnectAllWithDropdown || type == NetworkDisconnectAllWithDropdown || type == NetworkConnectAll || type == NetworkDisconnectAll) {
void NetworkModelController::handleNetworkAction(ActionType type, QAction *)
{
if (type == NetworkConnectAllWithDropdown || type == NetworkDisconnectAllWithDropdown || type == NetworkConnectAll || type == NetworkDisconnectAll) {
- if (type == NetworkConnectAllWithDropdown && QMessageBox::question(
0
, tr("Question"), tr("Really Connect to all IRC Networks?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No)
+ if (type == NetworkConnectAllWithDropdown && QMessageBox::question(
nullptr
, tr("Question"), tr("Really Connect to all IRC Networks?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No)
return;
return;
- if (type == NetworkDisconnectAllWithDropdown && QMessageBox::question(
0
, tr("Question"), tr("Really disconnect from all IRC Networks?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No)
+ if (type == NetworkDisconnectAllWithDropdown && QMessageBox::question(
nullptr
, tr("Question"), tr("Really disconnect from all IRC Networks?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No)
return;
foreach(NetworkId id, Client::networkIds()) {
const Network *net = Client::network(id);
return;
foreach(NetworkId id, Client::networkIds()) {
const Network *net = Client::network(id);
@@
-362,7
+363,7
@@
void NetworkModelController::handleHideAction(ActionType type, QAction *action)
return;
case HideApplyToAll:
BufferSettings().setMessageFilter(filter);
return;
case HideApplyToAll:
BufferSettings().setMessageFilter(filter);
- [[clang::fallthrough]];
+ // fallthrough
case HideUseDefaults:
if (_messageFilter)
BufferSettings(_messageFilter->idString()).removeFilter();
case HideUseDefaults:
if (_messageFilter)
BufferSettings(_messageFilter->idString()).removeFilter();
@@
-411,8
+412,14
@@
void NetworkModelController::handleGeneralAction(ActionType type, QAction *actio
break;
}
case ShowChannelList:
break;
}
case ShowChannelList:
+ if (networkId.isValid()) {
+ // Don't immediately list channels, allowing customization of filter first
+ emit showChannelList(networkId, {}, false);
+ }
+ break;
+ case ShowNetworkConfig:
if (networkId.isValid())
if (networkId.isValid())
- emit show
ChannelList
(networkId);
+ emit show
NetworkConfig
(networkId);
break;
case ShowIgnoreList:
if (networkId.isValid())
break;
case ShowIgnoreList:
if (networkId.isValid())
@@
-545,7
+552,7
@@
void NetworkModelController::handleNickAction(ActionType type, QAction *action)
NetworkModelController::JoinDlg::JoinDlg(const QModelIndex &index, QWidget *parent) : QDialog(parent)
{
NetworkModelController::JoinDlg::JoinDlg(const QModelIndex &index, QWidget *parent) : QDialog(parent)
{
- setWindowIcon(
QIcon::fromTheme
("irc-join-channel"));
+ setWindowIcon(
icon::get
("irc-join-channel"));
setWindowTitle(tr("Join Channel"));
QGridLayout *layout = new QGridLayout(this);
setWindowTitle(tr("Join Channel"));
QGridLayout *layout = new QGridLayout(this);