[gnome-software/wip/kalev/gs-shell-pages-rename: 1/3] Rename shell pages from GsShellFoo to GsFooPage
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/kalev/gs-shell-pages-rename: 1/3] Rename shell pages from GsShellFoo to GsFooPage
- Date: Mon, 6 Mar 2017 13:58:06 +0000 (UTC)
commit 99ba742905fcaf388465208880f89370c2ce3f73
Author: Kalev Lember <klember redhat com>
Date: Mon Mar 6 14:11:54 2017 +0100
Rename shell pages from GsShellFoo to GsFooPage
https://mail.gnome.org/archives/gnome-software-list/2017-March/msg00000.html
po/POTFILES.in | 32 +-
src/Makefile.am | 54 +-
src/gnome-software.gresource.xml | 18 +-
src/gnome-software.ui | 18 +-
src/{gs-shell-category.c => gs-category-page.c} | 104 ++--
src/{gs-shell-category.h => gs-category-page.h} | 16 +-
src/{gs-shell-category.ui => gs-category-page.ui} | 2 +-
src/gs-dbus-helper.c | 62 +-
src/{gs-shell-details.c => gs-details-page.c} | 634 ++++++++++----------
src/{gs-shell-details.h => gs-details-page.h} | 20 +-
src/{gs-shell-details.ui => gs-details-page.ui} | 2 +-
src/{gs-shell-extras.c => gs-extras-page.c} | 303 +++++-----
src/{gs-shell-extras.h => gs-extras-page.h} | 40 +-
src/{gs-shell-extras.ui => gs-extras-page.ui} | 2 +-
src/{gs-shell-installed.c => gs-installed-page.c} | 236 ++++----
src/{gs-shell-moderate.h => gs-installed-page.h} | 12 +-
...{gs-shell-installed.ui => gs-installed-page.ui} | 2 +-
src/{gs-shell-loading.c => gs-loading-page.c} | 90 ++--
src/{gs-shell-loading.h => gs-loading-page.h} | 16 +-
src/{gs-shell-loading.ui => gs-loading-page.ui} | 2 +-
src/{gs-shell-moderate.c => gs-moderate-page.c} | 120 ++--
src/{gs-shell-installed.h => gs-moderate-page.h} | 12 +-
src/{gs-shell-moderate.ui => gs-moderate-page.ui} | 2 +-
src/{gs-shell-overview.c => gs-overview-page.c} | 256 ++++----
src/{gs-shell-overview.h => gs-overview-page.h} | 18 +-
src/{gs-shell-overview.ui => gs-overview-page.ui} | 2 +-
src/{gs-shell-search.c => gs-search-page.c} | 170 +++---
src/{gs-shell-search.h => gs-search-page.h} | 22 +-
src/{gs-shell-search.ui => gs-search-page.ui} | 2 +-
src/gs-shell.c | 84 ++--
src/{gs-shell-updates.c => gs-updates-page.c} | 469 +++++++--------
src/{gs-shell-updates.h => gs-updates-page.h} | 12 +-
src/{gs-shell-updates.ui => gs-updates-page.ui} | 2 +-
src/meson.build | 18 +-
34 files changed, 1424 insertions(+), 1430 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index ae50196..7a3d2f4 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -33,20 +33,20 @@ src/gs-review-row.c
src/gs-review-row.ui
src/gs-screenshot-image.c
src/gs-shell.c
-src/gs-shell-category.ui
-src/gs-shell-details.c
-src/gs-shell-details.ui
-src/gs-shell-extras.c
-src/gs-shell-extras.ui
-src/gs-shell-installed.c
-src/gs-shell-installed.ui
-src/gs-shell-moderate.ui
-src/gs-shell-overview.c
-src/gs-shell-overview.ui
-src/gs-shell-search.c
-src/gs-shell-search.ui
-src/gs-shell-updates.c
-src/gs-shell-updates.ui
+src/gs-category-page.ui
+src/gs-details-page.c
+src/gs-details-page.ui
+src/gs-extras-page.c
+src/gs-extras-page.ui
+src/gs-installed-page.c
+src/gs-installed-page.ui
+src/gs-moderate-page.ui
+src/gs-overview-page.c
+src/gs-overview-page.ui
+src/gs-search-page.c
+src/gs-search-page.ui
+src/gs-updates-page.c
+src/gs-updates-page.ui
src/gs-sources-dialog.c
src/gs-sources-dialog.ui
src/gs-star-widget.ui
@@ -63,8 +63,8 @@ src/gs-content-rating.c
src/gs-menus.ui
src/org.gnome.Software.desktop.in
src/gs-popular-tile.ui
-src/gs-shell-loading.c
-src/gs-shell-loading.ui
+src/gs-loading-page.c
+src/gs-loading-page.ui
src/plugins/gs-desktop-common.c
src/plugins/gs-install-appstream.c
src/plugins/gs-plugin-fedora-distro-upgrades.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 7d7e91b..84437cb 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -71,15 +71,15 @@ UI_FILES = \
gs-review-histogram.ui \
gs-review-row.ui \
gs-screenshot-image.ui \
- gs-shell-category.ui \
- gs-shell-details.ui \
- gs-shell-extras.ui \
- gs-shell-installed.ui \
- gs-shell-moderate.ui \
- gs-shell-loading.ui \
- gs-shell-overview.ui \
- gs-shell-search.ui \
- gs-shell-updates.ui \
+ gs-category-page.ui \
+ gs-details-page.ui \
+ gs-extras-page.ui \
+ gs-installed-page.ui \
+ gs-moderate-page.ui \
+ gs-loading-page.ui \
+ gs-overview-page.ui \
+ gs-search-page.ui \
+ gs-updates-page.ui \
gs-sources-dialog-row.ui \
gs-sources-dialog.ui \
gs-star-widget.ui \
@@ -229,24 +229,24 @@ gnome_software_SOURCES = \
gs-screenshot-image.h \
gs-shell.c \
gs-shell.h \
- gs-shell-details.c \
- gs-shell-details.h \
- gs-shell-category.c \
- gs-shell-category.h \
- gs-shell-extras.c \
- gs-shell-extras.h \
- gs-shell-installed.c \
- gs-shell-installed.h \
- gs-shell-moderate.c \
- gs-shell-moderate.h \
- gs-shell-loading.c \
- gs-shell-loading.h \
- gs-shell-overview.c \
- gs-shell-overview.h \
- gs-shell-updates.c \
- gs-shell-updates.h \
- gs-shell-search.c \
- gs-shell-search.h \
+ gs-details-page.c \
+ gs-details-page.h \
+ gs-category-page.c \
+ gs-category-page.h \
+ gs-extras-page.c \
+ gs-extras-page.h \
+ gs-installed-page.c \
+ gs-installed-page.h \
+ gs-moderate-page.c \
+ gs-moderate-page.h \
+ gs-loading-page.c \
+ gs-loading-page.h \
+ gs-overview-page.c \
+ gs-overview-page.h \
+ gs-updates-page.c \
+ gs-updates-page.h \
+ gs-search-page.c \
+ gs-search-page.h \
gs-sources-dialog.c \
gs-sources-dialog.h \
gs-sources-dialog-row.c \
diff --git a/src/gnome-software.gresource.xml b/src/gnome-software.gresource.xml
index e6b4e79..693448d 100644
--- a/src/gnome-software.gresource.xml
+++ b/src/gnome-software.gresource.xml
@@ -19,15 +19,15 @@
<file preprocess="xml-stripblanks">gs-review-histogram.ui</file>
<file preprocess="xml-stripblanks">gs-review-row.ui</file>
<file preprocess="xml-stripblanks">gs-screenshot-image.ui</file>
- <file preprocess="xml-stripblanks">gs-shell-category.ui</file>
- <file preprocess="xml-stripblanks">gs-shell-details.ui</file>
- <file preprocess="xml-stripblanks">gs-shell-extras.ui</file>
- <file preprocess="xml-stripblanks">gs-shell-installed.ui</file>
- <file preprocess="xml-stripblanks">gs-shell-loading.ui</file>
- <file preprocess="xml-stripblanks">gs-shell-moderate.ui</file>
- <file preprocess="xml-stripblanks">gs-shell-overview.ui</file>
- <file preprocess="xml-stripblanks">gs-shell-search.ui</file>
- <file preprocess="xml-stripblanks">gs-shell-updates.ui</file>
+ <file preprocess="xml-stripblanks">gs-category-page.ui</file>
+ <file preprocess="xml-stripblanks">gs-details-page.ui</file>
+ <file preprocess="xml-stripblanks">gs-extras-page.ui</file>
+ <file preprocess="xml-stripblanks">gs-installed-page.ui</file>
+ <file preprocess="xml-stripblanks">gs-loading-page.ui</file>
+ <file preprocess="xml-stripblanks">gs-moderate-page.ui</file>
+ <file preprocess="xml-stripblanks">gs-overview-page.ui</file>
+ <file preprocess="xml-stripblanks">gs-search-page.ui</file>
+ <file preprocess="xml-stripblanks">gs-updates-page.ui</file>
<file preprocess="xml-stripblanks">gs-sources-dialog-row.ui</file>
<file preprocess="xml-stripblanks">gs-sources-dialog.ui</file>
<file preprocess="xml-stripblanks">gs-star-widget.ui</file>
diff --git a/src/gnome-software.ui b/src/gnome-software.ui
index 2e5e1a5..aa17a46 100644
--- a/src/gnome-software.ui
+++ b/src/gnome-software.ui
@@ -429,7 +429,7 @@
<object class="GtkStack" id="stack_main">
<property name="visible">True</property>
<child>
- <object class="GsShellOverview" id="shell_overview">
+ <object class="GsOverviewPage" id="overview_page">
<property name="visible">True</property>
</object>
<packing>
@@ -437,7 +437,7 @@
</packing>
</child>
<child>
- <object class="GsShellInstalled" id="shell_installed">
+ <object class="GsInstalledPage" id="installed_page">
<property name="visible">True</property>
</object>
<packing>
@@ -445,7 +445,7 @@
</packing>
</child>
<child>
- <object class="GsShellModerate" id="shell_moderate">
+ <object class="GsModeratePage" id="moderate_page">
<property name="visible">True</property>
</object>
<packing>
@@ -453,7 +453,7 @@
</packing>
</child>
<child>
- <object class="GsShellLoading" id="shell_loading">
+ <object class="GsLoadingPage" id="loading_page">
<property name="visible">True</property>
</object>
<packing>
@@ -461,7 +461,7 @@
</packing>
</child>
<child>
- <object class="GsShellSearch" id="shell_search">
+ <object class="GsSearchPage" id="search_page">
<property name="visible">True</property>
</object>
<packing>
@@ -469,7 +469,7 @@
</packing>
</child>
<child>
- <object class="GsShellUpdates" id="shell_updates">
+ <object class="GsUpdatesPage" id="updates_page">
<property name="visible">True</property>
</object>
<packing>
@@ -478,7 +478,7 @@
</child>
<child>
- <object class="GsShellDetails" id="shell_details">
+ <object class="GsDetailsPage" id="details_page">
<property name="visible">True</property>
</object>
<packing>
@@ -487,7 +487,7 @@
</child>
<child>
- <object class="GsShellCategory" id="shell_category">
+ <object class="GsCategoryPage" id="category_page">
<property name="visible">True</property>
</object>
<packing>
@@ -495,7 +495,7 @@
</packing>
</child>
<child>
- <object class="GsShellExtras" id="shell_extras">
+ <object class="GsExtrasPage" id="extras_page">
<property name="visible">True</property>
</object>
<packing>
diff --git a/src/gs-shell-category.c b/src/gs-category-page.c
similarity index 75%
rename from src/gs-shell-category.c
rename to src/gs-category-page.c
index 56f6d19..e487584 100644
--- a/src/gs-shell-category.c
+++ b/src/gs-category-page.c
@@ -27,9 +27,9 @@
#include "gs-common.h"
#include "gs-summary-tile.h"
-#include "gs-shell-category.h"
+#include "gs-category-page.h"
-struct _GsShellCategory
+struct _GsCategoryPage
{
GsPage parent_instance;
@@ -48,12 +48,12 @@ struct _GsShellCategory
GtkWidget *scrolledwindow_filter;
};
-G_DEFINE_TYPE (GsShellCategory, gs_shell_category, GS_TYPE_PAGE)
+G_DEFINE_TYPE (GsCategoryPage, gs_category_page, GS_TYPE_PAGE)
static void
-gs_shell_category_switch_to (GsPage *page, gboolean scroll_up)
+gs_category_page_switch_to (GsPage *page, gboolean scroll_up)
{
- GsShellCategory *self = GS_SHELL_CATEGORY (page);
+ GsCategoryPage *self = GS_CATEGORY_PAGE (page);
GtkWidget *widget;
widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "application_details_header"));
@@ -64,7 +64,7 @@ gs_shell_category_switch_to (GsPage *page, gboolean scroll_up)
static void
app_tile_clicked (GsAppTile *tile, gpointer data)
{
- GsShellCategory *self = GS_SHELL_CATEGORY (data);
+ GsCategoryPage *self = GS_CATEGORY_PAGE (data);
GsApp *app;
app = gs_app_tile_get_app (tile);
@@ -72,14 +72,14 @@ app_tile_clicked (GsAppTile *tile, gpointer data)
}
static void
-gs_shell_category_get_apps_cb (GObject *source_object,
- GAsyncResult *res,
- gpointer user_data)
+gs_category_page_get_apps_cb (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
{
guint i;
GsApp *app;
GtkWidget *tile;
- GsShellCategory *self = GS_SHELL_CATEGORY (user_data);
+ GsCategoryPage *self = GS_CATEGORY_PAGE (user_data);
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
g_autoptr(GError) error = NULL;
g_autoptr(GsAppList) list = NULL;
@@ -110,9 +110,9 @@ gs_shell_category_get_apps_cb (GObject *source_object,
}
static void
-gs_shell_category_reload (GsPage *page)
+gs_category_page_reload (GsPage *page)
{
- GsShellCategory *self = GS_SHELL_CATEGORY (page);
+ GsCategoryPage *self = GS_CATEGORY_PAGE (page);
GtkWidget *tile;
guint i, count;
@@ -152,35 +152,35 @@ gs_shell_category_reload (GsPage *page)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
- gs_shell_category_get_apps_cb,
+ gs_category_page_get_apps_cb,
self);
}
static void
-gs_shell_category_populate_filtered (GsShellCategory *self, GsCategory *subcategory)
+gs_category_page_populate_filtered (GsCategoryPage *self, GsCategory *subcategory)
{
g_assert (subcategory != NULL);
g_set_object (&self->subcategory, subcategory);
- gs_shell_category_reload (GS_PAGE (self));
+ gs_category_page_reload (GS_PAGE (self));
}
static void
filter_selected (GtkListBox *filters, GtkListBoxRow *row, gpointer data)
{
- GsShellCategory *self = GS_SHELL_CATEGORY (data);
+ GsCategoryPage *self = GS_CATEGORY_PAGE (data);
GsCategory *category;
if (row == NULL)
return;
category = g_object_get_data (G_OBJECT (gtk_bin_get_child (GTK_BIN (row))), "category");
- gs_shell_category_populate_filtered (self, category);
+ gs_category_page_populate_filtered (self, category);
}
static void
-gs_shell_category_create_filter_list (GsShellCategory *self,
- GsCategory *category,
- GsCategory *subcategory)
+gs_category_page_create_filter_list (GsCategoryPage *self,
+ GsCategory *category,
+ GsCategory *subcategory)
{
GtkWidget *row;
GsCategory *s;
@@ -217,7 +217,7 @@ gs_shell_category_create_filter_list (GsShellCategory *self,
}
void
-gs_shell_category_set_category (GsShellCategory *self, GsCategory *category)
+gs_category_page_set_category (GsCategoryPage *self, GsCategory *category)
{
GPtrArray *children = NULL;
GsCategory *sub;
@@ -244,25 +244,25 @@ gs_shell_category_set_category (GsShellCategory *self, GsCategory *category)
}
/* find apps in this group */
- gs_shell_category_create_filter_list (self, category, selected);
+ gs_category_page_create_filter_list (self, category, selected);
}
GsCategory *
-gs_shell_category_get_category (GsShellCategory *self)
+gs_category_page_get_category (GsCategoryPage *self)
{
return self->category;
}
static void
-gs_shell_category_init (GsShellCategory *self)
+gs_category_page_init (GsCategoryPage *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
}
static void
-gs_shell_category_dispose (GObject *object)
+gs_category_page_dispose (GObject *object)
{
- GsShellCategory *self = GS_SHELL_CATEGORY (object);
+ GsCategoryPage *self = GS_CATEGORY_PAGE (object);
if (self->cancellable != NULL) {
g_cancellable_cancel (self->cancellable);
@@ -274,11 +274,11 @@ gs_shell_category_dispose (GObject *object)
g_clear_object (&self->subcategory);
g_clear_object (&self->plugin_loader);
- G_OBJECT_CLASS (gs_shell_category_parent_class)->dispose (object);
+ G_OBJECT_CLASS (gs_category_page_parent_class)->dispose (object);
}
static gboolean
-key_event (GtkWidget *listbox, GdkEvent *event, GsShellCategory *self)
+key_event (GtkWidget *listbox, GdkEvent *event, GsCategoryPage *self)
{
guint keyval;
gboolean handled;
@@ -304,7 +304,7 @@ key_event (GtkWidget *listbox, GdkEvent *event, GsShellCategory *self)
}
static void
-button_shell_extensions_cb (GtkButton *button, GsShellCategory *self)
+button_shell_extensions_cb (GtkButton *button, GsCategoryPage *self)
{
gboolean ret;
g_autoptr(GError) error = NULL;
@@ -316,14 +316,14 @@ button_shell_extensions_cb (GtkButton *button, GsShellCategory *self)
}
static gboolean
-gs_shell_category_setup (GsPage *page,
- GsShell *shell,
- GsPluginLoader *plugin_loader,
- GtkBuilder *builder,
- GCancellable *cancellable,
- GError **error)
+gs_category_page_setup (GsPage *page,
+ GsShell *shell,
+ GsPluginLoader *plugin_loader,
+ GtkBuilder *builder,
+ GCancellable *cancellable,
+ GError **error)
{
- GsShellCategory *self = GS_SHELL_CATEGORY (page);
+ GsCategoryPage *self = GS_CATEGORY_PAGE (page);
GtkAdjustment *adj;
self->plugin_loader = g_object_ref (plugin_loader);
@@ -344,32 +344,32 @@ gs_shell_category_setup (GsPage *page,
}
static void
-gs_shell_category_class_init (GsShellCategoryClass *klass)
+gs_category_page_class_init (GsCategoryPageClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GsPageClass *page_class = GS_PAGE_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- object_class->dispose = gs_shell_category_dispose;
- page_class->switch_to = gs_shell_category_switch_to;
- page_class->reload = gs_shell_category_reload;
- page_class->setup = gs_shell_category_setup;
+ object_class->dispose = gs_category_page_dispose;
+ page_class->switch_to = gs_category_page_switch_to;
+ page_class->reload = gs_category_page_reload;
+ page_class->setup = gs_category_page_setup;
- gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/Software/gs-shell-category.ui");
+ gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-category-page.ui");
- gtk_widget_class_bind_template_child (widget_class, GsShellCategory, category_detail_box);
- gtk_widget_class_bind_template_child (widget_class, GsShellCategory,
infobar_category_shell_extensions);
- gtk_widget_class_bind_template_child (widget_class, GsShellCategory,
button_category_shell_extensions);
- gtk_widget_class_bind_template_child (widget_class, GsShellCategory, listbox_filter);
- gtk_widget_class_bind_template_child (widget_class, GsShellCategory, scrolledwindow_category);
- gtk_widget_class_bind_template_child (widget_class, GsShellCategory, scrolledwindow_filter);
+ gtk_widget_class_bind_template_child (widget_class, GsCategoryPage, category_detail_box);
+ gtk_widget_class_bind_template_child (widget_class, GsCategoryPage,
infobar_category_shell_extensions);
+ gtk_widget_class_bind_template_child (widget_class, GsCategoryPage, button_category_shell_extensions);
+ gtk_widget_class_bind_template_child (widget_class, GsCategoryPage, listbox_filter);
+ gtk_widget_class_bind_template_child (widget_class, GsCategoryPage, scrolledwindow_category);
+ gtk_widget_class_bind_template_child (widget_class, GsCategoryPage, scrolledwindow_filter);
}
-GsShellCategory *
-gs_shell_category_new (void)
+GsCategoryPage *
+gs_category_page_new (void)
{
- GsShellCategory *self;
- self = g_object_new (GS_TYPE_SHELL_CATEGORY, NULL);
+ GsCategoryPage *self;
+ self = g_object_new (GS_TYPE_CATEGORY_PAGE, NULL);
return self;
}
diff --git a/src/gs-shell-category.h b/src/gs-category-page.h
similarity index 73%
rename from src/gs-shell-category.h
rename to src/gs-category-page.h
index cda7606..308e39d 100644
--- a/src/gs-shell-category.h
+++ b/src/gs-category-page.h
@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __GS_SHELL_CATEGORY_H
-#define __GS_SHELL_CATEGORY_H
+#ifndef __GS_CATEGORY_PAGE_H
+#define __GS_CATEGORY_PAGE_H
#include <glib-object.h>
#include <gtk/gtk.h>
@@ -32,17 +32,17 @@
G_BEGIN_DECLS
-#define GS_TYPE_SHELL_CATEGORY (gs_shell_category_get_type ())
+#define GS_TYPE_CATEGORY_PAGE (gs_category_page_get_type ())
-G_DECLARE_FINAL_TYPE (GsShellCategory, gs_shell_category, GS, SHELL_CATEGORY, GsPage)
+G_DECLARE_FINAL_TYPE (GsCategoryPage, gs_category_page, GS, CATEGORY_PAGE, GsPage)
-GsShellCategory *gs_shell_category_new (void);
-void gs_shell_category_set_category (GsShellCategory *self,
+GsCategoryPage *gs_category_page_new (void);
+void gs_category_page_set_category (GsCategoryPage *self,
GsCategory *category);
-GsCategory *gs_shell_category_get_category (GsShellCategory *self);
+GsCategory *gs_category_page_get_category (GsCategoryPage *self);
G_END_DECLS
-#endif /* __GS_SHELL_CATEGORY_H */
+#endif /* __GS_CATEGORY_PAGE_H */
/* vim: set noexpandtab: */
diff --git a/src/gs-shell-category.ui b/src/gs-category-page.ui
similarity index 99%
rename from src/gs-shell-category.ui
rename to src/gs-category-page.ui
index 24e7218..318a12e 100644
--- a/src/gs-shell-category.ui
+++ b/src/gs-category-page.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.10"/>
- <template class="GsShellCategory" parent="GsPage">
+ <template class="GsCategoryPage" parent="GsPage">
<child>
<object class="GtkBox" id="box_category">
<property name="visible">True</property>
diff --git a/src/gs-dbus-helper.c b/src/gs-dbus-helper.c
index 44fde32..14426ea 100644
--- a/src/gs-dbus-helper.c
+++ b/src/gs-dbus-helper.c
@@ -31,7 +31,7 @@
#include "gs-packagekit-generated.h"
#include "gs-packagekit-modify2-generated.h"
#include "gs-resources.h"
-#include "gs-shell-extras.h"
+#include "gs-extras-page.h"
#include "gs-utils.h"
struct _GsDbusHelper {
@@ -271,9 +271,9 @@ is_show_confirm_search_set (const gchar *interaction)
}
static void
-notify_search_resources (GsShellExtrasMode mode,
- const gchar *desktop_id,
- gchar **resources)
+notify_search_resources (GsExtrasPageMode mode,
+ const gchar *desktop_id,
+ gchar **resources)
{
const gchar *app_name = NULL;
const gchar *mode_string;
@@ -294,25 +294,25 @@ notify_search_resources (GsShellExtrasMode mode,
}
switch (mode) {
- case GS_SHELL_EXTRAS_MODE_INSTALL_MIME_TYPES:
+ case GS_EXTRAS_PAGE_MODE_INSTALL_MIME_TYPES:
/* TRANSLATORS: this is a notification displayed when an app needs additional MIME types. */
body = g_strdup_printf (_("%s is requesting additional file format support."), app_name);
/* TRANSLATORS: notification title */
title = _("Additional MIME Types Required");
break;
- case GS_SHELL_EXTRAS_MODE_INSTALL_FONTCONFIG_RESOURCES:
+ case GS_EXTRAS_PAGE_MODE_INSTALL_FONTCONFIG_RESOURCES:
/* TRANSLATORS: this is a notification displayed when an app needs additional fonts. */
body = g_strdup_printf (_("%s is requesting additional fonts."), app_name);
/* TRANSLATORS: notification title */
title = _("Additional Fonts Required");
break;
- case GS_SHELL_EXTRAS_MODE_INSTALL_GSTREAMER_RESOURCES:
+ case GS_EXTRAS_PAGE_MODE_INSTALL_GSTREAMER_RESOURCES:
/* TRANSLATORS: this is a notification displayed when an app needs additional codecs. */
body = g_strdup_printf (_("%s is requesting additional multimedia codecs."), app_name);
/* TRANSLATORS: notification title */
title = _("Additional Multimedia Codecs Required");
break;
- case GS_SHELL_EXTRAS_MODE_INSTALL_PRINTER_DRIVERS:
+ case GS_EXTRAS_PAGE_MODE_INSTALL_PRINTER_DRIVERS:
/* TRANSLATORS: this is a notification displayed when an app needs additional printer
drivers. */
body = g_strdup_printf (_("%s is requesting additional printer drivers."), app_name);
/* TRANSLATORS: notification title */
@@ -326,7 +326,7 @@ notify_search_resources (GsShellExtrasMode mode,
break;
}
- mode_string = gs_shell_extras_mode_to_string (mode);
+ mode_string = gs_extras_page_mode_to_string (mode);
n = g_notification_new (title);
g_notification_set_body (n, body);
@@ -337,11 +337,11 @@ notify_search_resources (GsShellExtrasMode mode,
}
static void
-install_resources (GsShellExtrasMode mode,
- gchar **resources,
- const gchar *interaction,
- const gchar *desktop_id,
- GVariant *platform_data)
+install_resources (GsExtrasPageMode mode,
+ gchar **resources,
+ const gchar *interaction,
+ const gchar *desktop_id,
+ GVariant *platform_data)
{
GApplication *app;
const gchar *mode_string;
@@ -358,7 +358,7 @@ install_resources (GsShellExtrasMode mode,
}
app = g_application_get_default ();
- mode_string = gs_shell_extras_mode_to_string (mode);
+ mode_string = gs_extras_page_mode_to_string (mode);
g_action_group_activate_action (G_ACTION_GROUP (app), "install-resources",
g_variant_new ("(s^ass)", mode_string, resources, startup_id));
}
@@ -373,7 +373,7 @@ handle_modify_install_package_files (GsPackageKitModify *object,
{
g_debug ("****** Modify.InstallPackageFiles");
- notify_search_resources (GS_SHELL_EXTRAS_MODE_INSTALL_PACKAGE_FILES, NULL, arg_files);
+ notify_search_resources (GS_EXTRAS_PAGE_MODE_INSTALL_PACKAGE_FILES, NULL, arg_files);
gs_package_kit_modify_complete_install_package_files (object, invocation);
return TRUE;
@@ -389,7 +389,7 @@ handle_modify_install_provide_files (GsPackageKitModify *object,
{
g_debug ("****** Modify.InstallProvideFiles");
- notify_search_resources (GS_SHELL_EXTRAS_MODE_INSTALL_PROVIDE_FILES, NULL, arg_files);
+ notify_search_resources (GS_EXTRAS_PAGE_MODE_INSTALL_PROVIDE_FILES, NULL, arg_files);
gs_package_kit_modify_complete_install_provide_files (object, invocation);
return TRUE;
@@ -405,7 +405,7 @@ handle_modify_install_package_names (GsPackageKitModify *object,
{
g_debug ("****** Modify.InstallPackageNames");
- notify_search_resources (GS_SHELL_EXTRAS_MODE_INSTALL_PACKAGE_NAMES, NULL, arg_package_names);
+ notify_search_resources (GS_EXTRAS_PAGE_MODE_INSTALL_PACKAGE_NAMES, NULL, arg_package_names);
gs_package_kit_modify_complete_install_package_names (object, invocation);
return TRUE;
@@ -421,7 +421,7 @@ handle_modify_install_mime_types (GsPackageKitModify *object,
{
g_debug ("****** Modify.InstallMimeTypes");
- notify_search_resources (GS_SHELL_EXTRAS_MODE_INSTALL_MIME_TYPES, NULL, arg_mime_types);
+ notify_search_resources (GS_EXTRAS_PAGE_MODE_INSTALL_MIME_TYPES, NULL, arg_mime_types);
gs_package_kit_modify_complete_install_mime_types (object, invocation);
return TRUE;
@@ -437,7 +437,7 @@ handle_modify_install_fontconfig_resources (GsPackageKitModify *object,
{
g_debug ("****** Modify.InstallFontconfigResources");
- notify_search_resources (GS_SHELL_EXTRAS_MODE_INSTALL_FONTCONFIG_RESOURCES, NULL, arg_resources);
+ notify_search_resources (GS_EXTRAS_PAGE_MODE_INSTALL_FONTCONFIG_RESOURCES, NULL, arg_resources);
gs_package_kit_modify_complete_install_fontconfig_resources (object, invocation);
return TRUE;
@@ -453,7 +453,7 @@ handle_modify_install_gstreamer_resources (GsPackageKitModify *object,
{
g_debug ("****** Modify.InstallGStreamerResources");
- notify_search_resources (GS_SHELL_EXTRAS_MODE_INSTALL_GSTREAMER_RESOURCES, NULL, arg_resources);
+ notify_search_resources (GS_EXTRAS_PAGE_MODE_INSTALL_GSTREAMER_RESOURCES, NULL, arg_resources);
gs_package_kit_modify_complete_install_gstreamer_resources (object, invocation);
return TRUE;
@@ -473,7 +473,7 @@ handle_modify_install_resources (GsPackageKitModify *object,
g_debug ("****** Modify.InstallResources");
if (g_strcmp0 (arg_type, "plasma-service") == 0) {
- notify_search_resources (GS_SHELL_EXTRAS_MODE_INSTALL_PLASMA_RESOURCES, NULL, arg_resources);
+ notify_search_resources (GS_EXTRAS_PAGE_MODE_INSTALL_PLASMA_RESOURCES, NULL, arg_resources);
ret = TRUE;
} else {
ret = FALSE;
@@ -493,7 +493,7 @@ handle_modify_install_printer_drivers (GsPackageKitModify *object,
{
g_debug ("****** Modify.InstallPrinterDrivers");
- notify_search_resources (GS_SHELL_EXTRAS_MODE_INSTALL_PRINTER_DRIVERS, NULL, arg_device_ids);
+ notify_search_resources (GS_EXTRAS_PAGE_MODE_INSTALL_PRINTER_DRIVERS, NULL, arg_device_ids);
gs_package_kit_modify_complete_install_printer_drivers (object, invocation);
return TRUE;
@@ -510,7 +510,7 @@ handle_modify2_install_package_files (GsPackageKitModify2 *object,
{
g_debug ("****** Modify2.InstallPackageFiles");
- install_resources (GS_SHELL_EXTRAS_MODE_INSTALL_PACKAGE_FILES, arg_files, arg_interaction,
arg_desktop_id, arg_platform_data);
+ install_resources (GS_EXTRAS_PAGE_MODE_INSTALL_PACKAGE_FILES, arg_files, arg_interaction,
arg_desktop_id, arg_platform_data);
gs_package_kit_modify2_complete_install_package_files (object, invocation);
return TRUE;
@@ -527,7 +527,7 @@ handle_modify2_install_provide_files (GsPackageKitModify2 *object,
{
g_debug ("****** Modify2.InstallProvideFiles");
- install_resources (GS_SHELL_EXTRAS_MODE_INSTALL_PROVIDE_FILES, arg_files, arg_interaction,
arg_desktop_id, arg_platform_data);
+ install_resources (GS_EXTRAS_PAGE_MODE_INSTALL_PROVIDE_FILES, arg_files, arg_interaction,
arg_desktop_id, arg_platform_data);
gs_package_kit_modify2_complete_install_provide_files (object, invocation);
return TRUE;
@@ -544,7 +544,7 @@ handle_modify2_install_package_names (GsPackageKitModify2 *object,
{
g_debug ("****** Modify2.InstallPackageNames");
- install_resources (GS_SHELL_EXTRAS_MODE_INSTALL_PACKAGE_NAMES, arg_package_names, arg_interaction,
arg_desktop_id, arg_platform_data);
+ install_resources (GS_EXTRAS_PAGE_MODE_INSTALL_PACKAGE_NAMES, arg_package_names, arg_interaction,
arg_desktop_id, arg_platform_data);
gs_package_kit_modify2_complete_install_package_names (object, invocation);
return TRUE;
@@ -561,7 +561,7 @@ handle_modify2_install_mime_types (GsPackageKitModify2 *object,
{
g_debug ("****** Modify2.InstallMimeTypes");
- install_resources (GS_SHELL_EXTRAS_MODE_INSTALL_MIME_TYPES, arg_mime_types, arg_interaction,
arg_desktop_id, arg_platform_data);
+ install_resources (GS_EXTRAS_PAGE_MODE_INSTALL_MIME_TYPES, arg_mime_types, arg_interaction,
arg_desktop_id, arg_platform_data);
gs_package_kit_modify2_complete_install_mime_types (object, invocation);
return TRUE;
@@ -578,7 +578,7 @@ handle_modify2_install_fontconfig_resources (GsPackageKitModify2 *object,
{
g_debug ("****** Modify2.InstallFontconfigResources");
- install_resources (GS_SHELL_EXTRAS_MODE_INSTALL_FONTCONFIG_RESOURCES, arg_resources, arg_interaction,
arg_desktop_id, arg_platform_data);
+ install_resources (GS_EXTRAS_PAGE_MODE_INSTALL_FONTCONFIG_RESOURCES, arg_resources, arg_interaction,
arg_desktop_id, arg_platform_data);
gs_package_kit_modify2_complete_install_fontconfig_resources (object, invocation);
return TRUE;
@@ -595,7 +595,7 @@ handle_modify2_install_gstreamer_resources (GsPackageKitModify2 *object,
{
g_debug ("****** Modify2.InstallGStreamerResources");
- install_resources (GS_SHELL_EXTRAS_MODE_INSTALL_GSTREAMER_RESOURCES, arg_resources, arg_interaction,
arg_desktop_id, arg_platform_data);
+ install_resources (GS_EXTRAS_PAGE_MODE_INSTALL_GSTREAMER_RESOURCES, arg_resources, arg_interaction,
arg_desktop_id, arg_platform_data);
gs_package_kit_modify2_complete_install_gstreamer_resources (object, invocation);
return TRUE;
@@ -616,7 +616,7 @@ handle_modify2_install_resources (GsPackageKitModify2 *object,
g_debug ("****** Modify2.InstallResources");
if (g_strcmp0 (arg_type, "plasma-service") == 0) {
- install_resources (GS_SHELL_EXTRAS_MODE_INSTALL_PLASMA_RESOURCES, arg_resources,
arg_interaction, arg_desktop_id, arg_platform_data);
+ install_resources (GS_EXTRAS_PAGE_MODE_INSTALL_PLASMA_RESOURCES, arg_resources,
arg_interaction, arg_desktop_id, arg_platform_data);
ret = TRUE;
} else {
ret = FALSE;
@@ -637,7 +637,7 @@ handle_modify2_install_printer_drivers (GsPackageKitModify2 *object,
{
g_debug ("****** Modify2.InstallPrinterDrivers");
- install_resources (GS_SHELL_EXTRAS_MODE_INSTALL_PRINTER_DRIVERS, arg_device_ids, arg_interaction,
arg_desktop_id, arg_platform_data);
+ install_resources (GS_EXTRAS_PAGE_MODE_INSTALL_PRINTER_DRIVERS, arg_device_ids, arg_interaction,
arg_desktop_id, arg_platform_data);
gs_package_kit_modify2_complete_install_printer_drivers (object, invocation);
return TRUE;
diff --git a/src/gs-shell-details.c b/src/gs-details-page.c
similarity index 74%
rename from src/gs-shell-details.c
rename to src/gs-details-page.c
index 2f2606a..7f865e4 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-details-page.c
@@ -29,7 +29,7 @@
#include "gs-common.h"
#include "gs-content-rating.h"
-#include "gs-shell-details.h"
+#include "gs-details-page.h"
#include "gs-app-private.h"
#include "gs-app-addon-row.h"
#include "gs-auth-dialog.h"
@@ -43,15 +43,15 @@
/* the number of reviews to show before clicking the 'More Reviews' button */
#define SHOW_NR_REVIEWS_INITIAL 4
-static void gs_shell_details_refresh_all (GsShellDetails *self);
+static void gs_details_page_refresh_all (GsDetailsPage *self);
typedef enum {
- GS_SHELL_DETAILS_STATE_LOADING,
- GS_SHELL_DETAILS_STATE_READY,
- GS_SHELL_DETAILS_STATE_FAILED
-} GsShellDetailsState;
+ GS_DETAILS_PAGE_STATE_LOADING,
+ GS_DETAILS_PAGE_STATE_READY,
+ GS_DETAILS_PAGE_STATE_FAILED
+} GsDetailsPageState;
-struct _GsShellDetails
+struct _GsDetailsPage
{
GsPage parent_instance;
@@ -144,20 +144,20 @@ struct _GsShellDetails
GtkWidget *label_details_rating_title;
};
-G_DEFINE_TYPE (GsShellDetails, gs_shell_details, GS_TYPE_PAGE)
+G_DEFINE_TYPE (GsDetailsPage, gs_details_page, GS_TYPE_PAGE)
static void
-gs_shell_details_set_state (GsShellDetails *self,
- GsShellDetailsState state)
+gs_details_page_set_state (GsDetailsPage *self,
+ GsDetailsPageState state)
{
/* spinner */
switch (state) {
- case GS_SHELL_DETAILS_STATE_LOADING:
+ case GS_DETAILS_PAGE_STATE_LOADING:
gs_start_spinner (GTK_SPINNER (self->spinner_details));
gtk_widget_show (self->spinner_details);
break;
- case GS_SHELL_DETAILS_STATE_READY:
- case GS_SHELL_DETAILS_STATE_FAILED:
+ case GS_DETAILS_PAGE_STATE_READY:
+ case GS_DETAILS_PAGE_STATE_FAILED:
gs_stop_spinner (GTK_SPINNER (self->spinner_details));
gtk_widget_hide (self->spinner_details);
break;
@@ -167,13 +167,13 @@ gs_shell_details_set_state (GsShellDetails *self,
/* stack */
switch (state) {
- case GS_SHELL_DETAILS_STATE_LOADING:
+ case GS_DETAILS_PAGE_STATE_LOADING:
gtk_stack_set_visible_child_name (GTK_STACK (self->stack_details), "spinner");
break;
- case GS_SHELL_DETAILS_STATE_READY:
+ case GS_DETAILS_PAGE_STATE_READY:
gtk_stack_set_visible_child_name (GTK_STACK (self->stack_details), "ready");
break;
- case GS_SHELL_DETAILS_STATE_FAILED:
+ case GS_DETAILS_PAGE_STATE_FAILED:
gtk_stack_set_visible_child_name (GTK_STACK (self->stack_details), "failed");
break;
default:
@@ -182,7 +182,7 @@ gs_shell_details_set_state (GsShellDetails *self,
}
static void
-gs_shell_details_update_shortcut_button (GsShellDetails *self)
+gs_details_page_update_shortcut_button (GsDetailsPage *self)
{
gboolean add_shortcut_func;
gboolean remove_shortcut_func;
@@ -231,9 +231,9 @@ gs_shell_details_update_shortcut_button (GsShellDetails *self)
}
static void
-gs_shell_details_switch_to (GsPage *page, gboolean scroll_up)
+gs_details_page_switch_to (GsPage *page, gboolean scroll_up)
{
- GsShellDetails *self = GS_SHELL_DETAILS (page);
+ GsDetailsPage *self = GS_DETAILS_PAGE (page);
AsAppState state;
GtkWidget *widget;
GtkStyleContext *sc;
@@ -387,7 +387,7 @@ gs_shell_details_switch_to (GsPage *page, gboolean scroll_up)
}
static void
-gs_shell_details_refresh_progress (GsShellDetails *self)
+gs_details_page_refresh_progress (GsDetailsPage *self)
{
guint percentage;
AsAppState state;
@@ -467,49 +467,49 @@ gs_shell_details_refresh_progress (GsShellDetails *self)
}
static gboolean
-gs_shell_details_refresh_progress_idle (gpointer user_data)
+gs_details_page_refresh_progress_idle (gpointer user_data)
{
- GsShellDetails *self = GS_SHELL_DETAILS (user_data);
- gs_shell_details_refresh_progress (self);
+ GsDetailsPage *self = GS_DETAILS_PAGE (user_data);
+ gs_details_page_refresh_progress (self);
g_object_unref (self);
return G_SOURCE_REMOVE;
}
static void
-gs_shell_details_progress_changed_cb (GsApp *app,
- GParamSpec *pspec,
- GsShellDetails *self)
+gs_details_page_progress_changed_cb (GsApp *app,
+ GParamSpec *pspec,
+ GsDetailsPage *self)
{
- g_idle_add (gs_shell_details_refresh_progress_idle, g_object_ref (self));
+ g_idle_add (gs_details_page_refresh_progress_idle, g_object_ref (self));
}
static gboolean
-gs_shell_details_switch_to_idle (gpointer user_data)
+gs_details_page_switch_to_idle (gpointer user_data)
{
- GsShellDetails *self = GS_SHELL_DETAILS (user_data);
+ GsDetailsPage *self = GS_DETAILS_PAGE (user_data);
if (gs_shell_get_mode (self->shell) == GS_SHELL_MODE_DETAILS)
gs_page_switch_to (GS_PAGE (self), TRUE);
/* update widgets */
- gs_shell_details_refresh_all (self);
+ gs_details_page_refresh_all (self);
g_object_unref (self);
return G_SOURCE_REMOVE;
}
static void
-gs_shell_details_notify_state_changed_cb (GsApp *app,
- GParamSpec *pspec,
- GsShellDetails *self)
+gs_details_page_notify_state_changed_cb (GsApp *app,
+ GParamSpec *pspec,
+ GsDetailsPage *self)
{
- g_idle_add (gs_shell_details_switch_to_idle, g_object_ref (self));
+ g_idle_add (gs_details_page_switch_to_idle, g_object_ref (self));
}
static void
-gs_shell_details_screenshot_selected_cb (GtkListBox *list,
- GtkListBoxRow *row,
- GsShellDetails *self)
+gs_details_page_screenshot_selected_cb (GtkListBox *list,
+ GtkListBoxRow *row,
+ GsDetailsPage *self)
{
GsScreenshotImage *ssmain;
GsScreenshotImage *ssthumb;
@@ -529,7 +529,7 @@ gs_shell_details_screenshot_selected_cb (GtkListBox *list,
}
static void
-gs_shell_details_refresh_screenshots (GsShellDetails *self)
+gs_details_page_refresh_screenshots (GsDetailsPage *self)
{
GPtrArray *screenshots;
AsScreenshot *ss;
@@ -643,18 +643,18 @@ gs_shell_details_refresh_screenshots (GsShellDetails *self)
gtk_list_box_select_row (GTK_LIST_BOX (list),
gtk_list_box_get_row_at_index (GTK_LIST_BOX (list), 0));
g_signal_connect (list, "row-selected",
- G_CALLBACK (gs_shell_details_screenshot_selected_cb),
+ G_CALLBACK (gs_details_page_screenshot_selected_cb),
self);
}
static void
-gs_shell_details_website_cb (GtkWidget *widget, GsShellDetails *self)
+gs_details_page_website_cb (GtkWidget *widget, GsDetailsPage *self)
{
gs_app_show_url (self->app, AS_URL_KIND_HOMEPAGE);
}
static void
-gs_shell_details_set_description (GsShellDetails *self, const gchar *tmp)
+gs_details_page_set_description (GsDetailsPage *self, const gchar *tmp)
{
GtkStyleContext *style_context;
GtkWidget *para;
@@ -704,7 +704,7 @@ gs_shell_details_set_description (GsShellDetails *self, const gchar *tmp)
}
static void
-gs_shell_details_set_sensitive (GtkWidget *widget, gboolean is_active)
+gs_details_page_set_sensitive (GtkWidget *widget, gboolean is_active)
{
GtkStyleContext *style_context;
style_context = gtk_widget_get_style_context (widget);
@@ -716,9 +716,9 @@ gs_shell_details_set_sensitive (GtkWidget *widget, gboolean is_active)
}
static gboolean
-gs_shell_details_history_cb (GtkLabel *label,
- gchar *uri,
- GsShellDetails *self)
+gs_details_page_history_cb (GtkLabel *label,
+ gchar *uri,
+ GsDetailsPage *self)
{
GtkWidget *dialog;
@@ -734,7 +734,7 @@ gs_shell_details_history_cb (GtkLabel *label,
}
static void
-gs_shell_details_refresh_all (GsShellDetails *self)
+gs_details_page_refresh_all (GsDetailsPage *self)
{
GPtrArray *history;
GdkPixbuf *pixbuf = NULL;
@@ -769,7 +769,7 @@ gs_shell_details_refresh_all (GsShellDetails *self)
/* set the description */
tmp = gs_app_get_description (self->app);
- gs_shell_details_set_description (self, tmp);
+ gs_details_page_set_description (self, tmp);
/* set the icon */
pixbuf = gs_app_get_pixbuf (self->app);
@@ -909,22 +909,22 @@ gs_shell_details_refresh_all (GsShellDetails *self)
kudos = gs_app_get_kudos (self->app);
ret = (kudos & GS_APP_KUDO_MY_LANGUAGE) > 0;
gtk_widget_set_sensitive (self->image_details_kudo_translated, ret);
- gs_shell_details_set_sensitive (self->label_details_kudo_translated, ret);
+ gs_details_page_set_sensitive (self->label_details_kudo_translated, ret);
/* set RecentRelease kudo */
ret = (kudos & GS_APP_KUDO_RECENT_RELEASE) > 0;
gtk_widget_set_sensitive (self->image_details_kudo_updated, ret);
- gs_shell_details_set_sensitive (self->label_details_kudo_updated, ret);
+ gs_details_page_set_sensitive (self->label_details_kudo_updated, ret);
/* set UserDocs kudo */
ret = (kudos & GS_APP_KUDO_INSTALLS_USER_DOCS) > 0;
gtk_widget_set_sensitive (self->image_details_kudo_docs, ret);
- gs_shell_details_set_sensitive (self->label_details_kudo_docs, ret);
+ gs_details_page_set_sensitive (self->label_details_kudo_docs, ret);
/* set sandboxed kudo */
ret = (kudos & GS_APP_KUDO_SANDBOXED) > 0;
gtk_widget_set_sensitive (self->image_details_kudo_sandboxed, ret);
- gs_shell_details_set_sensitive (self->label_details_kudo_sandboxed, ret);
+ gs_details_page_set_sensitive (self->label_details_kudo_sandboxed, ret);
/* any of the various integration kudos */
user_integration_bf = GS_APP_KUDO_SEARCH_PROVIDER |
@@ -933,7 +933,7 @@ gs_shell_details_refresh_all (GsShellDetails *self)
GS_APP_KUDO_HIGH_CONTRAST;
ret = (kudos & user_integration_bf) > 0;
gtk_widget_set_sensitive (self->image_details_kudo_integration, ret);
- gs_shell_details_set_sensitive (self->label_details_kudo_integration, ret);
+ gs_details_page_set_sensitive (self->label_details_kudo_integration, ret);
/* hide the kudo details for non-desktop software */
switch (gs_app_get_kind (self->app)) {
@@ -1002,10 +1002,10 @@ gs_shell_details_refresh_all (GsShellDetails *self)
break;
}
- gs_shell_details_update_shortcut_button (self);
+ gs_details_page_update_shortcut_button (self);
/* update progress */
- gs_shell_details_refresh_progress (self);
+ gs_details_page_refresh_progress (self);
addons = gtk_container_get_children (GTK_CONTAINER (self->list_box_addons));
gtk_widget_set_visible (self->box_addons, addons != NULL);
@@ -1035,10 +1035,10 @@ list_sort_func (GtkListBoxRow *a,
gs_app_get_name (a2));
}
-static void gs_shell_details_addon_selected_cb (GsAppAddonRow *row, GParamSpec *pspec, GsShellDetails *self);
+static void gs_details_page_addon_selected_cb (GsAppAddonRow *row, GParamSpec *pspec, GsDetailsPage *self);
static void
-gs_shell_details_refresh_addons (GsShellDetails *self)
+gs_details_page_refresh_addons (GsDetailsPage *self)
{
GPtrArray *addons;
guint i;
@@ -1060,22 +1060,22 @@ gs_shell_details_refresh_addons (GsShellDetails *self)
gtk_widget_show (row);
g_signal_connect (row, "notify::selected",
- G_CALLBACK (gs_shell_details_addon_selected_cb),
+ G_CALLBACK (gs_details_page_addon_selected_cb),
self);
}
}
-static void gs_shell_details_refresh_reviews (GsShellDetails *self);
+static void gs_details_page_refresh_reviews (GsDetailsPage *self);
typedef struct {
- GsShellDetails *self;
+ GsDetailsPage *self;
AsReview *review;
GsApp *app;
GsPluginAction action;
-} GsShellDetailsReviewHelper;
+} GsDetailsPageReviewHelper;
static void
-gs_shell_details_review_helper_free (GsShellDetailsReviewHelper *helper)
+gs_details_page_review_helper_free (GsDetailsPageReviewHelper *helper)
{
g_object_unref (helper->self);
g_object_unref (helper->review);
@@ -1083,23 +1083,23 @@ gs_shell_details_review_helper_free (GsShellDetailsReviewHelper *helper)
g_free (helper);
}
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GsShellDetailsReviewHelper, gs_shell_details_review_helper_free);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GsDetailsPageReviewHelper, gs_details_page_review_helper_free);
static void
-gs_shell_details_app_set_review_cb (GObject *source,
- GAsyncResult *res,
- gpointer user_data);
+gs_details_page_app_set_review_cb (GObject *source,
+ GAsyncResult *res,
+ gpointer user_data);
static void
-gs_shell_details_authenticate_cb (GtkDialog *dialog,
- GtkResponseType response_type,
- GsShellDetailsReviewHelper *helper)
+gs_details_page_authenticate_cb (GtkDialog *dialog,
+ GtkResponseType response_type,
+ GsDetailsPageReviewHelper *helper)
{
/* unmap the dialog */
gtk_widget_destroy (GTK_WIDGET (dialog));
if (response_type != GTK_RESPONSE_OK) {
- gs_shell_details_review_helper_free (helper);
+ gs_details_page_review_helper_free (helper);
return;
}
gs_plugin_loader_review_action_async (helper->self->plugin_loader,
@@ -1109,17 +1109,17 @@ gs_shell_details_authenticate_cb (GtkDialog *dialog,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS |
GS_PLUGIN_FAILURE_FLAGS_FATAL_ANY,
helper->self->cancellable,
- gs_shell_details_app_set_review_cb,
+ gs_details_page_app_set_review_cb,
helper);
}
static void
-gs_shell_details_app_set_review_cb (GObject *source,
- GAsyncResult *res,
- gpointer user_data)
+gs_details_page_app_set_review_cb (GObject *source,
+ GAsyncResult *res,
+ gpointer user_data)
{
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source);
- g_autoptr(GsShellDetailsReviewHelper) helper = (GsShellDetailsReviewHelper *) user_data;
+ g_autoptr(GsDetailsPageReviewHelper) helper = (GsDetailsPageReviewHelper *) user_data;
g_autoptr(GError) error = NULL;
if (!gs_plugin_loader_app_action_finish (plugin_loader, res, &error)) {
@@ -1139,7 +1139,7 @@ gs_shell_details_app_set_review_cb (GObject *source,
}
gs_shell_modal_dialog_present (helper->self->shell, GTK_DIALOG (dialog));
g_signal_connect (dialog, "response",
- G_CALLBACK (gs_shell_details_authenticate_cb),
+ G_CALLBACK (gs_details_page_authenticate_cb),
g_steal_pointer (&helper));
return;
}
@@ -1147,15 +1147,15 @@ gs_shell_details_app_set_review_cb (GObject *source,
gs_app_get_id (helper->app), error->message);
return;
}
- gs_shell_details_refresh_reviews (helper->self);
+ gs_details_page_refresh_reviews (helper->self);
}
static void
-gs_shell_details_review_button_clicked_cb (GsReviewRow *row,
- GsPluginAction action,
- GsShellDetails *self)
+gs_details_page_review_button_clicked_cb (GsReviewRow *row,
+ GsPluginAction action,
+ GsDetailsPage *self)
{
- GsShellDetailsReviewHelper *helper = g_new0 (GsShellDetailsReviewHelper, 1);
+ GsDetailsPageReviewHelper *helper = g_new0 (GsDetailsPageReviewHelper, 1);
helper->self = g_object_ref (self);
helper->app = g_object_ref (self->app);
helper->review = g_object_ref (gs_review_row_get_review (row));
@@ -1167,12 +1167,12 @@ gs_shell_details_review_button_clicked_cb (GsReviewRow *row,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS |
GS_PLUGIN_FAILURE_FLAGS_FATAL_ANY,
self->cancellable,
- gs_shell_details_app_set_review_cb,
+ gs_details_page_app_set_review_cb,
helper);
}
static void
-gs_shell_details_refresh_reviews (GsShellDetails *self)
+gs_details_page_refresh_reviews (GsDetailsPage *self)
{
GArray *review_ratings = NULL;
GPtrArray *reviews;
@@ -1267,7 +1267,7 @@ gs_shell_details_refresh_reviews (GsShellDetails *self)
guint64 actions;
g_signal_connect (row, "button-clicked",
- G_CALLBACK (gs_shell_details_review_button_clicked_cb), self);
+ G_CALLBACK (gs_details_page_review_button_clicked_cb), self);
if (as_review_get_flags (review) & AS_REVIEW_FLAG_SELF) {
actions = possible_actions & 1 << GS_PLUGIN_ACTION_REVIEW_REMOVE;
show_review_button = FALSE;
@@ -1299,12 +1299,12 @@ gs_shell_details_refresh_reviews (GsShellDetails *self)
}
static void
-gs_shell_details_app_refine2_cb (GObject *source,
+gs_details_page_app_refine2_cb (GObject *source,
GAsyncResult *res,
gpointer user_data)
{
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source);
- GsShellDetails *self = GS_SHELL_DETAILS (user_data);
+ GsDetailsPage *self = GS_DETAILS_PAGE (user_data);
g_autoptr(GError) error = NULL;
if (!gs_plugin_loader_app_refine_finish (plugin_loader, res, &error)) {
g_warning ("failed to refine %s: %s",
@@ -1312,14 +1312,14 @@ gs_shell_details_app_refine2_cb (GObject *source,
error->message);
return;
}
- gs_shell_details_refresh_reviews (self);
+ gs_details_page_refresh_reviews (self);
/* seems a good place */
gs_shell_profile_dump (self->shell);
}
static void
-gs_shell_details_app_refine2 (GsShellDetails *self)
+gs_details_page_app_refine2 (GsDetailsPage *self)
{
gs_plugin_loader_app_refine_async (self->plugin_loader, self->app,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING |
@@ -1327,12 +1327,12 @@ gs_shell_details_app_refine2 (GsShellDetails *self)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
- gs_shell_details_app_refine2_cb,
+ gs_details_page_app_refine2_cb,
self);
}
static void
-gs_shell_details_content_rating_set_css (GtkWidget *widget, guint age)
+gs_details_page_content_rating_set_css (GtkWidget *widget, guint age)
{
g_autoptr(GString) css = g_string_new (NULL);
const gchar *color_bg = NULL;
@@ -1354,7 +1354,7 @@ gs_shell_details_content_rating_set_css (GtkWidget *widget, guint age)
}
static void
-gs_shell_details_refresh_content_rating (GsShellDetails *self)
+gs_details_page_refresh_content_rating (GsDetailsPage *self)
{
AsContentRating *content_rating;
GsContentRatingSystem system;
@@ -1386,7 +1386,7 @@ gs_shell_details_refresh_content_rating (GsShellDetails *self)
gtk_button_set_label (GTK_BUTTON (self->button_details_rating_value), display);
gtk_widget_set_visible (self->button_details_rating_value, TRUE);
gtk_widget_set_visible (self->label_details_rating_title, TRUE);
- gs_shell_details_content_rating_set_css (self->button_details_rating_value, age);
+ gs_details_page_content_rating_set_css (self->button_details_rating_value, age);
} else {
gtk_widget_set_visible (self->button_details_rating_value, FALSE);
gtk_widget_set_visible (self->label_details_rating_title, FALSE);
@@ -1394,12 +1394,12 @@ gs_shell_details_refresh_content_rating (GsShellDetails *self)
}
static void
-gs_shell_details_app_refine_cb (GObject *source,
- GAsyncResult *res,
- gpointer user_data)
+gs_details_page_app_refine_cb (GObject *source,
+ GAsyncResult *res,
+ gpointer user_data)
{
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source);
- GsShellDetails *self = GS_SHELL_DETAILS (user_data);
+ GsDetailsPage *self = GS_DETAILS_PAGE (user_data);
gboolean ret;
g_autoptr(GError) error = NULL;
g_autofree gchar *app_dump = NULL;
@@ -1421,7 +1421,7 @@ gs_shell_details_app_refine_cb (GObject *source,
id = gs_app_get_id (self->app);
str = g_strdup_printf (_("Unable to find “%s”"), id == NULL ? gs_app_get_source_default
(self->app) : id);
gtk_label_set_text (GTK_LABEL (self->label_failed), str);
- gs_shell_details_set_state (self, GS_SHELL_DETAILS_STATE_FAILED);
+ gs_details_page_set_state (self, GS_DETAILS_PAGE_STATE_FAILED);
return;
}
@@ -1429,31 +1429,31 @@ gs_shell_details_app_refine_cb (GObject *source,
app_dump = gs_app_to_string (self->app);
g_debug ("%s", app_dump);
- gs_shell_details_refresh_screenshots (self);
- gs_shell_details_refresh_addons (self);
- gs_shell_details_refresh_reviews (self);
- gs_shell_details_refresh_all (self);
- gs_shell_details_refresh_content_rating (self);
- gs_shell_details_set_state (self, GS_SHELL_DETAILS_STATE_READY);
+ gs_details_page_refresh_screenshots (self);
+ gs_details_page_refresh_addons (self);
+ gs_details_page_refresh_reviews (self);
+ gs_details_page_refresh_all (self);
+ gs_details_page_refresh_content_rating (self);
+ gs_details_page_set_state (self, GS_DETAILS_PAGE_STATE_READY);
/* do 2nd stage refine */
- gs_shell_details_app_refine2 (self);
+ gs_details_page_app_refine2 (self);
}
static void
-gs_shell_details_file_to_app_cb (GObject *source,
- GAsyncResult *res,
- gpointer user_data)
+gs_details_page_file_to_app_cb (GObject *source,
+ GAsyncResult *res,
+ gpointer user_data)
{
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source);
- GsShellDetails *self = GS_SHELL_DETAILS (user_data);
+ GsDetailsPage *self = GS_DETAILS_PAGE (user_data);
g_autoptr(GError) error = NULL;
g_autofree gchar *tmp = NULL;
/* disconnect the old handlers */
if (self->app != NULL) {
- g_signal_handlers_disconnect_by_func (self->app, gs_shell_details_notify_state_changed_cb,
self);
- g_signal_handlers_disconnect_by_func (self->app, gs_shell_details_progress_changed_cb, self);
+ g_signal_handlers_disconnect_by_func (self->app, gs_details_page_notify_state_changed_cb,
self);
+ g_signal_handlers_disconnect_by_func (self->app, gs_details_page_progress_changed_cb, self);
}
/* save app */
@@ -1469,16 +1469,16 @@ gs_shell_details_file_to_app_cb (GObject *source,
}
g_signal_connect_object (self->app, "notify::state",
- G_CALLBACK (gs_shell_details_notify_state_changed_cb),
+ G_CALLBACK (gs_details_page_notify_state_changed_cb),
self, 0);
g_signal_connect_object (self->app, "notify::size",
- G_CALLBACK (gs_shell_details_notify_state_changed_cb),
+ G_CALLBACK (gs_details_page_notify_state_changed_cb),
self, 0);
g_signal_connect_object (self->app, "notify::license",
- G_CALLBACK (gs_shell_details_notify_state_changed_cb),
+ G_CALLBACK (gs_details_page_notify_state_changed_cb),
self, 0);
g_signal_connect_object (self->app, "notify::progress",
- G_CALLBACK (gs_shell_details_progress_changed_cb),
+ G_CALLBACK (gs_details_page_progress_changed_cb),
self, 0);
/* print what we've got */
@@ -1487,21 +1487,21 @@ gs_shell_details_file_to_app_cb (GObject *source,
/* change widgets */
gs_page_switch_to (GS_PAGE (self), TRUE);
- gs_shell_details_refresh_screenshots (self);
- gs_shell_details_refresh_addons (self);
- gs_shell_details_refresh_reviews (self);
- gs_shell_details_refresh_all (self);
- gs_shell_details_refresh_content_rating (self);
- gs_shell_details_set_state (self, GS_SHELL_DETAILS_STATE_READY);
+ gs_details_page_refresh_screenshots (self);
+ gs_details_page_refresh_addons (self);
+ gs_details_page_refresh_reviews (self);
+ gs_details_page_refresh_all (self);
+ gs_details_page_refresh_content_rating (self);
+ gs_details_page_set_state (self, GS_DETAILS_PAGE_STATE_READY);
/* do 2nd stage refine */
- gs_shell_details_app_refine2 (self);
+ gs_details_page_app_refine2 (self);
}
void
-gs_shell_details_set_local_file (GsShellDetails *self, GFile *file)
+gs_details_page_set_local_file (GsDetailsPage *self, GFile *file)
{
- gs_shell_details_set_state (self, GS_SHELL_DETAILS_STATE_LOADING);
+ gs_details_page_set_state (self, GS_DETAILS_PAGE_STATE_LOADING);
gs_plugin_loader_file_to_app_async (self->plugin_loader,
file,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON |
@@ -1519,14 +1519,14 @@ gs_shell_details_set_local_file (GsShellDetails *self, GFile *file)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
- gs_shell_details_file_to_app_cb,
+ gs_details_page_file_to_app_cb,
self);
}
void
-gs_shell_details_set_url (GsShellDetails *self, const gchar *url)
+gs_details_page_set_url (GsDetailsPage *self, const gchar *url)
{
- gs_shell_details_set_state (self, GS_SHELL_DETAILS_STATE_LOADING);
+ gs_details_page_set_state (self, GS_DETAILS_PAGE_STATE_LOADING);
gs_plugin_loader_url_to_app_async (self->plugin_loader,
url,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON |
@@ -1544,12 +1544,12 @@ gs_shell_details_set_url (GsShellDetails *self, const gchar *url)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
- gs_shell_details_file_to_app_cb,
+ gs_details_page_file_to_app_cb,
self);
}
static void
-gs_shell_details_load (GsShellDetails *self)
+gs_details_page_load (GsDetailsPage *self)
{
gs_plugin_loader_app_refine_async (self->plugin_loader, self->app,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON |
@@ -1568,41 +1568,41 @@ gs_shell_details_load (GsShellDetails *self)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ADDONS,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
- gs_shell_details_app_refine_cb,
+ gs_details_page_app_refine_cb,
self);
}
static void
-gs_shell_details_reload (GsPage *page)
+gs_details_page_reload (GsPage *page)
{
- GsShellDetails *self = GS_SHELL_DETAILS (page);
+ GsDetailsPage *self = GS_DETAILS_PAGE (page);
if (self->app != NULL)
- gs_shell_details_load (self);
+ gs_details_page_load (self);
}
static void
-settings_changed_cb (GsShellDetails *self,
+settings_changed_cb (GsDetailsPage *self,
const gchar *key,
gpointer data)
{
if (g_strcmp0 (key, "show-nonfree-ui") == 0) {
- gs_shell_details_refresh_all (self);
+ gs_details_page_refresh_all (self);
}
}
void
-gs_shell_details_set_app (GsShellDetails *self, GsApp *app)
+gs_details_page_set_app (GsDetailsPage *self, GsApp *app)
{
- g_return_if_fail (GS_IS_SHELL_DETAILS (self));
+ g_return_if_fail (GS_IS_DETAILS_PAGE (self));
g_return_if_fail (GS_IS_APP (app));
/* get extra details about the app */
- gs_shell_details_set_state (self, GS_SHELL_DETAILS_STATE_LOADING);
+ gs_details_page_set_state (self, GS_DETAILS_PAGE_STATE_LOADING);
/* disconnect the old handlers */
if (self->app != NULL) {
- g_signal_handlers_disconnect_by_func (self->app, gs_shell_details_notify_state_changed_cb,
self);
- g_signal_handlers_disconnect_by_func (self->app, gs_shell_details_progress_changed_cb, self);
+ g_signal_handlers_disconnect_by_func (self->app, gs_details_page_notify_state_changed_cb,
self);
+ g_signal_handlers_disconnect_by_func (self->app, gs_details_page_progress_changed_cb, self);
g_signal_handlers_disconnect_by_func (self->settings,
settings_changed_cb,
self);
@@ -1611,24 +1611,24 @@ gs_shell_details_set_app (GsShellDetails *self, GsApp *app)
g_set_object (&self->app, app);
g_signal_connect_object (self->app, "notify::state",
- G_CALLBACK (gs_shell_details_notify_state_changed_cb),
+ G_CALLBACK (gs_details_page_notify_state_changed_cb),
self, 0);
g_signal_connect_object (self->app, "notify::size",
- G_CALLBACK (gs_shell_details_notify_state_changed_cb),
+ G_CALLBACK (gs_details_page_notify_state_changed_cb),
self, 0);
g_signal_connect_object (self->app, "notify::license",
- G_CALLBACK (gs_shell_details_notify_state_changed_cb),
+ G_CALLBACK (gs_details_page_notify_state_changed_cb),
self, 0);
g_signal_connect_object (self->app, "notify::quirk",
- G_CALLBACK (gs_shell_details_notify_state_changed_cb),
+ G_CALLBACK (gs_details_page_notify_state_changed_cb),
self, 0);
g_signal_connect_object (self->app, "notify::progress",
- G_CALLBACK (gs_shell_details_progress_changed_cb),
+ G_CALLBACK (gs_details_page_progress_changed_cb),
self, 0);
- gs_shell_details_load (self);
+ gs_details_page_load (self);
/* change widgets */
- gs_shell_details_refresh_all (self);
+ gs_details_page_refresh_all (self);
g_signal_connect_swapped (self->settings, "changed",
G_CALLBACK (settings_changed_cb),
@@ -1636,13 +1636,13 @@ gs_shell_details_set_app (GsShellDetails *self, GsApp *app)
}
GsApp *
-gs_shell_details_get_app (GsShellDetails *self)
+gs_details_page_get_app (GsDetailsPage *self)
{
return self->app;
}
static void
-gs_shell_details_app_remove_button_cb (GtkWidget *widget, GsShellDetails *self)
+gs_details_page_app_remove_button_cb (GtkWidget *widget, GsDetailsPage *self)
{
g_autoptr(GCancellable) cancellable = g_cancellable_new ();
g_set_object (&self->cancellable, cancellable);
@@ -1650,14 +1650,14 @@ gs_shell_details_app_remove_button_cb (GtkWidget *widget, GsShellDetails *self)
}
static void
-gs_shell_details_app_cancel_button_cb (GtkWidget *widget, GsShellDetails *self)
+gs_details_page_app_cancel_button_cb (GtkWidget *widget, GsDetailsPage *self)
{
g_cancellable_cancel (self->cancellable);
gtk_widget_set_sensitive (widget, FALSE);
}
static void
-gs_shell_details_app_install_button_cb (GtkWidget *widget, GsShellDetails *self)
+gs_details_page_app_install_button_cb (GtkWidget *widget, GsDetailsPage *self)
{
GList *l;
g_autoptr(GList) addons = NULL;
@@ -1686,9 +1686,9 @@ gs_shell_details_app_install_button_cb (GtkWidget *widget, GsShellDetails *self)
}
static void
-gs_shell_details_addon_selected_cb (GsAppAddonRow *row,
- GParamSpec *pspec,
- GsShellDetails *self)
+gs_details_page_addon_selected_cb (GsAppAddonRow *row,
+ GParamSpec *pspec,
+ GsDetailsPage *self)
{
GsApp *addon;
@@ -1708,8 +1708,8 @@ gs_shell_details_addon_selected_cb (GsAppAddonRow *row,
gs_page_remove_app (GS_PAGE (self), addon, self->cancellable);
/* make sure the addon checkboxes are synced if the
* user clicks cancel in the remove confirmation dialog */
- gs_shell_details_refresh_addons (self);
- gs_shell_details_refresh_all (self);
+ gs_details_page_refresh_addons (self);
+ gs_details_page_refresh_all (self);
}
break;
default:
@@ -1718,7 +1718,7 @@ gs_shell_details_addon_selected_cb (GsAppAddonRow *row,
}
static void
-gs_shell_details_app_launch_button_cb (GtkWidget *widget, GsShellDetails *self)
+gs_details_page_app_launch_button_cb (GtkWidget *widget, GsDetailsPage *self)
{
g_autoptr(GCancellable) cancellable = g_cancellable_new ();
@@ -1731,8 +1731,8 @@ gs_shell_details_app_launch_button_cb (GtkWidget *widget, GsShellDetails *self)
}
static void
-gs_shell_details_app_add_shortcut_button_cb (GtkWidget *widget,
- GsShellDetails *self)
+gs_details_page_app_add_shortcut_button_cb (GtkWidget *widget,
+ GsDetailsPage *self)
{
g_autoptr(GCancellable) cancellable = g_cancellable_new ();
g_set_object (&self->cancellable, cancellable);
@@ -1740,8 +1740,8 @@ gs_shell_details_app_add_shortcut_button_cb (GtkWidget *widget,
}
static void
-gs_shell_details_app_remove_shortcut_button_cb (GtkWidget *widget,
- GsShellDetails *self)
+gs_details_page_app_remove_shortcut_button_cb (GtkWidget *widget,
+ GsDetailsPage *self)
{
g_autoptr(GCancellable) cancellable = g_cancellable_new ();
g_set_object (&self->cancellable, cancellable);
@@ -1749,14 +1749,14 @@ gs_shell_details_app_remove_shortcut_button_cb (GtkWidget *widget,
}
static void
-gs_shell_details_review_response_cb (GtkDialog *dialog,
- gint response,
- GsShellDetails *self)
+gs_details_page_review_response_cb (GtkDialog *dialog,
+ gint response,
+ GsDetailsPage *self)
{
g_autofree gchar *text = NULL;
g_autoptr(GDateTime) now = NULL;
g_autoptr(AsReview) review = NULL;
- GsShellDetailsReviewHelper *helper;
+ GsDetailsPageReviewHelper *helper;
GsReviewDialog *rdialog = GS_REVIEW_DIALOG (dialog);
/* not agreed */
@@ -1775,7 +1775,7 @@ gs_shell_details_review_response_cb (GtkDialog *dialog,
as_review_set_date (review, now);
/* call into the plugins to set the new value */
- helper = g_new0 (GsShellDetailsReviewHelper, 1);
+ helper = g_new0 (GsDetailsPageReviewHelper, 1);
helper->self = g_object_ref (self);
helper->app = g_object_ref (self->app);
helper->review = g_object_ref (review);
@@ -1787,7 +1787,7 @@ gs_shell_details_review_response_cb (GtkDialog *dialog,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS |
GS_PLUGIN_FAILURE_FLAGS_FATAL_ANY,
self->cancellable,
- gs_shell_details_app_set_review_cb,
+ gs_details_page_app_set_review_cb,
helper);
/* unmap the dialog */
@@ -1795,30 +1795,30 @@ gs_shell_details_review_response_cb (GtkDialog *dialog,
}
static void
-gs_shell_details_write_review_cb (GtkButton *button,
- GsShellDetails *self)
+gs_details_page_write_review_cb (GtkButton *button,
+ GsDetailsPage *self)
{
GtkWidget *dialog;
dialog = gs_review_dialog_new ();
g_signal_connect (dialog, "response",
- G_CALLBACK (gs_shell_details_review_response_cb), self);
+ G_CALLBACK (gs_details_page_review_response_cb), self);
gs_shell_modal_dialog_present (self->shell, GTK_DIALOG (dialog));
}
static void
-gs_shell_details_app_installed (GsPage *page, GsApp *app)
+gs_details_page_app_installed (GsPage *page, GsApp *app)
{
- gs_shell_details_reload (page);
+ gs_details_page_reload (page);
}
static void
-gs_shell_details_app_removed (GsPage *page, GsApp *app)
+gs_details_page_app_removed (GsPage *page, GsApp *app)
{
- gs_shell_details_reload (page);
+ gs_details_page_reload (page);
}
static void
-gs_shell_details_more_reviews_button_cb (GtkWidget *widget, GsShellDetails *self)
+gs_details_page_more_reviews_button_cb (GtkWidget *widget, GsDetailsPage *self)
{
gtk_container_foreach (GTK_CONTAINER (self->list_box_reviews),
(GtkCallback) gtk_widget_show, NULL);
@@ -1826,7 +1826,7 @@ gs_shell_details_more_reviews_button_cb (GtkWidget *widget, GsShellDetails *self
}
static void
-gs_shell_details_content_rating_button_cb (GtkWidget *widget, GsShellDetails *self)
+gs_details_page_content_rating_button_cb (GtkWidget *widget, GsDetailsPage *self)
{
AsContentRating *cr;
AsContentRatingValue value_bad = AS_CONTENT_RATING_VALUE_NONE;
@@ -1899,18 +1899,18 @@ gs_shell_details_content_rating_button_cb (GtkWidget *widget, GsShellDetails *se
}
static gboolean
-gs_shell_details_activate_link_cb (GtkLabel *label,
- const gchar *uri,
- GsShellDetails *self)
+gs_details_page_activate_link_cb (GtkLabel *label,
+ const gchar *uri,
+ GsDetailsPage *self)
{
gtk_show_uri (NULL, uri, GDK_CURRENT_TIME, NULL);
return TRUE;
}
static GtkWidget *
-gs_shell_details_label_widget (GsShellDetails *self,
- const gchar *title,
- const gchar *url)
+gs_details_page_label_widget (GsDetailsPage *self,
+ const gchar *title,
+ const gchar *url)
{
GtkWidget *w;
g_autofree gchar *markup = NULL;
@@ -1918,7 +1918,7 @@ gs_shell_details_label_widget (GsShellDetails *self,
markup = g_strdup_printf ("<a href=\"%s\">%s</a>", url, title);
w = gtk_label_new (markup);
g_signal_connect (w, "activate-link",
- G_CALLBACK (gs_shell_details_activate_link_cb),
+ G_CALLBACK (gs_details_page_activate_link_cb),
self);
gtk_label_set_use_markup (GTK_LABEL (w), TRUE);
gtk_label_set_xalign (GTK_LABEL (w), 0.f);
@@ -1927,12 +1927,12 @@ gs_shell_details_label_widget (GsShellDetails *self,
}
static GtkWidget *
-gs_shell_details_license_widget_for_token (GsShellDetails *self, const gchar *token)
+gs_details_page_license_widget_for_token (GsDetailsPage *self, const gchar *token)
{
/* public domain */
if (g_strcmp0 (token, "@LicenseRef-public-domain") == 0) {
/* TRANSLATORS: see the wikipedia page */
- return gs_shell_details_label_widget (self, _("Public domain"),
+ return gs_details_page_label_widget (self, _("Public domain"),
"https://en.wikipedia.org/wiki/Public_domain");
}
@@ -1948,7 +1948,7 @@ gs_shell_details_license_widget_for_token (GsShellDetails *self, const gchar *to
url = tmp + 1;
/* TRANSLATORS: see GNU page */
- return gs_shell_details_label_widget (self, _("Free Software"), url);
+ return gs_details_page_label_widget (self, _("Free Software"), url);
}
/* SPDX value */
@@ -1956,7 +1956,7 @@ gs_shell_details_license_widget_for_token (GsShellDetails *self, const gchar *to
g_autofree gchar *uri = NULL;
uri = g_strdup_printf ("http://spdx.org/licenses/%s",
token + 1);
- return gs_shell_details_label_widget (self, token + 1, uri);
+ return gs_details_page_label_widget (self, token + 1, uri);
}
/* new SPDX value the extractor didn't know about */
@@ -1964,7 +1964,7 @@ gs_shell_details_license_widget_for_token (GsShellDetails *self, const gchar *to
g_autofree gchar *uri = NULL;
uri = g_strdup_printf ("http://spdx.org/licenses/%s",
token);
- return gs_shell_details_label_widget (self, token, uri);
+ return gs_details_page_label_widget (self, token, uri);
}
/* nothing to show */
@@ -1972,7 +1972,7 @@ gs_shell_details_license_widget_for_token (GsShellDetails *self, const gchar *to
}
static void
-gs_shell_details_license_free_cb (GtkWidget *widget, GsShellDetails *self)
+gs_details_page_license_free_cb (GtkWidget *widget, GsDetailsPage *self)
{
guint cnt = 0;
guint i;
@@ -1993,7 +1993,7 @@ gs_shell_details_license_free_cb (GtkWidget *widget, GsShellDetails *self)
continue;
/* add widget */
- w = gs_shell_details_license_widget_for_token (self, tokens[i]);
+ w = gs_details_page_license_widget_for_token (self, tokens[i]);
if (w == NULL)
continue;
gtk_container_add (GTK_CONTAINER (self->box_details_license_list), w);
@@ -2014,7 +2014,7 @@ gs_shell_details_license_free_cb (GtkWidget *widget, GsShellDetails *self)
}
static void
-gs_shell_details_license_nonfree_cb (GtkWidget *widget, GsShellDetails *self)
+gs_details_page_license_nonfree_cb (GtkWidget *widget, GsDetailsPage *self)
{
g_autofree gchar *str = NULL;
g_autofree gchar *uri = NULL;
@@ -2027,31 +2027,31 @@ gs_shell_details_license_nonfree_cb (GtkWidget *widget, GsShellDetails *self)
}
static void
-gs_shell_details_license_unknown_cb (GtkWidget *widget, GsShellDetails *self)
+gs_details_page_license_unknown_cb (GtkWidget *widget, GsDetailsPage *self)
{
gtk_widget_show (self->popover_license_unknown);
}
static void
-gs_shell_details_network_available_notify_cb (GsPluginLoader *plugin_loader,
- GParamSpec *pspec,
- GsShellDetails *self)
+gs_details_page_network_available_notify_cb (GsPluginLoader *plugin_loader,
+ GParamSpec *pspec,
+ GsDetailsPage *self)
{
- gs_shell_details_refresh_reviews (self);
+ gs_details_page_refresh_reviews (self);
}
static gboolean
-gs_shell_details_setup (GsPage *page,
- GsShell *shell,
- GsPluginLoader *plugin_loader,
- GtkBuilder *builder,
- GCancellable *cancellable,
- GError **error)
+gs_details_page_setup (GsPage *page,
+ GsShell *shell,
+ GsPluginLoader *plugin_loader,
+ GtkBuilder *builder,
+ GCancellable *cancellable,
+ GError **error)
{
- GsShellDetails *self = GS_SHELL_DETAILS (page);
+ GsDetailsPage *self = GS_DETAILS_PAGE (page);
GtkAdjustment *adj;
- g_return_val_if_fail (GS_IS_SHELL_DETAILS (self), TRUE);
+ g_return_val_if_fail (GS_IS_DETAILS_PAGE (self), TRUE);
self->shell = shell;
@@ -2064,56 +2064,56 @@ gs_shell_details_setup (GsPage *page,
gs_plugin_loader_get_plugin_supported (plugin_loader,
"gs_plugin_review_submit");
g_signal_connect (self->button_review, "clicked",
- G_CALLBACK (gs_shell_details_write_review_cb),
+ G_CALLBACK (gs_details_page_write_review_cb),
self);
/* hide some UI when offline */
g_signal_connect_object (self->plugin_loader, "notify::network-available",
- G_CALLBACK (gs_shell_details_network_available_notify_cb),
+ G_CALLBACK (gs_details_page_network_available_notify_cb),
self, 0);
/* setup details */
g_signal_connect (self->button_install, "clicked",
- G_CALLBACK (gs_shell_details_app_install_button_cb),
+ G_CALLBACK (gs_details_page_app_install_button_cb),
self);
g_signal_connect (self->button_remove, "clicked",
- G_CALLBACK (gs_shell_details_app_remove_button_cb),
+ G_CALLBACK (gs_details_page_app_remove_button_cb),
self);
g_signal_connect (self->button_cancel, "clicked",
- G_CALLBACK (gs_shell_details_app_cancel_button_cb),
+ G_CALLBACK (gs_details_page_app_cancel_button_cb),
self);
g_signal_connect (self->button_more_reviews, "clicked",
- G_CALLBACK (gs_shell_details_more_reviews_button_cb),
+ G_CALLBACK (gs_details_page_more_reviews_button_cb),
self);
g_signal_connect (self->button_details_rating_value, "clicked",
- G_CALLBACK (gs_shell_details_content_rating_button_cb),
+ G_CALLBACK (gs_details_page_content_rating_button_cb),
self);
g_signal_connect (self->label_details_updated_value, "activate-link",
- G_CALLBACK (gs_shell_details_history_cb),
+ G_CALLBACK (gs_details_page_history_cb),
self);
g_signal_connect (self->button_details_launch, "clicked",
- G_CALLBACK (gs_shell_details_app_launch_button_cb),
+ G_CALLBACK (gs_details_page_app_launch_button_cb),
self);
g_signal_connect (self->button_details_add_shortcut, "clicked",
- G_CALLBACK (gs_shell_details_app_add_shortcut_button_cb),
+ G_CALLBACK (gs_details_page_app_add_shortcut_button_cb),
self);
g_signal_connect (self->button_details_remove_shortcut, "clicked",
- G_CALLBACK (gs_shell_details_app_remove_shortcut_button_cb),
+ G_CALLBACK (gs_details_page_app_remove_shortcut_button_cb),
self);
g_signal_connect (self->button_details_website, "clicked",
- G_CALLBACK (gs_shell_details_website_cb),
+ G_CALLBACK (gs_details_page_website_cb),
self);
g_signal_connect (self->button_details_license_free, "clicked",
- G_CALLBACK (gs_shell_details_license_free_cb),
+ G_CALLBACK (gs_details_page_license_free_cb),
self);
g_signal_connect (self->button_details_license_nonfree, "clicked",
- G_CALLBACK (gs_shell_details_license_nonfree_cb),
+ G_CALLBACK (gs_details_page_license_nonfree_cb),
self);
g_signal_connect (self->button_details_license_unknown, "clicked",
- G_CALLBACK (gs_shell_details_license_unknown_cb),
+ G_CALLBACK (gs_details_page_license_unknown_cb),
self);
g_signal_connect (self->label_license_nonfree_details, "activate-link",
- G_CALLBACK (gs_shell_details_activate_link_cb),
+ G_CALLBACK (gs_details_page_activate_link_cb),
self);
adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (self->scrolledwindow_details));
@@ -2122,13 +2122,13 @@ gs_shell_details_setup (GsPage *page,
}
static void
-gs_shell_details_dispose (GObject *object)
+gs_details_page_dispose (GObject *object)
{
- GsShellDetails *self = GS_SHELL_DETAILS (object);
+ GsDetailsPage *self = GS_DETAILS_PAGE (object);
if (self->app != NULL) {
- g_signal_handlers_disconnect_by_func (self->app, gs_shell_details_notify_state_changed_cb,
self);
- g_signal_handlers_disconnect_by_func (self->app, gs_shell_details_progress_changed_cb, self);
+ g_signal_handlers_disconnect_by_func (self->app, gs_details_page_notify_state_changed_cb,
self);
+ g_signal_handlers_disconnect_by_func (self->app, gs_details_page_progress_changed_cb, self);
g_clear_object (&self->app);
}
g_clear_object (&self->builder);
@@ -2136,107 +2136,107 @@ gs_shell_details_dispose (GObject *object)
g_clear_object (&self->cancellable);
g_clear_object (&self->session);
- G_OBJECT_CLASS (gs_shell_details_parent_class)->dispose (object);
+ G_OBJECT_CLASS (gs_details_page_parent_class)->dispose (object);
}
static void
-gs_shell_details_class_init (GsShellDetailsClass *klass)
+gs_details_page_class_init (GsDetailsPageClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GsPageClass *page_class = GS_PAGE_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- object_class->dispose = gs_shell_details_dispose;
- page_class->app_installed = gs_shell_details_app_installed;
- page_class->app_removed = gs_shell_details_app_removed;
- page_class->switch_to = gs_shell_details_switch_to;
- page_class->reload = gs_shell_details_reload;
- page_class->setup = gs_shell_details_setup;
-
- gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-shell-details.ui");
-
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, application_details_icon);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, application_details_summary);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, application_details_title);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, box_addons);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, box_details);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, box_details_description);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, box_progress);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, star);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_review_count);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, box_details_screenshot);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, box_details_screenshot_main);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails,
box_details_screenshot_thumbnails);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, box_details_license_list);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, button_details_launch);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, button_details_add_shortcut);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, button_details_remove_shortcut);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, button_details_website);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, button_install);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, button_remove);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, button_cancel);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, button_more_reviews);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, infobar_details_app_norepo);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, infobar_details_app_repo);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, infobar_details_package_baseos);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, infobar_details_repo);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_addons_uninstalled_app);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_progress_percentage);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_progress_status);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_category_title);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_category_value);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_developer_title);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_developer_value);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, button_details_license_free);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, button_details_license_nonfree);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, button_details_license_unknown);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_origin_title);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_origin_value);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails,
label_details_size_download_title);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails,
label_details_size_download_value);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails,
label_details_size_installed_title);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails,
label_details_size_installed_value);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_updated_value);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_version_value);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_failed);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_pending);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, list_box_addons);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, box_reviews);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, box_details_screenshot_fallback);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, histogram);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, button_review);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, list_box_reviews);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, scrolledwindow_details);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, spinner_details);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, spinner_remove);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, stack_details);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, grid_details_kudo);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, image_details_kudo_docs);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, image_details_kudo_sandboxed);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, image_details_kudo_integration);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, image_details_kudo_translated);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, image_details_kudo_updated);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_kudo_docs);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_kudo_sandboxed);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_kudo_integration);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_kudo_translated);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_kudo_updated);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, progressbar_top);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, popover_license_free);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, popover_license_nonfree);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, popover_license_unknown);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_license_nonfree_details);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_licenses_intro);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, popover_content_rating);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_content_rating_title);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_content_rating_message);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_content_rating_none);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, button_details_rating_value);
- gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_rating_title);
+ object_class->dispose = gs_details_page_dispose;
+ page_class->app_installed = gs_details_page_app_installed;
+ page_class->app_removed = gs_details_page_app_removed;
+ page_class->switch_to = gs_details_page_switch_to;
+ page_class->reload = gs_details_page_reload;
+ page_class->setup = gs_details_page_setup;
+
+ gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-details-page.ui");
+
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, application_details_icon);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, application_details_summary);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, application_details_title);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_addons);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_details);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_details_description);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_progress);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, star);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_review_count);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_details_screenshot);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_details_screenshot_main);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_details_screenshot_thumbnails);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_details_license_list);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_details_launch);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_details_add_shortcut);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_details_remove_shortcut);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_details_website);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_install);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_remove);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_cancel);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_more_reviews);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, infobar_details_app_norepo);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, infobar_details_app_repo);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, infobar_details_package_baseos);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, infobar_details_repo);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_addons_uninstalled_app);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_progress_percentage);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_progress_status);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_category_title);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_category_value);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_developer_title);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_developer_value);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_details_license_free);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_details_license_nonfree);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_details_license_unknown);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_origin_title);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_origin_value);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_size_download_title);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_size_download_value);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage,
label_details_size_installed_title);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage,
label_details_size_installed_value);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_updated_value);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_version_value);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_failed);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_pending);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, list_box_addons);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_reviews);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_details_screenshot_fallback);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, histogram);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_review);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, list_box_reviews);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, scrolledwindow_details);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, spinner_details);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, spinner_remove);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, stack_details);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, grid_details_kudo);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_kudo_docs);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_kudo_sandboxed);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_kudo_integration);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_kudo_translated);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_kudo_updated);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_kudo_docs);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_kudo_sandboxed);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_kudo_integration);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_kudo_translated);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_kudo_updated);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, progressbar_top);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, popover_license_free);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, popover_license_nonfree);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, popover_license_unknown);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_license_nonfree_details);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_licenses_intro);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, popover_content_rating);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_content_rating_title);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_content_rating_message);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_content_rating_none);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, button_details_rating_value);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_rating_title);
}
static void
-gs_shell_details_init (GsShellDetails *self)
+gs_details_page_init (GsDetailsPage *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
@@ -2253,12 +2253,12 @@ gs_shell_details_init (GsShellDetails *self)
self, NULL);
}
-GsShellDetails *
-gs_shell_details_new (void)
+GsDetailsPage *
+gs_details_page_new (void)
{
- GsShellDetails *self;
- self = g_object_new (GS_TYPE_SHELL_DETAILS, NULL);
- return GS_SHELL_DETAILS (self);
+ GsDetailsPage *self;
+ self = g_object_new (GS_TYPE_DETAILS_PAGE, NULL);
+ return GS_DETAILS_PAGE (self);
}
/* vim: set noexpandtab: */
diff --git a/src/gs-shell-details.h b/src/gs-details-page.h
similarity index 69%
rename from src/gs-shell-details.h
rename to src/gs-details-page.h
index 8cfa5fb..0a4056e 100644
--- a/src/gs-shell-details.h
+++ b/src/gs-details-page.h
@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __GS_SHELL_DETAILS_H
-#define __GS_SHELL_DETAILS_H
+#ifndef __GS_DETAILS_PAGE_H
+#define __GS_DETAILS_PAGE_H
#include <glib-object.h>
#include <gtk/gtk.h>
@@ -32,21 +32,21 @@
G_BEGIN_DECLS
-#define GS_TYPE_SHELL_DETAILS (gs_shell_details_get_type ())
+#define GS_TYPE_DETAILS_PAGE (gs_details_page_get_type ())
-G_DECLARE_FINAL_TYPE (GsShellDetails, gs_shell_details, GS, SHELL_DETAILS, GsPage)
+G_DECLARE_FINAL_TYPE (GsDetailsPage, gs_details_page, GS, DETAILS_PAGE, GsPage)
-GsShellDetails *gs_shell_details_new (void);
-void gs_shell_details_set_app (GsShellDetails *self,
+GsDetailsPage *gs_details_page_new (void);
+void gs_details_page_set_app (GsDetailsPage *self,
GsApp *app);
-void gs_shell_details_set_local_file(GsShellDetails *self,
+void gs_details_page_set_local_file(GsDetailsPage *self,
GFile *file);
-void gs_shell_details_set_url (GsShellDetails *self,
+void gs_details_page_set_url (GsDetailsPage *self,
const gchar *url);
-GsApp *gs_shell_details_get_app (GsShellDetails *self);
+GsApp *gs_details_page_get_app (GsDetailsPage *self);
G_END_DECLS
-#endif /* __GS_SHELL_DETAILS_H */
+#endif /* __GS_DETAILS_PAGE_H */
/* vim: set noexpandtab: */
diff --git a/src/gs-shell-details.ui b/src/gs-details-page.ui
similarity index 99%
rename from src/gs-shell-details.ui
rename to src/gs-details-page.ui
index ea81c61..cacd1a0 100644
--- a/src/gs-shell-details.ui
+++ b/src/gs-details-page.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.10"/>
- <template class="GsShellDetails" parent="GsPage">
+ <template class="GsDetailsPage" parent="GsPage">
<child internal-child="accessible">
<object class="AtkObject" id="details-accessible">
<property name="accessible-name" translatable="yes">Details page</property>
diff --git a/src/gs-shell-extras.c b/src/gs-extras-page.c
similarity index 81%
rename from src/gs-shell-extras.c
rename to src/gs-extras-page.c
index 95aa0cf..bf9daaa 100644
--- a/src/gs-shell-extras.c
+++ b/src/gs-extras-page.c
@@ -21,7 +21,7 @@
#include "config.h"
-#include "gs-shell-extras.h"
+#include "gs-extras-page.h"
#include "gs-app.h"
#include "gs-app-row.h"
@@ -33,11 +33,11 @@
#include <glib/gi18n.h>
typedef enum {
- GS_SHELL_EXTRAS_STATE_LOADING,
- GS_SHELL_EXTRAS_STATE_READY,
- GS_SHELL_EXTRAS_STATE_NO_RESULTS,
- GS_SHELL_EXTRAS_STATE_FAILED
-} GsShellExtrasState;
+ GS_EXTRAS_PAGE_STATE_LOADING,
+ GS_EXTRAS_PAGE_STATE_READY,
+ GS_EXTRAS_PAGE_STATE_NO_RESULTS,
+ GS_EXTRAS_PAGE_STATE_FAILED
+} GsExtrasPageState;
typedef struct {
gchar *title;
@@ -45,10 +45,10 @@ typedef struct {
gchar *search_filename;
gchar *package_filename;
gchar *url_not_found;
- GsShellExtras *self;
+ GsExtrasPage *self;
} SearchData;
-struct _GsShellExtras
+struct _GsExtrasPage
{
GsPage parent_instance;
@@ -56,12 +56,12 @@ struct _GsShellExtras
GtkBuilder *builder;
GCancellable *search_cancellable;
GsShell *shell;
- GsShellExtrasState state;
+ GsExtrasPageState state;
GtkSizeGroup *sizegroup_image;
GtkSizeGroup *sizegroup_name;
GtkSizeGroup *sizegroup_button;
GPtrArray *array_search_data;
- GsShellExtrasMode mode;
+ GsExtrasPageMode mode;
GsLanguage *language;
GsVendor *vendor;
guint pending_search_cnt;
@@ -74,7 +74,7 @@ struct _GsShellExtras
GtkWidget *stack;
};
-G_DEFINE_TYPE (GsShellExtras, gs_shell_extras, GS_TYPE_PAGE)
+G_DEFINE_TYPE (GsExtrasPage, gs_extras_page, GS_TYPE_PAGE)
static void
search_data_free (SearchData *search_data)
@@ -89,47 +89,47 @@ search_data_free (SearchData *search_data)
g_slice_free (SearchData, search_data);
}
-static GsShellExtrasMode
-gs_shell_extras_mode_from_string (const gchar *str)
+static GsExtrasPageMode
+gs_extras_page_mode_from_string (const gchar *str)
{
if (g_strcmp0 (str, "install-package-files") == 0)
- return GS_SHELL_EXTRAS_MODE_INSTALL_PACKAGE_FILES;
+ return GS_EXTRAS_PAGE_MODE_INSTALL_PACKAGE_FILES;
if (g_strcmp0 (str, "install-provide-files") == 0)
- return GS_SHELL_EXTRAS_MODE_INSTALL_PROVIDE_FILES;
+ return GS_EXTRAS_PAGE_MODE_INSTALL_PROVIDE_FILES;
if (g_strcmp0 (str, "install-package-names") == 0)
- return GS_SHELL_EXTRAS_MODE_INSTALL_PACKAGE_NAMES;
+ return GS_EXTRAS_PAGE_MODE_INSTALL_PACKAGE_NAMES;
if (g_strcmp0 (str, "install-mime-types") == 0)
- return GS_SHELL_EXTRAS_MODE_INSTALL_MIME_TYPES;
+ return GS_EXTRAS_PAGE_MODE_INSTALL_MIME_TYPES;
if (g_strcmp0 (str, "install-fontconfig-resources") == 0)
- return GS_SHELL_EXTRAS_MODE_INSTALL_FONTCONFIG_RESOURCES;
+ return GS_EXTRAS_PAGE_MODE_INSTALL_FONTCONFIG_RESOURCES;
if (g_strcmp0 (str, "install-gstreamer-resources") == 0)
- return GS_SHELL_EXTRAS_MODE_INSTALL_GSTREAMER_RESOURCES;
+ return GS_EXTRAS_PAGE_MODE_INSTALL_GSTREAMER_RESOURCES;
if (g_strcmp0 (str, "install-plasma-resources") == 0)
- return GS_SHELL_EXTRAS_MODE_INSTALL_PLASMA_RESOURCES;
+ return GS_EXTRAS_PAGE_MODE_INSTALL_PLASMA_RESOURCES;
if (g_strcmp0 (str, "install-printer-drivers") == 0)
- return GS_SHELL_EXTRAS_MODE_INSTALL_PRINTER_DRIVERS;
+ return GS_EXTRAS_PAGE_MODE_INSTALL_PRINTER_DRIVERS;
g_assert_not_reached ();
}
const gchar *
-gs_shell_extras_mode_to_string (GsShellExtrasMode mode)
+gs_extras_page_mode_to_string (GsExtrasPageMode mode)
{
- if (mode == GS_SHELL_EXTRAS_MODE_INSTALL_PACKAGE_FILES)
+ if (mode == GS_EXTRAS_PAGE_MODE_INSTALL_PACKAGE_FILES)
return "install-package-files";
- if (mode == GS_SHELL_EXTRAS_MODE_INSTALL_PROVIDE_FILES)
+ if (mode == GS_EXTRAS_PAGE_MODE_INSTALL_PROVIDE_FILES)
return "install-provide-files";
- if (mode == GS_SHELL_EXTRAS_MODE_INSTALL_PACKAGE_NAMES)
+ if (mode == GS_EXTRAS_PAGE_MODE_INSTALL_PACKAGE_NAMES)
return "install-package-names";
- if (mode == GS_SHELL_EXTRAS_MODE_INSTALL_MIME_TYPES)
+ if (mode == GS_EXTRAS_PAGE_MODE_INSTALL_MIME_TYPES)
return "install-mime-types";
- if (mode == GS_SHELL_EXTRAS_MODE_INSTALL_FONTCONFIG_RESOURCES)
+ if (mode == GS_EXTRAS_PAGE_MODE_INSTALL_FONTCONFIG_RESOURCES)
return "install-fontconfig-resources";
- if (mode == GS_SHELL_EXTRAS_MODE_INSTALL_GSTREAMER_RESOURCES)
+ if (mode == GS_EXTRAS_PAGE_MODE_INSTALL_GSTREAMER_RESOURCES)
return "install-gstreamer-resources";
- if (mode == GS_SHELL_EXTRAS_MODE_INSTALL_PLASMA_RESOURCES)
+ if (mode == GS_EXTRAS_PAGE_MODE_INSTALL_PLASMA_RESOURCES)
return "install-plasma-resources";
- if (mode == GS_SHELL_EXTRAS_MODE_INSTALL_PRINTER_DRIVERS)
+ if (mode == GS_EXTRAS_PAGE_MODE_INSTALL_PRINTER_DRIVERS)
return "install-printer-drivers";
g_assert_not_reached ();
@@ -151,7 +151,7 @@ build_comma_separated_list (gchar **items)
}
static gchar *
-build_title (GsShellExtras *self)
+build_title (GsExtrasPage *self)
{
guint i;
g_autofree gchar *titles = NULL;
@@ -169,7 +169,7 @@ build_title (GsShellExtras *self)
titles = build_comma_separated_list ((gchar **) title_array->pdata);
switch (self->mode) {
- case GS_SHELL_EXTRAS_MODE_INSTALL_FONTCONFIG_RESOURCES:
+ case GS_EXTRAS_PAGE_MODE_INSTALL_FONTCONFIG_RESOURCES:
/* TRANSLATORS: Application window title for fonts installation.
%s will be replaced by name of the script we're searching for. */
return g_strdup_printf (ngettext ("Available fonts for the %s script",
@@ -189,7 +189,7 @@ build_title (GsShellExtras *self)
}
static void
-gs_shell_extras_update_ui_state (GsShellExtras *self)
+gs_extras_page_update_ui_state (GsExtrasPage *self)
{
GtkWidget *widget;
g_autofree gchar *title = NULL;
@@ -199,12 +199,12 @@ gs_shell_extras_update_ui_state (GsShellExtras *self)
/* main spinner */
switch (self->state) {
- case GS_SHELL_EXTRAS_STATE_LOADING:
+ case GS_EXTRAS_PAGE_STATE_LOADING:
gs_start_spinner (GTK_SPINNER (self->spinner));
break;
- case GS_SHELL_EXTRAS_STATE_READY:
- case GS_SHELL_EXTRAS_STATE_NO_RESULTS:
- case GS_SHELL_EXTRAS_STATE_FAILED:
+ case GS_EXTRAS_PAGE_STATE_READY:
+ case GS_EXTRAS_PAGE_STATE_NO_RESULTS:
+ case GS_EXTRAS_PAGE_STATE_FAILED:
gs_stop_spinner (GTK_SPINNER (self->spinner));
break;
default:
@@ -215,13 +215,13 @@ gs_shell_extras_update_ui_state (GsShellExtras *self)
/* headerbar title */
widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "application_details_header"));
switch (self->state) {
- case GS_SHELL_EXTRAS_STATE_LOADING:
- case GS_SHELL_EXTRAS_STATE_READY:
+ case GS_EXTRAS_PAGE_STATE_LOADING:
+ case GS_EXTRAS_PAGE_STATE_READY:
title = build_title (self);
gtk_label_set_label (GTK_LABEL (widget), title);
break;
- case GS_SHELL_EXTRAS_STATE_NO_RESULTS:
- case GS_SHELL_EXTRAS_STATE_FAILED:
+ case GS_EXTRAS_PAGE_STATE_NO_RESULTS:
+ case GS_EXTRAS_PAGE_STATE_FAILED:
gtk_label_set_label (GTK_LABEL (widget), _("Unable to Find Requested Software"));
break;
default:
@@ -231,16 +231,16 @@ gs_shell_extras_update_ui_state (GsShellExtras *self)
/* stack */
switch (self->state) {
- case GS_SHELL_EXTRAS_STATE_LOADING:
+ case GS_EXTRAS_PAGE_STATE_LOADING:
gtk_stack_set_visible_child_name (GTK_STACK (self->stack), "spinner");
break;
- case GS_SHELL_EXTRAS_STATE_READY:
+ case GS_EXTRAS_PAGE_STATE_READY:
gtk_stack_set_visible_child_name (GTK_STACK (self->stack), "results");
break;
- case GS_SHELL_EXTRAS_STATE_NO_RESULTS:
+ case GS_EXTRAS_PAGE_STATE_NO_RESULTS:
gtk_stack_set_visible_child_name (GTK_STACK (self->stack), "no-results");
break;
- case GS_SHELL_EXTRAS_STATE_FAILED:
+ case GS_EXTRAS_PAGE_STATE_FAILED:
gtk_stack_set_visible_child_name (GTK_STACK (self->stack), "failed");
break;
default:
@@ -250,16 +250,16 @@ gs_shell_extras_update_ui_state (GsShellExtras *self)
}
static void
-gs_shell_extras_set_state (GsShellExtras *self,
- GsShellExtrasState state)
+gs_extras_page_set_state (GsExtrasPage *self,
+ GsExtrasPageState state)
{
self->state = state;
- gs_shell_extras_update_ui_state (self);
+ gs_extras_page_update_ui_state (self);
}
static void
app_row_button_clicked_cb (GsAppRow *app_row,
- GsShellExtras *self)
+ GsExtrasPage *self)
{
GsApp *app;
app = gs_app_row_get_app (app_row);
@@ -274,7 +274,7 @@ app_row_button_clicked_cb (GsAppRow *app_row,
}
static void
-gs_shell_extras_add_app (GsShellExtras *self, GsApp *app, SearchData *search_data)
+gs_extras_page_add_app (GsExtrasPage *self, GsApp *app, SearchData *search_data)
{
GtkWidget *app_row;
GList *l;
@@ -311,7 +311,7 @@ gs_shell_extras_add_app (GsShellExtras *self, GsApp *app, SearchData *search_dat
static GsApp *
create_missing_app (SearchData *search_data)
{
- GsShellExtras *self = search_data->self;
+ GsExtrasPage *self = search_data->self;
GsApp *app;
GString *summary_missing;
g_autofree gchar *name = NULL;
@@ -328,7 +328,7 @@ create_missing_app (SearchData *search_data)
summary_missing = g_string_new ("");
switch (self->mode) {
- case GS_SHELL_EXTRAS_MODE_INSTALL_PACKAGE_FILES:
+ case GS_EXTRAS_PAGE_MODE_INSTALL_PACKAGE_FILES:
/* TRANSLATORS: this is when we know about an application or
* addon, but it can't be listed for some reason */
g_string_append_printf (summary_missing, _("No applications are available that provide the
file %s."), search_data->title);
@@ -339,7 +339,7 @@ create_missing_app (SearchData *search_data)
"for how to get missing applications "
"might be found %s."), search_data->title, url);
break;
- case GS_SHELL_EXTRAS_MODE_INSTALL_PROVIDE_FILES:
+ case GS_EXTRAS_PAGE_MODE_INSTALL_PROVIDE_FILES:
/* TRANSLATORS: this is when we know about an application or
* addon, but it can't be listed for some reason */
g_string_append_printf (summary_missing, _("No applications are available for %s support."),
search_data->title);
@@ -350,7 +350,7 @@ create_missing_app (SearchData *search_data)
"for how to get missing applications "
"might be found %s."), search_data->title, url);
break;
- case GS_SHELL_EXTRAS_MODE_INSTALL_PACKAGE_NAMES:
+ case GS_EXTRAS_PAGE_MODE_INSTALL_PACKAGE_NAMES:
/* TRANSLATORS: this is when we know about an application or
* addon, but it can't be listed for some reason */
g_string_append_printf (summary_missing, _("%s is not available."), search_data->title);
@@ -361,7 +361,7 @@ create_missing_app (SearchData *search_data)
"for how to get missing applications "
"might be found %s."), search_data->title, url);
break;
- case GS_SHELL_EXTRAS_MODE_INSTALL_MIME_TYPES:
+ case GS_EXTRAS_PAGE_MODE_INSTALL_MIME_TYPES:
/* TRANSLATORS: this is when we know about an application or
* addon, but it can't be listed for some reason */
g_string_append_printf (summary_missing, _("No applications are available for %s support."),
search_data->title);
@@ -372,7 +372,7 @@ create_missing_app (SearchData *search_data)
"for how to get an application that can support this format "
"might be found %s."), search_data->title, url);
break;
- case GS_SHELL_EXTRAS_MODE_INSTALL_FONTCONFIG_RESOURCES:
+ case GS_EXTRAS_PAGE_MODE_INSTALL_FONTCONFIG_RESOURCES:
/* TRANSLATORS: this is when we know about an application or
* addon, but it can't be listed for some reason */
g_string_append_printf (summary_missing, _("No fonts are available for the %s script
support."), search_data->title);
@@ -383,7 +383,7 @@ create_missing_app (SearchData *search_data)
"for how to get additional fonts "
"might be found %s."), search_data->title, url);
break;
- case GS_SHELL_EXTRAS_MODE_INSTALL_GSTREAMER_RESOURCES:
+ case GS_EXTRAS_PAGE_MODE_INSTALL_GSTREAMER_RESOURCES:
/* TRANSLATORS: this is when we know about an application or
* addon, but it can't be listed for some reason */
g_string_append_printf (summary_missing, _("No addon codecs are available for the %s
format."), search_data->title);
@@ -394,7 +394,7 @@ create_missing_app (SearchData *search_data)
"for how to get a codec that can play this format "
"might be found %s."), search_data->title, url);
break;
- case GS_SHELL_EXTRAS_MODE_INSTALL_PLASMA_RESOURCES:
+ case GS_EXTRAS_PAGE_MODE_INSTALL_PLASMA_RESOURCES:
/* TRANSLATORS: this is when we know about an application or
* addon, but it can't be listed for some reason */
g_string_append_printf (summary_missing, _("No Plasma resources are available for %s
support."), search_data->title);
@@ -405,7 +405,7 @@ create_missing_app (SearchData *search_data)
"for how to get additional Plasma resources "
"might be found %s."), search_data->title, url);
break;
- case GS_SHELL_EXTRAS_MODE_INSTALL_PRINTER_DRIVERS:
+ case GS_EXTRAS_PAGE_MODE_INSTALL_PRINTER_DRIVERS:
/* TRANSLATORS: this is when we know about an application or
* addon, but it can't be listed for some reason */
g_string_append_printf (summary_missing, _("No printer drivers are available for %s."),
search_data->title);
@@ -431,7 +431,7 @@ create_missing_app (SearchData *search_data)
}
static gchar *
-build_no_results_label (GsShellExtras *self)
+build_no_results_label (GsExtrasPage *self)
{
GList *l;
GsApp *app = NULL;
@@ -469,7 +469,7 @@ build_no_results_label (GsShellExtras *self)
}
static void
-show_search_results (GsShellExtras *self)
+show_search_results (GsExtrasPage *self)
{
GsApp *app;
GList *l;
@@ -496,8 +496,7 @@ show_search_results (GsShellExtras *self)
g_debug ("extras: failed to find any results, %u", n_missing);
str = build_no_results_label (self);
gtk_label_set_label (GTK_LABEL (self->label_no_results), str);
- gs_shell_extras_set_state (self,
- GS_SHELL_EXTRAS_STATE_NO_RESULTS);
+ gs_extras_page_set_state (self, GS_EXTRAS_PAGE_STATE_NO_RESULTS);
} else if (n_children == 1) {
/* switch directly to details view */
g_debug ("extras: found one result, showing in details view");
@@ -507,8 +506,7 @@ show_search_results (GsShellExtras *self)
} else {
/* show what we got */
g_debug ("extras: got %u search results, showing", n_children);
- gs_shell_extras_set_state (self,
- GS_SHELL_EXTRAS_STATE_READY);
+ gs_extras_page_set_state (self, GS_EXTRAS_PAGE_STATE_READY);
}
/* seems a good place */
@@ -521,7 +519,7 @@ search_files_cb (GObject *source_object,
gpointer user_data)
{
SearchData *search_data = (SearchData *) user_data;
- GsShellExtras *self = search_data->self;
+ GsExtrasPage *self = search_data->self;
g_autoptr(GsAppList) list = NULL;
guint i;
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
@@ -537,7 +535,7 @@ search_files_cb (GObject *source_object,
g_warning ("failed to find any search results: %s", error->message);
str = g_strdup_printf ("%s: %s", _("Failed to find any search results"), error->message);
gtk_label_set_label (GTK_LABEL (self->label_failed), str);
- gs_shell_extras_set_state (self, GS_SHELL_EXTRAS_STATE_FAILED);
+ gs_extras_page_set_state (self, GS_EXTRAS_PAGE_STATE_FAILED);
return;
}
@@ -554,7 +552,7 @@ search_files_cb (GObject *source_object,
GsApp *app = gs_app_list_index (list, i);
g_debug ("%s\n\n", gs_app_to_string (app));
- gs_shell_extras_add_app (self, app, search_data);
+ gs_extras_page_add_app (self, app, search_data);
}
self->pending_search_cnt--;
@@ -570,7 +568,7 @@ file_to_app_cb (GObject *source_object,
gpointer user_data)
{
SearchData *search_data = (SearchData *) user_data;
- GsShellExtras *self = search_data->self;
+ GsExtrasPage *self = search_data->self;
GsApp *app;
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
g_autoptr(GError) error = NULL;
@@ -592,14 +590,13 @@ file_to_app_cb (GObject *source_object,
g_warning ("failed to find any search results: %s", error->message);
str = g_strdup_printf ("%s: %s", _("Failed to find any search results"),
error->message);
gtk_label_set_label (GTK_LABEL (self->label_failed), str);
- gs_shell_extras_set_state (self,
- GS_SHELL_EXTRAS_STATE_FAILED);
+ gs_extras_page_set_state (self, GS_EXTRAS_PAGE_STATE_FAILED);
return;
}
}
g_debug ("%s\n\n", gs_app_to_string (app));
- gs_shell_extras_add_app (self, app, search_data);
+ gs_extras_page_add_app (self, app, search_data);
self->pending_search_cnt--;
@@ -616,7 +613,7 @@ get_search_what_provides_cb (GObject *source_object,
gpointer user_data)
{
SearchData *search_data = (SearchData *) user_data;
- GsShellExtras *self = search_data->self;
+ GsExtrasPage *self = search_data->self;
g_autoptr(GsAppList) list = NULL;
guint i;
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
@@ -632,7 +629,7 @@ get_search_what_provides_cb (GObject *source_object,
g_warning ("failed to find any search results: %s", error->message);
str = g_strdup_printf ("%s: %s", _("Failed to find any search results"), error->message);
gtk_label_set_label (GTK_LABEL (self->label_failed), str);
- gs_shell_extras_set_state (self, GS_SHELL_EXTRAS_STATE_FAILED);
+ gs_extras_page_set_state (self, GS_EXTRAS_PAGE_STATE_FAILED);
return;
}
@@ -649,7 +646,7 @@ get_search_what_provides_cb (GObject *source_object,
GsApp *app = gs_app_list_index (list, i);
g_debug ("%s\n\n", gs_app_to_string (app));
- gs_shell_extras_add_app (self, app, search_data);
+ gs_extras_page_add_app (self, app, search_data);
}
self->pending_search_cnt--;
@@ -660,7 +657,7 @@ get_search_what_provides_cb (GObject *source_object,
}
static void
-gs_shell_extras_load (GsShellExtras *self, GPtrArray *array_search_data)
+gs_extras_page_load (GsExtrasPage *self, GPtrArray *array_search_data)
{
guint i;
@@ -683,7 +680,7 @@ gs_shell_extras_load (GsShellExtras *self, GPtrArray *array_search_data)
gs_container_remove_all (GTK_CONTAINER (self->list_box_results));
/* set state as loading */
- self->state = GS_SHELL_EXTRAS_STATE_LOADING;
+ self->state = GS_EXTRAS_PAGE_STATE_LOADING;
/* start new searches, separate one for each codec */
for (i = 0; i < self->array_search_data->len; i++) {
@@ -737,15 +734,15 @@ gs_shell_extras_load (GsShellExtras *self, GPtrArray *array_search_data)
}
static void
-gs_shell_extras_reload (GsPage *page)
+gs_extras_page_reload (GsPage *page)
{
- GsShellExtras *self = GS_SHELL_EXTRAS (page);
+ GsExtrasPage *self = GS_EXTRAS_PAGE (page);
if (self->array_search_data != NULL)
- gs_shell_extras_load (self, NULL);
+ gs_extras_page_load (self, NULL);
}
static void
-gs_shell_extras_search_package_files (GsShellExtras *self, gchar **files)
+gs_extras_page_search_package_files (GsExtrasPage *self, gchar **files)
{
g_autoptr(GPtrArray) array_search_data = g_ptr_array_new_with_free_func ((GDestroyNotify)
search_data_free);
guint i;
@@ -761,11 +758,11 @@ gs_shell_extras_search_package_files (GsShellExtras *self, gchar **files)
g_ptr_array_add (array_search_data, search_data);
}
- gs_shell_extras_load (self, array_search_data);
+ gs_extras_page_load (self, array_search_data);
}
static void
-gs_shell_extras_search_provide_files (GsShellExtras *self, gchar **files)
+gs_extras_page_search_provide_files (GsExtrasPage *self, gchar **files)
{
g_autoptr(GPtrArray) array_search_data = g_ptr_array_new_with_free_func ((GDestroyNotify)
search_data_free);
guint i;
@@ -781,11 +778,11 @@ gs_shell_extras_search_provide_files (GsShellExtras *self, gchar **files)
g_ptr_array_add (array_search_data, search_data);
}
- gs_shell_extras_load (self, array_search_data);
+ gs_extras_page_load (self, array_search_data);
}
static void
-gs_shell_extras_search_package_names (GsShellExtras *self, gchar **package_names)
+gs_extras_page_search_package_names (GsExtrasPage *self, gchar **package_names)
{
g_autoptr(GPtrArray) array_search_data = g_ptr_array_new_with_free_func ((GDestroyNotify)
search_data_free);
guint i;
@@ -801,11 +798,11 @@ gs_shell_extras_search_package_names (GsShellExtras *self, gchar **package_names
g_ptr_array_add (array_search_data, search_data);
}
- gs_shell_extras_load (self, array_search_data);
+ gs_extras_page_load (self, array_search_data);
}
static void
-gs_shell_extras_search_mime_types (GsShellExtras *self, gchar **mime_types)
+gs_extras_page_search_mime_types (GsExtrasPage *self, gchar **mime_types)
{
g_autoptr(GPtrArray) array_search_data = g_ptr_array_new_with_free_func ((GDestroyNotify)
search_data_free);
guint i;
@@ -821,7 +818,7 @@ gs_shell_extras_search_mime_types (GsShellExtras *self, gchar **mime_types)
g_ptr_array_add (array_search_data, search_data);
}
- gs_shell_extras_load (self, array_search_data);
+ gs_extras_page_load (self, array_search_data);
}
static gchar *
@@ -834,7 +831,7 @@ font_tag_to_lang (const gchar *tag)
}
static gchar *
-gs_shell_extras_font_tag_to_localised_name (GsShellExtras *self, const gchar *tag)
+gs_extras_page_font_tag_to_localised_name (GsExtrasPage *self, const gchar *tag)
{
gchar *name;
g_autofree gchar *lang = NULL;
@@ -863,7 +860,7 @@ gs_shell_extras_font_tag_to_localised_name (GsShellExtras *self, const gchar *ta
}
static void
-gs_shell_extras_search_fontconfig_resources (GsShellExtras *self, gchar **resources)
+gs_extras_page_search_fontconfig_resources (GsExtrasPage *self, gchar **resources)
{
g_autoptr(GPtrArray) array_search_data = g_ptr_array_new_with_free_func ((GDestroyNotify)
search_data_free);
guint i;
@@ -872,18 +869,18 @@ gs_shell_extras_search_fontconfig_resources (GsShellExtras *self, gchar **resour
SearchData *search_data;
search_data = g_slice_new0 (SearchData);
- search_data->title = gs_shell_extras_font_tag_to_localised_name (self, resources[i]);
+ search_data->title = gs_extras_page_font_tag_to_localised_name (self, resources[i]);
search_data->search = g_strdup (resources[i]);
search_data->url_not_found = gs_vendor_get_not_found_url (self->vendor,
GS_VENDOR_URL_TYPE_FONT);
search_data->self = g_object_ref (self);
g_ptr_array_add (array_search_data, search_data);
}
- gs_shell_extras_load (self, array_search_data);
+ gs_extras_page_load (self, array_search_data);
}
static void
-gs_shell_extras_search_gstreamer_resources (GsShellExtras *self, gchar **resources)
+gs_extras_page_search_gstreamer_resources (GsExtrasPage *self, gchar **resources)
{
g_autoptr(GPtrArray) array_search_data = g_ptr_array_new_with_free_func ((GDestroyNotify)
search_data_free);
guint i;
@@ -902,11 +899,11 @@ gs_shell_extras_search_gstreamer_resources (GsShellExtras *self, gchar **resourc
g_ptr_array_add (array_search_data, search_data);
}
- gs_shell_extras_load (self, array_search_data);
+ gs_extras_page_load (self, array_search_data);
}
static void
-gs_shell_extras_search_plasma_resources (GsShellExtras *self, gchar **resources)
+gs_extras_page_search_plasma_resources (GsExtrasPage *self, gchar **resources)
{
g_autoptr(GPtrArray) array_search_data = g_ptr_array_new_with_free_func ((GDestroyNotify)
search_data_free);
guint i;
@@ -922,11 +919,11 @@ gs_shell_extras_search_plasma_resources (GsShellExtras *self, gchar **resources)
g_ptr_array_add (array_search_data, search_data);
}
- gs_shell_extras_load (self, array_search_data);
+ gs_extras_page_load (self, array_search_data);
}
static void
-gs_shell_extras_search_printer_drivers (GsShellExtras *self, gchar **device_ids)
+gs_extras_page_search_printer_drivers (GsExtrasPage *self, gchar **device_ids)
{
g_autoptr(GPtrArray) array_search_data = g_ptr_array_new_with_free_func ((GDestroyNotify)
search_data_free);
guint i, j;
@@ -978,39 +975,39 @@ gs_shell_extras_search_printer_drivers (GsShellExtras *self, gchar **device_ids)
g_ptr_array_add (array_search_data, search_data);
}
- gs_shell_extras_load (self, array_search_data);
+ gs_extras_page_load (self, array_search_data);
}
void
-gs_shell_extras_search (GsShellExtras *self,
- const gchar *mode_str,
- gchar **resources)
+gs_extras_page_search (GsExtrasPage *self,
+ const gchar *mode_str,
+ gchar **resources)
{
- self->mode = gs_shell_extras_mode_from_string (mode_str);
+ self->mode = gs_extras_page_mode_from_string (mode_str);
switch (self->mode) {
- case GS_SHELL_EXTRAS_MODE_INSTALL_PACKAGE_FILES:
- gs_shell_extras_search_package_files (self, resources);
+ case GS_EXTRAS_PAGE_MODE_INSTALL_PACKAGE_FILES:
+ gs_extras_page_search_package_files (self, resources);
break;
- case GS_SHELL_EXTRAS_MODE_INSTALL_PROVIDE_FILES:
- gs_shell_extras_search_provide_files (self, resources);
+ case GS_EXTRAS_PAGE_MODE_INSTALL_PROVIDE_FILES:
+ gs_extras_page_search_provide_files (self, resources);
break;
- case GS_SHELL_EXTRAS_MODE_INSTALL_PACKAGE_NAMES:
- gs_shell_extras_search_package_names (self, resources);
+ case GS_EXTRAS_PAGE_MODE_INSTALL_PACKAGE_NAMES:
+ gs_extras_page_search_package_names (self, resources);
break;
- case GS_SHELL_EXTRAS_MODE_INSTALL_MIME_TYPES:
- gs_shell_extras_search_mime_types (self, resources);
+ case GS_EXTRAS_PAGE_MODE_INSTALL_MIME_TYPES:
+ gs_extras_page_search_mime_types (self, resources);
break;
- case GS_SHELL_EXTRAS_MODE_INSTALL_FONTCONFIG_RESOURCES:
- gs_shell_extras_search_fontconfig_resources (self, resources);
+ case GS_EXTRAS_PAGE_MODE_INSTALL_FONTCONFIG_RESOURCES:
+ gs_extras_page_search_fontconfig_resources (self, resources);
break;
- case GS_SHELL_EXTRAS_MODE_INSTALL_GSTREAMER_RESOURCES:
- gs_shell_extras_search_gstreamer_resources (self, resources);
+ case GS_EXTRAS_PAGE_MODE_INSTALL_GSTREAMER_RESOURCES:
+ gs_extras_page_search_gstreamer_resources (self, resources);
break;
- case GS_SHELL_EXTRAS_MODE_INSTALL_PLASMA_RESOURCES:
- gs_shell_extras_search_plasma_resources (self, resources);
+ case GS_EXTRAS_PAGE_MODE_INSTALL_PLASMA_RESOURCES:
+ gs_extras_page_search_plasma_resources (self, resources);
break;
- case GS_SHELL_EXTRAS_MODE_INSTALL_PRINTER_DRIVERS:
- gs_shell_extras_search_printer_drivers (self, resources);
+ case GS_EXTRAS_PAGE_MODE_INSTALL_PRINTER_DRIVERS:
+ gs_extras_page_search_printer_drivers (self, resources);
break;
default:
g_assert_not_reached ();
@@ -1019,10 +1016,10 @@ gs_shell_extras_search (GsShellExtras *self,
}
static void
-gs_shell_extras_switch_to (GsPage *page,
- gboolean scroll_up)
+gs_extras_page_switch_to (GsPage *page,
+ gboolean scroll_up)
{
- GsShellExtras *self = GS_SHELL_EXTRAS (page);
+ GsExtrasPage *self = GS_EXTRAS_PAGE (page);
GtkWidget *widget;
if (gs_shell_get_mode (self->shell) != GS_SHELL_MODE_EXTRAS) {
@@ -1040,13 +1037,13 @@ gs_shell_extras_switch_to (GsPage *page,
gtk_adjustment_set_value (adj, gtk_adjustment_get_lower (adj));
}
- gs_shell_extras_update_ui_state (self);
+ gs_extras_page_update_ui_state (self);
}
static void
row_activated_cb (GtkListBox *list_box,
GtkListBoxRow *row,
- GsShellExtras *self)
+ GsExtrasPage *self)
{
GsApp *app;
@@ -1121,16 +1118,16 @@ list_header_func (GtkListBoxRow *row,
}
static gboolean
-gs_shell_extras_setup (GsPage *page,
- GsShell *shell,
- GsPluginLoader *plugin_loader,
- GtkBuilder *builder,
- GCancellable *cancellable,
- GError **error)
+gs_extras_page_setup (GsPage *page,
+ GsShell *shell,
+ GsPluginLoader *plugin_loader,
+ GtkBuilder *builder,
+ GCancellable *cancellable,
+ GError **error)
{
- GsShellExtras *self = GS_SHELL_EXTRAS (page);
+ GsExtrasPage *self = GS_EXTRAS_PAGE (page);
- g_return_val_if_fail (GS_IS_SHELL_EXTRAS (self), TRUE);
+ g_return_val_if_fail (GS_IS_EXTRAS_PAGE (self), TRUE);
self->shell = shell;
@@ -1149,9 +1146,9 @@ gs_shell_extras_setup (GsPage *page,
}
static void
-gs_shell_extras_dispose (GObject *object)
+gs_extras_page_dispose (GObject *object)
{
- GsShellExtras *self = GS_SHELL_EXTRAS (object);
+ GsExtrasPage *self = GS_EXTRAS_PAGE (object);
if (self->search_cancellable != NULL) {
g_cancellable_cancel (self->search_cancellable);
@@ -1168,17 +1165,17 @@ gs_shell_extras_dispose (GObject *object)
g_clear_pointer (&self->array_search_data, g_ptr_array_unref);
- G_OBJECT_CLASS (gs_shell_extras_parent_class)->dispose (object);
+ G_OBJECT_CLASS (gs_extras_page_parent_class)->dispose (object);
}
static void
-gs_shell_extras_init (GsShellExtras *self)
+gs_extras_page_init (GsExtrasPage *self)
{
g_autoptr(GError) error = NULL;
gtk_widget_init_template (GTK_WIDGET (self));
- self->state = GS_SHELL_EXTRAS_STATE_LOADING;
+ self->state = GS_EXTRAS_PAGE_STATE_LOADING;
self->sizegroup_image = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
self->sizegroup_name = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
self->sizegroup_button = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
@@ -1192,33 +1189,33 @@ gs_shell_extras_init (GsShellExtras *self)
}
static void
-gs_shell_extras_class_init (GsShellExtrasClass *klass)
+gs_extras_page_class_init (GsExtrasPageClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GsPageClass *page_class = GS_PAGE_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- object_class->dispose = gs_shell_extras_dispose;
- page_class->switch_to = gs_shell_extras_switch_to;
- page_class->reload = gs_shell_extras_reload;
- page_class->setup = gs_shell_extras_setup;
+ object_class->dispose = gs_extras_page_dispose;
+ page_class->switch_to = gs_extras_page_switch_to;
+ page_class->reload = gs_extras_page_reload;
+ page_class->setup = gs_extras_page_setup;
- gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-shell-extras.ui");
+ gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-extras-page.ui");
- gtk_widget_class_bind_template_child (widget_class, GsShellExtras, label_failed);
- gtk_widget_class_bind_template_child (widget_class, GsShellExtras, label_no_results);
- gtk_widget_class_bind_template_child (widget_class, GsShellExtras, list_box_results);
- gtk_widget_class_bind_template_child (widget_class, GsShellExtras, scrolledwindow);
- gtk_widget_class_bind_template_child (widget_class, GsShellExtras, spinner);
- gtk_widget_class_bind_template_child (widget_class, GsShellExtras, stack);
+ gtk_widget_class_bind_template_child (widget_class, GsExtrasPage, label_failed);
+ gtk_widget_class_bind_template_child (widget_class, GsExtrasPage, label_no_results);
+ gtk_widget_class_bind_template_child (widget_class, GsExtrasPage, list_box_results);
+ gtk_widget_class_bind_template_child (widget_class, GsExtrasPage, scrolledwindow);
+ gtk_widget_class_bind_template_child (widget_class, GsExtrasPage, spinner);
+ gtk_widget_class_bind_template_child (widget_class, GsExtrasPage, stack);
}
-GsShellExtras *
-gs_shell_extras_new (void)
+GsExtrasPage *
+gs_extras_page_new (void)
{
- GsShellExtras *self;
- self = g_object_new (GS_TYPE_SHELL_EXTRAS, NULL);
- return GS_SHELL_EXTRAS (self);
+ GsExtrasPage *self;
+ self = g_object_new (GS_TYPE_EXTRAS_PAGE, NULL);
+ return GS_EXTRAS_PAGE (self);
}
/* vim: set noexpandtab: */
diff --git a/src/gs-shell-extras.h b/src/gs-extras-page.h
similarity index 57%
rename from src/gs-shell-extras.h
rename to src/gs-extras-page.h
index 1002f9f..b59630b 100644
--- a/src/gs-shell-extras.h
+++ b/src/gs-extras-page.h
@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __GS_SHELL_EXTRAS_H
-#define __GS_SHELL_EXTRAS_H
+#ifndef __GS_EXTRAS_PAGE_H
+#define __GS_EXTRAS_PAGE_H
#include <glib-object.h>
#include <gtk/gtk.h>
@@ -31,31 +31,31 @@
G_BEGIN_DECLS
-#define GS_TYPE_SHELL_EXTRAS (gs_shell_extras_get_type ())
+#define GS_TYPE_EXTRAS_PAGE (gs_extras_page_get_type ())
-G_DECLARE_FINAL_TYPE (GsShellExtras, gs_shell_extras, GS, SHELL_EXTRAS, GsPage)
+G_DECLARE_FINAL_TYPE (GsExtrasPage, gs_extras_page, GS, EXTRAS_PAGE, GsPage)
typedef enum {
- GS_SHELL_EXTRAS_MODE_UNKNOWN,
- GS_SHELL_EXTRAS_MODE_INSTALL_PACKAGE_FILES,
- GS_SHELL_EXTRAS_MODE_INSTALL_PROVIDE_FILES,
- GS_SHELL_EXTRAS_MODE_INSTALL_PACKAGE_NAMES,
- GS_SHELL_EXTRAS_MODE_INSTALL_MIME_TYPES,
- GS_SHELL_EXTRAS_MODE_INSTALL_FONTCONFIG_RESOURCES,
- GS_SHELL_EXTRAS_MODE_INSTALL_GSTREAMER_RESOURCES,
- GS_SHELL_EXTRAS_MODE_INSTALL_PLASMA_RESOURCES,
- GS_SHELL_EXTRAS_MODE_INSTALL_PRINTER_DRIVERS,
- GS_SHELL_EXTRAS_MODE_LAST
-} GsShellExtrasMode;
-
-const gchar *gs_shell_extras_mode_to_string (GsShellExtrasMode mode);
-GsShellExtras *gs_shell_extras_new (void);
-void gs_shell_extras_search (GsShellExtras *self,
+ GS_EXTRAS_PAGE_MODE_UNKNOWN,
+ GS_EXTRAS_PAGE_MODE_INSTALL_PACKAGE_FILES,
+ GS_EXTRAS_PAGE_MODE_INSTALL_PROVIDE_FILES,
+ GS_EXTRAS_PAGE_MODE_INSTALL_PACKAGE_NAMES,
+ GS_EXTRAS_PAGE_MODE_INSTALL_MIME_TYPES,
+ GS_EXTRAS_PAGE_MODE_INSTALL_FONTCONFIG_RESOURCES,
+ GS_EXTRAS_PAGE_MODE_INSTALL_GSTREAMER_RESOURCES,
+ GS_EXTRAS_PAGE_MODE_INSTALL_PLASMA_RESOURCES,
+ GS_EXTRAS_PAGE_MODE_INSTALL_PRINTER_DRIVERS,
+ GS_EXTRAS_PAGE_MODE_LAST
+} GsExtrasPageMode;
+
+const gchar *gs_extras_page_mode_to_string (GsExtrasPageMode mode);
+GsExtrasPage *gs_extras_page_new (void);
+void gs_extras_page_search (GsExtrasPage *self,
const gchar *mode,
gchar **resources);
G_END_DECLS
-#endif /* __GS_SHELL_EXTRAS_H */
+#endif /* __GS_EXTRAS_PAGE_H */
/* vim: set noexpandtab: */
diff --git a/src/gs-shell-extras.ui b/src/gs-extras-page.ui
similarity index 99%
rename from src/gs-shell-extras.ui
rename to src/gs-extras-page.ui
index 6cdb430..1e72c09 100644
--- a/src/gs-shell-extras.ui
+++ b/src/gs-extras-page.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.10"/>
- <template class="GsShellExtras" parent="GsPage">
+ <template class="GsExtrasPage" parent="GsPage">
<child internal-child="accessible">
<object class="AtkObject" id="codecs-accessible">
<property name="accessible-name" translatable="yes">Codecs page</property>
diff --git a/src/gs-shell-installed.c b/src/gs-installed-page.c
similarity index 76%
rename from src/gs-shell-installed.c
rename to src/gs-installed-page.c
index 6bed6e1..5ae6ed0 100644
--- a/src/gs-shell-installed.c
+++ b/src/gs-installed-page.c
@@ -27,14 +27,14 @@
#include <appstream-glib.h>
#include "gs-shell.h"
-#include "gs-shell-installed.h"
+#include "gs-installed-page.h"
#include "gs-app.h"
#include "gs-common.h"
#include "gs-app-row.h"
#include "gs-app-folder-dialog.h"
#include "gs-folders.h"
-struct _GsShellInstalled
+struct _GsInstalledPage
{
GsPage parent_instance;
@@ -61,22 +61,22 @@ struct _GsShellInstalled
GtkWidget *stack_install;
};
-G_DEFINE_TYPE (GsShellInstalled, gs_shell_installed, GS_TYPE_PAGE)
+G_DEFINE_TYPE (GsInstalledPage, gs_installed_page, GS_TYPE_PAGE)
-static void gs_shell_installed_pending_apps_changed_cb (GsPluginLoader *plugin_loader,
- GsShellInstalled *self);
-static void set_selection_mode (GsShellInstalled *self, gboolean selection_mode);
+static void gs_installed_page_pending_apps_changed_cb (GsPluginLoader *plugin_loader,
+ GsInstalledPage *self);
+static void set_selection_mode (GsInstalledPage *self, gboolean selection_mode);
static void
-gs_shell_installed_invalidate (GsShellInstalled *self)
+gs_installed_page_invalidate (GsInstalledPage *self)
{
self->cache_valid = FALSE;
}
static void
-gs_shell_installed_app_row_activated_cb (GtkListBox *list_box,
- GtkListBoxRow *row,
- GsShellInstalled *self)
+gs_installed_page_app_row_activated_cb (GtkListBox *list_box,
+ GtkListBoxRow *row,
+ GsInstalledPage *self)
{
if (self->selection_mode) {
gboolean selected;
@@ -99,7 +99,7 @@ row_unrevealed (GObject *row, GParamSpec *pspec, gpointer data)
}
static void
-gs_shell_installed_unreveal_row (GsAppRow *app_row)
+gs_installed_page_unreveal_row (GsAppRow *app_row)
{
gs_app_row_unreveal (app_row);
g_signal_connect (app_row, "unrevealed",
@@ -107,9 +107,9 @@ gs_shell_installed_unreveal_row (GsAppRow *app_row)
}
static void
-gs_shell_installed_app_removed (GsPage *page, GsApp *app)
+gs_installed_page_app_removed (GsPage *page, GsApp *app)
{
- GsShellInstalled *self = GS_SHELL_INSTALLED (page);
+ GsInstalledPage *self = GS_INSTALLED_PAGE (page);
GList *l;
g_autoptr(GList) children = NULL;
@@ -117,14 +117,14 @@ gs_shell_installed_app_removed (GsPage *page, GsApp *app)
for (l = children; l; l = l->next) {
GsAppRow *app_row = GS_APP_ROW (l->data);
if (gs_app_row_get_app (app_row) == app) {
- gs_shell_installed_unreveal_row (app_row);
+ gs_installed_page_unreveal_row (app_row);
}
}
}
static void
-gs_shell_installed_app_remove_cb (GsAppRow *app_row,
- GsShellInstalled *self)
+gs_installed_page_app_remove_cb (GsAppRow *app_row,
+ GsInstalledPage *self)
{
GsApp *app;
@@ -133,7 +133,7 @@ gs_shell_installed_app_remove_cb (GsAppRow *app_row,
}
static gboolean
-gs_shell_installed_invalidate_sort_idle (gpointer user_data)
+gs_installed_page_invalidate_sort_idle (gpointer user_data)
{
GsAppRow *app_row = user_data;
GsApp *app = gs_app_row_get_app (app_row);
@@ -144,31 +144,31 @@ gs_shell_installed_invalidate_sort_idle (gpointer user_data)
/* if the app has been uninstalled (which can happen from another view)
* we should removed it from the installed view */
if (state == AS_APP_STATE_AVAILABLE || state == AS_APP_STATE_UNKNOWN)
- gs_shell_installed_unreveal_row (app_row);
+ gs_installed_page_unreveal_row (app_row);
g_object_unref (app_row);
return G_SOURCE_REMOVE;
}
static void
-gs_shell_installed_notify_state_changed_cb (GsApp *app,
- GParamSpec *pspec,
- GsAppRow *app_row)
+gs_installed_page_notify_state_changed_cb (GsApp *app,
+ GParamSpec *pspec,
+ GsAppRow *app_row)
{
- g_idle_add (gs_shell_installed_invalidate_sort_idle, g_object_ref (app_row));
+ g_idle_add (gs_installed_page_invalidate_sort_idle, g_object_ref (app_row));
}
-static void selection_changed (GsShellInstalled *self);
+static void selection_changed (GsInstalledPage *self);
static gboolean
-should_show_installed_size (GsShellInstalled *self)
+should_show_installed_size (GsInstalledPage *self)
{
return g_settings_get_boolean (self->settings,
"installed-page-show-size");
}
static gboolean
-gs_shell_installed_is_actual_app (GsApp *app)
+gs_installed_page_is_actual_app (GsApp *app)
{
if (gs_app_get_description (app) != NULL)
return TRUE;
@@ -180,7 +180,7 @@ gs_shell_installed_is_actual_app (GsApp *app)
}
static void
-gs_shell_installed_add_app (GsShellInstalled *self, GsAppList *list, GsApp *app)
+gs_installed_page_add_app (GsInstalledPage *self, GsAppList *list, GsApp *app)
{
GtkWidget *app_row;
@@ -192,9 +192,9 @@ gs_shell_installed_add_app (GsShellInstalled *self, GsAppList *list, GsApp *app)
gs_utils_list_has_app_fuzzy (list, app))
gs_app_row_set_show_source (GS_APP_ROW (app_row), TRUE);
g_signal_connect (app_row, "button-clicked",
- G_CALLBACK (gs_shell_installed_app_remove_cb), self);
+ G_CALLBACK (gs_installed_page_app_remove_cb), self);
g_signal_connect_object (app, "notify::state",
- G_CALLBACK (gs_shell_installed_notify_state_changed_cb),
+ G_CALLBACK (gs_installed_page_notify_state_changed_cb),
app_row, 0);
g_signal_connect_swapped (app_row, "notify::selected",
G_CALLBACK (selection_changed), self);
@@ -212,17 +212,17 @@ gs_shell_installed_add_app (GsShellInstalled *self, GsAppList *list, GsApp *app)
self->selection_mode);
/* only show if is an actual application */
- gtk_widget_set_visible (app_row, gs_shell_installed_is_actual_app (app));
+ gtk_widget_set_visible (app_row, gs_installed_page_is_actual_app (app));
}
static void
-gs_shell_installed_get_installed_cb (GObject *source_object,
- GAsyncResult *res,
- gpointer user_data)
+gs_installed_page_get_installed_cb (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
{
guint i;
GsApp *app;
- GsShellInstalled *self = GS_SHELL_INSTALLED (user_data);
+ GsInstalledPage *self = GS_INSTALLED_PAGE (user_data);
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
g_autoptr(GError) error = NULL;
g_autoptr(GsAppList) list = NULL;
@@ -243,17 +243,17 @@ gs_shell_installed_get_installed_cb (GObject *source_object,
}
for (i = 0; i < gs_app_list_length (list); i++) {
app = gs_app_list_index (list, i);
- gs_shell_installed_add_app (self, list, app);
+ gs_installed_page_add_app (self, list, app);
}
out:
- gs_shell_installed_pending_apps_changed_cb (plugin_loader, self);
+ gs_installed_page_pending_apps_changed_cb (plugin_loader, self);
/* seems a good place */
gs_shell_profile_dump (self->shell);
}
static void
-gs_shell_installed_load (GsShellInstalled *self)
+gs_installed_page_load (GsInstalledPage *self)
{
GsPluginRefineFlags flags;
@@ -283,22 +283,22 @@ gs_shell_installed_load (GsShellInstalled *self)
flags,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
- gs_shell_installed_get_installed_cb,
+ gs_installed_page_get_installed_cb,
self);
gs_start_spinner (GTK_SPINNER (self->spinner_install));
gtk_stack_set_visible_child_name (GTK_STACK (self->stack_install), "spinner");
}
static void
-gs_shell_installed_reload (GsPage *page)
+gs_installed_page_reload (GsPage *page)
{
- GsShellInstalled *self = GS_SHELL_INSTALLED (page);
- gs_shell_installed_invalidate (self);
- gs_shell_installed_load (self);
+ GsInstalledPage *self = GS_INSTALLED_PAGE (page);
+ gs_installed_page_invalidate (self);
+ gs_installed_page_load (self);
}
static void
-gs_shell_update_button_select_visibility (GsShellInstalled *self)
+gs_shell_update_button_select_visibility (GsInstalledPage *self)
{
gboolean show_button_select;
if (gs_utils_is_current_desktop ("GNOME")) {
@@ -311,9 +311,9 @@ gs_shell_update_button_select_visibility (GsShellInstalled *self)
}
static void
-gs_shell_installed_switch_to (GsPage *page, gboolean scroll_up)
+gs_installed_page_switch_to (GsPage *page, gboolean scroll_up)
{
- GsShellInstalled *self = GS_SHELL_INSTALLED (page);
+ GsInstalledPage *self = GS_INSTALLED_PAGE (page);
GtkWidget *widget;
if (gs_shell_get_mode (self->shell) != GS_SHELL_MODE_INSTALLED) {
@@ -341,11 +341,11 @@ gs_shell_installed_switch_to (GsPage *page, gboolean scroll_up)
if (self->cache_valid)
return;
- gs_shell_installed_load (self);
+ gs_installed_page_load (self);
}
/**
- * gs_shell_installed_get_app_sort_key:
+ * gs_installed_page_get_app_sort_key:
*
* Get a sort key to achive this:
*
@@ -358,7 +358,7 @@ gs_shell_installed_switch_to (GsPage *page, gboolean scroll_up)
* by name.
**/
static gchar *
-gs_shell_installed_get_app_sort_key (GsApp *app)
+gs_installed_page_get_app_sort_key (GsApp *app)
{
GString *key;
g_autofree gchar *casefolded_name = NULL;
@@ -428,9 +428,9 @@ gs_shell_installed_get_app_sort_key (GsApp *app)
}
static gint
-gs_shell_installed_sort_func (GtkListBoxRow *a,
- GtkListBoxRow *b,
- gpointer user_data)
+gs_installed_page_sort_func (GtkListBoxRow *a,
+ GtkListBoxRow *b,
+ gpointer user_data)
{
GsApp *a1, *a2;
g_autofree gchar *key1 = NULL;
@@ -444,8 +444,8 @@ gs_shell_installed_sort_func (GtkListBoxRow *a,
a1 = gs_app_row_get_app (GS_APP_ROW (a));
a2 = gs_app_row_get_app (GS_APP_ROW (b));
- key1 = gs_shell_installed_get_app_sort_key (a1);
- key2 = gs_shell_installed_get_app_sort_key (a2);
+ key1 = gs_installed_page_get_app_sort_key (a1);
+ key2 = gs_installed_page_get_app_sort_key (a2);
/* compare the keys according to the algorithm above */
return g_strcmp0 (key1, key2);
@@ -456,10 +456,10 @@ typedef enum {
GS_UPDATE_LIST_SECTION_SYSTEM_APPS,
GS_UPDATE_LIST_SECTION_ADDONS,
GS_UPDATE_LIST_SECTION_LAST
-} GsShellInstalledSection;
+} GsInstalledPageSection;
-static GsShellInstalledSection
-gs_shell_installed_get_app_section (GsApp *app)
+static GsInstalledPageSection
+gs_installed_page_get_app_section (GsApp *app)
{
if (gs_app_get_kind (app) == AS_APP_KIND_DESKTOP ||
gs_app_get_kind (app) == AS_APP_KIND_WEB_APP) {
@@ -471,7 +471,7 @@ gs_shell_installed_get_app_section (GsApp *app)
}
static GtkWidget *
-gs_shell_installed_get_section_header (GsShellInstalledSection section)
+gs_installed_page_get_section_header (GsInstalledPageSection section)
{
GtkWidget *header = NULL;
@@ -496,26 +496,26 @@ gs_shell_installed_get_section_header (GsShellInstalledSection section)
}
static void
-gs_shell_installed_list_header_func (GtkListBoxRow *row,
- GtkListBoxRow *before,
- gpointer user_data)
+gs_installed_page_list_header_func (GtkListBoxRow *row,
+ GtkListBoxRow *before,
+ gpointer user_data)
{
GsApp *app = gs_app_row_get_app (GS_APP_ROW (row));
- GsShellInstalledSection before_section = GS_UPDATE_LIST_SECTION_LAST;
- GsShellInstalledSection section;
+ GsInstalledPageSection before_section = GS_UPDATE_LIST_SECTION_LAST;
+ GsInstalledPageSection section;
GtkWidget *header;
/* first entry */
gtk_list_box_row_set_header (row, NULL);
if (before != NULL) {
GsApp *before_app = gs_app_row_get_app (GS_APP_ROW (before));
- before_section = gs_shell_installed_get_app_section (before_app);
+ before_section = gs_installed_page_get_app_section (before_app);
}
/* section changed or forced to have headers */
- section = gs_shell_installed_get_app_section (app);
+ section = gs_installed_page_get_app_section (app);
if (before_section != section) {
- header = gs_shell_installed_get_section_header (section);
+ header = gs_installed_page_get_section_header (section);
if (header == NULL)
return;
} else {
@@ -525,8 +525,8 @@ gs_shell_installed_list_header_func (GtkListBoxRow *row,
}
static gboolean
-gs_shell_installed_has_app (GsShellInstalled *self,
- GsApp *app)
+gs_installed_page_has_app (GsInstalledPage *self,
+ GsApp *app)
{
GList *l;
gboolean ret = FALSE;
@@ -544,8 +544,8 @@ gs_shell_installed_has_app (GsShellInstalled *self,
}
static void
-gs_shell_installed_pending_apps_changed_cb (GsPluginLoader *plugin_loader,
- GsShellInstalled *self)
+gs_installed_page_pending_apps_changed_cb (GsPluginLoader *plugin_loader,
+ GsInstalledPage *self)
{
GsApp *app;
GtkWidget *widget;
@@ -564,8 +564,8 @@ gs_shell_installed_pending_apps_changed_cb (GsPluginLoader *plugin_loader,
continue;
/* do not to add pending apps more than once. */
- if (gs_shell_installed_has_app (self, app) == FALSE)
- gs_shell_installed_add_app (self, pending, app);
+ if (gs_installed_page_has_app (self, app) == FALSE)
+ gs_installed_page_add_app (self, pending, app);
/* incremement the label */
cnt++;
@@ -585,7 +585,7 @@ gs_shell_installed_pending_apps_changed_cb (GsPluginLoader *plugin_loader,
}
static void
-set_selection_mode (GsShellInstalled *self, gboolean selection_mode)
+set_selection_mode (GsInstalledPage *self, gboolean selection_mode)
{
GList *l;
GtkWidget *header;
@@ -633,20 +633,20 @@ set_selection_mode (GsShellInstalled *self, gboolean selection_mode)
self->selection_mode);
gtk_widget_set_visible (GTK_WIDGET (app_row),
self->selection_mode ||
- gs_shell_installed_is_actual_app (app));
+ gs_installed_page_is_actual_app (app));
}
gtk_revealer_set_reveal_child (GTK_REVEALER (self->bottom_install), self->selection_mode);
}
static void
-selection_mode_cb (GtkButton *button, GsShellInstalled *self)
+selection_mode_cb (GtkButton *button, GsInstalledPage *self)
{
set_selection_mode (self, !self->selection_mode);
}
static GList *
-get_selected_apps (GsShellInstalled *self)
+get_selected_apps (GsInstalledPage *self)
{
GList *l, *list;
g_autoptr(GList) children = NULL;
@@ -663,7 +663,7 @@ get_selected_apps (GsShellInstalled *self)
}
static void
-selection_changed (GsShellInstalled *self)
+selection_changed (GsInstalledPage *self)
{
GList *l;
GsApp *app;
@@ -691,14 +691,14 @@ selection_changed (GsShellInstalled *self)
}
static gboolean
-folder_dialog_done (GsShellInstalled *self)
+folder_dialog_done (GsInstalledPage *self)
{
set_selection_mode (self, FALSE);
return FALSE;
}
static void
-show_folder_dialog (GtkButton *button, GsShellInstalled *self)
+show_folder_dialog (GtkButton *button, GsInstalledPage *self)
{
GtkWidget *toplevel;
GtkWidget *dialog;
@@ -715,7 +715,7 @@ show_folder_dialog (GtkButton *button, GsShellInstalled *self)
}
static void
-remove_folders (GtkButton *button, GsShellInstalled *self)
+remove_folders (GtkButton *button, GsInstalledPage *self)
{
GList *l;
GsApp *app;
@@ -738,7 +738,7 @@ remove_folders (GtkButton *button, GsShellInstalled *self)
}
static void
-select_all_cb (GtkMenuItem *item, GsShellInstalled *self)
+select_all_cb (GtkMenuItem *item, GsInstalledPage *self)
{
GList *l;
g_autoptr(GList) children = NULL;
@@ -751,7 +751,7 @@ select_all_cb (GtkMenuItem *item, GsShellInstalled *self)
}
static void
-select_none_cb (GtkMenuItem *item, GsShellInstalled *self)
+select_none_cb (GtkMenuItem *item, GsInstalledPage *self)
{
GList *l;
g_autoptr(GList) children = NULL;
@@ -764,7 +764,7 @@ select_none_cb (GtkMenuItem *item, GsShellInstalled *self)
}
static void
-gs_shell_settings_changed_cb (GsShellInstalled *self,
+gs_shell_settings_changed_cb (GsInstalledPage *self,
const gchar *key,
gpointer data)
{
@@ -774,23 +774,23 @@ gs_shell_settings_changed_cb (GsShellInstalled *self,
}
static gboolean
-gs_shell_installed_setup (GsPage *page,
- GsShell *shell,
- GsPluginLoader *plugin_loader,
- GtkBuilder *builder,
- GCancellable *cancellable,
- GError **error)
-{
- GsShellInstalled *self = GS_SHELL_INSTALLED (page);
+gs_installed_page_setup (GsPage *page,
+ GsShell *shell,
+ GsPluginLoader *plugin_loader,
+ GtkBuilder *builder,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GsInstalledPage *self = GS_INSTALLED_PAGE (page);
AtkObject *accessible;
GtkWidget *widget;
- g_return_val_if_fail (GS_IS_SHELL_INSTALLED (self), TRUE);
+ g_return_val_if_fail (GS_IS_INSTALLED_PAGE (self), TRUE);
self->shell = shell;
self->plugin_loader = g_object_ref (plugin_loader);
g_signal_connect (self->plugin_loader, "pending-apps-changed",
- G_CALLBACK (gs_shell_installed_pending_apps_changed_cb),
+ G_CALLBACK (gs_installed_page_pending_apps_changed_cb),
self);
self->builder = g_object_ref (builder);
@@ -798,12 +798,12 @@ gs_shell_installed_setup (GsPage *page,
/* setup installed */
g_signal_connect (self->list_box_install, "row-activated",
- G_CALLBACK (gs_shell_installed_app_row_activated_cb), self);
+ G_CALLBACK (gs_installed_page_app_row_activated_cb), self);
gtk_list_box_set_header_func (GTK_LIST_BOX (self->list_box_install),
- gs_shell_installed_list_header_func,
+ gs_installed_page_list_header_func,
self, NULL);
gtk_list_box_set_sort_func (GTK_LIST_BOX (self->list_box_install),
- gs_shell_installed_sort_func,
+ gs_installed_page_sort_func,
self, NULL);
g_signal_connect (self->button_folder_add, "clicked",
@@ -833,9 +833,9 @@ gs_shell_installed_setup (GsPage *page,
}
static void
-gs_shell_installed_dispose (GObject *object)
+gs_installed_page_dispose (GObject *object)
{
- GsShellInstalled *self = GS_SHELL_INSTALLED (object);
+ GsInstalledPage *self = GS_INSTALLED_PAGE (object);
g_clear_object (&self->sizegroup_image);
g_clear_object (&self->sizegroup_name);
@@ -846,36 +846,36 @@ gs_shell_installed_dispose (GObject *object)
g_clear_object (&self->cancellable);
g_clear_object (&self->settings);
- G_OBJECT_CLASS (gs_shell_installed_parent_class)->dispose (object);
+ G_OBJECT_CLASS (gs_installed_page_parent_class)->dispose (object);
}
static void
-gs_shell_installed_class_init (GsShellInstalledClass *klass)
+gs_installed_page_class_init (GsInstalledPageClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GsPageClass *page_class = GS_PAGE_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- object_class->dispose = gs_shell_installed_dispose;
- page_class->app_removed = gs_shell_installed_app_removed;
- page_class->switch_to = gs_shell_installed_switch_to;
- page_class->reload = gs_shell_installed_reload;
- page_class->setup = gs_shell_installed_setup;
+ object_class->dispose = gs_installed_page_dispose;
+ page_class->app_removed = gs_installed_page_app_removed;
+ page_class->switch_to = gs_installed_page_switch_to;
+ page_class->reload = gs_installed_page_reload;
+ page_class->setup = gs_installed_page_setup;
- gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/Software/gs-shell-installed.ui");
+ gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/Software/gs-installed-page.ui");
- gtk_widget_class_bind_template_child (widget_class, GsShellInstalled, bottom_install);
- gtk_widget_class_bind_template_child (widget_class, GsShellInstalled, button_folder_add);
- gtk_widget_class_bind_template_child (widget_class, GsShellInstalled, button_folder_move);
- gtk_widget_class_bind_template_child (widget_class, GsShellInstalled, button_folder_remove);
- gtk_widget_class_bind_template_child (widget_class, GsShellInstalled, list_box_install);
- gtk_widget_class_bind_template_child (widget_class, GsShellInstalled, scrolledwindow_install);
- gtk_widget_class_bind_template_child (widget_class, GsShellInstalled, spinner_install);
- gtk_widget_class_bind_template_child (widget_class, GsShellInstalled, stack_install);
+ gtk_widget_class_bind_template_child (widget_class, GsInstalledPage, bottom_install);
+ gtk_widget_class_bind_template_child (widget_class, GsInstalledPage, button_folder_add);
+ gtk_widget_class_bind_template_child (widget_class, GsInstalledPage, button_folder_move);
+ gtk_widget_class_bind_template_child (widget_class, GsInstalledPage, button_folder_remove);
+ gtk_widget_class_bind_template_child (widget_class, GsInstalledPage, list_box_install);
+ gtk_widget_class_bind_template_child (widget_class, GsInstalledPage, scrolledwindow_install);
+ gtk_widget_class_bind_template_child (widget_class, GsInstalledPage, spinner_install);
+ gtk_widget_class_bind_template_child (widget_class, GsInstalledPage, stack_install);
}
static void
-gs_shell_installed_init (GsShellInstalled *self)
+gs_installed_page_init (GsInstalledPage *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
@@ -889,12 +889,12 @@ gs_shell_installed_init (GsShellInstalled *self)
self);
}
-GsShellInstalled *
-gs_shell_installed_new (void)
+GsInstalledPage *
+gs_installed_page_new (void)
{
- GsShellInstalled *self;
- self = g_object_new (GS_TYPE_SHELL_INSTALLED, NULL);
- return GS_SHELL_INSTALLED (self);
+ GsInstalledPage *self;
+ self = g_object_new (GS_TYPE_INSTALLED_PAGE, NULL);
+ return GS_INSTALLED_PAGE (self);
}
/* vim: set noexpandtab: */
diff --git a/src/gs-shell-moderate.h b/src/gs-installed-page.h
similarity index 78%
rename from src/gs-shell-moderate.h
rename to src/gs-installed-page.h
index 7149009..07ce999 100644
--- a/src/gs-shell-moderate.h
+++ b/src/gs-installed-page.h
@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __GS_SHELL_MODERATE_H
-#define __GS_SHELL_MODERATE_H
+#ifndef __GS_INSTALLED_PAGE_H
+#define __GS_INSTALLED_PAGE_H
#include <glib-object.h>
#include <gtk/gtk.h>
@@ -30,14 +30,14 @@
G_BEGIN_DECLS
-#define GS_TYPE_SHELL_MODERATE (gs_shell_moderate_get_type ())
+#define GS_TYPE_INSTALLED_PAGE (gs_installed_page_get_type ())
-G_DECLARE_FINAL_TYPE (GsShellModerate, gs_shell_moderate, GS, SHELL_MODERATE, GsPage)
+G_DECLARE_FINAL_TYPE (GsInstalledPage, gs_installed_page, GS, INSTALLED_PAGE, GsPage)
-GsShellModerate *gs_shell_moderate_new (void);
+GsInstalledPage *gs_installed_page_new (void);
G_END_DECLS
-#endif /* __GS_SHELL_MODERATE_H */
+#endif /* __GS_INSTALLED_PAGE_H */
/* vim: set noexpandtab: */
diff --git a/src/gs-shell-installed.ui b/src/gs-installed-page.ui
similarity index 98%
rename from src/gs-shell-installed.ui
rename to src/gs-installed-page.ui
index 0cc34aa..b0372b6 100644
--- a/src/gs-shell-installed.ui
+++ b/src/gs-installed-page.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.10"/>
- <template class="GsShellInstalled" parent="GsPage">
+ <template class="GsInstalledPage" parent="GsPage">
<child internal-child="accessible">
<object class="AtkObject" id="installed-accessible">
<property name="accessible-name" translatable="yes">Installed page</property>
diff --git a/src/gs-shell-loading.c b/src/gs-loading-page.c
similarity index 61%
rename from src/gs-shell-loading.c
rename to src/gs-loading-page.c
index 413a453..419481c 100644
--- a/src/gs-shell-loading.c
+++ b/src/gs-loading-page.c
@@ -25,7 +25,7 @@
#include "gs-app.h"
#include "gs-shell.h"
-#include "gs-shell-loading.h"
+#include "gs-loading-page.h"
typedef struct {
GsPage parent_instance;
@@ -36,9 +36,9 @@ typedef struct {
GtkWidget *progressbar;
GtkWidget *label;
-} GsShellLoadingPrivate;
+} GsLoadingPagePrivate;
-G_DEFINE_TYPE_WITH_PRIVATE (GsShellLoading, gs_shell_loading, GS_TYPE_PAGE)
+G_DEFINE_TYPE_WITH_PRIVATE (GsLoadingPage, gs_loading_page, GS_TYPE_PAGE)
enum {
SIGNAL_REFRESHED,
@@ -48,12 +48,12 @@ enum {
static guint signals [SIGNAL_LAST] = { 0 };
static void
-gs_shell_loading_status_changed_cb (GsPluginLoader *plugin_loader,
- GsApp *app,
- GsPluginStatus status,
- GsShellLoading *self)
+gs_loading_page_status_changed_cb (GsPluginLoader *plugin_loader,
+ GsApp *app,
+ GsPluginStatus status,
+ GsLoadingPage *self)
{
- GsShellLoadingPrivate *priv = gs_shell_loading_get_instance_private (self);
+ GsLoadingPagePrivate *priv = gs_loading_page_get_instance_private (self);
/* update label */
switch (status) {
@@ -77,10 +77,10 @@ gs_shell_loading_status_changed_cb (GsPluginLoader *plugin_loader,
}
static void
-gs_shell_loading_refresh_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
+gs_loading_page_refresh_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
- GsShellLoading *self = GS_SHELL_LOADING (user_data);
+ GsLoadingPage *self = GS_LOADING_PAGE (user_data);
g_autoptr(GError) error = NULL;
/* no longer care */
@@ -97,9 +97,9 @@ gs_shell_loading_refresh_cb (GObject *source_object, GAsyncResult *res, gpointer
}
static void
-gs_shell_loading_load (GsShellLoading *self)
+gs_loading_page_load (GsLoadingPage *self)
{
- GsShellLoadingPrivate *priv = gs_shell_loading_get_instance_private (self);
+ GsLoadingPagePrivate *priv = gs_loading_page_get_instance_private (self);
/* ensure that at least some metadata of any age is present, and also
* spin up the plugins enough as to prime caches */
@@ -107,39 +107,39 @@ gs_shell_loading_load (GsShellLoading *self)
GS_PLUGIN_REFRESH_FLAGS_METADATA,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
priv->cancellable,
- gs_shell_loading_refresh_cb,
+ gs_loading_page_refresh_cb,
self);
g_signal_connect (priv->plugin_loader, "status-changed",
- G_CALLBACK (gs_shell_loading_status_changed_cb),
+ G_CALLBACK (gs_loading_page_status_changed_cb),
self);
}
static void
-gs_shell_loading_switch_to (GsPage *page, gboolean scroll_up)
+gs_loading_page_switch_to (GsPage *page, gboolean scroll_up)
{
- GsShellLoading *self = GS_SHELL_LOADING (page);
- GsShellLoadingPrivate *priv = gs_shell_loading_get_instance_private (self);
+ GsLoadingPage *self = GS_LOADING_PAGE (page);
+ GsLoadingPagePrivate *priv = gs_loading_page_get_instance_private (self);
if (gs_shell_get_mode (priv->shell) != GS_SHELL_MODE_LOADING) {
g_warning ("Called switch_to(loading) when in mode %s",
gs_shell_get_mode_string (priv->shell));
return;
}
- gs_shell_loading_load (self);
+ gs_loading_page_load (self);
}
static gboolean
-gs_shell_loading_setup (GsPage *page,
- GsShell *shell,
- GsPluginLoader *plugin_loader,
- GtkBuilder *builder,
- GCancellable *cancellable,
- GError **error)
+gs_loading_page_setup (GsPage *page,
+ GsShell *shell,
+ GsPluginLoader *plugin_loader,
+ GtkBuilder *builder,
+ GCancellable *cancellable,
+ GError **error)
{
- GsShellLoading *self = GS_SHELL_LOADING (page);
- GsShellLoadingPrivate *priv = gs_shell_loading_get_instance_private (self);
+ GsLoadingPage *self = GS_LOADING_PAGE (page);
+ GsLoadingPagePrivate *priv = gs_loading_page_get_instance_private (self);
- g_return_val_if_fail (GS_IS_SHELL_LOADING (self), TRUE);
+ g_return_val_if_fail (GS_IS_LOADING_PAGE (self), TRUE);
priv->shell = shell;
priv->plugin_loader = g_object_ref (plugin_loader);
@@ -148,53 +148,53 @@ gs_shell_loading_setup (GsPage *page,
}
static void
-gs_shell_loading_dispose (GObject *object)
+gs_loading_page_dispose (GObject *object)
{
- GsShellLoading *self = GS_SHELL_LOADING (object);
- GsShellLoadingPrivate *priv = gs_shell_loading_get_instance_private (self);
+ GsLoadingPage *self = GS_LOADING_PAGE (object);
+ GsLoadingPagePrivate *priv = gs_loading_page_get_instance_private (self);
g_clear_object (&priv->plugin_loader);
g_clear_object (&priv->cancellable);
- G_OBJECT_CLASS (gs_shell_loading_parent_class)->dispose (object);
+ G_OBJECT_CLASS (gs_loading_page_parent_class)->dispose (object);
}
static void
-gs_shell_loading_class_init (GsShellLoadingClass *klass)
+gs_loading_page_class_init (GsLoadingPageClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GsPageClass *page_class = GS_PAGE_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- object_class->dispose = gs_shell_loading_dispose;
- page_class->switch_to = gs_shell_loading_switch_to;
- page_class->setup = gs_shell_loading_setup;
+ object_class->dispose = gs_loading_page_dispose;
+ page_class->switch_to = gs_loading_page_switch_to;
+ page_class->setup = gs_loading_page_setup;
signals [SIGNAL_REFRESHED] =
g_signal_new ("refreshed",
G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GsShellLoadingClass, refreshed),
+ G_STRUCT_OFFSET (GsLoadingPageClass, refreshed),
NULL, NULL, g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-shell-loading.ui");
+ gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-loading-page.ui");
- gtk_widget_class_bind_template_child_private (widget_class, GsShellLoading, progressbar);
- gtk_widget_class_bind_template_child_private (widget_class, GsShellLoading, label);
+ gtk_widget_class_bind_template_child_private (widget_class, GsLoadingPage, progressbar);
+ gtk_widget_class_bind_template_child_private (widget_class, GsLoadingPage, label);
}
static void
-gs_shell_loading_init (GsShellLoading *self)
+gs_loading_page_init (GsLoadingPage *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
}
-GsShellLoading *
-gs_shell_loading_new (void)
+GsLoadingPage *
+gs_loading_page_new (void)
{
- GsShellLoading *self;
- self = g_object_new (GS_TYPE_SHELL_LOADING, NULL);
- return GS_SHELL_LOADING (self);
+ GsLoadingPage *self;
+ self = g_object_new (GS_TYPE_LOADING_PAGE, NULL);
+ return GS_LOADING_PAGE (self);
}
/* vim: set noexpandtab: */
diff --git a/src/gs-shell-loading.h b/src/gs-loading-page.h
similarity index 75%
rename from src/gs-shell-loading.h
rename to src/gs-loading-page.h
index 272e376..5751361 100644
--- a/src/gs-shell-loading.h
+++ b/src/gs-loading-page.h
@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __GS_SHELL_LOADING_H
-#define __GS_SHELL_LOADING_H
+#ifndef __GS_LOADING_PAGE_H
+#define __GS_LOADING_PAGE_H
#include <glib-object.h>
#include <gtk/gtk.h>
@@ -30,21 +30,21 @@
G_BEGIN_DECLS
-#define GS_TYPE_SHELL_LOADING (gs_shell_loading_get_type ())
+#define GS_TYPE_LOADING_PAGE (gs_loading_page_get_type ())
-G_DECLARE_DERIVABLE_TYPE (GsShellLoading, gs_shell_loading, GS, SHELL_LOADING, GsPage)
+G_DECLARE_DERIVABLE_TYPE (GsLoadingPage, gs_loading_page, GS, LOADING_PAGE, GsPage)
-struct _GsShellLoadingClass
+struct _GsLoadingPageClass
{
GsPageClass parent_class;
- void (*refreshed) (GsShellLoading *self);
+ void (*refreshed) (GsLoadingPage *self);
};
-GsShellLoading *gs_shell_loading_new (void);
+GsLoadingPage *gs_loading_page_new (void);
G_END_DECLS
-#endif /* __GS_SHELL_LOADING_H */
+#endif /* __GS_LOADING_PAGE_H */
/* vim: set noexpandtab: */
diff --git a/src/gs-shell-loading.ui b/src/gs-loading-page.ui
similarity index 97%
rename from src/gs-shell-loading.ui
rename to src/gs-loading-page.ui
index d5245ee..fe6a6da 100644
--- a/src/gs-shell-loading.ui
+++ b/src/gs-loading-page.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.10"/>
- <template class="GsShellLoading" parent="GsPage">
+ <template class="GsLoadingPage" parent="GsPage">
<child internal-child="accessible">
<object class="AtkObject" id="loading-accessible">
<property name="accessible-name" translatable="yes">Loading page</property>
diff --git a/src/gs-shell-moderate.c b/src/gs-moderate-page.c
similarity index 69%
rename from src/gs-shell-moderate.c
rename to src/gs-moderate-page.c
index b6d8101..d74d303 100644
--- a/src/gs-shell-moderate.c
+++ b/src/gs-moderate-page.c
@@ -29,10 +29,10 @@
#include "gs-app-row.h"
#include "gs-review-row.h"
#include "gs-shell.h"
-#include "gs-shell-moderate.h"
+#include "gs-moderate-page.h"
#include "gs-common.h"
-struct _GsShellModerate
+struct _GsModeratePage
{
GsPage parent_instance;
@@ -49,12 +49,12 @@ struct _GsShellModerate
GtkWidget *stack_install;
};
-G_DEFINE_TYPE (GsShellModerate, gs_shell_moderate, GS_TYPE_PAGE)
+G_DEFINE_TYPE (GsModeratePage, gs_moderate_page, GS_TYPE_PAGE)
static void
-gs_shell_moderate_app_set_review_cb (GObject *source,
- GAsyncResult *res,
- gpointer user_data)
+gs_moderate_page_app_set_review_cb (GObject *source,
+ GAsyncResult *res,
+ gpointer user_data)
{
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source);
g_autoptr(GError) error = NULL;
@@ -66,9 +66,9 @@ gs_shell_moderate_app_set_review_cb (GObject *source,
}
static void
-gs_shell_moderate_review_clicked_cb (GsReviewRow *row,
- GsPluginAction action,
- GsShellModerate *self)
+gs_moderate_page_review_clicked_cb (GsReviewRow *row,
+ GsPluginAction action,
+ GsModeratePage *self)
{
GsApp *app = g_object_get_data (G_OBJECT (row), "GsApp");
gs_plugin_loader_review_action_async (self->plugin_loader,
@@ -78,16 +78,16 @@ gs_shell_moderate_review_clicked_cb (GsReviewRow *row,
GS_PLUGIN_FAILURE_FLAGS_FATAL_ANY |
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
- gs_shell_moderate_app_set_review_cb,
+ gs_moderate_page_app_set_review_cb,
self);
gtk_widget_set_visible (GTK_WIDGET (row), FALSE);
}
static void
-gs_shell_moderate_selection_changed_cb (GtkListBox *listbox,
- GsAppRow *app_row,
- GsShellModerate *self)
+gs_moderate_page_selection_changed_cb (GtkListBox *listbox,
+ GsAppRow *app_row,
+ GsModeratePage *self)
{
g_autofree gchar *tmp = NULL;
tmp = gs_app_to_string (gs_app_row_get_app (app_row));
@@ -95,7 +95,7 @@ gs_shell_moderate_selection_changed_cb (GtkListBox *listbox,
}
static void
-gs_shell_moderate_add_app (GsShellModerate *self, GsApp *app)
+gs_moderate_page_add_app (GsModeratePage *self, GsApp *app)
{
GPtrArray *reviews;
GtkWidget *app_row;
@@ -127,7 +127,7 @@ gs_shell_moderate_add_app (GsShellModerate *self, GsApp *app)
1 << GS_PLUGIN_ACTION_REVIEW_DISMISS |
1 << GS_PLUGIN_ACTION_REVIEW_REPORT);
g_signal_connect (row, "button-clicked",
- G_CALLBACK (gs_shell_moderate_review_clicked_cb), self);
+ G_CALLBACK (gs_moderate_page_review_clicked_cb), self);
g_object_set_data_full (G_OBJECT (row), "GsApp",
g_object_ref (app),
(GDestroyNotify) g_object_unref);
@@ -137,13 +137,13 @@ gs_shell_moderate_add_app (GsShellModerate *self, GsApp *app)
}
static void
-gs_shell_moderate_get_unvoted_reviews_cb (GObject *source_object,
- GAsyncResult *res,
- gpointer user_data)
+gs_moderate_page_get_unvoted_reviews_cb (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
{
guint i;
GsApp *app;
- GsShellModerate *self = GS_SHELL_MODERATE (user_data);
+ GsModeratePage *self = GS_MODERATE_PAGE (user_data);
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
g_autoptr(GError) error = NULL;
g_autoptr(GsAppList) list = NULL;
@@ -169,7 +169,7 @@ gs_shell_moderate_get_unvoted_reviews_cb (GObject *source_object,
for (i = 0; i < gs_app_list_length (list); i++) {
app = gs_app_list_index (list, i);
- gs_shell_moderate_add_app (self, app);
+ gs_moderate_page_add_app (self, app);
}
/* seems a good place */
@@ -177,7 +177,7 @@ gs_shell_moderate_get_unvoted_reviews_cb (GObject *source_object,
}
static void
-gs_shell_moderate_load (GsShellModerate *self)
+gs_moderate_page_load (GsModeratePage *self)
{
/* remove old entries */
gs_container_remove_all (GTK_CONTAINER (self->list_box_install));
@@ -193,23 +193,23 @@ gs_shell_moderate_load (GsShellModerate *self)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
- gs_shell_moderate_get_unvoted_reviews_cb,
+ gs_moderate_page_get_unvoted_reviews_cb,
self);
gs_start_spinner (GTK_SPINNER (self->spinner_install));
gtk_stack_set_visible_child_name (GTK_STACK (self->stack_install), "spinner");
}
static void
-gs_shell_moderate_reload (GsPage *page)
+gs_moderate_page_reload (GsPage *page)
{
- GsShellModerate *self = GS_SHELL_MODERATE (page);
- gs_shell_moderate_load (self);
+ GsModeratePage *self = GS_MODERATE_PAGE (page);
+ gs_moderate_page_load (self);
}
static void
-gs_shell_moderate_switch_to (GsPage *page, gboolean scroll_up)
+gs_moderate_page_switch_to (GsPage *page, gboolean scroll_up)
{
- GsShellModerate *self = GS_SHELL_MODERATE (page);
+ GsModeratePage *self = GS_MODERATE_PAGE (page);
if (gs_shell_get_mode (self->shell) != GS_SHELL_MODE_MODERATE) {
g_warning ("Called switch_to(moderate) when in mode %s",
@@ -218,13 +218,13 @@ gs_shell_moderate_switch_to (GsPage *page, gboolean scroll_up)
}
if (gs_shell_get_mode (self->shell) == GS_SHELL_MODE_MODERATE)
gs_grab_focus_when_mapped (self->scrolledwindow_install);
- gs_shell_moderate_load (self);
+ gs_moderate_page_load (self);
}
static void
-gs_shell_moderate_list_header_func (GtkListBoxRow *row,
- GtkListBoxRow *before,
- gpointer user_data)
+gs_moderate_page_list_header_func (GtkListBoxRow *row,
+ GtkListBoxRow *before,
+ gpointer user_data)
{
GtkWidget *header;
gtk_list_box_row_set_header (row, NULL);
@@ -237,30 +237,30 @@ gs_shell_moderate_list_header_func (GtkListBoxRow *row,
}
static gboolean
-gs_shell_moderate_setup (GsPage *page,
- GsShell *shell,
- GsPluginLoader *plugin_loader,
- GtkBuilder *builder,
- GCancellable *cancellable,
- GError **error)
+gs_moderate_page_setup (GsPage *page,
+ GsShell *shell,
+ GsPluginLoader *plugin_loader,
+ GtkBuilder *builder,
+ GCancellable *cancellable,
+ GError **error)
{
- GsShellModerate *self = GS_SHELL_MODERATE (page);
- g_return_val_if_fail (GS_IS_SHELL_MODERATE (self), TRUE);
+ GsModeratePage *self = GS_MODERATE_PAGE (page);
+ g_return_val_if_fail (GS_IS_MODERATE_PAGE (self), TRUE);
self->shell = shell;
self->plugin_loader = g_object_ref (plugin_loader);
self->cancellable = g_object_ref (cancellable);
gtk_list_box_set_header_func (GTK_LIST_BOX (self->list_box_install),
- gs_shell_moderate_list_header_func,
+ gs_moderate_page_list_header_func,
self, NULL);
return TRUE;
}
static void
-gs_shell_moderate_dispose (GObject *object)
+gs_moderate_page_dispose (GObject *object)
{
- GsShellModerate *self = GS_SHELL_MODERATE (object);
+ GsModeratePage *self = GS_MODERATE_PAGE (object);
g_clear_object (&self->sizegroup_image);
g_clear_object (&self->sizegroup_name);
@@ -269,48 +269,48 @@ gs_shell_moderate_dispose (GObject *object)
g_clear_object (&self->plugin_loader);
g_clear_object (&self->cancellable);
- G_OBJECT_CLASS (gs_shell_moderate_parent_class)->dispose (object);
+ G_OBJECT_CLASS (gs_moderate_page_parent_class)->dispose (object);
}
static void
-gs_shell_moderate_class_init (GsShellModerateClass *klass)
+gs_moderate_page_class_init (GsModeratePageClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GsPageClass *page_class = GS_PAGE_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- object_class->dispose = gs_shell_moderate_dispose;
- page_class->switch_to = gs_shell_moderate_switch_to;
- page_class->reload = gs_shell_moderate_reload;
- page_class->setup = gs_shell_moderate_setup;
+ object_class->dispose = gs_moderate_page_dispose;
+ page_class->switch_to = gs_moderate_page_switch_to;
+ page_class->reload = gs_moderate_page_reload;
+ page_class->setup = gs_moderate_page_setup;
- gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/Software/gs-shell-moderate.ui");
+ gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-moderate-page.ui");
- gtk_widget_class_bind_template_child (widget_class, GsShellModerate, list_box_install);
- gtk_widget_class_bind_template_child (widget_class, GsShellModerate, scrolledwindow_install);
- gtk_widget_class_bind_template_child (widget_class, GsShellModerate, spinner_install);
- gtk_widget_class_bind_template_child (widget_class, GsShellModerate, stack_install);
+ gtk_widget_class_bind_template_child (widget_class, GsModeratePage, list_box_install);
+ gtk_widget_class_bind_template_child (widget_class, GsModeratePage, scrolledwindow_install);
+ gtk_widget_class_bind_template_child (widget_class, GsModeratePage, spinner_install);
+ gtk_widget_class_bind_template_child (widget_class, GsModeratePage, stack_install);
}
static void
-gs_shell_moderate_init (GsShellModerate *self)
+gs_moderate_page_init (GsModeratePage *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
g_signal_connect (self->list_box_install, "row-activated",
- G_CALLBACK (gs_shell_moderate_selection_changed_cb), self);
+ G_CALLBACK (gs_moderate_page_selection_changed_cb), self);
self->sizegroup_image = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
self->sizegroup_name = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
self->sizegroup_button = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
}
-GsShellModerate *
-gs_shell_moderate_new (void)
+GsModeratePage *
+gs_moderate_page_new (void)
{
- GsShellModerate *self;
- self = g_object_new (GS_TYPE_SHELL_MODERATE, NULL);
- return GS_SHELL_MODERATE (self);
+ GsModeratePage *self;
+ self = g_object_new (GS_TYPE_MODERATE_PAGE, NULL);
+ return GS_MODERATE_PAGE (self);
}
/* vim: set noexpandtab: */
diff --git a/src/gs-shell-installed.h b/src/gs-moderate-page.h
similarity index 78%
rename from src/gs-shell-installed.h
rename to src/gs-moderate-page.h
index 1b5e9fa..d6527ae 100644
--- a/src/gs-shell-installed.h
+++ b/src/gs-moderate-page.h
@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __GS_SHELL_INSTALLED_H
-#define __GS_SHELL_INSTALLED_H
+#ifndef __GS_MODERATE_PAGE_H
+#define __GS_MODERATE_PAGE_H
#include <glib-object.h>
#include <gtk/gtk.h>
@@ -30,14 +30,14 @@
G_BEGIN_DECLS
-#define GS_TYPE_SHELL_INSTALLED (gs_shell_installed_get_type ())
+#define GS_TYPE_MODERATE_PAGE (gs_moderate_page_get_type ())
-G_DECLARE_FINAL_TYPE (GsShellInstalled, gs_shell_installed, GS, SHELL_INSTALLED, GsPage)
+G_DECLARE_FINAL_TYPE (GsModeratePage, gs_moderate_page, GS, MODERATE_PAGE, GsPage)
-GsShellInstalled *gs_shell_installed_new (void);
+GsModeratePage *gs_moderate_page_new (void);
G_END_DECLS
-#endif /* __GS_SHELL_INSTALLED_H */
+#endif /* __GS_MODERATE_PAGE_H */
/* vim: set noexpandtab: */
diff --git a/src/gs-shell-moderate.ui b/src/gs-moderate-page.ui
similarity index 98%
rename from src/gs-shell-moderate.ui
rename to src/gs-moderate-page.ui
index 60380dc..03d9e78 100644
--- a/src/gs-shell-moderate.ui
+++ b/src/gs-moderate-page.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.10"/>
- <template class="GsShellModerate" parent="GsPage">
+ <template class="GsModeratePage" parent="GsPage">
<child internal-child="accessible">
<object class="AtkObject" id="moderate-accessible">
<property name="accessible-name" translatable="yes">Moderate page</property>
diff --git a/src/gs-shell-overview.c b/src/gs-overview-page.c
similarity index 74%
rename from src/gs-shell-overview.c
rename to src/gs-overview-page.c
index 3a0f443..a27894e 100644
--- a/src/gs-shell-overview.c
+++ b/src/gs-overview-page.c
@@ -25,7 +25,7 @@
#include <math.h>
#include "gs-shell.h"
-#include "gs-shell-overview.h"
+#include "gs-overview-page.h"
#include "gs-app.h"
#include "gs-app-list-private.h"
#include "gs-category.h"
@@ -70,9 +70,9 @@ typedef struct
GtkWidget *categories_expander_button_up;
GtkWidget *categories_expander_box;
GtkWidget *categories_more;
-} GsShellOverviewPrivate;
+} GsOverviewPagePrivate;
-G_DEFINE_TYPE_WITH_PRIVATE (GsShellOverview, gs_shell_overview, GS_TYPE_PAGE)
+G_DEFINE_TYPE_WITH_PRIVATE (GsOverviewPage, gs_overview_page, GS_TYPE_PAGE)
enum {
SIGNAL_REFRESHED,
@@ -83,7 +83,7 @@ static guint signals [SIGNAL_LAST] = { 0 };
typedef struct {
GsCategory *category;
- GsShellOverview *self;
+ GsOverviewPage *self;
const gchar *title;
} LoadData;
@@ -98,9 +98,9 @@ load_data_free (LoadData *data)
}
static void
-gs_shell_overview_invalidate (GsShellOverview *self)
+gs_overview_page_invalidate (GsOverviewPage *self)
{
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
priv->cache_valid = FALSE;
}
@@ -108,8 +108,8 @@ gs_shell_overview_invalidate (GsShellOverview *self)
static void
app_tile_clicked (GsAppTile *tile, gpointer data)
{
- GsShellOverview *self = GS_SHELL_OVERVIEW (data);
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPage *self = GS_OVERVIEW_PAGE (data);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
GsApp *app;
app = gs_app_tile_get_app (tile);
@@ -125,9 +125,9 @@ filter_category (GsApp *app, gpointer user_data)
}
static void
-gs_shell_overview_decrement_action_cnt (GsShellOverview *self)
+gs_overview_page_decrement_action_cnt (GsOverviewPage *self)
{
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
/* every job increcements this */
if (priv->action_cnt == 0) {
@@ -150,12 +150,12 @@ gs_shell_overview_decrement_action_cnt (GsShellOverview *self)
}
static void
-gs_shell_overview_get_popular_cb (GObject *source_object,
- GAsyncResult *res,
- gpointer user_data)
+gs_overview_page_get_popular_cb (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
{
- GsShellOverview *self = GS_SHELL_OVERVIEW (user_data);
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPage *self = GS_OVERVIEW_PAGE (user_data);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
guint i;
GsApp *app;
@@ -189,13 +189,13 @@ gs_shell_overview_get_popular_cb (GObject *source_object,
priv->empty = FALSE;
out:
- gs_shell_overview_decrement_action_cnt (self);
+ gs_overview_page_decrement_action_cnt (self);
}
static void
-gs_shell_overview_category_more_cb (GtkButton *button, GsShellOverview *self)
+gs_overview_page_category_more_cb (GtkButton *button, GsOverviewPage *self)
{
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
GsCategory *cat;
const gchar *id;
@@ -209,13 +209,13 @@ gs_shell_overview_category_more_cb (GtkButton *button, GsShellOverview *self)
}
static void
-gs_shell_overview_get_category_apps_cb (GObject *source_object,
- GAsyncResult *res,
- gpointer user_data)
+gs_overview_page_get_category_apps_cb (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
{
LoadData *load_data = (LoadData *) user_data;
- GsShellOverview *self = load_data->self;
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPage *self = load_data->self;
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
guint i;
GsApp *app;
@@ -271,7 +271,7 @@ gs_shell_overview_get_category_apps_cb (GObject *source_object,
gtk_widget_set_valign (button, GTK_ALIGN_END);
gtk_widget_set_margin_bottom (button, 9);
g_signal_connect (button, "clicked",
- G_CALLBACK (gs_shell_overview_category_more_cb), self);
+ G_CALLBACK (gs_overview_page_category_more_cb), self);
gtk_container_add (GTK_CONTAINER (headerbox), button);
gtk_container_add (GTK_CONTAINER (priv->box_overview), headerbox);
@@ -295,16 +295,16 @@ gs_shell_overview_get_category_apps_cb (GObject *source_object,
out:
load_data_free (load_data);
- gs_shell_overview_decrement_action_cnt (self);
+ gs_overview_page_decrement_action_cnt (self);
}
static void
-gs_shell_overview_get_featured_cb (GObject *source_object,
- GAsyncResult *res,
- gpointer user_data)
+gs_overview_page_get_featured_cb (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
{
- GsShellOverview *self = GS_SHELL_OVERVIEW (user_data);
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPage *self = GS_OVERVIEW_PAGE (user_data);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
GtkWidget *tile;
GsApp *app;
@@ -346,14 +346,14 @@ gs_shell_overview_get_featured_cb (GObject *source_object,
priv->empty = FALSE;
out:
- gs_shell_overview_decrement_action_cnt (self);
+ gs_overview_page_decrement_action_cnt (self);
}
static void
category_tile_clicked (GsCategoryTile *tile, gpointer data)
{
- GsShellOverview *self = GS_SHELL_OVERVIEW (data);
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPage *self = GS_OVERVIEW_PAGE (data);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
GsCategory *category;
category = gs_category_tile_get_category (tile);
@@ -361,12 +361,12 @@ category_tile_clicked (GsCategoryTile *tile, gpointer data)
}
static void
-gs_shell_overview_get_categories_cb (GObject *source_object,
- GAsyncResult *res,
- gpointer user_data)
+gs_overview_page_get_categories_cb (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
{
- GsShellOverview *self = GS_SHELL_OVERVIEW (user_data);
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPage *self = GS_OVERVIEW_PAGE (user_data);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
guint i;
GsCategory *cat;
@@ -418,11 +418,11 @@ out:
priv->empty = FALSE;
gtk_widget_set_visible (priv->category_heading, added_cnt > 0);
- gs_shell_overview_decrement_action_cnt (self);
+ gs_overview_page_decrement_action_cnt (self);
}
static const gchar *
-gs_shell_overview_get_category_label (const gchar *id)
+gs_overview_page_get_category_label (const gchar *id)
{
if (g_strcmp0 (id, "audio-video") == 0) {
/* TRANSLATORS: this is a heading for audio applications which
@@ -448,7 +448,7 @@ gs_shell_overview_get_category_label (const gchar *id)
}
static GPtrArray *
-gs_shell_overview_get_random_categories (void)
+gs_overview_page_get_random_categories (void)
{
GPtrArray *cats;
guint i;
@@ -483,9 +483,9 @@ gs_shell_overview_get_random_categories (void)
}
static void
-gs_shell_overview_load (GsShellOverview *self)
+gs_overview_page_load (GsOverviewPage *self)
{
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
guint i;
priv->empty = TRUE;
@@ -496,7 +496,7 @@ gs_shell_overview_load (GsShellOverview *self)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
priv->cancellable,
- gs_shell_overview_get_featured_cb,
+ gs_overview_page_get_featured_cb,
self);
priv->action_cnt++;
}
@@ -508,7 +508,7 @@ gs_shell_overview_load (GsShellOverview *self)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
priv->cancellable,
- gs_shell_overview_get_popular_cb,
+ gs_overview_page_get_popular_cb,
self);
priv->action_cnt++;
}
@@ -516,7 +516,7 @@ gs_shell_overview_load (GsShellOverview *self)
if (!priv->loading_popular_rotating) {
const guint MAX_CATS = 2;
g_autoptr(GPtrArray) cats_random = NULL;
- cats_random = gs_shell_overview_get_random_categories ();
+ cats_random = gs_overview_page_get_random_categories ();
/* load all the categories */
for (i = 0; i < cats_random->len && i < MAX_CATS; i++) {
@@ -537,14 +537,14 @@ gs_shell_overview_load (GsShellOverview *self)
load_data = g_slice_new0 (LoadData);
load_data->category = g_object_ref (category);
load_data->self = g_object_ref (self);
- load_data->title = gs_shell_overview_get_category_label (cat_id);
+ load_data->title = gs_overview_page_get_category_label (cat_id);
gs_plugin_loader_get_category_apps_async (priv->plugin_loader,
featured_category,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEW_RATINGS |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
priv->cancellable,
- gs_shell_overview_get_category_apps_cb,
+ gs_overview_page_get_category_apps_cb,
load_data);
priv->action_cnt++;
}
@@ -557,25 +557,25 @@ gs_shell_overview_load (GsShellOverview *self)
GS_PLUGIN_REFINE_FLAGS_DEFAULT,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
priv->cancellable,
- gs_shell_overview_get_categories_cb,
+ gs_overview_page_get_categories_cb,
self);
priv->action_cnt++;
}
}
static void
-gs_shell_overview_reload (GsPage *page)
+gs_overview_page_reload (GsPage *page)
{
- GsShellOverview *self = GS_SHELL_OVERVIEW (page);
- gs_shell_overview_invalidate (self);
- gs_shell_overview_load (self);
+ GsOverviewPage *self = GS_OVERVIEW_PAGE (page);
+ gs_overview_page_invalidate (self);
+ gs_overview_page_load (self);
}
static void
-gs_shell_overview_switch_to (GsPage *page, gboolean scroll_up)
+gs_overview_page_switch_to (GsPage *page, gboolean scroll_up)
{
- GsShellOverview *self = GS_SHELL_OVERVIEW (page);
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPage *self = GS_OVERVIEW_PAGE (page);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
GtkWidget *widget;
GtkAdjustment *adj;
@@ -605,15 +605,15 @@ gs_shell_overview_switch_to (GsPage *page, gboolean scroll_up)
if (priv->cache_valid || priv->action_cnt > 0)
return;
- gs_shell_overview_load (self);
+ gs_overview_page_load (self);
}
static void
categories_more_revealer_changed_cb (GtkRevealer *revealer,
GParamSpec *pspec,
- GsShellOverview *self)
+ GsOverviewPage *self)
{
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
gboolean child_revealed = gtk_revealer_get_child_revealed (revealer);
gtk_widget_set_visible (priv->categories_expander_button_up,
@@ -623,31 +623,31 @@ categories_more_revealer_changed_cb (GtkRevealer *revealer,
}
static void
-gs_shell_overview_categories_expander_down_cb (GtkButton *button, GsShellOverview *self)
+gs_overview_page_categories_expander_down_cb (GtkButton *button, GsOverviewPage *self)
{
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
gtk_revealer_set_transition_duration (GTK_REVEALER (priv->categories_more), 250);
gtk_revealer_set_reveal_child (GTK_REVEALER (priv->categories_more), TRUE);
}
static void
-gs_shell_overview_categories_expander_up_cb (GtkButton *button, GsShellOverview *self)
+gs_overview_page_categories_expander_up_cb (GtkButton *button, GsOverviewPage *self)
{
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
gtk_revealer_set_transition_duration (GTK_REVEALER (priv->categories_more), 250);
gtk_revealer_set_reveal_child (GTK_REVEALER (priv->categories_more), FALSE);
}
static void
-g_shell_overview_get_sources_cb (GsPluginLoader *plugin_loader,
- GAsyncResult *res,
- GsShellOverview *self)
+g_overview_page_get_sources_cb (GsPluginLoader *plugin_loader,
+ GAsyncResult *res,
+ GsOverviewPage *self)
{
guint i;
g_auto(GStrv) nonfree_ids = NULL;
g_autoptr(GError) error = NULL;
g_autoptr(GsAppList) list = NULL;
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
/* get the results */
list = gs_plugin_loader_get_sources_finish (plugin_loader, res, &error);
@@ -694,23 +694,23 @@ g_shell_overview_get_sources_cb (GsPluginLoader *plugin_loader,
}
static void
-g_shell_overview_rescan_proprietary_sources (GsShellOverview *self)
+g_overview_page_rescan_proprietary_sources (GsOverviewPage *self)
{
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
gs_plugin_loader_get_sources_async (priv->plugin_loader,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_SETUP_ACTION,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
priv->cancellable,
- (GAsyncReadyCallback) g_shell_overview_get_sources_cb,
+ (GAsyncReadyCallback) g_overview_page_get_sources_cb,
self);
}
static void
-g_shell_overview_proprietary_response_cb (GtkInfoBar *info_bar,
- gint response_id,
- GsShellOverview *self)
+g_overview_page_proprietary_response_cb (GtkInfoBar *info_bar,
+ gint response_id,
+ GsOverviewPage *self)
{
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
g_settings_set_boolean (priv->settings, "show-nonfree-prompt", FALSE);
if (response_id == GTK_RESPONSE_CLOSE) {
gtk_widget_hide (priv->infobar_proprietary);
@@ -721,13 +721,13 @@ g_shell_overview_proprietary_response_cb (GtkInfoBar *info_bar,
g_settings_set_boolean (priv->settings, "show-nonfree-software", TRUE);
/* actually call into the plugin loader and do the action */
- g_shell_overview_rescan_proprietary_sources (self);
+ g_overview_page_rescan_proprietary_sources (self);
}
static void
-gs_shell_overview_refresh_proprietary (GsShellOverview *self)
+gs_overview_page_refresh_proprietary (GsOverviewPage *self)
{
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
g_auto(GStrv) nonfree_ids = NULL;
/* only show if never prompted and have nonfree repos */
@@ -763,20 +763,20 @@ gs_shell_overview_refresh_proprietary (GsShellOverview *self)
}
static gboolean
-gs_shell_overview_setup (GsPage *page,
- GsShell *shell,
- GsPluginLoader *plugin_loader,
- GtkBuilder *builder,
- GCancellable *cancellable,
- GError **error)
+gs_overview_page_setup (GsPage *page,
+ GsShell *shell,
+ GsPluginLoader *plugin_loader,
+ GtkBuilder *builder,
+ GCancellable *cancellable,
+ GError **error)
{
- GsShellOverview *self = GS_SHELL_OVERVIEW (page);
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPage *self = GS_OVERVIEW_PAGE (page);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
GtkAdjustment *adj;
GtkWidget *tile;
gint i;
- g_return_val_if_fail (GS_IS_SHELL_OVERVIEW (self), TRUE);
+ g_return_val_if_fail (GS_IS_OVERVIEW_PAGE (self), TRUE);
priv->plugin_loader = g_object_ref (plugin_loader);
priv->builder = g_object_ref (builder);
@@ -785,12 +785,12 @@ gs_shell_overview_setup (GsPage *page,
g_free, (GDestroyNotify) g_object_unref);
/* create info bar if not already dismissed in initial-setup */
- gs_shell_overview_refresh_proprietary (self);
+ gs_overview_page_refresh_proprietary (self);
gtk_info_bar_add_button (GTK_INFO_BAR (priv->infobar_proprietary),
/* TRANSLATORS: button to turn on proprietary software sources */
_("Enable"), GTK_RESPONSE_YES);
g_signal_connect (priv->infobar_proprietary, "response",
- G_CALLBACK (g_shell_overview_proprietary_response_cb), self);
+ G_CALLBACK (g_overview_page_proprietary_response_cb), self);
/* avoid a ref cycle */
priv->shell = shell;
@@ -808,29 +808,29 @@ gs_shell_overview_setup (GsPage *page,
/* handle category expander */
g_signal_connect (priv->categories_expander_button_down, "clicked",
- G_CALLBACK (gs_shell_overview_categories_expander_down_cb), self);
+ G_CALLBACK (gs_overview_page_categories_expander_down_cb), self);
g_signal_connect (priv->categories_expander_button_up, "clicked",
- G_CALLBACK (gs_shell_overview_categories_expander_up_cb), self);
+ G_CALLBACK (gs_overview_page_categories_expander_up_cb), self);
return TRUE;
}
static void
settings_changed_cb (GSettings *settings,
const gchar *key,
- GsShellOverview *self)
+ GsOverviewPage *self)
{
if (g_strcmp0 (key, "show-nonfree-software") == 0 ||
g_strcmp0 (key, "show-nonfree-prompt") == 0 ||
g_strcmp0 (key, "nonfree-software-uri") == 0 ||
g_strcmp0 (key, "nonfree-sources") == 0) {
- gs_shell_overview_refresh_proprietary (self);
+ gs_overview_page_refresh_proprietary (self);
}
}
static void
-gs_shell_overview_init (GsShellOverview *self)
+gs_overview_page_init (GsOverviewPage *self)
{
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
gtk_widget_init_template (GTK_WIDGET (self));
priv->settings = g_settings_new ("org.gnome.software");
g_signal_connect (priv->settings, "changed",
@@ -843,10 +843,10 @@ gs_shell_overview_init (GsShellOverview *self)
}
static void
-gs_shell_overview_dispose (GObject *object)
+gs_overview_page_dispose (GObject *object)
{
- GsShellOverview *self = GS_SHELL_OVERVIEW (object);
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPage *self = GS_OVERVIEW_PAGE (object);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
g_clear_object (&priv->builder);
g_clear_object (&priv->plugin_loader);
@@ -855,13 +855,13 @@ gs_shell_overview_dispose (GObject *object)
g_clear_pointer (&priv->category_of_day, g_free);
g_clear_pointer (&priv->category_hash, g_hash_table_unref);
- G_OBJECT_CLASS (gs_shell_overview_parent_class)->dispose (object);
+ G_OBJECT_CLASS (gs_overview_page_parent_class)->dispose (object);
}
static void
-gs_shell_overview_refreshed (GsShellOverview *self)
+gs_overview_page_refreshed (GsOverviewPage *self)
{
- GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
+ GsOverviewPagePrivate *priv = gs_overview_page_get_instance_private (self);
if (priv->empty) {
gtk_stack_set_visible_child_name (GTK_STACK (priv->stack_overview), "no-results");
@@ -871,49 +871,49 @@ gs_shell_overview_refreshed (GsShellOverview *self)
}
static void
-gs_shell_overview_class_init (GsShellOverviewClass *klass)
+gs_overview_page_class_init (GsOverviewPageClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GsPageClass *page_class = GS_PAGE_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- object_class->dispose = gs_shell_overview_dispose;
- page_class->switch_to = gs_shell_overview_switch_to;
- page_class->reload = gs_shell_overview_reload;
- page_class->setup = gs_shell_overview_setup;
- klass->refreshed = gs_shell_overview_refreshed;
+ object_class->dispose = gs_overview_page_dispose;
+ page_class->switch_to = gs_overview_page_switch_to;
+ page_class->reload = gs_overview_page_reload;
+ page_class->setup = gs_overview_page_setup;
+ klass->refreshed = gs_overview_page_refreshed;
signals [SIGNAL_REFRESHED] =
g_signal_new ("refreshed",
G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GsShellOverviewClass, refreshed),
+ G_STRUCT_OFFSET (GsOverviewPageClass, refreshed),
NULL, NULL, g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/Software/gs-shell-overview.ui");
-
- gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, infobar_proprietary);
- gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, label_proprietary);
- gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, bin_featured);
- gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, box_overview);
- gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, box_popular);
- gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, category_heading);
- gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, featured_heading);
- gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, flowbox_categories);
- gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, flowbox_categories2);
- gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, popular_heading);
- gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, scrolledwindow_overview);
- gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, stack_overview);
- gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview,
categories_expander_button_down);
- gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview,
categories_expander_button_up);
- gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, categories_expander_box);
- gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, categories_more);
+ gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-overview-page.ui");
+
+ gtk_widget_class_bind_template_child_private (widget_class, GsOverviewPage, infobar_proprietary);
+ gtk_widget_class_bind_template_child_private (widget_class, GsOverviewPage, label_proprietary);
+ gtk_widget_class_bind_template_child_private (widget_class, GsOverviewPage, bin_featured);
+ gtk_widget_class_bind_template_child_private (widget_class, GsOverviewPage, box_overview);
+ gtk_widget_class_bind_template_child_private (widget_class, GsOverviewPage, box_popular);
+ gtk_widget_class_bind_template_child_private (widget_class, GsOverviewPage, category_heading);
+ gtk_widget_class_bind_template_child_private (widget_class, GsOverviewPage, featured_heading);
+ gtk_widget_class_bind_template_child_private (widget_class, GsOverviewPage, flowbox_categories);
+ gtk_widget_class_bind_template_child_private (widget_class, GsOverviewPage, flowbox_categories2);
+ gtk_widget_class_bind_template_child_private (widget_class, GsOverviewPage, popular_heading);
+ gtk_widget_class_bind_template_child_private (widget_class, GsOverviewPage, scrolledwindow_overview);
+ gtk_widget_class_bind_template_child_private (widget_class, GsOverviewPage, stack_overview);
+ gtk_widget_class_bind_template_child_private (widget_class, GsOverviewPage,
categories_expander_button_down);
+ gtk_widget_class_bind_template_child_private (widget_class, GsOverviewPage,
categories_expander_button_up);
+ gtk_widget_class_bind_template_child_private (widget_class, GsOverviewPage, categories_expander_box);
+ gtk_widget_class_bind_template_child_private (widget_class, GsOverviewPage, categories_more);
}
-GsShellOverview *
-gs_shell_overview_new (void)
+GsOverviewPage *
+gs_overview_page_new (void)
{
- return GS_SHELL_OVERVIEW (g_object_new (GS_TYPE_SHELL_OVERVIEW, NULL));
+ return GS_OVERVIEW_PAGE (g_object_new (GS_TYPE_OVERVIEW_PAGE, NULL));
}
/* vim: set noexpandtab: */
diff --git a/src/gs-shell-overview.h b/src/gs-overview-page.h
similarity index 73%
rename from src/gs-shell-overview.h
rename to src/gs-overview-page.h
index f873411..a2a2313 100644
--- a/src/gs-shell-overview.h
+++ b/src/gs-overview-page.h
@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __GS_SHELL_OVERVIEW_H
-#define __GS_SHELL_OVERVIEW_H
+#ifndef __GS_OVERVIEW_PAGE_H
+#define __GS_OVERVIEW_PAGE_H
#include <glib-object.h>
#include <gtk/gtk.h>
@@ -32,23 +32,23 @@
G_BEGIN_DECLS
-#define GS_TYPE_SHELL_OVERVIEW (gs_shell_overview_get_type ())
+#define GS_TYPE_OVERVIEW_PAGE (gs_overview_page_get_type ())
-G_DECLARE_DERIVABLE_TYPE (GsShellOverview, gs_shell_overview, GS, SHELL_OVERVIEW, GsPage)
+G_DECLARE_DERIVABLE_TYPE (GsOverviewPage, gs_overview_page, GS, OVERVIEW_PAGE, GsPage)
-struct _GsShellOverviewClass
+struct _GsOverviewPageClass
{
GsPageClass parent_class;
- void (*refreshed) (GsShellOverview *self);
+ void (*refreshed) (GsOverviewPage *self);
};
-GsShellOverview *gs_shell_overview_new (void);
-void gs_shell_overview_set_category (GsShellOverview *self,
+GsOverviewPage *gs_overview_page_new (void);
+void gs_overview_page_set_category (GsOverviewPage *self,
const gchar *category);
G_END_DECLS
-#endif /* __GS_SHELL_OVERVIEW_H */
+#endif /* __GS_OVERVIEW_PAGE_H */
/* vim: set noexpandtab: */
diff --git a/src/gs-shell-overview.ui b/src/gs-overview-page.ui
similarity index 99%
rename from src/gs-shell-overview.ui
rename to src/gs-overview-page.ui
index 52e7fbe..dfd6b8a 100644
--- a/src/gs-shell-overview.ui
+++ b/src/gs-overview-page.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.10"/>
- <template class="GsShellOverview" parent="GsPage">
+ <template class="GsOverviewPage" parent="GsPage">
<child internal-child="accessible">
<object class="AtkObject" id="overview-accessible">
<property name="accessible-name" translatable="yes">Overview page</property>
diff --git a/src/gs-shell-search.c b/src/gs-search-page.c
similarity index 71%
rename from src/gs-shell-search.c
rename to src/gs-search-page.c
index 96e981b..90aee1e 100644
--- a/src/gs-shell-search.c
+++ b/src/gs-search-page.c
@@ -24,13 +24,13 @@
#include <string.h>
#include <glib/gi18n.h>
-#include "gs-shell-search.h"
+#include "gs-search-page.h"
#include "gs-shell.h"
#include "gs-app.h"
#include "gs-common.h"
#include "gs-app-row.h"
-struct _GsShellSearch
+struct _GsSearchPage
{
GsPage parent_instance;
@@ -52,12 +52,12 @@ struct _GsShellSearch
GtkWidget *stack_search;
};
-G_DEFINE_TYPE (GsShellSearch, gs_shell_search, GS_TYPE_PAGE)
+G_DEFINE_TYPE (GsSearchPage, gs_search_page, GS_TYPE_PAGE)
static void
-gs_shell_search_app_row_activated_cb (GtkListBox *list_box,
- GtkListBoxRow *row,
- GsShellSearch *self)
+gs_search_page_app_row_activated_cb (GtkListBox *list_box,
+ GtkListBoxRow *row,
+ GsSearchPage *self)
{
GsApp *app;
app = gs_app_row_get_app (GS_APP_ROW (row));
@@ -65,8 +65,8 @@ gs_shell_search_app_row_activated_cb (GtkListBox *list_box,
}
static void
-gs_shell_search_app_row_clicked_cb (GsAppRow *app_row,
- GsShellSearch *self)
+gs_search_page_app_row_clicked_cb (GsAppRow *app_row,
+ GsSearchPage *self)
{
GsApp *app;
app = gs_app_row_get_app (app_row);
@@ -87,7 +87,7 @@ gs_shell_search_app_row_clicked_cb (GsAppRow *app_row,
}
static void
-gs_shell_search_waiting_cancel (GsShellSearch *self)
+gs_search_page_waiting_cancel (GsSearchPage *self)
{
if (self->waiting_id > 0)
g_source_remove (self->waiting_id);
@@ -95,20 +95,20 @@ gs_shell_search_waiting_cancel (GsShellSearch *self)
}
static void
-gs_shell_search_get_search_cb (GObject *source_object,
- GAsyncResult *res,
- gpointer user_data)
+gs_search_page_get_search_cb (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
{
guint i;
GsApp *app;
- GsShellSearch *self = GS_SHELL_SEARCH (user_data);
+ GsSearchPage *self = GS_SEARCH_PAGE (user_data);
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
GtkWidget *app_row;
g_autoptr(GError) error = NULL;
g_autoptr(GsAppList) list = NULL;
/* don't do the delayed spinner */
- gs_shell_search_waiting_cancel (self);
+ gs_search_page_waiting_cancel (self);
list = gs_plugin_loader_search_finish (plugin_loader, res, &error);
if (list == NULL) {
@@ -141,7 +141,7 @@ gs_shell_search_get_search_cb (GObject *source_object,
gs_utils_list_has_app_fuzzy (list, app))
gs_app_row_set_show_source (GS_APP_ROW (app_row), TRUE);
g_signal_connect (app_row, "button-clicked",
- G_CALLBACK (gs_shell_search_app_row_clicked_cb),
+ G_CALLBACK (gs_search_page_app_row_clicked_cb),
self);
gtk_container_add (GTK_CONTAINER (self->list_box_search), app_row);
gs_app_row_set_size_groups (GS_APP_ROW (app_row),
@@ -163,19 +163,19 @@ gs_shell_search_get_search_cb (GObject *source_object,
}
static gboolean
-gs_shell_search_waiting_show_cb (gpointer user_data)
+gs_search_page_waiting_show_cb (gpointer user_data)
{
- GsShellSearch *self = GS_SHELL_SEARCH (user_data);
+ GsSearchPage *self = GS_SEARCH_PAGE (user_data);
/* show spinner */
gtk_stack_set_visible_child_name (GTK_STACK (self->stack_search), "spinner");
gs_start_spinner (GTK_SPINNER (self->spinner_search));
- gs_shell_search_waiting_cancel (self);
+ gs_search_page_waiting_cancel (self);
return FALSE;
}
static void
-gs_shell_search_load (GsShellSearch *self)
+gs_search_page_load (GsSearchPage *self)
{
/* cancel any pending searches */
if (self->search_cancellable != NULL) {
@@ -185,8 +185,8 @@ gs_shell_search_load (GsShellSearch *self)
self->search_cancellable = g_cancellable_new ();
/* search for apps */
- gs_shell_search_waiting_cancel (self);
- self->waiting_id = g_timeout_add (250, gs_shell_search_waiting_show_cb, self);
+ gs_search_page_waiting_cancel (self);
+ self->waiting_id = g_timeout_add (250, gs_search_page_waiting_show_cb, self);
gs_plugin_loader_search_async (self->plugin_loader,
self->value,
@@ -203,38 +203,38 @@ gs_shell_search_load (GsShellSearch *self)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->search_cancellable,
- gs_shell_search_get_search_cb,
+ gs_search_page_get_search_cb,
self);
}
static void
-gs_shell_search_reload (GsPage *page)
+gs_search_page_reload (GsPage *page)
{
- GsShellSearch *self = GS_SHELL_SEARCH (page);
+ GsSearchPage *self = GS_SEARCH_PAGE (page);
if (self->value != NULL)
- gs_shell_search_load (self);
+ gs_search_page_load (self);
}
/**
- * gs_shell_search_set_appid_to_show:
+ * gs_search_page_set_appid_to_show:
*
* Switch to the specified app id after loading the search results.
**/
void
-gs_shell_search_set_appid_to_show (GsShellSearch *self, const gchar *appid)
+gs_search_page_set_appid_to_show (GsSearchPage *self, const gchar *appid)
{
g_free (self->appid_to_show);
self->appid_to_show = g_strdup (appid);
}
const gchar *
-gs_shell_search_get_text (GsShellSearch *self)
+gs_search_page_get_text (GsSearchPage *self)
{
return self->value;
}
void
-gs_shell_search_set_text (GsShellSearch *self, const gchar *value)
+gs_search_page_set_text (GsSearchPage *self, const gchar *value)
{
if (value == self->value)
return;
@@ -243,9 +243,9 @@ gs_shell_search_set_text (GsShellSearch *self, const gchar *value)
}
static void
-gs_shell_search_switch_to (GsPage *page, gboolean scroll_up)
+gs_search_page_switch_to (GsPage *page, gboolean scroll_up)
{
- GsShellSearch *self = GS_SHELL_SEARCH (page);
+ GsSearchPage *self = GS_SEARCH_PAGE (page);
GtkWidget *widget;
if (gs_shell_get_mode (self->shell) != GS_SHELL_MODE_SEARCH) {
@@ -270,11 +270,11 @@ gs_shell_search_switch_to (GsPage *page, gboolean scroll_up)
gtk_adjustment_set_value (adj, gtk_adjustment_get_lower (adj));
}
- gs_shell_search_load (self);
+ gs_search_page_load (self);
}
/**
- * gs_shell_installed_sort_func:
+ * gs_installed_page_sort_func:
*
* Get a sort key to achive this:
*
@@ -285,7 +285,7 @@ gs_shell_search_switch_to (GsPage *page, gboolean scroll_up)
* 5. Name
**/
static gchar *
-gs_shell_search_get_app_sort_key (GsApp *app)
+gs_search_page_get_app_sort_key (GsApp *app)
{
GPtrArray *ss;
GString *key;
@@ -333,23 +333,23 @@ gs_shell_search_get_app_sort_key (GsApp *app)
}
static gint
-gs_shell_search_sort_func (GtkListBoxRow *a,
- GtkListBoxRow *b,
- gpointer user_data)
+gs_search_page_sort_func (GtkListBoxRow *a,
+ GtkListBoxRow *b,
+ gpointer user_data)
{
GsApp *a1 = gs_app_row_get_app (GS_APP_ROW (a));
GsApp *a2 = gs_app_row_get_app (GS_APP_ROW (b));
- g_autofree gchar *key1 = gs_shell_search_get_app_sort_key (a1);
- g_autofree gchar *key2 = gs_shell_search_get_app_sort_key (a2);
+ g_autofree gchar *key1 = gs_search_page_get_app_sort_key (a1);
+ g_autofree gchar *key2 = gs_search_page_get_app_sort_key (a2);
/* compare the keys according to the algorithm above */
return g_strcmp0 (key2, key1);
}
static void
-gs_shell_search_list_header_func (GtkListBoxRow *row,
- GtkListBoxRow *before,
- gpointer user_data)
+gs_search_page_list_header_func (GtkListBoxRow *row,
+ GtkListBoxRow *before,
+ gpointer user_data)
{
GtkWidget *header;
@@ -370,36 +370,36 @@ gs_shell_search_list_header_func (GtkListBoxRow *row,
}
static void
-gs_shell_search_cancel_cb (GCancellable *cancellable,
- GsShellSearch *self)
+gs_search_page_cancel_cb (GCancellable *cancellable,
+ GsSearchPage *self)
{
if (self->search_cancellable != NULL)
g_cancellable_cancel (self->search_cancellable);
}
static void
-gs_shell_search_app_installed (GsPage *page, GsApp *app)
+gs_search_page_app_installed (GsPage *page, GsApp *app)
{
- gs_shell_search_reload (page);
+ gs_search_page_reload (page);
}
static void
-gs_shell_search_app_removed (GsPage *page, GsApp *app)
+gs_search_page_app_removed (GsPage *page, GsApp *app)
{
- gs_shell_search_reload (page);
+ gs_search_page_reload (page);
}
static gboolean
-gs_shell_search_setup (GsPage *page,
- GsShell *shell,
- GsPluginLoader *plugin_loader,
- GtkBuilder *builder,
- GCancellable *cancellable,
- GError **error)
+gs_search_page_setup (GsPage *page,
+ GsShell *shell,
+ GsPluginLoader *plugin_loader,
+ GtkBuilder *builder,
+ GCancellable *cancellable,
+ GError **error)
{
- GsShellSearch *self = GS_SHELL_SEARCH (page);
+ GsSearchPage *self = GS_SEARCH_PAGE (page);
- g_return_val_if_fail (GS_IS_SHELL_SEARCH (self), TRUE);
+ g_return_val_if_fail (GS_IS_SEARCH_PAGE (self), TRUE);
self->plugin_loader = g_object_ref (plugin_loader);
self->builder = g_object_ref (builder);
@@ -408,25 +408,25 @@ gs_shell_search_setup (GsPage *page,
/* connect the cancellables */
g_cancellable_connect (self->cancellable,
- G_CALLBACK (gs_shell_search_cancel_cb),
+ G_CALLBACK (gs_search_page_cancel_cb),
self, NULL);
/* setup search */
g_signal_connect (self->list_box_search, "row-activated",
- G_CALLBACK (gs_shell_search_app_row_activated_cb), self);
+ G_CALLBACK (gs_search_page_app_row_activated_cb), self);
gtk_list_box_set_header_func (GTK_LIST_BOX (self->list_box_search),
- gs_shell_search_list_header_func,
+ gs_search_page_list_header_func,
self, NULL);
gtk_list_box_set_sort_func (GTK_LIST_BOX (self->list_box_search),
- gs_shell_search_sort_func,
+ gs_search_page_sort_func,
self, NULL);
return TRUE;
}
static void
-gs_shell_search_dispose (GObject *object)
+gs_search_page_dispose (GObject *object)
{
- GsShellSearch *self = GS_SHELL_SEARCH (object);
+ GsSearchPage *self = GS_SEARCH_PAGE (object);
g_clear_object (&self->sizegroup_image);
g_clear_object (&self->sizegroup_name);
@@ -437,45 +437,45 @@ gs_shell_search_dispose (GObject *object)
g_clear_object (&self->cancellable);
g_clear_object (&self->search_cancellable);
- G_OBJECT_CLASS (gs_shell_search_parent_class)->dispose (object);
+ G_OBJECT_CLASS (gs_search_page_parent_class)->dispose (object);
}
static void
-gs_shell_search_finalize (GObject *object)
+gs_search_page_finalize (GObject *object)
{
- GsShellSearch *self = GS_SHELL_SEARCH (object);
+ GsSearchPage *self = GS_SEARCH_PAGE (object);
g_free (self->appid_to_show);
g_free (self->value);
- G_OBJECT_CLASS (gs_shell_search_parent_class)->finalize (object);
+ G_OBJECT_CLASS (gs_search_page_parent_class)->finalize (object);
}
static void
-gs_shell_search_class_init (GsShellSearchClass *klass)
+gs_search_page_class_init (GsSearchPageClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GsPageClass *page_class = GS_PAGE_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- object_class->dispose = gs_shell_search_dispose;
- object_class->finalize = gs_shell_search_finalize;
- page_class->app_installed = gs_shell_search_app_installed;
- page_class->app_removed = gs_shell_search_app_removed;
- page_class->switch_to = gs_shell_search_switch_to;
- page_class->reload = gs_shell_search_reload;
- page_class->setup = gs_shell_search_setup;
+ object_class->dispose = gs_search_page_dispose;
+ object_class->finalize = gs_search_page_finalize;
+ page_class->app_installed = gs_search_page_app_installed;
+ page_class->app_removed = gs_search_page_app_removed;
+ page_class->switch_to = gs_search_page_switch_to;
+ page_class->reload = gs_search_page_reload;
+ page_class->setup = gs_search_page_setup;
- gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-shell-search.ui");
+ gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-search-page.ui");
- gtk_widget_class_bind_template_child (widget_class, GsShellSearch, list_box_search);
- gtk_widget_class_bind_template_child (widget_class, GsShellSearch, scrolledwindow_search);
- gtk_widget_class_bind_template_child (widget_class, GsShellSearch, spinner_search);
- gtk_widget_class_bind_template_child (widget_class, GsShellSearch, stack_search);
+ gtk_widget_class_bind_template_child (widget_class, GsSearchPage, list_box_search);
+ gtk_widget_class_bind_template_child (widget_class, GsSearchPage, scrolledwindow_search);
+ gtk_widget_class_bind_template_child (widget_class, GsSearchPage, spinner_search);
+ gtk_widget_class_bind_template_child (widget_class, GsSearchPage, stack_search);
}
static void
-gs_shell_search_init (GsShellSearch *self)
+gs_search_page_init (GsSearchPage *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
@@ -484,12 +484,12 @@ gs_shell_search_init (GsShellSearch *self)
self->sizegroup_button = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
}
-GsShellSearch *
-gs_shell_search_new (void)
+GsSearchPage *
+gs_search_page_new (void)
{
- GsShellSearch *self;
- self = g_object_new (GS_TYPE_SHELL_SEARCH, NULL);
- return GS_SHELL_SEARCH (self);
+ GsSearchPage *self;
+ self = g_object_new (GS_TYPE_SEARCH_PAGE, NULL);
+ return GS_SEARCH_PAGE (self);
}
/* vim: set noexpandtab: */
diff --git a/src/gs-shell-search.h b/src/gs-search-page.h
similarity index 68%
rename from src/gs-shell-search.h
rename to src/gs-search-page.h
index a7c9bd3..0b97879 100644
--- a/src/gs-shell-search.h
+++ b/src/gs-search-page.h
@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __GS_SHELL_SEARCH_H
-#define __GS_SHELL_SEARCH_H
+#ifndef __GS_SEARCH_PAGE_H
+#define __GS_SEARCH_PAGE_H
#include <glib-object.h>
#include <gtk/gtk.h>
@@ -31,19 +31,19 @@
G_BEGIN_DECLS
-#define GS_TYPE_SHELL_SEARCH (gs_shell_search_get_type ())
+#define GS_TYPE_SEARCH_PAGE (gs_search_page_get_type ())
-G_DECLARE_FINAL_TYPE (GsShellSearch, gs_shell_search, GS, SHELL_SEARCH, GsPage)
+G_DECLARE_FINAL_TYPE (GsSearchPage, gs_search_page, GS, SEARCH_PAGE, GsPage)
-GsShellSearch *gs_shell_search_new (void);
-void gs_shell_search_set_appid_to_show (GsShellSearch *self,
- const gchar *appid);
-const gchar *gs_shell_search_get_text (GsShellSearch *self);
-void gs_shell_search_set_text (GsShellSearch *self,
- const gchar *value);
+GsSearchPage *gs_search_page_new (void);
+void gs_search_page_set_appid_to_show (GsSearchPage *self,
+ const gchar *appid);
+const gchar *gs_search_page_get_text (GsSearchPage *self);
+void gs_search_page_set_text (GsSearchPage *self,
+ const gchar *value);
G_END_DECLS
-#endif /* __GS_SHELL_SEARCH_H */
+#endif /* __GS_SEARCH_PAGE_H */
/* vim: set noexpandtab: */
diff --git a/src/gs-shell-search.ui b/src/gs-search-page.ui
similarity index 98%
rename from src/gs-shell-search.ui
rename to src/gs-search-page.ui
index 8c19647..b150030 100644
--- a/src/gs-shell-search.ui
+++ b/src/gs-search-page.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.10"/>
- <template class="GsShellSearch" parent="GsPage">
+ <template class="GsSearchPage" parent="GsPage">
<child internal-child="accessible">
<object class="AtkObject" id="search-accessible">
<property name="accessible-name" translatable="yes">Search page</property>
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 5dff5c9..78c4730 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -27,15 +27,15 @@
#include "gs-common.h"
#include "gs-shell.h"
-#include "gs-shell-details.h"
-#include "gs-shell-installed.h"
-#include "gs-shell-moderate.h"
-#include "gs-shell-loading.h"
-#include "gs-shell-search.h"
-#include "gs-shell-overview.h"
-#include "gs-shell-updates.h"
-#include "gs-shell-category.h"
-#include "gs-shell-extras.h"
+#include "gs-details-page.h"
+#include "gs-installed-page.h"
+#include "gs-moderate-page.h"
+#include "gs-loading-page.h"
+#include "gs-search-page.h"
+#include "gs-overview-page.h"
+#include "gs-updates-page.h"
+#include "gs-category-page.h"
+#include "gs-extras-page.h"
#include "gs-sources-dialog.h"
#include "gs-update-dialog.h"
#include "gs-update-monitor.h"
@@ -323,7 +323,7 @@ gs_shell_change_mode (GsShell *shell,
break;
case GS_SHELL_MODE_SEARCH:
page = GS_PAGE (g_hash_table_lookup (priv->pages, "search"));
- gs_shell_search_set_text (GS_SHELL_SEARCH (page), data);
+ gs_search_page_set_text (GS_SEARCH_PAGE (page), data);
break;
case GS_SHELL_MODE_UPDATES:
gs_shell_clean_back_entry_stack (shell);
@@ -333,19 +333,19 @@ gs_shell_change_mode (GsShell *shell,
app = GS_APP (data);
page = GS_PAGE (g_hash_table_lookup (priv->pages, "details"));
if (gs_app_get_local_file (app) != NULL) {
- gs_shell_details_set_local_file (GS_SHELL_DETAILS (page),
- gs_app_get_local_file (app));
+ gs_details_page_set_local_file (GS_DETAILS_PAGE (page),
+ gs_app_get_local_file (app));
} else if (gs_app_get_metadata_item (app, "GnomeSoftware::from-url") != NULL) {
- gs_shell_details_set_url (GS_SHELL_DETAILS (page),
- gs_app_get_metadata_item (app, "GnomeSoftware::from-url"));
+ gs_details_page_set_url (GS_DETAILS_PAGE (page),
+ gs_app_get_metadata_item (app, "GnomeSoftware::from-url"));
} else {
- gs_shell_details_set_app (GS_SHELL_DETAILS (page), data);
+ gs_details_page_set_app (GS_DETAILS_PAGE (page), data);
}
break;
case GS_SHELL_MODE_CATEGORY:
page = GS_PAGE (g_hash_table_lookup (priv->pages, "category"));
- gs_shell_category_set_category (GS_SHELL_CATEGORY (page),
- GS_CATEGORY (data));
+ gs_category_page_set_category (GS_CATEGORY_PAGE (page),
+ GS_CATEGORY (data));
break;
case GS_SHELL_MODE_EXTRAS:
page = GS_PAGE (g_hash_table_lookup (priv->pages, "extras"));
@@ -393,7 +393,7 @@ gs_shell_change_mode (GsShell *shell,
}
static void
-gs_shell_overview_button_cb (GtkWidget *widget, GsShell *shell)
+gs_overview_page_button_cb (GtkWidget *widget, GsShell *shell)
{
GsShellMode mode;
mode = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget),
@@ -419,7 +419,7 @@ save_back_entry (GsShell *shell)
switch (priv->mode) {
case GS_SHELL_MODE_CATEGORY:
page = GS_PAGE (g_hash_table_lookup (priv->pages, "category"));
- entry->category = gs_shell_category_get_category (GS_SHELL_CATEGORY (page));
+ entry->category = gs_category_page_get_category (GS_CATEGORY_PAGE (page));
g_object_ref (entry->category);
g_debug ("pushing back entry for %s with %s",
page_name[entry->mode],
@@ -427,7 +427,7 @@ save_back_entry (GsShell *shell)
break;
case GS_SHELL_MODE_DETAILS:
page = GS_PAGE (g_hash_table_lookup (priv->pages, "details"));
- entry->app = gs_shell_details_get_app (GS_SHELL_DETAILS (page));
+ entry->app = gs_details_page_get_app (GS_DETAILS_PAGE (page));
g_object_ref (entry->app);
g_debug ("pushing back entry for %s with %s",
page_name[entry->mode],
@@ -435,7 +435,7 @@ save_back_entry (GsShell *shell)
break;
case GS_SHELL_MODE_SEARCH:
page = GS_PAGE (g_hash_table_lookup (priv->pages, "search"));
- entry->search = g_strdup (gs_shell_search_get_text (GS_SHELL_SEARCH (page)));
+ entry->search = g_strdup (gs_search_page_get_text (GS_SEARCH_PAGE (page)));
g_debug ("pushing back entry for %s with %s",
page_name[entry->mode], entry->search);
break;
@@ -550,17 +550,17 @@ gs_shell_back_button_cb (GtkWidget *widget, GsShell *shell)
}
static void
-initial_overview_load_done (GsShellOverview *shell_overview, gpointer data)
+initial_overview_load_done (GsOverviewPage *overview_page, gpointer data)
{
GsPage *page;
GsShell *shell = data;
GsShellPrivate *priv = gs_shell_get_instance_private (shell);
- g_signal_handlers_disconnect_by_func (shell_overview, initial_overview_load_done, data);
+ g_signal_handlers_disconnect_by_func (overview_page, initial_overview_load_done, data);
- page = GS_PAGE (gtk_builder_get_object (priv->builder, "shell_updates"));
+ page = GS_PAGE (gtk_builder_get_object (priv->builder, "updates_page"));
gs_page_reload (page);
- page = GS_PAGE (gtk_builder_get_object (priv->builder, "shell_installed"));
+ page = GS_PAGE (gtk_builder_get_object (priv->builder, "installed_page"));
gs_page_reload (page);
g_signal_emit (shell, signals[SIGNAL_LOADED], 0);
@@ -609,7 +609,7 @@ search_changed_handler (GObject *entry, GsShell *shell)
(gpointer) text, TRUE);
} else {
GsPage *page = GS_PAGE (g_hash_table_lookup (priv->pages, "search"));
- gs_shell_search_set_text (GS_SHELL_SEARCH (page), text);
+ gs_search_page_set_text (GS_SEARCH_PAGE (page), text);
gs_page_switch_to (page, TRUE);
}
}
@@ -1679,19 +1679,19 @@ gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *can
"gnome-software::overview-mode",
GINT_TO_POINTER (GS_SHELL_MODE_OVERVIEW));
g_signal_connect (widget, "clicked",
- G_CALLBACK (gs_shell_overview_button_cb), shell);
+ G_CALLBACK (gs_overview_page_button_cb), shell);
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_installed"));
g_object_set_data (G_OBJECT (widget),
"gnome-software::overview-mode",
GINT_TO_POINTER (GS_SHELL_MODE_INSTALLED));
g_signal_connect (widget, "clicked",
- G_CALLBACK (gs_shell_overview_button_cb), shell);
+ G_CALLBACK (gs_overview_page_button_cb), shell);
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_updates"));
g_object_set_data (G_OBJECT (widget),
"gnome-software::overview-mode",
GINT_TO_POINTER (GS_SHELL_MODE_UPDATES));
g_signal_connect (widget, "clicked",
- G_CALLBACK (gs_shell_overview_button_cb), shell);
+ G_CALLBACK (gs_overview_page_button_cb), shell);
/* set up in-app notification controls */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_events_dismiss"));
@@ -1714,23 +1714,23 @@ gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *can
G_CALLBACK (gs_shell_plugin_events_restart_required_cb), shell);
/* add pages to hash */
- page = GS_PAGE (gtk_builder_get_object (priv->builder, "shell_overview"));
+ page = GS_PAGE (gtk_builder_get_object (priv->builder, "overview_page"));
g_hash_table_insert (priv->pages, g_strdup ("overview"), page);
- page = GS_PAGE (gtk_builder_get_object (priv->builder, "shell_updates"));
+ page = GS_PAGE (gtk_builder_get_object (priv->builder, "updates_page"));
g_hash_table_insert (priv->pages, g_strdup ("updates"), page);
- page = GS_PAGE (gtk_builder_get_object (priv->builder, "shell_installed"));
+ page = GS_PAGE (gtk_builder_get_object (priv->builder, "installed_page"));
g_hash_table_insert (priv->pages, g_strdup ("installed"), page);
- page = GS_PAGE (gtk_builder_get_object (priv->builder, "shell_moderate"));
+ page = GS_PAGE (gtk_builder_get_object (priv->builder, "moderate_page"));
g_hash_table_insert (priv->pages, g_strdup ("moderate"), page);
- page = GS_PAGE (gtk_builder_get_object (priv->builder, "shell_loading"));
+ page = GS_PAGE (gtk_builder_get_object (priv->builder, "loading_page"));
g_hash_table_insert (priv->pages, g_strdup ("loading"), page);
- page = GS_PAGE (gtk_builder_get_object (priv->builder, "shell_search"));
+ page = GS_PAGE (gtk_builder_get_object (priv->builder, "search_page"));
g_hash_table_insert (priv->pages, g_strdup ("search"), page);
- page = GS_PAGE (gtk_builder_get_object (priv->builder, "shell_details"));
+ page = GS_PAGE (gtk_builder_get_object (priv->builder, "details_page"));
g_hash_table_insert (priv->pages, g_strdup ("details"), page);
- page = GS_PAGE (gtk_builder_get_object (priv->builder, "shell_category"));
+ page = GS_PAGE (gtk_builder_get_object (priv->builder, "category_page"));
g_hash_table_insert (priv->pages, g_strdup ("category"), page);
- page = GS_PAGE (gtk_builder_get_object (priv->builder, "shell_extras"));
+ page = GS_PAGE (gtk_builder_get_object (priv->builder, "extras_page"));
g_hash_table_insert (priv->pages, g_strdup ("extras"), page);
gs_shell_setup_pages (shell);
@@ -1743,7 +1743,7 @@ gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *can
G_CALLBACK (search_changed_handler), shell);
/* load content */
- page = GS_PAGE (gtk_builder_get_object (priv->builder, "shell_loading"));
+ page = GS_PAGE (gtk_builder_get_object (priv->builder, "loading_page"));
g_signal_connect (page, "refreshed",
G_CALLBACK (initial_overview_load_done), shell);
@@ -1848,10 +1848,10 @@ void gs_shell_show_extras_search (GsShell *shell, const gchar *mode, gchar **res
GsShellPrivate *priv = gs_shell_get_instance_private (shell);
GsPage *page;
- page = GS_PAGE (gtk_builder_get_object (priv->builder, "shell_extras"));
+ page = GS_PAGE (gtk_builder_get_object (priv->builder, "extras_page"));
save_back_entry (shell);
- gs_shell_extras_search (GS_SHELL_EXTRAS (page), mode, resources);
+ gs_extras_page_search (GS_EXTRAS_PAGE (page), mode, resources);
gs_shell_change_mode (shell, GS_SHELL_MODE_EXTRAS, NULL, TRUE);
gs_shell_activate (shell);
}
@@ -1883,7 +1883,7 @@ gs_shell_show_search_result (GsShell *shell, const gchar *id, const gchar *searc
save_back_entry (shell);
page = GS_PAGE (g_hash_table_lookup (priv->pages, "search"));
- gs_shell_search_set_appid_to_show (GS_SHELL_SEARCH (page), id);
+ gs_search_page_set_appid_to_show (GS_SEARCH_PAGE (page), id);
gs_shell_change_mode (shell, GS_SHELL_MODE_SEARCH,
(gpointer) search, TRUE);
}
diff --git a/src/gs-shell-updates.c b/src/gs-updates-page.c
similarity index 73%
rename from src/gs-shell-updates.c
rename to src/gs-updates-page.c
index 1e361b1..1d3ea06 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-updates-page.c
@@ -25,7 +25,7 @@
#include <gio/gio.h>
#include "gs-shell.h"
-#include "gs-shell-updates.h"
+#include "gs-updates-page.h"
#include "gs-common.h"
#include "gs-app-private.h"
#include "gs-app-row.h"
@@ -46,23 +46,23 @@
#include <langinfo.h>
typedef enum {
- GS_SHELL_UPDATES_FLAG_NONE = 0,
- GS_SHELL_UPDATES_FLAG_HAS_UPDATES = 1 << 0,
- GS_SHELL_UPDATES_FLAG_HAS_UPGRADES = 1 << 1,
- GS_SHELL_UPDATES_FLAG_LAST
-} GsShellUpdatesFlags;
+ GS_UPDATES_PAGE_FLAG_NONE = 0,
+ GS_UPDATES_PAGE_FLAG_HAS_UPDATES = 1 << 0,
+ GS_UPDATES_PAGE_FLAG_HAS_UPGRADES = 1 << 1,
+ GS_UPDATES_PAGE_FLAG_LAST
+} GsUpdatesPageFlags;
typedef enum {
- GS_SHELL_UPDATES_STATE_STARTUP,
- GS_SHELL_UPDATES_STATE_ACTION_REFRESH,
- GS_SHELL_UPDATES_STATE_ACTION_GET_UPDATES,
- GS_SHELL_UPDATES_STATE_MANAGED,
- GS_SHELL_UPDATES_STATE_IDLE,
- GS_SHELL_UPDATES_STATE_FAILED,
- GS_SHELL_UPDATES_STATE_LAST,
-} GsShellUpdatesState;
-
-struct _GsShellUpdates
+ GS_UPDATES_PAGE_STATE_STARTUP,
+ GS_UPDATES_PAGE_STATE_ACTION_REFRESH,
+ GS_UPDATES_PAGE_STATE_ACTION_GET_UPDATES,
+ GS_UPDATES_PAGE_STATE_MANAGED,
+ GS_UPDATES_PAGE_STATE_IDLE,
+ GS_UPDATES_PAGE_STATE_FAILED,
+ GS_UPDATES_PAGE_STATE_LAST,
+} GsUpdatesPageState;
+
+struct _GsUpdatesPage
{
GsPage parent_instance;
@@ -79,8 +79,8 @@ struct _GsShellUpdates
gboolean any_require_reboot;
GsShell *shell;
GsPluginStatus last_status;
- GsShellUpdatesState state;
- GsShellUpdatesFlags result_flags;
+ GsUpdatesPageState state;
+ GsUpdatesPageFlags result_flags;
GtkWidget *button_refresh;
GtkWidget *button_update_all;
GtkWidget *header_spinner_start;
@@ -109,40 +109,40 @@ enum {
COLUMN_UPDATE_LAST
};
-G_DEFINE_TYPE (GsShellUpdates, gs_shell_updates, GS_TYPE_PAGE)
+G_DEFINE_TYPE (GsUpdatesPage, gs_updates_page, GS_TYPE_PAGE)
static void
-gs_shell_updates_set_flag (GsShellUpdates *self, GsShellUpdatesFlags flag)
+gs_updates_page_set_flag (GsUpdatesPage *self, GsUpdatesPageFlags flag)
{
self->result_flags |= flag;
}
static void
-gs_shell_updates_clear_flag (GsShellUpdates *self, GsShellUpdatesFlags flag)
+gs_updates_page_clear_flag (GsUpdatesPage *self, GsUpdatesPageFlags flag)
{
self->result_flags &= ~flag;
}
static const gchar *
-gs_shell_updates_state_to_string (GsShellUpdatesState state)
+gs_updates_page_state_to_string (GsUpdatesPageState state)
{
- if (state == GS_SHELL_UPDATES_STATE_STARTUP)
+ if (state == GS_UPDATES_PAGE_STATE_STARTUP)
return "startup";
- if (state == GS_SHELL_UPDATES_STATE_ACTION_REFRESH)
+ if (state == GS_UPDATES_PAGE_STATE_ACTION_REFRESH)
return "action-refresh";
- if (state == GS_SHELL_UPDATES_STATE_ACTION_GET_UPDATES)
+ if (state == GS_UPDATES_PAGE_STATE_ACTION_GET_UPDATES)
return "action-get-updates";
- if (state == GS_SHELL_UPDATES_STATE_MANAGED)
+ if (state == GS_UPDATES_PAGE_STATE_MANAGED)
return "managed";
- if (state == GS_SHELL_UPDATES_STATE_IDLE)
+ if (state == GS_UPDATES_PAGE_STATE_IDLE)
return "idle";
- if (state == GS_SHELL_UPDATES_STATE_FAILED)
+ if (state == GS_UPDATES_PAGE_STATE_FAILED)
return "failed";
return NULL;
}
static void
-gs_shell_updates_invalidate (GsShellUpdates *self)
+gs_updates_page_invalidate (GsUpdatesPage *self)
{
self->cache_valid = FALSE;
}
@@ -165,7 +165,7 @@ time_next_midnight (void)
}
static gchar *
-gs_shell_updates_last_checked_time_string (GsShellUpdates *self)
+gs_updates_page_last_checked_time_string (GsUpdatesPage *self)
{
#ifdef HAVE_GNOME_DESKTOP
GDesktopClockFormat clock_format;
@@ -235,7 +235,7 @@ gs_shell_updates_last_checked_time_string (GsShellUpdates *self)
}
static const gchar *
-gs_shell_updates_get_state_string (GsPluginStatus status)
+gs_updates_page_get_state_string (GsPluginStatus status)
{
if (status == GS_PLUGIN_STATUS_DOWNLOADING) {
/* TRANSLATORS: the updates are being downloaded */
@@ -247,7 +247,7 @@ gs_shell_updates_get_state_string (GsPluginStatus status)
}
static void
-gs_shell_updates_update_ui_state (GsShellUpdates *self)
+gs_updates_page_update_ui_state (GsUpdatesPage *self)
{
GsUpdateList *update_list;
gboolean allow_mobile_refresh = TRUE;
@@ -259,11 +259,11 @@ gs_shell_updates_update_ui_state (GsShellUpdates *self)
/* spinners */
switch (self->state) {
- case GS_SHELL_UPDATES_STATE_STARTUP:
- case GS_SHELL_UPDATES_STATE_ACTION_GET_UPDATES:
- case GS_SHELL_UPDATES_STATE_ACTION_REFRESH:
+ case GS_UPDATES_PAGE_STATE_STARTUP:
+ case GS_UPDATES_PAGE_STATE_ACTION_GET_UPDATES:
+ case GS_UPDATES_PAGE_STATE_ACTION_REFRESH:
/* if we have updates, avoid clearing the page with a spinner */
- if (self->result_flags != GS_SHELL_UPDATES_FLAG_NONE) {
+ if (self->result_flags != GS_UPDATES_PAGE_FLAG_NONE) {
gs_stop_spinner (GTK_SPINNER (self->spinner_updates));
gtk_spinner_start (GTK_SPINNER (self->header_spinner_start));
gtk_widget_show (self->header_spinner_start);
@@ -280,16 +280,16 @@ gs_shell_updates_update_ui_state (GsShellUpdates *self)
/* spinner text */
switch (self->state) {
- case GS_SHELL_UPDATES_STATE_STARTUP:
+ case GS_UPDATES_PAGE_STATE_STARTUP:
spinner_str = g_strdup_printf ("%s\n%s",
/* TRANSLATORS: the updates panel is starting up */
_("Setting up updates…"),
_("(This could take a while)"));
gtk_label_set_label (GTK_LABEL (self->label_updates_spinner), spinner_str);
break;
- case GS_SHELL_UPDATES_STATE_ACTION_REFRESH:
+ case GS_UPDATES_PAGE_STATE_ACTION_REFRESH:
spinner_str = g_strdup_printf ("%s\n%s",
- gs_shell_updates_get_state_string (self->last_status),
+ gs_updates_page_get_state_string (self->last_status),
/* TRANSLATORS: the updates panel is starting up */
_("(This could take a while)"));
gtk_label_set_label (GTK_LABEL (self->label_updates_spinner), spinner_str);
@@ -300,20 +300,20 @@ gs_shell_updates_update_ui_state (GsShellUpdates *self)
/* headerbar refresh icon */
switch (self->state) {
- case GS_SHELL_UPDATES_STATE_ACTION_REFRESH:
- case GS_SHELL_UPDATES_STATE_ACTION_GET_UPDATES:
+ case GS_UPDATES_PAGE_STATE_ACTION_REFRESH:
+ case GS_UPDATES_PAGE_STATE_ACTION_GET_UPDATES:
gtk_image_set_from_icon_name (GTK_IMAGE (gtk_button_get_image (GTK_BUTTON
(self->button_refresh))),
"media-playback-stop-symbolic", GTK_ICON_SIZE_MENU);
gtk_widget_show (self->button_refresh);
break;
- case GS_SHELL_UPDATES_STATE_STARTUP:
- case GS_SHELL_UPDATES_STATE_MANAGED:
+ case GS_UPDATES_PAGE_STATE_STARTUP:
+ case GS_UPDATES_PAGE_STATE_MANAGED:
gtk_widget_hide (self->button_refresh);
break;
default:
gtk_image_set_from_icon_name (GTK_IMAGE (gtk_button_get_image (GTK_BUTTON
(self->button_refresh))),
"view-refresh-symbolic", GTK_ICON_SIZE_MENU);
- if (self->result_flags != GS_SHELL_UPDATES_FLAG_NONE) {
+ if (self->result_flags != GS_UPDATES_PAGE_FLAG_NONE) {
gtk_widget_show (self->button_refresh);
} else {
if (gs_plugin_loader_get_network_metered (self->plugin_loader) &&
@@ -329,34 +329,34 @@ gs_shell_updates_update_ui_state (GsShellUpdates *self)
/* headerbar update button */
update_list = GS_UPDATE_LIST (self->list_box_updates);
gs_update_list_set_force_headers (update_list,
- self->result_flags & GS_SHELL_UPDATES_FLAG_HAS_UPGRADES);
+ self->result_flags & GS_UPDATES_PAGE_FLAG_HAS_UPGRADES);
gtk_widget_set_visible (self->button_update_all,
!gs_update_list_has_headers (update_list));
/* stack */
switch (self->state) {
- case GS_SHELL_UPDATES_STATE_MANAGED:
+ case GS_UPDATES_PAGE_STATE_MANAGED:
gtk_stack_set_visible_child_name (GTK_STACK (self->stack_updates), "managed");
break;
- case GS_SHELL_UPDATES_STATE_FAILED:
+ case GS_UPDATES_PAGE_STATE_FAILED:
gtk_stack_set_visible_child_name (GTK_STACK (self->stack_updates), "failed");
break;
- case GS_SHELL_UPDATES_STATE_ACTION_GET_UPDATES:
+ case GS_UPDATES_PAGE_STATE_ACTION_GET_UPDATES:
gtk_stack_set_visible_child_name (GTK_STACK (self->stack_updates),
"spinner");
break;
- case GS_SHELL_UPDATES_STATE_ACTION_REFRESH:
- if (self->result_flags != GS_SHELL_UPDATES_FLAG_NONE) {
+ case GS_UPDATES_PAGE_STATE_ACTION_REFRESH:
+ if (self->result_flags != GS_UPDATES_PAGE_FLAG_NONE) {
gtk_stack_set_visible_child_name (GTK_STACK (self->stack_updates), "view");
} else {
gtk_stack_set_visible_child_name (GTK_STACK (self->stack_updates), "spinner");
}
break;
- case GS_SHELL_UPDATES_STATE_STARTUP:
- case GS_SHELL_UPDATES_STATE_IDLE:
+ case GS_UPDATES_PAGE_STATE_STARTUP:
+ case GS_UPDATES_PAGE_STATE_IDLE:
/* if have updates, just show the view, otherwise show network */
- if (self->result_flags != GS_SHELL_UPDATES_FLAG_NONE) {
+ if (self->result_flags != GS_UPDATES_PAGE_FLAG_NONE) {
gtk_stack_set_visible_child_name (GTK_STACK (self->stack_updates), "view");
break;
}
@@ -388,11 +388,11 @@ gs_shell_updates_update_ui_state (GsShellUpdates *self)
/* any updates? */
gtk_widget_set_visible (self->updates_box,
- self->result_flags & GS_SHELL_UPDATES_FLAG_HAS_UPDATES);
+ self->result_flags & GS_UPDATES_PAGE_FLAG_HAS_UPDATES);
/* last checked label */
if (g_strcmp0 (gtk_stack_get_visible_child_name (GTK_STACK (self->stack_updates)), "uptodate") == 0) {
- checked_str = gs_shell_updates_last_checked_time_string (self);
+ checked_str = gs_updates_page_last_checked_time_string (self);
if (checked_str != NULL) {
g_autofree gchar *last_checked = NULL;
@@ -406,19 +406,19 @@ gs_shell_updates_update_ui_state (GsShellUpdates *self)
}
static void
-gs_shell_updates_set_state (GsShellUpdates *self, GsShellUpdatesState state)
+gs_updates_page_set_state (GsUpdatesPage *self, GsUpdatesPageState state)
{
g_debug ("setting state from %s to %s (has-update:%i, has-upgrade:%i)",
- gs_shell_updates_state_to_string (self->state),
- gs_shell_updates_state_to_string (state),
- (self->result_flags & GS_SHELL_UPDATES_FLAG_HAS_UPDATES) > 0,
- (self->result_flags & GS_SHELL_UPDATES_FLAG_HAS_UPGRADES) > 0);
+ gs_updates_page_state_to_string (self->state),
+ gs_updates_page_state_to_string (state),
+ (self->result_flags & GS_UPDATES_PAGE_FLAG_HAS_UPDATES) > 0,
+ (self->result_flags & GS_UPDATES_PAGE_FLAG_HAS_UPGRADES) > 0);
self->state = state;
- gs_shell_updates_update_ui_state (self);
+ gs_updates_page_update_ui_state (self);
}
static void
-gs_shell_updates_decrement_refresh_count (GsShellUpdates *self)
+gs_updates_page_decrement_refresh_count (GsUpdatesPage *self)
{
/* every job increcements this */
if (self->action_cnt == 0) {
@@ -429,7 +429,7 @@ gs_shell_updates_decrement_refresh_count (GsShellUpdates *self)
return;
/* all done */
- gs_shell_updates_set_state (self, GS_SHELL_UPDATES_STATE_IDLE);
+ gs_updates_page_set_state (self, GS_UPDATES_PAGE_STATE_IDLE);
/* seems a good place */
gs_shell_profile_dump (self->shell);
@@ -437,17 +437,17 @@ gs_shell_updates_decrement_refresh_count (GsShellUpdates *self)
static void
-gs_shell_updates_network_available_notify_cb (GsPluginLoader *plugin_loader,
- GParamSpec *pspec,
- GsShellUpdates *self)
+gs_updates_page_network_available_notify_cb (GsPluginLoader *plugin_loader,
+ GParamSpec *pspec,
+ GsUpdatesPage *self)
{
- gs_shell_updates_update_ui_state (self);
+ gs_updates_page_update_ui_state (self);
}
static void
-gs_shell_updates_get_updates_cb (GsPluginLoader *plugin_loader,
- GAsyncResult *res,
- GsShellUpdates *self)
+gs_updates_page_get_updates_cb (GsPluginLoader *plugin_loader,
+ GAsyncResult *res,
+ GsUpdatesPage *self)
{
guint i;
GtkWidget *widget;
@@ -459,14 +459,13 @@ gs_shell_updates_get_updates_cb (GsPluginLoader *plugin_loader,
/* get the results */
list = gs_plugin_loader_get_updates_finish (plugin_loader, res, &error);
if (list == NULL) {
- gs_shell_updates_clear_flag (self, GS_SHELL_UPDATES_FLAG_HAS_UPDATES);
+ gs_updates_page_clear_flag (self, GS_UPDATES_PAGE_FLAG_HAS_UPDATES);
if (!g_error_matches (error, GS_PLUGIN_ERROR, GS_PLUGIN_ERROR_CANCELLED))
g_warning ("updates-shell: failed to get updates: %s", error->message);
gs_utils_error_strip_unique_id (error);
gtk_label_set_label (GTK_LABEL (self->label_updates_failed),
error->message);
- gs_shell_updates_set_state (self,
- GS_SHELL_UPDATES_STATE_FAILED);
+ gs_updates_page_set_state (self, GS_UPDATES_PAGE_STATE_FAILED);
widget = GTK_WIDGET (gtk_builder_get_object (self->builder,
"button_updates_counter"));
gtk_widget_hide (widget);
@@ -520,49 +519,49 @@ gs_shell_updates_get_updates_cb (GsPluginLoader *plugin_loader,
/* no results */
if (gs_app_list_length (list) == 0) {
g_debug ("updates-shell: no updates to show");
- gs_shell_updates_clear_flag (self, GS_SHELL_UPDATES_FLAG_HAS_UPDATES);
+ gs_updates_page_clear_flag (self, GS_UPDATES_PAGE_FLAG_HAS_UPDATES);
} else {
- gs_shell_updates_set_flag (self, GS_SHELL_UPDATES_FLAG_HAS_UPDATES);
+ gs_updates_page_set_flag (self, GS_UPDATES_PAGE_FLAG_HAS_UPDATES);
}
/* only when both set */
- gs_shell_updates_decrement_refresh_count (self);
+ gs_updates_page_decrement_refresh_count (self);
}
static void
-gs_shell_updates_get_upgrades_cb (GObject *source_object,
- GAsyncResult *res,
- gpointer user_data)
+gs_updates_page_get_upgrades_cb (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
{
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
- GsShellUpdates *self = GS_SHELL_UPDATES (user_data);
+ GsUpdatesPage *self = GS_UPDATES_PAGE (user_data);
g_autoptr(GError) error = NULL;
g_autoptr(GsAppList) list = NULL;
/* get the results */
list = gs_plugin_loader_get_distro_upgrades_finish (plugin_loader, res, &error);
if (list == NULL) {
- gs_shell_updates_clear_flag (self, GS_SHELL_UPDATES_FLAG_HAS_UPGRADES);
+ gs_updates_page_clear_flag (self, GS_UPDATES_PAGE_FLAG_HAS_UPGRADES);
if (!g_error_matches (error, GS_PLUGIN_ERROR, GS_PLUGIN_ERROR_CANCELLED)) {
g_warning ("updates-shell: failed to get upgrades: %s",
error->message);
}
} else if (gs_app_list_length (list) == 0) {
g_debug ("updates-shell: no upgrades to show");
- gs_shell_updates_clear_flag (self, GS_SHELL_UPDATES_FLAG_HAS_UPGRADES);
+ gs_updates_page_clear_flag (self, GS_UPDATES_PAGE_FLAG_HAS_UPGRADES);
} else {
GsApp *app = gs_app_list_index (list, 0);
g_debug ("got upgrade %s", gs_app_get_id (app));
gs_upgrade_banner_set_app (GS_UPGRADE_BANNER (self->upgrade_banner), app);
- gs_shell_updates_set_flag (self, GS_SHELL_UPDATES_FLAG_HAS_UPGRADES);
+ gs_updates_page_set_flag (self, GS_UPDATES_PAGE_FLAG_HAS_UPGRADES);
}
/* only when both set */
- gs_shell_updates_decrement_refresh_count (self);
+ gs_updates_page_decrement_refresh_count (self);
}
static void
-gs_shell_updates_load (GsShellUpdates *self)
+gs_updates_page_load (GsUpdatesPage *self)
{
guint64 refine_flags;
@@ -573,42 +572,41 @@ gs_shell_updates_load (GsShellUpdates *self)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_UPDATE_DETAILS |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROVENANCE |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION;
- gs_shell_updates_set_state (self,
- GS_SHELL_UPDATES_STATE_ACTION_GET_UPDATES);
+ gs_updates_page_set_state (self, GS_UPDATES_PAGE_STATE_ACTION_GET_UPDATES);
self->action_cnt++;
gs_plugin_loader_get_updates_async (self->plugin_loader,
refine_flags,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
- (GAsyncReadyCallback) gs_shell_updates_get_updates_cb,
+ (GAsyncReadyCallback) gs_updates_page_get_updates_cb,
self);
/* don't refresh every each time */
- if ((self->result_flags & GS_SHELL_UPDATES_FLAG_HAS_UPGRADES) == 0) {
+ if ((self->result_flags & GS_UPDATES_PAGE_FLAG_HAS_UPGRADES) == 0) {
refine_flags |= GS_PLUGIN_REFINE_FLAGS_REQUIRE_UPGRADE_REMOVED;
gs_plugin_loader_get_distro_upgrades_async (self->plugin_loader,
refine_flags,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
- gs_shell_updates_get_upgrades_cb,
+ gs_updates_page_get_upgrades_cb,
self);
self->action_cnt++;
}
}
static void
-gs_shell_updates_reload (GsPage *page)
+gs_updates_page_reload (GsPage *page)
{
- GsShellUpdates *self = GS_SHELL_UPDATES (page);
- gs_shell_updates_invalidate (self);
- gs_shell_updates_load (self);
+ GsUpdatesPage *self = GS_UPDATES_PAGE (page);
+ gs_updates_page_invalidate (self);
+ gs_updates_page_load (self);
}
static void
-gs_shell_updates_switch_to (GsPage *page,
- gboolean scroll_up)
+gs_updates_page_switch_to (GsPage *page,
+ gboolean scroll_up)
{
- GsShellUpdates *self = GS_SHELL_UPDATES (page);
+ GsUpdatesPage *self = GS_UPDATES_PAGE (page);
GtkWidget *widget;
if (gs_shell_get_mode (self->shell) != GS_SHELL_MODE_UPDATES) {
@@ -630,19 +628,19 @@ gs_shell_updates_switch_to (GsPage *page,
/* no need to refresh */
if (self->cache_valid) {
- gs_shell_updates_update_ui_state (self);
+ gs_updates_page_update_ui_state (self);
return;
}
- if (self->state == GS_SHELL_UPDATES_STATE_ACTION_GET_UPDATES) {
- gs_shell_updates_update_ui_state (self);
+ if (self->state == GS_UPDATES_PAGE_STATE_ACTION_GET_UPDATES) {
+ gs_updates_page_update_ui_state (self);
return;
}
- gs_shell_updates_load (self);
+ gs_updates_page_load (self);
}
static void
-show_update_details (GsApp *app, GsShellUpdates *self)
+show_update_details (GsApp *app, GsUpdatesPage *self)
{
GtkWidget *dialog;
g_autofree gchar *str = NULL;
@@ -661,9 +659,9 @@ show_update_details (GsApp *app, GsShellUpdates *self)
}
static void
-gs_shell_updates_activated_cb (GtkListBox *list_box,
- GtkListBoxRow *row,
- GsShellUpdates *self)
+gs_updates_page_activated_cb (GtkListBox *list_box,
+ GtkListBoxRow *row,
+ GsUpdatesPage *self)
{
GsApp *app;
@@ -673,9 +671,9 @@ gs_shell_updates_activated_cb (GtkListBox *list_box,
}
static void
-gs_shell_updates_button_clicked_cb (GsUpdateList *update_list,
- GsApp *app,
- GsShellUpdates *self)
+gs_updates_page_button_clicked_cb (GsUpdateList *update_list,
+ GsApp *app,
+ GsUpdatesPage *self)
{
g_autoptr(GCancellable) cancellable = g_cancellable_new ();
if (gs_app_get_state (app) != AS_APP_STATE_UPDATABLE_LIVE)
@@ -685,9 +683,9 @@ gs_shell_updates_button_clicked_cb (GsUpdateList *update_list,
}
static void
-gs_shell_updates_refresh_cb (GsPluginLoader *plugin_loader,
- GAsyncResult *res,
- GsShellUpdates *self)
+gs_updates_page_refresh_cb (GsPluginLoader *plugin_loader,
+ GAsyncResult *res,
+ GsUpdatesPage *self)
{
gboolean ret;
g_autoptr(GDateTime) now = NULL;
@@ -700,15 +698,14 @@ gs_shell_updates_refresh_cb (GsPluginLoader *plugin_loader,
if (g_error_matches (error,
GS_PLUGIN_ERROR,
GS_PLUGIN_ERROR_CANCELLED)) {
- gs_shell_updates_set_state (self, GS_SHELL_UPDATES_STATE_IDLE);
+ gs_updates_page_set_state (self, GS_UPDATES_PAGE_STATE_IDLE);
return;
}
g_warning ("failed to refresh: %s", error->message);
gs_utils_error_strip_unique_id (error);
gtk_label_set_label (GTK_LABEL (self->label_updates_failed),
error->message);
- gs_shell_updates_set_state (self,
- GS_SHELL_UPDATES_STATE_FAILED);
+ gs_updates_page_set_state (self, GS_UPDATES_PAGE_STATE_FAILED);
return;
}
@@ -718,17 +715,17 @@ gs_shell_updates_refresh_cb (GsPluginLoader *plugin_loader,
g_date_time_to_unix (now));
/* get the new list */
- gs_shell_updates_invalidate (self);
+ gs_updates_page_invalidate (self);
gs_page_switch_to (GS_PAGE (self), TRUE);
}
static void
-gs_shell_updates_get_new_updates (GsShellUpdates *self)
+gs_updates_page_get_new_updates (GsUpdatesPage *self)
{
GsPluginRefreshFlags refresh_flags = GS_PLUGIN_REFRESH_FLAGS_NONE;
/* force a check for updates and download */
- gs_shell_updates_set_state (self, GS_SHELL_UPDATES_STATE_ACTION_REFRESH);
+ gs_updates_page_set_state (self, GS_UPDATES_PAGE_STATE_ACTION_REFRESH);
if (self->cancellable_refresh != NULL) {
g_cancellable_cancel (self->cancellable_refresh);
@@ -745,12 +742,12 @@ gs_shell_updates_get_new_updates (GsShellUpdates *self)
refresh_flags,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable_refresh,
- (GAsyncReadyCallback) gs_shell_updates_refresh_cb,
+ (GAsyncReadyCallback) gs_updates_page_refresh_cb,
self);
}
static void
-gs_shell_updates_show_network_settings (GsShellUpdates *self)
+gs_updates_page_show_network_settings (GsUpdatesPage *self)
{
g_autoptr(GError) error = NULL;
if (!g_spawn_command_line_async ("gnome-control-center network", &error))
@@ -758,9 +755,9 @@ gs_shell_updates_show_network_settings (GsShellUpdates *self)
}
static void
-gs_shell_updates_refresh_confirm_cb (GtkDialog *dialog,
- GtkResponseType response_type,
- GsShellUpdates *self)
+gs_updates_page_refresh_confirm_cb (GtkDialog *dialog,
+ GtkResponseType response_type,
+ GsUpdatesPage *self)
{
/* unmap the dialog */
gtk_widget_destroy (GTK_WIDGET (dialog));
@@ -768,11 +765,11 @@ gs_shell_updates_refresh_confirm_cb (GtkDialog *dialog,
switch (response_type) {
case GTK_RESPONSE_REJECT:
/* open the control center */
- gs_shell_updates_show_network_settings (self);
+ gs_updates_page_show_network_settings (self);
break;
case GTK_RESPONSE_ACCEPT:
self->has_agreed_to_mobile_data = TRUE;
- gs_shell_updates_get_new_updates (self);
+ gs_updates_page_get_new_updates (self);
break;
case GTK_RESPONSE_CANCEL:
case GTK_RESPONSE_DELETE_EVENT:
@@ -783,28 +780,28 @@ gs_shell_updates_refresh_confirm_cb (GtkDialog *dialog,
}
static void
-gs_shell_updates_button_network_settings_cb (GtkWidget *widget,
- GsShellUpdates *self)
+gs_updates_page_button_network_settings_cb (GtkWidget *widget,
+ GsUpdatesPage *self)
{
- gs_shell_updates_show_network_settings (self);
+ gs_updates_page_show_network_settings (self);
}
static void
-gs_shell_updates_button_mobile_refresh_cb (GtkWidget *widget,
- GsShellUpdates *self)
+gs_updates_page_button_mobile_refresh_cb (GtkWidget *widget,
+ GsUpdatesPage *self)
{
self->has_agreed_to_mobile_data = TRUE;
- gs_shell_updates_get_new_updates (self);
+ gs_updates_page_get_new_updates (self);
}
static void
-gs_shell_updates_button_refresh_cb (GtkWidget *widget,
- GsShellUpdates *self)
+gs_updates_page_button_refresh_cb (GtkWidget *widget,
+ GsUpdatesPage *self)
{
GtkWidget *dialog;
/* cancel existing action? */
- if (self->state == GS_SHELL_UPDATES_STATE_ACTION_REFRESH) {
+ if (self->state == GS_UPDATES_PAGE_STATE_ACTION_REFRESH) {
g_cancellable_cancel (self->cancellable_refresh);
g_clear_object (&self->cancellable_refresh);
return;
@@ -813,12 +810,12 @@ gs_shell_updates_button_refresh_cb (GtkWidget *widget,
/* check we have a "free" network connection */
if (gs_plugin_loader_get_network_available (self->plugin_loader) &&
!gs_plugin_loader_get_network_metered (self->plugin_loader)) {
- gs_shell_updates_get_new_updates (self);
+ gs_updates_page_get_new_updates (self);
/* expensive network connection */
} else if (gs_plugin_loader_get_network_metered (self->plugin_loader)) {
if (self->has_agreed_to_mobile_data) {
- gs_shell_updates_get_new_updates (self);
+ gs_updates_page_get_new_updates (self);
return;
}
dialog = gtk_message_dialog_new (gs_shell_get_window (self->shell),
@@ -839,7 +836,7 @@ gs_shell_updates_button_refresh_cb (GtkWidget *widget,
_("Check Anyway"),
GTK_RESPONSE_ACCEPT);
g_signal_connect (dialog, "response",
- G_CALLBACK (gs_shell_updates_refresh_confirm_cb),
+ G_CALLBACK (gs_updates_page_refresh_confirm_cb),
self);
gs_shell_modal_dialog_present (self->shell, GTK_DIALOG (dialog));
@@ -863,23 +860,23 @@ gs_shell_updates_button_refresh_cb (GtkWidget *widget,
_("Network Settings"),
GTK_RESPONSE_REJECT);
g_signal_connect (dialog, "response",
- G_CALLBACK (gs_shell_updates_refresh_confirm_cb),
+ G_CALLBACK (gs_updates_page_refresh_confirm_cb),
self);
gs_shell_modal_dialog_present (self->shell, GTK_DIALOG (dialog));
}
}
static void
-gs_shell_updates_pending_apps_changed_cb (GsPluginLoader *plugin_loader,
- GsShellUpdates *self)
+gs_updates_page_pending_apps_changed_cb (GsPluginLoader *plugin_loader,
+ GsUpdatesPage *self)
{
- gs_shell_updates_invalidate (self);
+ gs_updates_page_invalidate (self);
}
static void
cancel_trigger_failed_cb (GObject *source, GAsyncResult *res, gpointer user_data)
{
- GsShellUpdates *self = GS_SHELL_UPDATES (user_data);
+ GsUpdatesPage *self = GS_UPDATES_PAGE (user_data);
g_autoptr(GError) error = NULL;
if (!gs_plugin_loader_app_action_finish (self->plugin_loader, res, &error)) {
g_warning ("failed to cancel trigger: %s", error->message);
@@ -888,9 +885,9 @@ cancel_trigger_failed_cb (GObject *source, GAsyncResult *res, gpointer user_data
}
static void
-gs_shell_updates_reboot_failed_cb (GObject *source, GAsyncResult *res, gpointer user_data)
+gs_updates_page_reboot_failed_cb (GObject *source, GAsyncResult *res, gpointer user_data)
{
- GsShellUpdates *self = GS_SHELL_UPDATES (user_data);
+ GsUpdatesPage *self = GS_UPDATES_PAGE (user_data);
g_autoptr(GError) error = NULL;
g_autoptr(GsAppList) apps = NULL;
g_autoptr(GVariant) retval = NULL;
@@ -917,9 +914,9 @@ gs_shell_updates_reboot_failed_cb (GObject *source, GAsyncResult *res, gpointer
}
static void
-gs_shell_updates_perform_update_cb (GsPluginLoader *plugin_loader,
- GAsyncResult *res,
- GsShellUpdates *self)
+gs_updates_page_perform_update_cb (GsPluginLoader *plugin_loader,
+ GAsyncResult *res,
+ GsUpdatesPage *self)
{
g_autoptr(GError) error = NULL;
@@ -943,7 +940,7 @@ gs_shell_updates_perform_update_cb (GsPluginLoader *plugin_loader,
"Reboot",
NULL, NULL, G_DBUS_CALL_FLAGS_NONE,
G_MAXINT, NULL,
- gs_shell_updates_reboot_failed_cb,
+ gs_updates_page_reboot_failed_cb,
self);
/* when we are not doing an offline update, show a notification
@@ -964,8 +961,8 @@ gs_shell_updates_perform_update_cb (GsPluginLoader *plugin_loader,
}
static void
-gs_shell_updates_button_update_all_cb (GtkButton *button,
- GsShellUpdates *self)
+gs_updates_page_button_update_all_cb (GtkButton *button,
+ GsUpdatesPage *self)
{
g_autoptr(GError) error = NULL;
g_autoptr(GsAppList) apps = NULL;
@@ -978,14 +975,14 @@ gs_shell_updates_button_update_all_cb (GtkButton *button,
apps,
GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
- (GAsyncReadyCallback) gs_shell_updates_perform_update_cb,
+ (GAsyncReadyCallback) gs_updates_page_perform_update_cb,
self);
gtk_widget_set_sensitive (GTK_WIDGET (self->button_update_all), FALSE);
}
typedef struct {
GsApp *app;
- GsShellUpdates *self;
+ GsUpdatesPage *self;
} GsPageHelper;
static void
@@ -1017,8 +1014,8 @@ upgrade_download_finished_cb (GObject *source,
}
static void
-gs_shell_updates_upgrade_download_cb (GsUpgradeBanner *upgrade_banner,
- GsShellUpdates *self)
+gs_updates_page_upgrade_download_cb (GsUpgradeBanner *upgrade_banner,
+ GsUpdatesPage *self)
{
GsApp *app;
GsPageHelper *helper;
@@ -1050,7 +1047,7 @@ upgrade_reboot_failed_cb (GObject *source,
GAsyncResult *res,
gpointer user_data)
{
- GsShellUpdates *self = (GsShellUpdates *) user_data;
+ GsUpdatesPage *self = (GsUpdatesPage *) user_data;
GsApp *app;
g_autoptr(GError) error = NULL;
g_autoptr(GVariant) retval = NULL;
@@ -1086,7 +1083,7 @@ upgrade_trigger_finished_cb (GObject *source,
GAsyncResult *res,
gpointer user_data)
{
- GsShellUpdates *self = (GsShellUpdates *) user_data;
+ GsUpdatesPage *self = (GsUpdatesPage *) user_data;
g_autoptr(GDBusConnection) bus = NULL;
g_autoptr(GError) error = NULL;
@@ -1110,7 +1107,7 @@ upgrade_trigger_finished_cb (GObject *source,
}
static void
-trigger_upgrade (GsShellUpdates *self)
+trigger_upgrade (GsUpdatesPage *self)
{
GsApp *upgrade;
@@ -1130,9 +1127,9 @@ trigger_upgrade (GsShellUpdates *self)
}
static void
-gs_shell_updates_upgrade_confirm_cb (GtkDialog *dialog,
- GtkResponseType response_type,
- GsShellUpdates *self)
+gs_updates_page_upgrade_confirm_cb (GtkDialog *dialog,
+ GtkResponseType response_type,
+ GsUpdatesPage *self)
{
/* unmap the dialog */
gtk_widget_destroy (GTK_WIDGET (dialog));
@@ -1153,8 +1150,8 @@ gs_shell_updates_upgrade_confirm_cb (GtkDialog *dialog,
}
static void
-gs_shell_updates_upgrade_install_cb (GsUpgradeBanner *upgrade_banner,
- GsShellUpdates *self)
+gs_updates_page_upgrade_install_cb (GsUpgradeBanner *upgrade_banner,
+ GsUpdatesPage *self)
{
GPtrArray *removals;
GsApp *upgrade;
@@ -1185,7 +1182,7 @@ gs_shell_updates_upgrade_install_cb (GsUpgradeBanner *upgrade_banner,
dialog = gs_removal_dialog_new ();
g_signal_connect (dialog, "response",
- G_CALLBACK (gs_shell_updates_upgrade_confirm_cb),
+ G_CALLBACK (gs_updates_page_upgrade_confirm_cb),
self);
gs_removal_dialog_show_upgrade_removals (GS_REMOVAL_DIALOG (dialog),
upgrade);
@@ -1193,8 +1190,8 @@ gs_shell_updates_upgrade_install_cb (GsUpgradeBanner *upgrade_banner,
}
static void
-gs_shell_updates_upgrade_help_cb (GsUpgradeBanner *upgrade_banner,
- GsShellUpdates *self)
+gs_updates_page_upgrade_help_cb (GsUpgradeBanner *upgrade_banner,
+ GsUpdatesPage *self)
{
GsApp *app;
const gchar *uri;
@@ -1213,7 +1210,7 @@ gs_shell_updates_upgrade_help_cb (GsUpgradeBanner *upgrade_banner,
}
static void
-gs_shell_updates_invalidate_downloaded_upgrade (GsShellUpdates *self)
+gs_updates_page_invalidate_downloaded_upgrade (GsUpdatesPage *self)
{
GsApp *app;
app = gs_upgrade_banner_get_app (GS_UPGRADE_BANNER (self->upgrade_banner));
@@ -1227,7 +1224,7 @@ gs_shell_updates_invalidate_downloaded_upgrade (GsShellUpdates *self)
}
static gboolean
-gs_shell_update_are_updates_in_progress (GsShellUpdates *self)
+gs_shell_update_are_updates_in_progress (GsUpdatesPage *self)
{
GsUpdateList *update_list = GS_UPDATE_LIST (self->list_box_updates);
g_autoptr(GsAppList) list = gs_update_list_get_apps (update_list);
@@ -1247,12 +1244,12 @@ gs_shell_update_are_updates_in_progress (GsShellUpdates *self)
}
static void
-gs_shell_updates_changed_cb (GsPluginLoader *plugin_loader,
- GsShellUpdates *self)
+gs_updates_page_changed_cb (GsPluginLoader *plugin_loader,
+ GsUpdatesPage *self)
{
/* if we do a live update and the upgrade is waiting to be deployed
* then make sure all new packages are downloaded */
- gs_shell_updates_invalidate_downloaded_upgrade (self);
+ gs_updates_page_invalidate_downloaded_upgrade (self);
/* check to see if any apps in the app list are in a processing state */
if (gs_shell_update_are_updates_in_progress (self)) {
@@ -1261,14 +1258,14 @@ gs_shell_updates_changed_cb (GsPluginLoader *plugin_loader,
}
/* refresh updates list */
- gs_shell_updates_reload (GS_PAGE (self));
+ gs_updates_page_reload (GS_PAGE (self));
}
static void
-gs_shell_updates_status_changed_cb (GsPluginLoader *plugin_loader,
- GsApp *app,
- GsPluginStatus status,
- GsShellUpdates *self)
+gs_updates_page_status_changed_cb (GsPluginLoader *plugin_loader,
+ GsApp *app,
+ GsPluginStatus status,
+ GsUpdatesPage *self)
{
switch (status) {
case GS_PLUGIN_STATUS_INSTALLING:
@@ -1277,7 +1274,7 @@ gs_shell_updates_status_changed_cb (GsPluginLoader *plugin_loader,
gs_app_get_id (app) != NULL) {
/* if we do a install or remove then make sure all new
* packages are downloaded */
- gs_shell_updates_invalidate_downloaded_upgrade (self);
+ gs_updates_page_invalidate_downloaded_upgrade (self);
}
break;
default:
@@ -1285,77 +1282,77 @@ gs_shell_updates_status_changed_cb (GsPluginLoader *plugin_loader,
}
self->last_status = status;
- gs_shell_updates_update_ui_state (self);
+ gs_updates_page_update_ui_state (self);
}
static void
-gs_shell_updates_allow_updates_notify_cb (GsPluginLoader *plugin_loader,
- GParamSpec *pspec,
- GsShellUpdates *self)
+gs_updates_page_allow_updates_notify_cb (GsPluginLoader *plugin_loader,
+ GParamSpec *pspec,
+ GsUpdatesPage *self)
{
if (!gs_plugin_loader_get_allow_updates (plugin_loader)) {
- gs_shell_updates_set_state (self, GS_SHELL_UPDATES_STATE_MANAGED);
+ gs_updates_page_set_state (self, GS_UPDATES_PAGE_STATE_MANAGED);
return;
}
- gs_shell_updates_set_state (self, GS_SHELL_UPDATES_STATE_IDLE);
+ gs_updates_page_set_state (self, GS_UPDATES_PAGE_STATE_IDLE);
}
static void
-gs_shell_updates_upgrade_cancel_cb (GsUpgradeBanner *upgrade_banner,
- GsShellUpdates *self)
+gs_updates_page_upgrade_cancel_cb (GsUpgradeBanner *upgrade_banner,
+ GsUpdatesPage *self)
{
g_cancellable_cancel (self->cancellable_upgrade_download);
}
static gboolean
-gs_shell_updates_setup (GsPage *page,
- GsShell *shell,
- GsPluginLoader *plugin_loader,
- GtkBuilder *builder,
- GCancellable *cancellable,
- GError **error)
+gs_updates_page_setup (GsPage *page,
+ GsShell *shell,
+ GsPluginLoader *plugin_loader,
+ GtkBuilder *builder,
+ GCancellable *cancellable,
+ GError **error)
{
- GsShellUpdates *self = GS_SHELL_UPDATES (page);
+ GsUpdatesPage *self = GS_UPDATES_PAGE (page);
AtkObject *accessible;
- g_return_val_if_fail (GS_IS_SHELL_UPDATES (self), TRUE);
+ g_return_val_if_fail (GS_IS_UPDATES_PAGE (self), TRUE);
self->shell = shell;
self->plugin_loader = g_object_ref (plugin_loader);
g_signal_connect (self->plugin_loader, "pending-apps-changed",
- G_CALLBACK (gs_shell_updates_pending_apps_changed_cb),
+ G_CALLBACK (gs_updates_page_pending_apps_changed_cb),
self);
g_signal_connect (self->plugin_loader, "status-changed",
- G_CALLBACK (gs_shell_updates_status_changed_cb),
+ G_CALLBACK (gs_updates_page_status_changed_cb),
self);
g_signal_connect (self->plugin_loader, "updates-changed",
- G_CALLBACK (gs_shell_updates_changed_cb),
+ G_CALLBACK (gs_updates_page_changed_cb),
self);
g_signal_connect_object (self->plugin_loader, "notify::allow-updates",
- G_CALLBACK (gs_shell_updates_allow_updates_notify_cb),
+ G_CALLBACK (gs_updates_page_allow_updates_notify_cb),
self, 0);
g_signal_connect_object (self->plugin_loader, "notify::network-available",
- G_CALLBACK (gs_shell_updates_network_available_notify_cb),
+ G_CALLBACK (gs_updates_page_network_available_notify_cb),
self, 0);
self->builder = g_object_ref (builder);
self->cancellable = g_object_ref (cancellable);
/* setup updates */
g_signal_connect (self->list_box_updates, "row-activated",
- G_CALLBACK (gs_shell_updates_activated_cb), self);
+ G_CALLBACK (gs_updates_page_activated_cb), self);
g_signal_connect (self->list_box_updates, "button-clicked",
- G_CALLBACK (gs_shell_updates_button_clicked_cb), self);
+ G_CALLBACK (gs_updates_page_button_clicked_cb), self);
/* setup system upgrades */
g_signal_connect (self->upgrade_banner, "download-clicked",
- G_CALLBACK (gs_shell_updates_upgrade_download_cb), self);
+ G_CALLBACK (gs_updates_page_upgrade_download_cb), self);
g_signal_connect (self->upgrade_banner, "install-clicked",
- G_CALLBACK (gs_shell_updates_upgrade_install_cb), self);
+ G_CALLBACK (gs_updates_page_upgrade_install_cb), self);
g_signal_connect (self->upgrade_banner, "cancel-clicked",
- G_CALLBACK (gs_shell_updates_upgrade_cancel_cb), self);
+ G_CALLBACK (gs_updates_page_upgrade_cancel_cb), self);
g_signal_connect (self->upgrade_banner, "help-clicked",
- G_CALLBACK (gs_shell_updates_upgrade_help_cb), self);
+ G_CALLBACK (gs_updates_page_upgrade_help_cb), self);
self->header_end_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_widget_set_visible (self->header_end_box, TRUE);
@@ -1366,7 +1363,7 @@ gs_shell_updates_setup (GsPage *page,
gtk_widget_set_visible (self->button_update_all, TRUE);
gtk_style_context_add_class (gtk_widget_get_style_context (self->button_update_all),
"suggested-action");
gtk_container_add (GTK_CONTAINER (self->header_end_box), self->button_update_all);
- g_signal_connect (self->button_update_all, "clicked", G_CALLBACK
(gs_shell_updates_button_update_all_cb), self);
+ g_signal_connect (self->button_update_all, "clicked", G_CALLBACK
(gs_updates_page_button_update_all_cb), self);
self->header_start_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_widget_set_visible (self->header_start_box, TRUE);
@@ -1382,26 +1379,26 @@ gs_shell_updates_setup (GsPage *page,
atk_object_set_name (accessible, _("Check for updates"));
gtk_box_pack_start (GTK_BOX (self->header_start_box), self->button_refresh, FALSE, FALSE, 0);
g_signal_connect (self->button_refresh, "clicked",
- G_CALLBACK (gs_shell_updates_button_refresh_cb),
+ G_CALLBACK (gs_updates_page_button_refresh_cb),
self);
g_signal_connect (self->button_updates_mobile, "clicked",
- G_CALLBACK (gs_shell_updates_button_mobile_refresh_cb),
+ G_CALLBACK (gs_updates_page_button_mobile_refresh_cb),
self);
g_signal_connect (self->button_updates_offline, "clicked",
- G_CALLBACK (gs_shell_updates_button_network_settings_cb),
+ G_CALLBACK (gs_updates_page_button_network_settings_cb),
self);
/* set initial state */
if (!gs_plugin_loader_get_allow_updates (self->plugin_loader))
- self->state = GS_SHELL_UPDATES_STATE_MANAGED;
+ self->state = GS_UPDATES_PAGE_STATE_MANAGED;
return TRUE;
}
static void
-gs_shell_updates_dispose (GObject *object)
+gs_updates_page_dispose (GObject *object)
{
- GsShellUpdates *self = GS_SHELL_UPDATES (object);
+ GsUpdatesPage *self = GS_UPDATES_PAGE (object);
if (self->cancellable_refresh != NULL) {
g_cancellable_cancel (self->cancellable_refresh);
@@ -1414,44 +1411,44 @@ gs_shell_updates_dispose (GObject *object)
g_clear_object (&self->settings);
g_clear_object (&self->desktop_settings);
- G_OBJECT_CLASS (gs_shell_updates_parent_class)->dispose (object);
+ G_OBJECT_CLASS (gs_updates_page_parent_class)->dispose (object);
}
static void
-gs_shell_updates_class_init (GsShellUpdatesClass *klass)
+gs_updates_page_class_init (GsUpdatesPageClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GsPageClass *page_class = GS_PAGE_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- object_class->dispose = gs_shell_updates_dispose;
- page_class->switch_to = gs_shell_updates_switch_to;
- page_class->reload = gs_shell_updates_reload;
- page_class->setup = gs_shell_updates_setup;
-
- gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-shell-updates.ui");
-
- gtk_widget_class_bind_template_child (widget_class, GsShellUpdates, updates_box);
- gtk_widget_class_bind_template_child (widget_class, GsShellUpdates, button_updates_mobile);
- gtk_widget_class_bind_template_child (widget_class, GsShellUpdates, button_updates_offline);
- gtk_widget_class_bind_template_child (widget_class, GsShellUpdates, label_updates_failed);
- gtk_widget_class_bind_template_child (widget_class, GsShellUpdates, label_updates_last_checked);
- gtk_widget_class_bind_template_child (widget_class, GsShellUpdates, label_updates_spinner);
- gtk_widget_class_bind_template_child (widget_class, GsShellUpdates, list_box_updates);
- gtk_widget_class_bind_template_child (widget_class, GsShellUpdates, scrolledwindow_updates);
- gtk_widget_class_bind_template_child (widget_class, GsShellUpdates, spinner_updates);
- gtk_widget_class_bind_template_child (widget_class, GsShellUpdates, stack_updates);
- gtk_widget_class_bind_template_child (widget_class, GsShellUpdates, upgrade_banner);
+ object_class->dispose = gs_updates_page_dispose;
+ page_class->switch_to = gs_updates_page_switch_to;
+ page_class->reload = gs_updates_page_reload;
+ page_class->setup = gs_updates_page_setup;
+
+ gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-updates-page.ui");
+
+ gtk_widget_class_bind_template_child (widget_class, GsUpdatesPage, updates_box);
+ gtk_widget_class_bind_template_child (widget_class, GsUpdatesPage, button_updates_mobile);
+ gtk_widget_class_bind_template_child (widget_class, GsUpdatesPage, button_updates_offline);
+ gtk_widget_class_bind_template_child (widget_class, GsUpdatesPage, label_updates_failed);
+ gtk_widget_class_bind_template_child (widget_class, GsUpdatesPage, label_updates_last_checked);
+ gtk_widget_class_bind_template_child (widget_class, GsUpdatesPage, label_updates_spinner);
+ gtk_widget_class_bind_template_child (widget_class, GsUpdatesPage, list_box_updates);
+ gtk_widget_class_bind_template_child (widget_class, GsUpdatesPage, scrolledwindow_updates);
+ gtk_widget_class_bind_template_child (widget_class, GsUpdatesPage, spinner_updates);
+ gtk_widget_class_bind_template_child (widget_class, GsUpdatesPage, stack_updates);
+ gtk_widget_class_bind_template_child (widget_class, GsUpdatesPage, upgrade_banner);
}
static void
-gs_shell_updates_init (GsShellUpdates *self)
+gs_updates_page_init (GsUpdatesPage *self)
{
const char *ampm;
gtk_widget_init_template (GTK_WIDGET (self));
- self->state = GS_SHELL_UPDATES_STATE_STARTUP;
+ self->state = GS_UPDATES_PAGE_STATE_STARTUP;
self->settings = g_settings_new ("org.gnome.software");
self->desktop_settings = g_settings_new ("org.gnome.desktop.interface");
@@ -1460,12 +1457,12 @@ gs_shell_updates_init (GsShellUpdates *self)
self->ampm_available = TRUE;
}
-GsShellUpdates *
-gs_shell_updates_new (void)
+GsUpdatesPage *
+gs_updates_page_new (void)
{
- GsShellUpdates *self;
- self = g_object_new (GS_TYPE_SHELL_UPDATES, NULL);
- return GS_SHELL_UPDATES (self);
+ GsUpdatesPage *self;
+ self = g_object_new (GS_TYPE_UPDATES_PAGE, NULL);
+ return GS_UPDATES_PAGE (self);
}
/* vim: set noexpandtab: */
diff --git a/src/gs-shell-updates.h b/src/gs-updates-page.h
similarity index 79%
rename from src/gs-shell-updates.h
rename to src/gs-updates-page.h
index 3c7bb1f..35a10a5 100644
--- a/src/gs-shell-updates.h
+++ b/src/gs-updates-page.h
@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __GS_SHELL_UPDATES_H
-#define __GS_SHELL_UPDATES_H
+#ifndef __GS_UPDATES_PAGE_H
+#define __GS_UPDATES_PAGE_H
#include <glib-object.h>
#include <gtk/gtk.h>
@@ -31,14 +31,14 @@
G_BEGIN_DECLS
-#define GS_TYPE_SHELL_UPDATES (gs_shell_updates_get_type ())
+#define GS_TYPE_UPDATES_PAGE (gs_updates_page_get_type ())
-G_DECLARE_FINAL_TYPE (GsShellUpdates, gs_shell_updates, GS, SHELL_UPDATES, GsPage)
+G_DECLARE_FINAL_TYPE (GsUpdatesPage, gs_updates_page, GS, UPDATES_PAGE, GsPage)
-GsShellUpdates *gs_shell_updates_new (void);
+GsUpdatesPage *gs_updates_page_new (void);
G_END_DECLS
-#endif /* __GS_SHELL_UPDATES_H */
+#endif /* __GS_UPDATES_PAGE_H */
/* vim: set noexpandtab: */
diff --git a/src/gs-shell-updates.ui b/src/gs-updates-page.ui
similarity index 99%
rename from src/gs-shell-updates.ui
rename to src/gs-updates-page.ui
index 2ca87b9..46b944b 100644
--- a/src/gs-shell-updates.ui
+++ b/src/gs-updates-page.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.10"/>
- <template class="GsShellUpdates" parent="GsPage">
+ <template class="GsUpdatesPage" parent="GsPage">
<child internal-child="accessible">
<object class="AtkObject" id="updates-accessible">
<property name="accessible-name" translatable="yes">Updates page</property>
diff --git a/src/meson.build b/src/meson.build
index 65457ae..5b56218 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -53,15 +53,15 @@ gnome_software_sources = [
'gs-review-row.c',
'gs-screenshot-image.c',
'gs-shell.c',
- 'gs-shell-details.c',
- 'gs-shell-category.c',
- 'gs-shell-extras.c',
- 'gs-shell-installed.c',
- 'gs-shell-moderate.c',
- 'gs-shell-loading.c',
- 'gs-shell-overview.c',
- 'gs-shell-updates.c',
- 'gs-shell-search.c',
+ 'gs-details-page.c',
+ 'gs-category-page.c',
+ 'gs-extras-page.c',
+ 'gs-installed-page.c',
+ 'gs-moderate-page.c',
+ 'gs-loading-page.c',
+ 'gs-overview-page.c',
+ 'gs-updates-page.c',
+ 'gs-search-page.c',
'gs-sources-dialog.c',
'gs-sources-dialog-row.c',
'gs-update-dialog.c',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]