diff --git a/plugins/gtkgui/config.py b/plugins/gtkgui/config.py
index 3b644d48e..51e171375 100644
--- a/plugins/gtkgui/config.py
+++ b/plugins/gtkgui/config.py
@@ -35,12 +35,16 @@ import gtkgui
GTKGUI_GLADE='plugins/gtkgui/gtkgui.glade'
-class preferences_window:
+class Preferences_window:
"""Class for Preferences window"""
- def delete_event(self, widget):
- """close window"""
- del self.plugin.windows['preferences']
+ def on_delete_event(self, widget, event):
+ self.window.hide()
+ return True # do NOT destory the window
+
+ def on_close_button_clicked(self, widget):
+ self.window.hide()
+
def on_tray_icon_checkbutton_toggled(self, widget):
"""On Tray Icon Checkbutton Toggled"""
if widget.get_active():
@@ -436,10 +440,6 @@ class preferences_window:
else:
self.config_logger['lognotsep'] = 0
self.plugin.send('CONFIG', None, ('Logger', self.config_logger, 'GtkGui'))
-
- def on_close_button_clicked(self, widget):
- """When The close button is clicked"""
- widget.get_toplevel().destroy()
def fill_msg_treeview(self):
i = 0
@@ -969,6 +969,7 @@ class preferences_window:
self.on_msg_treemodel_row_deleted)
self.xml.signal_autoconnect(self)
+ #self.window.show_all()
class Account_modification_window:
"""Class for account informations"""
diff --git a/plugins/gtkgui/gtkgui.glade b/plugins/gtkgui/gtkgui.glade
index 53ecd425f..8aa4b4aba 100644
--- a/plugins/gtkgui/gtkgui.glade
+++ b/plugins/gtkgui/gtkgui.glade
@@ -2272,39 +2272,46 @@
0
-
+
True
- GTK_BUTTONBOX_START
+ False
5
-
+
True
- True
- True
- Re_gister
+ _Address:
True
- GTK_RELIEF_NORMAL
- True
-
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+ address_comboboxentry
+
+ 0
+ False
+ False
+
-
+
True
- True
- True
- _Join
- True
- GTK_RELIEF_NORMAL
- True
-
+
+ 0
+ True
+ True
+
- 2
+ 0
False
True
@@ -2417,75 +2424,44 @@
+
+
+ True
+ True
+ True
+ True
+ Re_gister
+ True
+ GTK_RELIEF_NORMAL
+ True
+
+
+
+
+
+
+ True
+ True
+ True
+ _Join
+ True
+ GTK_RELIEF_NORMAL
+ True
+
+
+
+
True
True
True
True
+ gtk-close
+ True
GTK_RELIEF_NORMAL
True
-
-
-
-
- True
- 0.5
- 0.5
- 0
- 0
- 0
- 0
- 0
- 0
-
-
-
- True
- False
- 2
-
-
-
- True
- gtk-close
- 4
- 0.5
- 0.5
- 0
- 0
-
-
- 0
- False
- False
-
-
-
-
-
- True
- _Close
- True
- False
- GTK_JUSTIFY_LEFT
- False
- False
- 0.5
- 0.5
- 0
- 0
-
-
- 0
- False
- False
-
-
-
-
-
-
+
@@ -2724,7 +2700,6 @@
4
500
384
- True
Preferences
GTK_WINDOW_TOPLEVEL
GTK_WIN_POS_NONE
@@ -2736,7 +2711,7 @@
False
GDK_WINDOW_TYPE_HINT_NORMAL
GDK_GRAVITY_NORTH_WEST
-
+
@@ -5293,7 +5268,7 @@ Custom
True
GTK_RELIEF_NORMAL
True
-
+
@@ -7246,110 +7221,35 @@ Custom
5
True
- 4
+ 5
2
False
5
10
-
+
True
- Nickname
- False
- False
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
+ True
+ True
+ False
+ 0
+
+ True
+ *
+ True
- 0
- 1
- 0
- 1
- fill
+ 1
+ 2
+ 4
+ 5
-
- True
- Room
- False
- False
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
-
-
- 0
- 1
- 1
- 2
- fill
-
-
-
-
-
-
- True
- Server
- False
- False
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
-
-
- 0
- 1
- 2
- 3
- fill
-
-
-
-
-
-
- True
- Password
- False
- False
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
-
-
- 0
- 1
- 3
- 4
- fill
-
-
-
-
-
-
+
True
True
True
@@ -7363,8 +7263,8 @@ Custom
1
2
- 0
- 1
+ 3
+ 4
@@ -7385,14 +7285,14 @@ Custom
1
2
- 1
- 2
+ 2
+ 3
-
+
True
True
True
@@ -7406,30 +7306,143 @@ Custom
1
2
- 2
- 3
+ 1
+ 2
-
+
+ True
+ Password:
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0
+ 0.5
+ 0
+ 0
+
+
+ 0
+ 1
+ 4
+ 5
+ fill
+
+
+
+
+
+
+ True
+ Server:
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0
+ 0.5
+ 0
+ 0
+
+
+ 0
+ 1
+ 3
+ 4
+ fill
+
+
+
+
+
+
+ True
+ Room:
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0
+ 0.5
+ 0
+ 0
+
+
+ 0
+ 1
+ 2
+ 3
+ fill
+
+
+
+
+
+
+ True
+ Nickname:
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0
+ 0.5
+ 0
+ 0
+
+
+ 0
+ 1
+ 1
+ 2
+ fill
+
+
+
+
+
+
+ True
+ Recently:
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0
+ 0.5
+ 0
+ 0
+
+
+ 0
+ 1
+ 0
+ 1
+ fill
+
+
+
+
+
+
True
- True
- True
- False
- 0
-
- True
- *
- True
1
2
- 3
- 4
-
+ 0
+ 1
+ fill
+ fill
diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py
index 686db430f..df2ba2637 100644
--- a/plugins/gtkgui/gtkgui.py
+++ b/plugins/gtkgui/gtkgui.py
@@ -790,12 +790,16 @@ class plugin:
'ask_online_status':0,\
'ask_offline_status':0,\
'last_msg':'',\
- 'msg0_name':'Brb',\
- 'msg0':'Back in some minutes.',\
- 'msg1_name':'Eating',\
- 'msg1':'I\'m eating, so leave me a message.',\
- 'msg2_name':'Film',\
- 'msg2':'I\'m watching a film.',\
+ 'msg0_name':'Online',\
+ 'msg0':'Yep I\'m online',\
+ 'msg1_name':'Brb',\
+ 'msg1':'Back in some minutes.',\
+ 'msg2_name':'Eating',\
+ 'msg2':'I\'m eating, so leave me a message.',\
+ 'msg3_name':'Film',\
+ 'msg3':'I\'m watching a film.',\
+ 'msg4_name':'Offline',\
+ 'msg4':'I\'m just offline',\
'trayicon':1,\
'iconstyle':'sun',\
'inmsgcolor':'#ff0000',\
@@ -868,7 +872,7 @@ class plugin:
break
if pix:
gtk.window_set_default_icon(pix)
- self.roster = roster_window(self)
+ self.roster = Roster_window(self)
gobject.timeout_add(100, self.read_queue)
gobject.timeout_add(100, self.read_sleepy)
self.sleeper = common.sleepy.Sleepy( \
@@ -892,6 +896,9 @@ class plugin:
self.show_systray()
self.init_regex()
+
+ # get instances for windows/dialogs that will show_all()/hide()
+ self.windows['preferences'] = Preferences_window(self)
gtk.gdk.threads_enter()
gobject.timeout_add(100, self.autoconnect)
diff --git a/plugins/gtkgui/roster_window.py b/plugins/gtkgui/roster_window.py
index dcfcd49c6..c70cadb74 100644
--- a/plugins/gtkgui/roster_window.py
+++ b/plugins/gtkgui/roster_window.py
@@ -1,4 +1,4 @@
-## plugins/roster.py
+## plugins/gtkgui/roster_window.py
##
## Gajim Team:
## - Yann Le Boulanger
@@ -42,7 +42,7 @@ gtk.glade.textdomain(APP)
GTKGUI_GLADE='plugins/gtkgui/gtkgui.glade'
-class roster_window:
+class Roster_window:
"""Class for main window of gtkgui plugin"""
def get_account_iter(self, name):
@@ -893,8 +893,11 @@ class roster_window:
def on_preferences_menuitem_activate(self, widget):
"""When preferences is selected :
call the preferences_window class"""
- if not self.plugin.windows.has_key('preferences'):
- self.plugin.windows['preferences'] = preferences_window(self.plugin)
+ print self.plugin.windows['preferences'].window.get_property('visible')
+ if self.plugin.windows['preferences'].window.get_property('visible'):
+ self.plugin.windows['preferences'].window.present()
+ else:
+ self.plugin.windows['preferences'].window.show_all()
def on_add_contact(self, widget, account):
"""When add user is selected :