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

List:       kde-commits
Subject:    kdeedu/kmessedwords/kmessedwords
From:       Anne-Marie Mahfouf <annma () kde ! org>
Date:       2004-11-09 18:43:12
Message-ID: 20041109184312.961FA16D68 () office ! kde ! org
[Download RAW message or body]

CVS commit by annma: 

forgot to remove 2 obsolete files
clean code: better names for methods


  M +1 -1      Makefile.am   1.36
  M +3 -1      kmwview.cpp   1.5
  M +1 -0      main.cpp   1.21
  M +20 -18    mainwindow.cpp   1.57
  M +6 -3      mainwindow.h   1.30
  R            mwconfig.cpp   1.25
  R            mwconfig.h   1.12


--- kdeedu/kmessedwords/kmessedwords/Makefile.am  #1.35:1.36
@@ -1,5 +1,5 @@
 ####### kdevelop will overwrite this part!!! (begin)##########
 bin_PROGRAMS = kmessedwords
-kmessedwords_SOURCES = minparser.cpp answer.cpp mainwindow.cpp frontend.ui \
kmwdict.ui mwconfig.cpp scores.cpp kwritewords.cpp main.cpp kmwview.cpp prefs.kcfgc \
interface.ui game.ui +kmessedwords_SOURCES = minparser.cpp answer.cpp mainwindow.cpp \
frontend.ui kmwdict.ui scores.cpp kwritewords.cpp main.cpp kmwview.cpp prefs.kcfgc \
interface.ui game.ui  kmessedwords_LDADD   =  $(LIB_KFILE) $(LIB_KDEUI) \
$(LIB_KDECORE) $(LIB_QT) $(LIBSOCKET)  

--- kdeedu/kmessedwords/kmessedwords/kmwview.cpp  #1.4:1.5
@@ -31,6 +31,8 @@ KmwView::KmwView(MainWindow *parent, con
     : FrontEnd(parent, name)
 {
-        //guesses=0L;
+        guesses=0L;
         tGuesses=0L;
+        solvedWords=0L;
+        messups=0L;
         btnMess->setFocus();    //focus on "Messup" button
         

--- kdeedu/kmessedwords/kmessedwords/main.cpp  #1.20:1.21
@@ -37,4 +37,5 @@ int main(int argc, char *argv[])
   aboutData.addAuthor("Reuben Sutton","Maintainer","reuben@microsucks.co.uk");
   aboutData.addAuthor("Primoz Anzur","Original Maintainer/Author", \
"zerokode@gmx.net"); +  aboutData.addAuthor("Anne-Marie Mahfouf","Port to KConfig XT, \
clean code", "annma@kde.org");  aboutData.addCredit("Waldo Bastian","Created the core \
KMW engine / improved syllables engine", "bastian@kde.org");  \
aboutData.addCredit("Chris Howells","Added \"Help\" menu", "howells@kde.org");

--- kdeedu/kmessedwords/kmessedwords/mainwindow.cpp  #1.56:1.57
@@ -43,7 +43,6 @@ MainWindow::MainWindow()
         // tell the KMainWindow that this is indeed the main widget
         setCentralWidget(m_view);
-        
+        //connect close of dictionary to new game
         connect(&showConfig, SIGNAL(getClose()), m_view, SLOT(slot_messup()) );
-
         //config
         config = kapp->config();
@@ -62,7 +61,5 @@ MainWindow::MainWindow()
 
         check_update();
-        //TODO loadSettings(); //themeString
-        winRefresh();
-
+        loadSettings(); //themeString
         setupActions();
 }
@@ -119,18 +116,13 @@ void MainWindow::optionsPreferences()
         game *mGame =  new game( 0, "Game" );
         dialog->addPage(mGame, i18n("Game"), "game");
-        connect(dialog, SIGNAL(settingsChanged()), this, SLOT(winRefresh()));
+        connect(dialog, SIGNAL(settingsChanged()), this, SLOT(updateSettings()));
         dialog->show();
         
 }
 
-void MainWindow::closeEvent(QCloseEvent *)
-{
-        exit(0);
-}
-
-void MainWindow::winRefresh()
+void MainWindow::loadSettings()
 {
-        //get the themes in the combobox
-        //TODO run at first only
+        m_view->leveler->setEnabled(true);
+        //find the themes
         QDir d(locate("data","kmessedwords/themes/")); //the theme directory...
         d.setFilter( QDir::Dirs);
@@ -142,6 +134,11 @@ void MainWindow::winRefresh()
                 }
         }
+        setBackgroundPic();
+}
+
+void MainWindow::setBackgroundPic()
+{
+        //get the themes in the combobox
         QPixmap bgPix;
-        m_view->leveler->setEnabled(true);
         themeName=themeString[Prefs::name()];
         if(Prefs::background())
@@ -155,5 +152,10 @@ void MainWindow::winRefresh()
                 m_view->mainScreen->setBackgroundColor("#DCDCDC");
         }
+}
 
+void MainWindow::updateSettings()
+{
+        //if pic changed TODO test?
+        setBackgroundPic();
         if(Prefs::buttons())
         {

--- kdeedu/kmessedwords/kmessedwords/mainwindow.h  #1.29:1.30
@@ -56,5 +56,5 @@ public:
 public slots:
         void slot_openBook();
-        void winRefresh();
+        void updateSettings();
 
 protected:
@@ -67,7 +67,10 @@ protected:
         KConfig *config;
 
-        void closeEvent(QCloseEvent *);
         ///Set up the actions for the menus
         void setupActions();
+        ///Set up the settings at start
+        void loadSettings();
+        ///Set the background picture
+        void setBackgroundPic();
 
         QString c_word;


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

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