本文整理汇总了Python中ubuntutweak.gui.dialogs.QuestionDialog.launch方法的典型用法代码示例。如果您正苦于以下问题:Python QuestionDialog.launch方法的具体用法?Python QuestionDialog.launch怎么用?Python QuestionDialog.launch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ubuntutweak.gui.dialogs.QuestionDialog
的用法示例。
在下文中一共展示了QuestionDialog.launch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_file_set
# 需要导入模块: from ubuntutweak.gui.dialogs import QuestionDialog [as 别名]
# 或者: from ubuntutweak.gui.dialogs.QuestionDialog import launch [as 别名]
self.add_start(theme_box, False, False, 0)
def on_file_set(self, widget):
try:
tf = ThemeFile(widget.get_filename())
except Exception, e:
log.error(e)
ErrorDialog(message=_('Theme file is invalid')).launch()
else:
if tf.install():
log.debug("Theme installed! Now update the combox")
valid_icon_themes = theme.get_valid_icon_themes()
self.icon_theme.update_texts_values_pair(valid_icon_themes, valid_icon_themes)
dialog = QuestionDialog(title=_('"%s" installed successfully' % tf.theme_name),
message=_('Would you like to set your icon theme to "%s" immediatelly?') % tf.theme_name)
response = dialog.launch()
if response == Gtk.ResponseType.YES:
self.icon_theme.get_setting().set_value(tf.install_name)
def _get_valid_icon_themes(self):
# This function is taken from gnome-tweak-tool
dirs = ( '/usr/share/icons',
os.path.join(os.path.expanduser("~"), ".icons"))
valid = walk_directories(dirs, lambda d:
os.path.isdir(d) and \
not os.path.exists(os.path.join(d, "cursors")))
valid.sort()
return valid