/[svn]/qsampler/trunk/src/main.cpp
ViewVC logotype

Annotation of /qsampler/trunk/src/main.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1558 - (hide annotations) (download)
Thu Dec 6 09:35:33 2007 UTC (16 years, 4 months ago) by capela
File size: 2251 byte(s)
* Qt4 migration: complete QSampler namespace overhaul.

1 capela 73 // main.cpp
2     //
3     /****************************************************************************
4 schoenebeck 1461 Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved.
5 capela 1464 Copyright (C) 2007, Christian Schoenebeck
6 capela 73
7     This program is free software; you can redistribute it and/or
8     modify it under the terms of the GNU General Public License
9     as published by the Free Software Foundation; either version 2
10     of the License, or (at your option) any later version.
11    
12     This program is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15     GNU General Public License for more details.
16    
17 capela 920 You should have received a copy of the GNU General Public License along
18     with this program; if not, write to the Free Software Foundation, Inc.,
19     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 capela 73
21     *****************************************************************************/
22    
23     #include "qsamplerAbout.h"
24     #include "qsamplerOptions.h"
25     #include "qsamplerMainForm.h"
26    
27 capela 1473 #include <QApplication>
28     #include <QTranslator>
29     #include <QLocale>
30    
31    
32 capela 73 //-------------------------------------------------------------------------
33     // main - The main program trunk.
34     //
35    
36     int main ( int argc, char **argv )
37     {
38 capela 1473 QApplication app(argc, argv);
39 capela 73
40 capela 1473 // Load translation support.
41     QTranslator translator(0);
42     QLocale loc;
43     if (loc.language() != QLocale::C) {
44     QString sLocName = "qsampler_" + loc.name();
45     if (!translator.load(sLocName, ".")) {
46     QString sLocPath = CONFIG_PREFIX "/share/locale";
47     if (!translator.load(sLocName, sLocPath))
48     fprintf(stderr, "Warning: no locale found: %s/%s.qm\n",
49     sLocPath.toUtf8().constData(),
50     sLocName.toUtf8().constData());
51     }
52     app.installTranslator(&translator);
53     }
54 capela 73
55 capela 1473 // Construct default settings; override with command line arguments.
56 capela 1558 QSampler::Options options;
57 capela 1473 if (!options.parse_args(app.argc(), app.argv())) {
58     app.quit();
59     return 1;
60     }
61 capela 752
62 capela 1473 // Construct, setup and show the main form.
63     QSampler::MainForm w;
64     w.setup(&options);
65     w.show();
66 capela 73
67 capela 1473 // Register the quit signal/slot.
68     // app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
69 capela 73
70 capela 1473 return app.exec();
71 capela 73 }
72    
73 capela 1464
74 capela 73 // end of main.cpp

  ViewVC Help
Powered by ViewVC