New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open Event in Calendar #79
Conversation
} | ||
|
||
// try to open to specific event | ||
@objc func openCalendarEvent(_: Any? = nil){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried a bunch of things but can't get the event identifier passed in as an argument!
Could you (@leits or anyone else) point me in the right direction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take a look at this, I have already implemented this here, so it shouldn't be much different
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea I'm a bit mixed on this too, but often when I'm looking at the details for an event I just want to click so the calendar comes up to that event. We can take the option out of the main menu but leave it in the submenu for each event?
Or if possible make it such that clicking anywhere in the submenu will open the calendar event? But I couldn't figure out how to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the modifier flags to do a different action when clicking with specific keys
// Open in Calendar | ||
eventMenu.addItem( | ||
withTitle: "Open in Calendar", | ||
action: #selector(AppDelegate.openCalendarEvent), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
event.eventIdentifier
contains the identifier string needed for ical://ekevent/\(identifier)
@@ -102,6 +102,12 @@ class StatusBarItemControler { | |||
action: #selector(AppDelegate.createMeeting), | |||
keyEquivalent: "") | |||
createItem.setShortcut(for: .createMeetingShortcut) | |||
|
|||
self.item.menu!.addItem( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is relevant to add a button to open the Calendar when you could just use Spotlight?
} | ||
|
||
// try to open to specific event | ||
@objc func openCalendarEvent(_: Any? = nil){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take a look at this, I have already implemented this here, so it shouldn't be much different
@@ -184,6 +184,29 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele | |||
|
|||
completionHandler() | |||
} | |||
|
|||
// just opens the calendar | |||
@objc func openCalendar(_: Any? = nil) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer not to add more responsibilities to the AppDelegate, what do you think @leits ?
Should we have another class in charge of all this actions?
0012f95
to
f9cf8e9
Compare
Status
IN DEVELOPMENT
Description
Tries to open the calendar to a specific event.
In response to #59