fix sth minor (delmonico), various cleanup

This commit is contained in:
Nikos Kouremenos 2005-06-10 16:45:54 +00:00
parent e774467002
commit 9847eca2f0
4 changed files with 39 additions and 37 deletions

View File

@ -2333,6 +2333,7 @@ class ManageBookmarksWindow:
self.view = self.xml.get_widget('bookmarks_treeview')
self.view.set_model(self.treestore)
self.view.expand_all()
renderer = gtk.CellRendererText()
column = gtk.TreeViewColumn('Bookmarks', renderer, text=1)
@ -2385,6 +2386,8 @@ class ManageBookmarksWindow:
account = model.get_value(add_to, 1)
self.treestore.append(add_to, [account,_('New Room'), '', '', '', ''])
self.view.expand_row(model.get_path(add_to), True)
def on_remove_bookmark_button_clicked(self, widget):
@ -2480,7 +2483,9 @@ class ManageBookmarksWindow:
def on_title_entry_changed(self, widget):
(model, iter) = self.selection.get_selected()
if iter: #After removing a bookmark, we got nothing selected
model.set_value(iter, 1, self.title_entry.get_text())
if model.iter_parent(iter):
#Don't clear the title field for account nodes
model.set_value(iter, 1, self.title_entry.get_text())
def on_nick_entry_changed(self, widget):
(model, iter) = self.selection.get_selected()

View File

@ -170,7 +170,7 @@ class Interface:
return
if os.name == 'nt':
try:
winsound.PlaySound(path_to_soundfile, \
winsound.PlaySound(path_to_soundfile,
winsound.SND_FILENAME|winsound.SND_ASYNC)
except:
pass

View File

@ -657,41 +657,38 @@ class Groupchat_window(chat.Chat):
def on_list_treeview_button_press_event(self, widget, event):
"""popup user's group's or agent menu"""
if event.type == gtk.gdk.BUTTON_PRESS:
if event.button == 3: # right click
try:
path, column, x, y = widget.get_path_at_pos(int(event.x), \
int(event.y))
except TypeError:
widget.get_selection().unselect_all()
return False
widget.get_selection().select_path(path)
model = widget.get_model()
iter = model.get_iter(path)
if len(path) == 2:
room_jid = self.get_active_jid()
self.mk_menu(room_jid, event, iter)
return True
if event.button == 1: # left click
try:
path, column, x, y = widget.get_path_at_pos(int(event.x), \
int(event.y))
except TypeError:
widget.get_selection().unselect_all()
return False
if event.button == 3: # right click
try:
path, column, x, y = widget.get_path_at_pos(int(event.x),
int(event.y))
except TypeError:
widget.get_selection().unselect_all()
return False
widget.get_selection().select_path(path)
model = widget.get_model()
iter = model.get_iter(path)
if len(path) == 2:
room_jid = self.get_active_jid()
self.mk_menu(room_jid, event, iter)
return True
if event.button == 1: # left click
try:
path, column, x, y = widget.get_path_at_pos(int(event.x),
int(event.y))
except TypeError:
widget.get_selection().unselect_all()
return False
model = widget.get_model()
iter = model.get_iter(path)
status = model.get_value(iter, 3) # if no status: it's a group
if not status:
if x < 20: # first cell in 1st column (the arrow SINGLE clicked)
if (widget.row_expanded(path)):
widget.collapse_row(path)
else:
widget.expand_row(path, False)
#FIXME: should popup chat window for GC contact DOUBLE clicked
# also chat [in context menu]
model = widget.get_model()
iter = model.get_iter(path)
status = model.get_value(iter, 3) # if no status: it's a group
if not status:
if x < 20: # first cell in 1st column (the arrow SINGLE clicked)
if (widget.row_expanded(path)):
widget.collapse_row(path)
else:
widget.expand_row(path, False)
return False
def on_list_treeview_key_press_event(self, widget, event):

View File

@ -279,7 +279,7 @@ class Tabbed_chat_window(chat.Chat):
def on_message_textview_key_press_event(self, widget, event):
"""When a key is pressed:
if enter is pressed without the shit key, message (if not empty) is sent
if enter is pressed without the shift key, message (if not empty) is sent
and printed in the conversation"""
jid = self.get_active_jid()
conversation_textview = self.xmls[jid].get_widget('conversation_textview')