From 0f2300a9814de60fbc204ebab4dc9e217f12a05a Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Mon, 12 Oct 2020 16:07:45 +0200 Subject: [PATCH] Added target application icon to candidate selection window --- .../AutotypeCandidateSelectionView.xib | 70 ++++++++++++------- ...AutotypeCandidateSelectionViewController.m | 5 ++ 2 files changed, 51 insertions(+), 24 deletions(-) diff --git a/MacPass/Base.lproj/AutotypeCandidateSelectionView.xib b/MacPass/Base.lproj/AutotypeCandidateSelectionView.xib index f45c411b..d3344799 100644 --- a/MacPass/Base.lproj/AutotypeCandidateSelectionView.xib +++ b/MacPass/Base.lproj/AutotypeCandidateSelectionView.xib @@ -1,8 +1,8 @@ - + - + @@ -11,30 +11,30 @@ + - - + + - - + + - + - - - + + + - @@ -111,14 +111,6 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - - + - + + diff --git a/MacPass/MPAutotypeCandidateSelectionViewController.m b/MacPass/MPAutotypeCandidateSelectionViewController.m index ecdc506e..34d186d0 100644 --- a/MacPass/MPAutotypeCandidateSelectionViewController.m +++ b/MacPass/MPAutotypeCandidateSelectionViewController.m @@ -33,6 +33,7 @@ @property (strong) IBOutlet NSButton *selectAutotypeContextButton; @property (strong) IBOutlet NSTableView *contextTableView; @property (strong) IBOutlet NSTextField *messageTextField; +@property (strong) IBOutlet NSImageView *targetApplicationImageView; @end @@ -47,6 +48,10 @@ NSString *template = NSLocalizedString(@"AUTOTYPE_CANDIDATE_SELECTION_WINDOW_MESSAGE_%@", "Message text in the autotype selection window. Placeholder is %1 - windowTitle"); self.messageTextField.stringValue = [NSString stringWithFormat:template, self.environment.windowTitle]; self.selectAutotypeContextButton.enabled = NO; + NSRunningApplication *targetApplication = [NSRunningApplication runningApplicationWithProcessIdentifier:self.environment.pid]; + if(nil != targetApplication) { + self.targetApplicationImageView.image = targetApplication.icon; + } NSNotification *notification = [NSNotification notificationWithName:NSTableViewSelectionDidChangeNotification object:self.contextTableView]; [self tableViewSelectionDidChange:notification]; }