X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fnetworkssettingspage.h;h=db209a740f6eb096784f1463a8a5da04f6bea17e;hb=311aa7358cde02f4e0dd4a95f5e6a6c958cd76cf;hp=232c7f8a836e13846d66a44ad02dbf3b65d2d755;hpb=4493458caaa821deb69a0cddf13beb98394977bb;p=quassel.git diff --git a/src/qtui/settingspages/networkssettingspage.h b/src/qtui/settingspages/networkssettingspage.h index 232c7f8a..db209a74 100644 --- a/src/qtui/settingspages/networkssettingspage.h +++ b/src/qtui/settingspages/networkssettingspage.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel IRC Team * + * Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -27,6 +27,7 @@ #include "settingspage.h" #include "ui_networkssettingspage.h" +#include "ui_networkadddlg.h" #include "ui_networkeditdlg.h" #include "ui_servereditdlg.h" #include "ui_saveidentitiesdlg.h" @@ -34,64 +35,87 @@ class NetworksSettingsPage : public SettingsPage { Q_OBJECT - public: - NetworksSettingsPage(QWidget *parent = 0); +public: + NetworksSettingsPage(QWidget *parent = 0); - bool aboutToSave(); + virtual inline bool needsCoreConnection() const { return true; } - public slots: - void save(); - void load(); + bool aboutToSave(); - private slots: - void widgetHasChanged(); - void setWidgetStates(); - void coreConnectionStateChanged(bool); - void networkConnectionStateChanged(Network::ConnectionState state); - void networkConnectionError(const QString &msg); +public slots: + void save(); + void load(); - void displayNetwork(NetworkId); - void setItemState(NetworkId, QListWidgetItem *item = 0); +private slots: + void widgetHasChanged(); + void setWidgetStates(); + void coreConnectionStateChanged(bool); + void networkConnectionStateChanged(Network::ConnectionState state); + void networkConnectionError(const QString &msg); + + void displayNetwork(NetworkId); + void setItemState(NetworkId, QListWidgetItem *item = 0); + + void clientNetworkAdded(NetworkId); + void clientNetworkRemoved(NetworkId); + void clientNetworkUpdated(); + + void clientIdentityAdded(IdentityId); + void clientIdentityRemoved(IdentityId); + void clientIdentityUpdated(); + + void on_networkList_itemSelectionChanged(); + void on_addNetwork_clicked(); + void on_deleteNetwork_clicked(); + void on_renameNetwork_clicked(); + void on_editIdentities_clicked(); + + // void on_connectNow_clicked(); + + void on_serverList_itemSelectionChanged(); + void on_addServer_clicked(); + void on_deleteServer_clicked(); + void on_editServer_clicked(); + void on_upServer_clicked(); + void on_downServer_clicked(); - void clientNetworkAdded(NetworkId); - void clientNetworkRemoved(NetworkId); - void clientNetworkUpdated(); +private: + Ui::NetworksSettingsPage ui; - void clientIdentityAdded(IdentityId); - void clientIdentityRemoved(IdentityId); - void clientIdentityUpdated(); + NetworkId currentId; + QHash networkInfos; + bool _ignoreWidgetChanges; - void on_networkList_itemSelectionChanged(); - void on_addNetwork_clicked(); - void on_deleteNetwork_clicked(); - void on_renameNetwork_clicked(); + QPixmap connectedIcon, connectingIcon, disconnectedIcon; - void on_connectNow_clicked(); + void reset(); + bool testHasChanged(); + QListWidgetItem *insertNetwork(NetworkId); + QListWidgetItem *insertNetwork(const NetworkInfo &info); + QListWidgetItem *networkItem(NetworkId) const; + void saveToNetworkInfo(NetworkInfo &); + IdentityId defaultIdentity() const; +}; - void on_serverList_itemSelectionChanged(); - void on_addServer_clicked(); - void on_deleteServer_clicked(); - void on_editServer_clicked(); - void on_upServer_clicked(); - void on_downServer_clicked(); - private: - Ui::NetworksSettingsPage ui; +class NetworkAddDlg : public QDialog { + Q_OBJECT - NetworkId currentId; - QHash networkInfos; - bool _ignoreWidgetChanges; + public: + NetworkAddDlg(const QStringList &existing = QStringList(), QWidget *parent = 0); + + NetworkInfo networkInfo() const; + + private slots: + void setButtonStates(); - QPixmap connectedIcon, connectingIcon, disconnectedIcon; + private: + Ui::NetworkAddDlg ui; - void reset(); - bool testHasChanged(); - QListWidgetItem *insertNetwork(NetworkId); - QListWidgetItem *insertNetwork(const NetworkInfo &info); - QListWidgetItem *networkItem(NetworkId) const; - void saveToNetworkInfo(NetworkInfo &); + QStringList existing; }; + class NetworkEditDlg : public QDialog { Q_OBJECT @@ -110,7 +134,6 @@ class NetworkEditDlg : public QDialog { }; - class ServerEditDlg : public QDialog { Q_OBJECT