Format with black
Thomas Ross
3 years ago
1611 | 1611 | title=_("Save As"), action=Gtk.FileChooserAction.SAVE, |
1612 | 1612 | ) |
1613 | 1613 | dialog.add_buttons( |
1614 | Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_SAVE, Gtk.ResponseType.OK | |
1614 | Gtk.STOCK_CANCEL, | |
1615 | Gtk.ResponseType.CANCEL, | |
1616 | Gtk.STOCK_SAVE, | |
1617 | Gtk.ResponseType.OK, | |
1615 | 1618 | ) |
1616 | 1619 | dialog.set_default_response(Gtk.ResponseType.OK) |
1617 | 1620 | filename = os.path.basename(self.currimg_name) |
1755 | 1758 | # Prompt user for the url: |
1756 | 1759 | dialog = Gtk.Dialog(_("Open Remote"), self.window, Gtk.DialogFlags.MODAL) |
1757 | 1760 | dialog.add_buttons( |
1758 | Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OPEN, Gtk.ResponseType.OK | |
1761 | Gtk.STOCK_CANCEL, | |
1762 | Gtk.ResponseType.CANCEL, | |
1763 | Gtk.STOCK_OPEN, | |
1764 | Gtk.ResponseType.OK, | |
1759 | 1765 | ) |
1760 | 1766 | location = Gtk.Entry.new() |
1761 | 1767 | location.set_size_request(300, -1) |
1796 | 1802 | title=_("Open"), action=Gtk.FileChooserAction.OPEN, |
1797 | 1803 | ) |
1798 | 1804 | dialog.add_buttons( |
1799 | Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OPEN, Gtk.ResponseType.OK | |
1805 | Gtk.STOCK_CANCEL, | |
1806 | Gtk.ResponseType.CANCEL, | |
1807 | Gtk.STOCK_OPEN, | |
1808 | Gtk.ResponseType.OK, | |
1800 | 1809 | ) |
1801 | 1810 | if isfile: |
1802 | 1811 | filter = Gtk.FileFilter.new() |
2166 | 2175 | # Show dialog: |
2167 | 2176 | self.actions_dialog.vbox.show_all() |
2168 | 2177 | instructions.set_size_request(self.actions_dialog.size_request().width - 50, -1) |
2169 | close_button = self.actions_dialog.add_button(Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE) | |
2178 | close_button = self.actions_dialog.add_button( | |
2179 | Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE | |
2180 | ) | |
2170 | 2181 | close_button.grab_focus() |
2171 | 2182 | self.actions_dialog.run() |
2172 | 2183 | self.refresh_custom_actions_menu() |
2209 | 2220 | ) |
2210 | 2221 | self.dialog_name.set_transient_for(self.actions_dialog) |
2211 | 2222 | self.dialog_name.add_buttons( |
2212 | Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT, Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT | |
2223 | Gtk.STOCK_CANCEL, | |
2224 | Gtk.ResponseType.REJECT, | |
2225 | Gtk.STOCK_OK, | |
2226 | Gtk.ResponseType.ACCEPT, | |
2213 | 2227 | ) |
2214 | 2228 | else: |
2215 | 2229 | self.dialog_name = Gtk.Dialog( |
2217 | 2231 | ) |
2218 | 2232 | self.dialog_name.set_transient_for(self.actions_dialog) |
2219 | 2233 | self.dialog_name.add_buttons( |
2220 | Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT, Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT | |
2234 | Gtk.STOCK_CANCEL, | |
2235 | Gtk.ResponseType.REJECT, | |
2236 | Gtk.STOCK_OK, | |
2237 | Gtk.ResponseType.ACCEPT, | |
2221 | 2238 | ) |
2222 | 2239 | |
2223 | 2240 | self.dialog_name.set_modal(True) |
4102 | 4119 | title=_("Choose directory"), action=Gtk.FileChooserAction.OPEN |
4103 | 4120 | ) |
4104 | 4121 | getdir.add_buttons( |
4105 | Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OPEN, Gtk.ResponseType.OK | |
4122 | Gtk.STOCK_CANCEL, | |
4123 | Gtk.ResponseType.CANCEL, | |
4124 | Gtk.STOCK_OPEN, | |
4125 | Gtk.ResponseType.OK, | |
4106 | 4126 | ) |
4107 | 4127 | getdir.set_action(Gtk.FileChooserAction.SELECT_FOLDER) |
4108 | 4128 | getdir.set_filename(self.fixed_dir) |
4154 | 4174 | [ |
4155 | 4175 | "Scott Horowitz <stonecrest@gmail.com>", |
4156 | 4176 | "Fredric Johansson <fredric.miscmail@gmail.com>", |
4157 | "Thomas Ross <thomasross@thomasross.io>" | |
4177 | "Thomas Ross <thomasross@thomasross.io>", | |
4158 | 4178 | ] |
4159 | 4179 | ) |
4160 | 4180 | self.about_dialog.set_artists(["William Rea <sillywilly@gmail.com>"]) |
6432 | 6452 | 1000, self.disable_screensaver_in_slideshow_mode |
6433 | 6453 | ) |
6434 | 6454 | |
6455 | ||
6435 | 6456 | def run(argv): |
6436 | 6457 | Gdk.threads_enter() |
6437 | 6458 | app = Base() |