+ QHash<IdentityId, Identity *> identities;
+ IdentityId currentId;
+
+ QList<IdentityId> changedIdentities; // for setting the widget changed state
+ QList<IdentityId> deletedIdentities;
+
+ void insertIdentity(Identity *identity);
+ void removeIdentity(Identity *identity);
+ void renameIdentity(IdentityId id, const QString &newName);
+ void displayIdentity(Identity *, bool dontsave = false);
+ void saveToIdentity(Identity *);
+
+ bool testHasChanged();
+};
+
+class CreateIdentityDlg : public QDialog {
+ Q_OBJECT
+
+ public:
+ CreateIdentityDlg(QAbstractItemModel *model, QWidget *parent = 0);
+
+ QString identityName() const;
+ IdentityId duplicateId() const;
+
+ private slots:
+ void on_identityName_textChanged(const QString &text);
+
+ private:
+ Ui::CreateIdentityDlg ui;
+};
+
+class SaveIdentitiesDlg : public QDialog {
+ Q_OBJECT
+
+ public:
+ SaveIdentitiesDlg(const QList<Identity *> &toCreate, const QList<Identity *> &toUpdate, const QList<IdentityId> &toRemove, QWidget *parent = 0);
+
+ private slots:
+ void clientEvent();
+
+ private:
+ Ui::SaveIdentitiesDlg ui;
+
+ //QList<Identity *> toCreate, toUpdate;
+ //QList<IdentityId> toRemove;
+
+ int numevents, rcvevents;
+
+};
+
+class NickEditDlg : public QDialog {
+ Q_OBJECT
+
+ public:
+ NickEditDlg(const QString &oldnick, const QStringList &existing = QStringList(), QWidget *parent = 0);
+
+ QString nick() const;
+
+ private slots:
+ void on_nickEdit_textChanged(const QString &);
+
+ private:
+ Ui::NickEditDlg ui;
+
+ QString oldNick;
+ QStringList existing;
+