Skip to content

Commit

Permalink
add help / Keyboard Shortcuts (for #3768)
Browse files Browse the repository at this point in the history
  • Loading branch information
kjk committed Oct 17, 2023
1 parent a97a727 commit f65d9d1
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ vs2022/.vs/
.vscode/ipch/
bin/cmapdump.exe
drmemlogs/
src/utils/BuildConfig.h
# src/utils/BuildConfig.h
build-log.txt
analyze-output.txt
analyze-errors.html
Expand Down
2 changes: 2 additions & 0 deletions src/CommandPalette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ static i32 gDocumentNotOpenWhitelist[] = {
CmdChangeLanguage,
CmdCheckUpdate,
CmdHelpOpenManualInBrowser,
CmdHelpOpenKeyboardShortcutsInBrowser,
CmdHelpVisitWebsite,
CmdHelpAbout,
CmdDebugDownloadSymbols,
Expand Down Expand Up @@ -107,6 +108,7 @@ static i32 gCommandsNoActivate[] = {
CmdChangeLanguage,
CmdHelpAbout,
CmdHelpOpenManualInBrowser,
CmdHelpOpenKeyboardShortcutsInBrowser,
CmdHelpVisitWebsite,
CmdOpenFile,
CmdOpenFolder,
Expand Down
1 change: 1 addition & 0 deletions src/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ Cmd* enum (e.g. CmdOpen) and a human-readable name (not used yet).
V(CmdChangeLanguage, "Change Language...") \
V(CmdCheckUpdate, "Check For Updates") \
V(CmdHelpOpenManualInBrowser, "Help: Manual") \
V(CmdHelpOpenKeyboardShortcutsInBrowser, "Help: Keyboard Shortcuts") \
V(CmdHelpVisitWebsite, "Help: SumatraPDF Website") \
V(CmdHelpAbout, "Help: About SumatraPDF") \
V(CmdMoveFrameFocus, "Move Frame Focus") \
Expand Down
5 changes: 5 additions & 0 deletions src/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,10 @@ static MenuDef menuDefHelp[] = {
_TRN("&Manual"),
CmdHelpOpenManualInBrowser,
},
{
_TRN("&Keyboard Shortcuts"),
CmdHelpOpenKeyboardShortcutsInBrowser
},
{
_TRN("Check for &Updates"),
CmdCheckUpdate,
Expand Down Expand Up @@ -891,6 +895,7 @@ UINT_PTR removeIfNoInternetPerms[] = {
CmdSearchSelectionWithBing,
CmdHelpVisitWebsite,
CmdHelpOpenManualInBrowser,
CmdHelpOpenKeyboardShortcutsInBrowser,
CmdContributeTranslation,
0,
};
Expand Down
4 changes: 2 additions & 2 deletions src/SumatraAbout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ struct AboutLayoutInfoEl {
};

static AboutLayoutInfoEl gAboutLayoutInfo[] = {
{"website", "SumatraPDF website", WEBSITE_MAIN_URL},
{"manual", "SumatraPDF manual", WEBSITE_MANUAL_URL},
{"website", "SumatraPDF website", kWebsiteURL},
{"manual", "SumatraPDF manual", kManualURL},
{"forums", "SumatraPDF forums", "https://github.com/sumatrapdfreader/sumatrapdf/discussions"},
{"programming", "The Programmers", URL_AUTHORS},
{"translations", "The Translators", URL_TRANSLATORS},
Expand Down
10 changes: 7 additions & 3 deletions src/SumatraPDF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5130,15 +5130,19 @@ static LRESULT FrameOnCommand(MainWindow* win, HWND hwnd, UINT msg, WPARAM wp, L
break;

case CmdHelpVisitWebsite:
SumatraLaunchBrowser(WEBSITE_MAIN_URL);
SumatraLaunchBrowser(kWebsiteURL);
break;

case CmdHelpOpenManualInBrowser:
SumatraLaunchBrowser(WEBSITE_MANUAL_URL);
SumatraLaunchBrowser(kManualURL);
break;

case CmdHelpOpenKeyboardShortcutsInBrowser:
SumatraLaunchBrowser(kManualKeyboardShortcutsURL);
break;

case CmdContributeTranslation:
SumatraLaunchBrowser(WEBSITE_TRANSLATIONS_URL);
SumatraLaunchBrowser(kContributeTranslationsURL);
break;

case CmdHelpAbout:
Expand Down
7 changes: 4 additions & 3 deletions src/SumatraPDF.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
#define CANVAS_CLASS_NAME L"SUMATRA_PDF_CANVAS"
#define FRAME_CLASS_NAME L"SUMATRA_PDF_FRAME"

#define WEBSITE_MAIN_URL "https://www.sumatrapdfreader.org/"
#define WEBSITE_MANUAL_URL "https://www.sumatrapdfreader.org/manual"
#define WEBSITE_TRANSLATIONS_URL "https://www.sumatrapdfreader.org/docs/Contribute-translation"
constexpr const char* kWebsiteURL = "https://www.sumatrapdfreader.org/";
constexpr const char* kManualURL = "https://www.sumatrapdfreader.org/manual";
constexpr const char* kManualKeyboardShortcutsURL = "https://www.sumatrapdfreader.org/docs/Keyboard-shortcuts";
constexpr const char* kContributeTranslationsURL = "https://www.sumatrapdfreader.org/docs/Contribute-translation";

#ifndef CRASH_REPORT_URL
#define CRASH_REPORT_URL "https://www.sumatrapdfreader.org/docs/Contribute-to-SumatraPDF"
Expand Down
3 changes: 0 additions & 3 deletions src/utils/BuildConfig.h
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
#define GIT_COMMIT_ID 728fd51a7074bb7b23b585967c51b06fadd4332a
#define BUILT_ON 2023 - 09 - 24
#define PRE_RELEASE_VER 15665

0 comments on commit f65d9d1

Please sign in to comment.