Rearrange how Application.run is called
Thomas Ross
3 years ago
30 | 30 | import gettext |
31 | 31 | import locale |
32 | 32 | |
33 | from gi.repository import Gio, Gdk | |
33 | from gi.repository import Gio | |
34 | 34 | |
35 | 35 | |
36 | 36 | LOCALE_DOMAIN = "mirage" |
123 | 123 | file=sys.stderr, |
124 | 124 | ) |
125 | 125 | |
126 | app = mirage.Base() | |
127 | Gdk.threads_enter() | |
128 | ||
129 | 126 | try: |
130 | app.run([]) | |
127 | mirage.run([]) | |
131 | 128 | except KeyboardInterrupt: |
132 | 129 | pass |
133 | ||
134 | Gdk.threads_leave() | |
135 | 130 | |
136 | 131 | |
137 | 132 | if __name__ == "__main__": |
75 | 75 | ) |
76 | 76 | |
77 | 77 | def do_activate(self): |
78 | Gdk.threads_init() | |
79 | ||
80 | 78 | # Constants |
81 | 79 | self.open_mode_smart = 0 |
82 | 80 | self.open_mode_fit = 1 |
6422 | 6420 | timer_screensaver = GLib.timeout_add( |
6423 | 6421 | 1000, self.disable_screensaver_in_slideshow_mode |
6424 | 6422 | ) |
6423 | ||
6424 | def run(argv): | |
6425 | Gdk.threads_enter() | |
6426 | app = Base() | |
6427 | Gdk.threads_init() | |
6428 | app.run(argv) | |
6429 | Gdk.threads_leave() |