Commit 1b5c7a68 authored by Michael Terry's avatar Michael Terry

Simplify legacy status icon implementation, don't show symbolic icons -- some...

Simplify legacy status icon implementation, don't show symbolic icons -- some dark panels don't color it correctly.  Let's just assume that panels are dumb and the smart ones will find the symbolic icon for us
parent cc9ee34c
......@@ -557,7 +557,6 @@ public abstract class AssistantOperation : Assistant
if (status_icon == null) {
status_icon = StatusIcon.create(this, o, automatic);
status_icon.show_window.connect((s, user_click) => {force_visible(user_click);});
status_icon.hide_all.connect((s) => {hide_everything();});
}
}
......
......@@ -27,7 +27,6 @@ using GLib;
* GNOME Shell:
* No status icon at all.
* Actions on persistent notifications.
* Detected by 'persistent' capability of notification server.
* Automatic-start and success notifications.
*
* Legacy:
......@@ -53,7 +52,6 @@ public abstract class StatusIcon : Object
}
public signal void show_window(bool user_click);
public signal void hide_all();
public Gtk.Window? window {get; construct;}
public DejaDup.Operation op {get; construct;}
public bool automatic {get; construct; default = false;}
......@@ -63,13 +61,7 @@ public abstract class StatusIcon : Object
protected string action;
protected double progress;
protected string later_label;
protected string skip_label;
construct {
later_label = _("_Resume Later");
skip_label = _("_Skip Backup");
op.action_desc_changed.connect(set_action_desc);
op.progress.connect(note_progress);
}
......@@ -114,22 +106,6 @@ public abstract class StatusIcon : Object
}
protected virtual void update_progress() {}
protected void later()
{
hide_all();
op.stop();
}
protected void skip()
{
hide_all();
// Fake a run by setting today's timestamp as the 'last-run' setting
DejaDup.update_last_run_timestamp(DejaDup.TimestampType.NONE);
op.cancel();
}
}
class ShellStatusIcon : StatusIcon
......@@ -156,16 +132,14 @@ class LegacyStatusIcon : StatusIcon
Object(window: window, op: op, automatic: automatic);
}
Gtk.Menu menu;
Gtk.StatusIcon icon;
construct {
icon = new Gtk.StatusIcon();
icon.set("icon-name", "deja-dup-symbolic",
"title", Environment.get_application_name());
icon.icon_name = "deja-dup";
icon.title = Environment.get_application_name();
icon.activate.connect(() => {show_window(true);});
ensure_menu();
icon.popup_menu.connect(show_menu);
icon.activate.connect((s) => {show_menu(s, 0, Gtk.get_current_event_time());});
update_progress();
}
protected override void update_progress()
......@@ -177,39 +151,5 @@ class LegacyStatusIcon : StatusIcon
tooltip = tooltip + "\n" + _("%.1f%% complete").printf(this.progress * 100);
icon.set_tooltip_text(tooltip);
}
void show_menu(Gtk.StatusIcon status_icon, uint button, uint activate_time)
{
menu.popup(null, null, status_icon.position_menu, button, activate_time);
}
void ensure_menu()
{
menu = new Gtk.Menu();
var progressitem = new Gtk.MenuItem.with_mnemonic(_("Show _Progress"));
progressitem.activate.connect((i) => {show_window(true);});
menu.append(progressitem);
if (op.mode == DejaDup.ToolJob.Mode.BACKUP) {
Gtk.MenuItem item;
menu.append(new Gtk.SeparatorMenuItem());
item = new Gtk.MenuItem.with_mnemonic(later_label);
item.activate.connect((i) => {later();});
menu.append(item);
if (automatic) {
item = new Gtk.MenuItem.with_mnemonic(skip_label);
item.activate.connect((i) => {skip();});
menu.append(item);
}
}
update_progress();
menu.show_all();
}
}
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2017-08-12 01:48-0400\n"
"POT-Creation-Date: 2017-08-13 11:09-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"
......
......@@ -39,28 +39,13 @@ public enum ShellEnv {
LEGACY
}
[DBus (name = "org.gnome.Shell")]
public interface GnomeShell : GLib.Object {
public abstract string ShellVersion { owned get; }
}
private ShellEnv shell = ShellEnv.NONE;
public ShellEnv get_shell()
{
if (shell == ShellEnv.NONE) {
// Use Legacy unless we detect a different shell.
shell = ShellEnv.LEGACY;
string gsv = null;
try {
GnomeShell gs = GLib.Bus.get_proxy_sync(BusType.SESSION,
"org.gnome.Shell",
"/org/gnome/Shell");
gsv = gs.ShellVersion;
} catch (Error e) {}
if (gsv != null) {
// It's really GnomeShell.
shell = ShellEnv.GNOME;
}
var desktop = Environment.get_variable("XDG_CURRENT_DESKTOP");
shell = (desktop == "GNOME") ? ShellEnv.GNOME : ShellEnv.LEGACY;
}
return shell;
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: deja-dup\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-12 01:48-0400\n"
"POT-Creation-Date: 2017-08-13 11:09-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"
......@@ -609,21 +609,21 @@ msgstr ""
#. But first, try to restart without a cache, since that seems to quite
#. frequently fix odd metadata errors with duplicity. If we hit an error
#. a second time, we'll show the unknown error message.
#: deja-dup/AssistantOperation.vala:575
#: deja-dup/AssistantOperation.vala:574
#: libdeja/tools/duplicity/DuplicityJob.vala:706
#: libdeja/tools/duplicity/DuplicityJob.vala:1085
msgid "Failed with an unknown error."
msgstr ""
#: deja-dup/AssistantOperation.vala:772
#: deja-dup/AssistantOperation.vala:771
msgid "Require Password?"
msgstr ""
#: deja-dup/AssistantOperation.vala:774
#: deja-dup/AssistantOperation.vala:773
msgid "Encryption Password Needed"
msgstr ""
#: deja-dup/AssistantOperation.vala:846
#: deja-dup/AssistantOperation.vala:845
msgid "Backup encryption password"
msgstr ""
......@@ -809,7 +809,7 @@ msgstr ""
msgid "_Back"
msgstr ""
#: deja-dup/Assistant.vala:357 deja-dup/StatusIcon.vala:70
#: deja-dup/Assistant.vala:357
msgid "_Resume Later"
msgstr ""
......@@ -972,36 +972,28 @@ msgstr ""
msgid "_Open Backup Settings"
msgstr ""
#: deja-dup/StatusIcon.vala:71
msgid "_Skip Backup"
msgstr ""
#: deja-dup/StatusIcon.vala:92
#: deja-dup/StatusIcon.vala:84
msgid "Backup completed"
msgstr ""
#: deja-dup/StatusIcon.vala:97
#: deja-dup/StatusIcon.vala:89
msgid "Backup finished"
msgstr ""
#: deja-dup/StatusIcon.vala:98
#: deja-dup/StatusIcon.vala:90
msgid ""
"Not all files were successfully backed up. See dialog for more details."
msgstr ""
#: deja-dup/StatusIcon.vala:144
#: deja-dup/StatusIcon.vala:120
msgid "Starting scheduled backup"
msgstr ""
#: deja-dup/StatusIcon.vala:177
#: deja-dup/StatusIcon.vala:151
#, c-format
msgid "%.1f%% complete"
msgstr ""
#: deja-dup/StatusIcon.vala:190
msgid "Show _Progress"
msgstr ""
#: deja-dup/monitor/monitor.vala:82 libdeja/BackendRackspace.vala:49
#: libdeja/BackendS3.vala:59
msgid "Backup will begin when a network connection becomes available."
......@@ -1190,61 +1182,62 @@ msgstr ""
msgid "Server _Address"
msgstr ""
#: deja-dup/widgets/ConfigLocationCustom.vala:41
#. Translators: This is followed by a list of valid adresses (smb://gnome.org, ssh://192.168.0.1, ftp://[2001:db8::1])
#: deja-dup/widgets/ConfigLocationCustom.vala:42
msgid ""
"Server addresses are made up of a protocol prefix and an address. Examples:"
msgstr ""
#: deja-dup/widgets/ConfigLocationCustom.vala:45
#: deja-dup/widgets/ConfigLocationCustom.vala:46
msgid "Available Protocols"
msgstr ""
#: deja-dup/widgets/ConfigLocationCustom.vala:46
#: deja-dup/widgets/ConfigLocationCustom.vala:47
msgid "Prefix"
msgstr ""
#: deja-dup/widgets/ConfigLocationCustom.vala:48
#: deja-dup/widgets/ConfigLocationCustom.vala:49
msgid "AppleTalk"
msgstr ""
#: deja-dup/widgets/ConfigLocationCustom.vala:51
#: deja-dup/widgets/ConfigLocationCustom.vala:52
msgid "File Transfer Protocol"
msgstr ""
#. Translators: do not translate ftp:// and ftps://
#: deja-dup/widgets/ConfigLocationCustom.vala:53
#: deja-dup/widgets/ConfigLocationCustom.vala:54
msgid "ftp:// or ftps://"
msgstr ""
#: deja-dup/widgets/ConfigLocationCustom.vala:55
#: deja-dup/widgets/ConfigLocationCustom.vala:56
msgid "Network File System"
msgstr ""
#: deja-dup/widgets/ConfigLocationCustom.vala:58
#: deja-dup/widgets/ConfigLocationCustom.vala:59
msgid "Samba"
msgstr ""
#: deja-dup/widgets/ConfigLocationCustom.vala:61
#: deja-dup/widgets/ConfigLocationCustom.vala:62
msgid "SSH File Transfer Protocol"
msgstr ""
#. Translators: do not translate sftp:// and ssh://
#: deja-dup/widgets/ConfigLocationCustom.vala:63
#: deja-dup/widgets/ConfigLocationCustom.vala:64
msgid "sftp:// or ssh://"
msgstr ""
#: deja-dup/widgets/ConfigLocationCustom.vala:65
#: deja-dup/widgets/ConfigLocationCustom.vala:66
msgid "WebDav"
msgstr ""
#. Translators: do not translate dav:// and davs://
#: deja-dup/widgets/ConfigLocationCustom.vala:67
#: deja-dup/widgets/ConfigLocationCustom.vala:68
msgid "dav:// or davs://"
msgstr ""
#: deja-dup/widgets/ConfigLocationCustom.vala:75
#: deja-dup/widgets/ConfigLocationCustom.vala:76
#: deja-dup/widgets/ConfigLocationFile.vala:44
#: deja-dup/widgets/ConfigLocationGCS.vala:36
#: deja-dup/widgets/ConfigLocationGCS.vala:38
#: deja-dup/widgets/ConfigLocationGoa.vala:36
#: deja-dup/widgets/ConfigLocationS3.vala:33
#: deja-dup/widgets/ConfigLocationVolume.vala:33
......@@ -1264,7 +1257,9 @@ msgstr ""
msgid "GCS Access Key I_D"
msgstr ""
#: deja-dup/widgets/ConfigLocationGCS.vala:34
#. Translators: "Bucket" refers to a term used by Google Cloud Services
#. see https://cloud.google.com/storage/docs/key-terms#bucket
#: deja-dup/widgets/ConfigLocationGCS.vala:36
msgid "_Bucket"
msgstr ""
......@@ -1319,7 +1314,7 @@ msgstr ""
#. Translators: %2$s is the name of a removable drive, %1$s is a folder
#. on that removable drive.
#: libdeja/BackendDrive.vala:98 libdeja/CommonUtils.vala:569
#: libdeja/BackendDrive.vala:98 libdeja/CommonUtils.vala:572
#, c-format
msgid "%1$s on %2$s"
msgstr ""
......@@ -1329,8 +1324,8 @@ msgstr ""
msgid "Backup will begin when %s is connected."
msgstr ""
#: libdeja/BackendDrive.vala:186 libdeja/BackendGOA.vala:143
#: libdeja/BackendRemote.vala:100
#: libdeja/BackendDrive.vala:186 libdeja/BackendGOA.vala:145
#: libdeja/BackendRemote.vala:117
msgid "Storage location not available"
msgstr ""
......@@ -1356,7 +1351,8 @@ msgstr ""
msgid "Waiting for Online Accounts to be configured in your backup settings…"
msgstr ""
#: libdeja/BackendGOA.vala:141
#. Translators: %s is the name of the provider inside of GNOME Online Accounts
#: libdeja/BackendGOA.vala:142
#, c-format
msgid "Waiting for %s to be configured in your backup settings…"
msgstr ""
......@@ -1394,7 +1390,7 @@ msgstr ""
msgid "_Remember API access key"
msgstr ""
#: libdeja/BackendRemote.vala:101
#: libdeja/BackendRemote.vala:118
msgid "Waiting for a network connection…"
msgstr ""
......@@ -1447,18 +1443,18 @@ msgid "Could not start backup tool"
msgstr ""
#. Translators: this is the home folder and %s is the user's username
#: libdeja/CommonUtils.vala:620
#: libdeja/CommonUtils.vala:623
#, c-format
msgid "Home (%s)"
msgstr ""
#. Translators: this is the home folder
#: libdeja/CommonUtils.vala:625
#: libdeja/CommonUtils.vala:628
msgid "Home"
msgstr ""
#. Translators: this is the trash folder
#: libdeja/CommonUtils.vala:630
#: libdeja/CommonUtils.vala:633
msgid "Trash"
msgstr ""
......
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