/***************************************************************************
- * Copyright (C) 2005-2016 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 *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
+#include "networkmodelcontroller.h"
+
#include <QComboBox>
#include <QDialogButtonBox>
#include <QGridLayout>
#include <QMessageBox>
#include <QPushButton>
-#include "networkmodelcontroller.h"
-
#include "buffermodel.h"
#include "buffersettings.h"
+#include "client.h"
#include "clientidentity.h"
+#include "clientignorelistmanager.h"
+#include "icon.h"
#include "network.h"
#include "util.h"
-#include "clientignorelistmanager.h"
-#include "client.h"
NetworkModelController::NetworkModelController(QObject *parent)
: QObject(parent),
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)
+ 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 == NetworkConnectAllWithDropdown || type == NetworkConnectAll) && net->connectionState() == Network::Disconnected)
return;
case HideApplyToAll:
BufferSettings().setMessageFilter(filter);
+ [[clang::fallthrough]];
case HideUseDefaults:
if (_messageFilter)
BufferSettings(_messageFilter->idString()).removeFilter();
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())
- emit showChannelList(networkId);
+ emit showNetworkConfig(networkId);
break;
case ShowIgnoreList:
if (networkId.isValid())
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);