當前位置: 首頁>>代碼示例>>Python>>正文


Python Edis.show方法代碼示例

本文整理匯總了Python中src.ui.main.Edis.show方法的典型用法代碼示例。如果您正苦於以下問題:Python Edis.show方法的具體用法?Python Edis.show怎麽用?Python Edis.show使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在src.ui.main.Edis的用法示例。


在下文中一共展示了Edis.show方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: run_edis

# 需要導入模塊: from src.ui.main import Edis [as 別名]
# 或者: from src.ui.main.Edis import show [as 別名]
def run_edis(app):
    """ Se carga la interfáz """

    DEBUG("Running Edis...")
    qsettings = QSettings(paths.CONFIGURACION, QSettings.IniFormat)
    # Ícono
    app.setWindowIcon(QIcon(":image/edis"))
    # Lenguaje
    local = QLocale.system().name()
    DEBUG("Loading language...")
    language = settings.get_setting('general/language')
    if language:
        edis_translator = QTranslator()
        edis_translator.load(os.path.join(paths.PATH,
                             "extras", "i18n", language))
        app.installTranslator(edis_translator)
        # Qt translator
        qtranslator = QTranslator()
        qtranslator.load("qt_" + local, QLibraryInfo.location(
                         QLibraryInfo.TranslationsPath))
        app.installTranslator(qtranslator)
    pixmap = QPixmap(":image/splash")
    # Splash screen
    show_splash = False
    if settings.get_setting('general/show-splash'):
        DEBUG("Showing splash...")
        splash = QSplashScreen(pixmap, Qt.WindowStaysOnTopHint)
        splash.setMask(pixmap.mask())
        splash.show()
        app.processEvents()
        show_splash = True

    # Style Sheet
    style = settings.get_setting('window/style-sheet')
    path_style = None
    style_sheet = None
    if style == 'Edark':
        path_style = os.path.join(paths.PATH, 'extras', 'theme', 'edark.qss')
    elif style != 'Default':
        path_style = os.path.join(paths.EDIS, style + '.qss')
    if path_style is not None:
        with open(path_style, mode='r') as f:
            style_sheet = f.read()
    app.setStyleSheet(style_sheet)

    # Fuente en Tooltips
    QToolTip.setFont(QFont(settings.DEFAULT_FONT, 9))

    # GUI
    if show_splash:
        alignment = Qt.AlignBottom | Qt.AlignLeft
        splash.showMessage("Loading UI...", alignment, Qt.white)
    DEBUG("Loading GUI...")
    edis = Edis()
    edis.show()
    # Archivos de última sesión
    files, recents_files, projects = [], [], []
    projects = qsettings.value('general/projects')
    #FIXME:
    if projects is None:
        projects = []
    if settings.get_setting('general/load-files'):
        DEBUG("Loading files and projects...")
        if show_splash:
            splash.showMessage("Loading files...", alignment, Qt.white)
        files = qsettings.value('general/files')
        if files is None:
            files = []
        # Archivos recientes
        recents_files = qsettings.value('general/recents-files')
        if recents_files is None:
            recents_files = []
    # Archivos desde línea de comandos
    files += cmd_parser.parse()
    edis.load_files_and_projects(files, recents_files, projects)
    if show_splash:
        splash.finish(edis)
    DEBUG("Edis is Ready!")
    sys.exit(app.exec_())
開發者ID:Garjy,項目名稱:edis,代碼行數:81,代碼來源:rock_and_roll.py


注:本文中的src.ui.main.Edis.show方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。