squawk/ui/accounts.h

48 lines
1.1 KiB
C
Raw Normal View History

2019-03-29 14:54:34 +00:00
#ifndef ACCOUNTS_H
#define ACCOUNTS_H
#include <QWidget>
#include <QScopedPointer>
#include <QItemSelection>
2019-03-29 14:54:34 +00:00
2019-03-30 20:13:13 +00:00
#include "account.h"
#include "models/accounts.h"
2019-03-29 14:54:34 +00:00
namespace Ui
{
class Accounts;
}
class Accounts : public QWidget
{
Q_OBJECT
public:
explicit Accounts(Models::Accounts* p_model, QWidget *parent = nullptr);
2019-03-29 14:54:34 +00:00
~Accounts() override;
2019-03-30 20:13:13 +00:00
signals:
void newAccount(const QMap<QString, QVariant>&);
void changeAccount(const QString&, const QMap<QString, QVariant>&);
2019-05-29 15:05:54 +00:00
void connectAccount(const QString&);
void disconnectAccount(const QString&);
void removeAccount(const QString&);
2019-03-30 20:13:13 +00:00
private slots:
void onAddButton(bool clicked = 0);
void onEditButton(bool clicked = 0);
2019-05-29 15:05:54 +00:00
void onConnectButton(bool clicked = 0);
void onDeleteButton(bool clicked = 0);
2019-03-30 20:13:13 +00:00
void onAccountAccepted();
void onAccountRejected();
void onSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
2019-05-29 15:05:54 +00:00
void updateConnectButton();
2019-03-30 20:13:13 +00:00
2019-03-29 14:54:34 +00:00
private:
QScopedPointer<Ui::Accounts> m_ui;
Models::Accounts* model;
bool editing;
2019-05-29 15:05:54 +00:00
bool toDisconnect;
2019-03-29 14:54:34 +00:00
};
#endif // ACCOUNTS_H