Ref T146, read only mode for login mode (so it can be used as display only UI element)

Also some minor tweaks/formatting
This commit is contained in:
Klaus Basan
2017-09-02 18:34:50 +02:00
committed by Mathew Sutcliffe
parent 946bdb964e
commit 7ad666c346
3 changed files with 17 additions and 9 deletions

View File

@@ -65,9 +65,16 @@ namespace BlackGui
}
}
void CLoginModeButtons::setReadOnly(bool readonly)
{
ui->rb_LoginNormal->setEnabled(!readonly);
ui->rb_LoginObserver->setEnabled(!readonly);
ui->rb_LoginStealth->setEnabled(!readonly);
}
void CLoginModeButtons::configureLoginModes()
{
if(CBuildConfig::isStableBranch() && !sGui->getIContextSimulator()->isSimulatorSimulating())
if (CBuildConfig::isStableBranch() && !sGui->getIContextSimulator()->isSimulatorSimulating())
{
// Disable pilot login modes
ui->rb_LoginNormal->setEnabled(false);
@@ -85,4 +92,4 @@ namespace BlackGui
ui->rb_LoginNormal->setChecked(true);
}
}
}
} // ns

View File

@@ -14,7 +14,6 @@
#include "blackcore/network.h"
#include "blackgui/blackguiexport.h"
#include <QGroupBox>
#include <QObject>
#include <QScopedPointer>
@@ -22,7 +21,6 @@
class QWidget;
namespace Ui { class CLoginModeButtons; }
namespace BlackGui
{
//! Display login modes (normal, stealth, ...)
@@ -35,7 +33,7 @@ namespace BlackGui
explicit CLoginModeButtons(QWidget *parent = nullptr);
//! Destructor
~CLoginModeButtons();
virtual ~CLoginModeButtons();
//! Get login mode, \sa BlackCore::INetwork::LoginMode
BlackCore::INetwork::LoginMode getLoginMode() const;
@@ -43,11 +41,14 @@ namespace BlackGui
//! Set login mode
void setLoginMode(BlackCore::INetwork::LoginMode mode);
//! Set to read only
void setReadOnly(bool readonly);
private:
void configureLoginModes();
QScopedPointer<Ui::CLoginModeButtons> ui;
};
}
} // ns
#endif // guard

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>271</width>
<height>23</height>
<width>257</width>
<height>49</height>
</rect>
</property>
<property name="windowTitle">
@@ -38,7 +38,7 @@
<item>
<widget class="QLabel" name="lbl_LognMode">
<property name="text">
<string>Login mode</string>
<string>Mode</string>
</property>
</widget>
</item>