forked from blue/squawk
Reformating, adding accounts ui dummy
This commit is contained in:
parent
de36fe2a4e
commit
6823b41f24
16 changed files with 551 additions and 31 deletions
|
@ -4,7 +4,8 @@
|
|||
Squawk::Squawk(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
m_ui(new Ui::Squawk),
|
||||
accounts(0)
|
||||
accounts(0),
|
||||
accountsCache()
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
|
@ -21,9 +22,20 @@ void Squawk::onAccounts()
|
|||
accounts = new Accounts(this);
|
||||
accounts->setAttribute(Qt::WA_DeleteOnClose);
|
||||
connect(accounts, SIGNAL(destroyed(QObject*)), this, SLOT(onAccountsClosed(QObject*)));
|
||||
connect(accounts, SIGNAL(newAccount(const QMap<QString, QVariant>&)), this, SIGNAL(newAccountRequest(const QMap<QString, QVariant>&)));
|
||||
|
||||
AC::const_iterator itr = accountsCache.begin();
|
||||
AC::const_iterator end = accountsCache.end();
|
||||
|
||||
for (; itr != end; ++itr) {
|
||||
accounts->addAccount(*itr);
|
||||
}
|
||||
|
||||
accounts->show();
|
||||
} else {
|
||||
accounts->focusWidget();
|
||||
accounts->show();
|
||||
accounts->raise();
|
||||
accounts->activateWindow();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,3 +53,11 @@ void Squawk::onAccountsClosed(QObject* parent)
|
|||
{
|
||||
accounts = 0;
|
||||
}
|
||||
|
||||
void Squawk::newAccount(const QMap<QString, QVariant>& account)
|
||||
{
|
||||
accountsCache.push_back(account);
|
||||
if (accounts != 0) {
|
||||
accounts->addAccount(account);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue