Python gtk.MESSAGE_INFO Examples

The following are 12 code examples of gtk.MESSAGE_INFO(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module gtk , or try the search function .
Example #1
Source File: gtktools.py    From Computable with MIT License 6 votes vote down vote up
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 
Example #2
Source File: gtktools.py    From matplotlib-4-abaqus with MIT License 6 votes vote down vote up
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 
Example #3
Source File: main.py    From gimp-plugin-export-layers with GNU General Public License v3.0 6 votes vote down vote up
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) 
Example #4
Source File: step_editor.py    From avocado-vt with GNU General Public License v2.0 5 votes vote down vote up
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() 
Example #5
Source File: status_icon_gtk2.py    From sun with GNU General Public License v3.0 5 votes vote down vote up
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() 
Example #6
Source File: menu.py    From hardening-script-el6-kickstart with Apache License 2.0 5 votes vote down vote up
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 
Example #7
Source File: menu.py    From hardening-script-el6-kickstart with Apache License 2.0 5 votes vote down vote up
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 
Example #8
Source File: bluezchat.py    From python-for-android with Apache License 2.0 5 votes vote down vote up
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() 
Example #9
Source File: main.py    From gimp-plugin-export-layers with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #10
Source File: main.py    From gimp-plugin-export-layers with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #11
Source File: main.py    From gimp-plugin-export-layers with GNU General Public License v3.0 5 votes vote down vote up
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() 
Example #12
Source File: main.py    From gimp-plugin-export-layers with GNU General Public License v3.0 4 votes vote down vote up
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()