def start (self): self.__can_start = False self.__prog.show () if self.preferences.drive.get_media_type () == nautilusburn.MEDIA_TYPE_CDRW: gtkutil.dialog_warn (_("CD-RW disc will be erased"), _("Please remove your disc if you want to " "preserve it's contents."), self.__prog) self.__blocked = False self.preferences.pool.temporaryDir = self.preferences.temporaryDir oper = FetchMusicList(self.__music_list, self.preferences.pool) # Fill filenames after retrieving stuff self.__filenames = [] oper.listeners.append (MusicListToFilenames (self.__music_list, self.__filenames)) oper.listeners.append (ConvertingError(self.__prog)) self.__fetching = oper self.__queue.append (oper) # Convert a music list into a list of filenames oper = WriteAudioDisc (self.__filenames, self.preferences, self.__prog) oper.recorder.connect ("progress-changed", self.__tick) oper.recorder.connect ("action-changed", self.__on_action_changed) oper.listeners.append (WritingError(self.__prog)) self.__queue.append (oper) self.__recording = oper self.__queue.start () self.__source = gobject.timeout_add (300, self.__tick)
def write_files(self, *args): # TODO: remove this as soon as we have gtk.Actions if len(self.music_list_widget.source) == 0: return # TODO: move this to SerpentineApplication.write_files ? try: self.__application.validate_files() except SerpentineCacheError, err: show_prefs = False if err.error_id == SerpentineCacheError.INVALID: title = _("Cache directory location unavailable") show_prefs = True elif err.error_id == SerpentineCacheError.NO_SPACE: title = _("Not enough space on cache directory") # TODO: see bug #344688 gtkutil.dialog_warn( title, gobject.markup_escape_text(err.error_message), parent=self ) return
def start(self): self.__can_start = False self.__prog.show() if self.preferences.drive.get_media_type( ) == nautilusburn.MEDIA_TYPE_CDRW: gtkutil.dialog_warn( _("CD-RW disc will be erased"), _("Please remove your disc if you want to " "preserve it's contents."), self.__prog) self.__blocked = False self.preferences.pool.temporaryDir = self.preferences.temporaryDir oper = FetchMusicList(self.__music_list, self.preferences.pool) # Fill filenames after retrieving stuff self.__filenames = [] oper.listeners.append( MusicListToFilenames(self.__music_list, self.__filenames)) oper.listeners.append(ConvertingError(self.__prog)) self.__fetching = oper self.__queue.append(oper) # Convert a music list into a list of filenames oper = WriteAudioDisc(self.__filenames, self.preferences, self.__prog) oper.recorder.connect("progress-changed", self.__tick) oper.recorder.connect("action-changed", self.__on_action_changed) oper.listeners.append(WritingError(self.__prog)) self.__queue.append(oper) self.__recording = oper self.__queue.start() self.__source = gobject.timeout_add(300, self.__tick)
def on_finished(self, evt): win = self.parent if evt.id == operations.SUCCESSFUL: gtkutil.dialog_warn(_("Playlist Saved"), _("Playlist was saved successfully."), win) else: gtkutil.dialog_error( _("Playlist Not Saved"), _("There was an error while saving the playlist."), win)
def on_finished(self, evt): # self.__prog.cancel_button.hide () # self.__prog.close_button.show () gobject.source_remove(self.__source) if evt.id == operations.SUCCESSFUL: gtkutil.dialog_warn(_("Writing to disc finished"), _("Disc writing was successful."), parent=self.__prog) # Warn our listenrs self._propagate(evt) self.__on_close()
def on_finished (self, evt): win = self.parent if evt.id == operations.SUCCESSFUL: gtkutil.dialog_warn ( _("Playlist Saved"), _("Playlist was saved successfully."), parent = win ) else: gtkutil.dialog_error ( _("Playlist Not Saved"), _("There was an error while saving the playlist."), parent = win )
def on_finished(self, evt): # self.__prog.cancel_button.hide () # self.__prog.close_button.show () gobject.source_remove(self.__source) if evt.id == operations.SUCCESSFUL: gtkutil.dialog_warn(_("Writing to disc finished"), _("Disc writing was successful."), self.__prog) # Warn our listenrs e = operations.FinishedEvent(self, evt.id) for l in self.listeners: l.on_finished(e) self.__on_close()
def on_finished (self, evt): # self.__prog.cancel_button.hide () # self.__prog.close_button.show () gobject.source_remove (self.__source) if evt.id == operations.SUCCESSFUL: gtkutil.dialog_warn ( _("Writing to disc finished"), _("Disc writing was successful."), parent = self.__prog ) # Warn our listenrs self._propagate (evt) self.__on_close ()
def __on_write_files (self, *args): # TODO: move this to SerpentineApplication.write_files ? try: # Try to validate music list validate_music_list (self.music_list_widget.source, self.application.preferences) except SerpentineCacheError, err: show_prefs = False if err.error_id == SerpentineCacheError.INVALID: title = _("Cache directory location unavailable") show_prefs = True elif err.error_id == SerpentineCacheError.NO_SPACE: title = _("Not enough space on cache directory") gtkutil.dialog_warn (title, err.error_message, parent = self) return
def on_finished (self, evt): # self.__prog.cancel_button.hide () # self.__prog.close_button.show () gobject.source_remove (self.__source) if evt.id == operations.SUCCESSFUL: gtkutil.dialog_warn ( _("Writing to disc finished"), _("Disc writing was successful."), self.__prog ) # Warn our listenrs e = operations.FinishedEvent (self, evt.id) for l in self.listeners: l.on_finished (e) self.__on_close ()
def write_files(self, *args): # TODO: remove this as soon as we have gtk.Actions if len(self.music_list_widget.source) == 0: return # TODO: move this to SerpentineApplication.write_files ? try: self.__application.validate_files() except SerpentineCacheError, err: show_prefs = False if err.error_id == SerpentineCacheError.INVALID: title = _("Cache directory location unavailable") show_prefs = True elif err.error_id == SerpentineCacheError.NO_SPACE: title = _("Not enough space on cache directory") # TODO: see bug #344688 gtkutil.dialog_warn(title, gobject.markup_escape_text(err.error_message), parent=self) return
def __init__ (self, application): gtk.Window.__init__ (self, gtk.WINDOW_TOPLEVEL) operations.Operation.__init__ (self) Component.__init__ (self, application) self.__application = application self.__masterer = AudioMastering () # Variable related to this being an Operation self.__running = False self.connect ("show", self.__on_show) # We listen for GtkMusicList events self.music_list_widget.listeners.append (self) glade_file = os.path.join (constants.data_dir, "serpentine.glade") g = gtk.glade.XML (glade_file, "main_window_container") # Send glade to setup subcomponents for c in self._components: if hasattr (c, "_setup_glade"): c._setup_glade (g) self.add (g.get_widget ("main_window_container")) self.set_title ("Serpentine") self.set_default_size (450, 350) self.set_icon_name ("gnome-dev-cdrom-audio") # record button # setup record button self.__write_to_disc = MapProxy (dict( button = g.get_widget ("write_to_disc"), menu = g.get_widget ("write_to_disc_mni") )) self.__write_to_disc.set_sensitive (False) self.__write_to_disc["button"].connect ("clicked", self.__on_write_files) self.__write_to_disc["menu"].connect ("activate", self.__on_write_files) # masterer widget box = self.get_child() self.music_list_widget.show() box.add (self.music_list_widget) # preferences g.get_widget ("preferences_mni").connect ("activate", self.__on_preferences) # setup remove buttons self.remove = MapProxy ({"menu": g.get_widget ("remove_mni"), "button": g.get_widget ("remove")}) self.remove["menu"].connect ("activate", self.__on_remove_file) self.remove["button"].connect ("clicked", self.__on_remove_file) self.remove.set_sensitive (False) # setup clear buttons self.clear = MapProxy ({"menu": g.get_widget ("clear_mni"), "button": g.get_widget ("clear")}) self.clear["button"].connect ("clicked", self.clear_files) self.clear["menu"].connect ("activate", self.clear_files) self.clear.set_sensitive (False) # setup quit menu item g.get_widget ("quit_mni").connect ("activate", self.stop) self.connect("delete-event", self.stop) # About dialog g.get_widget ("about_mni").connect ("activate", self.__on_about) # update buttons self.on_contents_changed() if self.__application.preferences.drive is None: gtkutil.dialog_warn ( _("No recording drive found"), _("No recording drive found on your system, therefore some of " "Serpentine's functionalities will be disabled."), parent = self ) g.get_widget ("preferences_mni").set_sensitive (False) self.__write_to_disc.set_sensitive (False) # Load internal XSPF playlist self.__load_playlist()
def __init__(self, application): gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL) operations.Operation.__init__(self) Component.__init__(self, application) self.__application = application self.__masterer = AudioMastering() # Variable related to this being an Operation self.__running = False self.connect("show", self.__on_show) # We listen for GtkMusicList events self.music_list_widget.listeners.append(self) glade_file = os.path.join(constants.data_dir, "serpentine.glade") g = gtk.glade.XML(glade_file, "main_window_container") # Send glade to setup subcomponents for c in self._components: if hasattr(c, "_setup_glade"): c._setup_glade(g) self.add(g.get_widget("main_window_container")) self.set_title("Serpentine") self.set_default_size(450, 350) self.set_icon_name("gnome-dev-cdrom-audio") # record button # setup record button self.__write_to_disc = MapProxy( dict(button=g.get_widget("write_to_disc"), menu=g.get_widget("write_to_disc_mni"))) self.__write_to_disc.set_sensitive(False) self.__write_to_disc["button"].connect("clicked", self.__on_write_files) self.__write_to_disc["menu"].connect("activate", self.__on_write_files) # masterer widget box = self.get_child() self.music_list_widget.show() box.add(self.music_list_widget) # preferences g.get_widget("preferences_mni").connect("activate", self.__on_preferences) # setup remove buttons self.remove = MapProxy({ "menu": g.get_widget("remove_mni"), "button": g.get_widget("remove") }) self.remove["menu"].connect("activate", self.__on_remove_file) self.remove["button"].connect("clicked", self.__on_remove_file) self.remove.set_sensitive(False) # setup clear buttons self.clear = MapProxy({ "menu": g.get_widget("clear_mni"), "button": g.get_widget("clear") }) self.clear["button"].connect("clicked", self.clear_files) self.clear["menu"].connect("activate", self.clear_files) self.clear.set_sensitive(False) # setup quit menu item g.get_widget("quit_mni").connect("activate", self.stop) self.connect("delete-event", self.stop) # About dialog g.get_widget("about_mni").connect("activate", self.__on_about) # update buttons self.on_contents_changed() if self.__application.preferences.drive is None: gtkutil.dialog_warn( _("No recording drive found"), _("No recording drive found on your system, therefore some of " "Serpentine's functionalities will be disabled."), self) g.get_widget("preferences_mni").set_sensitive(False) self.__write_to_disc.set_sensitive(False) # Load internal XSPF playlist self.__load_playlist()
def __init__ (self, application): gtk.Window.__init__ (self, gtk.WINDOW_TOPLEVEL) operations.Operation.__init__ (self) self.__application = application self.__masterer = AudioMastering () # Variable related to this being an Operation self.__running = False self.connect ("show", self.__on_show) # We listen for GtkMusicList events self.music_list_widget.listeners.append (self) glade_file = os.path.join (constants.data_dir, "serpentine.glade") g = gtk.glade.XML (glade_file, "main_window_container") self.add (g.get_widget ("main_window_container")) self.set_title ("Serpentine") self.set_default_size (450, 350) # Add a file button g.get_widget ("add").connect ("clicked", self.__on_add_file) g.get_widget ("add_mni").connect ("activate", self.__on_add_file) # record button g.get_widget("burn").connect ("clicked", self.__on_write_files) # masterer widget box = self.get_child() self.music_list_widget.show() box.add (self.music_list_widget) # preferences g.get_widget ("preferences_mni").connect ('activate', self.__on_preferences) # setup remove buttons self.remove = MapProxy ({'menu': g.get_widget ("remove_mni"), 'button': g.get_widget ("remove")}) self.remove["menu"].connect ("activate", self.__on_remove_file) self.remove["button"].connect ("clicked", self.__on_remove_file) self.remove.set_sensitive (False) # setup record button self.__on_write_files = g.get_widget ("burn") self.__on_write_files.set_sensitive (False) # setup clear buttons self.clear = MapProxy ({'menu': g.get_widget ("clear_mni"), 'button': g.get_widget ("clear")}) self.clear['button'].connect ("clicked", self.clear_files) self.clear['menu'].connect ("activate", self.clear_files) self.clear.set_sensitive (False) # setup quit menu item g.get_widget ("quit_mni").connect ('activate', self.stop) self.connect("delete-event", self.stop) # About dialog g.get_widget ("about_mni").connect ('activate', self.__on_about) self.__last_path = None self.__add_file = gtk.FileChooserDialog (buttons = (gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK)) self.__add_file.set_title ('') self.__add_file.set_select_multiple (True) # update buttons self.on_contents_changed() if self.__application.preferences.drive is None: gtkutil.dialog_warn ("No recording drive found", "No recording drive found on your system, therefore some of Serpentine's functionalities will be disabled.", self) g.get_widget ("preferences_mni").set_sensitive (False) self.__on_write_files.set_sensitive (False) # Load internal XSPF playlist self.__load_playlist()