[gnome-software] shell updates: Rip out the "updated" mode
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] shell updates: Rip out the "updated" mode
- Date: Wed, 14 May 2014 13:57:09 +0000 (UTC)
commit 0f468fc83b20b3cd007d46d29c9579c6160b4f94
Author: Kalev Lember <kalevlember gmail com>
Date: Sat May 10 14:39:47 2014 +0200
shell updates: Rip out the "updated" mode
The replacement is now in the updates dialog.
src/gs-shell-updates.c | 31 +++++++------------------------
src/gs-shell-updates.h | 1 -
src/gs-shell.c | 8 ++------
src/gs-shell.h | 1 -
4 files changed, 9 insertions(+), 32 deletions(-)
---
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index 4793cea..3e1cafc 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -300,8 +300,7 @@ gs_shell_updates_update_ui_state (GsShellUpdates *shell_updates)
gtk_image_set_from_icon_name (GTK_IMAGE (widget),
"view-refresh-symbolic", GTK_ICON_SIZE_MENU);
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_refresh"));
- gtk_widget_set_visible (widget,
- gs_shell_get_mode (priv->shell) != GS_SHELL_MODE_UPDATED);
+ gtk_widget_show (widget);
break;
case GS_SHELL_UPDATES_STATE_NO_UPDATES:
gtk_image_set_from_icon_name (GTK_IMAGE (widget),
@@ -381,8 +380,7 @@ gs_shell_updates_set_state (GsShellUpdates *shell_updates,
GsShellUpdatesState state)
{
shell_updates->priv->state = state;
- if (gs_shell_get_mode (shell_updates->priv->shell) == GS_SHELL_MODE_UPDATES ||
- gs_shell_get_mode (shell_updates->priv->shell) == GS_SHELL_MODE_UPDATED)
+ if (gs_shell_get_mode (shell_updates->priv->shell) == GS_SHELL_MODE_UPDATES)
gs_shell_updates_update_ui_state (shell_updates);
}
@@ -418,8 +416,7 @@ gs_shell_updates_get_updates_cb (GsPluginLoader *plugin_loader,
list = gs_plugin_loader_get_updates_finish (plugin_loader, res, &error);
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_updates_counter"));
- if (list != NULL &&
- gs_shell_get_mode (priv->shell) != GS_SHELL_MODE_UPDATED) {
+ if (list != NULL) {
gchar *text;
text = g_strdup_printf ("%d", g_list_length (list));
gtk_label_set_label (GTK_LABEL (widget), text);
@@ -430,8 +427,7 @@ gs_shell_updates_get_updates_cb (GsPluginLoader *plugin_loader,
}
if (list != NULL &&
- gs_shell_get_mode (priv->shell) != GS_SHELL_MODE_UPDATES &&
- gs_shell_get_mode (priv->shell) != GS_SHELL_MODE_UPDATED)
+ gs_shell_get_mode (priv->shell) != GS_SHELL_MODE_UPDATES)
gtk_style_context_add_class (gtk_widget_get_style_context (widget), "needs-attention");
else
gtk_style_context_remove_class (gtk_widget_get_style_context (widget), "needs-attention");
@@ -481,29 +477,18 @@ out:
**/
void
gs_shell_updates_refresh (GsShellUpdates *shell_updates,
- gboolean show_historical,
gboolean scroll_up)
{
GsShellUpdatesPrivate *priv = shell_updates->priv;
GtkWidget *widget;
- GtkWindow *window;
GList *list;
guint64 refine_flags;
- if (gs_shell_get_mode (priv->shell) == GS_SHELL_MODE_UPDATES ||
- gs_shell_get_mode (priv->shell) == GS_SHELL_MODE_UPDATED) {
+ if (gs_shell_get_mode (priv->shell) == GS_SHELL_MODE_UPDATES) {
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "buttonbox_main"));
gtk_widget_show (widget);
}
- /* set the window title to be more specific */
- window = GTK_WINDOW (gtk_builder_get_object (priv->builder, "window_software"));
- if (show_historical) {
- /* TRANSLATORS: window title to suggest that we are showing
- * the offline updates that have just been applied */
- gtk_window_set_title (window, _("Recent Software Updates"));
- }
-
if (gs_shell_get_mode (priv->shell) == GS_SHELL_MODE_UPDATES) {
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_refresh"));
gtk_widget_set_visible (widget, TRUE);
@@ -534,8 +519,6 @@ gs_shell_updates_refresh (GsShellUpdates *shell_updates,
refine_flags = GS_PLUGIN_REFINE_FLAGS_DEFAULT |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_UPDATE_DETAILS |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION;
- if (show_historical)
- refine_flags |= GS_PLUGIN_REFINE_FLAGS_USE_HISTORY;
gs_shell_updates_set_state (shell_updates,
GS_SHELL_UPDATES_STATE_ACTION_GET_UPDATES);
gs_plugin_loader_get_updates_async (priv->plugin_loader,
@@ -681,7 +664,7 @@ gs_shell_updates_refresh_cb (GsPluginLoader *plugin_loader,
g_date_time_unref (now);
/* get the new list */
- gs_shell_updates_refresh (shell_updates, FALSE, TRUE);
+ gs_shell_updates_refresh (shell_updates, TRUE);
}
/**
@@ -864,7 +847,7 @@ gs_shell_updates_changed_cb (GsPluginLoader *plugin_loader,
GsShellUpdates *shell_updates)
{
gs_shell_updates_invalidate (shell_updates);
- gs_shell_updates_refresh (shell_updates, FALSE, TRUE);
+ gs_shell_updates_refresh (shell_updates, TRUE);
}
/**
diff --git a/src/gs-shell-updates.h b/src/gs-shell-updates.h
index fe3a654..4600e92 100644
--- a/src/gs-shell-updates.h
+++ b/src/gs-shell-updates.h
@@ -55,7 +55,6 @@ GType gs_shell_updates_get_type (void);
GsShellUpdates *gs_shell_updates_new (void);
void gs_shell_updates_invalidate (GsShellUpdates *shell_updates);
void gs_shell_updates_refresh (GsShellUpdates *shell_updates,
- gboolean show_historical,
gboolean scroll_up);
void gs_shell_updates_setup (GsShellUpdates *shell_updates,
GsShell *shell,
diff --git a/src/gs-shell.c b/src/gs-shell.c
index e179d49..a459f24 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -43,7 +43,6 @@ static const gchar *page_name[] = {
"updates",
"details",
"category",
- "updates"
};
static void gs_shell_finalize (GObject *object);
@@ -192,10 +191,7 @@ gs_shell_change_mode (GsShell *shell,
gs_shell_search_refresh (priv->shell_search, text, scroll_up);
break;
case GS_SHELL_MODE_UPDATES:
- gs_shell_updates_refresh (priv->shell_updates, FALSE, scroll_up);
- break;
- case GS_SHELL_MODE_UPDATED:
- gs_shell_updates_refresh (priv->shell_updates, TRUE, scroll_up);
+ gs_shell_updates_refresh (priv->shell_updates, scroll_up);
break;
case GS_SHELL_MODE_DETAILS:
if (app != NULL) {
@@ -289,7 +285,7 @@ initial_overview_load_done (GsShellOverview *shell_overview, gpointer data)
g_signal_handlers_disconnect_by_func (shell_overview, initial_overview_load_done, data);
- gs_shell_updates_refresh (shell->priv->shell_updates, FALSE, TRUE);
+ gs_shell_updates_refresh (shell->priv->shell_updates, TRUE);
gs_shell_installed_refresh (shell->priv->shell_installed, TRUE);
g_signal_emit (shell, signals[SIGNAL_LOADED], 0);
diff --git a/src/gs-shell.h b/src/gs-shell.h
index a7400c3..c3959b0 100644
--- a/src/gs-shell.h
+++ b/src/gs-shell.h
@@ -60,7 +60,6 @@ typedef enum {
GS_SHELL_MODE_UPDATES,
GS_SHELL_MODE_DETAILS,
GS_SHELL_MODE_CATEGORY,
- GS_SHELL_MODE_UPDATED,
GS_SHELL_MODE_LAST
} GsShellMode;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]