17
17
#include <QApplication>
20
#include <QMessageBox>
21
20
#include <QTranslator>
23
22
#include <dialogs/CFirstStartWizard.h>
24
23
#include <main/CTrayIcon.h>
25
#include <rpc/CRPCServer.h>
26
24
#include <util/defaults.h>
27
25
#include <util/settings.h>
27
int main(int argc, char *argv[])
29
QApplication a(argc, argv);
30
a.setQuitOnLastWindowClosed(false);
32
/* Set information about the application. */
33
a.setApplicationName("NitroShare");
34
a.setOrganizationName("Nathan Osman");
35
a.setOrganizationDomain("quickmediasolutions.com");
31
37
/* Determine what the user's default locale is set to
32
38
and attempt to load the appropriate translation. */
33
39
QString locale = QLocale::system().name();
38
44
qDebug() << "Unable to load translation" << QString("translations/%1.qm").arg(locale);
40
46
QApplication::installTranslator(&translator);
43
int main(int argc, char *argv[])
45
QApplication a(argc, argv);
46
a.setQuitOnLastWindowClosed(false);
48
/* Set information about the application. */
49
a.setApplicationName("NitroShare");
50
a.setOrganizationName("Nathan Osman");
51
a.setOrganizationDomain("quickmediasolutions.com");
53
/* Initialize the locale and load the application defaults. */
48
/* Load the application defaults. */
57
// TODO: we need to send a message to anything occupying the RPC
58
// port to see if it is NitroShare - if it is, then tell the user
59
// that we are already running. If not, then try another port and
60
// write it to the configuration file immediately.
62
/* Determine if NitroShare is already running. */
66
qDebug() << "Unable to initialize RPC server. Assuming the application is already running.";
68
QMessageBox::critical(NULL, QObject::tr("Error:"), QObject::tr("NitroShare is already running. Please close the current instance before launching the application again."));
72
51
/* If this is the first time the application is started, display
73
52
the initial setup and configuration wizard. */
74
53
if(!Settings::Get("Internal/FirstStart").toBool())