X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fnetworkssettingspage.h;h=db209a740f6eb096784f1463a8a5da04f6bea17e;hb=f8275c3b697f1ee43d93bb4e5e688e87ca0405ce;hp=00c4532a23a858348e5da92e0fb9016ddc59b573;hpb=ddfd94072cc44fcbae497e5a962b9e50579b2026;p=quassel.git diff --git a/src/qtui/settingspages/networkssettingspage.h b/src/qtui/settingspages/networkssettingspage.h index 00c4532a..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 * @@ -18,66 +18,109 @@ * 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_networkeditdlgnew.h" -#include "network.h" -#include "types.h" +#include "ui_networkssettingspage.h" +#include "ui_networkadddlg.h" +#include "ui_networkeditdlg.h" +#include "ui_servereditdlg.h" +#include "ui_saveidentitiesdlg.h" 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); +public slots: + void save(); + void load(); - void displayNetwork(NetworkId, bool dontsave = false); +private slots: + void widgetHasChanged(); + void setWidgetStates(); + void coreConnectionStateChanged(bool); + void networkConnectionStateChanged(Network::ConnectionState state); + void networkConnectionError(const QString &msg); - void clientNetworkAdded(NetworkId); - void clientNetworkUpdated(); + void displayNetwork(NetworkId); + void setItemState(NetworkId, QListWidgetItem *item = 0); - void clientIdentityAdded(IdentityId); - void clientIdentityRemoved(IdentityId); - void clientIdentityUpdated(); + void clientNetworkAdded(NetworkId); + void clientNetworkRemoved(NetworkId); + void clientNetworkUpdated(); - void on_networkList_itemSelectionChanged(); - void on_addNetwork_clicked(); + void clientIdentityAdded(IdentityId); + void clientIdentityRemoved(IdentityId); + void clientIdentityUpdated(); - private: - Ui::NetworksSettingsPage ui; + 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(); - NetworkId currentId; - QHash networkInfos; +private: + Ui::NetworksSettingsPage ui; - QIcon connectedIcon, disconnectedIcon; + NetworkId currentId; + QHash networkInfos; + bool _ignoreWidgetChanges; - void reset(); - bool testHasChanged(); - void insertNetwork(NetworkId); - QListWidgetItem *networkItem(NetworkId) const; + QPixmap connectedIcon, connectingIcon, disconnectedIcon; + + void reset(); + bool testHasChanged(); + QListWidgetItem *insertNetwork(NetworkId); + QListWidgetItem *insertNetwork(const NetworkInfo &info); + QListWidgetItem *networkItem(NetworkId) const; + void saveToNetworkInfo(NetworkInfo &); + IdentityId defaultIdentity() const; }; -class NetworkEditDlgNew : public QDialog { + +class NetworkAddDlg : public QDialog { Q_OBJECT public: - NetworkEditDlgNew(const QString &old, const QStringList &existing = QStringList(), QWidget *parent = 0); + 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 + + public: + NetworkEditDlg(const QString &old, const QStringList &existing = QStringList(), QWidget *parent = 0); QString networkName() const; @@ -85,25 +128,41 @@ class NetworkEditDlgNew : public QDialog { void on_networkEdit_textChanged(const QString &); private: - Ui::NetworkEditDlgNew ui; + Ui::NetworkEditDlg ui; QStringList existing; }; +class ServerEditDlg : public QDialog { + Q_OBJECT + +public: + ServerEditDlg(const Network::Server &server = Network::Server(), QWidget *parent = 0); + + Network::Server serverData() const; -class ServerEditDlgNew : public QDialog { +private slots: + void on_host_textChanged(); + +private: + Ui::ServerEditDlg ui; +}; + + +class SaveNetworksDlg : public QDialog { Q_OBJECT public: - ServerEditDlgNew(const QVariantMap &serverData = QVariantMap(), QWidget *parent = 0); + SaveNetworksDlg(const QList &toCreate, const QList &toUpdate, const QList &toRemove, QWidget *parent = 0); - QVariantMap serverData() const; + private slots: + void clientEvent(); private: - QVariantMap _serverData; -}; - + Ui::SaveIdentitiesDlg ui; + int numevents, rcvevents; +}; #endif