...
 
Commits (5)
  • Yann Leboulanger's avatar
    begining of normal control work: get single message patch from #1041 and begin... · e4016315
    Yann Leboulanger authored
    begining of normal control work: get single message patch from #1041 and begin to make it a MessageControl subclass
    e4016315
  • nicfit's avatar
    Merged revisions 9178 via svnmerge from · 78f5bce4
    nicfit authored
    svn://88.191.11.156/gajim/trunk
    
    ................
      r9178 | nicfit | 2007-12-18 16:42:22 -0700 (Tue, 18 Dec 2007) | 55 lines
    
      Merge one_window branch
    
      Merged revisions 9143,9145-9155,9157-9162,9164-9169,9171-9177 via svnmerge from
      svn://88.191.11.156/gajim/branches/one_window
    
      ........
        r9145 | nicfit | 2007-12-13 21:49:09 -0700 (Thu, 13 Dec 2007) | 2 lines
    
        Implemented the original Nikos patch with an HPaned instead of a HBox and only do this mode when one_message_window == 'always'
      ........
        r9152 | nicfit | 2007-12-15 13:33:56 -0700 (Sat, 15 Dec 2007) | 2 lines
    
        Added config and GUI for one_message_window_with_roster
      ........
        r9153 | nicfit | 2007-12-15 13:41:46 -0700 (Sat, 15 Dec 2007) | 2 lines
    
        Use one_message_window_with_roster and some whitespace cleanup
      ........
        r9154 | nicfit | 2007-12-15 14:04:49 -0700 (Sat, 15 Dec 2007) | 2 lines
    
        Scratch the chckbox for with roster mode, use one_message_window opt and combo
      ........
        r9155 | nicfit | 2007-12-15 17:01:13 -0700 (Sat, 15 Dec 2007) | 2 lines
    
        MessageWindowMgr knows about ONE_MESSAGE_WINDOW_ALWAYS_WITH_ROSTER and MessageWindow can reparent itself rather then the roster having to do so.
      ........
        r9157 | nicfit | 2007-12-15 17:47:20 -0700 (Sat, 15 Dec 2007) | 2 lines
    
        Resizing fixes and make the roster window shrink when last tab is removed
      ........
        r9158 | nicfit | 2007-12-15 19:15:11 -0700 (Sat, 15 Dec 2007) | 2 lines
    
        Added "Show roster" (CTRL+R) to view menu when using always_with_roster to quickly hide/show the roster.
      ........
        r9159 | nicfit | 2007-12-15 19:49:30 -0700 (Sat, 15 Dec 2007) | 2 lines
    
        Handle window title setting in always_with_roster mode.
      ........
        r9160 | nicfit | 2007-12-15 20:13:57 -0700 (Sat, 15 Dec 2007) | 2 lines
    
        Removed FIXME
      ........
        r9167 | nicfit | 2007-12-17 18:40:59 -0700 (Mon, 17 Dec 2007) | 2 lines
    
        When roster is hidden, show it when the number of MessageWindow controls == 0
      ........
        r9168 | nicfit | 2007-12-17 19:07:49 -0700 (Mon, 17 Dec 2007) | 2 lines
    
        Disable hiding roster when there are no message controls open
      ........
        r9169 | nicfit | 2007-12-17 20:41:11 -0700 (Mon, 17 Dec 2007) | 2 lines
    
        Bunch of saved size bugs fixed
      ........
    ................
    78f5bce4
  • nicfit's avatar
    Merged revisions 9172-9175,9177,9179-9185 via svnmerge from · 67e07629
    nicfit authored
    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
    ........
    67e07629
  • Yann Leboulanger's avatar
    3b0b7228
  • Emmanuel Gil Peyrot's avatar
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -230,6 +230,17 @@
<signal name="activate" handler="on_show_transports_menuitem_activate"/>
</widget>
</child>
<child>
<widget class="GtkCheckMenuItem" id="show_roster_menuitem">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">Show _roster</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<signal name="toggled" handler="on_show_roster_menuitem_toggled"/>
<accelerator key="R" modifiers="GDK_CONTROL_MASK" signal="activate"/>
</widget>
</child>
<child>
<widget class="GtkSeparatorMenuItem" id="separator3">
<property name="visible">True</property>
......@@ -352,45 +363,65 @@
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow">
<widget class="GtkHPaned" id="roster_hpaned">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">2</property>
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkTreeView" id="roster_treeview">
<widget class="GtkVBox" id="roster_vbox2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
<property name="reorderable">True</property>
<signal name="leave_notify_event" handler="on_roster_treeview_leave_notify_event"/>
<signal name="button_press_event" handler="on_roster_treeview_button_press_event"/>
<signal name="motion_notify_event" handler="on_roster_treeview_motion_notify_event"/>
<signal name="row_collapsed" handler="on_roster_treeview_row_collapsed"/>
<signal name="row_expanded" handler="on_roster_treeview_row_expanded"/>
<signal name="key_press_event" handler="on_roster_treeview_key_press_event"/>
<signal name="row_activated" handler="on_roster_treeview_row_activated"/>
<signal name="button_release_event" handler="on_roster_treeview_button_release_event"/>
<signal name="scroll_event" handler="on_roster_treeview_scroll_event"/>
<signal name="style_set" handler="on_roster_treeview_style_set"/>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">2</property>
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<child>
<widget class="GtkTreeView" id="roster_treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
<property name="reorderable">True</property>
<signal name="leave_notify_event" handler="on_roster_treeview_leave_notify_event"/>
<signal name="button_press_event" handler="on_roster_treeview_button_press_event"/>
<signal name="motion_notify_event" handler="on_roster_treeview_motion_notify_event"/>
<signal name="row_collapsed" handler="on_roster_treeview_row_collapsed"/>
<signal name="row_expanded" handler="on_roster_treeview_row_expanded"/>
<signal name="key_press_event" handler="on_roster_treeview_key_press_event"/>
<signal name="row_activated" handler="on_roster_treeview_row_activated"/>
<signal name="button_release_event" handler="on_roster_treeview_button_release_event"/>
<signal name="scroll_event" handler="on_roster_treeview_scroll_event"/>
<signal name="style_set" handler="on_roster_treeview_style_set"/>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkComboBox" id="status_combobox">
<property name="visible">True</property>
<signal name="changed" handler="on_status_combobox_changed"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="resize">False</property>
<property name="shrink">True</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkComboBox" id="status_combobox">
<property name="visible">True</property>
<signal name="changed" handler="on_status_combobox_changed"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
</widget>
</child>
</widget>
......
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'''
......@@ -1623,7 +1623,7 @@ class ChatControl(ChatControlBase):
def prepare_context_menu(self):
'''sets compact view menuitem active state
sets active and sensitivity state for toggle_gpg_menuitem
sets sensitivity for history_menuitem (False for tranasports)
sets sensitivity for history_menuitem (False for transports)
and file_transfer_menuitem
and hide()/show() for add_to_roster_menuitem
'''
......
......@@ -45,8 +45,9 @@ opt_int = [ 'integer', 0 ]
opt_str = [ 'string', 0 ]
opt_bool = [ 'boolean', 0 ]
opt_color = [ 'color', '^(#[0-9a-fA-F]{6})|()$' ]
opt_one_window_types = ['never', 'always', 'peracct', 'pertype']
opt_one_window_types = ['never', 'always', 'always_with_roster', 'peracct', 'pertype']
opt_treat_incoming_messages = ['', 'chat', 'normal']
opt_default_outgoing_messages_type = ['chat', 'normal']
class Config:
......@@ -229,7 +230,7 @@ class Config:
'send_sha_in_gc_presence': [opt_bool, True, _('Jabberd1.4 does not like sha info when one join a password protected group chat. Turn this option to False to stop sending sha info in group chat presences.')],
'one_message_window': [opt_str, 'always',
#always, never, peracct, pertype should not be translated
_('Controls the window where new messages are placed.\n\'always\' - All messages are sent to a single window.\n\'never\' - All messages get their own window.\n\'peracct\' - Messages for each account are sent to a specific window.\n\'pertype\' - Each message type (e.g., chats vs. groupchats) are sent to a specific window. Note, changing this option requires restarting Gajim before the changes will take effect.')],
_('Controls the window where new messages are placed.\n\'always\' - All messages are sent to a single window.\n\'always_with_roster\' - Like \'always\' but the messages are in a single window along with the roster.\n\'never\' - All messages get their own window.\n\'peracct\' - Messages for each account are sent to a specific window.\n\'pertype\' - Each message type (e.g., chats vs. groupchats) are sent to a specific window.')],
'show_avatar_in_chat': [opt_bool, True, _('If False, you will no longer see the avatar in the chat window.')],
'escape_key_closes': [opt_bool, True, _('If True, pressing the escape key closes a tab/window.')],
'compact_view': [opt_bool, False, _('Hides the buttons in chat windows.')],
......@@ -246,6 +247,7 @@ class Config:
'use_gnomekeyring': [opt_bool, True, _('If True, Gajim will use Gnome Keyring (if available) to store account passwords.')],
'show_contacts_number': [opt_bool, True, _('If True, Gajim will show number of online and total contacts in account and group rows.')],
'treat_incoming_messages': [ opt_str, '', _('Can be empty, \'chat\' or \'normal\'. If not empty, treat all incoming messages as if they were of this type')],
'default_outgoing_messages_type': [ opt_str, 'chat', _('Can be \'chat\' or \'normal\'. Default type of outgoing messages.')],
'scroll_roster_to_last_message': [opt_bool, True, _('If True, Gajim will scroll and select the contact who sent you the last message, if chat window is not already opened.')],
'use_latex': [opt_bool, False, _('If True, Gajim will convert string between $$ and $$ to an image using dvips and convert before insterting it in chat window.')],
'change_status_window_timeout': [opt_int, 15, _('Time of inactivity needed before the change status window closes down.')],
......@@ -313,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
......
......@@ -6,6 +6,7 @@
## Copyright (C) 2003-2005 Vincent Hanquez <tab@snarc.org>
## Copyright (C) 2006 Stefan Bethge <stefan@lanpartei.de>
## Copyright (C) 2007 Stephan Erb <steve-e@h3c.de>
## Copyright (C) 2007 Travis Shirk <travis@pobox.com>
##
## This file is part of Gajim.
##
......@@ -72,6 +73,8 @@ class PreferencesWindow:
self.notebook = self.xml.get_widget('preferences_notebook')
self.treat_incoming_messages_combobox =\
self.xml.get_widget('treat_incoming_messages_combobox')
self.default_outgoing_messages_type_combobox =\
self.xml.get_widget('default_outgoing_messages_type_combobox')
self.one_window_type_combobox =\
self.xml.get_widget('one_window_type_combobox')
self.iconset_combobox = self.xml.get_widget('iconset_combobox')
......@@ -141,6 +144,15 @@ class PreferencesWindow:
else:
self.treat_incoming_messages_combobox.set_active(0)
# Set default for send outgoing messages
choices = common.config.opt_default_outgoing_messages_type
type = gajim.config.get('default_outgoing_messages_type')
if type in choices:
self.default_outgoing_messages_type_combobox.set_active(
choices.index(type))
else:
self.default_outgoing_messages_type_combobox.set_active(0)
# Set default for single window type
choices = common.config.opt_one_window_types
type = gajim.config.get('one_message_window')
......@@ -174,7 +186,7 @@ class PreferencesWindow:
# iconset
iconsets_list = os.listdir(os.path.join(gajim.DATA_DIR, 'iconsets'))
if os.path.isdir(gajim.MY_ICONSETS_PATH):
iconsets_list += os.listdir(gajim.MY_ICONSETS_PATH)
iconsets_list += os.listdir(gajim.MY_ICONSETS_PATH)
# new model, image in 0, string in 1
model = gtk.ListStore(gtk.Image, str)
renderer_image = cell_renderer_image.CellRendererImage(0, 0)
......@@ -537,9 +549,9 @@ class PreferencesWindow:
self.on_msg_treemodel_row_deleted)
self.default_msg_tree.get_model().connect('row-changed',
self.on_default_msg_treemodel_row_changed)
self.theme_preferences = None
self.notebook.set_current_page(0)
if not gajim.config.get('use_pep'):
self.notebook.remove_page(4)
......@@ -642,6 +654,11 @@ class PreferencesWindow:
config_type = common.config.opt_treat_incoming_messages[active]
gajim.config.set('treat_incoming_messages', config_type)
def on_default_outgoing_messages_type_combobox_changed(self, widget):
active = widget.get_active()
config_type = common.config.opt_default_outgoing_messages_type[active]
gajim.config.set('default_outgoing_messages_type', config_type)
def on_one_window_type_combo_changed(self, widget):
active = widget.get_active()
config_type = common.config.opt_one_window_types[active]
......@@ -1646,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)
......@@ -1978,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')
......
This diff is collapsed.
## message_control.py
##
## Copyright (C) 2006 Travis Shirk <travis@pobox.com>
## Copyright (C) 2006-2007 Travis Shirk <travis@pobox.com>
## Copyright (C) 2007 Stephan Erb <steve-e@h3c.de>
##
## This file is part of Gajim.
......@@ -34,7 +34,7 @@ class MessageControl:
def __init__(self, type_id, parent_win, widget_name, contact, account, resource = None):
# dict { cb id : widget}
# keep all registered callbacks of widgets, created by self.xml
self.handlers = {}
self.handlers = {}
self.type_id = type_id
self.parent_win = parent_win
self.widget_name = widget_name
......@@ -126,8 +126,8 @@ class MessageControl:
if self.session.enable_encryption:
was_encrypted = True
print "starting a new session, dropping the old one!"
gajim.connections[self.account].delete_session(self.session.jid, self.session.thread_id)
gajim.connections[self.account].delete_session(self.session.jid,
self.session.thread_id)
self.session = session
......
This diff is collapsed.
This diff is collapsed.
......@@ -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)
......
......@@ -6,6 +6,7 @@
## Copyright (C) 2005-2006 Andrew Sayman <lorien420@myrealbox.com>
## Copyright (C) 2007 Lukas Petrovicky <lukas@petrovicky.net>
## Copyright (C) 2007 Julien Pivotto <roidelapluie@gmail.com>
## Copyright (C) 2007 Travis Shirk <travis@pobox.com>
##
## This file is part of Gajim.
##
......
This diff is collapsed.