Skip to content

Commit b76667b

Browse files
committed
Fix menu item validation warning.
1 parent bcb7fb6 commit b76667b

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

Diff for: Source/SPDatabaseDocument.m

+9-15
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@ - (void) enableTaskCancellationWithTitle:(NSString *)buttonTitle callbackObject:
15411541
/**
15421542
* Disable task cancellation. Called automatically at the end of a task.
15431543
*/
1544-
- (void) disableTaskCancellation
1544+
- (void)disableTaskCancellation
15451545
{
15461546
#ifndef SP_CODA
15471547
// Ensure call on the main thread
@@ -1560,7 +1560,7 @@ - (void) disableTaskCancellation
15601560
/**
15611561
* Action sent by the cancel button when it's active.
15621562
*/
1563-
- (IBAction) cancelTask:(id)sender
1563+
- (IBAction)cancelTask:(id)sender
15641564
{
15651565
#ifndef SP_CODA
15661566
if (!taskCanBeCancelled) return;
@@ -1586,23 +1586,23 @@ - (IBAction) cancelTask:(id)sender
15861586
* Returns whether the document is busy performing a task - allows UI or actions
15871587
* to be restricted as appropriate.
15881588
*/
1589-
- (BOOL) isWorking
1589+
- (BOOL)isWorking
15901590
{
15911591
return (_isWorkingLevel > 0);
15921592
}
15931593

15941594
/**
15951595
* Set whether the database list is selectable or not during the task process.
15961596
*/
1597-
- (void) setDatabaseListIsSelectable:(BOOL)isSelectable
1597+
- (void)setDatabaseListIsSelectable:(BOOL)isSelectable
15981598
{
15991599
databaseListIsSelectable = isSelectable;
16001600
}
16011601

16021602
/**
16031603
* Reposition the task window within the main window.
16041604
*/
1605-
- (void) centerTaskWindow
1605+
- (void)centerTaskWindow
16061606
{
16071607
#ifndef SP_CODA
16081608
NSPoint newBottomLeftPoint;
@@ -1620,7 +1620,7 @@ - (void) centerTaskWindow
16201620
* Support pausing and restarting the task progress indicator.
16211621
* Only works while the indicator is in indeterminate mode.
16221622
*/
1623-
- (void) setTaskIndicatorShouldAnimate:(BOOL)shouldAnimate
1623+
- (void)setTaskIndicatorShouldAnimate:(BOOL)shouldAnimate
16241624
{
16251625
#ifndef SP_CODA
16261626
if (shouldAnimate) {
@@ -3599,13 +3599,13 @@ - (IBAction) makeTableListFilterHaveFocus:(id)sender
35993599

36003600
/**
36013601
* Menu item validation.
3602-
*/
3602+
*/
36033603
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
36043604
{
36053605
SEL action = [menuItem action];
36063606

3607-
if ([menuItem menu] == chooseDatabaseButton) {
3608-
return (_isConnected && databaseListIsSelectable);
3607+
if (action == @selector(chooseDatabase:)) {
3608+
return _isConnected && databaseListIsSelectable;
36093609
}
36103610

36113611
if (!_isConnected || _isWorkingLevel) {
@@ -3616,7 +3616,6 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem
36163616
);
36173617
}
36183618

3619-
#ifndef SP_CODA
36203619
if (action == @selector(openCurrentConnectionInNewWindow:))
36213620
{
36223621
if ([self isUntitled]) {
@@ -3628,7 +3627,6 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem
36283627
return YES;
36293628
}
36303629
}
3631-
#endif
36323630

36333631
// Data export
36343632
if (action == @selector(export:)) {
@@ -3709,7 +3707,6 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem
37093707
return YES;
37103708
}
37113709

3712-
#ifndef SP_CODA
37133710
if (action == @selector(printDocument:)) {
37143711
return (
37153712
([self database] != nil && [[tablesListInstance valueForKeyPath:@"tablesListView"] numberOfSelectedRows] == 1) ||
@@ -3719,7 +3716,6 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem
37193716
[self currentlySelectedView] == SPTableViewCustomQuery
37203717
);
37213718
}
3722-
#endif
37233719

37243720
if (action == @selector(chooseEncoding:)) {
37253721
return [self supportsEncoding];
@@ -3738,7 +3734,6 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem
37383734
return [[[tablesListInstance valueForKeyPath:@"tablesListView"] selectedRowIndexes] count];
37393735
}
37403736

3741-
#ifndef SP_CODA
37423737
if (action == @selector(addConnectionToFavorites:)) {
37433738
return ![connectionController selectedFavorite] || [connectionController isEditingConnection];
37443739
}
@@ -3752,7 +3747,6 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem
37523747
if ((action == @selector(backForwardInHistory:)) && ([menuItem tag] == 1)) {
37533748
return (([[spHistoryControllerInstance history] count]) && (([spHistoryControllerInstance historyPosition] + 1) < [[spHistoryControllerInstance history] count]));
37543749
}
3755-
#endif
37563750

37573751
// Show/hide console
37583752
if (action == @selector(toggleConsole:)) {

0 commit comments

Comments
 (0)