[baobab/wip/vala] First cut at action sensitivity.
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab/wip/vala] First cut at action sensitivity.
- Date: Mon, 16 Jan 2012 23:50:07 +0000 (UTC)
commit 33ff8741af81f153b3a44da91183c008d8ed0aaf
Author: Paolo Borelli <pborelli gnome org>
Date: Tue Jan 17 00:49:24 2012 +0100
First cut at action sensitivity.
data/baobab-main-window.ui | 6 +++---
src/baobab-window.vala | 26 +++++++++++++++++++++++++-
2 files changed, 28 insertions(+), 4 deletions(-)
---
diff --git a/data/baobab-main-window.ui b/data/baobab-main-window.ui
index a259707..681ee76 100644
--- a/data/baobab-main-window.ui
+++ b/data/baobab-main-window.ui
@@ -126,11 +126,11 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
- <property name="tooltip_markup" translatable="yes">Refresh</property>
- <property name="tooltip_text" translatable="yes">Refresh</property>
+ <property name="tooltip_markup" translatable="yes">Reload</property>
+ <property name="tooltip_text" translatable="yes">Reload</property>
<property name="use_action_appearance">False</property>
<property name="stock_id">gtk-refresh</property>
- <property name="action_name">win.refresh</property>
+ <property name="action_name">win.reload</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/src/baobab-window.vala b/src/baobab-window.vala
index 0548f4b..767a6b1 100644
--- a/src/baobab-window.vala
+++ b/src/baobab-window.vala
@@ -22,6 +22,23 @@ namespace Baobab {
{ "collapse-all", on_collapse_all }
};
+ protected struct ActionState {
+ string name;
+ bool enable;
+ }
+
+ private const ActionState[] actions_while_scanning = {
+ { "scan-home", false },
+ { "scan-filesystem", false },
+ { "scan-folder", false },
+ { "scan-remote", false },
+ { "stop", true },
+ { "reload", false },
+ { "show-allocated", false },
+ { "expand-all", false },
+ { "collapse-all", false }
+ };
+
private enum DndTargets {
URI_LIST
}
@@ -66,11 +83,13 @@ namespace Baobab {
drag_data_received.connect(on_drag_data_received);
enable_drop ();
- // Go live.
add (builder.get_object ("window-contents") as Gtk.Widget);
title = _("Disk Usage Analyzer");
set_default_size (800, 500);
// setup_persistent_state (app.get_ui_settings (), "window-state");
+
+ set_busy (false);
+
show ();
}
@@ -195,6 +214,11 @@ namespace Baobab {
if (window != null) {
window.set_cursor (cursor);
}
+
+ foreach (ActionState action_state in actions_while_scanning) {
+ var action = lookup_action (action_state.name) as SimpleAction;
+ action.set_enabled (busy == action_state.enable);
+ }
}
public bool check_dir (File directory) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]