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,80 +1,89 @@
<ui version="4.0" > <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CServerDlgBase</class> <class>CServerDlgBase</class>
<widget class="QDialog" name="CServerDlgBase" > <widget class="QDialog" name="CServerDlgBase">
<property name="geometry" > <property name="geometry">
<rect> <rect>
<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>
</property> </property>
<layout class="QVBoxLayout" > <layout class="QVBoxLayout">
<item> <item>
<widget class="QTreeWidget" name="lvwClients" > <widget class="QTreeWidget" name="lvwClients">
<property name="rootIsDecorated" > <property name="rootIsDecorated">
<bool>false</bool> <bool>false</bool>
</property> </property>
<column> <column>
<property name="text" > <property name="text">
<string>Client IP:Port</string> <string>Client IP:Port</string>
</property> </property>
</column> </column>
<column> <column>
<property name="text" > <property name="text">
<string>Name</string> <string>Name</string>
</property> </property>
</column> </column>
<column> <column>
<property name="text" > <property name="text">
<string>Jitter Buffer Size</string> <string>Jitter Buffer Size</string>
</property> </property>
</column> </column>
<column> <column>
<property name="text" > <property name="text">
<string>Block Size Out/ms</string> <string>Block Size Out/ms</string>
</property> </property>
</column> </column>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="chbStartOnOSStart" > <widget class="QCheckBox" name="chbStartOnOSStart">
<property name="text" > <property name="text">
<string>Start Minimized on Windows Start</string> <string>Start Minimized on Windows Start</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="chbRegisterServer" > <widget class="QCheckBox" name="chbUseCCLicence">
<property name="text" > <property name="text">
<string>Show Creative Commons Licence Dialog</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chbRegisterServer">
<property name="text">
<string>Register My Server in the Server List at the Central Server</string> <string>Register My Server in the Server List at the Central Server</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout">
<item> <item>
<widget class="QLabel" name="lblCentralServerAddress" > <widget class="QLabel" name="lblCentralServerAddress">
<property name="text" > <property name="text">
<string>Central Server Address:</string> <string>Central Server Address:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="edtCentralServerAddress" /> <widget class="QLineEdit" name="edtCentralServerAddress"/>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="chbDefaultCentralServer" > <widget class="QCheckBox" name="chbDefaultCentralServer">
<property name="text" > <property name="text">
<string>Default</string> <string>Default</string>
</property> </property>
</widget> </widget>
@ -82,30 +91,30 @@
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="grbServerInfo" > <widget class="QGroupBox" name="grbServerInfo">
<property name="title" > <property name="title">
<string>My Server Info</string> <string>My Server Info</string>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout">
<item> <item>
<layout class="QVBoxLayout" > <layout class="QVBoxLayout">
<item> <item>
<widget class="QLabel" name="lblServerName" > <widget class="QLabel" name="lblServerName">
<property name="text" > <property name="text">
<string>Name</string> <string>Name</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="lblLocationCity" > <widget class="QLabel" name="lblLocationCity">
<property name="text" > <property name="text">
<string>Location: City</string> <string>Location: City</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="lblLocationCountry" > <widget class="QLabel" name="lblLocationCountry">
<property name="text" > <property name="text">
<string>Location: Country</string> <string>Location: Country</string>
</property> </property>
</widget> </widget>
@ -113,15 +122,15 @@
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" > <layout class="QVBoxLayout">
<item> <item>
<widget class="QLineEdit" name="edtServerName" /> <widget class="QLineEdit" name="edtServerName"/>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="edtLocationCity" /> <widget class="QLineEdit" name="edtLocationCity"/>
</item> </item>
<item> <item>
<widget class="QComboBox" name="cbxLocationCountry" /> <widget class="QComboBox" name="cbxLocationCountry"/>
</item> </item>
</layout> </layout>
</item> </item>
@ -129,41 +138,41 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout">
<property name="spacing" > <property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<property name="leftMargin" > <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="topMargin" > <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin" > <property name="rightMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="bottomMargin" > <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="lblNameVersion" > <widget class="QLabel" name="lblNameVersion">
<property name="text" > <property name="text">
<string>TextLabelNameVersion</string> <string>TextLabelNameVersion</string>
</property> </property>
<property name="wordWrap" > <property name="wordWrap">
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<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,8 +184,19 @@
</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>
<connections/> <connections/>
</ui> </ui>

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