Пример #1
0
    def on_replace_clicked(self, widget):

        tracks = [row[2] for row in self.tracks_list.get_model() if row[1]]
        replace_str = self.replace_entry.get_text().strip()

        if replace_str:
            query = _("Replace '%s' with '%s' on %s tracks?") % (
                self.search_str, replace_str, len(tracks))
        else:
            query = _("Delete '%s' from %s tracks?") % (self.search_str,
                                                        len(tracks))

        if dialogs.yesno(self, query) != Gtk.ResponseType.YES:
            return

        for track in tracks:

            groups = gt_common._get_track_groups(track, self.tagname)

            if self.search_str != '':
                groups.discard(self.search_str)

            if replace_str != '':
                groups.add(replace_str)

            if not gt_common.set_track_groups(track, groups):
                return

        dialogs.info(self, "Tags successfully renamed!")
        self.reset()
Пример #2
0
def mass_rename(exaile):
    message = _("You should rescan your collection before using mass tag "
                "rename to ensure that all tags are up to date. Rescan now?")

    if dialogs.yesno(exaile.gui.main.window, message) == Gtk.ResponseType.YES:
        exaile.gui.on_rescan_collection()

    GtMassRename(exaile)
Пример #3
0
def mass_rename(exaile):

    if dialogs.yesno(
            None,
            _("You should rescan your collection before using mass tag rename to ensure that all tags are up to date. Rescan now?"
              )) == gtk.RESPONSE_YES:
        exaile.gui.on_rescan_collection()

    GtMassRename(exaile)
Пример #4
0
    def on_replace_clicked(self, widget):

        tracks = [row[2] for row in self.tracks_list.get_model() if row[1]]
        replace_str = self.replace_entry.get_text().strip()

        if replace_str:
            query = ngettext(
                "Replace '{old_tag}' with '{new_tag}' on {amount} track?",
                "Replace '{old_tag}' with '{new_tag}' on {amount} tracks?",
                len(tracks),
            ).format(
                old_tag=self.search_str,
                new_tag=replace_str,
                amount=len(tracks),
            )
        else:
            query = ngettext(
                "Delete '{tag}' from {amount} track?",
                "Delete '{tag}' from {amount} tracks?",
                len(tracks),
            ).format(tag=self.search_str, amount=len(tracks))

        if dialogs.yesno(self, query) != Gtk.ResponseType.YES:
            return

        for track in tracks:

            groups = gt_common._get_track_groups(track, self.tagname)

            if self.search_str != '':
                groups.discard(self.search_str)

            if replace_str != '':
                groups.add(replace_str)

            if not gt_common.set_track_groups(track, groups):
                return

        dialogs.info(self, "Tags successfully renamed!")
        self.reset()
Пример #5
0
    def on_replace_clicked(self, widget):
        
        tracks = [row[2] for row in self.tracks_list.get_model() if row[1]]
        
        query = _("Replace '%s' with '%s' on %s tracks?") % (self.search_str, self.replace_str, len(tracks))
        if dialogs.yesno(self, query) != Gtk.ResponseType.YES:
            return 

        for track in tracks:
            
            groups = gt_common._get_track_groups(track, self.tagname)
            
            if self.search_str != '':
                groups.discard(self.search_str)
            
            if self.replace_str != '':
                groups.add(self.replace_str)
            
            if not gt_common.set_track_groups(track, groups):
                return
        
        dialogs.info(self, "Tags successfully renamed!")
        self.reset()
Пример #6
0
    def on_replace_clicked(self, widget):

        tracks = [row[2] for row in self.tracks_list.get_model() if row[1]]

        query = _("Replace '%s' with '%s' on %s tracks?") % (
            self.search_str, self.replace_str, len(tracks))
        if dialogs.yesno(self.window, query) != gtk.RESPONSE_YES:
            return

        for track in tracks:

            groups = gt_common._get_track_groups(track, self.tagname)

            if self.search_str != '':
                groups.discard(self.search_str)

            if self.replace_str != '':
                groups.add(self.replace_str)

            if not gt_common.set_track_groups(track, groups):
                return

        dialogs.info(self.window, "Tags successfully renamed!")
        self.reset()
Пример #7
0
def mass_rename(exaile):
    
    if dialogs.yesno(exaile.gui.main.window, _("You should rescan your collection before using mass tag rename to ensure that all tags are up to date. Rescan now?")) == Gtk.ResponseType.YES:
        exaile.gui.on_rescan_collection()
    
    GtMassRename(exaile)
Пример #8
0
def mass_rename(exaile):
    
    if dialogs.yesno(None, _("You should rescan your collection before using mass tag rename to ensure that all tags are up to date. Rescan now?")) == gtk.RESPONSE_YES:
        exaile.gui.on_rescan_collection()
    
    GtMassRename(exaile)