X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fnetworkssettingspage.h;h=095e9964a5c921ea8560168fc75c1069c9a1455b;hp=c337325f558223ca61bd70905b17542c970285b8;hb=a65f42197839da536975b3e2858eedcef420035f;hpb=4a5065255e652dd0c301bac0db41b7afb777ef49 diff --git a/src/qtui/settingspages/networkssettingspage.h b/src/qtui/settingspages/networkssettingspage.h index c337325f..095e9964 100644 --- a/src/qtui/settingspages/networkssettingspage.h +++ b/src/qtui/settingspages/networkssettingspage.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2013 by the Quassel Project * + * Copyright (C) 2005-2019 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -21,10 +21,11 @@ #ifndef NETWORKSSETTINGSPAGE_H #define NETWORKSSETTINGSPAGE_H -#include +#include #include "network.h" #include "settingspage.h" +#include "clientidentity.h" #include "ui_networkssettingspage.h" #include "ui_networkadddlg.h" @@ -46,6 +47,7 @@ public: public slots: void save(); void load(); + void bufferList_Open(NetworkId); private slots: void widgetHasChanged(); @@ -57,6 +59,26 @@ private slots: void displayNetwork(NetworkId); void setItemState(NetworkId, QListWidgetItem *item = 0); + /** + * Reset the capability-dependent settings to the default unknown states + * + * For example, this updates the SASL text to indicate the status is unknown. Any actual + * information should be set by setNetworkCapStates() + * + * @see NetworksSettingsPage::setNetworkCapStates() + */ + void resetNetworkCapStates(); + + /** + * Update the capability-dependent settings according to what the server supports + * + * For example, this updates the SASL text for when the server advertises support. This should + * only be called on the currently displayed network. + * + * @param[in] id NetworkId referencing network used to update settings user interface. + */ + void setNetworkCapStates(NetworkId id); + void clientNetworkAdded(NetworkId); void clientNetworkRemoved(NetworkId); void clientNetworkUpdated(); @@ -65,6 +87,15 @@ private slots: void clientIdentityRemoved(IdentityId); void clientIdentityUpdated(); + /** + * Update the settings user interface according to capabilities advertised by the IRC server + */ + void clientNetworkCapsUpdated(); + +#ifdef HAVE_SSL + void sslUpdated(); +#endif + void on_networkList_itemSelectionChanged(); void on_addNetwork_clicked(); void on_deleteNetwork_clicked(); @@ -80,14 +111,38 @@ private slots: void on_upServer_clicked(); void on_downServer_clicked(); + /** + * Event handler for SASL status Details button + */ + void on_saslStatusDetails_clicked(); + private: + /** + * Status of capability support + */ + enum CapSupportStatus { + Unknown, ///< Old core, or otherwise unknown, can't make assumptions + Disconnected, ///< Disconnected from network, can't determine + MaybeUnsupported, ///< Server does not advertise support at this moment + MaybeSupported ///< Server advertises support at this moment + }; + // Keep in mind networks can add, change, and remove capabilities at any time. + Ui::NetworksSettingsPage ui; NetworkId currentId; QHash networkInfos; bool _ignoreWidgetChanges; +#ifdef HAVE_SSL + CertIdentity *_cid; +#endif + + QIcon connectedIcon, connectingIcon, disconnectedIcon; + + // Status icons + QIcon infoIcon, warningIcon; - QPixmap connectedIcon, connectingIcon, disconnectedIcon; + CapSupportStatus _saslStatusSelected; /// Status of SASL support for currently-selected network void reset(); bool testHasChanged(); @@ -96,6 +151,13 @@ private: QListWidgetItem *networkItem(NetworkId) const; void saveToNetworkInfo(NetworkInfo &); IdentityId defaultIdentity() const; + + /** + * Update the SASL settings interface according to the given SASL state + * + * @param[in] saslStatus Current status of SASL support. + */ + void setSASLStatus(const CapSupportStatus saslStatus); }; @@ -111,6 +173,16 @@ public: private slots: void setButtonStates(); + /** + * Update the default server port according to isChecked + * + * Connect with useSSL->toggled() in order to keep the port number in sync. This only modifies + * the port if it's not been changed from defaults. + * + * @param isChecked If true and port unchanged, set port to 6697, else set port to 6667. + */ + void updateSslPort(bool isChecked); + private: Ui::NetworkAddDlg ui; @@ -149,6 +221,16 @@ public: private slots: void on_host_textChanged(); + /** + * Update the default server port according to isChecked + * + * Connect with useSSL->toggled() in order to keep the port number in sync. This only modifies + * the port if it's not been changed from defaults. + * + * @param isChecked If true and port unchanged, set port to 6697, else set port to 6667. + */ + void updateSslPort(bool isChecked); + private: Ui::ServerEditDlg ui; };