now preferences_window, some tooltips, removed TRUE/FALSE from code and pep appliance in imports
This commit is contained in:
parent
ddc5d7b280
commit
b97b090054
|
@ -3,6 +3,7 @@
|
|||
## Gajim Team:
|
||||
## - Yann Le Boulanger <asterix@lagaule.org>
|
||||
## - Vincent Hanquez <tab@snarc.org>
|
||||
## - Nikos Kouremenos <nkour@jabber.org>
|
||||
##
|
||||
## Copyright (C) 2003-2005 Gajim Team
|
||||
##
|
||||
|
@ -19,9 +20,10 @@
|
|||
import pygtk
|
||||
pygtk.require('2.0')
|
||||
import gtk
|
||||
from gtk import TRUE, FALSE
|
||||
import gtk.glade,gobject
|
||||
import os,string
|
||||
import gtk.glade
|
||||
import gobject
|
||||
import os
|
||||
import string
|
||||
import common.sleepy
|
||||
from common import i18n
|
||||
_ = i18n._
|
||||
|
@ -93,7 +95,6 @@ class vCard_Window:
|
|||
vcard['DESC']= txt
|
||||
return vcard
|
||||
|
||||
|
||||
def on_retrieve(self, widget):
|
||||
if self.plugin.connected[self.account]:
|
||||
self.plugin.send('ASK_VCARD', self.account, self.jid)
|
||||
|
@ -125,7 +126,7 @@ class vCard_Window:
|
|||
self.xml.signal_connect('on_retrieve_clicked', self.on_retrieve)
|
||||
self.xml.signal_connect('on_publish_clicked', self.on_publish)
|
||||
|
||||
class preference_Window:
|
||||
class preferences_window:
|
||||
"""Class for Preferences window"""
|
||||
def delete_event(self, widget):
|
||||
"""close window"""
|
||||
|
@ -135,7 +136,7 @@ class preference_Window:
|
|||
"""When Cancel button is clicked"""
|
||||
widget.get_toplevel().destroy()
|
||||
|
||||
def write_cfg(self):
|
||||
def write_cfg(self): #FIXME: (nk) instant apply
|
||||
"""Save preferences in config File and apply them"""
|
||||
#Color for incomming messages
|
||||
color = self.xml.get_widget('colorbutton_in').get_color()
|
||||
|
@ -316,7 +317,7 @@ class preference_Window:
|
|||
def on_ok(self, widget):
|
||||
"""When Ok button is clicked"""
|
||||
self.write_cfg()
|
||||
self.xml.get_widget('Preferences').destroy()
|
||||
self.xml.get_widget('preferences_window').destroy()
|
||||
|
||||
def on_apply(self, widget):
|
||||
"""When Apply button is clicked"""
|
||||
|
@ -570,8 +571,8 @@ class preference_Window:
|
|||
|
||||
def __init__(self, plugin):
|
||||
"""Initialize Preference window"""
|
||||
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'Preferences', APP)
|
||||
self.window = self.xml.get_widget('Preferences')
|
||||
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'preferences_window', APP)
|
||||
self.window = self.xml.get_widget('preferences_window')
|
||||
self.plugin = plugin
|
||||
self.xml.get_widget('image_emoticons').set_from_file(\
|
||||
'plugins/gtkgui/pixmaps/smile.png')
|
||||
|
@ -829,7 +830,7 @@ class preference_Window:
|
|||
st = self.config_logger['lognotsep']
|
||||
self.xml.get_widget('chk_log_pres_ext').set_active(st)
|
||||
|
||||
class accountPreference_Window:
|
||||
class accountpreferences_window:
|
||||
"""Class for account informations"""
|
||||
def on_account_window_destroy(self, widget):
|
||||
"""close window"""
|
||||
|
@ -1123,7 +1124,7 @@ class accountPreference_Window:
|
|||
self.modify = True
|
||||
self.account = infos['accname']
|
||||
self.init_account(infos)
|
||||
self.xml.get_widget('new_account_checkbutton').set_sensitive(FALSE)
|
||||
self.xml.get_widget('new_account_checkbutton').set_sensitive(False)
|
||||
|
||||
class accounts_Window:
|
||||
"""Class for accounts window : lists of accounts"""
|
||||
|
@ -1158,7 +1159,7 @@ class accounts_Window:
|
|||
"""When new button is clicked : open an account information window"""
|
||||
if not self.plugin.windows.has_key('accountPreference'):
|
||||
self.plugin.windows['accountPreference'] = \
|
||||
accountPreference_Window(self.plugin)
|
||||
accountpreferences_window(self.plugin)
|
||||
|
||||
def on_delete_clicked(self, widget):
|
||||
"""When delete button is clicked :
|
||||
|
@ -1194,7 +1195,7 @@ class accounts_Window:
|
|||
infos['jid'] = self.plugin.accounts[account]["name"] + \
|
||||
'@' + self.plugin.accounts[account]["hostname"]
|
||||
self.plugin.windows['accountPreference'] = \
|
||||
accountPreference_Window(self.plugin, infos)
|
||||
accountpreferences_window(self.plugin, infos)
|
||||
|
||||
def on_toggled(self, cell, path, model=None):
|
||||
iter = model.get_iter(path)
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
## Gajim Team:
|
||||
## - Yann Le Boulanger <asterix@lagaule.org>
|
||||
## - Vincent Hanquez <tab@snarc.org>
|
||||
## - Nikos Kouremenos <nkour@jabber.org>
|
||||
##
|
||||
## Copyright (C) 2003-2005 Gajim Team
|
||||
##
|
||||
|
@ -19,8 +20,8 @@
|
|||
import pygtk
|
||||
pygtk.require('2.0')
|
||||
import gtk
|
||||
from gtk import TRUE, FALSE
|
||||
import gtk.glade,gobject
|
||||
import gtk.glade
|
||||
import gobject
|
||||
import string
|
||||
from common import i18n
|
||||
_ = i18n._
|
||||
|
@ -385,7 +386,7 @@ class warning_Window:
|
|||
xml.get_widget('label').set_text(txt)
|
||||
xml.signal_connect('on_close_clicked', self.on_close)
|
||||
|
||||
class about_Window:
|
||||
class about_Window: #FIXME: (nk) pygtk2.6 has a built-in window for that
|
||||
"""Class for about window"""
|
||||
def delete_event(self, widget):
|
||||
"""close window"""
|
||||
|
|
|
@ -3553,7 +3553,7 @@ on the server as a vCard</property>
|
|||
</child>
|
||||
</widget>
|
||||
|
||||
<widget class="GtkWindow" id="Preferences">
|
||||
<widget class="GtkWindow" id="preferences_window">
|
||||
<property name="border_width">5</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="title" translatable="yes">Preferences</property>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
## Gajim Team:
|
||||
## - Yann Le Boulanger <asterix@lagaule.org>
|
||||
## - Vincent Hanquez <tab@snarc.org>
|
||||
## - Nikos Kouremenos <nkour@jabber.org>
|
||||
##
|
||||
## Copyright (C) 2003-2005 Gajim Team
|
||||
##
|
||||
|
@ -19,7 +20,7 @@
|
|||
def usage():
|
||||
#TODO: use i18n
|
||||
print "usage :", sys.argv[0], ' [OPTION]'
|
||||
print " -p\tport on whitch the sock plugin listen"
|
||||
print " -p\tport on which the sock plugin listen"
|
||||
print " -h, --help\tdisplay this help and exit"
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -1052,12 +1053,12 @@ class gc:
|
|||
int(event.y))
|
||||
except TypeError:
|
||||
self.tree.get_selection().unselect_all()
|
||||
return gtk.FALSE
|
||||
return False
|
||||
model = self.tree.get_model()
|
||||
iter = model.get_iter(path)
|
||||
if len(path) == 2:
|
||||
self.mk_menu(event, iter)
|
||||
return gtk.TRUE
|
||||
return True
|
||||
if event.button == 1:
|
||||
try:
|
||||
path, column, x, y = self.tree.get_path_at_pos(int(event.x), \
|
||||
|
@ -1067,7 +1068,7 @@ class gc:
|
|||
if event.type == gtk.gdk.KEY_RELEASE:
|
||||
if event.keyval == gtk.keysyms.Escape:
|
||||
self.tree.get_selection().unselect_all()
|
||||
return gtk.FALSE
|
||||
return False
|
||||
|
||||
def on_row_activated(self, widget, path, col=0):
|
||||
"""When an iter is dubble clicked :
|
||||
|
@ -1117,7 +1118,7 @@ class gc:
|
|||
render = gtk.CellRendererPixbuf()
|
||||
col.pack_start(render, expand = False)
|
||||
self.tree.append_column(col)
|
||||
col.set_visible(FALSE)
|
||||
col.set_visible(False)
|
||||
self.tree.set_expander_column(col)
|
||||
|
||||
conversation = self.xml.get_widget('conversation')
|
||||
|
@ -1349,7 +1350,7 @@ class roster_Window:
|
|||
statuss = ['offline', 'online', 'away', 'xa', 'dnd', 'invisible']
|
||||
status = statuss[self.plugin.connected[account]]
|
||||
model.append(None, (self.pixbufs[status], account, 'account', account,\
|
||||
account, FALSE))
|
||||
account, False))
|
||||
|
||||
def add_user_to_roster(self, jid, account):
|
||||
"""Add a user to the roster and add groups if they aren't in roster"""
|
||||
|
@ -1376,7 +1377,7 @@ class roster_Window:
|
|||
IterAcct = self.get_account_iter(account)
|
||||
iterG = model.append(IterAcct, \
|
||||
(self.pixbufs['closed'], g, 'group', \
|
||||
g, account, FALSE))
|
||||
g, account, False))
|
||||
if not self.groups[account].has_key(g): #It can probably never append
|
||||
if account+g in self.hidden_lines:
|
||||
self.groups[account][g] = {'expand': False}
|
||||
|
@ -1679,13 +1680,13 @@ class roster_Window:
|
|||
menu = gtk.Menu()
|
||||
item = gtk.MenuItem(_("Log on"))
|
||||
if self.contacts[account][jid][0].show != 'offline':
|
||||
item.set_sensitive(FALSE)
|
||||
item.set_sensitive(False)
|
||||
menu.append(item)
|
||||
item.connect("activate", self.on_agent_logging, jid, 'available', account)
|
||||
|
||||
item = gtk.MenuItem(_("Log off"))
|
||||
if self.contacts[account][jid][0].show == 'offline':
|
||||
item.set_sensitive(FALSE)
|
||||
item.set_sensitive(False)
|
||||
menu.append(item)
|
||||
item.connect("activate", self.on_agent_logging, jid, 'unavailable', \
|
||||
account)
|
||||
|
@ -1780,7 +1781,7 @@ class roster_Window:
|
|||
"""when a key is pressed in the treeviews"""
|
||||
if event.keyval == gtk.keysyms.Escape:
|
||||
self.tree.get_selection().unselect_all()
|
||||
return gtk.FALSE
|
||||
return False
|
||||
|
||||
def on_roster_treeview_button_press_event(self, widget, event):
|
||||
"""popup user's group's or agent menu"""
|
||||
|
@ -1803,14 +1804,14 @@ class roster_Window:
|
|||
self.mk_menu_user(event, iter)
|
||||
elif type == 'account':
|
||||
self.mk_menu_account(event, iter)
|
||||
return gtk.TRUE
|
||||
return True
|
||||
if event.button == 1:
|
||||
try:
|
||||
path, column, x, y = self.tree.get_path_at_pos(int(event.x), \
|
||||
int(event.y))
|
||||
except TypeError:
|
||||
self.tree.get_selection().unselect_all()
|
||||
return gtk.FALSE
|
||||
return False
|
||||
|
||||
def on_req_usub(self, widget, user, account):
|
||||
"""Remove a user"""
|
||||
|
@ -1994,16 +1995,16 @@ class roster_Window:
|
|||
self.add_user_to_roster(jid, account)
|
||||
iters = self.get_user_iter(jid, account)
|
||||
path = self.tree.get_model().get_path(iters[0])
|
||||
self.tree.expand_row(path[0:1], FALSE)
|
||||
self.tree.expand_row(path[0:2], FALSE)
|
||||
self.tree.expand_row(path[0:1], False)
|
||||
self.tree.expand_row(path[0:2], False)
|
||||
self.tree.scroll_to_cell(path)
|
||||
self.tree.set_cursor(path)
|
||||
else:
|
||||
if not self.plugin.windows[account]['chats'].has_key(jid):
|
||||
self.new_chat(self.contacts[account][jid][0], account)
|
||||
if path:
|
||||
self.tree.expand_row(path[0:1], FALSE)
|
||||
self.tree.expand_row(path[0:2], FALSE)
|
||||
self.tree.expand_row(path[0:1], False)
|
||||
self.tree.expand_row(path[0:2], False)
|
||||
self.tree.scroll_to_cell(path)
|
||||
self.tree.set_cursor(path)
|
||||
self.plugin.windows[account]['chats'][jid].print_conversation(msg, \
|
||||
|
@ -2016,7 +2017,7 @@ class roster_Window:
|
|||
"""When preferences is selected :
|
||||
call the preference_Window class"""
|
||||
if not self.plugin.windows.has_key('preferences'):
|
||||
self.plugin.windows['preferences'] = preference_Window(self.plugin)
|
||||
self.plugin.windows['preferences'] = preferences_window(self.plugin)
|
||||
|
||||
def on_add(self, widget, account):
|
||||
"""When add user is selected :
|
||||
|
@ -2437,7 +2438,7 @@ class roster_Window:
|
|||
render_pixbuf = gtk.CellRendererPixbuf()
|
||||
col.pack_start(render_pixbuf, expand = False)
|
||||
self.tree.append_column(col)
|
||||
col.set_visible(FALSE)
|
||||
col.set_visible(False)
|
||||
self.tree.set_expander_column(col)
|
||||
|
||||
#signals
|
||||
|
|
Loading…
Reference in New Issue