From 592826f94abc105ec78660d5aeaefbef19ae0a17 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Wed, 1 Jun 2016 15:09:46 +0300 Subject: [PATCH] close issue #155, close issue #156, partial fix for issue #154 --- src/dlangide/ui/commands.d | 2 ++ src/dlangide/ui/frame.d | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/dlangide/ui/commands.d b/src/dlangide/ui/commands.d index 2861cba..fe36f9b 100644 --- a/src/dlangide/ui/commands.d +++ b/src/dlangide/ui/commands.d @@ -45,6 +45,7 @@ enum IDEActions : int { DebugStepOut, HelpAbout, + HelpViewHelp, WindowCloseDocument, WindowCloseAllDocuments, CreateNewWorkspace, @@ -127,6 +128,7 @@ const Action ACTION_EDIT_TOGGLE_LINE_COMMENT = (new Action(EditorActions.ToggleL const Action ACTION_EDIT_TOGGLE_BLOCK_COMMENT = (new Action(EditorActions.ToggleBlockComment, "MENU_EDIT_TOGGLE_BLOCK_COMMENT"c, null, KeyCode.KEY_DIVIDE, KeyFlag.Control|KeyFlag.Shift)).disableByDefault(); const Action ACTION_EDIT_PREFERENCES = (new Action(IDEActions.EditPreferences, "MENU_EDIT_PREFERENCES"c, null)).disableByDefault(); const Action ACTION_HELP_ABOUT = new Action(IDEActions.HelpAbout, "MENU_HELP_ABOUT"c); +const Action ACTION_HELP_VIEW_HELP = new Action(IDEActions.HelpViewHelp, "MENU_HELP_VIEW_HELP"c); const Action ACTION_WINDOW_CLOSE_DOCUMENT = new Action(IDEActions.WindowCloseDocument, "MENU_WINDOW_CLOSE_DOCUMENT"c, null, KeyCode.KEY_W, KeyFlag.Control); const Action ACTION_WINDOW_CLOSE_ALL_DOCUMENTS = new Action(IDEActions.WindowCloseAllDocuments, "MENU_WINDOW_CLOSE_ALL_DOCUMENTS"c); diff --git a/src/dlangide/ui/frame.d b/src/dlangide/ui/frame.d index fe93e98..ffe6e06 100644 --- a/src/dlangide/ui/frame.d +++ b/src/dlangide/ui/frame.d @@ -44,6 +44,10 @@ import std.array : empty; import std.string : split; import std.path; +immutable string HELP_PAGE_URL = "https://github.com/buggins/dlangide/wiki"; +// TODO: get version from GIT commit +immutable dstring DLANGIDE_VERSION = "v0.6.8"d; + bool isSupportedSourceTextFileFormat(string filename) { return (filename.endsWith(".d") || filename.endsWith(".txt") || filename.endsWith(".cpp") || filename.endsWith(".h") || filename.endsWith(".c") || filename.endsWith(".json") || filename.endsWith(".dd") || filename.endsWith(".ddoc") || filename.endsWith(".xml") || filename.endsWith(".html") @@ -666,11 +670,11 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL MenuItem windowItem = new MenuItem(new Action(3, "MENU_WINDOW"c)); - windowItem.add(new Action(30, "MENU_WINDOW_PREFERENCES")); + //windowItem.add(new Action(30, "MENU_WINDOW_PREFERENCES")); windowItem.add(ACTION_WINDOW_CLOSE_DOCUMENT); windowItem.add(ACTION_WINDOW_CLOSE_ALL_DOCUMENTS); MenuItem helpItem = new MenuItem(new Action(4, "MENU_HELP"c)); - helpItem.add(new Action(40, "MENU_HELP_VIEW_HELP")); + helpItem.add(ACTION_HELP_VIEW_HELP); helpItem.add(ACTION_HELP_ABOUT); mainMenuItems.add(fileItem); mainMenuItems.add(editItem); @@ -846,8 +850,11 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL if (onCanClose()) window.close(); return true; + case IDEActions.HelpViewHelp: + Platform.instance.openURL(HELP_PAGE_URL); + return true; case IDEActions.HelpAbout: - window.showMessageBox(UIString("About DlangIDE"d), + window.showMessageBox(UIString("About DlangIDE "d ~ DLANGIDE_VERSION), UIString("DLangIDE\n(C) Vadim Lopatin, 2014\nhttp://github.com/buggins/dlangide\nIDE for D programming language written in D\nUses DlangUI library for GUI"d)); return true; case StandardAction.OpenUrl: