[nautilus-actions] Change the Action tab label depending on the currently selected item
- From: Pierre Wieser <pwieser src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [nautilus-actions] Change the Action tab label depending on the currently selected item
- Date: Sat, 30 Jan 2010 18:20:01 +0000 (UTC)
commit 8289af439b6870ca33d5321ceabbeed61a624d5a
Author: Pierre Wieser <pwieser trychlos org>
Date: Sat Jan 30 19:20:11 2010 +0100
Change the Action tab label depending on the currently selected item
ChangeLog | 7 ++++++
TODO | 2 -
nautilus-actions/nact/nact-iaction-tab.c | 20 +++++++++++++-----
.../nact/nautilus-actions-config-tool.ui | 21 +++++++++++--------
4 files changed, 33 insertions(+), 17 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9aa3009..e8fcd63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2009-01-30 Pierre Wieser <pwieser trychlos org>
+ * nautilus-actions/nact/nact-iaction-tab.c
+ (on_tab_updatable_selection_changed):
+ Update tab label depending on the currently selected item.
+
+ * nautilus-actions/nact/nautilus-actions-config-tool.ui:
+ No more give a special name to Action tab label.
+
* nautilus-actions/nact/nautilus-actions-config-tool.ui:
Fix Action tab layout.
diff --git a/TODO b/TODO
index 7945562..e279fe4 100644
--- a/TODO
+++ b/TODO
@@ -121,8 +121,6 @@
- enhancement.ui: rows implicitely selected should have a special display
(as a sort of 'transparent' selection)
-- enhancement.ui: notebook page should be labeled 'Action' or 'Menu' depending of current item
-
- nact-iactions-list.c: display_label
the 'editable' cell property should be set only once, instead of at each redraw
and more because we also compute this on selection change
diff --git a/nautilus-actions/nact/nact-iaction-tab.c b/nautilus-actions/nact/nact-iaction-tab.c
index 057454a..4e03235 100644
--- a/nautilus-actions/nact/nact-iaction-tab.c
+++ b/nautilus-actions/nact/nact-iaction-tab.c
@@ -417,6 +417,8 @@ on_tab_updatable_selection_changed( NactIActionTab *instance, gint count_selecte
gboolean enabled_item;
GtkToggleButton *toggle;
gboolean editable;
+ GtkNotebook *notebook;
+ GtkWidget *page;
g_debug( "%s: instance=%p, count_selected=%d", thisfn, ( void * ) instance, count_selected );
g_return_if_fail( BASE_IS_WINDOW( instance ));
@@ -507,11 +509,17 @@ on_tab_updatable_selection_changed( NactIActionTab *instance, gint count_selecte
gtk_widget_set_sensitive( GTK_WIDGET( icon_button ), item != NULL );
nact_gtk_utils_set_editable( GTK_OBJECT( icon_button ), editable );
- title_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionPropertiesTitle" );
- if( item && NA_IS_OBJECT_MENU( item )){
- gtk_label_set_markup( GTK_LABEL( title_widget ), _( "<b>Menu properties</b>" ));
- } else {
- gtk_label_set_markup( GTK_LABEL( title_widget ), _( "<b>Action properties</b>" ));
+ if( enable_tab ){
+ notebook = GTK_NOTEBOOK( base_window_get_widget( BASE_WINDOW( instance ), "MainNotebook" ));
+ page = gtk_notebook_get_nth_page( notebook, TAB_ACTION );
+ title_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionPropertiesTitle" );
+ if( item && NA_IS_OBJECT_MENU( item )){
+ gtk_notebook_set_tab_label_text( notebook, page, _( "Menu" ));
+ gtk_label_set_markup( GTK_LABEL( title_widget ), _( "<b>Menu properties</b>" ));
+ } else {
+ gtk_notebook_set_tab_label_text( notebook, page, _( "Action" ));
+ gtk_label_set_markup( GTK_LABEL( title_widget ), _( "<b>Action properties</b>" ));
+ }
}
enabled_button = get_enabled_button( instance );
@@ -520,7 +528,7 @@ on_tab_updatable_selection_changed( NactIActionTab *instance, gint count_selecte
gtk_widget_set_sensitive( GTK_WIDGET( enabled_button ), item != NULL );
nact_gtk_utils_set_editable( GTK_OBJECT( enabled_button ), editable );
- /* read-only toggle only indicates the writability status of this item
+ /* read-only toggle only indicates the intrinsic writability status of this item
* _not_ the writability status of the provider
*/
readonly_button = GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "ActionReadonlyButton" ));
diff --git a/nautilus-actions/nact/nautilus-actions-config-tool.ui b/nautilus-actions/nact/nautilus-actions-config-tool.ui
index bb7868e..7dfe1cc 100644
--- a/nautilus-actions/nact/nautilus-actions-config-tool.ui
+++ b/nautilus-actions/nact/nautilus-actions-config-tool.ui
@@ -535,7 +535,7 @@
</object>
</child>
<child type="tab">
- <object class="GtkLabel" id="ActionTabLabel">
+ <object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="tooltip_text" translatable="yes">This tab lets you enter main characteristics of the action, as it will be displayed in the Nautilus context menu : label, tooltip, icon.</property>
<property name="label" translatable="yes">_Action</property>
@@ -1338,6 +1338,9 @@ Defining several profiles lets you have several commands, each applying with a d
<placeholder/>
</child>
<child>
+ <placeholder/>
+ </child>
+ <child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="label" translatable="yes">This assistant will guide you through the process of importing actions.</property>
@@ -1353,9 +1356,9 @@ Defining several profiles lets you have several commands, each applying with a d
<child>
<object class="GtkFileChooserWidget" id="ImportFileChooser">
<property name="visible">True</property>
+ <property name="select_multiple">True</property>
<property name="use_preview_label">False</property>
<property name="local_only">False</property>
- <property name="select_multiple">True</property>
<property name="preview_widget_active">False</property>
</object>
<packing>
@@ -2276,24 +2279,24 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
</object>
<object class="GtkSizeGroup" id="CommandLabelSizeGroup">
<widgets>
- <widget name="ProfileLabelLabel"/>
- <widget name="CommandPathLabel"/>
<widget name="CommandParametersLabel"/>
+ <widget name="CommandPathLabel"/>
+ <widget name="ProfileLabelLabel"/>
</widgets>
</object>
<object class="GtkSizeGroup" id="CommandButtonSizeGroup">
<widgets>
- <widget name="CommandPathButton"/>
<widget name="CommandLegendButton"/>
+ <widget name="CommandPathButton"/>
</widgets>
</object>
<object class="GtkSizeGroup" id="ActionLabelSizeGroup">
<widgets>
- <widget name="ActionIconLabelLabel"/>
- <widget name="ActionMenuLabelLabel"/>
- <widget name="ActionIdLabel"/>
- <widget name="ActionTooltipLabel"/>
<widget name="ActionIconLabel"/>
+ <widget name="ActionTooltipLabel"/>
+ <widget name="ActionIdLabel"/>
+ <widget name="ActionMenuLabelLabel"/>
+ <widget name="ActionIconLabelLabel"/>
</widgets>
</object>
</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]