ditz import
[kfpm.git] / kfpm.cpp
blob4efbfca59dbed94a3a107b385b6f48f599709400
1 /*
2 * main.cpp
4 * Copyright (c) 2007 VOROSKOI Andras <voroskoi@frugalware.org>
6 * Copyright: See COPYING file that comes with this distribution.
8 */
10 #include <iostream>
11 #include <qapplication.h>
12 #include <qtimer.h>
14 #include <unistd.h>
15 #include <sys/types.h>
17 #include "kfpm.h"
18 #include "mainwidget.h"
20 KFPM::KFPM(int & argc, char ** argv) : QApplication(argc, argv)
22 MainWidget *w = new MainWidget();
23 connect(this, SIGNAL(lastWindowClosed()), this, SLOT(quit()) );
24 setMainWidget(w);
25 w->show();
26 QTimer *t = new QTimer(w);
27 connect( t, SIGNAL(timeout()), w, SLOT(slot_initialize()) );
28 t->start( 0, TRUE );
31 int main( int argc, char **argv )
33 uid_t uid = geteuid();
34 if (uid != 0) {
35 std::cout << "You have to be root to run kfpm.\n";
36 exit (1);
38 return KFPM(argc, argv).exec();