source: src-qt4/pc-usermanager/main.cpp @ 38bddb5

9.2-releasereleng/10.0releng/10.0.1
Last change on this file since 38bddb5 was 38bddb5, checked in by Ken Moore <ken@…>, 6 months ago

Fix one compilation warning in pc-usermanager for 10.x, Kris should probably look at the other two to make sure that the logic does not get changed on accident.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1#include <qtranslator.h>
2#include <QApplication>
3#include <qlocale.h>
4#include <QDebug>
5#include "pcbsdusermanager.h"
6#include "../config.h"
7
8int main( int argc, char ** argv )
9{
10
11    QApplication a(argc, argv);
12
13    QTranslator translator;
14    QLocale mylocale;
15    QString langCode = mylocale.name();
16    if ( ! QFile::exists(PREFIX + "/share/pcbsd/i18n/pcbsdusermanager_" + langCode + ".qm" ) )
17      langCode.truncate(langCode.indexOf("_"));
18    translator.load( QString("pcbsdusermanager_") + langCode, PREFIX + "/share/pcbsd/i18n/" );
19    a.installTranslator( &translator );
20    qDebug() << "Locale:" << langCode;
21
22    PCBSDUserManager w; 
23
24    if ( argc >= 2)
25    {
26       QString chkarg = argv[1];
27       // Running in a warden jail?
28       if ( chkarg == "-warden" )
29         if ( argc == 4 ){
30           w.setWardenMode(QString(argv[2]), QString(argv[3]));
31         }else{
32           qDebug() << "Usage: -warden <directory> <ip>";
33           exit(1);
34         }
35    }
36       
37    w.setupUMDialogs();
38    w.show();
39    a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
40    return a.exec();
41}
Note: See TracBrowser for help on using the repository browser.