X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fnetworkssettingspage.h;h=bafc6456be7c55a885b3c435d436cd50cb835cdb;hp=bb6499f0841b37dbdc19ff1dfcd6d40a43d47e9e;hb=da86ee7178494e6e5404887ddac98d5e107cc747;hpb=48ed2b53aeb10bcbda6cdc46696bf649c0f6e670 diff --git a/src/qtui/settingspages/networkssettingspage.h b/src/qtui/settingspages/networkssettingspage.h index bb6499f0..bafc6456 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 * @@ -18,80 +18,101 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _NETWORKSSETTINGSPAGE_H_ -#define _NETWORKSSETTINGSPAGE_H_ +#ifndef NETWORKSSETTINGSPAGE_H +#define NETWORKSSETTINGSPAGE_H -#include +#include +#include "network.h" #include "settingspage.h" + #include "ui_networkssettingspage.h" +#include "ui_networkadddlg.h" #include "ui_networkeditdlg.h" #include "ui_servereditdlg.h" #include "ui_saveidentitiesdlg.h" -#include "network.h" -#include "types.h" - class NetworksSettingsPage : public SettingsPage { Q_OBJECT - public: - NetworksSettingsPage(QWidget *parent = 0); +public: + NetworksSettingsPage(QWidget *parent = 0); - bool aboutToSave(); + bool aboutToSave(); - public slots: - void save(); - void load(); +public slots: + void save(); + void load(); - private slots: - void widgetHasChanged(); - void setWidgetStates(); - void coreConnectionStateChanged(bool); - void networkConnectionStateChanged(Network::ConnectionState state); - void networkConnectionError(const QString &msg); +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 displayNetwork(NetworkId); + void setItemState(NetworkId, QListWidgetItem *item = 0); - void clientNetworkAdded(NetworkId); - void clientNetworkRemoved(NetworkId); - void clientNetworkUpdated(); + void clientNetworkAdded(NetworkId); + void clientNetworkRemoved(NetworkId); + void clientNetworkUpdated(); - void clientIdentityAdded(IdentityId); - void clientIdentityRemoved(IdentityId); - void clientIdentityUpdated(); + 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_networkList_itemSelectionChanged(); + void on_addNetwork_clicked(); + void on_deleteNetwork_clicked(); + void on_renameNetwork_clicked(); + void on_editIdentities_clicked(); - void on_connectNow_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 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; +private: + Ui::NetworksSettingsPage ui; - NetworkId currentId; - QHash networkInfos; + NetworkId currentId; + QHash networkInfos; + bool _ignoreWidgetChanges; - QIcon connectedIcon, connectingIcon, disconnectedIcon; + QPixmap connectedIcon, connectingIcon, disconnectedIcon; - void reset(); - bool testHasChanged(); - QListWidgetItem *insertNetwork(NetworkId); - QListWidgetItem *insertNetwork(const NetworkInfo &info); - QListWidgetItem *networkItem(NetworkId) const; - void saveToNetworkInfo(NetworkInfo &); + void reset(); + bool testHasChanged(); + QListWidgetItem *insertNetwork(NetworkId); + QListWidgetItem *insertNetwork(const NetworkInfo &info); + QListWidgetItem *networkItem(NetworkId) const; + void saveToNetworkInfo(NetworkInfo &); }; + +class NetworkAddDlg : public QDialog { + Q_OBJECT + + public: + NetworkAddDlg(const QStringList &existing = QStringList(), QWidget *parent = 0); + + NetworkInfo networkInfo() const; + + private slots: + void setButtonStates(); + + private: + Ui::NetworkAddDlg ui; + + QStringList existing; +}; + + class NetworkEditDlg : public QDialog { Q_OBJECT @@ -110,20 +131,19 @@ class NetworkEditDlg : public QDialog { }; - class ServerEditDlg : public QDialog { Q_OBJECT - public: - ServerEditDlg(const QVariant &serverData = QVariant(), QWidget *parent = 0); +public: + ServerEditDlg(const Network::Server &server = Network::Server(), QWidget *parent = 0); - QVariant serverData() const; + Network::Server serverData() const; - private slots: - void on_host_textChanged(); +private slots: + void on_host_textChanged(); - private: - Ui::ServerEditDlg ui; +private: + Ui::ServerEditDlg ui; };