support for storing/recovering the server window positions (#357)
This commit is contained in:
parent
2285148cb8
commit
e883a51db9
6 changed files with 42 additions and 11 deletions
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
- support sorting faders by channel instrument, coded by Alberstein8 (#356)
|
- support sorting faders by channel instrument, coded by Alberstein8 (#356)
|
||||||
|
|
||||||
|
- support for storing/recovering the server window positions (#357)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -234,6 +234,7 @@ CServer::CServer ( const int iNewMaxNumChan,
|
||||||
const bool bNDisconnectAllClientsOnQuit,
|
const bool bNDisconnectAllClientsOnQuit,
|
||||||
const bool bNUseDoubleSystemFrameSize,
|
const bool bNUseDoubleSystemFrameSize,
|
||||||
const ELicenceType eNLicenceType ) :
|
const ELicenceType eNLicenceType ) :
|
||||||
|
vecWindowPosMain (), // empty array
|
||||||
bUseDoubleSystemFrameSize ( bNUseDoubleSystemFrameSize ),
|
bUseDoubleSystemFrameSize ( bNUseDoubleSystemFrameSize ),
|
||||||
iMaxNumChannels ( iNewMaxNumChan ),
|
iMaxNumChannels ( iNewMaxNumChan ),
|
||||||
Socket ( this, iPortNumber ),
|
Socket ( this, iPortNumber ),
|
||||||
|
|
|
@ -251,6 +251,9 @@ public:
|
||||||
void SetLicenceType ( const ELicenceType NLiType ) { eLicenceType = NLiType; }
|
void SetLicenceType ( const ELicenceType NLiType ) { eLicenceType = NLiType; }
|
||||||
ELicenceType GetLicenceType() { return eLicenceType; }
|
ELicenceType GetLicenceType() { return eLicenceType; }
|
||||||
|
|
||||||
|
// window position/state settings
|
||||||
|
QByteArray vecWindowPosMain;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// access functions for actual channels
|
// access functions for actual channels
|
||||||
bool IsConnected ( const int iChanNum )
|
bool IsConnected ( const int iChanNum )
|
||||||
|
|
|
@ -332,6 +332,14 @@ lvwClients->setMinimumHeight ( 140 );
|
||||||
layout()->setMenuBar ( pMenu );
|
layout()->setMenuBar ( pMenu );
|
||||||
|
|
||||||
|
|
||||||
|
// Window positions --------------------------------------------------------
|
||||||
|
// main window
|
||||||
|
if ( !pServer->vecWindowPosMain.isEmpty() && !pServer->vecWindowPosMain.isNull() )
|
||||||
|
{
|
||||||
|
restoreGeometry ( pServer->vecWindowPosMain );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Connections -------------------------------------------------------------
|
// Connections -------------------------------------------------------------
|
||||||
// check boxes
|
// check boxes
|
||||||
QObject::connect ( chbRegisterServer, &QCheckBox::stateChanged,
|
QObject::connect ( chbRegisterServer, &QCheckBox::stateChanged,
|
||||||
|
@ -399,6 +407,15 @@ lvwClients->setMinimumHeight ( 140 );
|
||||||
Timer.start ( GUI_CONTRL_UPDATE_TIME );
|
Timer.start ( GUI_CONTRL_UPDATE_TIME );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CServerDlg::closeEvent ( QCloseEvent* Event )
|
||||||
|
{
|
||||||
|
// store window positions
|
||||||
|
pServer->vecWindowPosMain = saveGeometry();
|
||||||
|
|
||||||
|
// default implementation of this event handler routine
|
||||||
|
Event->accept();
|
||||||
|
}
|
||||||
|
|
||||||
void CServerDlg::OnStartOnOSStartStateChanged ( int value )
|
void CServerDlg::OnStartOnOSStartStateChanged ( int value )
|
||||||
{
|
{
|
||||||
const bool bCurAutoStartMinState = ( value == Qt::Checked );
|
const bool bCurAutoStartMinState = ( value == Qt::Checked );
|
||||||
|
|
|
@ -58,6 +58,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void changeEvent ( QEvent* pEvent );
|
virtual void changeEvent ( QEvent* pEvent );
|
||||||
|
virtual void closeEvent ( QCloseEvent* Event );
|
||||||
|
|
||||||
void UpdateGUIDependencies();
|
void UpdateGUIDependencies();
|
||||||
void UpdateSystemTrayIcon ( const bool bIsActive );
|
void UpdateSystemTrayIcon ( const bool bIsActive );
|
||||||
|
|
|
@ -427,6 +427,10 @@ if ( GetFlagIniSet ( IniXMLDocument, "server", "defcentservaddr", bValue ) )
|
||||||
{
|
{
|
||||||
pServer->SetLicenceType ( static_cast<ELicenceType> ( iValue ) );
|
pServer->SetLicenceType ( static_cast<ELicenceType> ( iValue ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// window position of the main window
|
||||||
|
pServer->vecWindowPosMain = FromBase64ToByteArray (
|
||||||
|
GetIniSetting ( IniXMLDocument, "server", "winposmain_base64" ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -666,6 +670,10 @@ void CSettings::Save()
|
||||||
// licence type
|
// licence type
|
||||||
SetNumericIniSet ( IniXMLDocument, "server", "licencetype",
|
SetNumericIniSet ( IniXMLDocument, "server", "licencetype",
|
||||||
static_cast<int> ( pServer->GetLicenceType() ) );
|
static_cast<int> ( pServer->GetLicenceType() ) );
|
||||||
|
|
||||||
|
// window position of the main window
|
||||||
|
PutIniSetting ( IniXMLDocument, "server", "winposmain_base64",
|
||||||
|
ToBase64 ( pServer->vecWindowPosMain ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// prepare file name for storing initialization data in XML file and store
|
// prepare file name for storing initialization data in XML file and store
|
||||||
|
|
Loading…
Reference in a new issue