Remove saveposition. Now we always save and restore positions and sizes. See #3638. steve-e, this bug

is still opened for what you told ;)
This commit is contained in:
Jean-Marie Traissard 2008-01-22 21:08:24 +00:00
parent b3bafa75ff
commit 39fe7fc4c0
5 changed files with 42 additions and 55 deletions

View File

@ -100,7 +100,6 @@ class Config:
'urlmsgcolor': [ opt_color, '#0000ff', '', True ],
'collapsed_rows': [ opt_str, '', _('List (space separated) of rows (accounts and groups) that are collapsed.'), True ],
'roster_theme': [ opt_str, _('default'), '', True ],
'saveposition': [ opt_bool, True ],
'mergeaccounts': [ opt_bool, False, '', True ],
'sort_by_show': [ opt_bool, True, '', True ],
'enable_zeroconf': [opt_bool, False, _('Enable link-local/zeroconf messaging')],

View File

@ -591,9 +591,6 @@ class PreferencesWindow:
def on_subscribe_tune_checkbutton_toggled(self, widget):
self.on_checkbutton_toggled(widget, 'subscribe_tune')
def on_save_position_checkbutton_toggled(self, widget):
self.on_checkbutton_toggled(widget, 'saveposition')
def on_sort_by_show_checkbutton_toggled(self, widget):
self.on_checkbutton_toggled(widget, 'sort_by_show')
gajim.interface.roster.draw_roster()

View File

@ -2061,14 +2061,14 @@ class SingleMessageWindow:
self.completion_dict = {}
self.xml.signal_autoconnect(self)
if gajim.config.get('saveposition'):
# get window position and size from config
gtkgui_helpers.resize_window(self.window,
gajim.config.get('single-msg-width'),
gajim.config.get('single-msg-height'))
gtkgui_helpers.move_window(self.window,
gajim.config.get('single-msg-x-position'),
gajim.config.get('single-msg-y-position'))
# get window position and size from config
gtkgui_helpers.resize_window(self.window,
gajim.config.get('single-msg-width'),
gajim.config.get('single-msg-height'))
gtkgui_helpers.move_window(self.window,
gajim.config.get('single-msg-x-position'),
gajim.config.get('single-msg-y-position'))
self.window.show_all()
def on_single_message_window_destroy(self, widget):
@ -2079,15 +2079,14 @@ class SingleMessageWindow:
self.message_tv_buffer.place_cursor(end_iter)
def save_pos(self):
if gajim.config.get('saveposition'):
# save the window size and position
x, y = self.window.get_position()
gajim.config.set('single-msg-x-position', x)
gajim.config.set('single-msg-y-position', y)
width, height = self.window.get_size()
gajim.config.set('single-msg-width', width)
gajim.config.set('single-msg-height', height)
gajim.interface.save_config()
# save the window size and position
x, y = self.window.get_position()
gajim.config.set('single-msg-x-position', x)
gajim.config.set('single-msg-y-position', y)
width, height = self.window.get_size()
gajim.config.set('single-msg-width', width)
gajim.config.set('single-msg-height', height)
gajim.interface.save_config()
def on_single_message_window_delete_event(self, window, ev):
self.save_pos()

View File

@ -782,9 +782,6 @@ class MessageWindowMgr(gobject.GObject):
def _resize_window(self, win, acct, type):
'''Resizes window according to config settings'''
if not gajim.config.get('saveposition'):
return
if self.mode in (self.ONE_MSG_WINDOW_ALWAYS,
self.ONE_MSG_WINDOW_ALWAYS_WITH_ROSTER):
size = (gajim.config.get('msgwin-width'),
@ -807,9 +804,8 @@ class MessageWindowMgr(gobject.GObject):
def _position_window(self, win, acct, type):
'''Moves window according to config settings'''
if (not gajim.config.get('saveposition') or
self.mode in [self.ONE_MSG_WINDOW_NEVER,
self.ONE_MSG_WINDOW_ALWAYS_WITH_ROSTER]):
if (self.mode in [self.ONE_MSG_WINDOW_NEVER,
self.ONE_MSG_WINDOW_ALWAYS_WITH_ROSTER]):
return
if self.mode == self.ONE_MSG_WINDOW_ALWAYS:
@ -934,9 +930,6 @@ class MessageWindowMgr(gobject.GObject):
gajim.interface.save_config()
def save_state(self, msg_win, width_adjust=0):
if not gajim.config.get('saveposition'):
return
# Save window size and position
pos_x_key = 'msgwin-x-position'
pos_y_key = 'msgwin-y-position'

View File

@ -4249,24 +4249,24 @@ class RosterWindow:
'''When we quit the gtk interface :
tell that to the core and exit gtk'''
msgwin_width_adjust = 0
if gajim.config.get('saveposition'):
# in case show_roster_on_start is False and roster is never shown
# window.window is None
if self.window.window is not None:
x, y = self.window.window.get_root_origin()
gajim.config.set('roster_x-position', x)
gajim.config.set('roster_y-position', y)
width, height = self.window.get_size()
# For the width use the size of the vbox containing the tree and
# status combo, this will cancel out any hpaned width
width = self.xml.get_widget('roster_vbox2').allocation.width
gajim.config.set('roster_width', width)
gajim.config.set('roster_height', height)
if not self.xml.get_widget('roster_vbox2').get_property('visible'):
# The roster vbox is hidden, so the message window is larger
# then we want to save (i.e. the window will grow every startup)
# so adjust.
msgwin_width_adjust = -1 * width
# in case show_roster_on_start is False and roster is never shown
# window.window is None
if self.window.window is not None:
x, y = self.window.window.get_root_origin()
gajim.config.set('roster_x-position', x)
gajim.config.set('roster_y-position', y)
width, height = self.window.get_size()
# For the width use the size of the vbox containing the tree and
# status combo, this will cancel out any hpaned width
width = self.xml.get_widget('roster_vbox2').allocation.width
gajim.config.set('roster_width', width)
gajim.config.set('roster_height', height)
if not self.xml.get_widget('roster_vbox2').get_property('visible'):
# The roster vbox is hidden, so the message window is larger
# then we want to save (i.e. the window will grow every startup)
# so adjust.
msgwin_width_adjust = -1 * width
gajim.config.set('show_roster_on_startup',
@ -5419,13 +5419,12 @@ class RosterWindow:
#FIXME: When list_accel_closures will be wrapped in pygtk
# no need of this variable
self.have_new_chat_accel = False # Is the "Ctrl+N" shown ?
if gajim.config.get('saveposition'):
gtkgui_helpers.resize_window(self.window,
gajim.config.get('roster_width'),
gajim.config.get('roster_height'))
gtkgui_helpers.move_window(self.window,
gajim.config.get('roster_x-position'),
gajim.config.get('roster_y-position'))
gtkgui_helpers.resize_window(self.window,
gajim.config.get('roster_width'),
gajim.config.get('roster_height'))
gtkgui_helpers.move_window(self.window,
gajim.config.get('roster_x-position'),
gajim.config.get('roster_y-position'))
self.popups_notification_height = 0
self.popup_notification_windows = []