[gnome-builder] Don't show Other Projects when it is empty
- From: Sébastien Lafargue <slafargue src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] Don't show Other Projects when it is empty
- Date: Sun, 22 Jan 2017 16:13:56 +0000 (UTC)
commit fb2b863b95d9745662611c8d2b553ba0738a185f
Author: namanyadav12 <namanyadav128 gmail com>
Date: Sun Jan 22 18:00:53 2017 +0530
Don't show Other Projects when it is empty
The Other Projects label is shown even if it
is empty when we go to selection or genesis
state and then cancel it to come back to the
browse state.
To fix this we have to call the function
ide_greeter_perspective_apply_filter_all
after changing the state to browse when the
Cancel button is clicked.
https://bugzilla.gnome.org/show_bug.cgi?id=771153
libide/greeter/ide-greeter-perspective.c | 38 +++++++++++++++++++++++++++++
libide/greeter/ide-greeter-perspective.ui | 4 ---
2 files changed, 38 insertions(+), 4 deletions(-)
---
diff --git a/libide/greeter/ide-greeter-perspective.c b/libide/greeter/ide-greeter-perspective.c
index 65a571f..bd05d11 100644
--- a/libide/greeter/ide-greeter-perspective.c
+++ b/libide/greeter/ide-greeter-perspective.c
@@ -52,6 +52,7 @@ struct _IdeGreeterPerspective
GtkStack *stack;
GtkStack *top_stack;
GtkButton *genesis_continue_button;
+ GtkButton *genesis_cancel_button;
GtkLabel *genesis_title;
GtkStack *genesis_stack;
GtkInfoBar *info_bar;
@@ -62,6 +63,7 @@ struct _IdeGreeterPerspective
GtkBox *my_projects_container;
GtkListBox *my_projects_list_box;
GtkButton *open_button;
+ GtkButton *cancel_button;
GtkBox *other_projects_container;
GtkListBox *other_projects_list_box;
GtkButton *remove_button;
@@ -753,6 +755,17 @@ ide_greeter_perspective_open_clicked (IdeGreeterPerspective *self,
gtk_window_present (GTK_WINDOW (dialog));
}
+static void
+ide_greeter_perspective_cancel_clicked (IdeGreeterPerspective *self,
+ GtkButton *cancel_button)
+{
+ g_assert (IDE_IS_GREETER_PERSPECTIVE (self));
+ g_assert (GTK_IS_BUTTON (cancel_button));
+
+ egg_state_machine_set_state (self->state_machine, "browse");
+ ide_greeter_perspective_apply_filter_all (self);
+}
+
void
ide_greeter_perspective_show_genesis_view (IdeGreeterPerspective *self,
const gchar *genesis_addin_name,
@@ -789,6 +802,17 @@ genesis_button_clicked (IdeGreeterPerspective *self,
}
static void
+ide_greeter_perspective_genesis_cancel_clicked (IdeGreeterPerspective *self,
+ GtkButton *genesis_cancel_button)
+{
+ g_assert (IDE_IS_GREETER_PERSPECTIVE (self));
+ g_assert (GTK_IS_BUTTON (genesis_cancel_button));
+
+ egg_state_machine_set_state (self->state_machine, "browse");
+ ide_greeter_perspective_apply_filter_all (self);
+}
+
+static void
ide_greeter_perspective_genesis_added (PeasExtensionSet *set,
PeasPluginInfo *plugin_info,
PeasExtension *exten,
@@ -1140,6 +1164,7 @@ ide_greeter_perspective_class_init (IdeGreeterPerspectiveClass *klass)
gtk_widget_class_set_css_name (widget_class, "greeter");
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, genesis_buttons);
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, genesis_continue_button);
+ gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, genesis_cancel_button);
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, genesis_stack);
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, genesis_title);
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, info_bar);
@@ -1148,6 +1173,7 @@ ide_greeter_perspective_class_init (IdeGreeterPerspectiveClass *klass)
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, my_projects_container);
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, my_projects_list_box);
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, open_button);
+ gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, cancel_button);
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, other_projects_container);
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, other_projects_list_box);
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, remove_button);
@@ -1230,12 +1256,24 @@ ide_greeter_perspective_init (IdeGreeterPerspective *self)
self,
G_CONNECT_SWAPPED);
+ g_signal_connect_object (self->genesis_cancel_button,
+ "clicked",
+ G_CALLBACK (ide_greeter_perspective_genesis_cancel_clicked),
+ self,
+ G_CONNECT_SWAPPED);
+
g_signal_connect_object (self->open_button,
"clicked",
G_CALLBACK (ide_greeter_perspective_open_clicked),
self,
G_CONNECT_SWAPPED);
+ g_signal_connect_object (self->cancel_button,
+ "clicked",
+ G_CALLBACK (ide_greeter_perspective_cancel_clicked),
+ self,
+ G_CONNECT_SWAPPED);
+
g_signal_connect_object (self->info_bar,
"response",
G_CALLBACK (ide_greeter_perspective_info_bar_response),
diff --git a/libide/greeter/ide-greeter-perspective.ui b/libide/greeter/ide-greeter-perspective.ui
index a4ee8d2..284d27d 100644
--- a/libide/greeter/ide-greeter-perspective.ui
+++ b/libide/greeter/ide-greeter-perspective.ui
@@ -314,8 +314,6 @@
</child>
<child>
<object class="GtkButton" id="genesis_cancel_button">
- <property name="action-name">perspective.state</property>
- <property name="action-target">'browse'</property>
<property name="label" translatable="yes">_Cancel</property>
<property name="use-underline">true</property>
<property name="visible">true</property>
@@ -366,8 +364,6 @@
<property name="tooltip-text" translatable="yes">Return to project selection</property>
<property name="label" translatable="yes">_Cancel</property>
<property name="use-underline">true</property>
- <property name="action-name">perspective.state</property>
- <property name="action-target">'browse'</property>
<style>
<class name="text-button"/>
</style>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]