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,7 +2061,6 @@ 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'),
@ -2069,6 +2068,7 @@ class SingleMessageWindow:
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,7 +2079,6 @@ 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)

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,8 +804,7 @@ 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,
if (self.mode in [self.ONE_MSG_WINDOW_NEVER,
self.ONE_MSG_WINDOW_ALWAYS_WITH_ROSTER]):
return
@ -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,7 +4249,7 @@ 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:
@ -5419,7 +5419,6 @@ 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'))