void Preferences::closeEvent(QCloseEvent *event) { if (!_confirmed) { // Switch back to old translation: QLocale loc( _language_old ); switchLanguage( __supportedLocales.indexOf(loc) ); // Switch back to old GUI-style: switchGUIstyle( _style_old ); } event->accept(); }
/// Hierarchicly sets the context to all children void UIView::setContext(UICore* states) { mCore = states; // -- Being inserted in a UICanvas hierarchy setPositionFlags(mCore->defaultPositionFlags); setSizeFlags(mCore->defaultSizeFlags); for(std::vector<UIView*>::iterator it = m_children.begin(); it != m_children.end(); ++it) { (*it)->setContext(states); } switchLanguage(); }
void MainWindow::init() { m_commandListener = new CommandListener( this ); qApp->setWindowIcon ( QIcon ( ":/shellicons/Icon" ) ); setWindowTitle ( About::applicationName() ); m_settings = new QSettings ( this ); m_cameraToggleAction = new QList < QAction *>; //m_cameraRemoveAction = new QList < QAction *>; m_centralWidget = new CameraViewer ( this ); setCentralWidget ( m_centralWidget ); m_controlBar = new ControlBar( this ); m_layoutBar = new LayoutBar( this ); initSettings(); m_controlBar->updateControls(); m_translator = Translator::instance(); m_translator->setParent( this ); connect ( m_translator , SIGNAL ( languageChanged( QString ) ), this, SLOT( switchLanguage( QString ) ) ); installEventFilter( m_commandListener ); //this is needed in Linux for a correct initial layout display. QTimer::singleShot(0, m_centralWidget, SLOT(layoutCurrentColLayout())); }
void I18nContext::realize() { Container::realize(); switchLanguage(defaultLanguage_); }