- QListWidgetItem *insertNetwork(NetworkId);
- QListWidgetItem *insertNetwork(const NetworkInfo &info);
- QListWidgetItem *networkItem(NetworkId) const;
- void saveToNetworkInfo(NetworkInfo &);
+ QListWidgetItem* insertNetwork(NetworkId);
+ QListWidgetItem* insertNetwork(const NetworkInfo& info);
+ QListWidgetItem* networkItem(NetworkId) const;
+ void saveToNetworkInfo(NetworkInfo&);
+ IdentityId defaultIdentity() const;
+
+ /**
+ * Get whether or not the displayed network's identity has SSL certs associated with it
+ *
+ * @return True if the currently displayed network has SSL certs set, otherwise false
+ */
+ bool displayedNetworkHasCertId() const;
+
+ /**
+ * Update the SASL settings interface according to the given SASL state
+ *
+ * @param saslStatus Current status of SASL support.
+ * @param usingSASLExternal If true, SASL support status is for SASL EXTERNAL, else SASL PLAIN
+ */
+ void setCapSASLStatus(const CapSupportStatus saslStatus, bool usingSASLExternal = false);
+};
+
+class NetworkAddDlg : public QDialog
+{
+ Q_OBJECT
+
+public:
+ NetworkAddDlg(QStringList existing = QStringList(), QWidget* parent = nullptr);
+
+ NetworkInfo networkInfo() const;
+
+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;
+
+ QStringList existing;