summaryrefslogtreecommitdiffstats
path: root/libksirtet/common/main.cpp
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 /libksirtet/common/main.cpp
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 'libksirtet/common/main.cpp')
-rw-r--r--libksirtet/common/main.cpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/libksirtet/common/main.cpp b/libksirtet/common/main.cpp
new file mode 100644
index 00000000..004b86ca
--- /dev/null
+++ b/libksirtet/common/main.cpp
@@ -0,0 +1,60 @@
+#include "main.h"
+#include "main.moc"
+
+#include <klocale.h>
+#include <kaction.h>
+#include <kstdaction.h>
+#include <kkeydialog.h>
+#include <kconfigdialog.h>
+
+#include "inter.h"
+#include "factory.h"
+
+void MainWindow::addConfig(KConfigDialog *dialog)
+{
+ QWidget *w = cfactory->createAIConfig();
+ if (w) dialog->addPage(w, i18n("A.I."), "personal");
+}
+
+void MainWindow::init()
+{
+ Interface *inter = static_cast<Interface *>(_inter);
+ inter->normalGame();
+ setFocusPolicy(StrongFocus);
+
+ // Modes
+ bool ama = ( bfactory->bbi.nbArcadeStages!=0 );
+ QString s = (ama ? i18n("&Single Human (Normal)") : i18n("&Single Human"));
+ (void)new KAction(s, 0, inter, SLOT(normalGame()),
+ actionCollection(), "mp_single_human");
+ if (ama) (void)new KAction(i18n("&Single Human (Arcade)"), 0,
+ inter, SLOT(arcadeGame()),
+ actionCollection(), "mp_arcade");
+ (void)new KAction(i18n("Human vs &Human"), 0, inter, SLOT(humanVsHuman()),
+ actionCollection(), "mp_human_vs_human");
+ (void)new KAction(i18n("Human vs &Computer"), 0,
+ inter, SLOT(humanVsComputer()),
+ actionCollection(), "mp_human_vs_computer");
+ (void)new KAction(i18n("&More..."), 0, inter, SLOT(dialog()),
+ actionCollection(), "mp_more");
+
+ buildGUI(inter);
+ connect(this, SIGNAL(settingsChanged()),
+ inter, SLOT(settingsChangedSlot()));
+}
+
+void MainWindow::addKeys(KKeyDialog &d)
+{
+ static_cast<Interface *>(_inter)->addKeys(d);
+}
+
+void MainWindow::saveKeys()
+{
+ static_cast<Interface *>(_inter)->saveKeys();
+}
+
+void MainWindow::focusInEvent(QFocusEvent *e)
+{
+ static_cast<Interface *>(_inter)->setFocus();
+ BaseMainWindow::focusInEvent(e);
+}