/[svn]/qsampler/tags/qsampler_0_1_3/src/main.cpp
ViewVC logotype

Contents of /qsampler/tags/qsampler_0_1_3/src/main.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 872 - (show annotations) (download)
Thu Jun 1 09:32:02 2006 UTC (17 years, 11 months ago) by (unknown author)
File size: 2293 byte(s)
This commit was manufactured by cvs2svn to create tag 'qsampler_0_1_3'.
1 // main.cpp
2 //
3 /****************************************************************************
4 Copyright (C) 2004, rncbc aka Rui Nuno Capela. All rights reserved.
5
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 2
9 of the License, or (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20 *****************************************************************************/
21
22 #include <qapplication.h>
23 #include <qtextcodec.h>
24
25 #include "qsamplerAbout.h"
26 #include "qsamplerOptions.h"
27 #include "qsamplerMainForm.h"
28
29 //-------------------------------------------------------------------------
30 // main - The main program trunk.
31 //
32
33 int main ( int argc, char **argv )
34 {
35 QApplication app(argc, argv);
36
37 // Load translation support.
38 QTranslator translator(0);
39 QString sLocale = QTextCodec::locale();
40 if (sLocale != "C") {
41 QString sLocName = "qsampler_" + sLocale;
42 if (!translator.load(sLocName, ".")) {
43 QString sLocPath = CONFIG_PREFIX "/share/locale";
44 if (!translator.load(sLocName, sLocPath))
45 fprintf(stderr, "Warning: no locale found: %s/%s.qm\n", sLocPath.latin1(), sLocName.latin1());
46 }
47 app.installTranslator(&translator);
48 }
49
50 // Construct default settings; override with command line arguments.
51 qsamplerOptions options;
52 if (!options.parse_args(app.argc(), app.argv())) {
53 app.quit();
54 return 1;
55 }
56
57 // Construct, setup and show the main form.
58 qsamplerMainForm w;
59 app.setMainWidget(&w);
60 w.setup(&options);
61 w.show();
62
63 // Register the quit signal/slot.
64 // app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
65
66 return app.exec();
67 }
68
69 // end of main.cpp

  ViewVC Help
Powered by ViewVC