Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public UFTCredentialsDialog(DriverConfigParam serverParam, DriverConfigParam cli
mTenantIdParam = tenantIdParam;
mUftmBasicCallFunc = uftmBasicCallFunc;
DialogResult = false;
mPreferredDeviceName = initialDeviceName;
mPreferredDeviceUuid = initialDeviceUuid;
mPreferredAppId = initialAppId;
mInitialPlatform = initialPlatform;
Expand All @@ -103,7 +102,6 @@ public UFTCredentialsDialog(DriverConfigParam serverParam, DriverConfigParam cli

private void UFTCredentialsDialog_Loaded(object sender, RoutedEventArgs e)
{
// Ensure UI is ready then invoke the same logic as the Refresh button
this.Dispatcher?.BeginInvoke(new Action(() =>
{
try
Expand Down Expand Up @@ -851,7 +849,6 @@ private void DisplayPhonesResult(string content, bool treatContentAsMessage = fa
mPhones.Add(phone);
}

// collect workspaces from parsed phones for filter population
mWorkspaces.Clear();
foreach (var p in mPhones)
{
Expand All @@ -861,7 +858,6 @@ private void DisplayPhonesResult(string content, bool treatContentAsMessage = fa
}
}

// populate filters and apply current selections (show filtered results)
PopulateFilters();
ApplyFilters();

Expand Down Expand Up @@ -1192,7 +1188,6 @@ private void PhonesListBox_SelectionChanged(object sender, SelectionChangedEvent
}

mPreferredDeviceUuid = SelectedPhoneUuid;
mPreferredDeviceName = SelectedPhoneName;
UpdateCurrentPhoneMarker();
}
}
Expand Down Expand Up @@ -1228,7 +1223,6 @@ private void PhoneItem_PreviewMouseLeftButtonDown(object sender, MouseButtonEven
e.Handled = true;
xPhonesListBox.SelectedItem = null;
mPreferredDeviceUuid = null;
mPreferredDeviceName = null;
UpdateCurrentPhoneMarker();
}
}
Expand Down Expand Up @@ -1289,19 +1283,12 @@ private void ApplyPreferredSelection()
string.Equals(phone.Uuid, mPreferredDeviceUuid, StringComparison.OrdinalIgnoreCase));
}

if (targetPhone == null && !string.IsNullOrWhiteSpace(mPreferredDeviceName))
{
targetPhone = mPhones.FirstOrDefault(phone =>
string.Equals(phone.DeviceName, mPreferredDeviceName, StringComparison.OrdinalIgnoreCase) ||
string.Equals(phone.DisplayName, mPreferredDeviceName, StringComparison.OrdinalIgnoreCase));
}

xPhonesListBox.SelectedItem = targetPhone;

if (targetPhone != null)
{
xPhonesListBox.ScrollIntoView(targetPhone);
}
}
}

private void UpdateCurrentPhoneMarker()
Expand Down Expand Up @@ -1329,22 +1316,6 @@ private bool IsPreferredPhone(UftPhoneViewModel phone)
return !string.IsNullOrEmpty(mPreferredDeviceUuid) &&
!string.IsNullOrEmpty(phone.Uuid) &&
string.Equals(phone.Uuid, mPreferredDeviceUuid, StringComparison.OrdinalIgnoreCase);
}

if (!string.IsNullOrEmpty(mPreferredDeviceName))
{
if (!string.IsNullOrEmpty(phone.DeviceName) && string.Equals(phone.DeviceName, mPreferredDeviceName, StringComparison.OrdinalIgnoreCase))
{
return true;
}

if (!string.IsNullOrEmpty(phone.DisplayName) && string.Equals(phone.DisplayName, mPreferredDeviceName, StringComparison.OrdinalIgnoreCase))
{
return true;
}
}

return false;
}

private sealed class UftPhoneViewModel
Expand Down
Loading