Commit 6d347b9f authored by Richard Hughes's avatar Richard Hughes
Browse files

updates: port the gpk-update-icon update checking functionality

This provides libnotify messages if the user has not selected the updates
to be automatically installed. It does *not* provide a status icon.

I have also hooked up the distribution upgrades to present the user
a libnotify dialog if the option is selected by the admin in GSettings.
parent 90fa432d
......@@ -281,7 +281,7 @@ AC_ARG_ENABLE(packagekit,
if test x$WANT_PACKAGEKIT = xyes ; then
PK_REQUIRED_VERSION=0.6.4
PKG_CHECK_MODULES(PACKAGEKIT, glib-2.0 packagekit-glib2 >= $PK_REQUIRED_VERSION,
PKG_CHECK_MODULES(PACKAGEKIT, glib-2.0 packagekit-glib2 >= $PK_REQUIRED_VERSION upower-glib >= 0.9.1,
[have_packagekit=true
AC_DEFINE(HAVE_PACKAGEKIT, 1, [Define if PackageKit should be used])],
[have_packagekit=false])
......
......@@ -100,4 +100,11 @@ typedef enum
GSD_POWER_ACTION_NOTHING
} GsdPowerActionType;
typedef enum
{
GSD_UPDATE_TYPE_ALL,
GSD_UPDATE_TYPE_SECURITY,
GSD_UPDATE_TYPE_NONE
} GsdUpdateType;
#endif /* __gsd_enums_h__ */
......@@ -15,5 +15,80 @@
<_summary>The install root to use when adding and removing packages</_summary>
<_description>The install root to use when processing packages, which is changed when using LTSP or when testing.</_description>
</key>
<key name="connection-use-mobile" type="b">
<default>false</default>
<_summary>Use mobile broadband connections</_summary>
<_description>Use mobile broadband connections such as GSM and CDMA to check for updates.</_description>
</key>
<key name="connection-use-wifi" type="b">
<default>true</default>
<_summary>Use WiFi connections</_summary>
<_description>Use WiFi (wireless LAN) connections to check for updates. It may be faster to download packages when on a wired connection, and the VPN or proxy required may also only be available on wired connections.</_description>
</key>
<key name="auto-update-type" enum="org.gnome.settings-daemon.GsdUpdateType">
<default>'security'</default>
<_summary>Automatically update these types of updates</_summary>
<_description>Automatically update these types of updates.</_description>
</key>
<key name="force-get-updates-login" type="b">
<default>false</default>
<_summary>Get the update list when the session starts</_summary>
<_description>Get the update list when the session starts, even if not scheduled to. This ensures the user has up to date and valid data in the tray at startup.</_description>
</key>
<key name="frequency-get-updates" type="i">
<default>86400</default>
<_summary>How often to check for updates</_summary>
<_description>How often to check for updates. Value is in seconds.</_description>
</key>
<key name="frequency-get-upgrades" type="i">
<default>604800</default>
<_summary>How often to check for distribution upgrades</_summary>
<_description>How often to check for distribution upgrades. Value is in seconds.</_description>
</key>
<key name="frequency-refresh-cache" type="i">
<default>86400</default>
<_summary>How often to refresh the package cache</_summary>
<_description>How often to refresh the package cache. Value is in seconds.</_description>
</key>
<key name="session-startup-timeout" type="i">
<default>300</default>
<_summary>The number of seconds at session startup to wait before checking for updates</_summary>
<_description>The number of seconds at session startup to wait before checking for updates. Value is in seconds.</_description>
</key>
<key name="update-battery" type="b">
<default>false</default>
<_summary>Install updates automatically when running on battery power</_summary>
<_description>Install updates automatically when running on battery power.</_description>
</key>
<key name="notify-distro-upgrades" type="b">
<default>true</default>
<_summary>Notify the user when distribution upgrades are available</_summary>
<_description>Notify the user when distribution upgrades are available.</_description>
</key>
<key name="notify-update-complete" type="b">
<default>false</default>
<_summary>Notify the user for completed updates</_summary>
<_description>Notify the user for completed updates. This may be a useful notification for some users as installing updates prevents shutdown.</_description>
</key>
<key name="notify-update-complete-restart" type="b">
<default>true</default>
<_summary>Notify the user for completed updates where the user needs to restart</_summary>
<_description>Notify the user for completed updates where the user needs to restart.</_description>
</key>
<key name="notify-update-not-battery" type="b">
<default>false</default>
<_summary>Notify the user when the automatic update was not started on battery power</_summary>
<_description>Notify the user when the update was not automatically started because the machine is running on battery power.</_description>
</key>
<key name="notify-update-started" type="b">
<default>true</default>
<_summary>Notify the user when the update was started</_summary>
<_description>Notify the user when the update was started.</_description>
</key>
<key name="notify-update-type" enum="org.gnome.settings-daemon.GsdUpdateType">
<default>'security'</default>
<_summary>Notify the user when the update type is available</_summary>
<_description>Notify the user when updates are available of a certain type and not auto-installed.</_description>
</key>
</schema>
</schemalist>
......@@ -4,6 +4,8 @@ plugin_LTLIBRARIES = \
libupdates_la_SOURCES = \
gsd-updates-plugin.h \
gsd-updates-plugin.c \
gsd-updates-refresh.h \
gsd-updates-refresh.c \
gsd-updates-manager.h \
gsd-updates-manager.c
......@@ -17,6 +19,9 @@ libupdates_la_CFLAGS = \
$(GNOME_CFLAGS) \
$(PACKAGEKIT_CFLAGS) \
-DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \
-DDATADIR=\"$(datadir)\" \
-DBINDIR=\"$(bindir)\" \
-I$(top_srcdir)/data \
$(AM_CFLAGS)
libupdates_la_LDFLAGS = \
......
This diff is collapsed.
This diff is collapsed.
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2007-2011 Richard Hughes <richard@hughsie.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 __GSD_UPDATES_REFRESH_H
#define __GSD_UPDATES_REFRESH_H
#include <glib-object.h>
G_BEGIN_DECLS
#define GSD_TYPE_UPDATES_REFRESH (gsd_updates_refresh_get_type ())
#define GSD_UPDATES_REFRESH(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_UPDATES_REFRESH, GsdUpdatesRefresh))
#define GSD_UPDATES_REFRESH_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_UPDATES_REFRESH, GsdUpdatesRefreshClass))
#define GSD_IS_UPDATES_REFRESH(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_UPDATES_REFRESH))
typedef struct GsdUpdatesRefreshPrivate GsdUpdatesRefreshPrivate;
typedef struct
{
GObject parent;
GsdUpdatesRefreshPrivate *priv;
} GsdUpdatesRefresh;
typedef struct
{
GObjectClass parent_class;
} GsdUpdatesRefreshClass;
#define GSD_SETTINGS_SCHEMA "org.gnome.settings-daemon.plugins.updates"
#define GSD_SETTINGS_AUTO_UPDATE_TYPE "auto-update-type"
#define GSD_SETTINGS_CONNECTION_USE_MOBILE "connection-use-mobile"
#define GSD_SETTINGS_CONNECTION_USE_WIFI "connection-use-wifi"
#define GSD_SETTINGS_FORCE_GET_UPDATES_LOGIN "force-get-updates-login"
#define GSD_SETTINGS_FREQUENCY_GET_UPDATES "frequency-get-updates"
#define GSD_SETTINGS_FREQUENCY_GET_UPGRADES "frequency-get-upgrades"
#define GSD_SETTINGS_FREQUENCY_REFRESH_CACHE "frequency-refresh-cache"
#define GSD_SETTINGS_NOTIFY_UPDATE_TYPE "notify-update-type"
#define GSD_SETTINGS_NOTIFY_DISTRO_UPGRADES "notify-distro-upgrades"
#define GSD_SETTINGS_NOTIFY_UPDATE_COMPLETE "notify-update-complete"
#define GSD_SETTINGS_NOTIFY_UPDATE_COMPLETE_RESTART "notify-update-complete-restart"
#define GSD_SETTINGS_NOTIFY_UPDATE_NOT_BATTERY "notify-update-not-battery"
#define GSD_SETTINGS_SESSION_STARTUP_TIMEOUT "session-startup-timeout"
#define GSD_SETTINGS_UPDATE_BATTERY "update-battery"
GType gsd_updates_refresh_get_type (void);
GsdUpdatesRefresh *gsd_updates_refresh_new (void);
gboolean gsd_updates_refresh_get_on_battery (GsdUpdatesRefresh *refresh);
G_END_DECLS
#endif /* __GSD_UPDATES_REFRESH_H */
......@@ -46,3 +46,4 @@ plugins/xsettings/gsd-xsettings-manager.c
plugins/smartcard/gsd-smartcard-manager.c
plugins/smartcard/gsd-smartcard.c
plugins/datetime/org.gnome.settingsdaemon.datetimemechanism.policy.in
plugins/updates/gsd-updates-manager.c
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment