[PR #89] [MERGED] Addition of a "friendly" display name for Monitors #1040

Closed
opened 2026-05-05 07:02:59 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MonitorControl/MonitorControl/pull/89
Author: @Jtango18
Created: 5/13/2019
Status: Merged
Merged: 5/16/2019
Merged by: @the0neyouseek

Base: masterHead: master


📝 Commits (5)

  • d907f49 Added hardcoded FriendlyName
  • 6d960c1 Modified to read FriendlyName from UserDefaults
  • 5b3c86d Tidy some nil handling
  • 963a8cc Added Notifications for live updates of name changes
  • 7fe3107 Added English localised string for "Friendly Name"

📊 Changes

8 files changed (+121 additions, -14 deletions)

View changed files

MonitorControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata (+7 -0)
📝 MonitorControl/AppDelegate.swift (+6 -1)
📝 MonitorControl/Display.swift (+8 -0)
📝 MonitorControl/Support/Utils.swift (+3 -0)
📝 MonitorControl/UI/Base.lproj/Main.storyboard (+47 -11)
MonitorControl/UI/FriendlyNameCellView.swift (+33 -0)
📝 MonitorControl/UI/en.lproj/Main.strings (+3 -0)
📝 MonitorControl/View Controllers/DisplayPrefsViewController.swift (+14 -2)

📄 Description

Hi,

First PR for this from me, more than happy if you deem it unnecessary and reject it since it's all for an issue I personally have.

I've added the ability for a user to assigned "friendly names" to the monitors listed for them.

I have a problem where I have two identical monitors, that show up with the exact same name in the drop-down menu.

Screen Shot 2019-05-13 at 18 46 21

My modification includes an editable cell in the preferences view where a user can specify a more meaningful name ("Left Screen" and "Right Screen" for example")

Screen Shot 2019-05-13 at 18 48 19

These names are stored in preferences and then propagated through the UI.

Screen Shot 2019-05-13 at 18 47 23

A couple of things that are probably worth noting:

  1. The added logic in the DispayPrefsViewController increased the cyclomatic complexity of the tableView function to > 12 which triggers a linting warning. I didn't want to go disassembling things in there too much in case you rejected the entire pull request.
  2. I haven't provided any localized strings for German/French. Happy to roll them in either part of the acceptance of this PR, or in a future PR.

It's been quite a while since I've done Prod level macOS development, so please feel free to critique anything you feel I need to address.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MonitorControl/MonitorControl/pull/89 **Author:** [@Jtango18](https://github.com/Jtango18) **Created:** 5/13/2019 **Status:** ✅ Merged **Merged:** 5/16/2019 **Merged by:** [@the0neyouseek](https://github.com/the0neyouseek) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (5) - [`d907f49`](https://github.com/MonitorControl/MonitorControl/commit/d907f498bf6033ee8ee41cd465195d59bff6df8c) Added hardcoded FriendlyName - [`6d960c1`](https://github.com/MonitorControl/MonitorControl/commit/6d960c1a591f16957021f7aa69d3318f176c66e2) Modified to read FriendlyName from UserDefaults - [`5b3c86d`](https://github.com/MonitorControl/MonitorControl/commit/5b3c86d58b8d8abdb559be81574c1f3e30735f4d) Tidy some nil handling - [`963a8cc`](https://github.com/MonitorControl/MonitorControl/commit/963a8ccec7c209f7be533f9b3a3d9960e2dd9afd) Added Notifications for live updates of name changes - [`7fe3107`](https://github.com/MonitorControl/MonitorControl/commit/7fe31076b98764ec82f892722d46d6630a72010d) Added English localised string for "Friendly Name" ### 📊 Changes **8 files changed** (+121 additions, -14 deletions) <details> <summary>View changed files</summary> ➕ `MonitorControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata` (+7 -0) 📝 `MonitorControl/AppDelegate.swift` (+6 -1) 📝 `MonitorControl/Display.swift` (+8 -0) 📝 `MonitorControl/Support/Utils.swift` (+3 -0) 📝 `MonitorControl/UI/Base.lproj/Main.storyboard` (+47 -11) ➕ `MonitorControl/UI/FriendlyNameCellView.swift` (+33 -0) 📝 `MonitorControl/UI/en.lproj/Main.strings` (+3 -0) 📝 `MonitorControl/View Controllers/DisplayPrefsViewController.swift` (+14 -2) </details> ### 📄 Description Hi, First PR for this from me, more than happy if you deem it unnecessary and reject it since it's all for an issue I personally have. I've added the ability for a user to assigned "friendly names" to the monitors listed for them. I have a problem where I have two identical monitors, that show up with the exact same name in the drop-down menu. ![Screen Shot 2019-05-13 at 18 46 21](https://user-images.githubusercontent.com/801539/57608364-2790b680-75b0-11e9-918b-487b50ee27e4.png) My modification includes an editable cell in the preferences view where a user can specify a more meaningful name ("Left Screen" and "Right Screen" for example") ![Screen Shot 2019-05-13 at 18 48 19](https://user-images.githubusercontent.com/801539/57608527-73dbf680-75b0-11e9-9563-c53789185297.png) These names are stored in preferences and then propagated through the UI. ![Screen Shot 2019-05-13 at 18 47 23](https://user-images.githubusercontent.com/801539/57608568-8ce4a780-75b0-11e9-8c0f-abe3ca710f11.png) A couple of things that are probably worth noting: 1. The added logic in the DispayPrefsViewController increased the cyclomatic complexity of the tableView function to > 12 which triggers a linting warning. I didn't want to go disassembling things in there too much in case you rejected the entire pull request. 2. I haven't provided any localized strings for German/French. Happy to roll them in either part of the acceptance of this PR, or in a future PR. It's been quite a while since I've done Prod level macOS development, so please feel free to critique anything you feel I need to address. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 07:02:59 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/MonitorControl#1040
No description provided.