本文整理汇总了Python中gtk.MESSAGE_INFO属性的典型用法代码示例。如果您正苦于以下问题:Python gtk.MESSAGE_INFO属性的具体用法?Python gtk.MESSAGE_INFO怎么用?Python gtk.MESSAGE_INFO使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类gtk
的用法示例。
在下文中一共展示了gtk.MESSAGE_INFO属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: simple_message
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import MESSAGE_INFO [as 别名]
def simple_message(msg, parent=None, title=None):
"""
create a simple message dialog with string msg. Optionally set
the parent widget and dialog title
"""
dialog = gtk.MessageDialog(
parent = None,
type = gtk.MESSAGE_INFO,
buttons = gtk.BUTTONS_OK,
message_format = msg)
if parent is not None:
dialog.set_transient_for(parent)
if title is not None:
dialog.set_title(title)
dialog.show()
dialog.run()
dialog.destroy()
return None
示例2: _on_reset_settings_activate
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import MESSAGE_INFO [as 别名]
def _on_reset_settings_activate(self, menu_item):
response_id, clear_operations = display_reset_prompt(
parent=self._dialog,
more_settings_shown=self._settings["gui/show_more_settings"].value)
if response_id == gtk.RESPONSE_YES:
if clear_operations:
operations.clear(self._settings["main/procedures"])
operations.clear(self._settings["main/constraints"])
else:
self._settings["main/procedures"].tags.add("ignore_reset")
self._settings["main/constraints"].tags.add("ignore_reset")
self._reset_settings()
self._save_settings()
if clear_operations:
update.clear_setting_sources(self._settings)
else:
self._settings["main/procedures"].tags.remove("ignore_reset")
self._settings["main/constraints"].tags.remove("ignore_reset")
self._display_inline_message(_("Settings reset."), gtk.MESSAGE_INFO)
示例3: message
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import MESSAGE_INFO [as 别名]
def message(self, text, title):
dlg = gtk.MessageDialog(self.window,
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
gtk.MESSAGE_INFO,
gtk.BUTTONS_CLOSE,
title)
dlg.set_title(title)
dlg.format_secondary_text(text)
dlg.run()
dlg.destroy()
示例4: message
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import MESSAGE_INFO [as 别名]
def message(self, data):
"""Function to display messages to the user
"""
msg = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO,
gtk.BUTTONS_CLOSE, data)
msg.set_resizable(1)
msg.set_title(self.dialog_title)
self.img.set_from_file(self.sun_icon)
msg.set_image(self.img)
msg.show_all()
msg.run()
msg.destroy()
示例5: show_help_main
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import MESSAGE_INFO [as 别名]
def show_help_main(self,args):
self.help_text = ("<b>Install Help</b>\n\n- All LVM partitions need to take less than or equal to 100% of the LVM Volume Group.\n\n- Pressing OK prompts for a password to encrypt Disk (LUKS), GRUB, and Root password.\n\n- The sshusers group controls remote access, wheel group is for root users, and isso group is for limited root with auditing permissions.\n\n- To access root remotely via ssh you need to create a user and add them to the wheel and sshusers groups.\n\n- Minimum password length is 14 characters, using a strong password is recommended.\n")
self.MessageBox(self.window,self.help_text,gtk.MESSAGE_INFO)
# System Profile Configuration
示例6: MessageBox
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import MESSAGE_INFO [as 别名]
def MessageBox(self,parent,text,type=gtk.MESSAGE_INFO):
message = gtk.MessageDialog(parent,0,type,gtk.BUTTONS_OK)
message.set_markup(text)
response = message.run()
if response == gtk.RESPONSE_OK:
message.destroy()
# Get Password
示例7: alert
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import MESSAGE_INFO [as 别名]
def alert(text, buttons=gtk.BUTTONS_NONE, type=gtk.MESSAGE_INFO):
md = gtk.MessageDialog(buttons=buttons, type=type)
md.label.set_text(text)
md.run()
md.destroy()
示例8: _on_image_preview_updated
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import MESSAGE_INFO [as 别名]
def _on_image_preview_updated(self, preview, update_duration_seconds):
if (self._settings[
"gui/image_preview_automatic_update_if_below_maximum_duration"].value
and (update_duration_seconds
>= self._MAXIMUM_IMAGE_PREVIEW_AUTOMATIC_UPDATE_DURATION_SECONDS)):
self._settings["gui/image_preview_automatic_update"].set_value(False)
self._display_inline_message(
"{}\n\n{}".format(
_("Disabling automatic preview update."),
_("The preview takes too long to update. "
+ "You may turn automatic updates back on "
+ "from the menu above the previewed image.")),
gtk.MESSAGE_INFO)
示例9: _on_save_settings_activate
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import MESSAGE_INFO [as 别名]
def _on_save_settings_activate(self, menu_item):
save_successful = self._save_settings()
if save_successful:
self._display_inline_message(_("Settings successfully saved."), gtk.MESSAGE_INFO)
示例10: export_layers
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import MESSAGE_INFO [as 别名]
def export_layers(self):
progress_updater = pg.gui.GtkProgressUpdater(self._progress_bar)
item_progress_indicator = progress_.ItemProgressIndicator(
self._progress_bar, progress_updater)
item_progress_indicator.install_progress_for_status()
self._layer_exporter = exportlayers.LayerExporter(
gimpenums.RUN_WITH_LAST_VALS,
self._image,
self._settings["main"],
pg.overwrite.NoninteractiveOverwriteChooser(
self._settings["main/overwrite_mode"].value),
progress_updater,
export_context_manager=handle_gui_in_export,
export_context_manager_args=[self._dialog])
try:
self._layer_exporter.export(layer_tree=self._layer_tree)
except exportlayers.ExportLayersCancelError:
pass
except exportlayers.ExportLayersError as e:
display_export_failure_message(e, parent=self._dialog)
except Exception as e:
if pdb.gimp_image_is_valid(self._image):
raise
else:
display_export_failure_invalid_image_message(
traceback.format_exc(), parent=self._dialog)
else:
if not self._layer_exporter.exported_layers:
messages_.display_message(
_("No layers were exported."), gtk.MESSAGE_INFO, parent=self._dialog)
finally:
item_progress_indicator.uninstall_progress_for_status()
示例11: _on_button_export_clicked
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import MESSAGE_INFO [as 别名]
def _on_button_export_clicked(self, button, lock_update_key):
self._setup_gui_before_export()
overwrite_chooser, progress_updater = self._setup_layer_exporter()
item_progress_indicator = progress_.ItemProgressIndicator(
self._progress_bar, progress_updater)
item_progress_indicator.install_progress_for_status(
self._progress_set_value_and_show_dialog)
should_quit = True
self._name_preview.lock_update(True, lock_update_key)
self._image_preview.lock_update(True, lock_update_key)
try:
self._layer_exporter.export()
except exportlayers.ExportLayersCancelError as e:
should_quit = False
except exportlayers.ExportLayersError as e:
display_export_failure_message(e, parent=self._dialog)
should_quit = False
except Exception as e:
if pdb.gimp_image_is_valid(self._image):
raise
else:
display_export_failure_invalid_image_message(
traceback.format_exc(), parent=self._dialog)
else:
self._settings["special/first_plugin_run"].set_value(False)
self._settings["special/first_plugin_run"].save()
if not self._layer_exporter.exported_layers:
messages_.display_message(
_("No layers were exported."), gtk.MESSAGE_INFO, parent=self._dialog)
should_quit = False
finally:
item_progress_indicator.uninstall_progress_for_status()
self._layer_exporter = None
self._name_preview.lock_update(False, lock_update_key)
self._image_preview.lock_update(False, lock_update_key)
if (overwrite_chooser.overwrite_mode
in self._settings["main/overwrite_mode"].items.values()):
self._settings["main/overwrite_mode"].set_value(overwrite_chooser.overwrite_mode)
self._settings["main"].save([pg.config.SESSION_SOURCE])
self._settings["gui"].save([pg.config.SESSION_SOURCE])
self._settings["gui_session"].save([pg.config.SESSION_SOURCE])
if should_quit:
gtk.main_quit()
else:
self._restore_gui_after_export()
progress_updater.reset()