~ubuntu-core-dev/update-notifier/ubuntu

38 by mvo
* now I got them all!
1
/* update-notifier.h
35 by mvo
* big rename: upgrade-notifier -> update-notifier
2
 * Copyright (C) 2004 Michiel Sikkes <michiel@eyesopened.nl>
3
 *
4
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Lesser General Public
6
 * License as published by the Free Software Foundation; either
7
 * version 2 of the License, or (at your option) any later version.
8
 *
9
 * This library is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 * Lesser General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Lesser General Public
15
 * License along with this library; if not, write to the
537 by Loïc Minier
Also update FSF address in src/hook-remove.c src/update-notifier.h
16
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor
17
 * Boston, MA  02110-1301 USA.
35 by mvo
* big rename: upgrade-notifier -> update-notifier
18
 */
19
20
#ifndef __UPGRADE_NOTIFIER_H__
21
#define __UPGRADE_NOTIFIER_H__
22
473.1.1 by Michael Vogt
dropped libgnome
23
#include <gtk/gtk.h>
24
#include <glib/gi18n.h>
35 by mvo
* big rename: upgrade-notifier -> update-notifier
25
639.1.4 by Michael Vogt
add trayappletui abstraction, port everything over to it
26
#include "config.h"
27
639.1.1 by Michael Vogt
start app-indicator port
28
#ifdef HAVE_APP_INDICATOR
29
#include <libappindicator/app-indicator.h>
30
#endif
31
35 by mvo
* big rename: upgrade-notifier -> update-notifier
32
#define CLIPBOARD_NAME 	"UPGRADE_NOTIFIER_SELECTION"
630.1.4 by Michael Terry
convert to gsettings
33
632 by Michael Vogt
add changelog entry, switch from com.canonical.update-notifier to com.ubuntu.update-notifier
34
#define SETTINGS_SCHEMA "com.ubuntu.update-notifier"
630.1.4 by Michael Terry
convert to gsettings
35
#define SETTINGS_KEY_NO_UPDATE_NOTIFICATIONS "no-show-notifications"
36
#define SETTINGS_KEY_APPORT_NOTIFICATIONS "show-apport-crashes"
37
#define SETTINGS_KEY_END_SYSTEM_UIDS "end-system-uids"
38
#define SETTINGS_KEY_AUTO_LAUNCH_INTERVAL "regular-auto-launch-interval"
928 by Brian Murray
restore update-notifier code to check for whether or not a release upgrade
39
#define SETTINGS_KEY_LAST_RELEASE_CHECK "release-check-time"
953.1.1 by Andrea Azzarone
Add a livepatch indicator in the system tray.
40
#define SETTINGS_KEY_SHOW_LIVEPATCH_ICON "show-livepatch-status-icon"
630.1.4 by Michael Terry
convert to gsettings
41
42
#define SETTINGS_UM_SCHEMA "com.ubuntu.update-manager"
43
#define SETTINGS_UM_KEY_LAST_LAUNCH "launch-time"
45 by mvo
* added basic "interactive-update-hooks" support
44
45
#define HOOKS_DIR "/var/lib/update-notifier/user.d/"
258 by Michael Vogt
* src/update-notifier.h:
46
#define CRASHREPORT_HELPER "/usr/share/apport/apport-checkreports"
47
#define CRASHREPORT_REPORT_APP "/usr/share/apport/apport-gtk"
248 by Michael Vogt
* src/crash.{c,h}:
48
#define CRASHREPORT_DIR "/var/crash/"
937 by Didier Roche
Only show apport UI if whoopsie is not in auto or never reporting mode.
49
#define CRASHREPORT_AUTOREPORT "/var/lib/apport/autoreport"
50
#define CRASHREPORT_WHOOPSIE_EXEC "/usr/bin/whoopsie"
51
#define CRASHREPORT_WHOOPSIE_SERVICE "whoopsie"
882 by Sebastien Bacher
releasing package update-notifier version 3.171
52
#define UNICAST_LOCAL_AVAHI_FILE "/run/avahi-daemon/disabled-for-unicast-local"
926 by Andrea Azzarone
Manually monitor the livepatch status file using GFileMonitor.
53
#define LIVEPATCH_FILE "/var/snap/canonical-livepatch/current/status"
45 by mvo
* added basic "interactive-update-hooks" support
54
460 by Michael Vogt
add AUTOLAUNCH_MINIMAL_SECURITY_INTERVAL (LP: #369198)
55
// security update autolaunch minimal time (12h)
56
#define AUTOLAUNCH_MINIMAL_SECURITY_INTERVAL 12*60*60
57
751 by Brian Murray
Switch from using gksu for apport crashes to pkexec (LP: #1098235)
58
// this is the age that we tolerate for updates (7 days)
352 by Michael Vogt
* show a warning icon if the last refresh of the
59
#define OUTDATED_NAG_AGE 60*60*24*7
564 by Michael Vogt
reboot in /var/run/reboot-required.pkgs (LP: #538253)
60
352 by Michael Vogt
* show a warning icon if the last refresh of the
61
// this is the time we wait when we found outdated information for 
62
// anacron(and friends) to update the system (2h)
63
#define OUTDATED_NAG_WAIT 60*60*2
64
928 by Brian Murray
restore update-notifier code to check for whether or not a release upgrade
65
// this is the script and the time to run the release-upgrades checker
66
#define RELEASE_UPGRADE_CHECKER "/usr/lib/ubuntu-release-upgrader/check-new-release-gtk"
67
#define RELEASE_UPGRADE_CHECK_WAIT 60*60*24*14
68
585 by Michael Vogt
add /usr/share/update-notifier/plugins/cache-changed dir
69
// cache-changed plugin dir
70
#define CACHE_CHANGED_PLUGIN_DIR "/usr/share/update-notifier/plugins/cache-changed"
71
356 by Michael Vogt
* src/update.c:
72
#if 0
352 by Michael Vogt
* show a warning icon if the last refresh of the
73
// testing
74
#define OUTDATED_NAG_AGE 60*60
75
#define OUTDATED_NAG_WAIT 6
356 by Michael Vogt
* src/update.c:
76
#endif
352 by Michael Vogt
* show a warning icon if the last refresh of the
77
751 by Brian Murray
Switch from using gksu for apport crashes to pkexec (LP: #1098235)
78
void invoke_with_pkexec(const gchar *cmd);
79
void invoke(const gchar *cmd, const gchar *desktop, gboolean with_pkexec);
754 by Colin Watson
Correct a number of imprecise prototypes.
80
gboolean in_admin_group(void);
45 by mvo
* added basic "interactive-update-hooks" support
81
82
typedef struct _TrayApplet TrayApplet;
750.1.1 by Colin Watson
Only create a single GSettings instance for com.ubuntu.update-notifier,
83
typedef struct _UpgradeNotifier UpgradeNotifier;
84
45 by mvo
* added basic "interactive-update-hooks" support
85
struct _TrayApplet 
35 by mvo
* big rename: upgrade-notifier -> update-notifier
86
{
639.1.4 by Michael Vogt
add trayappletui abstraction, port everything over to it
87
   GObject me;
750.1.1 by Colin Watson
Only create a single GSettings instance for com.ubuntu.update-notifier,
88
   UpgradeNotifier *un;
639.1.4 by Michael Vogt
add trayappletui abstraction, port everything over to it
89
#ifdef HAVE_APP_INDICATOR
90
   AppIndicator *indicator;
91
#else
329 by Michael Vogt
* use GtkStatusIcon instead of EggTrayIcon, that makes
92
   GtkStatusIcon *tray_icon;
639.1.1 by Michael Vogt
start app-indicator port
93
#endif
35 by mvo
* big rename: upgrade-notifier -> update-notifier
94
   GtkWidget *menu;
329 by Michael Vogt
* use GtkStatusIcon instead of EggTrayIcon, that makes
95
   char *name;
45 by mvo
* added basic "interactive-update-hooks" support
96
   void *user_data;
97
};
98
99
struct _UpgradeNotifier
100
{
750.1.1 by Colin Watson
Only create a single GSettings instance for com.ubuntu.update-notifier,
101
   GSettings *settings;
102
45 by mvo
* added basic "interactive-update-hooks" support
103
   TrayApplet *update;
104
   TrayApplet *hook;
248 by Michael Vogt
* src/crash.{c,h}:
105
   TrayApplet *crashreport;
953.1.1 by Andrea Azzarone
Add a livepatch indicator in the system tray.
106
   TrayApplet *livepatch;
45 by mvo
* added basic "interactive-update-hooks" support
107
781.2.8 by Brian Murray
* Modified new release check to run as an upstart user session
108
   guint update_finished_timer;
176 by mvo
* ported to gnome-vfs for the monitoring (getting rid of libgamin)
109
236 by Michael Vogt
* src/update-notifier.h:
110
   // some states for the file montioring (these field
111
   // are the state for the current "time-slice")
186 by mvo
* rework the way that gnome-vfs is used and (hopefully) make the code more robust this way
112
   gboolean dpkg_was_run;
749 by Colin Watson
Fix many typos for "running".
113
   gboolean apt_get_running;
186 by mvo
* rework the way that gnome-vfs is used and (hopefully) make the code more robust this way
114
236 by Michael Vogt
* src/update-notifier.h:
115
   // these field are "global" (time-wise)
186 by mvo
* rework the way that gnome-vfs is used and (hopefully) make the code more robust this way
116
   gboolean hook_pending;
248 by Michael Vogt
* src/crash.{c,h}:
117
   gboolean crashreport_pending;
273.1.1 by martin at piware
* Add check for /var/run/avahi-daemon/disabled-for-unicast-local, which
118
   gboolean unicast_local_avahi_pending;
926 by Andrea Azzarone
Manually monitor the livepatch status file using GFileMonitor.
119
   gboolean livepatch_pending;
186 by mvo
* rework the way that gnome-vfs is used and (hopefully) make the code more robust this way
120
   time_t last_apt_action;
121
35 by mvo
* big rename: upgrade-notifier -> update-notifier
122
};
123
124
#endif /* __UPGRADE_NOTIFIER_H__ */