aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Interfaces/English.lproj/DBView.xib122
-rw-r--r--Source/CMTextView.m2
-rw-r--r--Source/TableDocument.h2
-rw-r--r--Source/TableDocument.m369
-rw-r--r--Source/TablesList.m17
5 files changed, 389 insertions, 123 deletions
diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib
index 68f621b8..47e08691 100644
--- a/Interfaces/English.lproj/DBView.xib
+++ b/Interfaces/English.lproj/DBView.xib
@@ -24,7 +24,6 @@
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="6885"/>
- <integer value="6180"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2144,7 +2143,7 @@
<object class="NSTabViewItem" id="624106058">
<string key="NSIdentifier">content</string>
<object class="NSView" key="NSView" id="1013108064">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder" ref="714795046"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2884,6 +2883,7 @@
</object>
</object>
<string key="NSFrame">{{10, 7}, {706, 544}}</string>
+ <reference key="NSSuperview" ref="714795046"/>
</object>
<string key="NSLabel">Content</string>
<reference key="NSColor" ref="62854682"/>
@@ -3807,7 +3807,7 @@
<object class="NSTabViewItem" id="94659530">
<string key="NSIdentifier">status</string>
<object class="NSView" key="NSView" id="730602982">
- <reference key="NSNextResponder" ref="714795046"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -4610,7 +4610,6 @@
</object>
</object>
<string key="NSFrame">{{10, 7}, {706, 544}}</string>
- <reference key="NSSuperview" ref="714795046"/>
</object>
<string key="NSLabel">Status</string>
<reference key="NSColor" ref="62854682"/>
@@ -5445,14 +5444,14 @@
<reference key="NSTabView" ref="714795046"/>
</object>
</object>
- <reference key="NSSelectedTabViewItem" ref="94659530"/>
+ <reference key="NSSelectedTabViewItem" ref="624106058"/>
<reference key="NSFont" ref="26"/>
<int key="NSTvFlags">134217731</int>
<bool key="NSAllowTruncatedLabels">YES</bool>
<bool key="NSDrawsBackground">YES</bool>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="730602982"/>
+ <reference ref="1013108064"/>
</object>
</object>
</object>
@@ -8725,7 +8724,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
<string key="NSWindowContentMinSize">{213, 107}</string>
<object class="NSView" key="NSWindowView" id="860968037">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -8734,7 +8733,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="NSvFlags">264</int>
<string key="NSFrame">{{20, 233}, {140, 14}}</string>
<reference key="NSSuperview" ref="860968037"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="326519111">
<int key="NSCellFlags">67239424</int>
@@ -8761,7 +8759,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="NSvFlags">2322</int>
<string key="NSFrameSize">{352, 14}</string>
<reference key="NSSuperview" ref="158897172"/>
- <reference key="NSWindow"/>
<object class="NSTextContainer" key="NSTextContainer" id="197710090">
<object class="NSLayoutManager" key="NSLayoutManager">
<object class="NSTextStorage" key="NSTextStorage">
@@ -8811,7 +8808,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<string key="NSFrame">{{1, 1}, {352, 178}}</string>
<reference key="NSSuperview" ref="972781700"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="347971361"/>
<reference key="NSDocView" ref="347971361"/>
<reference key="NSBGColor" ref="449903125"/>
@@ -8823,7 +8819,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{353, 1}, {11, 178}}</string>
<reference key="NSSuperview" ref="972781700"/>
- <reference key="NSWindow"/>
<int key="NSsFlags">256</int>
<reference key="NSTarget" ref="972781700"/>
<string key="NSAction">_doScroller:</string>
@@ -8834,7 +8829,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{-100, -100}, {87, 18}}</string>
<reference key="NSSuperview" ref="972781700"/>
- <reference key="NSWindow"/>
<int key="NSsFlags">257</int>
<reference key="NSTarget" ref="972781700"/>
<string key="NSAction">_doScroller:</string>
@@ -8844,7 +8838,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<string key="NSFrame">{{20, 45}, {365, 180}}</string>
<reference key="NSSuperview" ref="860968037"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="158897172"/>
<int key="NSsFlags">18</int>
<reference key="NSVScroller" ref="84024470"/>
@@ -8856,7 +8849,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="NSvFlags">257</int>
<string key="NSFrame">{{314, 13}, {76, 28}}</string>
<reference key="NSSuperview" ref="860968037"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="693776804">
<int key="NSCellFlags">67239424</int>
@@ -8878,7 +8870,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="NSvFlags">257</int>
<string key="NSFrame">{{350, -130}, {80, 28}}</string>
<reference key="NSSuperview" ref="860968037"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="725784088">
<int key="NSCellFlags">67239424</int>
@@ -8897,8 +8888,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
</object>
<string key="NSFrameSize">{405, 267}</string>
- <reference key="NSSuperview"/>
- <reference key="NSWindow"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMinSize">{213, 129}</string>
@@ -11430,6 +11419,26 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="NSvFlags">268</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSButton" id="513459867">
+ <reference key="NSNextResponder" ref="260025442"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{270, -32}, {58, 28}}</string>
+ <reference key="NSSuperview" ref="260025442"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="828761093">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134348800</int>
+ <string key="NSContents">Copy</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="513459867"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">268435585</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent">c</string>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
<object class="NSScrollView" id="880498064">
<reference key="NSNextResponder" ref="260025442"/>
<int key="NSvFlags">274</int>
@@ -11443,7 +11452,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="NSTableView" id="999861934">
<reference key="NSNextResponder" ref="361281463"/>
<int key="NSvFlags">256</int>
- <string key="NSFrameSize">{358, 117}</string>
+ <string key="NSFrameSize">{358, 139}</string>
<reference key="NSSuperview" ref="361281463"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTableHeaderView" key="NSHeaderView" id="956714173">
@@ -11479,9 +11488,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<object class="NSTextFieldCell" key="NSDataCell" id="924386780">
<int key="NSCellFlags">337772096</int>
- <int key="NSCellFlags2">2048</int>
+ <int key="NSCellFlags2">133120</int>
<string key="NSContents">Text Cell</string>
- <reference key="NSSupport" ref="244931163"/>
+ <reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="999861934"/>
<reference key="NSBackgroundColor" ref="1024678221"/>
<reference key="NSTextColor" ref="454249633"/>
@@ -11498,16 +11507,16 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="NSTableHeaderCell" key="NSHeaderCell">
<int key="NSCellFlags">75628096</int>
<int key="NSCellFlags2">2048</int>
- <string key="NSContents">Status</string>
+ <string key="NSContents"/>
<reference key="NSSupport" ref="26"/>
<reference key="NSBackgroundColor" ref="960642700"/>
<reference key="NSTextColor" ref="222976159"/>
</object>
<object class="NSTextFieldCell" key="NSDataCell" id="229315620">
<int key="NSCellFlags">337772096</int>
- <int key="NSCellFlags2">2048</int>
+ <int key="NSCellFlags2">133120</int>
<string key="NSContents">Text Cell</string>
- <reference key="NSSupport" ref="244931163"/>
+ <reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="999861934"/>
<reference key="NSBackgroundColor" ref="1024678221"/>
<reference key="NSTextColor" ref="454249633"/>
@@ -11531,9 +11540,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<object class="NSTextFieldCell" key="NSDataCell" id="635109389">
<int key="NSCellFlags">337772096</int>
- <int key="NSCellFlags2">2048</int>
+ <int key="NSCellFlags2">133120</int>
<string key="NSContents">Text Cell</string>
- <reference key="NSSupport" ref="244931163"/>
+ <reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="999861934"/>
<reference key="NSBackgroundColor" ref="1024678221"/>
<reference key="NSTextColor" ref="454249633"/>
@@ -11555,7 +11564,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
</object>
<reference key="NSGridColor" ref="864903678"/>
- <double key="NSRowHeight">17</double>
+ <double key="NSRowHeight">14</double>
<int key="NSTvFlags">1388314624</int>
<reference key="NSDelegate"/>
<reference key="NSDataSource"/>
@@ -11568,7 +11577,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="NSTableViewDraggingDestinationStyle">1</int>
</object>
</object>
- <string key="NSFrame">{{1, 17}, {358, 117}}</string>
+ <string key="NSFrame">{{1, 17}, {358, 139}}</string>
<reference key="NSSuperview" ref="880498064"/>
<reference key="NSNextKeyView" ref="999861934"/>
<reference key="NSDocView" ref="999861934"/>
@@ -11611,7 +11620,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<reference ref="907428034"/>
</object>
- <string key="NSFrameSize">{360, 135}</string>
+ <string key="NSFrameSize">{360, 157}</string>
<reference key="NSSuperview" ref="260025442"/>
<reference key="NSNextKeyView" ref="361281463"/>
<int key="NSsFlags">562</int>
@@ -11620,10 +11629,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference key="NSContentView" ref="361281463"/>
<reference key="NSHeaderClipView" ref="107516071"/>
<reference key="NSCornerView" ref="907428034"/>
- <bytes key="NSScrollAmts">QSAAAEEgAABBmAAAQZgAAA</bytes>
+ <bytes key="NSScrollAmts">QSAAAEEgAABBgAAAQYAAAA</bytes>
</object>
</object>
- <string key="NSFrameSize">{360, 135}</string>
+ <string key="NSFrameSize">{360, 157}</string>
<reference key="NSSuperview"/>
<string key="NSClassName">NSView</string>
</object>
@@ -16140,6 +16149,22 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<int key="connectionID">6900</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">statusTableCopyChecksum</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="513459867"/>
+ </object>
+ <int key="connectionID">6903</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">copyChecksumFromSheet:</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="513459867"/>
+ </object>
+ <int key="connectionID">6904</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -22604,6 +22629,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="880498064"/>
+ <reference ref="513459867"/>
</object>
<reference key="parent" ref="0"/>
<string key="objectName">statusTable Accessory View</string>
@@ -22712,6 +22738,20 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference key="object" ref="635109389"/>
<reference key="parent" ref="140803099"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6901</int>
+ <reference key="object" ref="513459867"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="828761093"/>
+ </object>
+ <reference key="parent" ref="260025442"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6902</int>
+ <reference key="object" ref="828761093"/>
+ <reference key="parent" ref="513459867"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -24086,7 +24126,11 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>6892.IBPluginDependency</string>
<string>6893.IBPluginDependency</string>
<string>6894.IBPluginDependency</string>
+ <string>6895.IBPluginDependency</string>
+ <string>6896.IBPluginDependency</string>
<string>69.ImportedFromIB2</string>
+ <string>6901.IBPluginDependency</string>
+ <string>6902.IBPluginDependency</string>
<string>711.IBPluginDependency</string>
<string>711.ImportedFromIB2</string>
<string>713.IBPluginDependency</string>
@@ -24896,11 +24940,11 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{51, 206}, {944, 550}}</string>
+ <string>{{402, -257}, {944, 550}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<boolean value="NO"/>
- <string>{{51, 206}, {944, 550}}</string>
+ <string>{{402, -257}, {944, 550}}</string>
<integer value="1"/>
<integer value="1"/>
<string>{{62, 352}, {845, 504}}</string>
@@ -26066,7 +26110,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<integer value="1040"/>
<boolean value="NO"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{92, 444}, {360, 135}}</string>
+ <string>{{79, 571}, {360, 157}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -26079,6 +26125,8 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
@@ -26221,7 +26269,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">6900</int>
+ <int key="maxID">6907</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -28218,6 +28266,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>closePanelSheet:</string>
<string>closePasswordSheet:</string>
<string>closeSheet:</string>
+ <string>copyChecksumFromSheet:</string>
<string>copyCreateTableSyntax:</string>
<string>copyCreateTableSyntaxFromSheet:</string>
<string>export:</string>
@@ -28290,6 +28339,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
@@ -28332,7 +28382,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>sidebarGrabber</string>
<string>spHistoryControllerInstance</string>
<string>statusTableAccessoryView</string>
+ <string>statusTableCopyChecksum</string>
<string>statusTableView</string>
+ <string>statusValues</string>
<string>tableContentInstance</string>
<string>tableDataInstance</string>
<string>tableDumpInstance</string>
@@ -28397,6 +28449,8 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
+ <string>id</string>
<string>NSButton</string>
<string>NSTableView</string>
<string>NSSplitView</string>
diff --git a/Source/CMTextView.m b/Source/CMTextView.m
index 7d140ccb..4a226ef5 100644
--- a/Source/CMTextView.m
+++ b/Source/CMTextView.m
@@ -1190,7 +1190,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
if([selTables count])
[theHintString replaceCharactersInRange:r withString:[selTables componentsJoinedAndBacktickQuoted]];
else
- [theHintString replaceCharactersInRange:r withString:@"<tables>"];
+ [theHintString replaceCharactersInRange:r withString:@"$SP_SELECTED_TABLE"];
}
[theHintString flushCachedRegexData];
}
diff --git a/Source/TableDocument.h b/Source/TableDocument.h
index 74aa3402..e897ed36 100644
--- a/Source/TableDocument.h
+++ b/Source/TableDocument.h
@@ -52,6 +52,7 @@
IBOutlet id statusTableAccessoryView;
IBOutlet id statusTableView;
+ IBOutlet id statusTableCopyChecksum;
IBOutlet SPUserManager *userManagerInstance;
@@ -243,6 +244,7 @@
- (IBAction)closePasswordSheet:(id)sender;
- (IBAction)backForwardInHistory:(id)sender;
- (IBAction)showUserManager:(id)sender;
+- (IBAction)copyChecksumFromSheet:(id)sender;
- (void)showConsole:(id)sender;
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index d940e39a..69e3a337 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -1929,8 +1929,6 @@
[alert setAccessoryView:statusTableAccessoryView];
[alert beginSheetModalForWindow:tableWindow modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:@"statusError"];
}
-
-
}
/**
@@ -1938,17 +1936,26 @@
*/
- (IBAction)analyzeTable:(id)sender
{
- MCPResult *theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"ANALYZE TABLE %@", [[self table] backtickQuotedString]]];
+
+ NSArray *selectedItems = [tablesListInstance selectedTableItems];
+ id message = nil;
+
+ if([selectedItems count] == 0) return;
+
+ MCPResult *theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"ANALYZE TABLE %@", [selectedItems componentsJoinedAndBacktickQuoted]]];
+
+ NSString *what = ([selectedItems count]>1) ? NSLocalizedString(@"selected items", @"selected items") : [NSString stringWithFormat:@"%@ '%@'", NSLocalizedString(@"table", @"table"), [self table]];
// Check for errors, only displaying if the connection hasn't been terminated
if (![[mySQLConnection getLastErrorMessage] isEqualToString:@""]) {
+ NSString *mText = ([selectedItems count]>1) ? NSLocalizedString(@"Unable to analyze selected items", @"unable to analyze selected items message") : NSLocalizedString(@"Unable to analyze table", @"unable to analyze table message");
if ([mySQLConnection isConnected]) {
- [[NSAlert alertWithMessageText:@"Unable to analyze table"
+ [[NSAlert alertWithMessageText:mText
defaultButton:@"OK"
alternateButton:nil
otherButton:nil
- informativeTextWithFormat:[NSString stringWithFormat:@"An error occurred while trying to analyze the table '%@'. Please try again.\n\n%@", [self table], [mySQLConnection getLastErrorMessage]]]
+ informativeTextWithFormat:[NSString stringWithFormat:NSLocalizedString(@"An error occurred while analyzing the %@.\n\nMySQL said:%@",@"an error occurred while analyzing the %@.\n\nMySQL said:%@"), what, [mySQLConnection getLastErrorMessage]]]
beginSheetModalForWindow:tableWindow
modalDelegate:self
didEndSelector:NULL
@@ -1958,24 +1965,47 @@
return;
}
- // Process result
- NSDictionary *result = [[theResult fetch2DResultAsType:MCPTypeDictionary] lastObject];
+ NSDictionary *result = [theResult fetch2DResultAsType:MCPTypeDictionary];
+ BOOL statusOK = YES;
+ for(id res in result) {
+ if(![[res objectForKey:@"Msg_type"] isEqualToString:@"status"]) {
+ statusOK = NO;
+ break;
+ }
+ }
- NSString *message = @"";
+ // Process result
+ if([selectedItems count] == 1) {
+ message = @"";
- message = ([[result objectForKey:@"Msg_type"] isEqualToString:@"status"]) ? @"Successfully analyzed table" : @"Analyze table failed.";
+ NSDictionary *lastresult = [[theResult fetch2DResultAsType:MCPTypeDictionary] lastObject];
- message = [NSString stringWithFormat:@"%@\n\nMySQL said: %@", message, [result objectForKey:@"Msg_text"]];
+ message = ([[lastresult objectForKey:@"Msg_type"] isEqualToString:@"status"]) ? NSLocalizedString(@"Successfully analyzed table.",@"analyze table successfully passed message") : NSLocalizedString(@"Analyze table failed.", @"analyze table failed message");
- [[NSAlert alertWithMessageText:[NSString stringWithFormat:@"Analyze table '%@'", [self table]]
- defaultButton:@"OK"
- alternateButton:nil
- otherButton:nil
- informativeTextWithFormat:message]
- beginSheetModalForWindow:tableWindow
- modalDelegate:self
- didEndSelector:NULL
- contextInfo:NULL];
+ message = [NSString stringWithFormat:@"%@\n\nMySQL said: %@", message, [lastresult objectForKey:@"Msg_text"]];
+ } else if(statusOK) {
+ message = NSLocalizedString(@"Successfully analyzed all selected items.",@"successfully analyzed all selected items message");
+ }
+
+ if(message) {
+ [[NSAlert alertWithMessageText:[NSString stringWithFormat:@"Analyze %@", what]
+ defaultButton:@"OK"
+ alternateButton:nil
+ otherButton:nil
+ informativeTextWithFormat:message]
+ beginSheetModalForWindow:tableWindow
+ modalDelegate:self
+ didEndSelector:NULL
+ contextInfo:NULL];
+ } else {
+ message = NSLocalizedString(@"MySQL said:",@"mysql said message");
+ statusValues = [result retain];
+ NSAlert *alert = [[NSAlert new] autorelease];
+ [alert setInformativeText:message];
+ [alert setMessageText:NSLocalizedString(@"Error while analyzing selected items", @"error while analyzing selected items message")];
+ [alert setAccessoryView:statusTableAccessoryView];
+ [alert beginSheetModalForWindow:tableWindow modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:@"statusError"];
+ }
}
/**
@@ -1983,17 +2013,26 @@
*/
- (IBAction)optimizeTable:(id)sender
{
- MCPResult *theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"OPTIMIZE TABLE %@", [[self table] backtickQuotedString]]];
+
+ NSArray *selectedItems = [tablesListInstance selectedTableItems];
+ id message = nil;
+
+ if([selectedItems count] == 0) return;
+
+ MCPResult *theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"OPTIMIZE TABLE %@", [selectedItems componentsJoinedAndBacktickQuoted]]];
+
+ NSString *what = ([selectedItems count]>1) ? NSLocalizedString(@"selected items", @"selected items") : [NSString stringWithFormat:@"%@ '%@'", NSLocalizedString(@"table", @"table"), [self table]];
// Check for errors, only displaying if the connection hasn't been terminated
if (![[mySQLConnection getLastErrorMessage] isEqualToString:@""]) {
+ NSString *mText = ([selectedItems count]>1) ? NSLocalizedString(@"Unable to optimze selected items", @"unable to optimze selected items message") : NSLocalizedString(@"Unable to optimze table", @"unable to optimze table message");
if ([mySQLConnection isConnected]) {
- [[NSAlert alertWithMessageText:@"Unable to optimize table"
+ [[NSAlert alertWithMessageText:mText
defaultButton:@"OK"
alternateButton:nil
otherButton:nil
- informativeTextWithFormat:[NSString stringWithFormat:@"An error occurred while trying to optimize the table '%@'. Please try again.\n\n%@", [self table], [mySQLConnection getLastErrorMessage]]]
+ informativeTextWithFormat:[NSString stringWithFormat:NSLocalizedString(@"An error occurred while optimzing the %@.\n\nMySQL said:%@",@"an error occurred while trying to optimze the %@.\n\nMySQL said:%@"), what, [mySQLConnection getLastErrorMessage]]]
beginSheetModalForWindow:tableWindow
modalDelegate:self
didEndSelector:NULL
@@ -2003,24 +2042,47 @@
return;
}
+ NSDictionary *result = [theResult fetch2DResultAsType:MCPTypeDictionary];
+ BOOL statusOK = YES;
+ for(id res in result) {
+ if(![[res objectForKey:@"Msg_type"] isEqualToString:@"status"]) {
+ statusOK = NO;
+ break;
+ }
+ }
+
// Process result
- NSDictionary *result = [[theResult fetch2DResultAsType:MCPTypeDictionary] lastObject];
+ if([selectedItems count] == 1) {
+ message = @"";
- NSString *message = @"";
+ NSDictionary *lastresult = [[theResult fetch2DResultAsType:MCPTypeDictionary] lastObject];
- message = ([[result objectForKey:@"Msg_type"] isEqualToString:@"status"]) ? @"Successfully optimized table" : @"Optimize table failed.";
+ message = ([[lastresult objectForKey:@"Msg_type"] isEqualToString:@"status"]) ? NSLocalizedString(@"Successfully optimized table.",@"optimize table successfully passed message") : NSLocalizedString(@"Optimize table failed.", @"optimize table failed message");
- message = [NSString stringWithFormat:@"%@\n\nMySQL said: %@", message, [result objectForKey:@"Msg_text"]];
+ message = [NSString stringWithFormat:@"%@\n\nMySQL said: %@", message, [lastresult objectForKey:@"Msg_text"]];
+ } else if(statusOK) {
+ message = NSLocalizedString(@"Successfully optimized all selected items.",@"successfully optimized all selected items message");
+ }
- [[NSAlert alertWithMessageText:[NSString stringWithFormat:@"Optimize table '%@'", [self table]]
- defaultButton:@"OK"
- alternateButton:nil
- otherButton:nil
- informativeTextWithFormat:message]
- beginSheetModalForWindow:tableWindow
- modalDelegate:self
- didEndSelector:NULL
- contextInfo:NULL];
+ if(message) {
+ [[NSAlert alertWithMessageText:[NSString stringWithFormat:@"Optimize %@", what]
+ defaultButton:@"OK"
+ alternateButton:nil
+ otherButton:nil
+ informativeTextWithFormat:message]
+ beginSheetModalForWindow:tableWindow
+ modalDelegate:self
+ didEndSelector:NULL
+ contextInfo:NULL];
+ } else {
+ message = NSLocalizedString(@"MySQL said:",@"mysql said message");
+ statusValues = [result retain];
+ NSAlert *alert = [[NSAlert new] autorelease];
+ [alert setInformativeText:message];
+ [alert setMessageText:NSLocalizedString(@"Error while optimizing selected items", @"error while optimizing selected items message")];
+ [alert setAccessoryView:statusTableAccessoryView];
+ [alert beginSheetModalForWindow:tableWindow modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:@"statusError"];
+ }
}
/**
@@ -2028,17 +2090,25 @@
*/
- (IBAction)repairTable:(id)sender
{
- MCPResult *theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"REPAIR TABLE %@", [[self table] backtickQuotedString]]];
+ NSArray *selectedItems = [tablesListInstance selectedTableItems];
+ id message = nil;
+
+ if([selectedItems count] == 0) return;
+
+ MCPResult *theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"REPAIR TABLE %@", [selectedItems componentsJoinedAndBacktickQuoted]]];
+
+ NSString *what = ([selectedItems count]>1) ? NSLocalizedString(@"selected items", @"selected items") : [NSString stringWithFormat:@"%@ '%@'", NSLocalizedString(@"table", @"table"), [self table]];
// Check for errors, only displaying if the connection hasn't been terminated
if (![[mySQLConnection getLastErrorMessage] isEqualToString:@""]) {
+ NSString *mText = ([selectedItems count]>1) ? NSLocalizedString(@"Unable to repair selected items", @"unable to repair selected items message") : NSLocalizedString(@"Unable to repair table", @"unable to repair table message");
if ([mySQLConnection isConnected]) {
- [[NSAlert alertWithMessageText:@"Unable to repair table"
+ [[NSAlert alertWithMessageText:mText
defaultButton:@"OK"
alternateButton:nil
otherButton:nil
- informativeTextWithFormat:[NSString stringWithFormat:@"An error occurred while trying to repair the table '%@'. Please try again.\n\n%@", [self table], [mySQLConnection getLastErrorMessage]]]
+ informativeTextWithFormat:[NSString stringWithFormat:NSLocalizedString(@"An error occurred while repairing the %@.\n\nMySQL said:%@",@"an error occurred while trying to repair the %@.\n\nMySQL said:%@"), what, [mySQLConnection getLastErrorMessage]]]
beginSheetModalForWindow:tableWindow
modalDelegate:self
didEndSelector:NULL
@@ -2048,24 +2118,47 @@
return;
}
+ NSDictionary *result = [theResult fetch2DResultAsType:MCPTypeDictionary];
+ BOOL statusOK = YES;
+ for(id res in result) {
+ if(![[res objectForKey:@"Msg_type"] isEqualToString:@"status"]) {
+ statusOK = NO;
+ break;
+ }
+ }
+
// Process result
- NSDictionary *result = [[theResult fetch2DResultAsType:MCPTypeDictionary] lastObject];
+ if([selectedItems count] == 1) {
+ message = @"";
- NSString *message = @"";
+ NSDictionary *lastresult = [[theResult fetch2DResultAsType:MCPTypeDictionary] lastObject];
- message = ([[result objectForKey:@"Msg_type"] isEqualToString:@"status"]) ? @"Successfully repaired table" : @"Repair table failed.";
+ message = ([[lastresult objectForKey:@"Msg_type"] isEqualToString:@"status"]) ? NSLocalizedString(@"Successfully repaired table.",@"repair table successfully passed message") : NSLocalizedString(@"Repair table failed.", @"repair table failed message");
- message = [NSString stringWithFormat:@"%@\n\nMySQL said: %@", message, [result objectForKey:@"Msg_text"]];
+ message = [NSString stringWithFormat:@"%@\n\nMySQL said: %@", message, [lastresult objectForKey:@"Msg_text"]];
+ } else if(statusOK) {
+ message = NSLocalizedString(@"Successfully repaired all selected items.",@"successfully repaired all selected items message");
+ }
- [[NSAlert alertWithMessageText:[NSString stringWithFormat:@"Repair table '%@'", [self table]]
- defaultButton:@"OK"
- alternateButton:nil
- otherButton:nil
- informativeTextWithFormat:message]
- beginSheetModalForWindow:tableWindow
- modalDelegate:self
- didEndSelector:NULL
- contextInfo:NULL];
+ if(message) {
+ [[NSAlert alertWithMessageText:[NSString stringWithFormat:@"Repair %@", what]
+ defaultButton:@"OK"
+ alternateButton:nil
+ otherButton:nil
+ informativeTextWithFormat:message]
+ beginSheetModalForWindow:tableWindow
+ modalDelegate:self
+ didEndSelector:NULL
+ contextInfo:NULL];
+ } else {
+ message = NSLocalizedString(@"MySQL said:",@"mysql said message");
+ statusValues = [result retain];
+ NSAlert *alert = [[NSAlert new] autorelease];
+ [alert setInformativeText:message];
+ [alert setMessageText:NSLocalizedString(@"Error while repairing selected items", @"error while repairing selected items message")];
+ [alert setAccessoryView:statusTableAccessoryView];
+ [alert beginSheetModalForWindow:tableWindow modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:@"statusError"];
+ }
}
/**
@@ -2073,35 +2166,75 @@
*/
- (IBAction)flushTable:(id)sender
{
- [mySQLConnection queryString:[NSString stringWithFormat:@"FLUSH TABLE %@", [[self table] backtickQuotedString]]];
+ NSArray *selectedItems = [tablesListInstance selectedTableItems];
+ id message = nil;
+
+ if([selectedItems count] == 0) return;
+
+ MCPResult *theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"FLUSH TABLE %@", [selectedItems componentsJoinedAndBacktickQuoted]]];
+
+ NSString *what = ([selectedItems count]>1) ? NSLocalizedString(@"selected items", @"selected items") : [NSString stringWithFormat:@"%@ '%@'", NSLocalizedString(@"table", @"table"), [self table]];
// Check for errors, only displaying if the connection hasn't been terminated
if (![[mySQLConnection getLastErrorMessage] isEqualToString:@""]) {
+ NSString *mText = ([selectedItems count]>1) ? NSLocalizedString(@"Unable to flush selected items", @"unable to flush selected items message") : NSLocalizedString(@"Unable to flush table", @"unable to flush table message");
if ([mySQLConnection isConnected]) {
- [[NSAlert alertWithMessageText:@"Unable to flush table"
+ [[NSAlert alertWithMessageText:mText
defaultButton:@"OK"
alternateButton:nil
otherButton:nil
- informativeTextWithFormat:[NSString stringWithFormat:@"An error occurred while trying to flush the table '%@'. Please try again.\n\n%@", [self table], [mySQLConnection getLastErrorMessage]]]
+ informativeTextWithFormat:[NSString stringWithFormat:NSLocalizedString(@"An error occurred while flushing the %@.\n\nMySQL said:%@",@"an error occurred while trying to flush the %@.\n\nMySQL said:%@"), what, [mySQLConnection getLastErrorMessage]]]
beginSheetModalForWindow:tableWindow
modalDelegate:self
didEndSelector:NULL
- contextInfo:NULL];
+ contextInfo:NULL];
}
return;
}
- [[NSAlert alertWithMessageText:[NSString stringWithFormat:@"Flush table '%@'", [self table]]
- defaultButton:@"OK"
- alternateButton:nil
- otherButton:nil
- informativeTextWithFormat:@"Table was successfully flushed"]
- beginSheetModalForWindow:tableWindow
- modalDelegate:self
- didEndSelector:NULL
- contextInfo:NULL];
+ NSDictionary *result = [theResult fetch2DResultAsType:MCPTypeDictionary];
+ BOOL statusOK = YES;
+ for(id res in result) {
+ if(![[res objectForKey:@"Msg_type"] isEqualToString:@"status"]) {
+ statusOK = NO;
+ break;
+ }
+ }
+
+ // Process result
+ if([selectedItems count] == 1) {
+ message = @"";
+
+ NSDictionary *lastresult = [[theResult fetch2DResultAsType:MCPTypeDictionary] lastObject];
+
+ message = ([[lastresult objectForKey:@"Msg_type"] isEqualToString:@"status"]) ? NSLocalizedString(@"Successfully flushed table.",@"flush table successfully passed message") : NSLocalizedString(@"Flush table failed.", @"flush table failed message");
+
+ message = [NSString stringWithFormat:@"%@\n\nMySQL said: %@", message, [lastresult objectForKey:@"Msg_text"]];
+ } else if(statusOK) {
+ message = NSLocalizedString(@"Successfully flushed all selected items.",@"successfully flushed all selected items message");
+ }
+
+ if(message) {
+ [[NSAlert alertWithMessageText:[NSString stringWithFormat:@"Flush %@", what]
+ defaultButton:@"OK"
+ alternateButton:nil
+ otherButton:nil
+ informativeTextWithFormat:message]
+ beginSheetModalForWindow:tableWindow
+ modalDelegate:self
+ didEndSelector:NULL
+ contextInfo:NULL];
+ } else {
+ message = NSLocalizedString(@"MySQL said:",@"mysql said message");
+ statusValues = [result retain];
+ NSAlert *alert = [[NSAlert new] autorelease];
+ [alert setInformativeText:message];
+ [alert setMessageText:NSLocalizedString(@"Error while flushing selected items", @"error while flushing selected items message")];
+ [alert setAccessoryView:statusTableAccessoryView];
+ [alert beginSheetModalForWindow:tableWindow modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:@"statusError"];
+ }
}
/**
@@ -2109,37 +2242,54 @@
*/
- (IBAction)checksumTable:(id)sender
{
- MCPResult *theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"CHECKSUM TABLE %@", [[self table] backtickQuotedString]]];
+ NSArray *selectedItems = [tablesListInstance selectedTableItems];
+ id message = nil;
+
+ if([selectedItems count] == 0) return;
+
+ MCPResult *theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"CHECKSUM TABLE %@", [selectedItems componentsJoinedAndBacktickQuoted]]];
+
+ NSString *what = ([selectedItems count]>1) ? NSLocalizedString(@"selected items", @"selected items") : [NSString stringWithFormat:@"%@ '%@'", NSLocalizedString(@"table", @"table"), [self table]];
// Check for errors, only displaying if the connection hasn't been terminated
if (![[mySQLConnection getLastErrorMessage] isEqualToString:@""]) {
if ([mySQLConnection isConnected]) {
- [[NSAlert alertWithMessageText:@"Unable to perform checksum"
+ [[NSAlert alertWithMessageText:NSLocalizedString(@"Unable to perform the checksum", @"unable to perform the checksum")
defaultButton:@"OK"
alternateButton:nil
otherButton:nil
- informativeTextWithFormat:[NSString stringWithFormat:@"An error occurred while performing the checksum on table '%@'. Please try again.\n\n%@", [self table], [mySQLConnection getLastErrorMessage]]]
+ informativeTextWithFormat:[NSString stringWithFormat:NSLocalizedString(@"An error occurred while performing the checksum on %@.\n\nMySQL said:%@",@"an error occurred while performing the checksum on the %@.\n\nMySQL said:%@"), what, [mySQLConnection getLastErrorMessage]]]
beginSheetModalForWindow:tableWindow
modalDelegate:self
didEndSelector:NULL
contextInfo:NULL];
}
+
return;
}
// Process result
- NSString *result = [[[theResult fetch2DResultAsType:MCPTypeDictionary] lastObject] objectForKey:@"Checksum"];
-
- [[NSAlert alertWithMessageText:[NSString stringWithFormat:@"Checksum table '%@'", [self table]]
- defaultButton:@"OK"
- alternateButton:nil
- otherButton:nil
- informativeTextWithFormat:[NSString stringWithFormat:@"Table checksum: %@", result]]
- beginSheetModalForWindow:tableWindow
- modalDelegate:self
- didEndSelector:NULL
- contextInfo:NULL];
+ if([selectedItems count] == 1) {
+ message = [[[theResult fetch2DResultAsType:MCPTypeDictionary] lastObject] objectForKey:@"Checksum"];
+ [[NSAlert alertWithMessageText:[NSString stringWithFormat:NSLocalizedString(@"Checksum %@",@"checksum %@ message"), what]
+ defaultButton:@"OK"
+ alternateButton:nil
+ otherButton:nil
+ informativeTextWithFormat:[NSString stringWithFormat:NSLocalizedString(@"Table checksum: %@",@"table checksum: %@"), message]]
+ beginSheetModalForWindow:tableWindow
+ modalDelegate:self
+ didEndSelector:NULL
+ contextInfo:NULL];
+ } else {
+ NSDictionary *result = [theResult fetch2DResultAsType:MCPTypeDictionary];
+ statusValues = [result retain];
+ NSAlert *alert = [[NSAlert new] autorelease];
+ [alert setInformativeText:[NSString stringWithFormat:NSLocalizedString(@"Checksums of %@",@"Checksums of %@ message"), what]];
+ [alert setMessageText:NSLocalizedString(@"Table checksum",@"table checksum message")];
+ [alert setAccessoryView:statusTableAccessoryView];
+ [alert beginSheetModalForWindow:tableWindow modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:@"statusError"];
+ }
}
/**
@@ -2984,17 +3134,18 @@
// table menu items
if ([menuItem action] == @selector(showCreateTableSyntax:) ||
- [menuItem action] == @selector(copyCreateTableSyntax:) ||
- [menuItem action] == @selector(analyzeTable:) ||
- [menuItem action] == @selector(optimizeTable:) ||
- [menuItem action] == @selector(repairTable:) ||
- [menuItem action] == @selector(flushTable:) ||
- [menuItem action] == @selector(checksumTable:))
+ [menuItem action] == @selector(copyCreateTableSyntax:))
{
return ([self table] != nil && [[self table] isNotEqualTo:@""]);
}
- if ([menuItem action] == @selector(checkTable:)) {
+ if ([menuItem action] == @selector(analyzeTable:) ||
+ [menuItem action] == @selector(optimizeTable:) ||
+ [menuItem action] == @selector(repairTable:) ||
+ [menuItem action] == @selector(flushTable:) ||
+ [menuItem action] == @selector(checkTable:) ||
+ [menuItem action] == @selector(checksumTable:))
+ {
return ([[[tablesListInstance valueForKeyPath:@"tablesListView"] selectedRowIndexes] count]) ? YES:NO;
}
@@ -3745,13 +3896,27 @@
{
if(statusTableView && aTableView == statusTableView && rowIndex < [statusValues count]) {
if ([[aTableColumn identifier] isEqualToString:@"table_name"]) {
- return [[statusValues objectAtIndex:rowIndex] objectForKey:@"Table"];
+ if([[statusValues objectAtIndex:rowIndex] objectForKey:@"table_name"])
+ return [[statusValues objectAtIndex:rowIndex] objectForKey:@"table_name"];
+ else if([[statusValues objectAtIndex:rowIndex] objectForKey:@"Table"])
+ return [[statusValues objectAtIndex:rowIndex] objectForKey:@"Table"];
+ return @"";
}
else if ([[aTableColumn identifier] isEqualToString:@"msg_status"]) {
- return [[statusValues objectAtIndex:rowIndex] objectForKey:@"Msg_type"];
+ if([[statusValues objectAtIndex:rowIndex] objectForKey:@"Msg_type"])
+ return [[[statusValues objectAtIndex:rowIndex] objectForKey:@"Msg_type"] capitalizedString];
+ return @"";
}
else if ([[aTableColumn identifier] isEqualToString:@"msg_text"]) {
- return [[statusValues objectAtIndex:rowIndex] objectForKey:@"Msg_text"];
+ if([[statusValues objectAtIndex:rowIndex] objectForKey:@"Msg_text"]) {
+ [[aTableColumn headerCell] setStringValue:NSLocalizedString(@"Message",@"message column title")];
+ return [[statusValues objectAtIndex:rowIndex] objectForKey:@"Msg_text"];
+ }
+ else if([[statusValues objectAtIndex:rowIndex] objectForKey:@"Checksum"]) {
+ [[aTableColumn headerCell] setStringValue:@"Checksum"];
+ return [[statusValues objectAtIndex:rowIndex] objectForKey:@"Checksum"];
+ }
+ return @"";
}
}
return nil;
@@ -3762,6 +3927,34 @@
return NO;
}
+
+#pragma mark -
+#pragma mark status accessory view
+
+- (IBAction)copyChecksumFromSheet:(id)sender
+{
+ NSMutableString *tmp = [NSMutableString string];
+ for(id row in statusValues)
+ if([row objectForKey:@"Msg_type"])
+ [tmp appendFormat:@"%@\t%@\t%@\n", [[row objectForKey:@"Table"] description],
+ [[row objectForKey:@"Msg_type"] description],
+ [[row objectForKey:@"Msg_text"] description]];
+ else
+ [tmp appendFormat:@"%@\t%@\n", [[row objectForKey:@"Table"] description],
+ [[row objectForKey:@"Checksum"] description]];
+ if ( [tmp length] )
+ {
+ NSPasteboard *pb = [NSPasteboard generalPasteboard];
+
+ [pb declareTypes:[NSArray arrayWithObjects: NSTabularTextPboardType,
+ NSStringPboardType, nil]
+ owner:nil];
+
+ [pb setString:tmp forType:NSStringPboardType];
+ [pb setString:tmp forType:NSTabularTextPboardType];
+ }
+}
+
#pragma mark -
/**
diff --git a/Source/TablesList.m b/Source/TablesList.m
index 3ca55f43..e9c07510 100644
--- a/Source/TablesList.m
+++ b/Source/TablesList.m
@@ -824,6 +824,19 @@
NSMenu *tableSubMenu = [[[NSApp mainMenu] itemWithTitle:@"Table"] submenu];
[[tableSubMenu itemAtIndex:3] setTitle:NSLocalizedString(@"Check Selected Items", @"check selected items menu item")];
+ [[tableSubMenu itemAtIndex:4] setTitle:NSLocalizedString(@"Repair Selected Items", @"repair selected items menu item")];
+ [[tableSubMenu itemAtIndex:6] setTitle:NSLocalizedString(@"Analyze Selected Items", @"analyze selected items menu item")];
+ [[tableSubMenu itemAtIndex:7] setTitle:NSLocalizedString(@"Optimize Selected Items", @"optimize selected items menu item")];
+ [[tableSubMenu itemAtIndex:8] setTitle:NSLocalizedString(@"Flush Selected Items", @"flush selected items menu item")];
+ [[tableSubMenu itemAtIndex:9] setTitle:NSLocalizedString(@"Checksum Selected Items", @"checksum selected items menu item")];
+ [[tableSubMenu itemAtIndex:2] setHidden:NO];
+ [[tableSubMenu itemAtIndex:3] setHidden:NO];
+ [[tableSubMenu itemAtIndex:4] setHidden:NO];
+ [[tableSubMenu itemAtIndex:5] setHidden:NO];
+ [[tableSubMenu itemAtIndex:6] setHidden:NO];
+ [[tableSubMenu itemAtIndex:7] setHidden:NO];
+ [[tableSubMenu itemAtIndex:8] setHidden:NO];
+ [[tableSubMenu itemAtIndex:9] setHidden:NO];
// set window title
@@ -898,12 +911,16 @@
[[tableSubMenu itemAtIndex:3] setHidden:NO];
[[tableSubMenu itemAtIndex:3] setTitle:NSLocalizedString(@"Check Table", @"check table menu item")];
[[tableSubMenu itemAtIndex:4] setHidden:NO];
+ [[tableSubMenu itemAtIndex:4] setTitle:NSLocalizedString(@"Repair Table", @"repair table menu item")];
[[tableSubMenu itemAtIndex:5] setHidden:NO]; // divider
[[tableSubMenu itemAtIndex:6] setHidden:NO];
+ [[tableSubMenu itemAtIndex:6] setTitle:NSLocalizedString(@"Analyze Table", @"analyze table menu item")];
[[tableSubMenu itemAtIndex:7] setHidden:NO];
+ [[tableSubMenu itemAtIndex:7] setTitle:NSLocalizedString(@"Optimize Table", @"optimize table menu item")];
[[tableSubMenu itemAtIndex:8] setHidden:NO];
[[tableSubMenu itemAtIndex:8] setTitle:NSLocalizedString(@"Flush Table", @"flush table menu item")];
[[tableSubMenu itemAtIndex:9] setHidden:NO];
+ [[tableSubMenu itemAtIndex:9] setTitle:NSLocalizedString(@"Checksum Table", @"checksum table menu item")];
[renameTableMenuItem setHidden:NO];
[renameTableMenuItem setTitle:NSLocalizedString(@"Rename Table...", @"rename table menu title")];