~mateo-salta/nitroshare/nitroshare

« back to all changes in this revision

Viewing changes to src/main/main.cpp

  • Committer: Nathan Osman
  • Date: 2012-06-26 23:07:20 UTC
  • Revision ID: admin@quickmediasolutions.com-20120626230720-uzgqoc5w7lnowgx7
Added wizard to run when NitroShare is first started to guide new users in configuring the application.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
#include <QtGui/QApplication>
18
18
 
 
19
#include <dialogs/CFirstStartWizard.h>
19
20
#include <main/CTrayIcon.h>
20
21
#include <util/defaults.h>
 
22
#include <util/settings.h>
21
23
 
22
24
int main(int argc, char *argv[])
23
25
{
24
26
    QApplication a(argc, argv);
25
27
    a.setQuitOnLastWindowClosed(false);
26
28
 
27
 
    // Set information about the application
 
29
    /* Set information about the application. */
28
30
    a.setApplicationName("NitroShare");
29
31
    a.setOrganizationName("Nathan Osman");
30
32
    a.setOrganizationDomain("quickmediasolutions.com");
31
33
 
32
 
    // Load the application defaults
 
34
    /* Load the application defaults. */
33
35
    Defaults::Init();
34
36
 
 
37
    /* If this is the first time the application is started, display
 
38
       the initial setup and configuration wizard. */
 
39
    if(!Settings::Get("Internal/FirstStart").toBool())
 
40
    {
 
41
        if(!CFirstStartWizard().exec())
 
42
            return 1;
 
43
 
 
44
        /* If we reach this point, the user completed the wizard and
 
45
           we should avoid showing it in the future. */
 
46
        Settings::Set("Internal/FirstStart", true);
 
47
    }
 
48
 
35
49
    CTrayIcon icon;
36
50
    
37
51
    return a.exec();