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
3 years ago
1609 | 1609 | title=_("Save As"), action=Gtk.FileChooserAction.SAVE, |
1610 | 1610 | ) |
1611 | 1611 | 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 | |
1613 | 1613 | ) |
1614 | 1614 | dialog.set_default_response(Gtk.ResponseType.OK) |
1615 | 1615 | filename = os.path.basename(self.currimg_name) |
1752 | 1752 | # Prompt user for the url: |
1753 | 1753 | dialog = Gtk.Dialog(_("Open Remote"), self.window, Gtk.DialogFlags.MODAL) |
1754 | 1754 | 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 | |
1756 | 1756 | ) |
1757 | 1757 | location = Gtk.Entry.new() |
1758 | 1758 | location.set_size_request(300, -1) |
1793 | 1793 | title=_("Open"), action=Gtk.FileChooserAction.OPEN, |
1794 | 1794 | ) |
1795 | 1795 | 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 | |
1797 | 1797 | ) |
1798 | 1798 | if isfile: |
1799 | 1799 | filter = Gtk.FileFilter.new() |
2162 | 2162 | # Show dialog: |
2163 | 2163 | self.actions_dialog.vbox.show_all() |
2164 | 2164 | 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) | |
2166 | 2166 | close_button.grab_focus() |
2167 | 2167 | self.actions_dialog.run() |
2168 | 2168 | self.refresh_custom_actions_menu() |
2205 | 2205 | ) |
2206 | 2206 | self.dialog_name.set_transient_for(self.actions_dialog) |
2207 | 2207 | 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 | |
2209 | 2209 | ) |
2210 | 2210 | else: |
2211 | 2211 | self.dialog_name = Gtk.Dialog( |
2213 | 2213 | ) |
2214 | 2214 | self.dialog_name.set_transient_for(self.actions_dialog) |
2215 | 2215 | 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 | |
2217 | 2217 | ) |
2218 | 2218 | |
2219 | 2219 | self.dialog_name.set_modal(True) |
2503 | 2503 | self.dialog_shortcut = Gtk.Dialog( |
2504 | 2504 | _("Action Shortcut"), self.dialog_name, Gtk.DialogFlags.MODAL, |
2505 | 2505 | ) |
2506 | self.dialog_shortcut.add_button("_Cancel", Gtk.ResponseType.REJECT) | |
2506 | self.dialog_shortcut.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT) | |
2507 | 2507 | self.shortcut_label = Gtk.Label.new( |
2508 | 2508 | _("Press the desired shortcut for the action.") |
2509 | 2509 | ) |
2602 | 2602 | return |
2603 | 2603 | # Dialog: |
2604 | 2604 | 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) | |
2606 | 2606 | snapbutton = dialog.add_button(_("_Snap"), Gtk.ResponseType.ACCEPT) |
2607 | 2607 | snapimage = Gtk.Image.new() |
2608 | 2608 | snapimage.set_from_stock(Gtk.STOCK_OK, Gtk.IconSize.BUTTON) |
4096 | 4096 | title=_("Choose directory"), action=Gtk.FileChooserAction.OPEN |
4097 | 4097 | ) |
4098 | 4098 | 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 | |
4100 | 4100 | ) |
4101 | 4101 | getdir.set_action(Gtk.FileChooserAction.SELECT_FOLDER) |
4102 | 4102 | getdir.set_filename(self.fixed_dir) |
4577 | 4577 | |
4578 | 4578 | def crop_image(self, action, parameter, data): |
4579 | 4579 | 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) | |
4581 | 4581 | cropbutton = dialog.add_button(_("C_rop"), Gtk.ResponseType.ACCEPT) |
4582 | 4582 | cropimage = Gtk.Image.new() |
4583 | 4583 | cropimage.set_from_stock(Gtk.STOCK_OK, Gtk.IconSize.BUTTON) |
5031 | 5031 | |
5032 | 5032 | def saturation(self, action, parameter, data): |
5033 | 5033 | 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) | |
5035 | 5035 | resizebutton = dialog.add_button(_("_Saturate"), Gtk.ResponseType.ACCEPT) |
5036 | 5036 | resizeimage = Gtk.Image.new() |
5037 | 5037 | resizeimage.set_from_stock(Gtk.STOCK_OK, Gtk.IconSize.BUTTON) |
5085 | 5085 | |
5086 | 5086 | def resize_image(self, action, parameter, data): |
5087 | 5087 | 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) | |
5089 | 5089 | resizebutton = dialog.add_button(_("_Resize"), Gtk.ResponseType.ACCEPT) |
5090 | 5090 | resizeimage = Gtk.Image.new() |
5091 | 5091 | resizeimage.set_from_stock(Gtk.STOCK_OK, Gtk.IconSize.BUTTON) |