diff --git a/app/ui/lang/be/LC_MESSAGES/demon-editor.mo b/app/ui/lang/be/LC_MESSAGES/demon-editor.mo index 359bd308..8ed4c266 100644 Binary files a/app/ui/lang/be/LC_MESSAGES/demon-editor.mo and b/app/ui/lang/be/LC_MESSAGES/demon-editor.mo differ diff --git a/app/ui/lang/de/LC_MESSAGES/demon-editor.mo b/app/ui/lang/de/LC_MESSAGES/demon-editor.mo index da74d2fb..85473d88 100644 Binary files a/app/ui/lang/de/LC_MESSAGES/demon-editor.mo and b/app/ui/lang/de/LC_MESSAGES/demon-editor.mo differ diff --git a/app/ui/lang/ru/LC_MESSAGES/demon-editor.mo b/app/ui/lang/ru/LC_MESSAGES/demon-editor.mo index 46bcf1d5..36c38aac 100644 Binary files a/app/ui/lang/ru/LC_MESSAGES/demon-editor.mo and b/app/ui/lang/ru/LC_MESSAGES/demon-editor.mo differ diff --git a/app/ui/main.glade b/app/ui/main.glade index 441a0827..9a77f678 100644 --- a/app/ui/main.glade +++ b/app/ui/main.glade @@ -1003,6 +1003,11 @@ Author: Dmitriy Yefremov True False gtk-find-and-replace + + + True + False + edit-select-all True @@ -4751,6 +4756,17 @@ Author: Dmitriy Yefremov + + + Remove duplicates + True + False + False + remove_duplicates_image + False + + + True diff --git a/app/ui/main.py b/app/ui/main.py index 417e7fbb..64cd6347 100644 --- a/app/ui/main.py +++ b/app/ui/main.py @@ -98,7 +98,8 @@ class Application(Gtk.Application): _FAV_ELEMENTS = ("fav_cut_popup_item", "fav_paste_popup_item", "fav_locate_popup_item", "fav_iptv_popup_item", "fav_insert_marker_popup_item", "fav_insert_space_popup_item", "fav_edit_sub_menu_popup_item", "fav_edit_popup_item", "fav_picon_popup_item", "fav_copy_popup_item", "fav_add_alt_popup_item", - "fav_epg_configuration_popup_item", "fav_mark_dup_popup_item", "fav_reference_popup_item") + "fav_epg_configuration_popup_item", "fav_mark_dup_popup_item", "fav_remove_dup_popup_item", + "fav_reference_popup_item") _BOUQUET_ELEMENTS = ("bouquets_new_popup_item", "bouquets_edit_popup_item", "bouquets_cut_popup_item", "bouquets_copy_popup_item", "bouquets_paste_popup_item", "new_header_button", @@ -174,6 +175,7 @@ class Application(Gtk.Application): "on_fav_press": self.on_fav_press, "on_locate_in_services": self.on_locate_in_services, "on_mark_duplicates": self.on_mark_duplicates, + "on_remove_duplicates": self.on_remove_duplicates, "on_services_mark_not_in_bouquets": self.on_services_mark_not_in_bouquets, "on_services_clear_marked": self.on_services_clear_marked, "on_services_clear_new_marked": self.on_services_clear_new_marked, @@ -4022,6 +4024,26 @@ class Application(Gtk.Application): if r[Column.FAV_SERVICE] in dup: r[Column.FAV_BACKGROUND] = self._NEW_COLOR + def on_remove_duplicates(self, item): + exist = set() + to_remove = [] + for r in self._fav_model: + fav_id = r[Column.FAV_ID] + if fav_id in exist: + to_remove.append(r.iter) + else: + exist.add(fav_id) + + count = len(to_remove) + if count: + if show_dialog(DialogType.QUESTION, self._main_window) != Gtk.ResponseType.OK: + return + gen = self.remove_favs(to_remove, self._fav_model) + GLib.idle_add(lambda: next(gen, False)) + self.show_info_message(f"{get_message('Done!')} {get_message('Removed')}: {count}") + else: + self.show_info_message(f"{get_message('Done!')} {get_message('Found')}: {count}") + def on_services_mark_not_in_bouquets(self, item): if self.is_data_loading(): self.show_error_message("Data loading in progress!") diff --git a/build/linux/deb/usr/share/locale/be/LC_MESSAGES/demon-editor.mo b/build/linux/deb/usr/share/locale/be/LC_MESSAGES/demon-editor.mo index 359bd308..8ed4c266 100644 Binary files a/build/linux/deb/usr/share/locale/be/LC_MESSAGES/demon-editor.mo and b/build/linux/deb/usr/share/locale/be/LC_MESSAGES/demon-editor.mo differ diff --git a/build/linux/deb/usr/share/locale/de/LC_MESSAGES/demon-editor.mo b/build/linux/deb/usr/share/locale/de/LC_MESSAGES/demon-editor.mo index da74d2fb..85473d88 100644 Binary files a/build/linux/deb/usr/share/locale/de/LC_MESSAGES/demon-editor.mo and b/build/linux/deb/usr/share/locale/de/LC_MESSAGES/demon-editor.mo differ diff --git a/build/linux/deb/usr/share/locale/ru/LC_MESSAGES/demon-editor.mo b/build/linux/deb/usr/share/locale/ru/LC_MESSAGES/demon-editor.mo index 46bcf1d5..36c38aac 100644 Binary files a/build/linux/deb/usr/share/locale/ru/LC_MESSAGES/demon-editor.mo and b/build/linux/deb/usr/share/locale/ru/LC_MESSAGES/demon-editor.mo differ diff --git a/po/be/demon-editor.po b/po/be/demon-editor.po index eecd2ee3..71f86b0c 100644 --- a/po/be/demon-editor.po +++ b/po/be/demon-editor.po @@ -1440,3 +1440,9 @@ msgstr "Уключыць падтрымку пашырэнняў" msgid "After uploading the changes you may need to completely reboot the receiver!" msgstr "Пасля загрузкі змен можа запатрабавацца перазапуск рэсівера!" + +msgid "Remove duplicates" +msgstr "Выдаліць дублікаты" + +msgid "Removed" +msgstr "Выдалена" diff --git a/po/de/demon-editor.po b/po/de/demon-editor.po index d51c9395..96283383 100644 --- a/po/de/demon-editor.po +++ b/po/de/demon-editor.po @@ -1454,3 +1454,9 @@ msgstr "Erweiterungen Unterstützung aktivieren" msgid "After uploading the changes you may need to completely reboot the receiver!" msgstr "Nach dem Hochladen der Änderungen muss den Receiver eventuell komplett neu starten!" + +msgid "Remove duplicates" +msgstr "Duplikate entfernen" + +msgid "Removed" +msgstr "Entfernt" diff --git a/po/ru/demon-editor.po b/po/ru/demon-editor.po index c8da3b16..28bdec34 100644 --- a/po/ru/demon-editor.po +++ b/po/ru/demon-editor.po @@ -1437,3 +1437,9 @@ msgstr "Включить поддержку расширений" msgid "After uploading the changes you may need to completely reboot the receiver!" msgstr "После загрузки изменений может потребоваться перезапуск ресивера!" + +msgid "Remove duplicates" +msgstr "Удалить дубликаты" + +msgid "Removed" +msgstr "Удалено"