mirror of
https://github.com/tnodir/fort
synced 2024-11-15 07:06:08 +00:00
UI: Programs: Services button is for admin access only
This commit is contained in:
parent
6d0046e4cb
commit
34ba701ba4
@ -4,6 +4,7 @@
|
||||
#include <conf/confmanager.h>
|
||||
#include <conf/firewallconf.h>
|
||||
#include <fortmanager.h>
|
||||
#include <fortsettings.h>
|
||||
#include <manager/translationmanager.h>
|
||||
#include <manager/windowmanager.h>
|
||||
#include <model/applistmodel.h>
|
||||
@ -21,6 +22,11 @@ FortManager *ProgramsController::fortManager() const
|
||||
return IoC<FortManager>();
|
||||
}
|
||||
|
||||
FortSettings *ProgramsController::settings() const
|
||||
{
|
||||
return IoC<FortSettings>();
|
||||
}
|
||||
|
||||
ConfManager *ProgramsController::confManager() const
|
||||
{
|
||||
return IoC<ConfManager>();
|
||||
|
@ -8,6 +8,7 @@ class AppListModel;
|
||||
class ConfManager;
|
||||
class FirewallConf;
|
||||
class FortManager;
|
||||
class FortSettings;
|
||||
class IniOptions;
|
||||
class IniUser;
|
||||
class TranslationManager;
|
||||
@ -21,6 +22,7 @@ public:
|
||||
explicit ProgramsController(QObject *parent = nullptr);
|
||||
|
||||
FortManager *fortManager() const;
|
||||
FortSettings *settings() const;
|
||||
ConfManager *confManager() const;
|
||||
FirewallConf *conf() const;
|
||||
IniOptions *ini() const;
|
||||
|
@ -40,6 +40,11 @@ ProgramsWindow::ProgramsWindow(QWidget *parent) :
|
||||
setupStateWatcher();
|
||||
}
|
||||
|
||||
FortSettings *ProgramsWindow::settings() const
|
||||
{
|
||||
return ctrl()->settings();
|
||||
}
|
||||
|
||||
ConfManager *ProgramsWindow::confManager() const
|
||||
{
|
||||
return ctrl()->confManager();
|
||||
@ -231,6 +236,7 @@ QLayout *ProgramsWindow::setupHeader()
|
||||
|
||||
// Services button
|
||||
m_btServices = ControlUtil::createLinkButton(":/icons/windows-48.png");
|
||||
m_btServices->setEnabled(settings()->hasMasterAdmin());
|
||||
|
||||
connect(m_btServices, &QAbstractButton::clicked, windowManager(),
|
||||
&WindowManager::showServicesWindow);
|
||||
|
@ -12,6 +12,7 @@ class AppListModel;
|
||||
class AppListModel;
|
||||
class ConfManager;
|
||||
class FirewallConf;
|
||||
class FortSettings;
|
||||
class IniOptions;
|
||||
class IniUser;
|
||||
class ProgramEditDialog;
|
||||
@ -30,6 +31,7 @@ public:
|
||||
explicit ProgramsWindow(QWidget *parent = nullptr);
|
||||
|
||||
ProgramsController *ctrl() const { return m_ctrl; }
|
||||
FortSettings *settings() const;
|
||||
ConfManager *confManager() const;
|
||||
FirewallConf *conf() const;
|
||||
IniOptions *ini() const;
|
||||
|
@ -73,7 +73,7 @@ void ServicesWindow::saveWindowState()
|
||||
|
||||
void ServicesWindow::restoreWindowState()
|
||||
{
|
||||
m_stateWatcher->restore(this, QSize(1024, 768), iniUser()->serviceWindowGeometry(),
|
||||
m_stateWatcher->restore(this, QSize(800, 600), iniUser()->serviceWindowGeometry(),
|
||||
iniUser()->serviceWindowMaximized());
|
||||
|
||||
if (iniUser()->servicesHeaderVersion() == SERVICES_HEADER_VERSION) {
|
||||
@ -201,8 +201,8 @@ void ServicesWindow::setupTableServiceListHeader()
|
||||
header->setSectionResizeMode(1, QHeaderView::Stretch);
|
||||
header->setSectionResizeMode(2, QHeaderView::Interactive);
|
||||
|
||||
header->resizeSection(0, 250);
|
||||
header->resizeSection(1, 350);
|
||||
header->resizeSection(0, 180);
|
||||
header->resizeSection(1, 520);
|
||||
header->resizeSection(2, 100);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user