mirror of
https://github.com/DYefremov/DemonEditor.git
synced 2025-12-22 00:19:40 +01:00
added creation of empty configuration
This commit is contained in:
@@ -71,6 +71,7 @@ class MainAppWindow:
|
||||
"on_download": self.on_download,
|
||||
"on_data_open": self.on_data_open,
|
||||
"on_data_save": self.on_data_save,
|
||||
"on_new_configuration": self.on_new_configuration,
|
||||
"on_tree_view_key_press": self.on_tree_view_key_press,
|
||||
"on_tree_view_key_release": self.on_tree_view_key_release,
|
||||
"on_bouquets_selection": self.on_bouquets_selection,
|
||||
@@ -854,6 +855,22 @@ class MainAppWindow:
|
||||
# blacklist
|
||||
write_blacklist(path, self._blacklist)
|
||||
|
||||
def on_new_configuration(self, item):
|
||||
""" Creates new empty configuration """
|
||||
if show_dialog(DialogType.QUESTION, self._main_window) == Gtk.ResponseType.CANCEL:
|
||||
return
|
||||
|
||||
self.clear_current_data()
|
||||
|
||||
profile = Profile(self._profile)
|
||||
if profile is Profile.ENIGMA_2:
|
||||
self._bouquets_model.append(None, ["Favourites (TV)", None, None, BqType.TV.value])
|
||||
self._bouquets_model.append(None, ["Favourites (Radio)", None, None, BqType.RADIO.value])
|
||||
elif profile is Profile.NEUTRINO_MP:
|
||||
self._bouquets_model.append(None, ["Providers", None, None, BqType.BOUQUET.value])
|
||||
self._bouquets_model.append(None, ["FAV", None, None, BqType.TV.value])
|
||||
self._bouquets_model.append(None, ["WEBTV", None, None, BqType.WEBTV.value])
|
||||
|
||||
def on_services_selection(self, model, path, column):
|
||||
self.update_service_bar(model, path)
|
||||
|
||||
|
||||
@@ -284,23 +284,44 @@ Author: Dmitriy Yefremov
|
||||
<property name="can_focus">False</property>
|
||||
<signal name="button-release-event" handler="on_popover_release" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkFrame" id="left_popover_munu_frame">
|
||||
<object class="GtkBox" id="left_popover_munu_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">5</property>
|
||||
<property name="margin_right">5</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">5</property>
|
||||
<property name="margin_right">5</property>
|
||||
<property name="margin_left">10</property>
|
||||
<property name="margin_right">10</property>
|
||||
<property name="margin_top">5</property>
|
||||
<property name="margin_bottom">5</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="create_left_popover_munu_button">
|
||||
<property name="label">gtk-new</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">New empty configuration</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="always_show_image">True</property>
|
||||
<signal name="clicked" handler="on_new_configuration" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="open_left_popover_munu_button">
|
||||
<property name="label">gtk-open</property>
|
||||
@@ -315,7 +336,7 @@ Author: Dmitriy Yefremov
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@@ -332,15 +353,9 @@ Author: Dmitriy Yefremov
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="visible">True</property>
|
||||
@@ -371,11 +386,6 @@ Author: Dmitriy Yefremov
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label_item">
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="submenu">main</property>
|
||||
<property name="position">1</property>
|
||||
@@ -701,19 +711,11 @@ Author: Dmitriy Yefremov
|
||||
<property name="can_focus">False</property>
|
||||
<signal name="button-release-event" handler="on_popover_release" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkFrame" id="right_popover_munu_frame">
|
||||
<object class="GtkBox" id="right_popover_munu_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">5</property>
|
||||
<property name="margin_right">5</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">5</property>
|
||||
<property name="margin_right">5</property>
|
||||
<property name="margin_left">10</property>
|
||||
<property name="margin_right">10</property>
|
||||
<property name="margin_top">5</property>
|
||||
<property name="margin_bottom">5</property>
|
||||
<property name="orientation">vertical</property>
|
||||
@@ -772,11 +774,6 @@ Author: Dmitriy Yefremov
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label_item">
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="submenu">main</property>
|
||||
<property name="position">1</property>
|
||||
|
||||
Reference in New Issue
Block a user