summaryrefslogtreecommitdiffstats
path: root/kmahjongg/HighScore.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitc90c389a8a8d9d8661e9772ec4144c5cf2039f23 (patch)
tree6d8391395bce9eaea4ad78958617edb20c6a7573 /kmahjongg/HighScore.h
downloadtdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.tar.gz
tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmahjongg/HighScore.h')
-rw-r--r--kmahjongg/HighScore.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/kmahjongg/HighScore.h b/kmahjongg/HighScore.h
new file mode 100644
index 00000000..5db36819
--- /dev/null
+++ b/kmahjongg/HighScore.h
@@ -0,0 +1,77 @@
+
+#ifndef HighScore_included
+#define HighScore_included
+
+#include <qdialog.h>
+
+
+class QLineEdit;
+class QComboBox;
+class QLabel;
+
+const int numScores = 10;
+
+typedef struct HiScoreEntry {
+ QString name;
+ long board;
+ long score;
+ long elapsed;
+
+};
+
+typedef struct TableInstance {
+ QString name;
+ HiScoreEntry entries[numScores];
+ TableInstance *next;
+};
+
+
+class HighScore : public QDialog
+{
+ Q_OBJECT
+
+public:
+
+ HighScore
+ (
+ QWidget* parent = NULL,
+ const char* name = NULL
+ );
+
+ virtual ~HighScore();
+
+ int exec(QString &layout);
+
+
+ void checkHighScore(int score, int elapsed, long game, QString &board);
+public slots:
+ void selectionChanged(int);
+
+protected slots:
+ void nameChanged(const QString &s);
+ void reset();
+private:
+ void addRow(int num); // generate one table row
+ void loadTables(); // initialise from saved
+ void saveTables(); // save to disc.
+ void getBoardName(QString in, QString &out);
+ void selectTable(const QString &name);
+ void setComboTo(const QString &to);
+ void copyTableToScreen(const QString &name);
+ QString &highScoreFile();
+
+ int selectedLine;
+ QLineEdit *lineEdit;
+ QLabel* numbersWidgets[numScores];
+ QLabel* boardWidgets[numScores];
+ QLabel* namesWidgets[numScores];
+ QLabel* scoresWidgets[numScores];
+ QLabel* elapsedWidgets[numScores];
+ QComboBox* combo;
+ QString filename;
+
+ TableInstance *tables;
+ TableInstance *currTable;
+};
+
+#endif // HighScore_included