source: src-qt4/qsudo/main.cpp @ b633c064

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

Add new qsudo "sudo" password helper app

  • Property mode set to 100644
File size: 727 bytes
Line 
1#include <qtranslator.h>
2#include <qlocale.h>
3#include <QApplication>
4#include <QFile>
5#include "mainwindow.h"
6#include "../config.h"
7
8int main(int argc, char *argv[])
9{   
10    QApplication a(argc, argv);
11
12    QTranslator translator;
13    QLocale mylocale;
14    QString langCode = mylocale.name();
15    if ( ! QFile::exists(PREFIX + "/share/pcbsd/i18n/qsudo_" + langCode + ".qm" ) )
16        langCode.truncate(langCode.indexOf("_"));
17
18    if ( QFile::exists(PREFIX + "/share/pcbsd/i18n/qsudo_" + langCode + ".qm" ) ) {
19      translator.load( QString("qsudo_") + langCode, PREFIX + "/share/pcbsd/i18n/" );
20      a.installTranslator( &translator );
21    }
22
23    MainWindow w;
24    w.ProgramInit();
25    w.show();
26
27    return a.exec();
28}
Note: See TracBrowser for help on using the repository browser.