Package list mirage / 8c168f0
Go back to using stock buttons for dialogs It's deprecated, but currently fits the application better. All stock buttons should be removed in one release in the future. Thomas Ross 1 year, 6 months ago
1 changed file(s) with 12 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
16091609 title=_("Save As"), action=Gtk.FileChooserAction.SAVE,
16101610 )
16111611 dialog.add_buttons(
1612 "_Cancel", Gtk.ResponseType.CANCEL, "_Save", Gtk.ResponseType.OK
1612 Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_SAVE, Gtk.ResponseType.OK
16131613 )
16141614 dialog.set_default_response(Gtk.ResponseType.OK)
16151615 filename = os.path.basename(self.currimg_name)
17521752 # Prompt user for the url:
17531753 dialog = Gtk.Dialog(_("Open Remote"), self.window, Gtk.DialogFlags.MODAL)
17541754 dialog.add_buttons(
1755 "_Cancel", Gtk.ResponseType.CANCEL, "_Open", Gtk.ResponseType.OK
1755 Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OPEN, Gtk.ResponseType.OK
17561756 )
17571757 location = Gtk.Entry.new()
17581758 location.set_size_request(300, -1)
17931793 title=_("Open"), action=Gtk.FileChooserAction.OPEN,
17941794 )
17951795 dialog.add_buttons(
1796 "_Cancel", Gtk.ResponseType.CANCEL, "_Open", Gtk.ResponseType.OK
1796 Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OPEN, Gtk.ResponseType.OK
17971797 )
17981798 if isfile:
17991799 filter = Gtk.FileFilter.new()
21622162 # Show dialog:
21632163 self.actions_dialog.vbox.show_all()
21642164 instructions.set_size_request(self.actions_dialog.size_request().width - 50, -1)
2165 close_button = self.actions_dialog.add_button("_Close", Gtk.ResponseType.CLOSE)
2165 close_button = self.actions_dialog.add_button(Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE)
21662166 close_button.grab_focus()
21672167 self.actions_dialog.run()
21682168 self.refresh_custom_actions_menu()
22052205 )
22062206 self.dialog_name.set_transient_for(self.actions_dialog)
22072207 self.dialog_name.add_buttons(
2208 "_Cancel", Gtk.ResponseType.REJECT, "_OK", Gtk.ResponseType.ACCEPT
2208 Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT, Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT
22092209 )
22102210 else:
22112211 self.dialog_name = Gtk.Dialog(
22132213 )
22142214 self.dialog_name.set_transient_for(self.actions_dialog)
22152215 self.dialog_name.add_buttons(
2216 "_Cancel", Gtk.ResponseType.REJECT, "_OK", Gtk.ResponseType.ACCEPT
2216 Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT, Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT
22172217 )
22182218
22192219 self.dialog_name.set_modal(True)
25032503 self.dialog_shortcut = Gtk.Dialog(
25042504 _("Action Shortcut"), self.dialog_name, Gtk.DialogFlags.MODAL,
25052505 )
2506 self.dialog_shortcut.add_button("_Cancel", Gtk.ResponseType.REJECT)
2506 self.dialog_shortcut.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT)
25072507 self.shortcut_label = Gtk.Label.new(
25082508 _("Press the desired shortcut for the action.")
25092509 )
26022602 return
26032603 # Dialog:
26042604 dialog = Gtk.Dialog(_("Screenshot"), self.window, Gtk.DialogFlags.MODAL,)
2605 dialog.add_button("_Cancel", Gtk.ResponseType.REJECT)
2605 dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT)
26062606 snapbutton = dialog.add_button(_("_Snap"), Gtk.ResponseType.ACCEPT)
26072607 snapimage = Gtk.Image.new()
26082608 snapimage.set_from_stock(Gtk.STOCK_OK, Gtk.IconSize.BUTTON)
40964096 title=_("Choose directory"), action=Gtk.FileChooserAction.OPEN
40974097 )
40984098 getdir.add_buttons(
4099 "_Cancel", Gtk.ResponseType.CANCEL, "_Open", Gtk.ResponseType.OK
4099 Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OPEN, Gtk.ResponseType.OK
41004100 )
41014101 getdir.set_action(Gtk.FileChooserAction.SELECT_FOLDER)
41024102 getdir.set_filename(self.fixed_dir)
45774577
45784578 def crop_image(self, action, parameter, data):
45794579 dialog = Gtk.Dialog(_("Crop Image"), self.window, Gtk.DialogFlags.MODAL,)
4580 dialog.add_button("_Cancel", Gtk.ResponseType.REJECT)
4580 dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT)
45814581 cropbutton = dialog.add_button(_("C_rop"), Gtk.ResponseType.ACCEPT)
45824582 cropimage = Gtk.Image.new()
45834583 cropimage.set_from_stock(Gtk.STOCK_OK, Gtk.IconSize.BUTTON)
50315031
50325032 def saturation(self, action, parameter, data):
50335033 dialog = Gtk.Dialog(_("Saturation"), self.window, Gtk.DialogFlags.MODAL,)
5034 dialog.add_button("_Cancel", Gtk.ResponseType.REJECT)
5034 dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT)
50355035 resizebutton = dialog.add_button(_("_Saturate"), Gtk.ResponseType.ACCEPT)
50365036 resizeimage = Gtk.Image.new()
50375037 resizeimage.set_from_stock(Gtk.STOCK_OK, Gtk.IconSize.BUTTON)
50855085
50865086 def resize_image(self, action, parameter, data):
50875087 dialog = Gtk.Dialog(_("Resize Image"), self.window, Gtk.DialogFlags.MODAL)
5088 dialog.add_button("_Cancel", Gtk.ResponseType.REJECT)
5088 dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT)
50895089 resizebutton = dialog.add_button(_("_Resize"), Gtk.ResponseType.ACCEPT)
50905090 resizeimage = Gtk.Image.new()
50915091 resizeimage.set_from_stock(Gtk.STOCK_OK, Gtk.IconSize.BUTTON)