summaryrefslogtreecommitdiffstats
path: root/ktip/ktipwindow.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
commit4aed2c8219774f5d797760606b8489a92ddc5163 (patch)
tree3f8c130f7d269626bf6a9447407ef6c35954426a /ktip/ktipwindow.cpp
downloadtdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz
tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.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/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ktip/ktipwindow.cpp')
-rw-r--r--ktip/ktipwindow.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/ktip/ktipwindow.cpp b/ktip/ktipwindow.cpp
new file mode 100644
index 00000000..4da55ed0
--- /dev/null
+++ b/ktip/ktipwindow.cpp
@@ -0,0 +1,61 @@
+/*
+ KTip, the KDE Tip Of the Day
+
+ Copyright (c) 2000, Matthias Hoelzer-Kluepfel
+ Copyright (c) 2002 Tobias Koenig <tokoe82@yahoo.de>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of version 2 of the GNU General Public
+ License as published by the Free Software Foundation
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include <dcopclient.h>
+
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <ktip.h>
+#include <kuniqueapplication.h>
+#include <kwin.h>
+#include <stdlib.h>
+
+static const char description[] = I18N_NOOP("Useful tips");
+
+int main(int argc, char *argv[])
+{
+ KAboutData aboutData("ktip", I18N_NOOP("KTip"),
+ "0.3", description, KAboutData::License_GPL,
+ "(c) 1998-2002, KDE Developers");
+ KCmdLineArgs::init( argc, argv, &aboutData );
+ KUniqueApplication::addCmdLineOptions();
+
+ if (!KUniqueApplication::start())
+ exit(-1);
+
+ KUniqueApplication app;
+
+ KTipDialog *tipDialog = new KTipDialog(new KTipDatabase(locate("data", QString("kdewizard/tips"))));
+ Q_CHECK_PTR(tipDialog);
+#ifdef Q_WS_X11
+ KWin::setState(tipDialog->winId(), NET::StaysOnTop);
+#endif
+ tipDialog->setCaption(i18n("Useful Tips"));
+ app.dcopClient()->send("ksplash", "ksplash", "close()", QByteArray()); // Close splash screen
+ tipDialog->show();
+
+ QObject::connect(qApp, SIGNAL(lastWindowClosed()), qApp, SLOT(quit()));
+
+ app.setMainWidget(tipDialog);
+
+ return app.exec();
+}