[tomboy] Add hidden option to disable the tray icon (bug #594682)
- From: Sanford Armstrong <sharm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tomboy] Add hidden option to disable the tray icon (bug #594682)
- Date: Mon, 7 Jun 2010 21:58:02 +0000 (UTC)
commit a9fad5c620d85623df9775b6538726c820921147
Author: Matthew Pirocchi <matthew pirocchi gmail com>
Date: Mon Jun 7 14:45:57 2010 -0700
Add hidden option to disable the tray icon (bug #594682)
Tomboy continues running even when no windows are open.
Tomboy/Preferences.cs | 4 ++++
Tomboy/RecentChanges.cs | 6 ++++--
Tomboy/Tomboy.cs | 3 ++-
Tomboy/Tray.cs | 6 ++++++
data/tomboy.schemas.in | 16 ++++++++++++++++
5 files changed, 32 insertions(+), 3 deletions(-)
---
diff --git a/Tomboy/Preferences.cs b/Tomboy/Preferences.cs
index a13ca1d..234b9a7 100644
--- a/Tomboy/Preferences.cs
+++ b/Tomboy/Preferences.cs
@@ -15,6 +15,7 @@ namespace Tomboy
public const string ENABLE_AUTO_BULLETED_LISTS = "/apps/tomboy/enable_bulleted_lists";
public const string ENABLE_ICON_PASTE = "/apps/tomboy/enable_icon_paste";
public const string ENABLE_CLOSE_NOTE_ON_ESCAPE = "/apps/tomboy/enable_close_note_on_escape";
+ public const string ENABLE_TRAY_ICON = "/apps/tomboy/enable_tray_icon";
public const string ENABLE_DELETE_CONFIRM = "/apps/tomboy/enable_delete_confirm";
public const string START_NOTE_URI = "/apps/tomboy/start_note";
@@ -87,6 +88,9 @@ namespace Tomboy
case ENABLE_CLOSE_NOTE_ON_ESCAPE:
return true;
+ case ENABLE_TRAY_ICON:
+ return true;
+
case ENABLE_DELETE_CONFIRM:
return true;
diff --git a/Tomboy/RecentChanges.cs b/Tomboy/RecentChanges.cs
index cafe9cc..0f43b2b 100644
--- a/Tomboy/RecentChanges.cs
+++ b/Tomboy/RecentChanges.cs
@@ -230,7 +230,8 @@ namespace Tomboy
am ["NewNotebookAction"].Activated += OnNewNotebook;
am ["DeleteNotebookAction"].Activated += OnDeleteNotebook;
am ["CloseWindowAction"].Activated += OnCloseWindow;
- if (Tomboy.TrayIconShowing == false)
+ if (Tomboy.TrayIconShowing == false &&
+ (bool) Preferences.Get (Preferences.ENABLE_TRAY_ICON))
am ["CloseWindowAction"].Visible = false;
// Allow Escape to close the window as well as <Control>W
@@ -1011,7 +1012,8 @@ namespace Tomboy
Destroy ();
instance = null;
#if !MAC
- if (Tomboy.TrayIconShowing == false)
+ if (Tomboy.TrayIconShowing == false &&
+ (bool) Preferences.Get (Preferences.ENABLE_TRAY_ICON))
Tomboy.ActionManager ["QuitTomboyAction"].Activate ();
#endif
}
diff --git a/Tomboy/Tomboy.cs b/Tomboy/Tomboy.cs
index cd777aa..f2d2146 100644
--- a/Tomboy/Tomboy.cs
+++ b/Tomboy/Tomboy.cs
@@ -205,7 +205,8 @@ namespace Tomboy
// instead, launch the Search All Notes window so the user can
// can still use Tomboy.
#if !MAC
- if (tray_icon_showing == false)
+ if (tray_icon_showing == false &&
+ (bool) Preferences.Get (Preferences.ENABLE_TRAY_ICON))
ActionManager ["ShowSearchAllNotesAction"].Activate ();
#endif
diff --git a/Tomboy/Tray.cs b/Tomboy/Tray.cs
index 8aae890..46a3c26 100644
--- a/Tomboy/Tray.cs
+++ b/Tomboy/Tray.cs
@@ -158,6 +158,12 @@ namespace Tomboy
Tooltip = TomboyTrayUtils.GetToolTipText ();
+ Visible = (bool) Preferences.Get (Preferences.ENABLE_TRAY_ICON);
+ Preferences.SettingChanged += (o, args) => {
+ if (args.Key == Preferences.ENABLE_TRAY_ICON)
+ Visible = (bool) args.Value;
+ };
+
Tomboy.ExitingEvent += OnExit;
#if MAC
Visible = false;
diff --git a/data/tomboy.schemas.in b/data/tomboy.schemas.in
index b2ce1d0..6376535 100644
--- a/data/tomboy.schemas.in
+++ b/data/tomboy.schemas.in
@@ -121,6 +121,22 @@
</schema>
<schema>
+ <key>/schemas/apps/tomboy/enable_tray_icon</key>
+ <applyto>/apps/tomboy/enable_tray_icon</applyto>
+ <owner>tomboy</owner>
+ <type>bool</type>
+ <default>true</default>
+ <locale name="C">
+ <short>Enable Tray Icon</short>
+ <long>
+ If true, Tomboy's tray icon will be displayed in the notification area.
+ Disabling this may be useful when another application is providing
+ the functionality of the tray icon.
+ </long>
+ </locale>
+ </schema>
+
+ <schema>
<key>/schemas/apps/tomboy/start_note</key>
<applyto>/apps/tomboy/start_note</applyto>
<owner>tomboy</owner>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]