Пример #1
0
 def onLanguageChange(self):
     languageName = self._langBox.currentText()        
     if iep.config.settings.language == languageName:
         return
     # Save new language
     iep.config.settings.language = languageName
     setLanguage(iep.config.settings.language)
     # Notify user
     text = translate('wizard', """
     The language has been changed for this wizard.
     IEP needs to restart for the change to take effect application-wide.
     """)
     m = QtGui.QMessageBox(self)
     m.setWindowTitle(translate("wizard", "Language changed"))
     m.setText(text)
     m.setIcon(m.Information)
     m.exec_()
     
     # Get props of current wizard
     geo = self.wizard().geometry()
     parent = self.wizard().parent()
     # Close ourself!        
     self.wizard().close()
     # Start new one
     w = IEPWizard(parent)
     w.setGeometry(geo)
     w.show()
Пример #2
0
    def onLanguageChange(self):
        languageName = self._langBox.currentText()
        if iep.config.settings.language == languageName:
            return
        # Save new language
        iep.config.settings.language = languageName
        setLanguage(iep.config.settings.language)
        # Notify user
        text = translate(
            'wizard', """
        The language has been changed for this wizard.
        IEP needs to restart for the change to take effect application-wide.
        """)
        m = QtGui.QMessageBox(self)
        m.setWindowTitle(translate("wizard", "Language changed"))
        m.setText(text)
        m.setIcon(m.Information)
        m.exec_()

        # Get props of current wizard
        geo = self.wizard().geometry()
        parent = self.wizard().parent()
        # Close ourself!
        self.wizard().close()
        # Start new one
        w = IEPWizard(parent)
        w.setGeometry(geo)
        w.show()
Пример #3
0
def startIep():
    """ startIep()
    Run IEP.
    """
    
    # Do some imports
    from iep.iepcore import iepLogging # to start logging asap
    from iep.iepcore.main import MainWindow
    
    # Apply users' preferences w.r.t. date representation etc
    # this is required for e.g. strftime("%c")
    # Just using '' does not seem to work on OSX. Thus
    # this odd loop.
    #locale.setlocale(locale.LC_ALL, "")
    for x in ('', 'C', 'en_US', 'en_US.utf8', 'en_US.UTF-8'):
        try:
            locale.setlocale(locale.LC_ALL, x)
            break
        except locale.Error:
            pass
    
    # Set to be aware of the systems native colors, fonts, etc.
    QtGui.QApplication.setDesktopSettingsAware(True)
    
    # Instantiate the application
    QtGui.qApp = MyApp([])  # QtGui.QApplication([])
    
    # Choose language, get locale
    appLocale = setLanguage(config.settings.language)
    
    # Create main window, using the selected locale
    frame = MainWindow(None, appLocale)
    
    # Enter the main loop
    QtGui.qApp.exec_()
Пример #4
0
def startIep():
    """ startIep()
    Run IEP.
    """
    
    # Do some imports
    from iep.iepcore import iepLogging # to start logging asap
    from iep.iepcore.main import MainWindow
    
    # Set to be aware of the systems native colors, fonts, etc.
    QtGui.QApplication.setDesktopSettingsAware(True)
    
    # Prevent loading plugins form the system plugin dir since this may
    # cause multiple versions of the Qt library to be loaded at once,
    # which will conflict.  Note also the writing of qt.conf in the
    # freezeSctipt
    # But on KDE this means that the style of IEP does not fit in, see
    # issue 138. Therefore do *not* disable if running from source on KDE
    disableLibraryPaths = True
    if os.environ.get('KDE_FULL_SESSION'):  # relatively safe way to detect KDE
        if QtGui.__file__.startswith('/usr/'):
            disableLibraryPaths = False
    if disableLibraryPaths:
        QtGui.QApplication.setLibraryPaths([])
    
    # Instantiate the application
    QtGui.qApp = QtGui.QApplication([])
    
    # Choose language, get locale
    locale = setLanguage(config.settings.language)
    
    # Create main window, using the selected locale
    frame = MainWindow(None, locale)
    
    # Enter the main loop
    QtGui.qApp.exec_()