diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-06-12 23:47:17 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-06-29 14:09:46 +0200 |
| commit | 05b2584fa4d773f5a88ed3ce98f5dd8304e11c34 (patch) | |
| tree | f72e73c3259b8100e886f49f67ecc669b7667502 /account.cpp | |
| parent | 3b8fafc4122848219898245d52dabd669cacb4ba (diff) | |
| download | xxcc-05b2584fa4d773f5a88ed3ce98f5dd8304e11c34.tar.gz | |
First commit
Diffstat (limited to 'account.cpp')
| -rw-r--r-- | account.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/account.cpp b/account.cpp new file mode 100644 index 0000000..5e30184 --- /dev/null +++ b/account.cpp @@ -0,0 +1,25 @@ +#include "account.h" + +Account::Account(Client *const c, QListWidget *const list, + QWidget *const parent) : + QWidget(parent) +{ + const auto it = new QListWidgetItem(list); + const auto w = new QWidget; + + ui.setupUi(w); + ui.jid->setText(c->configuration().jidBare()); + ui.connected->setChecked( + c->state() == Client::State::ConnectedState); + + connect(c, &Client::stateChanged, this, + [this] (const Client::State state) + { + ui.connected->setChecked( + state == Client::State::ConnectedState); + }); + + it->setSizeHint(w->sizeHint()); + list->addItem(it); + list->setItemWidget(it, w); +} |
