2020-06-14 12:44:32 +00:00
|
|
|
#include <QMessageBox>
|
|
|
|
|
|
|
|
#include "accounthelper.h"
|
2020-06-13 16:05:06 +00:00
|
|
|
#include "whoamidialog.h"
|
|
|
|
#include "ui_whoamidialog.h"
|
|
|
|
|
|
|
|
WhoAmIDialog::WhoAmIDialog(QWidget *parent) :
|
|
|
|
QDialog(parent),
|
|
|
|
ui(new Ui::WhoAmIDialog)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2020-06-14 12:44:32 +00:00
|
|
|
|
|
|
|
AccountHelper::GetUserID([this](int id) {
|
|
|
|
this->onGotUserId(id);
|
|
|
|
});
|
2020-06-13 16:05:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
WhoAmIDialog::~WhoAmIDialog()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
2020-06-14 12:44:32 +00:00
|
|
|
|
|
|
|
void WhoAmIDialog::onGotUserId(int userID)
|
|
|
|
{
|
|
|
|
if(userID < 1) {
|
|
|
|
QMessageBox::warning(this, tr("Error"), tr("Could not get your id!"));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
this->ui->user_id->setText(QString::number(userID));
|
|
|
|
}
|