Merge pull request #2047 from Cockatrice/autoadmin

Enable admin features on login and remove "are you sure" prompt
This commit is contained in:
Gavin Bisesi 2016-07-02 19:49:02 -04:00 committed by GitHub
commit b61e023267

View file

@ -87,6 +87,8 @@ TabAdmin::TabAdmin(TabSupervisor *_tabSupervisor, AbstractClient *_client, bool
QWidget * mainWidget = new QWidget(this); QWidget * mainWidget = new QWidget(this);
mainWidget->setLayout(mainLayout); mainWidget->setLayout(mainLayout);
setCentralWidget(mainWidget); setCentralWidget(mainWidget);
actUnlock();
} }
void TabAdmin::retranslateUi() void TabAdmin::retranslateUi()
@ -125,14 +127,12 @@ void TabAdmin::actReloadConfig()
void TabAdmin::actUnlock() void TabAdmin::actUnlock()
{ {
if (QMessageBox::question(this, tr("Unlock administration functions"), tr("Do you really want to unlock the administration functions?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
if (fullAdmin) if (fullAdmin)
adminGroupBox->setEnabled(true); adminGroupBox->setEnabled(true);
lockButton->setEnabled(true); lockButton->setEnabled(true);
unlockButton->setEnabled(false); unlockButton->setEnabled(false);
locked = false; locked = false;
emit adminLockChanged(false); emit adminLockChanged(false);
}
} }
void TabAdmin::actLock() void TabAdmin::actLock()