55 | 55 |
except:
|
56 | 56 |
HAS_XMOUSE = False
|
57 | 57 |
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
|
63 | 58 |
|
64 | 59 |
|
65 | 60 |
def valid_int(inputstring):
|
|
612 | 607 |
"value-changed", self.slideshow_delay_changed
|
613 | 608 |
)
|
614 | 609 |
|
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 | |
|
637 | 610 |
# Show GUI:
|
638 | 611 |
if not self.toolbar_show:
|
639 | 612 |
self.toolbar.set_property("visible", False)
|
|
1013 | 986 |
sys.exit(1)
|
1014 | 987 |
else:
|
1015 | 988 |
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)
|
1033 | 989 |
|
1034 | 990 |
def toolbar_focused(self, widget, direction):
|
1035 | 991 |
self.layout.grab_focus()
|