Changeset 2 in tspsg-svn for trunk


Ignore:
Timestamp:
Oct 13, 2007, 2:26:06 PM (17 years ago)
Author:
laleppa
Message:

Load English language as default if locale language not available
Center Main Window at application start
Some svn:ignore's

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore set to
      *.vcproj*
      *.ncb
      *.sln
      *.suo
      *.idb
      *.pdb
      ui_*
      moc_*
      qrc_*
      tspsg
      Makefile
      debug
      release
  • trunk/i18n

    • Property svn:ignore set to
      *.qm
  • trunk/src/main.cpp

    r1 r2  
    2929QLocale *qlocale = &QLocale::system();
    3030QTranslator translator;
     31        // Getting current locale languge name and trying to load it
    3132        if (translator.load(qlocale->languageToString(qlocale->language()),"i18n"))
     33                app.installTranslator(&translator);
     34        // If language loading failed and locale language is not
     35        // application's "native" we're trying to load English
     36        else if (qlocale->languageToString(qlocale->language()).compare("Russian") && translator.load("English","i18n"))
    3237                app.installTranslator(&translator);//*/
    3338
  • trunk/src/mainwindow.cpp

    r1 r2  
    2222#include "mainwindow.h"
    2323
     24// TODO: Saving window state on close
     25
    2426MainWindow::MainWindow(QWidget *parent)
    2527        : QMainWindow(parent)
     
    2729        setupUi(this);
    2830        connect(actionSettingsSettings,SIGNAL(triggered()),this,SLOT(ChangeSettings()));
     31        // Centering MainWindow
     32        // TODO: Loading of saved window state
     33QRect rect = geometry();
     34    rect.moveCenter(QApplication::desktop()->screenGeometry(QApplication::desktop()->primaryScreen()).center());
     35        setGeometry(rect);
     36
    2937}
    3038
Note: See TracChangeset for help on using the changeset viewer.