public GlobalActions() : base("Global")
{
Add(new ActionEntry [] {
// Media Menu
new ActionEntry("MediaMenuAction", null,
Catalog.GetString("_Media"), null, null, null),
new ActionEntry("ImportAction", Stock.Open,
Catalog.GetString("Import _Media..."), "<control>I",
Catalog.GetString("Import media from a variety of sources"), OnImport),
new ActionEntry("ImportPlaylistAction", null,
Catalog.GetString("Import _Playlist..."), null,
Catalog.GetString("Import a playlist"), OnImportPlaylist),
new ActionEntry("OpenLocationAction", null,
Catalog.GetString("Open _Location..."), "<control>L",
Catalog.GetString("Open a remote location for playback"), OnOpenLocation),
new ActionEntry("QuitAction", Stock.Quit,
Catalog.GetString("_Quit"), "<control>Q",
Catalog.GetString("Quit Banshee"), OnQuit),
// Edit Menu
new ActionEntry("EditMenuAction", null,
Catalog.GetString("_Edit"), null, null, null),
new ActionEntry("PreferencesAction", Stock.Preferences,
Catalog.GetString("_Preferences"), "",
Catalog.GetString("Modify your personal preferences"), OnPreferences),
// Tools menu
new ActionEntry("ToolsMenuAction", null,
Catalog.GetString("_Tools"), null, null, null),
new ActionEntry("RescanAction", null,
Catalog.GetString("Rescan Music Library"), null,
Catalog.GetString("Rescan the Music Library folder"), delegate {
new Banshee.Collection.RescanPipeline(ServiceManager.SourceManager.MusicLibrary, tracks => {
string msg = String.Format(
Catalog.GetPluralString(
// singular form unused b/c we know it's > 1, but we still need GetPlural
"The rescan operation will remove one track from your music library.",
"The rescan operation will remove {0} tracks from your music library.",
tracks),
tracks);
return(TrackActions.ConfirmRemove(msg));
});
}),
// Help Menu
new ActionEntry("HelpMenuAction", null,
Catalog.GetString("_Help"), null, null, null),
new ActionEntry("UserHelp", Gtk.Stock.Help,
Catalog.GetString("_Contents"), "F1", null,
delegate { Banshee.ServiceStack.Application.DisplayHelp(null); }),
new ActionEntry("WikiSearchHelpAction", null,
Catalog.GetString("Advanced Collection Searching"), null,
Catalog.GetString("Learn advanced ways to search your media collection"), delegate {
Banshee.Web.Browser.Open("http://banshee.fm/support/guide/searching/");
}),
new ActionEntry("WikiAction", null,
Catalog.GetString("Banshee _Home Page"), null,
Catalog.GetString("Visit the Banshee Home Page"), delegate {
Banshee.Web.Browser.Open("http://banshee.fm/");
}),
new ActionEntry("WikiDeveloperAction", null,
Catalog.GetString("_Get Involved"), null,
Catalog.GetString("Become a contributor to Banshee"), delegate {
Banshee.Web.Browser.Open("http://banshee.fm/contribute/");
}),
new ActionEntry("VersionInformationAction", null,
Catalog.GetString("_Version Information"), null,
Catalog.GetString("View detailed version and configuration information"), OnVersionInformation),
new ActionEntry("AboutAction", "gtk-about", OnAbout)
});
this["VersionInformationAction"].Visible = ApplicationContext.Debugging;
GLib.Timeout.Add(500, delegate {
if (ApplicationContext.CommandLine.Contains("show-import-media"))
{
OnImport(null, null);
}
if (ApplicationContext.CommandLine.Contains("show-about"))
{
OnAbout(null, null);
}
if (ApplicationContext.CommandLine.Contains("show-open-location"))
{
OnOpenLocation(null, null);
}
if (ApplicationContext.CommandLine.Contains("show-preferences"))
{
OnPreferences(null, null);
}
return(false);
});
}