~ubuntu-branches/ubuntu/vivid/system-config-printer/vivid

« back to all changes in this revision

Viewing changes to troubleshoot/Shrug.py

  • Committer: Package Import Robot
  • Author(s): Till Kamppeter
  • Date: 2014-07-06 09:41:43 UTC
  • mfrom: (1.1.81)
  • Revision ID: package-import@ubuntu.com-20140706094143-yvp3kzo7ti1ghih8
Tags: 1.4.5+20140706-0ubuntu1
* New upstream release
   o GIT 1.4.x snapshot from 6 July 2014
   o Some codec fixes
   o Traceback fixes
   o IPv6 address entry fix
   o Auth info saving improvement
   o Some loop/hang bug fixes
   o Use LockButton for fewer auth dialogs
* 30_newprinter-driver-download-override-false-error-alarm.patch,
  33_dont-use-hp-makeuri-with-non-hp-printers.patch:
  Removed, included upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
        box.set_layout (Gtk.ButtonBoxStyle.END)
50
50
        page.pack_start (box, False, False, 0)
51
51
 
52
 
        self.save = Gtk.Button (stock=Gtk.STOCK_SAVE)
 
52
        self.save = Gtk.Button.new_from_stock (Gtk.STOCK_SAVE)
53
53
        box.pack_start (self.save, False, False, 0)
54
54
 
55
55
        troubleshooter.new_page (page, self)
67
67
    def on_save_clicked (self, button):
68
68
        while True:
69
69
            parent = self.troubleshooter.get_window()
70
 
            dialog = Gtk.FileChooserDialog (parent=parent,
71
 
                                            action=Gtk.FileChooserAction.SAVE,
72
 
                                            buttons=(Gtk.STOCK_CANCEL,
73
 
                                                     Gtk.ResponseType.CANCEL,
74
 
                                                     Gtk.STOCK_SAVE,
75
 
                                                     Gtk.ResponseType.OK))
 
70
            dialog = Gtk.FileChooserDialog (transient_for=parent,
 
71
                                            action=Gtk.FileChooserAction.SAVE)
 
72
            dialog.add_buttons (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
 
73
                                Gtk.STOCK_SAVE, Gtk.ResponseType.OK)
76
74
            dialog.set_do_overwrite_confirmation (True)
77
75
            dialog.set_current_name ("troubleshoot.txt")
78
76
            dialog.set_default_response (Gtk.ResponseType.OK)
88
86
                                               end=self.buffer.get_end_iter (),
89
87
                                               include_hidden_chars=False))
90
88
            except IOError as e:
91
 
                err = Gtk.MessageDialog (parent,
92
 
                                         Gtk.DialogFlags.MODAL |
93
 
                                         Gtk.DialogFlags.DESTROY_WITH_PARENT,
94
 
                                         Gtk.MessageType.ERROR,
95
 
                                         Gtk.ButtonsType.CLOSE,
96
 
                                         _("Error saving file"))
 
89
                err = Gtk.MessageDialog (parent=parent,
 
90
                                         flags=Gtk.DialogFlags.MODAL |
 
91
                                               Gtk.DialogFlags.DESTROY_WITH_PARENT,
 
92
                                         message_type=Gtk.MessageType.ERROR,
 
93
                                         buttons=Gtk.ButtonsType.CLOSE,
 
94
                                         message_format=_("Error saving file"))
97
95
                err.format_secondary_text (_("There was an error saving "
98
96
                                             "the file:") + "\n" +
99
97
                                           e.strerror)