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

List:       kde-commits
Subject:    KDE/kdegames/ksame
From:       Simon Huerlimann <simon.huerlimann () access ! unizh ! ch>
Date:       2007-05-19 11:31:31
Message-ID: 1179574291.281730.1491.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 666283 by huerlimann:

Move mainwindow action setup into own method.


 M  +19 -13    mainwindow.cpp  
 M  +2 -1      mainwindow.h  


--- trunk/KDE/kdegames/ksame/mainwindow.cpp #666282:666283
@@ -2,6 +2,7 @@
  *   KSame
  *   Copyright (C) 1997,1998  Marcus Kreutzberger <kreutzbe@informatik.mu-luebeck.de>
  *   Copyright (C) 2006 Henrique Pinto <henrique.pinto@kdemail.net>
+ *   Copyright (C) 2007 Simon Hürlimann <simon.huerlimann@huerlisi.ch>
  *
  *   This program is free software; you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
@@ -48,25 +49,13 @@
 KSame::MainWindow::MainWindow( QWidget *parent )
 	: KXmlGuiWindow( parent )
 {
-	KStandardGameAction::gameNew(this, SLOT(newGame()), actionCollection());
-	m_restartAction = KStandardGameAction::restart(this, SLOT( restartGame() ), actionCollection());
-	KStandardGameAction::highscores(this, SLOT(showHighScoreDialog()), actionCollection());
-	KStandardGameAction::quit(this, SLOT(close()), actionCollection());
-	m_undoAction = KStandardGameAction::undo(this, SLOT( undo() ), actionCollection());
 
-	m_randomBoardAction = new KToggleAction(i18n("&Random Board"), actionCollection());
-    actionCollection()->addAction("random_board", m_randomBoardAction);
-	m_showNumberRemainingAction = new KToggleAction(i18n("&Show Number Remaining"), actionCollection());
-	actionCollection()->addAction("showNumberRemaining", m_showNumberRemainingAction);
-	connect(m_showNumberRemainingAction, SIGNAL(triggered(bool) ), SLOT(showNumberRemainingToggled()));
-
 	m_statusBar = statusBar();
 	m_statusBar->insertItem( i18n( "Colors: XX" ), 1, 1 );
 	m_statusBar->insertItem( i18n( "Board: XXXXXX" ), 2, 1 );
 	m_statusBar->insertItem( i18n( "Marked: 0" ), 3, 1 );
 	m_statusBar->insertItem( i18n( "Score: 0" ), 4, 1 );
 
-
 	m_board = new KSame::Board( this );
 	connect( m_board, SIGNAL( scoreChanged( quint32 ) ),           this, SLOT( setScore( quint32 ) ) );
 	connect( m_board, SIGNAL( newCountOfMarkedStones( int ) ),     this, SLOT( setMarked( int ) ) );
@@ -76,7 +65,7 @@
 	KSame::View* view = new KSame::View( m_board );
 	setCentralWidget( view );
 
-	setupGUI( QSize( 576, 384 ) );
+	setupActions();
 
 	m_randomBoardAction->setChecked( true );
 
@@ -91,6 +80,23 @@
 	}
 }
 
+void KSame::MainWindow::setupActions()
+{
+	KStandardGameAction::gameNew(this, SLOT(newGame()), actionCollection());
+	m_restartAction = KStandardGameAction::restart(this, SLOT( restartGame() ), actionCollection());
+	KStandardGameAction::highscores(this, SLOT(showHighScoreDialog()), actionCollection());
+	KStandardGameAction::quit(this, SLOT(close()), actionCollection());
+	m_undoAction = KStandardGameAction::undo(this, SLOT( undo() ), actionCollection());
+
+	m_randomBoardAction = new KToggleAction(i18n("&Random Board"), actionCollection());
+    actionCollection()->addAction("random_board", m_randomBoardAction);
+	m_showNumberRemainingAction = new KToggleAction(i18n("&Show Number Remaining"), actionCollection());
+	actionCollection()->addAction("showNumberRemaining", m_showNumberRemainingAction);
+	connect(m_showNumberRemainingAction, SIGNAL(triggered(bool) ), SLOT(showNumberRemainingToggled()));
+
+	setupGUI( QSize( 576, 384 ) );
+}
+
 void KSame::MainWindow::readProperties( const KConfigGroup &conf )
 {
 	Q_UNUSED(conf)
--- trunk/KDE/kdegames/ksame/mainwindow.h #666282:666283
@@ -2,6 +2,7 @@
  *   KSame
  *   Copyright (C) 1997,1998  Marcus Kreutzberger <kreutzbe@informatik.mu-luebeck.de>
  *   Copyright (C) 2006 Henrique Pinto <henrique.pinto@kdemail.net>
+ *   Copyright (C) 2007 Simon Hürlimann <simon.huerlimann@huerlisi.ch>
  *
  *   This program is free software; you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
@@ -53,7 +54,7 @@
 
 		protected:
 			void newGame(unsigned int board, int colors);
-
+			void setupActions();
 			virtual void saveProperties(KConfigGroup &conf);
 			virtual void readProperties(const KConfigGroup &conf);
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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