Changeset 9260

Show
Ignore:
Timestamp:
01/22/08 22:08:24 (10 months ago)
Author:
jim++
Message:

Remove saveposition. Now we always save and restore positions and sizes. See #3638. steve-e, this bug
is still opened for what you told ;)

Location:
trunk/src
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/common/config.py

    r9245 r9260  
    101101                'collapsed_rows': [ opt_str, '', _('List (space separated) of rows (accounts and groups) that are collapsed.'), True ], 
    102102                'roster_theme': [ opt_str, _('default'), '', True ], 
    103                 'saveposition': [ opt_bool, True ], 
    104103                'mergeaccounts': [ opt_bool, False, '', True ], 
    105104                'sort_by_show': [ opt_bool, True, '', True ], 
  • trunk/src/config.py

    r9253 r9260  
    591591        def on_subscribe_tune_checkbutton_toggled(self, widget): 
    592592                self.on_checkbutton_toggled(widget, 'subscribe_tune') 
    593  
    594         def on_save_position_checkbutton_toggled(self, widget): 
    595                 self.on_checkbutton_toggled(widget, 'saveposition') 
    596593 
    597594        def on_sort_by_show_checkbutton_toggled(self, widget): 
  • trunk/src/dialogs.py

    r9259 r9260  
    20622062                self.xml.signal_autoconnect(self) 
    20632063 
    2064                 if gajim.config.get('saveposition'): 
    2065                         # get window position and size from config 
    2066                         gtkgui_helpers.resize_window(self.window, 
    2067                                 gajim.config.get('single-msg-width'), 
    2068                                 gajim.config.get('single-msg-height')) 
    2069                         gtkgui_helpers.move_window(self.window, 
    2070                                 gajim.config.get('single-msg-x-position'), 
    2071                                 gajim.config.get('single-msg-y-position')) 
     2064                # get window position and size from config 
     2065                gtkgui_helpers.resize_window(self.window, 
     2066                        gajim.config.get('single-msg-width'), 
     2067                        gajim.config.get('single-msg-height')) 
     2068                gtkgui_helpers.move_window(self.window, 
     2069                        gajim.config.get('single-msg-x-position'), 
     2070                        gajim.config.get('single-msg-y-position')) 
     2071 
    20722072                self.window.show_all() 
    20732073 
     
    20802080 
    20812081        def save_pos(self): 
    2082                 if gajim.config.get('saveposition'): 
    2083                         # save the window size and position 
    2084                         x, y = self.window.get_position() 
    2085                         gajim.config.set('single-msg-x-position', x) 
    2086                         gajim.config.set('single-msg-y-position', y) 
    2087                         width, height = self.window.get_size() 
    2088                         gajim.config.set('single-msg-width', width) 
    2089                         gajim.config.set('single-msg-height', height) 
    2090                         gajim.interface.save_config() 
     2082                # save the window size and position 
     2083                x, y = self.window.get_position() 
     2084                gajim.config.set('single-msg-x-position', x) 
     2085                gajim.config.set('single-msg-y-position', y) 
     2086                width, height = self.window.get_size() 
     2087                gajim.config.set('single-msg-width', width) 
     2088                gajim.config.set('single-msg-height', height) 
     2089                gajim.interface.save_config() 
    20912090 
    20922091        def on_single_message_window_delete_event(self, window, ev): 
  • trunk/src/message_window.py

    r9259 r9260  
    783783        def _resize_window(self, win, acct, type): 
    784784                '''Resizes window according to config settings''' 
    785                 if not gajim.config.get('saveposition'): 
    786                         return 
    787  
    788785                if self.mode in (self.ONE_MSG_WINDOW_ALWAYS, 
    789786                                self.ONE_MSG_WINDOW_ALWAYS_WITH_ROSTER): 
     
    808805        def _position_window(self, win, acct, type): 
    809806                '''Moves window according to config settings''' 
    810                 if (not gajim.config.get('saveposition') or 
    811                 self.mode in [self.ONE_MSG_WINDOW_NEVER, 
    812                                 self.ONE_MSG_WINDOW_ALWAYS_WITH_ROSTER]): 
     807                if (self.mode in [self.ONE_MSG_WINDOW_NEVER, 
     808                self.ONE_MSG_WINDOW_ALWAYS_WITH_ROSTER]): 
    813809                        return 
    814810 
     
    935931 
    936932        def save_state(self, msg_win, width_adjust=0): 
    937                 if not gajim.config.get('saveposition'): 
    938                         return 
    939  
    940933                # Save window size and position 
    941934                pos_x_key = 'msgwin-x-position' 
  • trunk/src/roster_window.py

    r9259 r9260  
    42504250                tell that to the core and exit gtk''' 
    42514251                msgwin_width_adjust = 0 
    4252                 if gajim.config.get('saveposition'): 
    4253                         # in case show_roster_on_start is False and roster is never shown 
    4254                         # window.window is None 
    4255                         if self.window.window is not None: 
    4256                                 x, y = self.window.window.get_root_origin() 
    4257                                 gajim.config.set('roster_x-position', x) 
    4258                                 gajim.config.set('roster_y-position', y) 
    4259                                 width, height = self.window.get_size() 
    4260                                 # For the width use the size of the vbox containing the tree and 
    4261                                 # status combo, this will cancel out any hpaned width 
    4262                                 width = self.xml.get_widget('roster_vbox2').allocation.width 
    4263                                 gajim.config.set('roster_width', width) 
    4264                                 gajim.config.set('roster_height', height) 
    4265                                 if not self.xml.get_widget('roster_vbox2').get_property('visible'): 
    4266                                         # The roster vbox is hidden, so the message window is larger 
    4267                                         # then we want to save (i.e. the window will grow every startup) 
    4268                                         # so adjust. 
    4269                                         msgwin_width_adjust = -1 * width 
     4252 
     4253                # in case show_roster_on_start is False and roster is never shown 
     4254                # window.window is None 
     4255                if self.window.window is not None: 
     4256                        x, y = self.window.window.get_root_origin() 
     4257                        gajim.config.set('roster_x-position', x) 
     4258                        gajim.config.set('roster_y-position', y) 
     4259                        width, height = self.window.get_size() 
     4260                        # For the width use the size of the vbox containing the tree and 
     4261                        # status combo, this will cancel out any hpaned width 
     4262                        width = self.xml.get_widget('roster_vbox2').allocation.width 
     4263                        gajim.config.set('roster_width', width) 
     4264                        gajim.config.set('roster_height', height) 
     4265                        if not self.xml.get_widget('roster_vbox2').get_property('visible'): 
     4266                                # The roster vbox is hidden, so the message window is larger 
     4267                                # then we want to save (i.e. the window will grow every startup) 
     4268                                # so adjust. 
     4269                                msgwin_width_adjust = -1 * width 
    42704270 
    42714271 
     
    54205420                # no need of this variable 
    54215421                self.have_new_chat_accel = False # Is the "Ctrl+N" shown ? 
    5422                 if gajim.config.get('saveposition'): 
    5423                         gtkgui_helpers.resize_window(self.window, 
    5424                                 gajim.config.get('roster_width'), 
    5425                                 gajim.config.get('roster_height')) 
    5426                         gtkgui_helpers.move_window(self.window, 
    5427                                 gajim.config.get('roster_x-position'), 
    5428                                 gajim.config.get('roster_y-position')) 
     5422                gtkgui_helpers.resize_window(self.window, 
     5423                        gajim.config.get('roster_width'), 
     5424                        gajim.config.get('roster_height')) 
     5425                gtkgui_helpers.move_window(self.window, 
     5426                        gajim.config.get('roster_x-position'), 
     5427                        gajim.config.get('roster_y-position')) 
    54295428 
    54305429                self.popups_notification_height = 0