[gnome-packagekit] Put the cancel button up into the status bar
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-packagekit] Put the cancel button up into the status bar
- Date: Fri, 11 May 2012 16:16:27 +0000 (UTC)
commit a1adeb69ecbf99853dd9eef35417b4d880e822ab
Author: Richard Hughes <richard hughsie com>
Date: Fri May 11 15:19:05 2012 +0100
Put the cancel button up into the status bar
data/gpk-application.ui | 53 ++++++++++++++++++----------------------------
src/gpk-application.c | 10 ++++++++-
src/gpk-common.h | 2 +-
3 files changed, 31 insertions(+), 34 deletions(-)
---
diff --git a/data/gpk-application.ui b/data/gpk-application.ui
index 4b8836e..cc2677e 100644
--- a/data/gpk-application.ui
+++ b/data/gpk-application.ui
@@ -50,7 +50,7 @@
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">end</property>
- <property name="position">1</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -69,6 +69,26 @@
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">end</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button_cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_markup" translatable="yes">Cancel search</property>
+ <property name="tooltip_text" translatable="yes">Cancel search</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
<property name="position">2</property>
</packing>
</child>
@@ -567,37 +587,6 @@
<property name="position">0</property>
</packing>
</child>
- <child>
- <object class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="button_cancel">
- <property name="label">gtk-cancel</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes">Cancel search</property>
- <property name="use_action_appearance">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">6</property>
- <property name="position">1</property>
- </packing>
- </child>
</object>
<packing>
<property name="expand">True</property>
diff --git a/src/gpk-application.c b/src/gpk-application.c
index 9150e18..33aff62 100644
--- a/src/gpk-application.c
+++ b/src/gpk-application.c
@@ -641,6 +641,10 @@ gpk_application_status_changed_timeout_cb (GpkApplicationPrivate *priv)
text = gpk_status_enum_to_localised_text (priv->status_last);
gtk_label_set_label (GTK_LABEL (widget), text);
+ /* show cancel button */
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_cancel"));
+ gtk_widget_show (widget);
+
/* set icon */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "image_status"));
gtk_image_set_from_icon_name (GTK_IMAGE (widget),
@@ -681,6 +685,10 @@ gpk_application_progress_cb (PkProgress *progress, PkProgressType type, GpkAppli
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "treeview_packages"));
gtk_widget_set_sensitive (widget, TRUE);
+ /* hide the cancel button */
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_cancel"));
+ gtk_widget_hide (widget);
+
/* make apply button sensitive */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_apply"));
gtk_widget_set_sensitive (widget, TRUE);
@@ -3434,7 +3442,7 @@ gpk_application_startup_cb (GtkApplication *application, GpkApplicationPrivate *
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_cancel"));
g_signal_connect (widget, "clicked",
G_CALLBACK (gpk_application_cancel_cb), priv);
- gtk_widget_set_sensitive (widget, FALSE);
+ gtk_widget_hide (widget);
/* the fancy text entry widget */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "entry_text"));
diff --git a/src/gpk-common.h b/src/gpk-common.h
index 3b7324e..d50ee3b 100644
--- a/src/gpk-common.h
+++ b/src/gpk-common.h
@@ -72,7 +72,7 @@ G_BEGIN_DECLS
#define GPK_ICON_SERVICE_PACK "gpk-service-pack"
/* any status that is slower than this will not be shown in the UI */
-#define GPK_UI_STATUS_SHOW_DELAY 250 /* ms */
+#define GPK_UI_STATUS_SHOW_DELAY 750 /* ms */
void gpk_common_test (gpointer data);
void gtk_text_buffer_insert_markup (GtkTextBuffer *buffer,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]