[M-CVS] CVS: M/src/gui wxMDialogs.cpp,1.396,1.397 wxTemplateDialog.cpp,1.30,1.31
Status: Beta
Brought to you by:
vadz
From: Vadim Z. <va...@us...> - 2003-08-31 13:04:08
|
Update of /cvsroot/mahogany/M/src/gui In directory sc8-pr-cvs1:/tmp/cvs-serv4252/src/gui Modified Files: wxMDialogs.cpp wxTemplateDialog.cpp Log Message: corrections after Profile paths change so that settings are again written to the correct place Index: wxMDialogs.cpp =================================================================== RCS file: /cvsroot/mahogany/M/src/gui/wxMDialogs.cpp,v retrieving revision 1.396 retrieving revision 1.397 diff -b -u -2 -r1.396 -r1.397 --- wxMDialogs.cpp 17 Aug 2003 21:43:47 -0000 1.396 +++ wxMDialogs.cpp 31 Aug 2003 13:04:04 -0000 1.397 @@ -1468,11 +1468,14 @@ bool MFolderDialog::TransferDataToWindow() { - // restore last folder from config - wxString folderName = mApplication-> - GetProfile()->readEntry(GetConfigPath(), ""); + // restore last folder from config (not Profile as we put it in + // M_SETTINGS_CONFIG_SECTION, i.e. outside M_PROFILE_CONFIG_SECTION) + wxConfigBase *config = wxConfigBase::Get(); + if ( config ) + { + wxString folderName = config->Read(GetConfigPath(), ""); if ( !folderName.empty() ) { // select folder in the tree - MFolder *folder = MFolder::Get(folderName); + MFolder_obj folder(folderName); if ( folder ) { @@ -1481,9 +1484,8 @@ wxLogDebug(_T("Couldn't restore the last selected folder in the tree.")); } - - folder->DecRef(); } //else: the folder was probably destroyed since the last time } + } // we can only do it now as wxGTK doesn't allow us to set the focus from @@ -1503,9 +1505,12 @@ { // save the folder name to config - mApplication->GetProfile()-> - writeEntry(GetConfigPath(), m_folder->GetFullName()); + wxConfigBase *config = wxConfigBase::Get(); + if ( config ) + { + config->Write(GetConfigPath(), m_folder->GetFullName()); } } - else + } + else // file has been chosen { // the name of the folder can't contain '/' and such, so take just the @@ -3139,5 +3144,5 @@ // hack: use a long label for sizer calculations m_labelValue = new wxStaticText(m_frame, -1, _("XXXXXX done")); - sizer->Add(m_labelValue, 0, wxALL, 10); + sizer->Add(m_labelValue, 0, wxLEFT | wxRIGHT, 10); m_frame->SetAutoLayout(TRUE); Index: wxTemplateDialog.cpp =================================================================== RCS file: /cvsroot/mahogany/M/src/gui/wxTemplateDialog.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -b -u -2 -r1.30 -r1.31 --- wxTemplateDialog.cpp 22 Jul 2003 22:01:41 -0000 1.30 +++ wxTemplateDialog.cpp 31 Aug 2003 13:04:04 -0000 1.31 @@ -878,6 +878,9 @@ path << '/' << M_SETTINGS_CONFIG_SECTION << "/TemplateEditKind"; - Profile *profile = mApplication->GetProfile(); - long kindLastEdited = profile->readEntry(path, (long)MessageTemplate_Reply); + wxConfigBase *config = wxConfigBase::Get(); + + long + kindLastEdited = config ? config->Read(path, (long)MessageTemplate_Reply) + : MessageTemplate_Reply; if ( kindLastEdited < 0 || kindLastEdited >= MessageTemplate_Max ) { @@ -889,7 +892,7 @@ wxAllTemplatesDialog dlg((MessageTemplateKind)kindLastEdited, menu, parent); - if ( dlg.ShowModal() == wxID_OK ) + if ( dlg.ShowModal() == wxID_OK && config ) { - profile->writeEntry(path, dlg.GetTemplateKind()); + config->Write(path, dlg.GetTemplateKind()); } } |