Commit 90f2bb16 authored by Iain Lane's avatar Iain Lane

Update upstream source from tag 'upstream/38.4'

Update to upstream version '38.4'
with Debian dir c68f2f350ad2dde8b38ba5ce23927dd94ba3fb31
parents 9dc0c9d3 888a9f0d
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Déjà Dup Upstream-Name: Déjà Dup
Upstream-Contact: Déjà Dup Maintainers <deja-dup-team@lists.launchpad.net> Upstream-Contact: Déjà Dup Maintainers <deja-dup-team@lists.launchpad.net>
Source: https://launchpad.net/deja-dup/+download Source: https://wiki.gnome.org/Apps/DejaDup/Download
Files: * Files: *
Copyright: 2008–2011,2016-2017 Michael Terry <mike@mterry.name> Copyright: 2008–2011,2016-2019 Michael Terry <mike@mterry.name>
2009–2010 Andrew Fister <temposs@gmail.com> 2009–2010 Andrew Fister <temposs@gmail.com>
2010 Urban Skudnik <urban.skudnik@gmail.com> 2010 Urban Skudnik <urban.skudnik@gmail.com>
2011–2015 Canonical Ltd 2011–2015 Canonical Ltd
...@@ -18,7 +18,7 @@ Comment: For specific author information, see the git logs ...@@ -18,7 +18,7 @@ Comment: For specific author information, see the git logs
License: GPL-3+ License: GPL-3+
Files: po/*.po Files: po/*.po
Copyright: 2008–2013 Rosetta Contributors and Canonical Ltd Copyright: 2008–2019 Rosetta Contributors and Canonical Ltd
License: GPL-3+ License: GPL-3+
Files: libdeja/uriutils.c libdeja/uriutils.h Files: libdeja/uriutils.c libdeja/uriutils.h
...@@ -39,20 +39,20 @@ Files: vapi/config.vapi ...@@ -39,20 +39,20 @@ Files: vapi/config.vapi
Copyright: 2007–2008 Jaap Haitsma <jaap@haitsma.org> Copyright: 2007–2008 Jaap Haitsma <jaap@haitsma.org>
License: GPL-3+ License: GPL-3+
Files: deja-dup/help/C/*.page Files: help/C/*.page
Copyright: 2010–2011 Michael Terry <mike@mterry.name> Copyright: 2010–2011,2016-2019 Michael Terry <mike@mterry.name>
2011-2013 Canonical Ltd 2011-2015 Canonical Ltd
License: CC-BY-SA-3.0 License: CC-BY-SA-3.0
Files: deja-dup/help/*/*.po Files: help/*.po
Copyright: 2008–2013 Rosetta Contributors and Canonical Ltd Copyright: 2008–2019 Rosetta Contributors and Canonical Ltd
License: CC-BY-SA-3.0 License: CC-BY-SA-3.0
Files: data/icons/hicolor/scalable/apps/org.gnome.DejaDup.svg Files: data/icons/org.gnome.DejaDup.svg
Copyright: 2011 Lapo Calamandrei <calamandrei@gmail.com> Copyright: 2019 Jakub Steiner <jimmac@gmail.com>
License: LGPL-3+ or CC-BY-SA-3.0 License: CC-BY-SA-4.0
Files: data/icons/hicolor/symbolic/apps/org.gnome.DejaDup-symbolic.svg Files: data/icons/org.gnome.DejaDup-symbolic.svg
Copyright: 2012 Barbara Muraus <barbara.muraus@gmail.com> Copyright: 2012 Barbara Muraus <barbara.muraus@gmail.com>
License: CC-BY-SA-3.0 License: CC-BY-SA-3.0
...@@ -128,3 +128,18 @@ License: CC-BY-SA-3.0 ...@@ -128,3 +128,18 @@ License: CC-BY-SA-3.0
license. license.
. .
For more information, see http://creativecommons.org/licenses/by-sa/3.0/ For more information, see http://creativecommons.org/licenses/by-sa/3.0/
License: CC-BY-SA-4.0
You are free:
to Share (to copy, distribute and transmit the work) and
to Remix (to adapt the work) under the following conditions:
.
Attribution — You must attribute the work in the manner specified by the
author or licensor (but not in any way that suggests that they endorse you
or your use of the work).
.
Share Alike — If you alter, transform, or build upon this work, you may
distribute the resulting work only under the same, similar or a compatible
license.
.
For more information, see http://creativecommons.org/licenses/by-sa/4.0/
= New to deja-dup? = = New to deja-dup? =
When making a non-trivial change, remember to add yourself to AUTHORS and deja-dup/help/C/credits.page When making a non-trivial change, remember to add yourself to AUTHORS and help/C/credits.page
deja-dup uses meson, but for most development purposes, you can simply use the convenience top-level Makefile: deja-dup uses meson, but for most development purposes, you can simply use the convenience top-level Makefile:
* To build: make * To build: make
......
# -*- Mode: Makefile; indent-tabs-mode: t; tab-width: 2 -*-
#
# This file is part of Déjà Dup.
# For copyright information, see AUTHORS.
#
# Déjà Dup 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 3 of the License, or
# (at your option) any later version.
#
# Déjà Dup 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 Déjà Dup. If not, see <http://www.gnu.org/licenses/>.
all: configure
ninja -C builddir
%:
@[ "$@" = "Makefile" ] || ninja -C builddir $@
configure:
@[ -f builddir/build.ninja ] || meson -Dprofile=Devel builddir
distconfigure:
@[ -f builddir/build.ninja ] || meson builddir
check: all
LC_ALL=C.UTF-8 meson test -C builddir
dist: clean distconfigure screenshots pot
rm -f builddir/meson-dist/*
ninja -C builddir dist
gpg --armor --sign --detach-sig builddir/meson-dist/deja-dup-*.tar.xz
clean distclean:
rm -rf builddir
deb:
DEB_BUILD_OPTIONS=nocheck debuild
screenshots: all
@gsettings set org.gnome.desktop.interface font-name 'Cantarell 11'
@gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita'
@gsettings set org.gnome.desktop.interface icon-theme 'Adwaita'
@gsettings set org.gnome.desktop.wm.preferences theme 'Adwaita'
@gsettings set org.gnome.DejaDup backend 'file'
@sleep 5
@mkdir -p ./builddir/screenshots
@rm -f ./builddir/screenshots/*
@./tests/shell-local "deja-dup" &
@gnome-screenshot --window --delay 1 --file data/appdata/01-main.png
@killall deja-dup
@./tests/shell-local "deja-dup --backup" >/dev/null &
@gnome-screenshot --window --delay 1 --file data/appdata/02-backup.png
@killall deja-dup
@gsettings reset org.gnome.desktop.interface font-name
@gsettings reset org.gnome.desktop.interface gtk-theme
@gsettings reset org.gnome.desktop.interface icon-theme
@gsettings reset org.gnome.desktop.wm.preferences theme
@gsettings reset org.gnome.DejaDup backend
@eog data/appdata
pot: configure
ninja -C builddir deja-dup-pot help-org.gnome.DejaDup-pot
# call like 'make copy-po TD=path-to-translation-dir'
copy-po:
test -d $(TD)
cp -a $(TD)/po/*.po po
for po in $(TD)/deja-dup/help/*.po; do \
mkdir -p deja-dup/help/$$(basename $$po .po); \
cp -a $$po deja-dup/help/$$(basename $$po .po)/; \
done
git add po/*.po
git add deja-dup/help/*/*.po
flatpak:
flatpak-builder --repo=$(HOME)/repo \
--force-clean \
--state-dir=builddir/.flatpak-builder \
builddir/flatpak \
flatpak/org.gnome.DejaDupDevel.yaml
flatpak update --user -y org.gnome.DejaDupDevel
.PHONY: configure distconfigure clean dist all copy-po check screenshots flatpak
This diff is collapsed.
This diff is collapsed.
Déjà Dup Backup Tool # Déjà Dup Backup Tool
====================
Déjà Dup is a simple backup tool. It hides the complexity of backing up the Déjà Dup is a simple backup tool. It hides the complexity of backing up the
Right Way (encrypted, off-site, and regular) and uses Right Way (encrypted, off-site, and regular) and uses
...@@ -12,10 +11,10 @@ Features: ...@@ -12,10 +11,10 @@ Features:
* Schedules regular backups * Schedules regular backups
* Integrates well into your GNOME desktop * Integrates well into your GNOME desktop
Links ## Links
-----
* [Homepage](https://wiki.gnome.org/Apps/DejaDup) * [Wiki](https://wiki.gnome.org/Apps/DejaDup)
* [Getting involved](https://wiki.gnome.org/Apps/DejaDup/GettingInvolved) * [Download](https://wiki.gnome.org/Apps/DejaDup/Download)
* [Get involved](https://wiki.gnome.org/Apps/DejaDup/GettingInvolved)
* [Mailing list](https://mail.gnome.org/mailman/listinfo/deja-dup-list) * [Mailing list](https://mail.gnome.org/mailman/listinfo/deja-dup-list)
data/appdata/01-main.png

36.9 KB | W: | H:

data/appdata/01-main.png

36.8 KB | W: | H:

data/appdata/01-main.png
data/appdata/01-main.png
data/appdata/01-main.png
data/appdata/01-main.png
  • 2-up
  • Swipe
  • Onion skin
data/appdata/02-backup.png

12.6 KB | W: | H:

data/appdata/02-backup.png

12.6 KB | W: | H:

data/appdata/02-backup.png
data/appdata/02-backup.png
data/appdata/02-backup.png
data/appdata/02-backup.png
  • 2-up
  • Swipe
  • Onion skin
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -59,6 +59,7 @@ test('validate-monitor-desktop', desktop_file_validate, ...@@ -59,6 +59,7 @@ test('validate-monitor-desktop', desktop_file_validate,
conf_data = configuration_data() conf_data = configuration_data()
conf_data.set('icon', application_id) conf_data.set('icon', application_id)
conf_data.set('name_suffix', name_suffix)
vars = configure_file(input: 'org.gnome.DejaDup.desktop.in', vars = configure_file(input: 'org.gnome.DejaDup.desktop.in',
output: 'org.gnome.DejaDup.vars.desktop.in', output: 'org.gnome.DejaDup.vars.desktop.in',
configuration: conf_data) configuration: conf_data)
...@@ -75,7 +76,6 @@ test('validate-desktop', desktop_file_validate, ...@@ -75,7 +76,6 @@ test('validate-desktop', desktop_file_validate,
conf_data = configuration_data() conf_data = configuration_data()
conf_data.set('appid', application_id) conf_data.set('appid', application_id)
conf_data.set('series', series)
conf_data.set('version', meson.project_version()) conf_data.set('version', meson.project_version())
vars = configure_file(input: 'org.gnome.DejaDup.appdata.xml.in', vars = configure_file(input: 'org.gnome.DejaDup.appdata.xml.in',
output: 'org.gnome.DejaDup.vars.appdata.xml.in', output: 'org.gnome.DejaDup.vars.appdata.xml.in',
......
[Desktop Entry] [Desktop Entry]
Version=1.0 Version=1.1
Name=Backup Monitor Name=Backup Monitor
Comment=Schedules backups at regular intervals Comment=Schedules backups at regular intervals
...@@ -9,7 +9,6 @@ Icon=@icon@ ...@@ -9,7 +9,6 @@ Icon=@icon@
Exec=@pkglibexecdir@/deja-dup-monitor Exec=@pkglibexecdir@/deja-dup-monitor
X-GNOME-Autostart-Delay=120 X-GNOME-Autostart-Delay=120
X-GNOME-AutoRestart=true
StartupNotify=false StartupNotify=false
NoDisplay=true NoDisplay=true
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- For copyright information, see AUTHORS. --> <!-- For copyright information, see AUTHORS. -->
<component type="desktop-application"> <component type="desktop-application">
<id>@appid@.desktop</id> <id>@appid@</id>
<metadata_license>CC-BY-SA-4.0</metadata_license> <metadata_license>CC-BY-SA-4.0</metadata_license>
<project_license>GPL-3.0+</project_license> <project_license>GPL-3.0+</project_license>
<name>Déjà Dup Backup Tool</name> <name>Déjà Dup Backup Tool</name>
...@@ -16,21 +16,14 @@ ...@@ -16,21 +16,14 @@
<li>Integrates well into your GNOME desktop</li> <li>Integrates well into your GNOME desktop</li>
</ul> </ul>
</description> </description>
<provides>
<binary>deja-dup</binary>
</provides>
<categories>
<category>Utility</category>
<category>Archiving</category>
</categories>
<kudos> <kudos>
<kudo>AppMenu</kudo>
<kudo>HiDpiIcon</kudo> <kudo>HiDpiIcon</kudo>
<kudo>HighContrast</kudo> <kudo>HighContrast</kudo>
<kudo>ModernToolkit</kudo> <kudo>ModernToolkit</kudo>
<kudo>Notifications</kudo> <kudo>Notifications</kudo>
<kudo>UserDocs</kudo> <kudo>UserDocs</kudo>
</kudos> </kudos>
<launchable type="desktop-id">@appid@.desktop</launchable>
<translation type="gettext">deja-dup</translation> <translation type="gettext">deja-dup</translation>
<url type="homepage">https://wiki.gnome.org/Apps/DejaDup</url> <url type="homepage">https://wiki.gnome.org/Apps/DejaDup</url>
<url type="help">https://wiki.gnome.org/Apps/DejaDup/Help</url> <url type="help">https://wiki.gnome.org/Apps/DejaDup/Help</url>
......
[Desktop Entry] [Desktop Entry]
Version=1.1 Version=1.1
Name=Backups Name=Backups@name_suffix@
Comment=Change your backup settings Comment=Change your backup settings
Icon=@icon@ Icon=@icon@
......
...@@ -29,11 +29,7 @@ public class AssistantRestore : AssistantOperation ...@@ -29,11 +29,7 @@ public class AssistantRestore : AssistantOperation
return this._restore_files; return this._restore_files;
} }
set { set {
foreach (File f in this._restore_files) this._restore_files = value.copy_deep ((CopyFunc) Object.ref);
f.unref();
this._restore_files = value.copy();
foreach (File f in this._restore_files)
f.ref();
} }
} }
......
...@@ -207,7 +207,7 @@ public class AssistantRestoreMissing : AssistantRestore { ...@@ -207,7 +207,7 @@ public class AssistantRestoreMissing : AssistantRestore {
{ {
if (page == confirm_page) { if (page == confirm_page) {
scan_queue = false; scan_queue = false;
restore_files_remaining = restore_files.copy(); restore_files_remaining = restore_files.copy_deep ((CopyFunc) Object.ref);
} }
else if (page == listfiles_page) { else if (page == listfiles_page) {
list_dir_label.label = display_directory.get_parse_name(); list_dir_label.label = display_directory.get_parse_name();
......
...@@ -24,9 +24,10 @@ namespace DejaDup { ...@@ -24,9 +24,10 @@ namespace DejaDup {
// Convenience class for adding automatic backup switch to pref shells // Convenience class for adding automatic backup switch to pref shells
public class PreferencesPeriodicSwitch : Gtk.Switch public class PreferencesPeriodicSwitch : Gtk.Switch
{ {
DejaDup.FilteredSettings settings;
construct construct
{ {
var settings = DejaDup.get_settings(); settings = DejaDup.get_settings();
settings.bind(DejaDup.PERIODIC_KEY, this, "active", SettingsBindFlags.DEFAULT); settings.bind(DejaDup.PERIODIC_KEY, this, "active", SettingsBindFlags.DEFAULT);
} }
} }
......
...@@ -163,7 +163,7 @@ public class DejaDupApp : Gtk.Application ...@@ -163,7 +163,7 @@ public class DejaDupApp : Gtk.Application
main_window.destroy.connect(() => {this.main_window = null;}); main_window.destroy.connect(() => {this.main_window = null;});
// Translators: "Backups" is a noun // Translators: "Backups" is a noun
main_window.title = _("Backups"); main_window.title = _("Backups") + Config.NAME_SUFFIX;
main_window.resizable = false; main_window.resizable = false;
var header = new Gtk.HeaderBar(); var header = new Gtk.HeaderBar();
...@@ -278,7 +278,7 @@ public class DejaDupApp : Gtk.Application ...@@ -278,7 +278,7 @@ public class DejaDupApp : Gtk.Application
{ {
unowned List<Gtk.Window> list = get_windows(); unowned List<Gtk.Window> list = get_windows();
DejaDup.show_uri(list == null ? null : list.data, DejaDup.show_uri(list == null ? null : list.data,
"help:" + Config.APPLICATION_ID); "help:" + Config.PACKAGE);
} }
void about() void about()
...@@ -358,9 +358,7 @@ int main(string[] args) ...@@ -358,9 +358,7 @@ int main(string[] args)
// context is itself a reference to both the underlying command line tool // context is itself a reference to both the underlying command line tool
// "duplicity" and the act of duplicating data for backup. As a whole, the // "duplicity" and the act of duplicating data for backup. As a whole, the
// phrase "Déjà Dup" may not be very translatable. // phrase "Déjà Dup" may not be very translatable.
var appname = _("Déjà Dup Backup Tool"); var appname = _("Déjà Dup Backup Tool") + Config.NAME_SUFFIX;
if (Config.PROFILE != "")
appname = "%s (%s)".printf(appname, Config.PROFILE);
Environment.set_application_name(appname); Environment.set_application_name(appname);
Environment.set_prgname(Config.APPLICATION_ID); Environment.set_prgname(Config.APPLICATION_ID);
......
...@@ -32,13 +32,12 @@ deja_dup = executable('deja-dup', ...@@ -32,13 +32,12 @@ deja_dup = executable('deja-dup',
resources, resources,
vala_args: common_vflags, vala_args: common_vflags,
c_args: common_cflags, c_args: common_cflags,
dependencies: [gio_unix_dep, goa_dep, gtk_dep, packagekit_dep, peas_dep, secret_dep], dependencies: [gio_unix_dep, goa_dep, gtk_dep, packagekit_dep, secret_dep],
link_with: [libdeja, libwidgets], link_with: [libdeja, libwidgets],
include_directories: [libdeja_inc, libwidgets_inc], include_directories: [libdeja_inc, libwidgets_inc],
install: true, install: true,
install_rpath: pkglibdir) install_rpath: pkglibdir)
subdir('help')
subdir('monitor') subdir('monitor')
subdir('nautilus') subdir('nautilus')
subdir('tests') subdir('tests')
## Multiple monitor daemons
Profiles are a way to get parallel-installed deja-dups. They're used for testing and for containerized deployments
like flatpak and snap.
But parallel-installed deja-dups means multiple monitor daemons. Which, since they all share the same gsettings, would
mean kicking off multiple backups at the same time.
To avoid this, we claim the normal org.gnome.DejaDup.Monitor bus name regardless of what the profile is. We still kick
off the specific profile bus name for the actual backup.
The first monitor to start wins the race. It's possible to put our thumb on the scale by adjusing the installed
autostart desktop file's X-GNOME-Autostart-Delay value.
## Why do we need a monitor program?
This program is a bit of a hack. I'm not terribly happy with it, but it's a comprimise of sorts. I want a periodic scheduler that 'just works' in terms of user perceptions. So, we ideally would: This program is a bit of a hack. I'm not terribly happy with it, but it's a comprimise of sorts. I want a periodic scheduler that 'just works' in terms of user perceptions. So, we ideally would:
a) Backup at regular intervals 1. Backup at regular intervals
a.1) preferrably early in the morning (probably configurable by user) 1. preferrably early in the morning (probably configurable by user)
a.2) or roughly ASAP if computer isn't on when scheduled 2. or roughly ASAP if computer isn't on when scheduled
b) If user isn't logged in, still backup 2. If user isn't logged in, still backup
c) If user is logged in (or becomes logged in while backup is still going), 3. If user is logged in (or becomes logged in while backup is still going),
show notification icon allowing reschedule/cancel show notification icon allowing reschedule/cancel
Given these desired traits, what can we do? Given these desired traits, what can we do?
(c) suggests that we need a constantly-running program in the user's session that waits for the scheduled backup and displays an icon. This is unavoidable. It should have as small a footprint as possible. (3) suggests that we need a constantly-running program in the user's session that waits for the scheduled backup and displays an icon. This is unavoidable. It should have as small a footprint as possible.
(b) suggests we need to run a scheduler as root, most naturally as part of a cron job. Since we can't drop a file in that says 'add this job to each user's crontab' (like we can do with /etc/xdg/autostart for autostart tasks), we'd need to drop in a /etc/cron.d file that runs at the minimum period we allow the user to set (probably a day), checks *all* users' settings to see if they are due for a backup, and kicks off a backup for/as them if needed. But we're not guaranteed to satisfy (a.2) unless user is running anacron. (2) suggests we need to run a scheduler as root, most naturally as part of a cron job. Since we can't drop a file in that says 'add this job to each user's crontab' (like we can do with /etc/xdg/autostart for autostart tasks), we'd need to drop in a /etc/cron.d file that runs at the minimum period we allow the user to set (probably a day), checks *all* users' settings to see if they are due for a backup, and kicks off a backup for/as them if needed. But we're not guaranteed to satisfy (1.2) unless user is running anacron.
We could avoid the hackery of 'one root task that checks all users' by, when keys that control periodic settings are changed (watched by (c) daemon), doing "crontab -l | cronttab -" goofiness. That would correctly install into the user's crontab and allow nice system cron permission control and such. I'm not sure if that's a bonus or not (the silent refusal to run might confuse user, but surely that's a corner case). We could avoid the hackery of 'one root task that checks all users' by, when keys that control periodic settings are changed (watched by (3) daemon), doing "crontab -l | cronttab -" goofiness. That would correctly install into the user's crontab and allow nice system cron permission control and such. I'm not sure if that's a bonus or not (the silent refusal to run might confuse user, but surely that's a corner case).
The above points about (b) assumes that the user has a properly set up cron. These days that's probably true, but none-the-less, it would be nice if we could avoid that. The above points about (2) assumes that the user has a properly set up cron. These days that's probably true, but none-the-less, it would be nice if we could avoid that.
If we went with a cron-based solution, we couldn't truly be sure the user's jobs were being run, and we couldn't be sure if they would be run 'asap' if the computer isn't running at job time. This can be fixed by depending on anacron. If we went with a cron-based solution, we couldn't truly be sure the user's jobs were being run, and we couldn't be sure if they would be run 'asap' if the computer isn't running at job time. This can be fixed by depending on anacron.
Another issue with (b) is that it requires us to have saved the user's passwords -- and more importantly -- be able to get them from gnome-keyring without a gnome session. This is probably a deal breaker. Without keyring support, we'd have to hardcode passwords... Another issue with (2) is that it requires us to have saved the user's passwords -- and more importantly -- be able to get them from gnome-keyring without a gnome session. This is probably a deal breaker. Without keyring support, we'd have to hardcode passwords...
Alternatively, we could have the already-required user-space (c) watcher program kick of backups by watching the clock itself. Our scheduling is simple enough, it would suffice. This sacrifices (b) altogether. Which sucks. But we could kick off the build the next time the user does log in. Such a choice would put us squarely in the 'single-user laptop/desktop' use-case, foregoing the 'making backup for administrators easier' camp. I'm mostly OK with this. Alternatively, we could have the already-required user-space (3) watcher program kick of backups by watching the clock itself. Our scheduling is simple enough, it would suffice. This sacrifices (2) altogether. Which sucks. But we could kick off the build the next time the user does log in. Such a choice would put us squarely in the 'single-user laptop/desktop' use-case, foregoing the 'making backup for administrators easier' camp. I'm mostly OK with this.
For now, we're going to do what the paragraph above suggests: don't use cron, do it ourselves. This issue should be revisited in the future. For now, we're going to do what the paragraph above suggests: don't use cron, do it ourselves. This issue should be revisited in the future.
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
executable('deja-dup-monitor', ['monitor.vala'], executable('deja-dup-monitor', ['monitor.vala'],
vala_args: common_vflags, vala_args: common_vflags,
c_args: common_cflags, c_args: common_cflags,
dependencies: [gio_dep, goa_dep, peas_dep, secret_dep], dependencies: [gio_dep, goa_dep, secret_dep],
link_with: [libdeja], link_with: [libdeja],
include_directories: [libdeja_inc], include_directories: [libdeja_inc],
install: true, install: true,
......
...@@ -21,6 +21,7 @@ using GLib; ...@@ -21,6 +21,7 @@ using GLib;
class Monitor : Object { class Monitor : Object {
static MainLoop loop;
static uint timeout_id; static uint timeout_id;
static uint netcheck_id; static uint netcheck_id;
static bool reactive_check; static bool reactive_check;
...@@ -105,30 +106,6 @@ static TimeSpan time_until(DateTime date) ...@@ -105,30 +106,6 @@ static TimeSpan time_until(DateTime date)
return date.difference(new DateTime.now_local()); return date.difference(new DateTime.now_local());
} }
static async void call_remote(string action, string[] args = {})
{
var vargs = new VariantBuilder(new VariantType("av"));
foreach (string arg in args) {
vargs.add("v", new Variant.string(arg));
}
var platform_args = new VariantBuilder(new VariantType("a{sv}"));
try {
var deja = yield new DBusProxy.for_bus(BusType.SESSION,
DBusProxyFlags.NONE,
null,
Config.APPLICATION_ID,
"/org/gnome/DejaDup" + Config.PROFILE,
"org.freedesktop.Application",
null);
yield deja.call("ActivateAction",
new Variant("(sava{sv})", action, vargs, platform_args),
DBusCallFlags.NONE, -1, null);
}
catch (Error e) {
warning("%s", e.message);
}
}
static async void kickoff() static async void kickoff()
{ {
TimeSpan wait_time; TimeSpan wait_time;
...@@ -156,7 +133,7 @@ static async void kickoff() ...@@ -156,7 +133,7 @@ static async void kickoff()
if (!ready) { if (!ready) {
debug("Postponing the backup."); debug("Postponing the backup.");
if (!was_reactive && when != null) if (!was_reactive && when != null)
yield call_remote("delay", {when}); DejaDup.run_deja_dup({"--delay", when});
return; return;
} }
...@@ -167,7 +144,7 @@ static async void kickoff() ...@@ -167,7 +144,7 @@ static async void kickoff()
DejaDup.update_last_run_timestamp(DejaDup.TimestampType.BACKUP); DejaDup.update_last_run_timestamp(DejaDup.TimestampType.BACKUP);
} }
else { else {
yield call_remote("backup-auto"); DejaDup.run_deja_dup({"--backup", "--auto"});
} }
} }
...@@ -177,7 +154,7 @@ static bool time_until_next_run(out TimeSpan time) ...@@ -177,7 +154,7 @@ static bool time_until_next_run(out TimeSpan time)
var next_date = DejaDup.next_run_date(); var next_date = DejaDup.next_run_date();
if (next_date == null) { if (next_date == null) {
debug("Automatic backups disabled. Not scheduling a backup."); debug("Automatic backups disabled. Stopping monitor.");
return false; return false;
} }
...@@ -222,8 +199,11 @@ static void prepare_next_run() ...@@ -222,8 +199,11 @@ static void prepare_next_run()
return; return;
TimeSpan wait_time; TimeSpan wait_time;
if (!time_until_next_run(out wait_time)) if (!time_until_next_run(out wait_time)) {
// automatic backups are disabled - just quit for now
loop.quit();
return; return;
}
prepare_run(wait_time); prepare_run(wait_time);
} }
...@@ -241,11 +221,6 @@ static void make_first_check() ...@@ -241,11 +221,6 @@ static void make_first_check()
first_check = true; first_check = true;
DejaDup.make_prompt_check(); DejaDup.make_prompt_check();
Timeout.add_seconds(DejaDup.get_prompt_delay(), () => {
DejaDup.make_prompt_check();
return true;
});
prepare_next_run(); prepare_next_run();
} }
...@@ -298,10 +273,10 @@ static int main(string[] args) ...@@ -298,10 +273,10 @@ static int main(string[] args)
if (!DejaDup.initialize(null, null)) if (!DejaDup.initialize(null, null))