Kaydet (Commit) 417c1152 authored tarafından Kurt Zenker's avatar Kurt Zenker

INTEGRATION: CWS gh14 (1.70.2); FILE MERGED

2007/06/15 09:24:21 gh 1.70.2.1: #108785#show profilename in statusbar; fix mnemonics for LRU-list > 10 entries
üst 39cd0ef5
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: app.cxx,v $ * $RCSfile: app.cxx,v $
* *
* $Revision: 1.71 $ * $Revision: 1.72 $
* *
* last change: $Author: ihi $ $Date: 2007-06-05 15:09:56 $ * last change: $Author: kz $ $Date: 2007-06-19 14:37:58 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -766,6 +766,9 @@ BasicFrame::BasicFrame() : WorkWindow( NULL, ...@@ -766,6 +766,9 @@ BasicFrame::BasicFrame() : WorkWindow( NULL,
GetMenuBar()->SetHideButtonClickHdl( LINK( this, BasicFrame, HideButtonClick ) ); GetMenuBar()->SetHideButtonClickHdl( LINK( this, BasicFrame, HideButtonClick ) );
} }
const ByteString ProfilePrefix("_profile_");
const USHORT ProfilePrefixLen = ProfilePrefix.Len();
void BasicFrame::LoadIniFile() void BasicFrame::LoadIniFile()
{ {
USHORT i; USHORT i;
...@@ -785,6 +788,9 @@ void BasicFrame::LoadIniFile() ...@@ -785,6 +788,9 @@ void BasicFrame::LoadIniFile()
aConf.SetGroup("Misc"); aConf.SetGroup("Misc");
ByteString aTemp; ByteString aTemp;
ByteString aCurrentProfile = aConf.ReadKey( "CurrentProfile", "Misc" ); ByteString aCurrentProfile = aConf.ReadKey( "CurrentProfile", "Misc" );
pStatus->SetProfileName( String( aCurrentProfile.Copy( ProfilePrefixLen ), RTL_TEXTENCODING_UTF8 ) );
aConf.SetGroup( aCurrentProfile ); aConf.SetGroup( aCurrentProfile );
aTemp = aConf.ReadKey( "AutoReload", "0" ); aTemp = aConf.ReadKey( "AutoReload", "0" );
bAutoReload = ( aTemp.CompareTo("1") == COMPARE_EQUAL ); bAutoReload = ( aTemp.CompareTo("1") == COMPARE_EQUAL );
...@@ -1148,9 +1154,20 @@ BOOL BasicFrame::CompileAll() ...@@ -1148,9 +1154,20 @@ BOOL BasicFrame::CompileAll()
// Menu aufsetzen // Menu aufsetzen
#define MENU2FILENAME( Name ) Name.Copy( Name.SearchAscii(" ") +1) #define MENU2FILENAME( Name ) Name.Copy( Name.SearchAscii(" ") +1).EraseAllChars( '~' )
#define FILENAME2MENU( Nr, Name ) CUniString("~").Append( UniString::CreateFromInt32(i) ).AppendAscii(" ").Append( Name ) #define LRUNr( nNr ) CByteString("LRU").Append( ByteString::CreateFromInt32( nNr ) )
#define LRUNr( nNr ) CByteString("LRU").Append( ByteString::CreateFromInt32(nNr) ) String FILENAME2MENU( USHORT nNr, String aName )
{
String aRet;
if ( nNr <= 9 )
aRet = CUniString("~").Append( UniString::CreateFromInt32( nNr ) );
else if ( nNr == 10 )
aRet = CUniString("1~0");
else
aRet = UniString::CreateFromInt32( nNr );
return aRet.AppendAscii(" ").Append( aName );
}
void BasicFrame::AddToLRU(String const& aFile) void BasicFrame::AddToLRU(String const& aFile)
{ {
Config aConfig(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); Config aConfig(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ));
...@@ -1181,7 +1198,7 @@ void BasicFrame::AddToLRU(String const& aFile) ...@@ -1181,7 +1198,7 @@ void BasicFrame::AddToLRU(String const& aFile)
} }
} }
aConfig.WriteKey(LRUNr(1), ByteString( aFile, RTL_TEXTENCODING_UTF8 ) ); aConfig.WriteKey(LRUNr(1), ByteString( aFile, RTL_TEXTENCODING_UTF8 ) );
if ( pPopup->GetItemPos( IDM_FILE_LRU1 + i-1 ) == MENU_ITEM_NOTFOUND ) if ( pPopup->GetItemPos( IDM_FILE_LRU1 ) == MENU_ITEM_NOTFOUND )
pPopup->InsertItem(IDM_FILE_LRU1,FILENAME2MENU( 1, aFile)); pPopup->InsertItem(IDM_FILE_LRU1,FILENAME2MENU( 1, aFile));
else else
pPopup->SetItemText(IDM_FILE_LRU1,FILENAME2MENU( 1, aFile)); pPopup->SetItemText(IDM_FILE_LRU1,FILENAME2MENU( 1, aFile));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment