do not allow access to preferences when a transaction is running

This commit is contained in:
guinux 2016-05-06 10:55:21 +02:00
parent 95b3e901fb
commit 369c7cc327
4 changed files with 16 additions and 0 deletions

View File

@ -985,6 +985,7 @@
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="popover">popovermenu</property>
<signal name="toggled" handler="on_menu_button_toggled" swapped="no"/>
<child>
<object class="GtkImage" id="menu_icon">
<property name="visible">True</property>

View File

@ -430,6 +430,7 @@
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="popover">popovermenu</property>
<signal name="toggled" handler="on_menu_button_toggled" swapped="no"/>
<child>
<object class="GtkImage" id="menu_icon">
<property name="visible">True</property>

View File

@ -51,6 +51,8 @@ namespace Pamac {
[GtkChild]
Gtk.Button button_back;
[GtkChild]
Gtk.ModelButton preferences_button;
[GtkChild]
Gtk.TreeView packages_treeview;
[GtkChild]
Gtk.TreeViewColumn packages_state_column;
@ -1428,6 +1430,11 @@ namespace Pamac {
refresh_packages_list ();
}
[GtkCallback]
void on_menu_button_toggled () {
preferences_button.visible = !transaction_running;
}
[GtkCallback]
void on_history_button_clicked () {
transaction.run_history_dialog ();

View File

@ -25,6 +25,8 @@ namespace Pamac {
[GtkChild]
Gtk.HeaderBar headerbar;
[GtkChild]
Gtk.ModelButton preferences_button;
[GtkChild]
Gtk.StackSwitcher stackswitcher;
[GtkChild]
Gtk.ScrolledWindow repos_scrolledwindow;
@ -148,6 +150,11 @@ namespace Pamac {
}
}
[GtkCallback]
void on_menu_button_toggled () {
preferences_button.visible = !transaction_running;
}
[GtkCallback]
void on_preferences_button_clicked () {
transaction.run_preferences_dialog.begin (() => {