本文整理汇总了Python中fsgs.FSGSDirectories.FSGSDirectories.ensure_downloads_dir方法的典型用法代码示例。如果您正苦于以下问题:Python FSGSDirectories.ensure_downloads_dir方法的具体用法?Python FSGSDirectories.ensure_downloads_dir怎么用?Python FSGSDirectories.ensure_downloads_dir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fsgs.FSGSDirectories.FSGSDirectories
的用法示例。
在下文中一共展示了FSGSDirectories.ensure_downloads_dir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from fsgs.FSGSDirectories import FSGSDirectories [as 别名]
# 或者: from fsgs.FSGSDirectories.FSGSDirectories import ensure_downloads_dir [as 别名]
def __init__(self, parent, fsgs):
fsui.Window.__init__(self, parent, gettext("Download Game Manually"))
self.fsgs = fsgs
self.download_page = fsgs.config.get("download_page")
self.download_notice = fsgs.config.get("download_notice")
self.task = None
self.layout = fsui.VerticalLayout()
self.layout.set_padding(20, 20, 20, 20)
self.icon_header = IconHeader(
self, fsui.Icon("web-browser", "pkg:workspace"),
gettext("Download Game Manually"),
gettext("This game must be downloaded before you can play it"))
self.layout.add(self.icon_header, fill=True, margin_bottom=20)
label = fsui.HeadingLabel(self, gettext(
"Please open the following web page and download the "
"game from there:"))
label.set_min_width(500)
self.layout.add(label)
hori_layout = fsui.HorizontalLayout()
self.layout.add(hori_layout, fill=True, margin_top=10)
hori_layout.add(fsui.ImageView(self, fsui.Image(
"launcher:res/16/world_link.png")))
label = fsui.URLLabel(self, self.download_page, self.download_page)
hori_layout.add(label, margin_left=6)
if self.download_notice:
label = fsui.MultiLineLabel(self, self.download_notice)
label.set_min_width(500)
self.layout.add(label, margin_top=20)
label = fsui.HeadingLabel(self, gettext(
"Download to the following directory, and then "
"click '{0}':".format(gettext("Scan Downloads"))))
label.set_min_width(500)
self.layout.add(label, margin_top=20)
hori_layout = fsui.HorizontalLayout()
self.layout.add(hori_layout, fill=True, margin_top=10)
hori_layout.add(fsui.ImageView(self, fsui.Image(
"launcher:res/16/folder.png")))
label = fsui.Label(self, FSGSDirectories.ensure_downloads_dir())
hori_layout.add(label, margin_left=6)
hori_layout = fsui.HorizontalLayout()
self.layout.add(hori_layout, fill=True, margin_top=20)
self.status_label = fsui.Label(self, "")
hori_layout.add(self.status_label, expand=True)
self.scan_button = fsui.Button(self, gettext("Scan Downloads"))
self.scan_button.activated.connect(self.on_scan_files)
hori_layout.add(self.scan_button, margin_left=20)
self.close_button = fsui.Button(self, gettext("Close"))
self.close_button.activated.connect(self.on_close)
hori_layout.add(self.close_button, margin_left=10)
self.set_size(self.layout.get_min_size())
self.center_on_parent()