Changeset 281
Legend:
- Unmodified
- Added
- Removed
-
trunk/config.py
r278 r281 49 49 image_dir = os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), 'share/images/') 50 50 system = os.name 51 #: Minimum screen height to display all panes of Itaka 52 min_screen_height = 800 51 53 52 54 #: To be changed on install to specify where the installed files actually are -
trunk/uigtk.py
r280 r281 404 404 405 405 self.button_preferences = gtk.Button('Preferences', gtk.STOCK_PREFERENCES) 406 self.button_preferences.connect('clicked', self. expand_preferences)406 self.button_preferences.connect('clicked', self._expand_preferences) 407 407 408 408 # Set up some variables for our timeouts/animations … … 477 477 self.button_log_clear_image.set_from_stock(gtk.STOCK_CLEAR, gtk.ICON_SIZE_BUTTON) 478 478 self.button_log_clear.set_image(self.button_log_clear_image) 479 self.button_log_clear.connect('clicked', self. clear_logger)479 self.button_log_clear.connect('clicked', self._clear_logger) 480 480 481 481 self.button_log_pause = gtk.ToggleButton(_('Pause')) … … 497 497 self.expander = gtk.Expander(None) 498 498 self.expander.set_label_widget(self.label_log_box) 499 self.expander.connect('notify::expanded', self. expand_logger)499 self.expander.connect('notify::expanded', self._expand_logger) 500 500 501 501 self.vbox.pack_start(self.hbox_status, False, False, 4) … … 623 623 624 624 self.button_preferences_close = gtk.Button('Close', gtk.STOCK_SAVE) 625 self.button_preferences_close.connect('clicked', self. contractpreferences)625 self.button_preferences_close.connect('clicked', self._contract_preferences) 626 626 627 627 self.button_preferences_about = gtk.Button('About', gtk.STOCK_ABOUT) … … 798 798 self.log.failure(('Gui', '_save_preferences'), _('Could not save preferences'), 'ERROR') 799 799 800 def expand_preferences(self, *args):800 def _expand_preferences(self, *args): 801 801 """ 802 802 Expands the window for preferences … … 807 807 # start timer, resize, catch configure-notify, set up idle handler, when idle resize to what the size should be at this point of time, repeat 808 808 if not self.preferences_expanded: 809 if ((gtk.gdk.screen_height() < 800) and self.expander.get_property("expanded")): 809 # Close log in small screen displays 810 if ((gtk.gdk.screen_height() < self.itaka_globals.min_screen_height) and self.expander.get_property("expanded")): 810 811 self.expander.set_expanded(False) 812 811 813 if self.timeout_expand is not None: 812 814 """NOTE: GTK+ GtkWidget.size_request() method can give you the amount of size a widget will take … … 853 855 return False 854 856 else: 855 self.timeout_expand = gobject.timeout_add(30, self. expand_preferences)856 857 def contractpreferences(self, *args):857 self.timeout_expand = gobject.timeout_add(30, self._expand_preferences) 858 859 def _contract_preferences(self, save): 858 860 """ 859 861 Contracts the window of preferences 862 863 @type args: unknown 864 @param args: gtk.Widget or "False" if you don't want to save preferences, just hide the pane 860 865 """ 861 866 … … 883 888 self.button_preferences.set_sensitive(True) 884 889 885 # Save our settings 886 self._save_preferences() 890 # Save our settings (but not if we are on small displays and we just want to hide the pane) 891 if save is not False: 892 print_m("Saving") 893 self._save_preferences() 887 894 888 895 self.timeout_contract = None 889 896 return False 890 897 else: 891 self.timeout_contract = gobject.timeout_add(30, self. contractpreferences)898 self.timeout_contract = gobject.timeout_add(30, self._contract_preferences, save) 892 899 893 900 def _window_size_changed(self, widget=None, data=None): … … 917 924 918 925 @type widget: instance 919 @ SAVEwidget: gtk.Widget926 @param widget: gtk.Widget 920 927 921 928 @type button: int 922 @ SAVEbutton: The button pressed.929 @param button: The button pressed. 923 930 924 931 @type time: unknown … … 1012 1019 self.about_dialog.destroy() 1013 1020 1014 def expand_logger(self, expander, params):1021 def _expand_logger(self, expander, params): 1015 1022 """ 1016 1023 Expand or contract the logger … … 1024 1031 1025 1032 if self.expander.get_expanded(): 1033 # Close preferences pane in small screen displays 1034 if ((gtk.gdk.screen_height() < self.itaka_globals.min_screen_height) and self.preferences_expanded): 1035 # Tell it to not save 1036 self._contract_preferences(False) 1037 1026 1038 # Show the debugvbox() and it's subwidgets 1027 1039 self.vbox_log.show_all() … … 1033 1045 return 1034 1046 1035 def clear_logger(self, *args):1047 def _clear_logger(self, *args): 1036 1048 """ 1037 1049 Clear the log
Note: See TracChangeset
for help on using the changeset viewer.

