[gnome-packagekit/glib2: 77/79] moo
- From: Richard Hughes <rhughes src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-packagekit/glib2: 77/79] moo
- Date: Tue, 6 Oct 2009 09:51:12 +0000 (UTC)
commit 460906685fb2f7796fa8ffca85c583b05fd98900
Author: Richard Hughes <richard hughsie com>
Date: Mon Oct 5 16:22:08 2009 +0100
moo
src/gpk-dialog.c | 26 +++++++++++++++++---------
src/gpk-task.c | 31 +++++++++++++++++++++++++------
2 files changed, 42 insertions(+), 15 deletions(-)
---
diff --git a/src/gpk-dialog.c b/src/gpk-dialog.c
index b75c023..ac2ef41 100644
--- a/src/gpk-dialog.c
+++ b/src/gpk-dialog.c
@@ -78,10 +78,10 @@ gpk_dialog_package_id_name_join_locale (gchar **package_ids)
}
/**
- * gpk_dialog_package_list_to_list_store:
+ * gpk_dialog_package_array_to_list_store:
**/
static GtkListStore *
-gpk_dialog_package_list_to_list_store (GPtrArray *list)
+gpk_dialog_package_array_to_list_store (GPtrArray *array)
{
GtkListStore *store;
GtkTreeIter iter;
@@ -97,8 +97,8 @@ gpk_dialog_package_list_to_list_store (GPtrArray *list)
store = gtk_list_store_new (GPK_DIALOG_STORE_LAST, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
/* add each well */
- for (i=0; i<list->len; i++) {
- item = g_ptr_array_index (list, i);
+ for (i=0; i<array->len; i++) {
+ item = g_ptr_array_index (array, i);
text = gpk_package_id_format_twoline (item->package_id, item->summary);
/* get the icon */
@@ -169,15 +169,23 @@ gpk_dialog_widget_unrealize_unref_cb (GtkWidget *widget, GObject *obj)
* gpk_dialog_embed_package_list_widget:
**/
gboolean
-gpk_dialog_embed_package_list_widget (GtkDialog *dialog, GPtrArray *list)
+gpk_dialog_embed_package_list_widget (GtkDialog *dialog, GPtrArray *array)
{
GtkWidget *scroll;
GtkListStore *store;
GtkWidget *widget;
const guint row_height = 48;
+ PkItemPackage *item;
+ guint i;
+
+ /* debug */
+ for (i=0; i<array->len; i++) {
+ item = g_ptr_array_index (array, i);
+ egg_debug ("add %s,%s", pk_info_enum_to_text (item->info), item->package_id);
+ }
/* convert to a store */
- store = gpk_dialog_package_list_to_list_store (list);
+ store = gpk_dialog_package_array_to_list_store (array);
/* create a treeview to hold the store */
widget = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
@@ -194,10 +202,10 @@ gpk_dialog_embed_package_list_widget (GtkDialog *dialog, GPtrArray *list)
gtk_container_set_border_width (GTK_CONTAINER (scroll), 6);
/* only allow more space if there are a large number of items */
- if (list->len > 5) {
+ if (array->len > 5) {
gtk_widget_set_size_request (GTK_WIDGET (scroll), -1, (row_height * 5) + 8);
- } else if (list->len > 1) {
- gtk_widget_set_size_request (GTK_WIDGET (scroll), -1, (row_height * list->len) + 8);
+ } else if (array->len > 1) {
+ gtk_widget_set_size_request (GTK_WIDGET (scroll), -1, (row_height * array->len) + 8);
}
/* add scrolled window */
diff --git a/src/gpk-task.c b/src/gpk-task.c
index b0833c9..234af58 100644
--- a/src/gpk-task.c
+++ b/src/gpk-task.c
@@ -357,7 +357,7 @@ gpk_task_simulate_question (PkTask *task, guint request, PkResults *results)
NULL);
/* allow skipping of deps except when we remove other packages */
- if (role != PK_ROLE_ENUM_REMOVE_PACKAGES) {
+ if (role != PK_ROLE_ENUM_SIMULATE_REMOVE_PACKAGES) {
/* have we previously said we don't want to be shown the confirmation */
ret = gconf_client_get_bool (priv->gconf_client, GPK_CONF_SHOW_DEPENDS, NULL);
if (!ret) {
@@ -368,20 +368,39 @@ gpk_task_simulate_question (PkTask *task, guint request, PkResults *results)
}
/* per-role messages */
- title = _("Additional software required");
- if (role == PK_ROLE_ENUM_INSTALL_PACKAGES) {
+ if (role == PK_ROLE_ENUM_SIMULATE_INSTALL_PACKAGES) {
+ /* TRANSLATORS: title of a dependency dialog */
+ title = _("Additional software will be installed");
+
+ /* TRANSLATORS: message text of a dependency dialog */
message = ngettext ("To install this package, additional software also has to be installed.",
"To install these packages, additional software also has to be installed.", inputs);
- } else if (role == PK_ROLE_ENUM_REMOVE_PACKAGES) {
+ } else if (role == PK_ROLE_ENUM_SIMULATE_REMOVE_PACKAGES) {
+ /* TRANSLATORS: title of a dependency dialog */
+ title = _("Additional software will be removed");
+
+ /* TRANSLATORS: message text of a dependency dialog */
message = ngettext ("To remove this package, additional software also has to be removed.",
"To remove these packages, additional software also has to be removed.", inputs);
- } else if (role == PK_ROLE_ENUM_UPDATE_PACKAGES) {
+ } else if (role == PK_ROLE_ENUM_SIMULATE_UPDATE_PACKAGES) {
+ /* TRANSLATORS: title of a dependency dialog */
+ title = _("Additional software will be installed");
+
+ /* TRANSLATORS: message text of a dependency dialog */
message = ngettext ("To update this package, additional software also has to be installed.",
"To update these packages, additional software also has to be installed.", inputs);
- } else if (role == PK_ROLE_ENUM_INSTALL_FILES) {
+ } else if (role == PK_ROLE_ENUM_SIMULATE_INSTALL_FILES) {
+ /* TRANSLATORS: title of a dependency dialog */
+ title = _("Additional software will be installed");
+
+ /* TRANSLATORS: message text of a dependency dialog */
message = ngettext ("To install this file, additional software also has to be installed.",
"To install these file, additional software also has to be installed.", inputs);
} else {
+ /* TRANSLATORS: title of a dependency dialog */
+ title = _("Additional software required");
+
+ /* TRANSLATORS: message text of a dependency dialog */
message = _("To process this transaction, additional software is required.");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]