adding a file with a fix and some FIXME comments
This commit is contained in:
parent
33a83db622
commit
64539f9099
1 changed files with 13 additions and 3 deletions
|
@ -1667,6 +1667,7 @@ class ManageEmoticonsWindow:
|
||||||
|
|
||||||
def on_add_remove_emoticons_window_delete_event(self, widget, event):
|
def on_add_remove_emoticons_window_delete_event(self, widget, event):
|
||||||
self.window.hide()
|
self.window.hide()
|
||||||
|
self.plugin.init_regexp() # update regexp [emoticons included]
|
||||||
return True # do NOT destroy the window
|
return True # do NOT destroy the window
|
||||||
|
|
||||||
def on_close_button_clicked(self, widget):
|
def on_close_button_clicked(self, widget):
|
||||||
|
@ -1675,6 +1676,7 @@ class ManageEmoticonsWindow:
|
||||||
def on_emoticons_treemodel_row_deleted(self, model, path):
|
def on_emoticons_treemodel_row_deleted(self, model, path):
|
||||||
iter = model.get_iter(path)
|
iter = model.get_iter(path)
|
||||||
gajim.config.get_per('emoticons', model.get_value(iter, 0))
|
gajim.config.get_per('emoticons', model.get_value(iter, 0))
|
||||||
|
#FIXME: we just remove it from Treeview!!! plz remove me from emoticons dict
|
||||||
self.plugin.save_config()
|
self.plugin.save_config()
|
||||||
|
|
||||||
def on_emoticons_treemodel_row_changed(self, model, path, iter):
|
def on_emoticons_treemodel_row_changed(self, model, path, iter):
|
||||||
|
@ -1734,7 +1736,7 @@ class ManageEmoticonsWindow:
|
||||||
path_to_file = widget.get_preview_filename()
|
path_to_file = widget.get_preview_filename()
|
||||||
widget.get_preview_widget().set_from_file(path_to_file)
|
widget.get_preview_widget().set_from_file(path_to_file)
|
||||||
|
|
||||||
def on_set_image_button_clicked(self, widget, data = None):
|
def on_set_image_button_clicked(self, widget, data=None):
|
||||||
(model, iter) = self.emot_tree.get_selection().get_selected()
|
(model, iter) = self.emot_tree.get_selection().get_selected()
|
||||||
if not iter:
|
if not iter:
|
||||||
return
|
return
|
||||||
|
@ -1790,15 +1792,23 @@ class ManageEmoticonsWindow:
|
||||||
pix = gtk.gdk.pixbuf_new_from_file(file)
|
pix = gtk.gdk.pixbuf_new_from_file(file)
|
||||||
img.set_from_pixbuf(pix)
|
img.set_from_pixbuf(pix)
|
||||||
model.set(iter, 2, img)
|
model.set(iter, 2, img)
|
||||||
|
#FIXME: we don't add it to emoticons dict!
|
||||||
|
# please call in the key the upper()
|
||||||
|
# so:
|
||||||
|
# ':D' -> 'path_to_file'
|
||||||
|
# ':d' works (will be uppered)
|
||||||
|
# '<lol>' should becomes <LOL>
|
||||||
|
# bottom line: emots are case INsensitive so make sure you add them in
|
||||||
|
# emoticons dict (the keys part) as CAPS
|
||||||
|
|
||||||
def on_button_new_emoticon_clicked(self, widget, data = None):
|
def on_button_new_emoticon_clicked(self, widget, data=None):
|
||||||
model = self.emot_tree.get_model()
|
model = self.emot_tree.get_model()
|
||||||
iter = model.append()
|
iter = model.append()
|
||||||
model.set(iter, 0, 'emoticon', 1, '')
|
model.set(iter, 0, 'emoticon', 1, '')
|
||||||
col = self.emot_tree.get_column(0)
|
col = self.emot_tree.get_column(0)
|
||||||
self.emot_tree.set_cursor(model.get_path(iter), col, True)
|
self.emot_tree.set_cursor(model.get_path(iter), col, True)
|
||||||
|
|
||||||
def on_button_remove_emoticon_clicked(self, widget, data = None):
|
def on_button_remove_emoticon_clicked(self, widget, data=None):
|
||||||
(model, iter) = self.emot_tree.get_selection().get_selected()
|
(model, iter) = self.emot_tree.get_selection().get_selected()
|
||||||
if not iter:
|
if not iter:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Reference in a new issue