serverstart/src/serverstartdlg.cpp
//--------------------------------------------------------------------------------
// This private function will load all values from the *.prefs file and will set
// all edit controls using this values.
//--------------------------------------------------------------------------------
This private function will load all values from the *.prefs file and will set
all edit controls using this values.
This private function will load all values from the * . prefs file and will set all edit controls using this values .
void CServerStartDlg::LoadPrefs(CString & filename) {
const char *pszValue = NULL;
       Settings *new_settings_instance = new Settings("psetPrefs");
       int res=new_settings_instance->open(filename);
       Settings::Item pdf_item("pdfFileUser");
       if( new_settings_instance->read(pdf_item) != -1 ) {
		   if(pdf_item.read(&pszValue)!=-1 && pszValue) {
               m_PdfEdit.SetWindowText(pszValue);
		   }
	   }
       Settings::Item home_item("projectHome");
       if( new_settings_instance->read(home_item) != -1 ) {
		   if(home_item.read(&pszValue)!=-1 && pszValue) {
               m_HomeEdit.SetWindowText(pszValue);
		   }
	   }
       Settings::Item admin_item("ADMINDIR");
       if( new_settings_instance->read(admin_item) != -1 ) {
		   if(admin_item.read(&pszValue)!=-1 && pszValue) {
               m_AdminEdit.SetWindowText(pszValue);
		   }
	   }
       Settings::Item sharedsrc_item("sharedSrcRoot");
       if( new_settings_instance->read(sharedsrc_item) != -1 ) {
		   if(sharedsrc_item.read(&pszValue)!=-1 && pszValue) {
               m_SharedSrcEdit.SetWindowText(pszValue);
		   }
	   }
       Settings::Item privatesrc_item("privateSrcRoot");
       if( new_settings_instance->read(privatesrc_item) != -1 ) {
		   if(privatesrc_item.read(&pszValue)!=-1 && pszValue) {
               m_PrivateSrcEdit.SetWindowText(pszValue);
		   }
	   }
       Settings::Item sharedmodel_item("sharedModelRoot");
       if( new_settings_instance->read(sharedmodel_item) != -1 ) {
		   if(sharedmodel_item.read(&pszValue)!=-1 && pszValue) {
               m_SharedModelEdit.SetWindowText(pszValue);
		   }
	   }
       Settings::Item privatemodel_item("privateModelRoot");
       if( new_settings_instance->read(privatemodel_item) != -1 ) {
		   if(privatemodel_item.read(&pszValue)!=-1 && pszValue) {
               m_PrivateModelEdit.SetWindowText(pszValue);
		   }
	   }
	   new_settings_instance->close(0);
	   delete new_settings_instance;
}
void CServerStartDlg :: LoadPrefs ( CString & filename ) { const char * pszValue = NULL ; Settings * new_settings_instance = new Settings ( " " ) ; int res = new_settings_instance -> open ( filename ) ; Settings :: Item pdf_item ( " " ) ; if ( new_settings_instance -> read ( pdf_item ) != -1 ) { if ( pdf_item . read ( & pszValue ) != -1 && pszValue ) { m_PdfEdit . SetWindowText ( pszValue ) ; } } Settings :: Item home_item ( " " ) ; if ( new_settings_instance -> read ( home_item ) != -1 ) { if ( home_item . read ( & pszValue ) != -1 && pszValue ) { m_HomeEdit . SetWindowText ( pszValue ) ; } } Settings :: Item admin_item ( " " ) ; if ( new_settings_instance -> read ( admin_item ) != -1 ) { if ( admin_item . read ( & pszValue ) != -1 && pszValue ) { m_AdminEdit . SetWindowText ( pszValue ) ; } } Settings :: Item sharedsrc_item ( " " ) ; if ( new_settings_instance -> read ( sharedsrc_item ) != -1 ) { if ( sharedsrc_item . read ( & pszValue ) != -1 && pszValue ) { m_SharedSrcEdit . SetWindowText ( pszValue ) ; } } Settings :: Item privatesrc_item ( " " ) ; if ( new_settings_instance -> read ( privatesrc_item ) != -1 ) { if ( privatesrc_item . read ( & pszValue ) != -1 && pszValue ) { m_PrivateSrcEdit . SetWindowText ( pszValue ) ; } } Settings :: Item sharedmodel_item ( " " ) ; if ( new_settings_instance -> read ( sharedmodel_item ) != -1 ) { if ( sharedmodel_item . read ( & pszValue ) != -1 && pszValue ) { m_SharedModelEdit . SetWindowText ( pszValue ) ; } } Settings :: Item privatemodel_item ( " " ) ; if ( new_settings_instance -> read ( privatemodel_item ) != -1 ) { if ( privatemodel_item . read ( & pszValue ) != -1 && pszValue ) { m_PrivateModelEdit . SetWindowText ( pszValue ) ; } } new_settings_instance -> close ( 0 ) ; delete new_settings_instance ; }
This private function will load all values from the *.prefs file and will set
all edit controls using this values.
This private function will load all values from the * . prefs file and will set all edit controls using this values .