mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 14:50:53 +01:00
Classe QETApp renommee en QETDiagramEditor
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@127 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
11
main.cpp
11
main.cpp
@@ -1,6 +1,6 @@
|
||||
#include <QApplication>
|
||||
#include <QTranslator>
|
||||
#include "qetapp.h"
|
||||
#include "qetdiagrameditor.h"
|
||||
|
||||
/**
|
||||
Fonction principale du programme QElectroTech
|
||||
@@ -10,23 +10,24 @@
|
||||
int main(int argc, char **argv) {
|
||||
// Creation de l'application
|
||||
QApplication app(argc, argv);
|
||||
app.setQuitOnLastWindowClosed(false);
|
||||
|
||||
QString system_language = QLocale::system().name().left(2);
|
||||
// charge les eventuelles traductions pour la lib Qt
|
||||
QTranslator qtTranslator;
|
||||
qtTranslator.load("qt_" + system_language, QETApp::languagesPath());
|
||||
qtTranslator.load("qt_" + system_language, QETDiagramEditor::languagesPath());
|
||||
app.installTranslator(&qtTranslator);
|
||||
|
||||
// determine la langue a utiliser pour l'application
|
||||
QTranslator trad;
|
||||
if (system_language != "fr") {
|
||||
// utilisation de la version anglaise par defaut
|
||||
if (!trad.load("qet_" + system_language, QETApp::languagesPath())) trad.load("qet_en", QETApp::languagesPath());
|
||||
if (!trad.load("qet_" + system_language, QETDiagramEditor::languagesPath())) trad.load("qet_en", QETDiagramEditor::languagesPath());
|
||||
app.installTranslator(&trad);
|
||||
}
|
||||
|
||||
// Creation et affichage du QETApp : QElectroTechApplication
|
||||
(new QETApp()) -> show();
|
||||
// Creation et affichage d'un editeur de schema
|
||||
(new QETDiagramEditor()) -> show();
|
||||
// Execution de l'application
|
||||
return(app.exec());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user