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

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

Fix up all the last bits of clang / HEAD fussiness

  • Property mode set to 100755
File size: 1.0 KB
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#include <unistd.h>
10#include <sys/types.h>
11
12int main ( int argc, char **argv )
13{
14    QApplication app(argc, argv);
15
16    QLocale mylocale;
17    QTranslator translator;
18    QString langCode = mylocale.name();
19    if ( ! QFile::exists( PREFIX + "/share/pcbsd/i18n/PFManager_" + langCode + ".qm" ) )
20     langCode.truncate(langCode.indexOf("_"));
21    translator.load( QString("PFManager_") + langCode, PREFIX + "/share/pcbsd/i18n/" );
22    app.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
32    PFManagerDlg wnd;
33
34    wnd.load();
35
36    //app.setMainWidget(&wnd);
37    wnd.show();
38    app.connect(&app, SIGNAL(lastWindowClosed()),
39                &app, SLOT(quit()));
40
41    return app.exec();
42}
Note: See TracBrowser for help on using the repository browser.