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


Python KanoDialog.set_action_background方法代码示例

本文整理汇总了Python中kano.gtk3.kano_dialog.KanoDialog.set_action_background方法的典型用法代码示例。如果您正苦于以下问题:Python KanoDialog.set_action_background方法的具体用法?Python KanoDialog.set_action_background怎么用?Python KanoDialog.set_action_background使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kano.gtk3.kano_dialog.KanoDialog的用法示例。


在下文中一共展示了KanoDialog.set_action_background方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _show_icon_tutorial

# 需要导入模块: from kano.gtk3.kano_dialog import KanoDialog [as 别名]
# 或者: from kano.gtk3.kano_dialog.KanoDialog import set_action_background [as 别名]
    def _show_icon_tutorial(self):
        try:
            from kano_profile.apps import save_app_state_variable, load_app_state_variable

            if load_app_state_variable('kano-apps', 'icon-tutorial-shown'):
                return
            else:
                save_app_state_variable('kano-apps', 'icon-tutorial-shown', True)
        except ImportError:
            # ignore problems importing kano_profile, as we don't want it to
            # be a dependency
            pass

        kdialog = KanoDialog(
            _("Add more apps to the desktop"),
            _(
                "Click the '+' button to the right of the app name to "
                "make it appear on the desktop. You can remove it again "
                "by clicking on 'x'."
            ),
            {
                _("OK, GOT IT"): {
                    "return_value": 0,
                    "color": "green"
                }
            },
            parent_window=self
        )
        kdialog.set_action_background("grey")
        kdialog.title.description.set_max_width_chars(40)
        kdialog.run()
开发者ID:KanoComputing,项目名称:kano-apps,代码行数:33,代码来源:MainWindow.py

示例2: close_window

# 需要导入模块: from kano.gtk3.kano_dialog import KanoDialog [as 别名]
# 或者: from kano.gtk3.kano_dialog.KanoDialog import set_action_background [as 别名]
        def close_window(self, button, event):
            if common.need_reboot:
                kdialog = KanoDialog(
                    _("Reboot?"),
                    _("Your Kano needs to reboot for changes to apply"),
                    [
                        {
                            'label': _("LATER"),
                            'color': 'grey',
                            'return_value': False
                        },
                        {
                            'label': _("REBOOT NOW"),
                            'color': 'orange',
                            'return_value': True
                        }
                    ],
                    parent_window=self.get_toplevel()
                )

                kdialog.set_action_background('grey')
                do_reboot_now = kdialog.run()
                if do_reboot_now:
                    os.system("sudo systemctl reboot")

            self._trigger_tracking_event()

            Gtk.main_quit()
开发者ID:KanoComputing,项目名称:kano-settings,代码行数:30,代码来源:main_window.py

示例3: _show_more_cb

# 需要导入模块: from kano.gtk3.kano_dialog import KanoDialog [as 别名]
# 或者: from kano.gtk3.kano_dialog.KanoDialog import set_action_background [as 别名]
    def _show_more_cb(self, widget):
        kdialog = KanoDialog(
            self._app["title"],
            self._app['description'] if "description" in self._app else self._app['tagline'],
            {
                _("OK, GOT IT"): {
                    "return_value": 0,
                    "color": "green"
                }
            },
            parent_window=self._window
        )
        kdialog.set_action_background("grey")
        kdialog.title.description.set_max_width_chars(40)
        kdialog.run()

        return True
开发者ID:KanoComputing,项目名称:kano-apps,代码行数:19,代码来源:AppGrid.py

示例4: _show_icon_tutorial

# 需要导入模块: from kano.gtk3.kano_dialog import KanoDialog [as 别名]
# 或者: from kano.gtk3.kano_dialog.KanoDialog import set_action_background [as 别名]
    def _show_icon_tutorial(self):
        if load_app_state_variable('kano-apps', 'icon-tutorial-shown'):
            return
        else:
            save_app_state_variable('kano-apps', 'icon-tutorial-shown', True)

        kdialog = KanoDialog(
            "Add more apps to the desktop",
            "Click the '+' button to the right of the app name to "
            "make it appear on the desktop. You can remove it again "
            "by clicking on 'x'.",
            {
                "OK, GOT IT": {
                    "return_value": 0,
                    "color": "green"
                }
            },
            parent_window=self
        )
        kdialog.set_action_background("grey")
        kdialog.title.description.set_max_width_chars(40)
        kdialog.run()
开发者ID:japonophile,项目名称:kano-apps,代码行数:24,代码来源:MainWindow.py


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