mirror of
https://github.com/DYefremov/DemonEditor.git
synced 2026-03-17 18:10:59 +01:00
little refactoring for bq selection
This commit is contained in:
@@ -11,9 +11,9 @@
|
||||
<property name="program_name">DemonEditor</property>
|
||||
<property name="version">0.3.1 Pre-alpha</property>
|
||||
<property name="copyright">2018 Dmitriy Yefremov
|
||||
dmitry.v.yefremov@gmail.com
|
||||
</property>
|
||||
<property name="comments" translatable="yes">Enigma2 channel and satellites list editor for GNU/Linux</property>
|
||||
<property name="website">https://github.com/DYefremov/DemonEditor</property>
|
||||
<property name="license" translatable="yes">Это приложение распространяется без каких-либо гарантий.
|
||||
Подробнее в <a href="http://opensource.org/licenses/mit-license.php">The MIT License (MIT)</a>.</property>
|
||||
<property name="authors">Dmitriy Yefremov
|
||||
|
||||
Binary file not shown.
@@ -246,10 +246,8 @@ class MainAppWindow:
|
||||
def on_paste(self, view):
|
||||
selection = view.get_selection()
|
||||
dest_index = 0
|
||||
bq_selected = self.get_selected_bouquet()
|
||||
|
||||
bq_selected = self.check_bouquet_selection()
|
||||
if not bq_selected:
|
||||
show_dialog(DialogType.ERROR, self._main_window, "Error. No bouquet is selected!")
|
||||
return
|
||||
|
||||
fav_bouquet = self._bouquets[bq_selected]
|
||||
@@ -440,10 +438,8 @@ class MainAppWindow:
|
||||
|
||||
def receive_selection(self, *, view, drop_info, data):
|
||||
""" Update fav view after data received """
|
||||
bq_selected = self.get_selected_bouquet()
|
||||
|
||||
bq_selected = self.check_bouquet_selection()
|
||||
if not bq_selected:
|
||||
show_dialog(DialogType.ERROR, self._main_window, "Error. No bouquet is selected!")
|
||||
return
|
||||
|
||||
model = get_base_model(view.get_model())
|
||||
@@ -686,6 +682,20 @@ class MainAppWindow:
|
||||
service.hide, service.service_type, service.pos, service.fav_id,
|
||||
self._picons.get(service.picon_id, None)))
|
||||
|
||||
def check_bouquet_selection(self):
|
||||
""" checks and returns bouquet if selected """
|
||||
bq_selected = self.get_selected_bouquet()
|
||||
|
||||
if not bq_selected:
|
||||
show_dialog(DialogType.ERROR, self._main_window, "Error. No bouquet is selected!")
|
||||
return
|
||||
|
||||
if Profile(self._profile) is Profile.NEUTRINO_MP and bq_selected.endswith(BqType.WEBTV.value):
|
||||
show_dialog(DialogType.ERROR, self._main_window, "Operation not allowed in this context!")
|
||||
return
|
||||
|
||||
return bq_selected
|
||||
|
||||
def get_selected_bouquet(self):
|
||||
""" returns 'name:type' of last selected bouquet or False """
|
||||
if self._current_bq_name is None:
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -465,6 +465,9 @@ msgstr "Не выбран файл satellites.xml!"
|
||||
msgid "Error. Verify the data!"
|
||||
msgstr "Ошибка. Проверьте данные!"
|
||||
|
||||
msgid "Operation not allowed in this context!"
|
||||
msgstr "Недопустимая операция в данном контексте!"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user