~vcs-imports/listen/0.5.x

« back to all changes in this revision

Viewing changes to 0.5b1/src/widget/osd.py

  • Committer: theliz48
  • Date: 2006-09-05 10:13:04 UTC
  • Revision ID: vcs-imports@canonical.com-20060905101304-736d9911f51f319f
Small update

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
 
148
148
 
149
149
        b = gtk.VBox()
150
 
        b.pack_start(check_noti,False,False)
 
150
        if parent.notify.dbus_notify:
 
151
            b.pack_start(check_noti,False,False)
151
152
        b.pack_start(check_osd,False,False)
152
153
 
153
154
        general_frame = self.Frame(_("General"), bold = True, child = b);
192
193
        else:
193
194
            status = "false"
194
195
        config.set('osd', 'enable', status)
 
196
        
195
197
    def __use_notification(self,togglebutton):
196
198
        if togglebutton.get_active():
197
199
            status = "true"
200
202
        config.set('setting', 'notification', status)
201
203
 
202
204
    def pref_show_panel(self, widget = None):
203
 
        if self.__sid:
204
 
            gobject.source_remove(self.__sid)
205
 
            self.__sid = None
206
 
 
207
 
        self.__display(self.__get_preview_msg(), True)
 
205
        self.__show_panel(widget)
208
206
 
209
207
    def __show_panel(self, widget = None):
210
208
        if self.__sid:
257
255
        widget.move(int(event.x_root - self.__startDragPosition[0]), int(event.y_root - self.__startDragPosition[1]))
258
256
 
259
257
    def __start_dragging(self, widget, event):
 
258
        print "start drag"
260
259
        self.__startDragPosition = event.x, event.y
261
260
        self.__motionHandler = self.__window.connect('motion_notify_event', self.__dragging)
262
261
 
263
262
    def __end_dragging(self, widget, event):
 
263
        print "end drag"    
264
264
        self.__window.disconnect(self.__motionHandler)
265
265
        self.__custom_position = self.__window.get_position()
266
266
 
268
268
        self.__show_panel()
269
269
 
270
270
    def __init__(self,player):
271
 
        def show_osd(player,song):
272
 
            self.show_osd(song)
273
 
        player.connect("new-song",show_osd)
 
271
        player.connect("new-song",lambda player,song: self.show_osd(song))
274
272
        
275
273
        self.first_time=True
276
274
        for key, value in {
529
527
        #gobject.idle_add(win.move, winX, winY)
530
528
        win.move(winX, winY)
531
529
        #gobject.idle_add(win.show_all)
532
 
        win.show_all()
533
530
        self.__window = win
534
531
 
535
532
        if not is_preview:
543
540
        else:
544
541
            win.connect('button-press-event', self.__start_dragging)
545
542
            win.connect('button-release-event', self.__end_dragging)
 
543
        win.show_all()
546
544
 
547
545
    def __hide_panel(self, window=None, event=None):
548
546
        if self.__window: