本文整理汇总了Python中src.ui.main.Edis.load_files_and_projects方法的典型用法代码示例。如果您正苦于以下问题:Python Edis.load_files_and_projects方法的具体用法?Python Edis.load_files_and_projects怎么用?Python Edis.load_files_and_projects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类src.ui.main.Edis
的用法示例。
在下文中一共展示了Edis.load_files_and_projects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_edis
# 需要导入模块: from src.ui.main import Edis [as 别名]
# 或者: from src.ui.main.Edis import load_files_and_projects [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_())