[tomboy] Use gtk_show_uri to display help, and update signatures of
- From: Sanford Armstrong <sharm src gnome org>
- To: svn-commits-list gnome org
- Subject: [tomboy] Use gtk_show_uri to display help, and update signatures of
- Date: Fri, 24 Jul 2009 18:20:21 +0000 (UTC)
commit 367c005906a38b407aec69b166ac79ea30f49931
Author: Sandy Armstrong <sanfordarmstrong gmail com>
Date: Fri Jul 24 11:18:05 2009 -0700
Use gtk_show_uri to display help, and update signatures of
INativeApplication.OpenUrl/DisplayHelp a bit.
Tomboy/Addins/Bugzilla/BugzillaLink.cs | 2 +-
.../Addins/ExportToHtml/ExportToHtmlNoteAddin.cs | 3 ++-
.../WebSyncService/WebSyncPreferencesWidget.cs | 2 +-
Tomboy/Applet.cs | 2 +-
Tomboy/GnomeApplication.cs | 13 ++++---------
Tomboy/MacApplication.cs | 2 +-
Tomboy/NativeApplication.cs | 6 ++----
Tomboy/NoteWindow.cs | 2 +-
Tomboy/PreferencesDialog.cs | 2 +-
Tomboy/Tomboy.cs | 6 ++----
Tomboy/Utils.cs | 18 +++++++-----------
Tomboy/Watchers.cs | 2 +-
Tomboy/WindowsApplication.cs | 4 ++--
13 files changed, 26 insertions(+), 38 deletions(-)
---
diff --git a/Tomboy/Addins/Bugzilla/BugzillaLink.cs b/Tomboy/Addins/Bugzilla/BugzillaLink.cs
index b035f8c..a85f510 100644
--- a/Tomboy/Addins/Bugzilla/BugzillaLink.cs
+++ b/Tomboy/Addins/Bugzilla/BugzillaLink.cs
@@ -77,7 +77,7 @@ namespace Tomboy.Bugzilla
Logger.Log ("Opening url '{0}'...", BugUrl);
try {
- Services.NativeApplication.OpenUrl (BugUrl);
+ Services.NativeApplication.OpenUrl (BugUrl, editor.Screen);
} catch (Exception e) {
GuiUtils.ShowOpeningLocationError (null, BugUrl, e.Message);
}
diff --git a/Tomboy/Addins/ExportToHtml/ExportToHtmlNoteAddin.cs b/Tomboy/Addins/ExportToHtml/ExportToHtmlNoteAddin.cs
index 0b5f545..84d36cf 100644
--- a/Tomboy/Addins/ExportToHtml/ExportToHtmlNoteAddin.cs
+++ b/Tomboy/Addins/ExportToHtml/ExportToHtmlNoteAddin.cs
@@ -104,7 +104,8 @@ namespace Tomboy.ExportToHtml
try {
Uri output_uri = new Uri (output_path);
- Services.NativeApplication.OpenUrl (output_uri.AbsoluteUri);
+ Services.NativeApplication.OpenUrl (output_uri.AbsoluteUri,
+ Note.Window.Screen);
} catch (Exception ex) {
Logger.Log ("Could not open exported note in a web browser: {0}",
ex);
diff --git a/Tomboy/Addins/WebSyncService/WebSyncPreferencesWidget.cs b/Tomboy/Addins/WebSyncService/WebSyncPreferencesWidget.cs
index d255a9d..901c0c4 100644
--- a/Tomboy/Addins/WebSyncService/WebSyncPreferencesWidget.cs
+++ b/Tomboy/Addins/WebSyncService/WebSyncPreferencesWidget.cs
@@ -113,7 +113,7 @@ namespace Tomboy.WebSync
}
Logger.Debug ("Launching browser to authorize web sync: " + authUrl);
try {
- Services.NativeApplication.OpenUrl (authUrl);
+ Services.NativeApplication.OpenUrl (authUrl, Screen);
authReqested = true;
authButton.Label = Catalog.GetString ("Click Here After Authorizing");
} catch (Exception e) {
diff --git a/Tomboy/Applet.cs b/Tomboy/Applet.cs
index d664700..b60e813 100644
--- a/Tomboy/Applet.cs
+++ b/Tomboy/Applet.cs
@@ -95,7 +95,7 @@ namespace Tomboy
{
// Don't use the ActionManager in this case because
// the handler won't know about the Screen.
- GuiUtils.ShowHelp ("tomboy.xml", null, Screen, null);
+ GuiUtils.ShowHelp ("ghelp:tomboy", Screen, null);
}
void ShowAboutVerb ()
diff --git a/Tomboy/GnomeApplication.cs b/Tomboy/GnomeApplication.cs
index 5a44c66..cb9312e 100644
--- a/Tomboy/GnomeApplication.cs
+++ b/Tomboy/GnomeApplication.cs
@@ -142,19 +142,14 @@ namespace Tomboy
ExitingEvent (null, new EventArgs ());
}
- public void OpenUrl (string url)
+ public void OpenUrl (string url, Gdk.Screen screen)
{
- GtkBeans.Global.ShowUri (null, url);
+ GtkBeans.Global.ShowUri (screen, url);
}
- public void DisplayHelp (string filename, string link_id, Gdk.Screen screen)
+ public void DisplayHelp (string help_uri, Gdk.Screen screen)
{
- Gnome.Help.DisplayDesktopOnScreen (
- Gnome.Program.Get (),
- Defines.GNOME_HELP_DIR,
- filename,
- link_id,
- screen);
+ GtkBeans.Global.ShowUri (screen, help_uri);
}
public string ConfDir {
diff --git a/Tomboy/MacApplication.cs b/Tomboy/MacApplication.cs
index 42deeef..0eae103 100644
--- a/Tomboy/MacApplication.cs
+++ b/Tomboy/MacApplication.cs
@@ -200,7 +200,7 @@ namespace Tomboy
[DllImport ("libc", EntryPoint="system")]
public static extern int system (string command);
- public override void OpenUrl (string url)
+ public override void OpenUrl (string url, Gdk.Screen screen)
{
system ("open \"" + url + "\"");
}
diff --git a/Tomboy/NativeApplication.cs b/Tomboy/NativeApplication.cs
index 645c5dd..13587aa 100644
--- a/Tomboy/NativeApplication.cs
+++ b/Tomboy/NativeApplication.cs
@@ -20,10 +20,8 @@ namespace Tomboy
string ConfDir { get; }
- void OpenUrl (string url);
+ void OpenUrl (string url, Gdk.Screen screen);
- void DisplayHelp (string filename,
- string link_id,
- Gdk.Screen screen);
+ void DisplayHelp (string help_uri, Gdk.Screen screen);
}
}
diff --git a/Tomboy/NoteWindow.cs b/Tomboy/NoteWindow.cs
index c8f5886..09e7be3 100644
--- a/Tomboy/NoteWindow.cs
+++ b/Tomboy/NoteWindow.cs
@@ -689,7 +689,7 @@ namespace Tomboy
void OpenHelpActivate (object sender, EventArgs args)
{
- GuiUtils.ShowHelp ("tomboy.xml", "editing-notes", Screen, this);
+ GuiUtils.ShowHelp ("ghelp:tomboy?editing-notes", Screen, this);
}
void CreateNewNote (object sender, EventArgs args)
diff --git a/Tomboy/PreferencesDialog.cs b/Tomboy/PreferencesDialog.cs
index 07ed364..7f20135 100644
--- a/Tomboy/PreferencesDialog.cs
+++ b/Tomboy/PreferencesDialog.cs
@@ -543,7 +543,7 @@ namespace Tomboy
get_more_link.Clicked += delegate(object sender, EventArgs args) {
string uri = ((Gtk.LinkButton) sender).Uri;
try {
- Services.NativeApplication.OpenUrl (uri);
+ Services.NativeApplication.OpenUrl (uri, Screen);
} catch (Exception e) {
GuiUtils.ShowOpeningLocationError (this, uri, e.Message);
}
diff --git a/Tomboy/Tomboy.cs b/Tomboy/Tomboy.cs
index 71e35d6..97d6df9 100644
--- a/Tomboy/Tomboy.cs
+++ b/Tomboy/Tomboy.cs
@@ -300,9 +300,7 @@ namespace Tomboy
tray_icon.GetGeometry (out screen, out area, out orientation);
#endif
}
- GuiUtils.ShowHelp("tomboy.xml", null,
- screen,
- null);
+ GuiUtils.ShowHelp ("ghelp:tomboy", screen, null);
}
@@ -344,7 +342,7 @@ namespace Tomboy
"note-taking application.");
Gtk.AboutDialog.SetUrlHook (delegate (Gtk.AboutDialog dialog, string link) {
try {
- Services.NativeApplication.OpenUrl (link);
+ Services.NativeApplication.OpenUrl (link, null);
} catch (Exception e) {
GuiUtils.ShowOpeningLocationError (dialog, link, e.Message);
}
diff --git a/Tomboy/Utils.cs b/Tomboy/Utils.cs
index be3b99f..1ed72d8 100644
--- a/Tomboy/Utils.cs
+++ b/Tomboy/Utils.cs
@@ -131,22 +131,18 @@ namespace Tomboy
return MakeImageButton (image, label);
}
- public static void ShowHelp (string filename,
- string link_id,
+ public static void ShowHelp (string help_uri,
Gdk.Screen screen,
Gtk.Window parent)
{
try {
- Services.NativeApplication.DisplayHelp (
- filename,
- link_id,
- screen);
+ Services.NativeApplication.DisplayHelp (help_uri, screen);
} catch {
- string message =
- Catalog.GetString ("The \"Tomboy Notes Manual\" could " +
- "not be found. Please verify " +
- "that your installation has been " +
- "completed successfully.");
+ string message =
+ Catalog.GetString ("The \"Tomboy Notes Manual\" could " +
+ "not be found. Please verify " +
+ "that your installation has been " +
+ "completed successfully.");
HIGMessageDialog dialog =
new HIGMessageDialog (parent,
Gtk.DialogFlags.DestroyWithParent,
diff --git a/Tomboy/Watchers.cs b/Tomboy/Watchers.cs
index 57c0112..adfdfa3 100644
--- a/Tomboy/Watchers.cs
+++ b/Tomboy/Watchers.cs
@@ -452,7 +452,7 @@ namespace Tomboy
{
if (url != string.Empty) {
Logger.Log ("Opening url '{0}'...", url);
- Services.NativeApplication.OpenUrl (url);
+ Services.NativeApplication.OpenUrl (url, Note.Window.Screen);
}
}
diff --git a/Tomboy/WindowsApplication.cs b/Tomboy/WindowsApplication.cs
index 6d4f6d3..8c9f59e 100644
--- a/Tomboy/WindowsApplication.cs
+++ b/Tomboy/WindowsApplication.cs
@@ -78,7 +78,7 @@ namespace Tomboy
get { return confDir; }
}
- public virtual void OpenUrl (string url)
+ public virtual void OpenUrl (string url, Gdk.Screen screen)
{
try {
System.Diagnostics.Process.Start (url);
@@ -87,7 +87,7 @@ namespace Tomboy
}
}
- public virtual void DisplayHelp (string filename, string link_id, Gdk.Screen screen)
+ public virtual void DisplayHelp (string help_uri, Gdk.Screen screen)
{
OpenUrl ("http://library.gnome.org/users/tomboy/0.12/");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]