当前位置: 首页>>代码示例>>Python>>正文


Python FSGSDirectories.ensure_downloads_dir方法代码示例

本文整理汇总了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()
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:69,代码来源:download.py


注:本文中的fsgs.FSGSDirectories.FSGSDirectories.ensure_downloads_dir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。