/*************************************************************************** main.cpp - description ------------------- begin : Die Mai 22 17:24:18 CEST 2001 copyright : (C) 2001 by Ralf Nolden email : nolden@kde.org ***************************************************************************/ /*************************************************************************** * * * 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 * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "config.h" #include #include #include #include #include #include #include #include #include static const char *description = I18N_NOOP("SUSEgreeter"); // INSERT A DESCRIPTION FOR YOUR APPLICATION HERE static KCmdLineOptions options[] = { { 0, 0, 0 } // INSERT YOUR COMMANDLINE OPTIONS HERE }; int main(int argc, char *argv[]) { KAboutData aboutData( "SUSEgreeter", I18N_NOOP("SUSEgreeter"), VERSION, description, KAboutData::License_GPL, "(c) 2001, Adrian Schroeter", 0, 0, "adrian@suse.de"); aboutData.addAuthor("Adrian Schroeter",0, "adrian@suse.de"); KCmdLineArgs::init( argc, argv, &aboutData ); KCmdLineArgs::addCmdLineOptions( options ); // Add our own options. KLocale::setMainCatalogue("SUSEgreeter"); KApplication a; if ( !kapp->dcopClient()->isAttached() ) kapp->dcopClient()->attach(); KGlobal::locale()->insertCatalogue(QString::fromLatin1("kpersonalizer")); // first, reset the startup from true (see desktop file in share/autostart) to false // setCaption("SUSE"); // TODO: i18n("Welcome") kapp->config()->setGroup("General"); bool ktip = (kapp->config()->readBoolEntry("FirstLogin103", true) ); // bool os_dirty = eye_dirty = style_dirty = false; kapp->config()->writeEntry("FirstLogin103", false); kapp->config()->sync(); SUSEgreetings greeter; a.setMainWidget(&greeter); greeter.move( -10000, -10000 ); greeter.show(); QDesktopWidget *dsk = kapp->desktop(); QRect scr = dsk->screenGeometry( dsk->screenNumber( QPoint( 0, 0 ) ) ); QRect grt( 0, 0, greeter.width(), greeter.height() ); grt.moveCenter( scr.center() ); greeter.setGeometry( grt ); int ret = a.exec(); if(ktip){ // only run if we set this to true in the constructor. then SUSEgreeter didn't run before // set the ktiprc file entry to true. The global one is set to false for starting SUSEgreeter KConfig ktiprc("ktiprc"); ktiprc.setGroup("TipOfDay"); ktiprc.writeEntry("RunOnStart", true); ktiprc.sync(); // KRun::runCommand("ktip"); kapp->dcopClient()->send("kicker", "kicker", "showKMenu()", ""); } return ret; }