gnome-packagekit r131 - trunk/src
- From: rhughes svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-packagekit r131 - trunk/src
- Date: Thu, 27 Mar 2008 00:42:58 +0000 (GMT)
Author: rhughes
Date: Thu Mar 27 00:42:58 2008
New Revision: 131
URL: http://svn.gnome.org/viewvc/gnome-packagekit?rev=131&view=rev
Log:
from git
Modified:
trunk/src/pk-application.c
trunk/src/pk-install-package.c
trunk/src/pk-progress.c
trunk/src/pk-transaction-viewer.c
Modified: trunk/src/pk-application.c
==============================================================================
--- trunk/src/pk-application.c (original)
+++ trunk/src/pk-application.c Thu Mar 27 00:42:58 2008
@@ -203,6 +203,8 @@
pk_application_homepage_cb (GtkWidget *widget,
PkApplication *application)
{
+ g_return_if_fail (application != NULL);
+ g_return_if_fail (PK_IS_APPLICATION (application));
pk_execute_url (application->priv->url);
}
@@ -235,6 +237,9 @@
static void
pk_application_requires_dialog_cb (GtkDialog *dialog, gint id, PkApplication *application)
{
+ g_return_if_fail (application != NULL);
+ g_return_if_fail (PK_IS_APPLICATION (application));
+
if (id == -9) {
pk_debug ("the user clicked no");
} else if (id == -8) {
@@ -261,6 +266,9 @@
GtkWidget *dialog;
guint i;
+ g_return_if_fail (application != NULL);
+ g_return_if_fail (PK_IS_APPLICATION (application));
+
/* see how many packages there are */
length = pk_client_package_buffer_get_size (client);
@@ -1062,6 +1070,7 @@
{
g_return_if_fail (application != NULL);
g_return_if_fail (PK_IS_APPLICATION (application));
+
pk_notebook_populate (application, page);
}
@@ -1131,6 +1140,7 @@
{
g_return_if_fail (application != NULL);
g_return_if_fail (PK_IS_APPLICATION (application));
+
pk_debug ("connected=%i", connected);
}
@@ -1268,6 +1278,9 @@
GtkWidget *image;
PkApplication *application = PK_APPLICATION (data);
+ g_return_if_fail (application != NULL);
+ g_return_if_fail (PK_IS_APPLICATION (application));
+
/* only respond to left button */
if (button != 1) {
return;
@@ -1494,6 +1507,10 @@
pk_application_menu_sources_cb (GtkAction *action, PkApplication *application)
{
gboolean ret;
+
+ g_return_if_fail (application != NULL);
+ g_return_if_fail (PK_IS_APPLICATION (application));
+
ret = g_spawn_command_line_async ("pk-repo", NULL);
if (ret == FALSE) {
pk_warning ("spawn of pk-repo failed");
@@ -1506,6 +1523,9 @@
static void
pk_application_menu_quit_cb (GtkAction *action, PkApplication *application)
{
+ g_return_if_fail (application != NULL);
+ g_return_if_fail (PK_IS_APPLICATION (application));
+
pk_application_quit (application);
}
@@ -1517,6 +1537,10 @@
pk_application_menu_filter_installed_cb (GtkWidget *widget, PkApplication *application)
{
const gchar *name;
+
+ g_return_if_fail (application != NULL);
+ g_return_if_fail (PK_IS_APPLICATION (application));
+
name = gtk_widget_get_name (widget);
/* only care about new state */
@@ -1548,6 +1572,10 @@
pk_application_menu_filter_devel_cb (GtkWidget *widget, PkApplication *application)
{
const gchar *name;
+
+ g_return_if_fail (application != NULL);
+ g_return_if_fail (PK_IS_APPLICATION (application));
+
name = gtk_widget_get_name (widget);
/* only care about new state */
@@ -1579,6 +1607,10 @@
pk_application_menu_filter_gui_cb (GtkWidget *widget, PkApplication *application)
{
const gchar *name;
+
+ g_return_if_fail (application != NULL);
+ g_return_if_fail (PK_IS_APPLICATION (application));
+
name = gtk_widget_get_name (widget);
/* only care about new state */
@@ -1610,6 +1642,10 @@
pk_application_menu_filter_free_cb (GtkWidget *widget, PkApplication *application)
{
const gchar *name;
+
+ g_return_if_fail (application != NULL);
+ g_return_if_fail (PK_IS_APPLICATION (application));
+
name = gtk_widget_get_name (widget);
/* only care about new state */
@@ -1640,6 +1676,9 @@
static void
pk_application_menu_filter_basename_cb (GtkWidget *widget, PkApplication *application)
{
+ g_return_if_fail (application != NULL);
+ g_return_if_fail (PK_IS_APPLICATION (application));
+
/* single checkbox */
if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget))) {
pk_enum_list_append (application->priv->current_filter, PK_FILTER_ENUM_BASENAME);
@@ -1658,6 +1697,9 @@
static void
pk_application_menu_filter_newest_cb (GtkWidget *widget, PkApplication *application)
{
+ g_return_if_fail (application != NULL);
+ g_return_if_fail (PK_IS_APPLICATION (application));
+
/* single checkbox */
if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget))) {
// pk_enum_list_append (application->priv->current_filter, PK_FILTER_ENUM_NEWEST);
@@ -1675,10 +1717,27 @@
static void
pk_application_status_changed_cb (PkClient *client, PkStatusEnum status, PkApplication *application)
{
+ g_return_if_fail (application != NULL);
+ g_return_if_fail (PK_IS_APPLICATION (application));
pk_statusbar_set_status (application->priv->statusbar, status);
}
/**
+ * pk_application_allow_cancel_cb:
+ **/
+static void
+pk_application_allow_cancel_cb (PkClient *client, gboolean allow_cancel, PkApplication *application)
+{
+ GtkWidget *widget;
+
+ g_return_if_fail (application != NULL);
+ g_return_if_fail (PK_IS_APPLICATION (application));
+
+ widget = glade_xml_get_widget (application->priv->glade_xml, "button_cancel");
+ gtk_widget_set_sensitive (widget, allow_cancel);
+}
+
+/**
* pk_application_init:
**/
static void
@@ -1729,6 +1788,8 @@
G_CALLBACK (pk_application_progress_changed_cb), application);
g_signal_connect (application->priv->client_search, "status-changed",
G_CALLBACK (pk_application_status_changed_cb), application);
+ g_signal_connect (application->priv->client_search, "allow-cancel",
+ G_CALLBACK (pk_application_allow_cancel_cb), application);
application->priv->client_action = pk_client_new ();
g_signal_connect (application->priv->client_action, "package",
@@ -1741,6 +1802,8 @@
G_CALLBACK (pk_application_progress_changed_cb), application);
g_signal_connect (application->priv->client_action, "status-changed",
G_CALLBACK (pk_application_status_changed_cb), application);
+ g_signal_connect (application->priv->client_action, "allow-cancel",
+ G_CALLBACK (pk_application_allow_cancel_cb), application);
application->priv->client_description = pk_client_new ();
g_signal_connect (application->priv->client_description, "description",
@@ -1753,6 +1816,8 @@
G_CALLBACK (pk_application_progress_changed_cb), application);
g_signal_connect (application->priv->client_description, "status-changed",
G_CALLBACK (pk_application_status_changed_cb), application);
+ g_signal_connect (application->priv->client_description, "allow-cancel",
+ G_CALLBACK (pk_application_allow_cancel_cb), application);
application->priv->client_files = pk_client_new ();
pk_client_set_use_buffer (application->priv->client_files, TRUE, NULL);
@@ -1766,6 +1831,8 @@
G_CALLBACK (pk_application_progress_changed_cb), application);
g_signal_connect (application->priv->client_files, "status-changed",
G_CALLBACK (pk_application_status_changed_cb), application);
+ g_signal_connect (application->priv->client_files, "allow-cancel",
+ G_CALLBACK (pk_application_allow_cancel_cb), application);
/* get actions */
application->priv->role_list = pk_client_get_actions (application->priv->client_action);
Modified: trunk/src/pk-install-package.c
==============================================================================
--- trunk/src/pk-install-package.c (original)
+++ trunk/src/pk-install-package.c Thu Mar 27 00:42:58 2008
@@ -110,7 +110,7 @@
* pk_monitor_resolve_package_cb:
**/
static void
-pk_monitor_resolve_package_cb (PkClient *client, guint value, const gchar *package_id,
+pk_monitor_resolve_package_cb (PkClient *client, PkInfoEnum info, const gchar *package_id,
const gchar *summary, gboolean data)
{
/* save */
Modified: trunk/src/pk-progress.c
==============================================================================
--- trunk/src/pk-progress.c (original)
+++ trunk/src/pk-progress.c Thu Mar 27 00:42:58 2008
@@ -203,11 +203,8 @@
* pk_progress_package_cb:
*/
static void
-pk_progress_package_cb (PkClient *client,
- guint value,
- const gchar *package_id,
- const gchar *summary,
- PkProgress *progress)
+pk_progress_package_cb (PkClient *client, PkInfoEnum info, const gchar *package_id,
+ const gchar *summary, PkProgress *progress)
{
GtkWidget *widget;
PkPackageId *ident;
@@ -419,7 +416,7 @@
gtk_widget_show (widget);
icon_name = pk_status_enum_to_icon_name (status);
gtk_image_set_from_icon_name (GTK_IMAGE (widget), icon_name, GTK_ICON_SIZE_DIALOG);
- g_print ("setting icon %s\n", icon_name);
+ pk_debug ("setting icon %s\n", icon_name);
}
/**
@@ -446,8 +443,18 @@
gchar *text;
PkRoleEnum role;
PkPackageId *ident;
+ GError *error = NULL;
+ gboolean ret;
+
+ /* get role and text */
+ ret = pk_client_get_role (client, &role, &package_id, &error);
+ if (!ret) {
+ pk_warning ("failed to get role: %s", error->message);
+ g_error_free (error);
+ return NULL;
+ }
- pk_client_get_role (client, &role, &package_id, NULL);
+ /* backup */
role_text = pk_role_enum_to_localised_present (role);
/* check to see if we have a package_id or just a search term */
Modified: trunk/src/pk-transaction-viewer.c
==============================================================================
--- trunk/src/pk-transaction-viewer.c (original)
+++ trunk/src/pk-transaction-viewer.c Thu Mar 27 00:42:58 2008
@@ -106,10 +106,27 @@
{
GDate *date;
GTimeVal timeval;
+ GTimeVal timeval_now;
gchar buffer[100];
+ guint hours;
+ /* the old date */
g_time_val_from_iso8601 (timespec, &timeval);
+ /* the new date */
+ g_get_current_time (&timeval_now);
+
+ /* the difference in hours */
+ hours = (timeval_now.tv_sec - timeval.tv_sec) / (60 * 60);
+ pk_debug ("hours is %i", hours);
+
+ /* is this recently? */
+ if (hours < 24) {
+ return g_strdup (_("Today"));
+ } else if (hours < 24*2) {
+ return g_strdup (_("Yesterday"));
+ }
+
/* get printed string */
date = g_date_new ();
g_date_set_time_val (date, &timeval);
@@ -198,7 +215,7 @@
/* image */
renderer = gtk_cell_renderer_pixbuf_new ();
- g_object_set (renderer, "stock-size", GTK_ICON_SIZE_MENU, NULL);
+ g_object_set (renderer, "stock-size", GTK_ICON_SIZE_BUTTON, NULL);
column = gtk_tree_view_column_new_with_attributes (_("Succeeded"), renderer,
"icon-name", PACKAGES_COLUMN_GENERAL_SUCCEEDED, NULL);
gtk_tree_view_append_column (treeview, column);
@@ -215,7 +232,7 @@
/* image */
renderer = gtk_cell_renderer_pixbuf_new ();
- g_object_set (renderer, "stock-size", GTK_ICON_SIZE_MENU, NULL);
+ g_object_set (renderer, "stock-size", GTK_ICON_SIZE_DIALOG, NULL);
column = gtk_tree_view_column_new_with_attributes (_("Type"), renderer,
"icon-name", PACKAGES_COLUMN_DETAILS_ICON, NULL);
gtk_tree_view_append_column (treeview, column);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]