Patch #1897 2007-02-24 03:56

stahta01

Windows XP --personality=ask not working
Download
1897-Windows_XP_per.patch (1.2 KB)
Category
Application::Bugfix
Status
Closed
Close date
2007-06-09 11:52
Assigned to
biplab
Index: src/src/app.cpp
===================================================================
--- src/src/app.cpp    (revision 4032)
+++ src/src/app.cpp    (working copy)
@@ -933,14 +933,18 @@
         CompileTimeAssertion<wxMinimumVersion<2,5>::eval>::Assert(); // just to make sure: wxWidgets 2.4 is dead
 
         const wxArrayString items(Manager::Get()->GetPersonalityManager()->GetPersonalitiesList());
+        int persIndex;
+        persIndex = wxGetSingleChoiceIndex
+              (
+                _("Please choose which personality (profile) to load:"),
+                _("Personalities (profiles)"),
+                items
+              );
 
-        wxSingleChoiceDialog dlg(0, _("Please choose which personality (profile) to load:"),
-                                    _("Personalities (profiles)"),
-                                    items);
-        PlaceWindow(&dlg);
-
-        if (dlg.ShowModal() == wxID_OK)
-            Manager::Get()->GetPersonalityManager()->SetPersonality(dlg.GetStringSelection());
+        if ( persIndex != -1 )
+            Manager::Get()->GetPersonalityManager()->SetPersonality(items[persIndex]);
+        else
+            Manager::Get()->GetPersonalityManager()->SetPersonality(_T("default"));
     }
     else
     {
stahta01 2007-02-24 03:57

The command line option of --personality=ask is not working under windows XP SP2; my patch needs tested under Linux etc. Tim S

See thread http://forums.codeblocks.org/index.php?topic=5266

File 1: src/sdk/personalitymanager.cpp

Problem 1: ConfigManager::GetConfigFolder() returns empty string or null string.

Solution 1: Replaced with ConfigManager::GetFolder(sdConfig).

File 2: src/src/app.cpp

Problem 2: Under windows XP SP2, my guess is that wxSingleChoiceDialog has some unknown side effect that prevents code from working.

Solution 2: re-wrote logic using wxGetSingleChoiceIndex

stahta01 2007-03-13 08:15

Updated patch to match changes to SVN.

stahta01 2007-06-01 13:08

Updated to SVN 4032

biplab 2007-06-09 11:52

It has been fixed in Rev 4080.