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

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

Initial import of PC-BSD /current/ SVN repo

  • Property mode set to 100755
File size: 987 bytes
Line 
1#include <qapplication.h>
2#include <qtranslator.h>
3#include <QLocale>
4#include <qtextcodec.h>
5#include <QFile>
6#include <QDebug>
7#include "pfmanagerdlg.hpp"
8#include "../config.h"
9
10int main ( int argc, char **argv )
11{
12    QApplication app(argc, argv);
13
14    QLocale mylocale;
15    QTranslator translator;
16    QString langCode = mylocale.name();
17    if ( ! QFile::exists( PREFIX + "/share/pcbsd/i18n/PFManager_" + langCode + ".qm" ) )
18     langCode.truncate(langCode.indexOf("_"));
19    translator.load( QString("PFManager_") + langCode, PREFIX + "/share/pcbsd/i18n/" );
20    app.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
30    PFManagerDlg wnd;
31
32    wnd.load();
33
34    //app.setMainWidget(&wnd);
35    wnd.show();
36    app.connect(&app, SIGNAL(lastWindowClosed()),
37                &app, SLOT(quit()));
38
39    return app.exec();
40}
Note: See TracBrowser for help on using the repository browser.