source: src-qt4/pc-zmanager/main.cpp @ 125dbc9

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

Welcome the new 'pc-zmanager' for ZFS & Disk Management

A HUGE Thank You to: Claudio L <claudio@…>

Update pkg-plist and add it to the control panel

  • Property mode set to 100644
File size: 1021 bytes
Line 
1#include "zmanagerwindow.h"
2#include <QApplication>
3#include <QFile>
4#include <QDebug>
5#include <qtranslator.h>
6#include <qlocale.h>
7#include <qtsingleapplication.h>
8
9#ifndef PREFIX
10#define PREFIX QString("/usr/local")
11#endif
12
13
14
15
16
17
18int main(int argc, char *argv[])
19{
20    QtSingleApplication a(argc, argv);
21    if ( a.isRunning() )
22      return !(a.sendMessage("show"));
23
24    QTranslator translator;
25    QLocale mylocale;
26    QString langCode = mylocale.name();
27    if ( ! QFile::exists( PREFIX + "/share/pcbsd/i18n/ZManager_" + langCode + ".qm" ) )
28      langCode.truncate(langCode.indexOf("_"));
29    translator.load( QString("ZManager_") + langCode, PREFIX + "/share/pcbsd/i18n/" );
30    a.installTranslator( &translator );
31    qDebug() << "Locale:" << langCode;
32
33    ZManagerWindow w;
34
35
36    w.ProgramInit();
37
38    w.show();
39
40    QObject::connect(&a, SIGNAL(messageReceived(const QString&)), &w, SLOT(slotSingleInstance()) );
41//    a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
42    return a.exec();
43}
Note: See TracBrowser for help on using the repository browser.