diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/config.py | 1 | ||||
-rw-r--r-- | src/dialogs.py | 9 | ||||
-rw-r--r-- | src/disco.py | 2 | ||||
-rw-r--r-- | src/filetransfers_window.py | 1 | ||||
-rwxr-xr-x | src/gajim-remote.py | 2 | ||||
-rwxr-xr-x | src/gajim.py | 24 | ||||
-rw-r--r-- | src/gajim_themes_window.py | 1 | ||||
-rw-r--r-- | src/groupchat_control.py | 5 | ||||
-rw-r--r-- | src/message_control.py | 10 | ||||
-rw-r--r-- | src/message_window.py | 1 | ||||
-rw-r--r-- | src/notify.py | 2 | ||||
-rw-r--r-- | src/remote_control.py | 7 | ||||
-rw-r--r-- | src/systray.py | 4 | ||||
-rw-r--r-- | src/systraywin32.py | 12 | ||||
-rw-r--r-- | src/vcard.py | 8 |
15 files changed, 22 insertions, 67 deletions
diff --git a/src/config.py b/src/config.py index 60f840d4b..2dc893317 100644 --- a/src/config.py +++ b/src/config.py @@ -19,7 +19,6 @@ import gtk import gtk.glade import gobject import os -import sys import common.config import common.sleepy diff --git a/src/dialogs.py b/src/dialogs.py index 9d50d9054..925a97ccb 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -22,7 +22,7 @@ import gtk import gtk.glade import gobject import os -import Queue +import sys import gtkgui_helpers import vcard @@ -34,9 +34,12 @@ try: except: HAS_GTK_SPELL = False +# those imports are not used in this file, but in files that import dialog +# so they can do dialog.GajimThemesWindow() for example from filetransfers_window import FileTransfersWindow from gajim_themes_window import GajimThemesWindow from advanced import AdvancedConfigurationWindow + from common import gajim from common import helpers from common import i18n @@ -1038,7 +1041,7 @@ class PopupNotificationWindow: attached_keys = gajim.config.get_per('accounts', self.account, 'attached_gpg_keys').split() if self.jid in attached_keys: - keyID = attached_keys[attached_keys.index(jid) + 1] + keyID = attached_keys[attached_keys.index(self.jid) + 1] if self.msg_type.find('file') != 0: if self.msg_type == 'pm': room_jid, nick = self.jid.split('/', 1) @@ -1117,7 +1120,7 @@ class SingleMessageWindow: gtkspell.Spell(self.message_textview) except gobject.GError, msg: #FIXME: add a ui for this use spell.set_language() - dialogs.ErrorDialog(unicode(msg), _('If that is not your language for which you want to highlight misspelled words, then please set your $LANG as appropriate. Eg. for French do export LANG=fr_FR or export LANG=fr_FR.UTF-8 in ~/.bash_profile or to make it global in /etc/profile.\n\nHighlighting misspelled words feature will not be used')).get_response() + ErrorDialog(unicode(msg), _('If that is not your language for which you want to highlight misspelled words, then please set your $LANG as appropriate. Eg. for French do export LANG=fr_FR or export LANG=fr_FR.UTF-8 in ~/.bash_profile or to make it global in /etc/profile.\n\nHighlighting misspelled words feature will not be used')).get_response() gajim.config.set('use_speller', False) self.send_button.set_no_show_all(True) diff --git a/src/disco.py b/src/disco.py index 534fb0451..234069ec4 100644 --- a/src/disco.py +++ b/src/disco.py @@ -57,10 +57,8 @@ import pango import dialogs import tooltips -from common import helpers from common import gajim from common import xmpp -from common import connection from common import i18n _ = i18n._ diff --git a/src/filetransfers_window.py b/src/filetransfers_window.py index 71704761c..1c4ff9378 100644 --- a/src/filetransfers_window.py +++ b/src/filetransfers_window.py @@ -23,7 +23,6 @@ import gtk.glade import gobject import pango import os -import sys import time import gtkgui_helpers diff --git a/src/gajim-remote.py b/src/gajim-remote.py index 9ad75e97a..5cb77f259 100755 --- a/src/gajim-remote.py +++ b/src/gajim-remote.py @@ -34,8 +34,6 @@ import sys import locale import signal signal.signal(signal.SIGINT, signal.SIG_DFL) # ^C exits the application -import traceback -import gobject from common import exceptions from common import i18n diff --git a/src/gajim.py b/src/gajim.py index 1415fa1df..3048101e0 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -31,7 +31,6 @@ exec python -OOt "$0" ${1+"$@"} import sys import os -import pygtk import message_control @@ -90,10 +89,7 @@ if '.svn' in os.listdir(path) or '_svn' in os.listdir(path): del path import gobject -# TODO remove this comment -# testing how it works without threads_init -import pango import sre import signal import getopt @@ -111,7 +107,6 @@ from common import nslookup from common import proxy65_manager from common import socks5 from common import gajim -from common import connection from common import helpers from common import optparser @@ -151,7 +146,6 @@ import systray import dialogs import vcard import config -import disco GTKGUI_GLADE = 'gtkgui.glade' @@ -599,7 +593,7 @@ class Interface: show = 'offline' gc_c = gajim.contacts.create_gc_contact(room_jid = jid, name = nick, show = show) - c = gajim.contacts.contact_from_gc_contct(c) + c = gajim.contacts.contact_from_gc_contact(gc_c) self.roster.new_chat(c, account, private_chat = True) ctrl = self.msg_win_mgr.get_control(fjid, account) ctrl.print_conversation('Error %s: %s' % (array[1], array[2]), @@ -1702,19 +1696,9 @@ class Interface: self.systray_capabilities = True self.systray = systraywin32.SystrayWin32() else: - try: - import egg.trayicon # use gnomepythonextras trayicon - except: - try: - import trayicon # use the one we distribute - except: # user doesn't have trayicon capabilities - pass - else: - self.systray_capabilities = True - self.systray = systray.Systray() - else: - self.systray_capabilities = True - self.systray = systray.Systray() + self.systray_capabilities = systray.HAS_SYSTRAY_CAPABILITIES + if self.systray_capabilities: + self.systray = systray.Systray() if self.systray_capabilities and gajim.config.get('trayicon'): self.show_systray() diff --git a/src/gajim_themes_window.py b/src/gajim_themes_window.py index 0fd9f0205..7b034e962 100644 --- a/src/gajim_themes_window.py +++ b/src/gajim_themes_window.py @@ -26,7 +26,6 @@ import gtk import gtk.glade -import gobject import pango import dialogs import gtkgui_helpers diff --git a/src/groupchat_control.py b/src/groupchat_control.py index 31412876c..cd1c9375a 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -33,18 +33,13 @@ import dialogs import config import vcard import cell_renderer_image -import history_window -import tooltips from common import gajim from common import helpers -from common import gajim from chat_control import ChatControl from chat_control import ChatControlBase from conversation_textview import ConversationTextview -from message_textview import MessageTextView -from gettext import ngettext from common import i18n _ = i18n._ diff --git a/src/message_control.py b/src/message_control.py index a0fe71653..27890c3ba 100644 --- a/src/message_control.py +++ b/src/message_control.py @@ -13,10 +13,7 @@ ## import gtk import gtk.glade -import pango import gobject -import common -import gtkgui_helpers from common import gajim @@ -112,9 +109,10 @@ class MessageControl: (label_str, color) either of which can be None if chatstate is given that means we have HE SENT US a chatstate and we want it displayed''' - # NOTE: Derived classes SHOULD implement this - # Return a markup'd label and optional gtk.Color - return (label_str, None) #FIXME: label_str is not defined. pychecker your files + # NOTE: Derived classes MUST implement this + # Return a markup'd label and optional gtk.Color in a tupple like: + #return (label_str, None) + pass def get_tab_image(self): '''Return a suitable tab image for display. None clears any current label.''' diff --git a/src/message_window.py b/src/message_window.py index 2e853a72f..06900da66 100644 --- a/src/message_window.py +++ b/src/message_window.py @@ -23,7 +23,6 @@ import gtk import gtk.glade -import pango import gobject import common diff --git a/src/notify.py b/src/notify.py index fe992c430..9ffc71105 100644 --- a/src/notify.py +++ b/src/notify.py @@ -29,12 +29,10 @@ ## import os -import gajim import dialogs import gobject from common import gajim -from common import exceptions from common import i18n i18n.init() _ = i18n._ diff --git a/src/remote_control.py b/src/remote_control.py index 596d56f16..366f14c85 100644 --- a/src/remote_control.py +++ b/src/remote_control.py @@ -26,13 +26,8 @@ ## import gobject -import gtk import os -import sys -import systray - -from common import exceptions from common import gajim from common import helpers from time import time @@ -108,7 +103,7 @@ def get_dbus_struct(obj): if isinstance(obj, float): return DBUS_DOUBLE(obj) if isinstance(obj, bool): - return DBUS_BOLEAN(obj) + return DBUS_BOOLEAN(obj) if isinstance(obj, (list, tuple)): result = [DBUS_VARIANT(get_dbus_struct(i)) for i in obj] if result == []: diff --git a/src/systray.py b/src/systray.py index c3f31e377..a5322172b 100644 --- a/src/systray.py +++ b/src/systray.py @@ -31,6 +31,8 @@ from common import gajim from common import helpers from common import i18n +HAS_SYSTRAY_CAPABILITIES = True + try: import egg.trayicon as trayicon # gnomepythonextras trayicon except: @@ -38,7 +40,7 @@ except: import trayicon # our trayicon except: gajim.log.debug('No trayicon module available') - pass + HAS_SYSTRAY_CAPABILITIES = False _ = i18n._ APP = i18n.APP diff --git a/src/systraywin32.py b/src/systraywin32.py index 9ee236853..8fc302fd1 100644 --- a/src/systraywin32.py +++ b/src/systraywin32.py @@ -98,18 +98,6 @@ class SystrayWINAPI: msg_map[key] = value self._message_map.update(msg_map) - def message_unmap(self, msg, callback=None): - if self._message_map.has_key(msg): - if callback: - cblist = self._message_map[key] - if isinstance(cblist, list): - if not len(cblist) < 2: - for i in xrange(len(cblist)): - if cblist[i] == callback: - del self._message_map[key][i] - return - del self._message_map[key] - def remove_notify_icon(self): """ Removes the notify icon. """ if self.notify_icon: diff --git a/src/vcard.py b/src/vcard.py index 16198709d..af8ca4785 100644 --- a/src/vcard.py +++ b/src/vcard.py @@ -20,11 +20,11 @@ import urllib import base64 import mimetypes import os -import sys import time +import locale + import gtkgui_helpers import dialogs -import locale from common import helpers from common import gajim @@ -502,8 +502,8 @@ class VcardWindow: self.xml.get_widget('PHOTO_image').set_from_pixbuf(None) gajim.connections[self.account].request_vcard(self.jid) else: - ErrorDialog(_('You are not connected to the server'), - _('Without a connection, you can not get your contact information.')).get_response() + dialogs.ErrorDialog(_('You are not connected to the server'), + _('Without a connection, you can not get your contact information.')).get_response() def change_to_vcard(self): self.xml.get_widget('information_notebook').remove_page(0) |