예제 #1
0
    def __init__(self, music_list, preferences, parent=None):
        MeasurableOperation.__init__(self)
        self.__queue = operations.OperationsQueue()
        self.__queue.listeners.append(self)
        self.__parent = parent
        self.__prog = gtkutil.HigProgress()
        self.__prog.primary_text = _("Writing Audio Disc")
        self.__prog.secondary_text = _("The audio tracks are going to be "
                                       "written to a disc. This operation may "
                                       "take a long time, depending on data "
                                       "size and write speed.")

        self.__prog.connect("destroy-event", self.__on_prog_destroyed)
        self.__prog.cancel_button.connect("clicked", self.__on_cancel)
        self.__prog.close_button.connect("clicked", self.__on_close)
        self.__music_list = music_list
        self.__preferences = preferences
        self.__drive = preferences.drive
        self.__can_start = True
예제 #2
0
            self.music = music

        def on_finished(self, e):
            if self.music:
                print "Fetched", self.music
            print self.oper.progress
            #self.prog.set_progress_fraction (self.oper.progress)
            gtk.main_quit()

        def tick(self):
            self.prog.progress_fraction = self.oper.progress
            return True

#    win = gtk.Window (gtk.WINDOW_TOPLEVEL)

    prog = gtkutil.HigProgress()
    prog.primary_text = "Recording Audio Disc"
    prog.secondary_text = "Selected files are to be written to a CD or DVD "   \
                          "disc. This operation may take a long time, "        \
                          "depending on data size and write speed."
    prog.show()
    #    win.add (prog)
    #    win.set_border_width (6)
    #    win.show()
    pool = GvfsMusicPool()
    #f = os.path.abspath (sys.argv[1])
    music_list = [{'location': os.path.abspath(sys.argv[1])}]
    fetcher = FetchMusicList(music_list, pool)
    l = MyListener(prog, fetcher)
    fetcher.listeners.append(l)
    gobject.timeout_add(200, l.tick)