[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/games/magazynier
From:       Tadeusz Andrzej Kadłubowski <yess () hell ! org ! pl>
Date:       2009-03-18 18:25:20
Message-ID: 1237400720.827558.28500.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 941031 by tkadlubo:

List of available level packs in the menu. Not yet usable, but visible.


 M  +3 -1      Magazynierui.rc  
 M  +21 -2     window.cpp  
 M  +1 -0      window.h  


--- trunk/playground/games/magazynier/Magazynierui.rc #941030:941031
@@ -8,7 +8,9 @@
    <Action name="prev-level" />
    <Action name="next-level" />
    <Separator />
-   <Menu name="level-pack" />
+   <Menu name="level-pack">
+     <ActionList name="level-pack-actions" />
+   </Menu>
   </Menu>
  </MenuBar>
  <ToolBar name="mainToolBar" >
--- trunk/playground/games/magazynier/window.cpp #941030:941031
@@ -24,6 +24,8 @@
 #include <KDebug>
 #include <KGlobal>
 #include <KLocale>
+#include <KMenu>
+#include <KMenuBar>
 #include <KStandardDirs>
 #include <KStatusBar>
 #include <KUndoStack>
@@ -42,8 +44,6 @@
 	m_LevelPack(NULL),
 	m_LevelModel(NULL)
 {	
-	findLevelPacks();
-
 	view = new QGraphicsView();
 	view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
 	view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
@@ -57,7 +57,12 @@
 	statusBar()->insertPermanentItem("", 2); //Moves: 1337
 
 	setupGUI();
+	
 	Renderer::instance()->setViewSize(view->height(), view->width());
+
+	findLevelPacks();
+	setupLevelPackMenu();	
+
 	setupLastPlayedLevelPack();
 
 } //}}}
@@ -93,6 +98,20 @@
 	return;
 } //}}}
 
+void MagazynierWindow::setupLevelPackMenu(void) //{{{
+{
+	QList<QAction *> levelPackActionList;
+	QMap<QString, LevelPack *>::const_iterator i;
+
+	for (i = levelPacks.constBegin(); i != levelPacks.constEnd(); ++i) {
+		KAction *levelPackAction = new KAction(this);
+		levelPackAction->setText(i.key());
+		levelPackActionList.append(levelPackAction);
+	}
+	plugActionList("level-pack-actions", levelPackActionList);
+}
+//}}}
+
 void MagazynierWindow::setupActions(void) //{{{
 {
 	undoStack->createUndoAction(actionCollection(), "");
--- trunk/playground/games/magazynier/window.h #941030:941031
@@ -48,6 +48,7 @@
 		LevelPack *m_LevelPack;
 		LevelModel *m_LevelModel;
 		void findLevelPacks(void);
+		void MagazynierWindow::setupLevelPackMenu(void);
 		
 		QGraphicsView *view;
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic