Commit b0c7a17c authored by Michael Terry's avatar Michael Terry

BackendRemote: Make "SMB host is not available" message nicer

GVFS gives us back "Invalid argument" which isn't very user friendly.
So we try to detect that situation and promote it to a nicer message.

Also fix testing whether the host is reachable when already mounted,
instead just checking if we are connected to the network at all.
SSH configs and such may fool us into thinking a host nickname isn't
reachable.  If it's mounted and we are connected, that should be
enough.
parent 3390fd1b
......@@ -98,6 +98,22 @@ public class BackendRemote : BackendFile
return false;
}
// Check if we should give nicer message
string get_unready_message(File root, Error e)
{
// SMB likes to give back a very generic error when the host is not
// available ("Invalid argument"). Try to work around that here.
// TODO: file upstream bug.
if (Posix.errno == Posix.EAGAIN &&
root.get_uri_scheme() == "smb" &&
e.matches(IOError.quark(), 0))
{
return _("The network server is not available");
}
return e.message;
}
public override async bool is_ready(out string when)
{
var root = get_root_from_settings();
......@@ -111,12 +127,12 @@ public class BackendRemote : BackendFile
return yield root.mount_enclosing_volume(MountMountFlags.NONE, mount_op, null);
} catch (IOError.ALREADY_MOUNTED e) {
when = _("Backup will begin when a network connection becomes available.");
return yield Network.get().can_reach(root.get_uri());
return Network.get().connected;
} catch (IOError.FAILED_HANDLED e) {
// Needed user input, so we know we can reach server
return true;
} catch (Error e) {
when = e.message;
when = get_unready_message(root, e);
return false;
}
}
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: deja-dup\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-31 10:27-0400\n"
"POT-Creation-Date: 2017-09-18 13:47-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -40,7 +40,9 @@ msgid ""
msgstr ""
#: data/org.gnome.DejaDup.appdata.xml.in:12
msgid "Support for local, remote, or cloud backup locations such as Nextcloud"
msgid ""
"Support for local, remote, or cloud backup locations such as Google Drive "
"and Nextcloud"
msgstr ""
#: data/org.gnome.DejaDup.appdata.xml.in:13
......@@ -559,11 +561,11 @@ msgctxt "back up is verb"
msgid "_Back Up"
msgstr ""
#: deja-dup/AssistantBackup.vala:58
#: deja-dup/AssistantBackup.vala:57
msgid "Creating the first backup. This may take a while."
msgstr ""
#: deja-dup/AssistantBackup.vala:59
#: deja-dup/AssistantBackup.vala:58
msgid ""
"Creating a fresh backup to protect against backup corruption. This will "
"take longer than normal."
......@@ -571,24 +573,24 @@ msgstr ""
#. Translators: This is the phrase 'Backing up' in the larger phrase
#. "Backing up '%s'". %s is a filename.
#: deja-dup/AssistantBackup.vala:89
#: deja-dup/AssistantBackup.vala:88
msgid "Backing up:"
msgstr ""
#: deja-dup/AssistantBackup.vala:98
#: deja-dup/AssistantBackup.vala:97
msgid "Backup Failed"
msgstr ""
#: deja-dup/AssistantBackup.vala:101
#: deja-dup/AssistantBackup.vala:100
msgid "Backup Finished"
msgstr ""
#. Also leave ourselves up if we just finished a restore test.
#: deja-dup/AssistantBackup.vala:105
#: deja-dup/AssistantBackup.vala:104
msgid "Your files were successfully backed up and tested."
msgstr ""
#: deja-dup/AssistantBackup.vala:112
#: deja-dup/AssistantBackup.vala:111
msgid "Backing Up…"
msgstr ""
......@@ -792,7 +794,7 @@ msgid_plural "Your files were successfully restored."
msgstr[0] ""
msgstr[1] ""
#: deja-dup/AssistantRestore.vala:491 libdeja/Operation.vala:64
#: deja-dup/AssistantRestore.vala:491 libdeja/Operation.vala:58
msgid "Restoring…"
msgstr ""
......@@ -1014,30 +1016,30 @@ msgstr ""
msgid "_Open Backup Settings"
msgstr ""
#: deja-dup/StatusIcon.vala:84
#: deja-dup/StatusIcon.vala:82
msgid "Backup completed"
msgstr ""
#: deja-dup/StatusIcon.vala:89
#: deja-dup/StatusIcon.vala:87
msgid "Backup finished"
msgstr ""
#: deja-dup/StatusIcon.vala:90
#: deja-dup/StatusIcon.vala:88
msgid ""
"Not all files were successfully backed up. See dialog for more details."
msgstr ""
#: deja-dup/StatusIcon.vala:120
#: deja-dup/StatusIcon.vala:118
msgid "Starting scheduled backup"
msgstr ""
#: deja-dup/StatusIcon.vala:151
#: deja-dup/StatusIcon.vala:149
#, c-format
msgid "%.1f%% complete"
msgstr ""
#: deja-dup/monitor/monitor.vala:82 libdeja/BackendRackspace.vala:54
#: libdeja/BackendRemote.vala:104 libdeja/BackendS3.vala:64
#: libdeja/BackendRemote.vala:129 libdeja/BackendS3.vala:64
msgid "Backup will begin when a network connection becomes available."
msgstr ""
......@@ -1187,23 +1189,23 @@ msgstr ""
#. Note that we are using | not || here, because if show_deprecated is set,
#. we want to insert multiple backends.
#: deja-dup/widgets/ConfigLocation.vala:295 libdeja/BackendS3.vala:122
#: deja-dup/widgets/ConfigLocation.vala:293 libdeja/BackendS3.vala:122
msgid "Amazon S3"
msgstr ""
#: deja-dup/widgets/ConfigLocation.vala:297
#: deja-dup/widgets/ConfigLocation.vala:295
msgid "Google Cloud Storage"
msgstr ""
#: deja-dup/widgets/ConfigLocation.vala:299 libdeja/BackendU1.vala:45
#: deja-dup/widgets/ConfigLocation.vala:297 libdeja/BackendU1.vala:45
msgid "Ubuntu One"
msgstr ""
#: deja-dup/widgets/ConfigLocation.vala:301 libdeja/BackendRackspace.vala:72
#: deja-dup/widgets/ConfigLocation.vala:299 libdeja/BackendRackspace.vala:72
msgid "Rackspace Cloud Files"
msgstr ""
#: deja-dup/widgets/ConfigLocation.vala:303
#: deja-dup/widgets/ConfigLocation.vala:301
msgid "OpenStack Swift"
msgstr ""
......@@ -1304,8 +1306,8 @@ msgstr ""
msgid "Backup will begin when %s is connected."
msgstr ""
#: libdeja/BackendDrive.vala:184 libdeja/BackendGOA.vala:146
#: libdeja/BackendRemote.vala:129
#: libdeja/BackendDrive.vala:184 libdeja/BackendGOA.vala:158
#: libdeja/BackendRemote.vala:154
msgid "Storage location not available"
msgstr ""
......@@ -1314,7 +1316,11 @@ msgstr ""
msgid "Waiting for ‘%s’ to become connected…"
msgstr ""
#: libdeja/BackendGOA.vala:101
#: libdeja/BackendGOA.vala:94
msgid "Google Drive"
msgstr ""
#: libdeja/BackendGOA.vala:113
msgid "Backup will begin when a storage location is configured"
msgstr ""
......@@ -1322,17 +1328,17 @@ msgstr ""
#. Translators: "Files" here is the string used in GNOME Online Account
#. settings checkbox for a given account to enable/disable an account's
#. Files feature.
#: libdeja/BackendGOA.vala:111
#: libdeja/BackendGOA.vala:123
#, c-format
msgid "Backup will begin when ‘%s’ has Files support enabled"
msgstr ""
#: libdeja/BackendGOA.vala:140
#: libdeja/BackendGOA.vala:152
msgid "Waiting for Online Accounts to be configured in your backup settings…"
msgstr ""
#. Translators: %s is the name of the provider inside of GNOME Online Accounts
#: libdeja/BackendGOA.vala:143
#: libdeja/BackendGOA.vala:155
#, c-format
msgid "Waiting for %s to be configured in your backup settings…"
msgstr ""
......@@ -1370,7 +1376,11 @@ msgstr ""
msgid "_Remember API access key"
msgstr ""
#: libdeja/BackendRemote.vala:130
#: libdeja/BackendRemote.vala:111
msgid "The network server is not available"
msgstr ""
#: libdeja/BackendRemote.vala:155
msgid "Waiting for a network connection…"
msgstr ""
......@@ -1452,19 +1462,19 @@ msgid ""
"again."
msgstr ""
#: libdeja/Operation.vala:62
#: libdeja/Operation.vala:56
msgid "Backing up…"
msgstr ""
#: libdeja/Operation.vala:66
#: libdeja/Operation.vala:60
msgid "Checking for backups…"
msgstr ""
#: libdeja/Operation.vala:68
#: libdeja/Operation.vala:62
msgid "Listing files…"
msgstr ""
#: libdeja/Operation.vala:70 libdeja/Operation.vala:99
#: libdeja/Operation.vala:64 libdeja/Operation.vala:93
#: libdeja/tools/duplicity/DuplicityJob.vala:394
#: libdeja/tools/duplicity/DuplicityJob.vala:401
#: libdeja/tools/duplicity/DuplicityJob.vala:426
......
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