changeset bf3cbcef9306 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=bf3cbcef9306
description: fix resizing of the MUC occupant treeview when we resize chat window. Fixes #5433
diffstat:
src/groupchat_control.py | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diffs (43 lines):
diff -r 416a49f14391 -r bf3cbcef9306 src/groupchat_control.py
--- a/src/groupchat_control.py Tue Nov 24 15:41:16 2009 +0100
+++ b/src/groupchat_control.py Fri Nov 20 22:09:05 2009 +0100
@@ -318,6 +318,7 @@
id_ = self.list_treeview.connect('style-set',
self.on_list_treeview_style_set)
self.handlers[id_] = self.list_treeview
+ self.resize_from_another_muc = False
# we want to know when the the widget resizes, because that is
# an indication that the hpaned has moved...
# FIXME: Find a better indicator that the hpaned has moved.
@@ -441,17 +442,29 @@
menu.show_all()
+ def resize_occupant_treeview(self, position):
+ self.resize_from_another_muc = True
+ self.hpaned.set_position(position)
+ def reset_flag():
+ self.resize_from_another_muc = False
+ # Reset the flag when everything will be redrawn, and in particular when
+ # on_treeview_size_allocate will have been called.
+ gobject.idle_add(reset_flag)
+
def on_treeview_size_allocate(self, widget, allocation):
'''The MUC treeview has resized. Move the hpaned in all tabs to match'''
+ if self.resize_from_another_muc:
+ # Don't send the event to other MUC
+ return
hpaned_position = self.hpaned.get_position()
for account in gajim.gc_connected:
for room_jid in [i for i in gajim.gc_connected[account] if \
- gajim.gc_connected[account][i]]:
+ gajim.gc_connected[account][i] and i != self.room_jid]:
ctrl = gajim.interface.msg_win_mgr.get_gc_control(room_jid, account)
if not ctrl:
ctrl = gajim.interface.minimized_controls[account][room_jid]
if ctrl:
- ctrl.hpaned.set_position(hpaned_position)
+ ctrl.resize_occupant_treeview(hpaned_position)
def iter_contact_rows(self):
'''iterate over all contact rows in the tree model'''
changeset 9938de8ef67d in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=9938de8ef67d
description: prevent having twice the same group for a contact. Fixes #5504
diffstat:
src/common/xmpp/roster_nb.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diffs (14 lines):
diff -r 9f1b512429cb -r 9938de8ef67d src/common/xmpp/roster_nb.py
--- a/src/common/xmpp/roster_nb.py Sun Dec 06 22:09:44 2009 +0100
+++ b/src/common/xmpp/roster_nb.py Tue Dec 15 19:04:35 2009 +0100
@@ -85,7 +85,9 @@
self._data[jid]['subscription']=item.getAttr('subscription')
self._data[jid]['groups']=[]
if not self._data[jid].has_key('resources'): self._data[jid]['resources']={}
- for group in item.getTags('group'): self._data[jid]['groups'].append(group.getData())
+ for group in item.getTags('group'):
+ if group.getData() not in self._data[jid]['groups']:
+ self._data[jid]['groups'].append(group.getData())
self._data[self._owner.User+'@'+self._owner.Server]={'resources':{},'name':None,'ask':None,'subscription':None,'groups':None,}
self.set=1
# Looks like we have a workaround
changeset 475d5057e4e4 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=475d5057e4e4
description: harmonize indentation. Fixes #5518
diffstat:
src/common/gajim.py | 8 ++++----
src/common/xmpp/protocol.py | 12 ++++++------
src/common/zeroconf/zeroconf_avahi.py | 4 ++--
src/common/zeroconf/zeroconf_bonjour.py | 22 +++++++++++-----------
src/groupchat_control.py | 8 ++++----
src/history_manager.py | 32 ++++++++++++++++----------------
src/roster_window.py | 4 ++--
7 files changed, 45 insertions(+), 45 deletions(-)
diffs (246 lines):
diff -r 1d96df4d8e56 -r 475d5057e4e4 src/common/gajim.py
--- a/src/common/gajim.py Mon Dec 28 22:41:05 2009 +0100
+++ b/src/common/gajim.py Mon Dec 28 23:04:23 2009 +0100
@@ -82,7 +82,7 @@
MY_ICONSETS_PATH = gajimpaths['MY_ICONSETS']
MY_MOOD_ICONSETS_PATH = gajimpaths['MY_MOOD_ICONSETS']
MY_ACTIVITY_ICONSETS_PATH = gajimpaths['MY_ACTIVITY_ICONSETS']
-MY_CACERTS = gajimpaths['MY_CACERTS']
+MY_CACERTS = gajimpaths['MY_CACERTS']
TMP = gajimpaths['TMP']
DATA_DIR = gajimpaths['DATA']
ICONS_DIR = gajimpaths['ICONS']
@@ -223,9 +223,9 @@
return jid[pos:]
def get_resource_from_jid(jid):
- tokens = jid.split('/', 1)
- if len(tokens) > 1:
- return tokens[1]
+ tokens = jid.split('/', 1)
+ if len(tokens) > 1:
+ return tokens[1]
def get_name_and_server_from_jid(jid):
name = get_nick_from_jid(jid)
diff -r 1d96df4d8e56 -r 475d5057e4e4 src/common/xmpp/protocol.py
--- a/src/common/xmpp/protocol.py Mon Dec 28 22:41:05 2009 +0100
+++ b/src/common/xmpp/protocol.py Mon Dec 28 23:04:23 2009 +0100
@@ -523,12 +523,12 @@
return time.strftime('%Y%m%dT%H:%M:%S', time.gmtime())
def getTimestamp2(self):
- """
- Return the timestamp in the 'yyyymmddThhmmss' format
- """
- if self.timestamp:
- return self.timestamp
- return time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())
+ """
+ Return the timestamp in the 'yyyymmddThhmmss' format
+ """
+ if self.timestamp:
+ return self.timestamp
+ return time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())
def getID(self):
"""
diff -r 1d96df4d8e56 -r 475d5057e4e4 src/common/zeroconf/zeroconf_avahi.py
--- a/src/common/zeroconf/zeroconf_avahi.py Mon Dec 28 22:41:05 2009 +0100
+++ b/src/common/zeroconf/zeroconf_avahi.py Mon Dec 28 23:04:23 2009 +0100
@@ -77,7 +77,7 @@
log.debug('Found service %s in domain %s on %i.%i.' % (name, domain,
interface, protocol))
if not self.connected:
- return
+ return
# synchronous resolving
self.server.ResolveService( int(interface), int(protocol), name, stype,
@@ -90,7 +90,7 @@
log.debug('Service %s in domain %s on %i.%i disappeared.' % (name,
domain, interface, protocol))
if not self.connected:
- return
+ return
if name != self.name:
for key in self.contacts.keys():
if self.contacts[key][C_BARE_NAME] == name:
diff -r 1d96df4d8e56 -r 475d5057e4e4 src/common/zeroconf/zeroconf_bonjour.py
--- a/src/common/zeroconf/zeroconf_bonjour.py Mon Dec 28 22:41:05 2009 +0100
+++ b/src/common/zeroconf/zeroconf_bonjour.py Mon Dec 28 23:04:23 2009 +0100
@@ -10,11 +10,11 @@
##
## Gajim is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
-## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
+## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
##
from common import gajim
@@ -28,14 +28,14 @@
pass
-resolve_timeout = 1
+resolve_timeout = 1
class Zeroconf:
def __init__(self, new_serviceCB, remove_serviceCB, name_conflictCB,
disconnected_CB, error_CB, name, host, port):
- self.domain = None # specific domain to browse
+ self.domain = None # specific domain to browse
self.stype = '_presence._tcp'
- self.port = port # listening port that gets announced
+ self.port = port # listening port that gets announced
self.username = name
self.host = host
self.txt = pybonjour.TXTRecord() # service data
@@ -48,7 +48,7 @@
self.disconnected_CB = disconnected_CB
self.error_CB = error_CB
- self.contacts = {} # all current local contacts with data
+ self.contacts = {} # all current local contacts with data
self.connected = False
self.announced = False
self.invalid_self_contact = {}
@@ -58,7 +58,7 @@
def browse_callback(self, sdRef, flags, interfaceIndex, errorCode, serviceName, regtype, replyDomain):
gajim.log.debug('Found service %s in domain %s on %i(type: %s).' % (serviceName, replyDomain, interfaceIndex, regtype))
if not self.connected:
- return
+ return
if errorCode != pybonjour.kDNSServiceErr_NoError:
return
if not (flags & pybonjour.kDNSServiceFlagsAdd):
@@ -83,7 +83,7 @@
def remove_service_callback(self, name):
gajim.log.debug('Service %s disappeared.' % name)
if not self.connected:
- return
+ return
if name != self.name:
for key in self.contacts.keys():
if self.contacts[key][C_BARE_NAME] == name:
@@ -103,7 +103,7 @@
def service_resolved_callback(self, sdRef, flags, interfaceIndex, errorCode, fullname,
hosttarget, port, txtRecord):
- # TODO: do proper decoding...
+ # TODO: do proper decoding...
escaping= {
r'\.': '.',
r'\032': ' ',
@@ -211,7 +211,7 @@
txt['version'] = 1
txt['txtvers'] = 1
- # replace gajim's show messages with compatible ones
+ # replace gajim's show messages with compatible ones
if 'status' in self.txt:
txt['status'] = self.replace_show(self.txt['status'])
else:
@@ -221,7 +221,7 @@
try:
sdRef = pybonjour.DNSServiceRegister(name = self.name,
- regtype = self.stype, port = self.port, txtRecord = self.txt,
+ regtype = self.stype, port = self.port, txtRecord = self.txt,
callBack = self.service_added_callback)
self.service_sdRef = sdRef
except pybonjour.BonjourError, e:
diff -r 1d96df4d8e56 -r 475d5057e4e4 src/groupchat_control.py
--- a/src/groupchat_control.py Mon Dec 28 22:41:05 2009 +0100
+++ b/src/groupchat_control.py Mon Dec 28 23:04:23 2009 +0100
@@ -126,8 +126,8 @@
class PrivateChatControl(ChatControl):
TYPE_ID = message_control.TYPE_PM
- # Set a command host to bound to. Every command given through a private chat
- # will be processed with this command host.
+ # Set a command host to bound to. Every command given through a private chat
+ # will be processed with this command host.
COMMAND_HOST = PrivateChatCommands
def __init__(self, parent_win, gc_contact, contact, account, session):
@@ -193,8 +193,8 @@
class GroupchatControl(ChatControlBase):
TYPE_ID = message_control.TYPE_GC
- # Set a command host to bound to. Every command given through a group chat
- # will be processed with this command host.
+ # Set a command host to bound to. Every command given through a group chat
+ # will be processed with this command host.
COMMAND_HOST = GroupChatCommands
def __init__(self, parent_win, contact, acct, is_continued=False):
diff -r 1d96df4d8e56 -r 475d5057e4e4 src/history_manager.py
--- a/src/history_manager.py Mon Dec 28 22:41:05 2009 +0100
+++ b/src/history_manager.py Mon Dec 28 23:04:23 2009 +0100
@@ -57,23 +57,23 @@
from common import i18n
def parseOpts():
- config_path = None
+ config_path = None
- try:
- shortargs = 'hc:'
- longargs = 'help config_path='
- opts = getopt.getopt(sys.argv[1:], shortargs, longargs.split())[0]
- except getopt.error, msg:
- print str(msg)
- print 'for help use --help'
- sys.exit(2)
- for o, a in opts:
- if o in ('-h', '--help'):
- print 'history_manager [--help] [--config-path]'
- sys.exit()
- elif o in ('-c', '--config-path'):
- config_path = a
- return config_path
+ try:
+ shortargs = 'hc:'
+ longargs = 'help config_path='
+ opts = getopt.getopt(sys.argv[1:], shortargs, longargs.split())[0]
+ except getopt.error, msg:
+ print str(msg)
+ print 'for help use --help'
+ sys.exit(2)
+ for o, a in opts:
+ if o in ('-h', '--help'):
+ print 'history_manager [--help] [--config-path]'
+ sys.exit()
+ elif o in ('-c', '--config-path'):
+ config_path = a
+ return config_path
config_path = parseOpts()
del parseOpts
diff -r 1d96df4d8e56 -r 475d5057e4e4 src/roster_window.py
--- a/src/roster_window.py Mon Dec 28 22:41:05 2009 +0100
+++ b/src/roster_window.py Mon Dec 28 23:04:23 2009 +0100
@@ -1778,7 +1778,7 @@
"""
Remove contacts on last events removed
- Only performed if removal was requested before but the contact still had
+ Only performed if removal was requested before but the contact still had
pending events
"""
contact_list = ((event.jid.split('/')[0], event.account) for event in \
@@ -5748,7 +5748,7 @@
self.popups_notification_height = 0
self.popup_notification_windows = []
- # Remove contact from roster when last event opened
+ # Remove contact from roster when last event opened
# { (contact, account): { backend: boolean }
self.contacts_to_be_removed = {}
gajim.events.event_removed_subscribe(self.on_event_removed)