make updates unactivatable when a transaction is running

This commit is contained in:
guinux 2016-04-24 11:06:25 +02:00
parent f0ac44bc4f
commit 47b2c34db3
1 changed files with 33 additions and 24 deletions

View File

@ -56,6 +56,8 @@ namespace Pamac {
public Pamac.Transaction transaction;
public bool transaction_running;
public UpdaterWindow (Gtk.Application application) {
Object (application: application);
@ -66,6 +68,7 @@ namespace Pamac {
transaction_infobox.visible = false;
stackswitcher.visible = false;
aur_scrolledwindow.visible = false;
transaction_running = false;
Timeout.add (100, populate_window);
}
@ -111,6 +114,7 @@ namespace Pamac {
[GtkCallback]
void on_repos_select_update_toggled (string path) {
if (!transaction_running) {
Gtk.TreePath treepath = new Gtk.TreePath.from_string (path);
Gtk.TreeIter iter;
string pkgname;
@ -125,9 +129,11 @@ namespace Pamac {
}
set_transaction_infobox_visible ();
}
}
[GtkCallback]
void on_aur_select_update_toggled (string path) {
if (!transaction_running) {
Gtk.TreePath treepath = new Gtk.TreePath.from_string (path);
Gtk.TreeIter iter;
string pkgname;
@ -142,6 +148,7 @@ namespace Pamac {
}
set_transaction_infobox_visible ();
}
}
[GtkCallback]
void on_preferences_button_clicked () {
@ -152,6 +159,7 @@ namespace Pamac {
[GtkCallback]
void on_apply_button_clicked () {
transaction_running = true;
transaction.sysupgrade (false);
details_button.visible = true;
cancel_button.visible = true;
@ -193,6 +201,7 @@ namespace Pamac {
}
void populate_updates_list () {
transaction_running = false;
apply_button.visible = true;
apply_button.grab_default ();
details_button.visible = false;