don't open a tabbedchat or a groupchat window over another one

This commit is contained in:
Yann Leboulanger 2005-11-01 15:42:08 +00:00
parent 2c016fddab
commit 9121514778
3 changed files with 12 additions and 2 deletions

View File

@ -99,7 +99,8 @@ class GroupchatWindow(chat.Chat):
self.xml.signal_autoconnect(signal_dict) self.xml.signal_autoconnect(signal_dict)
# get size and position from config # get size and position from config
if gajim.config.get('saveposition'): if gajim.config.get('saveposition') and \
not gtkgui_helpers.one_window_opened('gc'):
gtkgui_helpers.move_window(self.window, gtkgui_helpers.move_window(self.window,
gajim.config.get('gc-x-position'), gajim.config.get('gc-x-position'),
gajim.config.get('gc-y-position')) gajim.config.get('gc-y-position'))

View File

@ -198,6 +198,14 @@ def resize_window(window, w, h):
h = screen_h h = screen_h
window.resize(abs(w), abs(h)) window.resize(abs(w), abs(h))
def one_window_opened(typ):
for account in gajim.connections:
if not gajim.interface.windows[account].has_key(typ):
continue
if len(gajim.interface.windows[account][typ]):
return True
return False
class TagInfoHandler(xml.sax.ContentHandler): class TagInfoHandler(xml.sax.ContentHandler):
def __init__(self, tagname1, tagname2): def __init__(self, tagname1, tagname2):
xml.sax.ContentHandler.__init__(self) xml.sax.ContentHandler.__init__(self)

View File

@ -81,7 +81,8 @@ class TabbedChatWindow(chat.Chat):
self.xml.signal_autoconnect(signal_dict) self.xml.signal_autoconnect(signal_dict)
if gajim.config.get('saveposition'): if gajim.config.get('saveposition') and \
not gtkgui_helpers.one_window_opened('chats'):
# get window position and size from config # get window position and size from config
gtkgui_helpers.move_window(self.window, gajim.config.get('chat-x-position'), gtkgui_helpers.move_window(self.window, gajim.config.get('chat-x-position'),
gajim.config.get('chat-y-position')) gajim.config.get('chat-y-position'))