From 5dd5a09bfc0db70fd0868b8254af242e99f2018f Mon Sep 17 00:00:00 2001 From: DYefremov Date: Fri, 5 Apr 2019 13:46:37 +0300 Subject: [PATCH] show error message if no item is selected by import --- app/ui/imports.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/ui/imports.py b/app/ui/imports.py index c62e132b..1e44ad49 100644 --- a/app/ui/imports.py +++ b/app/ui/imports.py @@ -7,7 +7,7 @@ from app.eparser.ecommons import BqType, BqServiceType, Bouquet from app.eparser.enigma.bouquets import get_bouquet from app.eparser.neutrino.bouquets import parse_webtv, parse_bouquets as get_neutrino_bouquets from app.properties import Profile -from app.ui.dialogs import show_dialog, DialogType, get_chooser_dialog +from app.ui.dialogs import show_dialog, DialogType, get_chooser_dialog, get_message from app.ui.main_helper import on_popup_menu from .uicommons import Gtk, UI_RESOURCES_PATH, KeyboardKey, Column @@ -126,6 +126,10 @@ class ImportDialog: self.show_info_message(str(e), Gtk.MessageType.ERROR) def on_import(self, item): + if not any(r[-1] for r in self._main_model): + self.show_info_message(get_message("No selected item!"), Gtk.MessageType.ERROR) + return + if not self._bouquets or show_dialog(DialogType.QUESTION, self._dialog_window) == Gtk.ResponseType.CANCEL: return