rsyncui/main.cpp

34 lines
923 B
C++
Raw Normal View History

2023-01-07 12:44:45 +01:00
#include "mainwindow.h"
#include "tools.h"
2023-01-22 14:33:23 +01:00
#include <QTranslator>
2023-01-07 12:44:45 +01:00
int main(int argc, char *argv[])
{
2024-08-03 15:22:35 +02:00
QApplication a(argc, argv);
QTranslator myappTranslator;
2023-01-22 14:33:23 +01:00
2024-08-03 15:22:35 +02:00
QCoreApplication::setOrganizationName("RsyncUI");
QCoreApplication::setApplicationName("RsyncUI");
2024-08-03 15:22:35 +02:00
// Initialization of localization
QLocale localeName = QLocale::system();
QString localeDir = "/usr/share/locale/" + localeName.name() + "/LC_MESSAGES/"; //RsyncUI_" + localeName.name() + ".qm";
QString localeFilename = QCoreApplication::applicationName() + "_" + localeName.name();
QLocale locale = QLocale();
2023-02-12 19:11:06 +01:00
2024-08-03 15:22:35 +02:00
if (myappTranslator.load(localeFilename, localeDir))
{
a.installTranslator(&myappTranslator);
}
2023-01-18 23:12:21 +01:00
2024-08-03 15:22:35 +02:00
// Enable logging to journald
qputenv("QT_FORCE_STDERR_LOGGING", QByteArray("0"));
2023-03-09 18:13:46 +01:00
2024-08-03 15:22:35 +02:00
static const QString appName = "RsyncUI";
//Password passwdJob;
MainWindow w;
info(DEBUGMACRO, "RsyncUI begining");
2024-08-03 15:22:35 +02:00
w.show();
return a.exec();
2023-01-07 12:44:45 +01:00
}