本文整理匯總了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