#include "identitiessettingspage.h"
#include "client.h"
+#include "iconloader.h"
IdentitiesSettingsPage::IdentitiesSettingsPage(QWidget *parent)
: SettingsPage(tr("General"), tr("Identities"), parent) {
ui.setupUi(this);
+ ui.renameIdentity->setIcon(BarIcon("edit-rename"));
+ ui.addIdentity->setIcon(BarIcon("list-add-user"));
+ ui.deleteIdentity->setIcon(BarIcon("list-remove-user"));
+ ui.addNick->setIcon(SmallIcon("list-add"));
+ ui.deleteNick->setIcon(SmallIcon("edit-delete"));
+ ui.renameNick->setIcon(SmallIcon("edit-rename"));
+ ui.nickUp->setIcon(SmallIcon("go-up"));
+ ui.nickDown->setIcon(SmallIcon("go-down"));
+
setEnabled(Client::isConnected()); // need a core connection!
setWidgetStates();
connect(Client::instance(), SIGNAL(coreConnectionStateChanged(bool)), this, SLOT(coreConnectionStateChanged(bool)));
// we would need this if we enabled drag and drop in the nicklist...
//connect(ui.nicknameList, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(setWidgetStates()));
//connect(ui.nicknameList->model(), SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(nicklistHasChanged()));
-
}
void IdentitiesSettingsPage::setWidgetStates() {
ui.nickDown->setDisabled(true);
}
ui.deleteNick->setEnabled(ui.nicknameList->count() > 1);
-
}
void IdentitiesSettingsPage::coreConnectionStateChanged(bool state) {
SaveIdentitiesDlg::SaveIdentitiesDlg(const QList<Identity *> &toCreate, const QList<Identity *> &toUpdate, const QList<IdentityId> &toRemove, QWidget *parent)
: QDialog(parent) { //, toCreate(tocreate), toUpdate(toupdate), toRemove(toremove) {
ui.setupUi(this);
+ ui.abort->setIcon(SmallIcon("dialog-cancel"));
+
numevents = toCreate.count() + toUpdate.count() + toRemove.count();
rcvevents = 0;
if(numevents) {
numevents--;
continue;
}
- // FIXME this only checks for one changed item rather than all!
connect(cid, SIGNAL(updatedRemotely()), this, SLOT(clientEvent()));
- Client::updateIdentity(*id);
+ Client::updateIdentity(id->id(), id->toVariantMap());
}
foreach(IdentityId id, toRemove) {
Client::removeIdentity(id);