Commit 6a1193af authored by Michael Terry's avatar Michael Terry

make sure to always grab duplicity info before resolving BackendAuto

parent 4855ffee
......@@ -389,18 +389,23 @@ void convert_s3_folder_to_hostname()
}
}
public void initialize()
public bool initialize(out string header, out string msg)
{
convert_ssh_to_file();
convert_s3_folder_to_hostname();
/* We do a little trick here. BackendAuto -- which is the default
backend on a fresh install of deja-dup -- will do some work to
automatically suss out which backend should be used instead of it.
So we request the current backend then drop it just to get that
ball rolling in case this is the first time. */
var unused_backend = DejaDup.Backend.get_default();
unused_backend = null;
var rv = DuplicityInfo.get_default().check_duplicity_version(out header, out msg);
if (rv) {
/* We do a little trick here. BackendAuto -- which is the default
backend on a fresh install of deja-dup -- will do some work to
automatically suss out which backend should be used instead of it.
So we request the current backend then drop it just to get that
ball rolling in case this is the first time. */
var unused_backend = DejaDup.Backend.get_default();
unused_backend = null;
}
return rv;
}
public void i18n_setup()
......
......@@ -23,7 +23,6 @@ public Gtk.Window toplevel = null;
class DejaDupApp : Object
{
static bool valid_duplicity = false;
static bool show_version = false;
static bool restore_mode = false;
static bool backup_mode = false;
......@@ -97,16 +96,13 @@ class DejaDupApp : Object
int status;
if (!handle_console_options(out status))
return status;
DejaDup.initialize();
Gtk.init(ref args); // to open display ('cause we passed false above)
Gtk.IconTheme.get_default().append_search_path(Config.THEME_DIR);
Gtk.Window.set_default_icon_name(Config.PACKAGE);
/* First, check duplicity version info */
valid_duplicity = DejaDup.init_duplicity(null);
if (!valid_duplicity)
if (!DejaDup.gui_initialize(null))
return 1;
/* Now proceed with main program */
......
......@@ -312,7 +312,9 @@ static int main(string[] args)
if (!handle_options(out status))
return status;
DejaDup.initialize();
if (!DejaDup.initialize(null, null))
return 1;
DejaDup.Network.ensure_status();
DejaDup.Network.get().notify["connected"].connect(network_changed);
......
......@@ -72,8 +72,7 @@ g_io_module_load (GIOModule *module)
GtkIconTheme *theme = gtk_icon_theme_get_default ();
gtk_icon_theme_append_search_path (theme, THEME_DIR);
deja_dup_initialize();
if (!deja_dup_init_duplicity(NULL, FALSE))
if (!deja_dup_gui_initialize(NULL, FALSE))
return;
deja_dup_preferences_panel_register_type (G_TYPE_MODULE (module));
......
......@@ -76,12 +76,11 @@ class PreferencesApp : Object
if (!handle_console_options(out status))
return status;
DejaDup.initialize();
Gtk.init(ref args); // to open display ('cause we passed false above)
Gtk.IconTheme.get_default().append_search_path(Config.THEME_DIR);
Gtk.Window.set_default_icon_name(Config.PACKAGE);
if (!DejaDup.init_duplicity(null))
if (!DejaDup.gui_initialize(null))
return 1;
var app = new Gtk.Application("org.gnome.DejaDup.Preferences", 0);
......
......@@ -105,11 +105,11 @@ public void destroy_widget(Gtk.Widget w)
Idle.add(() => {w.destroy(); return false;});
}
public bool init_duplicity(Gtk.Window? parent, bool show_error = true)
public bool gui_initialize(Gtk.Window? parent, bool show_error = true)
{
string header;
string msg;
var rv = DejaDup.DuplicityInfo.get_default().check_duplicity_version(out header, out msg);
var rv = DejaDup.initialize(out header, out msg);
if (!rv && show_error) {
Gtk.MessageDialog dlg = new Gtk.MessageDialog (parent,
......
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