[gnome-software] Rename GsReposDialogRow to GsRepoRow
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Rename GsReposDialogRow to GsRepoRow
- Date: Mon, 26 Feb 2018 22:09:54 +0000 (UTC)
commit 38ea7678c23ad4a393515c10fd41e78f34b1dc73
Author: Kalev Lember <klember redhat com>
Date: Mon Feb 26 18:07:39 2018 +0100
Rename GsReposDialogRow to GsRepoRow
po/POTFILES.in | 4 +-
src/gnome-software.gresource.xml | 2 +-
src/{gs-repos-dialog-row.c => gs-repo-row.c} | 102 ++++++++++++-------------
src/gs-repo-row.h | 61 +++++++++++++++
src/{gs-repos-dialog-row.ui => gs-repo-row.ui} | 2 +-
src/gs-repos-dialog-row.h | 61 ---------------
src/gs-repos-dialog.c | 40 +++++-----
src/gs-repos-dialog.ui | 2 +-
src/meson.build | 2 +-
9 files changed, 138 insertions(+), 138 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index b02354db..c4459a87 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -49,8 +49,8 @@ src/gs-removal-dialog.c
src/gs-removal-dialog.ui
src/gs-repos-dialog.c
src/gs-repos-dialog.ui
-src/gs-repos-dialog-row.c
-src/gs-repos-dialog-row.ui
+src/gs-repo-row.c
+src/gs-repo-row.ui
src/gs-review-dialog.c
src/gs-review-dialog.ui
src/gs-review-histogram.ui
diff --git a/src/gnome-software.gresource.xml b/src/gnome-software.gresource.xml
index cea8f77b..cb296d85 100644
--- a/src/gnome-software.gresource.xml
+++ b/src/gnome-software.gresource.xml
@@ -21,7 +21,7 @@
<file preprocess="xml-stripblanks">gs-overview-page.ui</file>
<file preprocess="xml-stripblanks">gs-popular-tile.ui</file>
<file preprocess="xml-stripblanks">gs-removal-dialog.ui</file>
- <file preprocess="xml-stripblanks">gs-repos-dialog-row.ui</file>
+ <file preprocess="xml-stripblanks">gs-repo-row.ui</file>
<file preprocess="xml-stripblanks">gs-repos-dialog.ui</file>
<file preprocess="xml-stripblanks">gs-review-dialog.ui</file>
<file preprocess="xml-stripblanks">gs-review-histogram.ui</file>
diff --git a/src/gs-repos-dialog-row.c b/src/gs-repo-row.c
similarity index 70%
rename from src/gs-repos-dialog-row.c
rename to src/gs-repo-row.c
index ec0f6507..09ce0765 100644
--- a/src/gs-repos-dialog-row.c
+++ b/src/gs-repo-row.c
@@ -21,7 +21,7 @@
#include "config.h"
-#include "gs-repos-dialog-row.h"
+#include "gs-repo-row.h"
#include <glib/gi18n.h>
@@ -37,9 +37,9 @@ typedef struct
GtkWidget *url_title_label;
GtkWidget *url_value_label;
guint refresh_idle_id;
-} GsReposDialogRowPrivate;
+} GsRepoRowPrivate;
-G_DEFINE_TYPE_WITH_PRIVATE (GsReposDialogRow, gs_repos_dialog_row, GTK_TYPE_LIST_BOX_ROW)
+G_DEFINE_TYPE_WITH_PRIVATE (GsRepoRow, gs_repo_row, GTK_TYPE_LIST_BOX_ROW)
enum {
SIGNAL_BUTTON_CLICKED,
@@ -49,35 +49,35 @@ enum {
static guint signals [SIGNAL_LAST] = { 0 };
void
-gs_repos_dialog_row_set_switch_enabled (GsReposDialogRow *row,
- gboolean switch_enabled)
+gs_repo_row_set_switch_enabled (GsRepoRow *row,
+ gboolean switch_enabled)
{
- GsReposDialogRowPrivate *priv = gs_repos_dialog_row_get_instance_private (row);
+ GsRepoRowPrivate *priv = gs_repo_row_get_instance_private (row);
gtk_widget_set_visible (priv->active_switch, switch_enabled);
}
void
-gs_repos_dialog_row_set_name (GsReposDialogRow *row, const gchar *name)
+gs_repo_row_set_name (GsRepoRow *row, const gchar *name)
{
- GsReposDialogRowPrivate *priv = gs_repos_dialog_row_get_instance_private (row);
+ GsRepoRowPrivate *priv = gs_repo_row_get_instance_private (row);
gtk_label_set_text (GTK_LABEL (priv->name_label), name);
gtk_widget_set_visible (priv->name_label, name != NULL);
}
void
-gs_repos_dialog_row_set_comment (GsReposDialogRow *row, const gchar *comment)
+gs_repo_row_set_comment (GsRepoRow *row, const gchar *comment)
{
- GsReposDialogRowPrivate *priv = gs_repos_dialog_row_get_instance_private (row);
+ GsRepoRowPrivate *priv = gs_repo_row_get_instance_private (row);
gtk_label_set_markup (GTK_LABEL (priv->comment_label), comment);
gtk_widget_set_visible (priv->comment_label, comment != NULL);
}
void
-gs_repos_dialog_row_set_url (GsReposDialogRow *row, const gchar *url)
+gs_repo_row_set_url (GsRepoRow *row, const gchar *url)
{
- GsReposDialogRowPrivate *priv = gs_repos_dialog_row_get_instance_private (row);
+ GsRepoRowPrivate *priv = gs_repo_row_get_instance_private (row);
gtk_label_set_text (GTK_LABEL (priv->url_value_label), url);
gtk_widget_set_visible (priv->url_value_label, url != NULL);
@@ -99,9 +99,9 @@ repo_supports_removal (GsApp *repo)
}
static void
-refresh_ui (GsReposDialogRow *row)
+refresh_ui (GsRepoRow *row)
{
- GsReposDialogRowPrivate *priv = gs_repos_dialog_row_get_instance_private (row);
+ GsRepoRowPrivate *priv = gs_repo_row_get_instance_private (row);
if (priv->repo == NULL) {
gtk_widget_set_visible (priv->button, FALSE);
@@ -180,8 +180,8 @@ refresh_ui (GsReposDialogRow *row)
static gboolean
refresh_idle (gpointer user_data)
{
- g_autoptr(GsReposDialogRow) row = (GsReposDialogRow *) user_data;
- GsReposDialogRowPrivate *priv = gs_repos_dialog_row_get_instance_private (row);
+ g_autoptr(GsRepoRow) row = (GsRepoRow *) user_data;
+ GsRepoRowPrivate *priv = gs_repo_row_get_instance_private (row);
refresh_ui (row);
@@ -190,9 +190,9 @@ refresh_idle (gpointer user_data)
}
static void
-repo_state_changed_cb (GsApp *repo, GParamSpec *pspec, GsReposDialogRow *row)
+repo_state_changed_cb (GsApp *repo, GParamSpec *pspec, GsRepoRow *row)
{
- GsReposDialogRowPrivate *priv = gs_repos_dialog_row_get_instance_private (row);
+ GsRepoRowPrivate *priv = gs_repo_row_get_instance_private (row);
if (priv->refresh_idle_id > 0)
return;
@@ -200,9 +200,9 @@ repo_state_changed_cb (GsApp *repo, GParamSpec *pspec, GsReposDialogRow *row)
}
void
-gs_repos_dialog_row_set_repo (GsReposDialogRow *row, GsApp *repo)
+gs_repo_row_set_repo (GsRepoRow *row, GsApp *repo)
{
- GsReposDialogRowPrivate *priv = gs_repos_dialog_row_get_instance_private (row);
+ GsRepoRowPrivate *priv = gs_repo_row_get_instance_private (row);
g_assert (priv->repo == NULL);
@@ -214,56 +214,56 @@ gs_repos_dialog_row_set_repo (GsReposDialogRow *row, GsApp *repo)
}
GsApp *
-gs_repos_dialog_row_get_repo (GsReposDialogRow *row)
+gs_repo_row_get_repo (GsRepoRow *row)
{
- GsReposDialogRowPrivate *priv = gs_repos_dialog_row_get_instance_private (row);
+ GsRepoRowPrivate *priv = gs_repo_row_get_instance_private (row);
return priv->repo;
}
void
-gs_repos_dialog_row_show_details (GsReposDialogRow *row)
+gs_repo_row_show_details (GsRepoRow *row)
{
- GsReposDialogRowPrivate *priv = gs_repos_dialog_row_get_instance_private (row);
+ GsRepoRowPrivate *priv = gs_repo_row_get_instance_private (row);
gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (row), FALSE);
gtk_revealer_set_reveal_child (GTK_REVEALER (priv->details_revealer), TRUE);
}
void
-gs_repos_dialog_row_hide_details (GsReposDialogRow *row)
+gs_repo_row_hide_details (GsRepoRow *row)
{
- GsReposDialogRowPrivate *priv = gs_repos_dialog_row_get_instance_private (row);
+ GsRepoRowPrivate *priv = gs_repo_row_get_instance_private (row);
gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (row), TRUE);
gtk_revealer_set_reveal_child (GTK_REVEALER (priv->details_revealer), FALSE);
}
void
-gs_repos_dialog_row_show_status (GsReposDialogRow *row)
+gs_repo_row_show_status (GsRepoRow *row)
{
- GsReposDialogRowPrivate *priv = gs_repos_dialog_row_get_instance_private (row);
+ GsRepoRowPrivate *priv = gs_repo_row_get_instance_private (row);
gtk_widget_set_visible (priv->status_label, TRUE);
}
static void
-button_clicked_cb (GtkWidget *widget, GsReposDialogRow *row)
+button_clicked_cb (GtkWidget *widget, GsRepoRow *row)
{
g_signal_emit (row, signals[SIGNAL_BUTTON_CLICKED], 0);
}
GtkWidget *
-gs_repos_dialog_row_get_switch (GsReposDialogRow *row)
+gs_repo_row_get_switch (GsRepoRow *row)
{
- GsReposDialogRowPrivate *priv = gs_repos_dialog_row_get_instance_private (row);
+ GsRepoRowPrivate *priv = gs_repo_row_get_instance_private (row);
return priv->active_switch;
}
static void
-gs_repos_dialog_row_destroy (GtkWidget *object)
+gs_repo_row_destroy (GtkWidget *object)
{
- GsReposDialogRow *row = GS_REPOS_DIALOG_ROW (object);
- GsReposDialogRowPrivate *priv = gs_repos_dialog_row_get_instance_private (row);
+ GsRepoRow *row = GS_REPO_ROW (object);
+ GsRepoRowPrivate *priv = gs_repo_row_get_instance_private (row);
if (priv->repo != NULL) {
g_signal_handlers_disconnect_by_func (priv->repo, repo_state_changed_cb, row);
@@ -275,13 +275,13 @@ gs_repos_dialog_row_destroy (GtkWidget *object)
priv->refresh_idle_id = 0;
}
- GTK_WIDGET_CLASS (gs_repos_dialog_row_parent_class)->destroy (object);
+ GTK_WIDGET_CLASS (gs_repo_row_parent_class)->destroy (object);
}
static void
-gs_repos_dialog_row_init (GsReposDialogRow *row)
+gs_repo_row_init (GsRepoRow *row)
{
- GsReposDialogRowPrivate *priv = gs_repos_dialog_row_get_instance_private (row);
+ GsRepoRowPrivate *priv = gs_repo_row_get_instance_private (row);
gtk_widget_init_template (GTK_WIDGET (row));
g_signal_connect (priv->button, "clicked",
@@ -289,36 +289,36 @@ gs_repos_dialog_row_init (GsReposDialogRow *row)
}
static void
-gs_repos_dialog_row_class_init (GsReposDialogRowClass *klass)
+gs_repo_row_class_init (GsRepoRowClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- widget_class->destroy = gs_repos_dialog_row_destroy;
+ widget_class->destroy = gs_repo_row_destroy;
signals [SIGNAL_BUTTON_CLICKED] =
g_signal_new ("button-clicked",
G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GsReposDialogRowClass, button_clicked),
+ G_STRUCT_OFFSET (GsRepoRowClass, button_clicked),
NULL, NULL, g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/Software/gs-repos-dialog-row.ui");
+ gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-repo-row.ui");
- gtk_widget_class_bind_template_child_private (widget_class, GsReposDialogRow, active_switch);
- gtk_widget_class_bind_template_child_private (widget_class, GsReposDialogRow, button);
- gtk_widget_class_bind_template_child_private (widget_class, GsReposDialogRow, name_label);
- gtk_widget_class_bind_template_child_private (widget_class, GsReposDialogRow, comment_label);
- gtk_widget_class_bind_template_child_private (widget_class, GsReposDialogRow, details_revealer);
- gtk_widget_class_bind_template_child_private (widget_class, GsReposDialogRow, status_label);
- gtk_widget_class_bind_template_child_private (widget_class, GsReposDialogRow, url_title_label);
- gtk_widget_class_bind_template_child_private (widget_class, GsReposDialogRow, url_value_label);
+ gtk_widget_class_bind_template_child_private (widget_class, GsRepoRow, active_switch);
+ gtk_widget_class_bind_template_child_private (widget_class, GsRepoRow, button);
+ gtk_widget_class_bind_template_child_private (widget_class, GsRepoRow, name_label);
+ gtk_widget_class_bind_template_child_private (widget_class, GsRepoRow, comment_label);
+ gtk_widget_class_bind_template_child_private (widget_class, GsRepoRow, details_revealer);
+ gtk_widget_class_bind_template_child_private (widget_class, GsRepoRow, status_label);
+ gtk_widget_class_bind_template_child_private (widget_class, GsRepoRow, url_title_label);
+ gtk_widget_class_bind_template_child_private (widget_class, GsRepoRow, url_value_label);
}
GtkWidget *
-gs_repos_dialog_row_new (void)
+gs_repo_row_new (void)
{
- return g_object_new (GS_TYPE_REPOS_DIALOG_ROW, NULL);
+ return g_object_new (GS_TYPE_REPO_ROW, NULL);
}
/* vim: set noexpandtab: */
diff --git a/src/gs-repo-row.h b/src/gs-repo-row.h
new file mode 100644
index 00000000..ee7f888a
--- /dev/null
+++ b/src/gs-repo-row.h
@@ -0,0 +1,61 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2015-2018 Kalev Lember <klember redhat com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef GS_REPO_ROW_H
+#define GS_REPO_ROW_H
+
+#include "gnome-software-private.h"
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define GS_TYPE_REPO_ROW (gs_repo_row_get_type ())
+
+G_DECLARE_DERIVABLE_TYPE (GsRepoRow, gs_repo_row, GS, REPO_ROW, GtkListBoxRow)
+
+struct _GsRepoRowClass
+{
+ GtkListBoxRowClass parent_class;
+ void (*button_clicked) (GsRepoRow *row);
+};
+
+GtkWidget *gs_repo_row_new (void);
+void gs_repo_row_set_switch_enabled (GsRepoRow *row,
+ gboolean switch_enabled);
+GtkWidget *gs_repo_row_get_switch (GsRepoRow *row);
+void gs_repo_row_set_name (GsRepoRow *row,
+ const gchar *name);
+void gs_repo_row_set_comment (GsRepoRow *row,
+ const gchar *comment);
+void gs_repo_row_set_url (GsRepoRow *row,
+ const gchar *url);
+void gs_repo_row_set_repo (GsRepoRow *row,
+ GsApp *repo);
+GsApp *gs_repo_row_get_repo (GsRepoRow *row);
+void gs_repo_row_show_details (GsRepoRow *row);
+void gs_repo_row_hide_details (GsRepoRow *row);
+void gs_repo_row_show_status (GsRepoRow *row);
+
+G_END_DECLS
+
+#endif /* GS_REPO_ROW_H */
+
+/* vim: set noexpandtab: */
diff --git a/src/gs-repos-dialog-row.ui b/src/gs-repo-row.ui
similarity index 99%
rename from src/gs-repos-dialog-row.ui
rename to src/gs-repo-row.ui
index c57a6dc8..15d1a396 100644
--- a/src/gs-repos-dialog-row.ui
+++ b/src/gs-repo-row.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.10 -->
- <template class="GsReposDialogRow" parent="GtkListBoxRow">
+ <template class="GsRepoRow" parent="GtkListBoxRow">
<child>
<object class="GtkBox">
<property name="visible">True</property>
diff --git a/src/gs-repos-dialog.c b/src/gs-repos-dialog.c
index 15917fb0..c10c1db8 100644
--- a/src/gs-repos-dialog.c
+++ b/src/gs-repos-dialog.c
@@ -28,7 +28,7 @@
#include "gnome-software-private.h"
#include "gs-common.h"
#include "gs-os-release.h"
-#include "gs-repos-dialog-row.h"
+#include "gs-repo-row.h"
#include <glib/gi18n.h>
struct _GsReposDialog
@@ -282,12 +282,12 @@ remove_confirm_repo (GsReposDialog *dialog, GsApp *repo)
}
static void
-repo_button_clicked_cb (GsReposDialogRow *row,
+repo_button_clicked_cb (GsRepoRow *row,
GsReposDialog *dialog)
{
- GsApp *repo;
+ GsApp *repo;
- repo = gs_repos_dialog_row_get_repo (row);
+ repo = gs_repo_row_get_repo (row);
switch (gs_app_get_state (repo)) {
case AS_APP_STATE_AVAILABLE:
@@ -324,15 +324,15 @@ add_repo (GsReposDialog *dialog, GsApp *repo)
return;
}
- row = gs_repos_dialog_row_new ();
- gs_repos_dialog_row_set_name (GS_REPOS_DIALOG_ROW (row),
- gs_app_get_name (repo));
+ row = gs_repo_row_new ();
+ gs_repo_row_set_name (GS_REPO_ROW (row),
+ gs_app_get_name (repo));
text = get_repo_installed_text (repo);
- gs_repos_dialog_row_set_comment (GS_REPOS_DIALOG_ROW (row), text);
- gs_repos_dialog_row_set_url (GS_REPOS_DIALOG_ROW (row),
- gs_app_get_url (repo, AS_URL_KIND_HOMEPAGE));
- gs_repos_dialog_row_show_status (GS_REPOS_DIALOG_ROW (row));
- gs_repos_dialog_row_set_repo (GS_REPOS_DIALOG_ROW (row), repo);
+ gs_repo_row_set_comment (GS_REPO_ROW (row), text);
+ gs_repo_row_set_url (GS_REPO_ROW (row),
+ gs_app_get_url (repo, AS_URL_KIND_HOMEPAGE));
+ gs_repo_row_show_status (GS_REPO_ROW (row));
+ gs_repo_row_set_repo (GS_REPO_ROW (row), repo);
g_object_set_data_full (G_OBJECT (row),
"sort",
@@ -610,13 +610,13 @@ list_row_activated_cb (GtkListBox *list_box,
{
GtkListBoxRow *other_row;
- gs_repos_dialog_row_show_details (GS_REPOS_DIALOG_ROW (row));
+ gs_repo_row_show_details (GS_REPO_ROW (row));
for (guint i = 0; (other_row = gtk_list_box_get_row_at_index (list_box, i)) != NULL; i++) {
if (other_row == row)
continue;
- gs_repos_dialog_row_hide_details (GS_REPOS_DIALOG_ROW (other_row));
+ gs_repo_row_hide_details (GS_REPO_ROW (other_row));
}
}
@@ -707,14 +707,14 @@ gs_repos_dialog_init (GsReposDialog *dialog)
gtk_label_set_text (GTK_LABEL (dialog->label_description), label_description_text);
/* set up third party repository row */
- dialog->switch_third_party = gs_repos_dialog_row_get_switch (GS_REPOS_DIALOG_ROW
(dialog->row_third_party));
+ dialog->switch_third_party = gs_repo_row_get_switch (GS_REPO_ROW (dialog->row_third_party));
g_signal_connect (dialog->switch_third_party, "state-set",
G_CALLBACK (third_party_switch_state_set_cb),
dialog);
- gs_repos_dialog_row_set_switch_enabled (GS_REPOS_DIALOG_ROW (dialog->row_third_party), TRUE);
- gs_repos_dialog_row_set_name (GS_REPOS_DIALOG_ROW (dialog->row_third_party),
- /* TRANSLATORS: info bar title in the software repositories dialog */
- _("Third Party Repositories"));
+ gs_repo_row_set_switch_enabled (GS_REPO_ROW (dialog->row_third_party), TRUE);
+ gs_repo_row_set_name (GS_REPO_ROW (dialog->row_third_party),
+ /* TRANSLATORS: info bar title in the software repositories dialog */
+ _("Third Party Repositories"));
g_string_append (str,
/* TRANSLATORS: this is the third party repositories info bar. */
_("Access additional software from selected third party sources."));
@@ -730,7 +730,7 @@ gs_repos_dialog_init (GsReposDialog *dialog)
* link on the third party repositories info bar */
_("Find out moreā¦"));
}
- gs_repos_dialog_row_set_comment (GS_REPOS_DIALOG_ROW (dialog->row_third_party), str->str);
+ gs_repo_row_set_comment (GS_REPO_ROW (dialog->row_third_party), str->str);
refresh_third_party_repo (dialog);
/* TRANSLATORS: This is the description text displayed in the Software Repositories dialog.
diff --git a/src/gs-repos-dialog.ui b/src/gs-repos-dialog.ui
index 76b96055..5ec42704 100644
--- a/src/gs-repos-dialog.ui
+++ b/src/gs-repos-dialog.ui
@@ -158,7 +158,7 @@
<property name="can_focus">False</property>
<property name="selection_mode">none</property>
<child>
- <object class="GsReposDialogRow" id="row_third_party">
+ <object class="GsRepoRow" id="row_third_party">
<property name="visible">True</property>
<property name="activatable">False</property>
</object>
diff --git a/src/meson.build b/src/meson.build
index f2a82178..18d5bf80 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -47,7 +47,7 @@ gnome_software_sources = [
'gs-progress-button.c',
'gs-removal-dialog.c',
'gs-repos-dialog.c',
- 'gs-repos-dialog-row.c',
+ 'gs-repo-row.c',
'gs-review-bar.c',
'gs-review-dialog.c',
'gs-review-histogram.c',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]