|
@@ -61,6 +61,7 @@ type
|
|
procedure loadConnections; message 'TCloudOptionsWindow_loadConnections';
|
|
procedure loadConnections; message 'TCloudOptionsWindow_loadConnections';
|
|
procedure saveConnections; message 'TCloudOptionsWindow_saveConnections';
|
|
procedure saveConnections; message 'TCloudOptionsWindow_saveConnections';
|
|
procedure selectConnection( name: NSString ); message 'TCloudOptionsWindow_selectConnection:';
|
|
procedure selectConnection( name: NSString ); message 'TCloudOptionsWindow_selectConnection:';
|
|
|
|
+ procedure selectConnectionIndex( index: Integer ); message 'TCloudOptionsWindow_selectConnectionIndex:';
|
|
procedure newConnection( sender: NSObject );
|
|
procedure newConnection( sender: NSObject );
|
|
procedure removeConnection( sender: NSObject );
|
|
procedure removeConnection( sender: NSObject );
|
|
procedure saveConnection( name: NSString );
|
|
procedure saveConnection( name: NSString );
|
|
@@ -250,13 +251,21 @@ begin
|
|
for i:=0 to configItems.count-1 do begin
|
|
for i:=0 to configItems.count-1 do begin
|
|
configItem:= TWFXConnectionConfigItem( self.configItems.getItem(i) );
|
|
configItem:= TWFXConnectionConfigItem( self.configItems.getItem(i) );
|
|
if configItem.name.isEqualToString(name) then begin
|
|
if configItem.name.isEqualToString(name) then begin
|
|
- self.connectionListView.selectRow_byExtendingSelection( i, False );
|
|
|
|
|
|
+ self.selectConnectionIndex( i );
|
|
Exit;
|
|
Exit;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
self.onSelectedConnectionChanged( i );
|
|
self.onSelectedConnectionChanged( i );
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TWFXOptionsWindow.selectConnectionIndex( index: Integer );
|
|
|
|
+var
|
|
|
|
+ indexSet: NSIndexSet;
|
|
|
|
+begin
|
|
|
|
+ indexSet:= NSIndexSet.indexSetWithIndex( index );
|
|
|
|
+ self.connectionListView.selectRowIndexes_byExtendingSelection( indexSet , False );
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TWFXOptionsWindow.addConnection( connectionName: NSString );
|
|
procedure TWFXOptionsWindow.addConnection( connectionName: NSString );
|
|
var
|
|
var
|
|
driverIndex: Integer;
|
|
driverIndex: Integer;
|
|
@@ -284,7 +293,7 @@ begin
|
|
index:= self.configItems.addItem( configItem );
|
|
index:= self.configItems.addItem( configItem );
|
|
configItem.release;
|
|
configItem.release;
|
|
self.connectionListView.noteNumberOfRowsChanged;
|
|
self.connectionListView.noteNumberOfRowsChanged;
|
|
- self.connectionListView.selectRow_byExtendingSelection( index, False );
|
|
|
|
|
|
+ self.selectConnectionIndex( index );
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TWFXOptionsWindow.newConnection(sender: NSObject);
|
|
procedure TWFXOptionsWindow.newConnection(sender: NSObject);
|
|
@@ -304,7 +313,7 @@ begin
|
|
if currentIndex >= self.configItems.Count then
|
|
if currentIndex >= self.configItems.Count then
|
|
currentIndex:= self.configItems.Count - 1;
|
|
currentIndex:= self.configItems.Count - 1;
|
|
if currentIndex >= 0 then begin
|
|
if currentIndex >= 0 then begin
|
|
- self.connectionListView.selectRow_byExtendingSelection( currentIndex, False );
|
|
|
|
|
|
+ self.selectConnectionIndex( currentIndex );
|
|
end else begin
|
|
end else begin
|
|
self.onSelectedConnectionChanged( currentIndex );
|
|
self.onSelectedConnectionChanged( currentIndex );
|
|
end;
|
|
end;
|
|
@@ -344,7 +353,7 @@ begin
|
|
configItem.setName( name );
|
|
configItem.setName( name );
|
|
configItem.setModificationTime( LocalTimeToUniversal(now) );
|
|
configItem.setModificationTime( LocalTimeToUniversal(now) );
|
|
self.connectionListView.reloadData;
|
|
self.connectionListView.reloadData;
|
|
- self.connectionListView.selectRow_byExtendingSelection( currentIndex, False );
|
|
|
|
|
|
+ self.selectConnectionIndex( currentIndex );
|
|
end;
|
|
end;
|
|
|
|
|
|
function TWFXOptionsWindow.currentConfigItem: TWFXConnectionConfigItem;
|
|
function TWFXOptionsWindow.currentConfigItem: TWFXConnectionConfigItem;
|
|
@@ -550,7 +559,7 @@ begin
|
|
leftView.release;
|
|
leftView.release;
|
|
|
|
|
|
win.makeFirstResponder( connectionListView );
|
|
win.makeFirstResponder( connectionListView );
|
|
- connectionListView.selectRow_byExtendingSelection( 0, False );
|
|
|
|
|
|
+ win.selectConnectionIndex( 0 );
|
|
Result:= win;
|
|
Result:= win;
|
|
end;
|
|
end;
|
|
|
|
|