add clean cache feature in preferences (as paccache frontend)

This commit is contained in:
guinux
2016-08-25 12:33:16 +02:00
parent eb57d65876
commit 412d1f9a02
6 changed files with 192 additions and 26 deletions

View File

@@ -56,6 +56,10 @@ namespace Pamac {
Gtk.CheckButton check_aur_updates_checkbutton;
[GtkChild]
Gtk.CheckButton no_confirm_build_checkbutton;
[GtkChild]
Gtk.SpinButton cache_keep_nb_spin_button;
[GtkChild]
Gtk.CheckButton cache_only_uninstalled_checkbutton;
Gtk.ListStore ignorepkgs_liststore;
Transaction transaction;
@@ -368,5 +372,11 @@ namespace Pamac {
transaction.start_generate_mirrors_list ();
generate_mirrors_list_button.get_style_context ().remove_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION);
}
[GtkCallback]
void on_cache_clean_button_clicked () {
transaction.clean_cache ((uint) cache_keep_nb_spin_button.get_value_as_int (),
cache_only_uninstalled_checkbutton.active);
}
}
}