X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Fnetworkmodelcontroller.cpp;h=10807d91b89d8b50771632de3e5aa04c66cdbab8;hb=78b9ceaa30c504f2a606eaa4502f1d4cff556d31;hp=a8946ede102e454f90b894571ed00ef25ca11481;hpb=eaa1bd30bc088e5cae6d8a742d7aedb3d8ff1897;p=quassel.git diff --git a/src/uisupport/networkmodelcontroller.cpp b/src/uisupport/networkmodelcontroller.cpp index a8946ede..10807d91 100644 --- a/src/uisupport/networkmodelcontroller.cpp +++ b/src/uisupport/networkmodelcontroller.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -236,12 +236,16 @@ void NetworkModelController::actionTriggered(QAction *action) void NetworkModelController::handleNetworkAction(ActionType type, QAction *) { - if (type == NetworkConnectAll || type == NetworkDisconnectAll) { + 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) + return; + if (type == NetworkDisconnectAllWithDropdown && QMessageBox::question(0, 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); - if (type == NetworkConnectAll && net->connectionState() == Network::Disconnected) + if ((type == NetworkConnectAllWithDropdown || type == NetworkConnectAll) && net->connectionState() == Network::Disconnected) net->requestConnect(); - if (type == NetworkDisconnectAll && net->connectionState() != Network::Disconnected) + if ((type == NetworkDisconnectAllWithDropdown || type == NetworkDisconnectAll) && net->connectionState() != Network::Disconnected) net->requestDisconnect(); } return; @@ -358,6 +362,7 @@ void NetworkModelController::handleHideAction(ActionType type, QAction *action) return; case HideApplyToAll: BufferSettings().setMessageFilter(filter); + [[clang::fallthrough]]; case HideUseDefaults: if (_messageFilter) BufferSettings(_messageFilter->idString()).removeFilter(); @@ -409,6 +414,10 @@ void NetworkModelController::handleGeneralAction(ActionType type, QAction *actio if (networkId.isValid()) emit showChannelList(networkId); break; + case ShowNetworkConfig: + if (networkId.isValid()) + emit showNetworkConfig(networkId); + break; case ShowIgnoreList: if (networkId.isValid()) emit showIgnoreList(QString());