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

List:       kde-commits
Subject:    kdeedu/khangman
From:       Anne-Marie Mahfouf <annma () kde ! org>
Date:       2005-04-13 1:21:20
Message-ID: 20050413012120.13EA3633 () office ! kde ! org
[Download RAW message or body]

CVS commit by annma: 

detect if hint available


  M +1 -1      TODO   1.14
  M +1 -1      khangman/khangman.kcfg   1.24
  M +16 -8     khangman/khangmanview.cpp   1.108
  M +1 -1      khangman/khangmanview.h   1.45


--- kdeedu/khangman/TODO  #1.13:1.14
@@ -5,5 +5,5 @@
 - KPassivePopup for tip: good solution? tip appears always at the same place, where \
ever you click. Is that good? Should the tooltip appear where the user clicked \
                instead?
 - usability of the Configure KHangMan dialog
-
+- enable hint: in Settings at the moment, should it be as a button in the toolbar as \
well? (Danny)  
 11 April 2005

--- kdeedu/khangman/khangman/khangman.kcfg  #1.23:1.24
@@ -101,5 +101,5 @@
     <group name="advanced">
             <entry name="Hint" type="Bool">
-            <label>Enable Hint mode if available</label>
+            <label>Enable Hint mode if available i.e. only if hintBool == \
true</label>  <default code="true">false</default>
         </entry>

--- kdeedu/khangman/khangman/khangmanview.cpp  #1.107:1.108
@@ -67,4 +67,5 @@ KHangManView::KHangManView(KHangMan*pare
     accent_b = false;
     m_accent = true;
+    hintBool = true;//assume tip exists
     //tip="";
     //missedL = "_ _ _ _ _  \n_ _ _ _ _  ";
@@ -151,5 +152,5 @@ bool KHangManView::containsChar(const QS
 void KHangManView::mousePressEvent(QMouseEvent *mouse)
 {
-    if (mouse->button() == RightButton)//(kvtmlBool && hintBool && (mouse->button() \
== RightButton)) +    if (mouse->button() == RightButton && hintBool)//(kvtmlBool && \
hintBool && (mouse->button() == RightButton))  {
         KPassivePopup *myPopup = new KPassivePopup( charWrite);
@@ -221,8 +222,9 @@ void KHangManView::paintWordTwice()
     QRect aux = paint.boundingRect(QRect(), AlignCenter|AlignCenter, \
goodWord.left(redIndex));  if (Prefs::mode() ==0) { //sea theme
+        kdDebug() << "aux.width(): " << aux.width() << endl;
         if (redIndex == 0)
-            paint.drawText(width()/50+aux.width(), height()-height()/10- \
height()*126/535/2, width()*366/700, height()*126/535, AlignCenter|AlignCenter, \
QString(goodWord[redIndex])); +            paint.drawText(width()/50, \
height()-height()/10- height()*126/535/2, width()*366/700, height()*126/535, \
AlignCenter, QString(goodWord[redIndex]));  else //weird that it needs 2 pixels less \
                after first
-            paint.drawText(width()/50+aux.width()-2, height()-height()/10- \
height()*126/535/2, width()*366/700, height()*126/535, AlignCenter|AlignCenter, \
QString(goodWord[redIndex])); +            paint.drawText(aux.width()-2, \
height()-height()/10- height()*126/535/2, width()*366/700, height()*126/535, \
AlignCenter|AlignCenter, QString(goodWord[redIndex]));  }
     else { //desert theme
@@ -450,5 +452,7 @@ void KHangManView::slotTry()
                 popup->show();
                 if (Prefs::mode() ==0)  {
-                
+                    int x = width()*332/700;
+                    int y = height()*145/535;
+                    popup->move(x, y);
                 }
                 else  {
@@ -656,9 +660,13 @@ void KHangManView::readFile()
     kdDebug() << "tip : " << tip << endl;
     if (tip.isEmpty()) {
-            hintBool = false;
-            Prefs::setHint(false);
+        Prefs::setHint(false);//hint can't be enabled
             Prefs::writeConfig();
+        hintBool = false;//hint does not exist
             khangman ->changeStatusbar("", 103);
     }
+    else {
+        hintBool = true;
+        khangman ->changeStatusbar(i18n("Hint available"), 103);
+    }
 }
 

--- kdeedu/khangman/khangman/khangmanview.h  #1.44:1.45
@@ -112,5 +112,5 @@ protected:
     ///KDE random generator
     KRandomSequence random;
-    ///true if hint is enabled for the fiels that support it
+    ///true if hint exists
     bool hintBool;
     ///Enable hints on mouse right click if Hints exist


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

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