diff --git a/README.md b/README.md index 5e273f42..f0ba082c 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,12 @@ Clipboard is **"rubber"**. There is an accumulation before the insertion! * **Ctrl + R, F2** - rename. * **Ctrl + S, T** in Satellites edit tool for create satellite or transponder. * **Ctrl + L** - parental lock. -* **Ctrl + H** - hide/skip. -* **Space** - select/deselect. -* **Left/Right** - remove selection. +* **Ctrl + H** - hide/skip. * **P** - enable/disable preview mode for IPTV in the bouquet list. -* **Enter** - start play IPTV or other stream in the bouquet list. +* **Enter** - start play IPTV or other stream in the bouquet list. +* **Space** - select/deselect. +* **Left/Right** - remove selection. +* **Ctrl + Up, Down, PageUp, PageDown, Home, End** - move selected items in the list. ### Extra: * Multiple selections in lists only with Space key (as in file managers). * Ability to import IPTV into bouquet (Neutrino WEBTV) from m3u files. diff --git a/app/ui/main_window.glade b/app/ui/main_window.glade index 274fe885..60f3eefc 100644 --- a/app/ui/main_window.glade +++ b/app/ui/main_window.glade @@ -58,7 +58,7 @@ False gtk-clear - + True False gtk-clear @@ -112,46 +112,6 @@ False gtk-find - - True - False - gtk-save-as - - - True - False - network-transmit-receive - - - True - False - gtk-select-all - - - True - False - gtk-new - - - True - False - gtk-save-as - - - True - False - gtk-select-all - - - True - False - gtk-save-as - - - True - False - gtk-select-all - True False @@ -172,222 +132,6 @@ False insert-link - - True - False - - - gtk-go-forward - True - False - False - True - True - - - - - - True - False - - - - - Create bouquet - True - False - False - image5 - False - - - True - False - - - For current satellite - True - False - image1 - False - - - - - - For current package - True - False - image6 - False - - - - - - For current type - True - False - image8 - False - - - - - - True - False - - - - - For each satellite - True - False - image4 - False - - - - - - For each package - True - False - image7 - False - - - - - - For each type - True - False - image9 - False - - - - - - - - - - True - False - - - - - gtk-copy - True - False - False - True - True - - - - - - gtk-edit - True - False - False - immediate - True - True - - - - - - gtk-new - False - True - True - - - - - - True - False - - - - - Picon - True - False - False - insert_image_2 - False - - - True - False - - - Assign - True - False - insert_link_image - False - - - - - - Remove - True - False - clear_image - False - - - - - - True - False - - - - - Copy reference - True - False - copy_image - False - - - - - - - - - - True - False - - - - - gtk-remove - True - False - False - True - True - - - - True False @@ -403,6 +147,11 @@ False network-transmit-receive + + True + False + network-transmit-receive + True False @@ -485,7 +234,7 @@ IPTV True False - image10 + networktransmit_receive_image False @@ -559,7 +308,7 @@ Remove True False - clearimage + clear_image_2 False @@ -602,6 +351,36 @@ + + True + False + gtk-new + + + True + False + gtk-save-as + + + True + False + gtk-save-as + + + True + False + gtk-save-as + + + True + False + gtk-select-all + + + True + False + gtk-select-all + True False @@ -1469,7 +1248,7 @@ 1 True - + True False vertical @@ -2029,7 +1808,7 @@ True True - + True False vertical @@ -2049,19 +1828,158 @@ - - False - 0 - in + + True + True + vertical + True - - True + + 30 False - + 0 + none + + + True + False + + + + + + + + True + True + - - + + + True + True + 2 + in + + + True + True + fav_list_store + 2 + True + both + True + + + + + + + + + multiple + + + + + Num + + + 0.20000000298023224 + + + 0 + + + + + + + True + 2 + autosize + Service + True + + + + 8 + + + + + + 1 + + + + + + 2 + + + + + + 3 + + + + + + 4 + + + + + + + Type + True + + + 0.50999999046325684 + + + 5 + + + + + + + Pos + True + + + 0.50999999046325684 + + + 6 + + + + + + + False + fav_id + + + + 7 + + + + + + + + + True + True + @@ -2070,133 +1988,6 @@ 1 - - - True - True - 2 - in - - - True - True - fav_list_store - 2 - True - both - True - - - - - - - - - multiple - - - - - Num - - - 0.20000000298023224 - - - 0 - - - - - - - True - 2 - autosize - Service - True - - - - 8 - - - - - - 1 - - - - - - 2 - - - - - - 3 - - - - - - 4 - - - - - - - Type - True - - - 0.50999999046325684 - - - 5 - - - - - - - Pos - True - - - 0.50999999046325684 - - - 6 - - - - - - - False - fav_id - - - - 7 - - - - - - - - - True - True - 2 - - 20 @@ -2237,7 +2028,7 @@ False True - 3 + 4 @@ -2247,7 +2038,7 @@ - + True False vertical @@ -2524,4 +2315,225 @@ + + True + False + gtk-select-all + + + True + False + + + gtk-go-forward + True + False + False + True + True + + + + + + True + False + + + + + Create bouquet + True + False + False + new_image + False + + + True + False + + + For current satellite + True + False + save_as_image_2 + False + + + + + + For current package + True + False + save_as_image + False + + + + + + For current type + True + False + save_as_image_3 + False + + + + + + True + False + + + + + For each satellite + True + False + select_all_image + False + + + + + + For each package + True + False + slect_all_image_2 + False + + + + + + For each type + True + False + select_all_image_3 + False + + + + + + + + + + True + False + + + + + gtk-copy + True + False + False + True + True + + + + + + gtk-edit + True + False + False + immediate + True + True + + + + + + gtk-new + False + True + True + + + + + + True + False + + + + + Picon + True + False + False + insert_image_2 + False + + + True + False + + + Assign + True + False + insert_link_image + False + + + + + + Remove + True + False + clear_image + False + + + + + + True + False + + + + + Copy reference + True + False + copy_image + False + + + + + + + + + + True + False + + + + + gtk-remove + True + False + False + True + True + + + + diff --git a/app/ui/satellites_dialog.py b/app/ui/satellites_dialog.py index 429722cd..3868ccff 100644 --- a/app/ui/satellites_dialog.py +++ b/app/ui/satellites_dialog.py @@ -145,13 +145,7 @@ class SatellitesDialog: @run_idle def append_data(self, model, satellites): for sat in satellites: - self.append_satellite(model, sat) - - def append_satellite(self, model, sat): - name, flags, pos, transponders = sat - parent = model.append(None, [name, *self._aggr, flags, pos]) - for transponder in transponders: - model.append(parent, ["Transponder:", *transponder, None, None]) + append_satellite(model, sat) def on_add(self, view): """ Common adding """ @@ -282,7 +276,7 @@ class SatellitesDialog: def on_update(self, item): dialog = SatellitesUpdateDialog(self._dialog, self._sat_view.get_model()) - sats = dialog.run() + dialog.run() dialog.destroy() @staticmethod @@ -515,9 +509,23 @@ class SatellitesUpdateDialog: pos = row[-1] if pos in sats: sat = sats.pop(pos) - print("The remaining satellites:", sats) + itr = row.iter + self.update_satellite(itr, row, sat) + + for sat in sats.values(): + append_satellite(self._main_model, sat) + self._download_task = False + @run_idle + def update_satellite(self, itr, row, sat): + if self._main_model.iter_has_child(itr): + children = row.iterchildren() + for ch in children: + self._main_model.remove(ch.iter) + for tr in sat[3]: + self._main_model.append(itr, ["Transponder:", *tr, None, None]) + @run_idle def append_output(self, text): append_text_to_tview(text, self._text_view) @@ -539,5 +547,16 @@ class SatellitesUpdateDialog: self._download_task = False +# ***************** Commons *******************# + +@run_idle +def append_satellite(model, sat): + """ Common function for append satellite to the model """ + name, flags, pos, transponders = sat + parent = model.append(None, [name, *(None,) * 9, flags, pos]) + for transponder in transponders: + model.append(parent, ["Transponder:", *transponder, None, None]) + + if __name__ == "__main__": pass