~mterry/deja-dup/no-python2

« back to all changes in this revision

Viewing changes to deja-dup/widgets/ConfigLabelDescription.vala

  • Committer: Michael Terry
  • Date: 2015-11-06 14:25:39 UTC
  • Revision ID: michael.terry@canonical.com-20151106142539-s8q7a4isdthb6le1
Use packagekit to install duplicity on the fly if needed, removing any dependency on python2 by deja-dup directly

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
{
26
26
  public enum Kind {BACKUP, RESTORE}
27
27
  public Kind kind {get; construct;}
 
28
  public bool everything_installed {get; set;}
28
29
 
29
 
  public ConfigLabelDescription(Kind kind)
 
30
  public ConfigLabelDescription(Kind kind, bool everything_installed)
30
31
  {
31
 
    Object(kind: kind);
 
32
    Object(kind: kind, everything_installed: everything_installed);
32
33
  }
33
34
 
34
35
  construct {
37
38
      watch_key(DejaDup.PERIODIC_KEY);
38
39
      watch_key(DejaDup.PERIODIC_PERIOD_KEY);
39
40
    }
 
41
    notify["everything-installed"].connect((s, p) => {
 
42
      set_from_config.begin();
 
43
    });
40
44
  }
41
45
 
42
46
  protected override void fill_box()
51
55
 
52
56
  void set_from_config_restore()
53
57
  {
 
58
    if (!everything_installed) {
 
59
      var button_name = "<b>%s</b>".printf(_("Install…"));
 
60
      label.label = _("You can restore existing backups after you first install some necessary software by clicking the %s button.").printf(button_name);
 
61
      return;
 
62
    }
 
63
 
54
64
    var val = DejaDup.last_run_date(DejaDup.TimestampType.BACKUP);
55
65
 
56
66
    // This here encodes a lot of outside GUI information in this widget,
67
77
 
68
78
  void set_from_config_backup()
69
79
  {
 
80
    if (!everything_installed) {
 
81
      var button_name = "<b>%s</b>".printf(_("Install…"));
 
82
      label.label = _("You can create a backup after you first install some necessary software by clicking the %s button.").printf(button_name);
 
83
      return;
 
84
    }
 
85
 
70
86
    var next = DejaDup.next_run_date();
71
87
    if (next == null) {
72
88
      var button_name = "<b>%s</b>".printf(_("Back Up Now…"));