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

List:       kde-commits
Subject:    playground/edu/kanagram/src
From:       Joshua Keel <joshuakeel () gmail ! com>
Date:       2005-07-25 14:55:48
Message-ID: 1122303348.460683.18650.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 438621 by jkeel:

Put a 2-second timer on the red input box, making it less harsh to the user


 M  +6 -1      kanagram.cpp  
 M  +1 -0      kanagram.h  
 M  +2 -0      vocabedit.cpp  
 M  +2 -0      vocabsettings.cpp  


--- trunk/playground/edu/kanagram/src/kanagram.cpp #438620:438621
@@ -2,7 +2,6 @@
  *   Copyright (C) 2005 by Joshua Keel                                     *
  *   joshuakeel@gmail.com                                                  *
  *                                                                         *
- *   Portions of this code taken from KSimon by Albert Astals Cid.         *
  *                                                                         *
  *   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  *
@@ -289,6 +288,7 @@
 		else
 		{
 			m_inputBox->setPaletteBackgroundColor(QColor(255, 0, 0));
+			QTimer::singleShot(2000, this, SLOT(resetInputBox()));
 			cout << "Sorry, try again!" << endl;
 			m_inputBox->clear();
 			update();
@@ -541,4 +541,9 @@
 	update();
 }
 
+void Kanagram::resetInputBox()
+{
+	m_inputBox->unsetPalette();
+}
+
 #include "kanagram.moc"
--- trunk/playground/edu/kanagram/src/kanagram.h #438620:438621
@@ -47,6 +47,7 @@
 		void checkWord();
 		void loadSettings();
 		void hideHint();
+		void resetInputBox();
 
 	private:
 		void drawText(QPainter &p, const QString &text, const QPoint &center, bool \
withMargin, int xMargin, int yMargin, QRect *rect, bool highlight, bool bold, QFont \
                &font, QColor fontColor, QColor fontHighlightColor, int fontSize = \
                18);
--- trunk/playground/edu/kanagram/src/vocabedit.cpp #438620:438621
@@ -62,6 +62,8 @@
 		m_vocabList.append(expr);
 		lboxWords->insertItem(doc->getEntry(i)->getOriginal());	
 	}
+	txtVocabName->setText(doc->getTitle());
+	txtDescription->setText(doc->getDocRemark());
 
 	connect(btnSave, SIGNAL(clicked()), this, SLOT(slotSave()));
 	connect(btnNewWord, SIGNAL(clicked()), this, SLOT(slotNewWord()));
--- trunk/playground/edu/kanagram/src/vocabsettings.cpp #438620:438621
@@ -79,10 +79,12 @@
 	if(!info.isWritable())
 	{
 		btnDelete->setEnabled(false);
+		btnEdit->setEnabled(false);
 	}
 	else
 	{
 		btnDelete->setEnabled(true);
+		btnEdit->setEnabled(true);
 	}
 }
 


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

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