Commit 67e07629 authored by nicfit's avatar nicfit

Merged revisions 9172-9175,9177,9179-9185 via svnmerge from

svn://88.191.11.156/gajim/trunk

........
  r9179 | asterix | 2007-12-19 07:42:04 -0700 (Wed, 19 Dec 2007) | 2 lines

  [ruiabreuferreira and I] ability to use http_proxy environment variable. fixes #2977
........
  r9180 | baron | 2007-12-19 10:18:44 -0700 (Wed, 19 Dec 2007) | 2 lines

  Removing generated files that accidentally got checked in
........
  r9181 | baron | 2007-12-19 10:22:15 -0700 (Wed, 19 Dec 2007) | 2 lines

  Return error under error condition
........
  r9183 | nicfit | 2007-12-19 20:11:44 -0700 (Wed, 19 Dec 2007) | 3 lines

  Use show_all on the notebook and not the window when a new tab is added.
  For example, if the roster is hidden in single UI mode and a new chat arrived the roster would unhide.
........
  r9184 | nicfit | 2007-12-19 20:40:27 -0700 (Wed, 19 Dec 2007) | 2 lines

  MessageWindow reconfig bug fixes for deleted roster
........
parent 78f5bce4
This diff is collapsed.
......@@ -643,7 +643,7 @@ class ChatControlBase(MessageControl):
self.orig_msg = None
def print_conversation_line(self, text, kind, name, tim,
other_tags_for_name = [], other_tags_for_time = [],
other_tags_for_name = [], other_tags_for_time = [],
other_tags_for_text = [], count_as_new = True,
subject = None, old_kind = None, xhtml = None):
'''prints 'chat' type messages'''
......
......@@ -315,6 +315,7 @@ class Config:
'zeroconf_last_name': [ opt_str, '', '', True ],
'zeroconf_jabber_id': [ opt_str, '', '', True ],
'zeroconf_email': [ opt_str, '', '', True ],
'use_env_http_proxy' : [opt_bool, False],
}, {}),
'statusmsg': ({
'message': [ opt_str, '' ],
......
......@@ -428,6 +428,39 @@ class Connection(ConnectionHandlers):
proxy['user'] = gajim.config.get_per('proxies', p, 'user')
proxy['password'] = gajim.config.get_per('proxies', p, 'pass')
proxy['type'] = gajim.config.get_per('proxies', p, 'type')
elif gajim.config.get_per('accounts', self.name, 'use_env_http_proxy'):
try:
try:
env_http_proxy = os.environ['HTTP_PROXY']
except:
env_http_proxy = os.environ['http_proxy']
env_http_proxy = env_http_proxy.strip('"')
# Dispose of the http:// prefix
env_http_proxy = env_http_proxy.split('://')
env_http_proxy = env_http_proxy[len(env_http_proxy)-1]
env_http_proxy = env_http_proxy.split('@')
if len(env_http_proxy) == 2:
login = env_http_proxy[0].split(':')
addr = env_http_proxy[1].split(':')
else:
login = ['', '']
addr = env_http_proxy[0].split(':')
proxy = {'host': addr[0], 'type' : u'http', 'user':login[0]}
if len(addr) == 2:
proxy['port'] = addr[1]
else:
proxy['port'] = 3128
if len(login) == 2:
proxy['password'] = login[1]
else:
proxy['password'] = u''
except:
proxy = None
else:
proxy = None
......
......@@ -1663,6 +1663,12 @@ class AccountsWindow:
'priority'))
# Connection tab
use_env_http_proxy = gajim.config.get_per('accounts', account,
'use_env_http_proxy')
self.xml.get_widget('use_env_http_proxy_checkbutton1').set_active(
use_env_http_proxy)
self.xml.get_widget('proxy_hbox1').set_sensitive(not use_env_http_proxy)
usessl = gajim.config.get_per('accounts', account, 'usessl')
self.xml.get_widget('use_ssl_checkbutton1').set_active(usessl)
......@@ -1995,6 +2001,14 @@ class AccountsWindow:
self.on_checkbutton_toggled(widget, 'use_ft_proxies',
account=self.current_account)
def on_use_env_http_proxy_checkbutton1_toggled(self, widget):
if self.ignore_events:
return
self.on_checkbutton_toggled(widget, 'use_env_http_proxy',
account=self.current_account)
hbox = self.xml.get_widget('proxy_hbox1')
hbox.set_sensitive(not widget.get_active())
def on_proxies_combobox1_changed(self, widget):
active = widget.get_active()
proxy = widget.get_model()[active][0].decode('utf-8')
......
......@@ -238,7 +238,10 @@ class MessageWindow(object):
self.setup_tab_dnd(control.widget)
self.redraw_tab(control)
self.window.show_all()
if self.parent_paned:
self.notebook.show_all()
else:
self.window.show_all()
# NOTE: we do not call set_control_active(True) since we don't know whether
# the tab is the active one.
self.show_title()
......@@ -437,7 +440,6 @@ class MessageWindow(object):
# Don't close parent window, just remove the child
child = self.parent_paned.get_child2()
self.parent_paned.remove(child)
# FIXME: restore preferred roster size
else:
self.window.destroy()
return # don't show_title, we are dead
......@@ -925,8 +927,10 @@ class MessageWindowMgr(gobject.GObject):
def shutdown(self, width_adjust=0):
for w in self.windows():
self.save_state(w, width_adjust)
w.window.hide()
w.window.destroy()
if not w.parent_paned:
w.window.hide()
w.window.destroy()
gajim.interface.save_config()
def save_state(self, msg_win, width_adjust=0):
......@@ -993,7 +997,10 @@ class MessageWindowMgr(gobject.GObject):
controls = []
for w in self.windows():
w.window.hide()
# Note, we are taking care not to hide/delete the roster window when the
# MessageWindow is embedded.
if not w.parent_paned:
w.window.hide()
while w.notebook.get_n_pages():
page = w.notebook.get_nth_page(0)
ctrl = w._widget_to_control(page)
......@@ -1002,7 +1009,12 @@ class MessageWindowMgr(gobject.GObject):
controls.append(ctrl)
# Must clear _controls from window to prevent MessageControl.shutdown calls
w._controls = {}
w.window.destroy()
if not w.parent_paned:
w.window.destroy()
else:
# Don't close parent window, just remove the child
child = w.parent_paned.get_child2()
w.parent_paned.remove(child)
self._windows = {}
......
......@@ -114,6 +114,7 @@ static PyObject * idle_getIdleSec(PyObject *self, PyObject *args)
else
{
printf("Couldn't grab properties of system\n");
return NULL;
}
if (obj)
......
......@@ -1244,7 +1244,7 @@ class RosterWindow:
item.set_image(icon)
item.connect('activate', self.on_join_gc_activate, account)
gc_sub_menu.append(item)
if len(gajim.connections[account].bookmarks) > 0: # user has at least one bookmark
item = gtk.SeparatorMenuItem() # separator
gc_sub_menu.append(item)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment