Bug 51494 - Playground menu is not updated appropriately
Summary: Playground menu is not updated appropriately
Status: CLOSED FIXED
Alias: None
Product: ktuberling
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Eric Bischoff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-04 17:38 UTC by johnny
Modified: 2003-03-03 10:46 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description johnny 2002-12-04 17:38:21 UTC
Version:            (using KDE KDE 3.0.99)
Installed from:    Compiled From Sources
OS:          Linux

There are actually two bugs in the Playground menu.
First one: if you select the (let's say) A background, and then you load a saved file with B background, the tick in the menu doesn't get updated to the current background.

Second bug: If you select (let's say) background B, and then you select it again, it should do nothing, but instead it unselects it making the menu without any selection (which is senseless in this context..)
Comment 1 George Staikos 2003-03-02 23:13:32 UTC
Subject: KDE_3_1_BRANCH: kdegames/ktuberling

CVS commit by staikos: 

Backport fix for 51494.  Please remember to backport your bug fixes!
(and close the bug)

Note: please review the warnings in this code.  It has some dangerous looking
warnings right now.

CCMAIL: 51494-done@bugs.kde.org, domseichter@web.de


  M +1 -1      playground.cpp   1.19.2.1
  M +11 -2     toplevel.cpp   1.55.2.1


--- kdegames/ktuberling/playground.cpp  #1.19:1.19.2.1
@@ -590,5 +590,5 @@ bool PlayGround::loadFrom(const QString 
     return false;
   }
-  change(newGameboard);
+  topLevel->changeGameboard(newGameboard);
 
   for (;;)

--- kdegames/ktuberling/toplevel.cpp  #1.55:1.55.2.1
@@ -151,6 +151,9 @@ void TopLevel::changeGameboard(uint newG
 {
   // Do not accept to switch to same gameboard
-  if (newGameboard == selectedGameboard)
+  if (newGameboard == selectedGameboard) {
+    // select this gameboard again
+    ((KToggleAction*) actionCollection()->action(gameboardActions[newGameboard].latin1()))->setChecked(true);
     return;
+  }
 
   // Unselect preceeding gameboard
@@ -161,4 +164,7 @@ void TopLevel::changeGameboard(uint newG
   writeOptions();
 
+  if( !((KToggleAction*) actionCollection()->action(gameboardActions[selectedGameboard].latin1()))->isChecked() )
+    ((KToggleAction*) actionCollection()->action(gameboardActions[selectedGameboard].latin1()))->setChecked(true);
+  
   // Change gameboard effectively
   playGround->change(newGameboard);
@@ -169,6 +175,9 @@ void TopLevel::changeLanguage(uint newLa
 {
   // Do not accept to switch to same language
-  if (newLanguage == selectedLanguage && soundEnabled)
+  if (newLanguage == selectedLanguage && soundEnabled) {
+    // newLanguage should stay checked
+    ((KToggleAction*) actionCollection()->action(languageActions[newLanguage].latin1()))->setChecked(true);
     return;
+  }
 
   // Unselect preceeding language


Comment 2 domseichter 2003-03-03 10:46:28 UTC
Bug is fixed in CVS HEAD (fix will be part of 3.1.1) and therefore closed.