~ubuntu-branches/ubuntu/oneiric/emesene/oneiric

« back to all changes in this revision

Viewing changes to SmilieWindow.py

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2010-01-06 23:25:28 UTC
  • mfrom: (1.1.5 upstream) (5.2.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100106232528-aumo0oasgv98865j
Tags: 1.6-1
* New upstream release.
  - debian/patches/20_dont_build_own_libmimic.patch:
    + Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from gobject import timeout_add, source_remove
22
22
 
23
23
from Theme import resizePixbuf
 
24
import CustomEmoticons
24
25
 
25
26
import stock
26
27
import dialog
50
51
        table1 = gtk.Table()
51
52
        
52
53
        self.theme = controller.theme
 
54
        self.controller = controller
53
55
 
54
56
        self.customEmoticons = controller.customEmoticons
55
57
        self.config = controller.config
249
251
        button = gtk.Button(None)
250
252
        button.set_image(gtk.image_new_from_stock(gtk.STOCK_ADD,
251
253
            gtk.ICON_SIZE_BUTTON))
252
 
        button.connect('clicked', self.addClicked)
 
254
        button.connect('clicked', self.addClicked, self.controller)
253
255
        button.connect('enter-notify-event', self.on_enter_notify_event)
254
256
 
255
257
        self.buttonBox.pack_start(button)
264
266
 
265
267
        self.vbox.show_all()
266
268
 
267
 
    def addClicked(self, button):
 
269
    def addClicked(self, button, controller):
268
270
        self.hide()
269
271
 
270
272
        def _on_ce_choosed(response, path, shortcut, size):
284
286
            if not ret:
285
287
                dialog.error(msg)
286
288
 
 
289
        #Let's create the list of customs emoticons for dialog.CEChooser. \
 
290
        #  _on_changed
 
291
        #Arielj: -why is this method getting config from controller? there's a self.config attribute
 
292
        #        -I've add a self.controller attribute to call this method when add is clicked
 
293
        #        -we shouldn't need to pass a controller as a parameter with that new attribute
 
294
        #        -CustomEmoticons should receive only the controller and get the from that controller inside.
 
295
        config = controller.config
 
296
        ce = CustomEmoticons.CustomEmoticons(config, controller)
 
297
        smilie_list = ce.loadMap()
 
298
 
287
299
        dialog.set_custom_emoticon(self.config.user['emoticonDir'],
288
 
            _on_ce_choosed)
 
300
            _on_ce_choosed, smilie_list)
289
301