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

9.1-release9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1
Last change on this file since 1620346 was 1620346, checked in by Kris Moore <kris@…>, 20 months ago

Initial import of PC-BSD /current/ SVN repo

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