added show licence switch in the server GUI

This commit is contained in:
Volker Fischer 2020-04-08 15:30:32 +02:00
parent e7bb2ad1c6
commit 5824855252
7 changed files with 125 additions and 58 deletions

View file

@ -6,13 +6,13 @@
- added support for channel meters, coded by pljones - added support for channel meters, coded by pljones
- added show licence switch in the server GUI
- store fader mute state in the ini file, coded by doloopuntil - store fader mute state in the ini file, coded by doloopuntil
- fixed low-res icon issue (Ticket #28) - fixed low-res icon issue (Ticket #28)
TODO insert licence setting in server dialog -> on per default
TODO support OPUS 64 in the server as a first step towards official 64 samples frame size support TODO support OPUS 64 in the server as a first step towards official 64 samples frame size support
TODO in CreateLevelsForAllConChannels we should call CStereoSignalLevelMeter::CalcLogResult instead -> make it public and static TODO in CreateLevelsForAllConChannels we should call CStereoSignalLevelMeter::CalcLogResult instead -> make it public and static

View file

@ -541,6 +541,10 @@ const bool bUseDoubleSystemFrameSize = true; // TODO for now this value is fixed
// settings file) // settings file)
Server.SetUseDefaultCentralServerAddress ( true ); Server.SetUseDefaultCentralServerAddress ( true );
// special case for the GUI mode: we want the licenct type to be
// creative commons per default (if not given in the settings file)
Server.SetLicenceType ( LT_CREATIVECOMMONS );
// load settings from init-file // load settings from init-file
CSettings Settings ( &Server, strIniFileName ); CSettings Settings ( &Server, strIniFileName );
Settings.Load(); Settings.Load();

View file

@ -191,11 +191,12 @@ public:
// GUI settings ------------------------------------------------------------ // GUI settings ------------------------------------------------------------
void SetAutoRunMinimized ( const bool NAuRuMin ) void SetAutoRunMinimized ( const bool NAuRuMin ) { bAutoRunMinimized = NAuRuMin; }
{ bAutoRunMinimized = NAuRuMin; }
bool GetAutoRunMinimized() { return bAutoRunMinimized; } bool GetAutoRunMinimized() { return bAutoRunMinimized; }
void SetLicenceType ( const ELicenceType NLiType ) { eLicenceType = NLiType; }
ELicenceType GetLicenceType() { return eLicenceType; }
protected: protected:
// access functions for actual channels // access functions for actual channels
bool IsConnected ( const int iChanNum ) bool IsConnected ( const int iChanNum )

View file

@ -56,6 +56,11 @@ CServerDlg::CServerDlg ( CServer* pNServP,
"started when the operating system starts up and is automatically " "started when the operating system starts up and is automatically "
"minimized to a system task bar icon." ) ); "minimized to a system task bar icon." ) );
// CC licence dialog switch
chbUseCCLicence->setWhatsThis ( tr ( "<b>Show Creative Commons Licence "
"Dialog:</b> If enabled, a Creative Commons Licence dialog is shown "
"each time a new user connects the server." ) );
// register server flag // register server flag
chbRegisterServer->setWhatsThis ( tr ( "<b>Register Server Status:</b> If " chbRegisterServer->setWhatsThis ( tr ( "<b>Register Server Status:</b> If "
"the register server check box is checked, this server registers " "the register server check box is checked, this server registers "
@ -229,6 +234,16 @@ lvwClients->setMinimumHeight ( 140 );
chbRegisterServer->setCheckState ( Qt::Unchecked ); chbRegisterServer->setCheckState ( Qt::Unchecked );
} }
// update show Creative Commons licence check box
if ( pServer->GetLicenceType() == LT_CREATIVECOMMONS )
{
chbUseCCLicence->setCheckState ( Qt::Checked );
}
else
{
chbUseCCLicence->setCheckState ( Qt::Unchecked );
}
// update start minimized check box (only available for Windows) // update start minimized check box (only available for Windows)
#ifndef _WIN32 #ifndef _WIN32
chbStartOnOSStart->setVisible ( false ); chbStartOnOSStart->setVisible ( false );
@ -284,6 +299,9 @@ lvwClients->setMinimumHeight ( 140 );
QObject::connect ( chbStartOnOSStart, SIGNAL ( stateChanged ( int ) ), QObject::connect ( chbStartOnOSStart, SIGNAL ( stateChanged ( int ) ),
this, SLOT ( OnStartOnOSStartStateChanged ( int ) ) ); this, SLOT ( OnStartOnOSStartStateChanged ( int ) ) );
QObject::connect ( chbUseCCLicence, SIGNAL ( stateChanged ( int ) ),
this, SLOT ( OnUseCCLicenceStateChanged ( int ) ) );
// line edits // line edits
QObject::connect ( edtCentralServerAddress, SIGNAL ( editingFinished() ), QObject::connect ( edtCentralServerAddress, SIGNAL ( editingFinished() ),
this, SLOT ( OnCentralServerAddressEditingFinished() ) ); this, SLOT ( OnCentralServerAddressEditingFinished() ) );
@ -342,6 +360,18 @@ void CServerDlg::OnStartOnOSStartStateChanged ( int value )
ModifyAutoStartEntry ( bCurAutoStartMinState ); ModifyAutoStartEntry ( bCurAutoStartMinState );
} }
void CServerDlg::OnUseCCLicenceStateChanged ( int value )
{
if ( value == Qt::Checked )
{
pServer->SetLicenceType ( LT_CREATIVECOMMONS );
}
else
{
pServer->SetLicenceType ( LT_NO_LICENCE );
}
}
void CServerDlg::OnDefaultCentralServerStateChanged ( int value ) void CServerDlg::OnDefaultCentralServerStateChanged ( int value )
{ {
// apply new setting to the server and update it // apply new setting to the server and update it

View file

@ -86,6 +86,7 @@ public slots:
void OnRegisterServerStateChanged ( int value ); void OnRegisterServerStateChanged ( int value );
void OnDefaultCentralServerStateChanged ( int value ); void OnDefaultCentralServerStateChanged ( int value );
void OnStartOnOSStartStateChanged ( int value ); void OnStartOnOSStartStateChanged ( int value );
void OnUseCCLicenceStateChanged ( int value );
void OnCentralServerAddressEditingFinished(); void OnCentralServerAddressEditingFinished();
void OnServerNameTextChanged ( const QString& strNewName ); void OnServerNameTextChanged ( const QString& strNewName );
void OnLocationCityTextChanged ( const QString& strNewCity ); void OnLocationCityTextChanged ( const QString& strNewCity );

View file

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>CServerDlgBase</class> <class>CServerDlgBase</class>
<widget class="QDialog" name="CServerDlgBase"> <widget class="QDialog" name="CServerDlgBase">
@ -6,14 +7,15 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>588</width> <width>588</width>
<height>386</height> <height>415</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string></string> <string/>
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset resource="resources.qrc" >:/png/main/res/fronticon.png</iconset> <iconset resource="resources.qrc">
<normaloff>:/png/main/res/fronticon.png</normaloff>:/png/main/res/fronticon.png</iconset>
</property> </property>
<property name="sizeGripEnabled"> <property name="sizeGripEnabled">
<bool>true</bool> <bool>true</bool>
@ -53,6 +55,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="chbUseCCLicence">
<property name="text">
<string>Show Creative Commons Licence Dialog</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QCheckBox" name="chbRegisterServer"> <widget class="QCheckBox" name="chbRegisterServer">
<property name="text"> <property name="text">
@ -163,7 +172,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Expanding</enum> <enum>QSizePolicy::Expanding</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
@ -175,6 +184,17 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<tabstops>
<tabstop>lvwClients</tabstop>
<tabstop>chbStartOnOSStart</tabstop>
<tabstop>chbUseCCLicence</tabstop>
<tabstop>chbRegisterServer</tabstop>
<tabstop>edtCentralServerAddress</tabstop>
<tabstop>chbDefaultCentralServer</tabstop>
<tabstop>edtServerName</tabstop>
<tabstop>edtLocationCity</tabstop>
<tabstop>cbxLocationCountry</tabstop>
</tabstops>
<resources> <resources>
<include location="resources.qrc"/> <include location="resources.qrc"/>
</resources> </resources>

View file

@ -364,6 +364,13 @@ void CSettings::Load()
{ {
pServer->SetAutoRunMinimized ( bValue ); pServer->SetAutoRunMinimized ( bValue );
} }
// licence type
if ( GetNumericIniSet ( IniXMLDocument, "server", "licencetype",
0, 1 /* LT_CREATIVECOMMONS */, iValue ) )
{
pServer->SetLicenceType ( static_cast<ELicenceType> ( iValue ) );
}
} }
} }
@ -583,6 +590,10 @@ void CSettings::Save()
// start minimized on OS start // start minimized on OS start
SetFlagIniSet ( IniXMLDocument, "server", "autostartmin", SetFlagIniSet ( IniXMLDocument, "server", "autostartmin",
pServer->GetAutoRunMinimized() ); pServer->GetAutoRunMinimized() );
// licence type
SetNumericIniSet ( IniXMLDocument, "server", "licencetype",
static_cast<int> ( pServer->GetLicenceType() ) );
} }
// prepare file name for storing initialization data in XML file and store // prepare file name for storing initialization data in XML file and store