Codebase list mirage / fcafc73
Drop GNOME toolbar style integration GConf is deprecated and it looks like GNOME is moving away from the pattern, see https://gitlab.gnome.org/GNOME/gtk/-/commit/425e977bb65a52c05fbc2b643acf32aec4bc477f Thomas Ross 3 years ago
3 changed file(s) with 1 addition(s) and 45 deletion(s). Raw diff Collapse all Expand all
11 BREAKING CHANGES
22 + Drop support for Python 2.
33 + Drop support for GTK+2.0, switching to GTK 3.
4 + Drop GNOME toolbar style integration
45 + Convert to Python 3's ConfigParser with no interpolation. This
56 preserves compatibility with the old config files all cases,
67 except when they have been manually modified to use interpolation.
33 REQUIREMENTS:
44 (Required) PyGTK 2.12.0 or newer
55 (Required) GTK 2.10.0 or newer
6 (Optional) Gnome-python if you want Mirage's toolbar to follow your Gnome setting
76 (Building) GCC
87 (Building) python-dev and libX11-dev (on some distros)
98
5555 except:
5656 HAS_XMOUSE = False
5757 print("xmouse.so module not found, some screenshot capabilities will be disabled.")
58
59 try:
60 from gi.repository import GConf
61 except:
62 pass
6358
6459
6560 def valid_int(inputstring):
612607 "value-changed", self.slideshow_delay_changed
613608 )
614609
615 # Since GNOME does its own thing for the toolbar style...
616 # Requires gnome-python installed to work (but optional)
617 try:
618 client = GConf.Client.get_default()
619 style = client.get_string("/desktop/gnome/interface/toolbar_style")
620 if style == "both":
621 self.toolbar.set_style(Gtk.ToolbarStyle.BOTH)
622 elif style == "both-horiz":
623 self.toolbar.set_style(Gtk.ToolbarStyle.BOTH_HORIZ)
624 elif style == "icons":
625 self.toolbar.set_style(Gtk.ToolbarStyle.ICONS)
626 elif style == "text":
627 self.toolbar.set_style(Gtk.ToolbarStyle.TEXT)
628 client.add_dir(
629 "/desktop/gnome/interface", GConf.ClientPreloadType.PRELOAD_NONE
630 )
631 client.notify_add(
632 "/desktop/gnome/interface/toolbar_style", self.gconf_key_changed
633 )
634 except:
635 pass
636
637610 # Show GUI:
638611 if not self.toolbar_show:
639612 self.toolbar.set_property("visible", False)
1013986 sys.exit(1)
1014987 else:
1015988 return None
1016
1017 def gconf_key_changed(self, client, cnxn_id, entry, label):
1018 if entry.value.type == GConf.ValueType.STRING:
1019 style = entry.value.to_string()
1020 if style == "both":
1021 self.toolbar.set_style(Gtk.ToolbarStyle.BOTH)
1022 elif style == "both-horiz":
1023 self.toolbar.set_style(Gtk.ToolbarStyle.BOTH_HORIZ)
1024 elif style == "icons":
1025 self.toolbar.set_style(Gtk.ToolbarStyle.ICONS)
1026 elif style == "text":
1027 self.toolbar.set_style(Gtk.ToolbarStyle.TEXT)
1028 if self.image_loaded and self.last_image_action_was_fit:
1029 if self.last_image_action_was_smart_fit:
1030 self.zoom_to_fit_or_1_to_1(None, False, False)
1031 else:
1032 self.zoom_to_fit_window(None, False, False)
1033989
1034990 def toolbar_focused(self, widget, direction):
1035991 self.layout.grab_focus()