source: src-qt4/pc-sysmanager/main.cpp @ 7cc177e

9.2-releasereleng/10.0releng/10.0.1
Last change on this file since 7cc177e was 7cc177e, checked in by Kris Moore <kris@…>, 7 months ago

Fix up all the last bits of clang / HEAD fussiness

  • Property mode set to 100644
File size: 1.0 KB
Line 
1#include <qapplication.h>
2#include <qtranslator.h>
3#include <qtextcodec.h>
4#include <qstylefactory.h>
5#include <qdesktopwidget.h>
6#include <QDebug>
7#include <unistd.h>
8#include <sys/types.h>
9#include "pbsystemtab.h"
10#include "../config.h"
11
12int main( int argc, char ** argv )
13{
14   QApplication a(argc, argv);
15
16   QTranslator translator;
17   QLocale mylocale;
18   QString langCode = mylocale.name();
19   if ( ! QFile::exists( PREFIX + "/share/pcbsd/i18n/PBSystem_" + langCode + ".qm" ) )
20     langCode.truncate(langCode.indexOf("_"));
21   translator.load( QString("PBSystem_") + langCode, PREFIX + "/share/pcbsd/i18n/" );
22   a.installTranslator( &translator );
23   qDebug() << "Locale:" << langCode;
24
25   // Make sure we are running as root
26   if (getuid() != 0) {
27      qDebug("Error, needs to be run as root");
28      exit(1);
29   }
30
31   PBSystemTab w;
32
33   w.ProgramInit();
34
35   QString Tmp = a.argv()[1];
36   if ( Tmp == "-updates" )
37     w.changeOpenTab(1);
38
39   w.show();
40   a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
41   return a.exec();
42}
Note: See TracBrowser for help on using the repository browser.