Skip to content

Commit 56817be

Browse files
committed
Internal Refactoring: Move MySQL Help viewer into own xib with own controller
1 parent 99cb087 commit 56817be

File tree

14 files changed

+1130
-757
lines changed

14 files changed

+1130
-757
lines changed

Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Querying & Preparation.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ - (NSString *)escapeString:(NSString *)theString includingQuotes:(BOOL)includeQu
100100
NSData *escapedData;
101101
if (includeQuotes) {
102102

103+
#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)
103104
// Add quotes if requested
104105
escBuffer[0] = '\'';
105106
escBuffer[escapedLength+1] = '\'';

Interfaces/English.lproj/DBView.xib

Lines changed: 2 additions & 194 deletions
Large diffs are not rendered by default.

Interfaces/English.lproj/HelpViewer.xib

Lines changed: 213 additions & 0 deletions
Large diffs are not rendered by default.

Resources/Templates/SPMySQLHelpTemplate.html

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<html>
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5-
5+
<title>{{title}}</title>
66
<style type="text/css" media="all">
77
body {
88
margin: 2px;
99
padding: 10px;
10-
font-family:'Helvetica';
10+
font-family: 'Helvetica', 'Helvetica Neue', sans-serif;
1111
font-size:9pt;
1212
}
1313

@@ -23,19 +23,28 @@
2323
}
2424

2525
.description {
26-
font-family: Monaco;
26+
font-family: Monaco, monospace;
2727
}
2828

2929
.example {
30-
font-family: Courier;
30+
font-family: Courier, monospace;
3131
}
3232

3333
.header {
3434
padding-bottom: 5px;
3535
}
36+
37+
.nothing {
38+
color: gray;
39+
}
40+
41+
.error {
42+
color: #ff415a;
43+
font-family: monospace;
44+
}
3645
</style>
3746
</head>
3847
<body>
39-
%@
48+
{{body}}
4049
</body>
4150
</html>

Source/SPCustomQuery.h

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,6 @@
3131

3232
#import "SPDatabaseContentViewDelegate.h"
3333

34-
#import <WebKit/WebKit.h>
35-
36-
#define SP_HELP_TOC_SEARCH_STRING @"contents"
37-
#define SP_HELP_SEARCH_IN_MYSQL 0
38-
#define SP_HELP_SEARCH_IN_PAGE 1
39-
#define SP_HELP_SEARCH_IN_WEB 2
40-
#define SP_HELP_GOBACK_BUTTON 0
41-
#define SP_HELP_SHOW_TOC_BUTTON 1
42-
#define SP_HELP_GOFORWARD_BUTTON 2
43-
#define SP_HELP_NOT_AVAILABLE @"__no_help_available"
44-
4534
#define SP_SAVE_ALL_FAVORTITE_MENUITEM_TAG 100001
4635
#define SP_SAVE_SELECTION_FAVORTITE_MENUITEM_TAG 100000
4736
#define SP_FAVORITE_HEADER_MENUITEM_TAG 200000
@@ -122,12 +111,6 @@
122111
#ifndef SP_CODA
123112
IBOutlet NSMenuItem *previousHistoryMenuItem;
124113
IBOutlet NSMenuItem *nextHistoryMenuItem;
125-
IBOutlet NSWindow *helpWebViewWindow;
126-
IBOutlet WebView *helpWebView;
127-
IBOutlet NSSearchField *helpSearchField;
128-
IBOutlet NSSearchFieldCell *helpSearchFieldCell;
129-
IBOutlet NSSegmentedControl *helpNavigator;
130-
IBOutlet NSSegmentedControl *helpTargetSelector;
131114
#endif
132115

133116
IBOutlet NSButton *queryInfoButton;
@@ -145,17 +128,10 @@
145128
NSArray *currentQueryRanges;
146129
BOOL currentQueryBeforeCaret;
147130

148-
NSString *mySQLversion;
149131
NSTableColumn *sortColumn;
150132

151133
NSUInteger queryStartPosition;
152134

153-
#ifndef SP_CODA
154-
NSUInteger helpTarget;
155-
WebHistory *helpHistory;
156-
NSString *helpHTMLTemplate;
157-
#endif
158-
159135
SPDataStorage *resultData;
160136
pthread_mutex_t resultDataLock;
161137
NSArray *cqColumnDefinition;
@@ -213,17 +189,6 @@
213189
- (IBAction)chooseQueryHistory:(id)sender;
214190
- (IBAction)closeSheet:(id)sender;
215191
- (IBAction)gearMenuItemSelected:(id)sender;
216-
#ifndef SP_CODA
217-
- (IBAction)showHelpForCurrentWord:(id)sender;
218-
- (IBAction)showHelpForSearchString:(id)sender;
219-
- (IBAction)helpSegmentDispatcher:(id)sender;
220-
- (IBAction)helpTargetDispatcher:(id)sender;
221-
- (IBAction)helpSearchFindNextInPage:(id)sender;
222-
- (IBAction)helpSearchFindPreviousInPage:(id)sender;
223-
- (IBAction)helpSelectHelpTargetMySQL:(id)sender;
224-
- (IBAction)helpSelectHelpTargetPage:(id)sender;
225-
- (IBAction)helpSelectHelpTargetWeb:(id)sender;
226-
#endif
227192
- (IBAction)filterQueryFavorites:(id)sender;
228193
- (IBAction)filterQueryHistory:(id)sender;
229194
- (IBAction)saveQueryHistory:(id)sender;
@@ -268,11 +233,6 @@
268233
#ifndef SP_CODA
269234
// MySQL Help
270235
- (void)showAutoHelpForCurrentWord:(id)sender;
271-
- (NSString *)getHTMLformattedMySQLHelpFor:(NSString *)searchString calledByAutoHelp:(BOOL)autoHelp;
272-
- (void)showHelpFor:(NSString *)aString addToHistory:(BOOL)addToHistory calledByAutoHelp:(BOOL)autoHelp;
273-
- (void)helpTargetValidation;
274-
- (void)openMySQLonlineDocumentationWithString:(NSString *)searchString;
275-
- (NSWindow *)helpWebViewWindow;
276236
#endif
277237
- (void)setMySQLversion:(NSString *)theVersion;
278238

0 commit comments

Comments
 (0)