当前位置: 首页>>代码示例>>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;未经允许,请勿转载。