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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1460 by capela, Sun Sep 24 12:47:51 2006 UTC revision 1461 by schoenebeck, Sun Oct 28 23:30:36 2007 UTC
# Line 1  Line 1 
1  // main.cpp  // main.cpp
2  //  //
3  /****************************************************************************  /****************************************************************************
4     Copyright (C) 2004-2006, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved.
5    
6     This program is free software; you can redistribute it and/or     This program is free software; you can redistribute it and/or
7     modify it under the terms of the GNU General Public License     modify it under the terms of the GNU General Public License
# Line 19  Line 19 
19    
20  *****************************************************************************/  *****************************************************************************/
21    
22  #include <qapplication.h>  #include <QApplication>
23  #include <qtextcodec.h>  #include <QTextCodec>
24    #include <QTranslator>
25    
26  #include "qsamplerAbout.h"  #include "qsamplerAbout.h"
27  #include "qsamplerOptions.h"  #include "qsamplerOptions.h"
# Line 36  int main ( int argc, char **argv ) Line 37  int main ( int argc, char **argv )
37    
38      // Load translation support.      // Load translation support.
39      QTranslator translator(0);      QTranslator translator(0);
40      QString sLocale = QTextCodec::locale();      QString sLocale = QTextCodec::codecForLocale()->name();
41      if (sLocale != "C") {      if (sLocale != "C") { //TODO: not sure if "C" locale name exists in Qt4
42          QString sLocName = "qsampler_" + sLocale;          QString sLocName = "qsampler_" + sLocale;
43          if (!translator.load(sLocName, ".")) {          if (!translator.load(sLocName, ".")) {
44              QString sLocPath = CONFIG_PREFIX "/share/locale";              QString sLocPath = CONFIG_PREFIX "/share/locale";
45              if (!translator.load(sLocName, sLocPath))              if (!translator.load(sLocName, sLocPath))
46                  fprintf(stderr, "Warning: no locale found: %s/%s.qm\n", sLocPath.latin1(), sLocName.latin1());                  fprintf(stderr, "Warning: no locale found: %s/%s.qm\n", sLocPath.toLatin1().data(), sLocName.toLatin1().data());
47          }          }
48          app.installTranslator(&translator);          app.installTranslator(&translator);
49      }      }
# Line 55  int main ( int argc, char **argv ) Line 56  int main ( int argc, char **argv )
56      }      }
57    
58      // Construct, setup and show the main form.      // Construct, setup and show the main form.
59      qsamplerMainForm w;      QSampler::MainForm w;
60          app.setMainWidget(&w);          app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
61      w.setup(&options);      w.setup(&options);
62      w.show();      w.show();
63    

Legend:
Removed from v.1460  
changed lines
  Added in v.1461

  ViewVC Help
Powered by ViewVC