51 #include <QTranslator>
52 #include <QLibraryInfo>
53 #include <QMessageBox>
56 #include "../core/config.h"
57 #include "../core/system/serverinfo.h"
59 #include "../core/system/eptexception.h"
64 int main(
int argc,
char *argv[])
69 RunGuard guard(
"entropypianotuner_runguard");
72 QApplication q(argc, argv);
73 QMessageBox::warning(
nullptr, q.tr(
"Application can not be started"), q.tr(
"The Entropy Piano Tuner could not be started because another instance is already running."));
83 std::unique_ptr<PlatformTools> defaultPlatformTools;
90 QCoreApplication::setOrganizationName(
"tp3");
92 QCoreApplication::setApplicationName(
"Entropy Piano Tuner");
104 QTranslator qtTranslator;
107 if (localeName.isEmpty()) {
109 localeName = QLocale::system().name();
112 QLocale::setDefault(QLocale(localeName));
115 qtTranslator.load(QLocale(),
"qt",
"_",
":/languages/translations");
116 a.installTranslator(&qtTranslator);
119 QTranslator myappTranslator;
120 myappTranslator.load(QLocale(),
"piano_tuner",
"_",
":/languages/translations");
121 a.installTranslator(&myappTranslator);
135 qCritical() <<
"Unhandled exception: ";
137 exitCode = EXIT_FAILURE;
139 catch (
const std::exception &e) {
140 qCritical() <<
"Unhandled exception: ";
141 qCritical() << QString::fromStdString(e.what());
142 exitCode = EXIT_FAILURE;
145 qCritical() <<
"Unhandled exception: ";
146 qCritical() <<
"unknown exception";
147 exitCode = EXIT_FAILURE;
The main application singleton class.
void start()
Function to start the MainWindow and the Core.
void playStartupSound()
Function to play the startup sound.
bool tryToRun()
Try to run the applicaiton, return false if another instance is running.
static const std::string SERVER_DOMAIN
void increaseApplicationRuns()
Increments mApplicationRuns.
void init()
Function to initialise the application.
Class for checking whether the application is already running.
static SettingsForQt & getSingleton()
Getter function for the singleton.
int main(int argc, char *argv[])
virtual const std::string & getFullDescription(void) const
Returns a string with the full description of this error.