Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Internal Refactoring: Move MySQL Help viewer into own xib with own co…
…ntroller
  • Loading branch information
dmoagx committed May 27, 2018
1 parent 99cb087 commit 56817be
Show file tree
Hide file tree
Showing 14 changed files with 1,130 additions and 757 deletions.
Expand Up @@ -100,6 +100,7 @@ - (NSString *)escapeString:(NSString *)theString includingQuotes:(BOOL)includeQu
NSData *escapedData;
if (includeQuotes) {

#warning This code assumes that the encoding cData is in is still ASCII-compatible which may not be the case (e.g. for UTF16, EBCDIC)
// Add quotes if requested
escBuffer[0] = '\'';
escBuffer[escapedLength+1] = '\'';
Expand Down
196 changes: 2 additions & 194 deletions Interfaces/English.lproj/DBView.xib

Large diffs are not rendered by default.

213 changes: 213 additions & 0 deletions Interfaces/English.lproj/HelpViewer.xib

Large diffs are not rendered by default.

19 changes: 14 additions & 5 deletions Resources/Templates/SPMySQLHelpTemplate.html
Expand Up @@ -2,12 +2,12 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>{{title}}</title>
<style type="text/css" media="all">
body {
margin: 2px;
padding: 10px;
font-family:'Helvetica';
font-family: 'Helvetica', 'Helvetica Neue', sans-serif;
font-size:9pt;
}

Expand All @@ -23,19 +23,28 @@
}

.description {
font-family: Monaco;
font-family: Monaco, monospace;
}

.example {
font-family: Courier;
font-family: Courier, monospace;
}

.header {
padding-bottom: 5px;
}

.nothing {
color: gray;
}

.error {
color: #ff415a;
font-family: monospace;
}
</style>
</head>
<body>
%@
{{body}}
</body>
</html>
40 changes: 0 additions & 40 deletions Source/SPCustomQuery.h
Expand Up @@ -31,17 +31,6 @@

#import "SPDatabaseContentViewDelegate.h"

#import <WebKit/WebKit.h>

#define SP_HELP_TOC_SEARCH_STRING @"contents"
#define SP_HELP_SEARCH_IN_MYSQL 0
#define SP_HELP_SEARCH_IN_PAGE 1
#define SP_HELP_SEARCH_IN_WEB 2
#define SP_HELP_GOBACK_BUTTON 0
#define SP_HELP_SHOW_TOC_BUTTON 1
#define SP_HELP_GOFORWARD_BUTTON 2
#define SP_HELP_NOT_AVAILABLE @"__no_help_available"

#define SP_SAVE_ALL_FAVORTITE_MENUITEM_TAG 100001
#define SP_SAVE_SELECTION_FAVORTITE_MENUITEM_TAG 100000
#define SP_FAVORITE_HEADER_MENUITEM_TAG 200000
Expand Down Expand Up @@ -122,12 +111,6 @@
#ifndef SP_CODA
IBOutlet NSMenuItem *previousHistoryMenuItem;
IBOutlet NSMenuItem *nextHistoryMenuItem;
IBOutlet NSWindow *helpWebViewWindow;
IBOutlet WebView *helpWebView;
IBOutlet NSSearchField *helpSearchField;
IBOutlet NSSearchFieldCell *helpSearchFieldCell;
IBOutlet NSSegmentedControl *helpNavigator;
IBOutlet NSSegmentedControl *helpTargetSelector;
#endif

IBOutlet NSButton *queryInfoButton;
Expand All @@ -145,17 +128,10 @@
NSArray *currentQueryRanges;
BOOL currentQueryBeforeCaret;

NSString *mySQLversion;
NSTableColumn *sortColumn;

NSUInteger queryStartPosition;

#ifndef SP_CODA
NSUInteger helpTarget;
WebHistory *helpHistory;
NSString *helpHTMLTemplate;
#endif

SPDataStorage *resultData;
pthread_mutex_t resultDataLock;
NSArray *cqColumnDefinition;
Expand Down Expand Up @@ -213,17 +189,6 @@
- (IBAction)chooseQueryHistory:(id)sender;
- (IBAction)closeSheet:(id)sender;
- (IBAction)gearMenuItemSelected:(id)sender;
#ifndef SP_CODA
- (IBAction)showHelpForCurrentWord:(id)sender;
- (IBAction)showHelpForSearchString:(id)sender;
- (IBAction)helpSegmentDispatcher:(id)sender;
- (IBAction)helpTargetDispatcher:(id)sender;
- (IBAction)helpSearchFindNextInPage:(id)sender;
- (IBAction)helpSearchFindPreviousInPage:(id)sender;
- (IBAction)helpSelectHelpTargetMySQL:(id)sender;
- (IBAction)helpSelectHelpTargetPage:(id)sender;
- (IBAction)helpSelectHelpTargetWeb:(id)sender;
#endif
- (IBAction)filterQueryFavorites:(id)sender;
- (IBAction)filterQueryHistory:(id)sender;
- (IBAction)saveQueryHistory:(id)sender;
Expand Down Expand Up @@ -268,11 +233,6 @@
#ifndef SP_CODA
// MySQL Help
- (void)showAutoHelpForCurrentWord:(id)sender;
- (NSString *)getHTMLformattedMySQLHelpFor:(NSString *)searchString calledByAutoHelp:(BOOL)autoHelp;
- (void)showHelpFor:(NSString *)aString addToHistory:(BOOL)addToHistory calledByAutoHelp:(BOOL)autoHelp;
- (void)helpTargetValidation;
- (void)openMySQLonlineDocumentationWithString:(NSString *)searchString;
- (NSWindow *)helpWebViewWindow;
#endif
- (void)setMySQLversion:(NSString *)theVersion;

Expand Down

0 comments on commit 56817be

Please sign in to comment.