Skip to content

Commit

Permalink
eliminar recientes implementado
Browse files Browse the repository at this point in the history
  • Loading branch information
sodomon2 committed Nov 10, 2020
1 parent efe9622 commit 7187db7
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 0 deletions.
15 changes: 15 additions & 0 deletions components/SODPlayer-recents.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,20 @@ if #recents_item < 1 then
return
end

function ui.btn_clear_recent:on_clicked()
ui.delete_dialog:run()
ui.delete_dialog:hide()
end

function ui.btn_dialog_delete:on_clicked()
conf.history.recents = {}
config:save(('%s/sodplayer.json'):format(dir), conf)
ui.delete_dialog:hide()
end

function ui.btn_dialog_cancel:on_clicked()
ui.delete_dialog:hide()
end

menu_archive_recent.submenu = create_submenu(1)

114 changes: 114 additions & 0 deletions vistas/player.ui
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,102 @@
</object>
</child>
</object>
<object class="GtkDialog" id="delete_dialog">
<property name="can_focus">False</property>
<property name="title" translatable="yes">DeleteNote</property>
<property name="resizable">False</property>
<property name="type_hint">dialog</property>
<child type="titlebar">
<placeholder/>
</child>
<child internal-child="vbox">
<object class="GtkBox">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="btn_dialog_delete">
<property name="label" translatable="yes">Delete</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_dialog_cancel">
<property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="width_request">100</property>
<property name="height_request">80</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">¿Eliminar Recientes?</property>
<attributes>
<attribute name="font-desc" value="Sans Bold 9"/>
<attribute name="scale" value="2"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_bottom">3</property>
<property name="label" translatable="yes">todos los recientes seran borrados</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkDialog" id="dialog_url">
<property name="can_focus">False</property>
<property name="title" translatable="yes">SODPlayer - Enter URL</property>
Expand Down Expand Up @@ -1236,6 +1332,24 @@
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_clear_recent">
<property name="label" translatable="yes">Eliminar Recientes</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">start</property>
<property name="margin_left">3</property>
<property name="margin_right">3</property>
<property name="margin_top">3</property>
<property name="margin_bottom">3</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
Expand Down

0 comments on commit 7187db7

Please sign in to comment.