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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1473 - (show annotations) (download)
Mon Nov 5 19:07:26 2007 UTC (16 years, 5 months ago) by capela
File size: 2249 byte(s)
* Qt4 migration: still far from complete, the .ui files got shaved
  with special regard to some redundant or duplicated signal/slot
  connections and to the options dialog font aesthetics as also
  other minors.

1 // main.cpp
2 //
3 /****************************************************************************
4 Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved.
5 Copyright (C) 2007, Christian Schoenebeck
6
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 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
21 *****************************************************************************/
22
23 #include "qsamplerAbout.h"
24 #include "qsamplerOptions.h"
25 #include "qsamplerMainForm.h"
26
27 #include <QApplication>
28 #include <QTranslator>
29 #include <QLocale>
30
31
32 //-------------------------------------------------------------------------
33 // main - The main program trunk.
34 //
35
36 int main ( int argc, char **argv )
37 {
38 QApplication app(argc, argv);
39
40 // 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
55 // Construct default settings; override with command line arguments.
56 qsamplerOptions options;
57 if (!options.parse_args(app.argc(), app.argv())) {
58 app.quit();
59 return 1;
60 }
61
62 // Construct, setup and show the main form.
63 QSampler::MainForm w;
64 w.setup(&options);
65 w.show();
66
67 // Register the quit signal/slot.
68 // app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
69
70 return app.exec();
71 }
72
73
74 // end of main.cpp

  ViewVC Help
Powered by ViewVC