Skip to content
Permalink
Browse files
Fix menu item validation warning.
  • Loading branch information
stuconnolly committed Oct 6, 2018
1 parent bcb7fb6 commit b76667b
Showing 1 changed file with 9 additions and 15 deletions.
@@ -1541,7 +1541,7 @@ - (void) enableTaskCancellationWithTitle:(NSString *)buttonTitle callbackObject:
/**
* Disable task cancellation. Called automatically at the end of a task.
*/
- (void) disableTaskCancellation
- (void)disableTaskCancellation
{
#ifndef SP_CODA
// Ensure call on the main thread
@@ -1560,7 +1560,7 @@ - (void) disableTaskCancellation
/**
* Action sent by the cancel button when it's active.
*/
- (IBAction) cancelTask:(id)sender
- (IBAction)cancelTask:(id)sender
{
#ifndef SP_CODA
if (!taskCanBeCancelled) return;
@@ -1586,23 +1586,23 @@ - (IBAction) cancelTask:(id)sender
* Returns whether the document is busy performing a task - allows UI or actions
* to be restricted as appropriate.
*/
- (BOOL) isWorking
- (BOOL)isWorking
{
return (_isWorkingLevel > 0);
}

/**
* Set whether the database list is selectable or not during the task process.
*/
- (void) setDatabaseListIsSelectable:(BOOL)isSelectable
- (void)setDatabaseListIsSelectable:(BOOL)isSelectable
{
databaseListIsSelectable = isSelectable;
}

/**
* Reposition the task window within the main window.
*/
- (void) centerTaskWindow
- (void)centerTaskWindow
{
#ifndef SP_CODA
NSPoint newBottomLeftPoint;
@@ -1620,7 +1620,7 @@ - (void) centerTaskWindow
* Support pausing and restarting the task progress indicator.
* Only works while the indicator is in indeterminate mode.
*/
- (void) setTaskIndicatorShouldAnimate:(BOOL)shouldAnimate
- (void)setTaskIndicatorShouldAnimate:(BOOL)shouldAnimate
{
#ifndef SP_CODA
if (shouldAnimate) {
@@ -3599,13 +3599,13 @@ - (IBAction) makeTableListFilterHaveFocus:(id)sender

/**
* Menu item validation.
*/
*/
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
{
SEL action = [menuItem action];

if ([menuItem menu] == chooseDatabaseButton) {
return (_isConnected && databaseListIsSelectable);
if (action == @selector(chooseDatabase:)) {
return _isConnected && databaseListIsSelectable;
}

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

#ifndef SP_CODA
if (action == @selector(openCurrentConnectionInNewWindow:))
{
if ([self isUntitled]) {
@@ -3628,7 +3627,6 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem
return YES;
}
}
#endif

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

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

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

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

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

0 comments on commit b76667b

Please sign in to comment.