/***************************************************************************
- * 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 *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#ifndef _NETWORKSSETTINGSPAGE_H_
-#define _NETWORKSSETTINGSPAGE_H_
+#ifndef NETWORKSSETTINGSPAGE_H
+#define NETWORKSSETTINGSPAGE_H
-#include <QIcon>
+#include <QPixmap>
+#include "network.h"
#include "settingspage.h"
+
#include "ui_networkssettingspage.h"
-#include "ui_networkeditdlgnew.h"
-#include "ui_servereditdlgnew.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
void widgetHasChanged();
void setWidgetStates();
void coreConnectionStateChanged(bool);
+ void networkConnectionStateChanged(Network::ConnectionState state);
+ void networkConnectionError(const QString &msg);
- void displayNetwork(NetworkId, bool dontsave = false);
+ void displayNetwork(NetworkId);
+ void setItemState(NetworkId, QListWidgetItem *item = 0);
void clientNetworkAdded(NetworkId);
void clientNetworkRemoved(NetworkId);
void on_deleteNetwork_clicked();
void on_renameNetwork_clicked();
+ void on_connectNow_clicked();
+
void on_serverList_itemSelectionChanged();
void on_addServer_clicked();
void on_deleteServer_clicked();
NetworkId currentId;
QHash<NetworkId, NetworkInfo> networkInfos;
+ bool _ignoreWidgetChanges;
- QIcon connectedIcon, disconnectedIcon;
+ QPixmap connectedIcon, connectingIcon, disconnectedIcon;
void reset();
bool testHasChanged();
void saveToNetworkInfo(NetworkInfo &);
};
-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);
- QString networkName() const;
+ NetworkInfo networkInfo() const;
private slots:
- void on_networkEdit_textChanged(const QString &);
+ void setButtonStates();
private:
- Ui::NetworkEditDlgNew ui;
+ Ui::NetworkAddDlg ui;
+ QString networksFilePath;
QStringList existing;
};
-
-class ServerEditDlgNew : public QDialog {
+class NetworkEditDlg : public QDialog {
Q_OBJECT
public:
- ServerEditDlgNew(const QVariantMap &serverData = QVariantMap(), QWidget *parent = 0);
+ NetworkEditDlg(const QString &old, const QStringList &existing = QStringList(), QWidget *parent = 0);
- QVariantMap serverData() const;
+ QString networkName() const;
private slots:
- void on_host_textChanged();
+ void on_networkEdit_textChanged(const QString &);
private:
- Ui::ServerEditDlgNew 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;
+
+private slots:
+ void on_host_textChanged();
+
+private:
+ Ui::ServerEditDlg ui;
};
public:
SaveNetworksDlg(const QList<NetworkInfo> &toCreate, const QList<NetworkInfo> &toUpdate, const QList<NetworkId> &toRemove, QWidget *parent = 0);
+ private slots:
+ void clientEvent();
+
private:
Ui::SaveIdentitiesDlg ui;
+
+ int numevents, rcvevents;
};
#endif