Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
Source code |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
#include "kmedianotify.h" #include <kapplication.h> #include <kaboutdata.h> #include <kcmdlineargs.h> #include <klocale.h> static const char description[] = I18N_NOOP("A KDE KPart Application"); static const char version[] = "0.1"; static KCmdLineOptions options[] = { // { "+[URL]", I18N_NOOP( "Document to open" ), 0 }, {"header <string>",I18N_NOOP("Title of the notification"),""}, {"desc <string>",I18N_NOOP("Description of the notification"),""}, {"img <string>",I18N_NOOP("Icon to be shown in the popup"),"/usr/share/icons/crystalsvg/22x22/apps/hwinfo.png"}, KCmdLineLastOption }; int main(int argc, char **argv) { KAboutData about("kmedianotify", I18N_NOOP("kMediaNotify"), version, description, KAboutData::License_GPL, "(C) 2005 Francis Bélanger", 0, 0, "francis.belanger@gmail.com"); about.addAuthor( "Francis Bélanger", 0, "francis.belanger@gmail.com" ); KCmdLineArgs::init(argc, argv, &about); KCmdLineArgs::addCmdLineOptions( options ); KApplication app; kMediaNotify *mainWin = 0; if (app.isRestored()) { RESTORE(kMediaNotify); } else { // no session.. just start up normally KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); /// @todo do something with the command line args here QString sTitle = args->getOption("header"); QString sDesc = args->getOption("desc"); QString sIcon = args->getOption("img"); mainWin = new kMediaNotify(sTitle,sDesc,sIcon); app.setMainWidget( mainWin ); //mainWin->show(); mainWin->notify(); args->clear(); } // mainWin has WDestructiveClose flag by default, so it will delete itself. return app.exec(); } |
This post has been edited 1 times, last edit by "!nkubus" (Jun 16th 2005, 2:17am)
Forum Software: Burning Board®, developed by WoltLab® GmbH
Linux Computer - Linux Forum -
Linux Computer und Notebooks - Lastminute - Wasserbetten & Whirlpools