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 for storing/recovering the server window positions (#357)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -234,6 +234,7 @@ CServer::CServer ( const int iNewMaxNumChan,
|
|||
const bool bNDisconnectAllClientsOnQuit,
|
||||
const bool bNUseDoubleSystemFrameSize,
|
||||
const ELicenceType eNLicenceType ) :
|
||||
vecWindowPosMain (), // empty array
|
||||
bUseDoubleSystemFrameSize ( bNUseDoubleSystemFrameSize ),
|
||||
iMaxNumChannels ( iNewMaxNumChan ),
|
||||
Socket ( this, iPortNumber ),
|
||||
|
|
|
@ -251,6 +251,9 @@ public:
|
|||
void SetLicenceType ( const ELicenceType NLiType ) { eLicenceType = NLiType; }
|
||||
ELicenceType GetLicenceType() { return eLicenceType; }
|
||||
|
||||
// window position/state settings
|
||||
QByteArray vecWindowPosMain;
|
||||
|
||||
protected:
|
||||
// access functions for actual channels
|
||||
bool IsConnected ( const int iChanNum )
|
||||
|
|
|
@ -332,6 +332,14 @@ lvwClients->setMinimumHeight ( 140 );
|
|||
layout()->setMenuBar ( pMenu );
|
||||
|
||||
|
||||
// Window positions --------------------------------------------------------
|
||||
// main window
|
||||
if ( !pServer->vecWindowPosMain.isEmpty() && !pServer->vecWindowPosMain.isNull() )
|
||||
{
|
||||
restoreGeometry ( pServer->vecWindowPosMain );
|
||||
}
|
||||
|
||||
|
||||
// Connections -------------------------------------------------------------
|
||||
// check boxes
|
||||
QObject::connect ( chbRegisterServer, &QCheckBox::stateChanged,
|
||||
|
@ -399,6 +407,15 @@ lvwClients->setMinimumHeight ( 140 );
|
|||
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 )
|
||||
{
|
||||
const bool bCurAutoStartMinState = ( value == Qt::Checked );
|
||||
|
|
|
@ -58,6 +58,7 @@ public:
|
|||
|
||||
protected:
|
||||
virtual void changeEvent ( QEvent* pEvent );
|
||||
virtual void closeEvent ( QCloseEvent* Event );
|
||||
|
||||
void UpdateGUIDependencies();
|
||||
void UpdateSystemTrayIcon ( const bool bIsActive );
|
||||
|
|
|
@ -427,6 +427,10 @@ if ( GetFlagIniSet ( IniXMLDocument, "server", "defcentservaddr", bValue ) )
|
|||
{
|
||||
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
|
||||
SetNumericIniSet ( IniXMLDocument, "server", "licencetype",
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue