Skip to content
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

Closed
wants to merge 2 commits into from
Closed

Conversation

dev10110
Copy link
Contributor

Status

IN DEVELOPMENT

Description

Tries to open the calendar to a specific event.

In response to #59

}

// try to open to specific event
@objc func openCalendarEvent(_: Any? = nil){
Copy link
Contributor Author

@dev10110 dev10110 Sep 16, 2020

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?

Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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),
Copy link
Contributor Author

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(
Copy link
Contributor

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){
Copy link
Contributor

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) {
Copy link
Contributor

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?

@leits leits self-requested a review September 21, 2020 09:41
@leits leits self-assigned this Sep 21, 2020
@leits leits added the feature New feature or request label Sep 21, 2020
@leits leits force-pushed the master branch 2 times, most recently from 0012f95 to f9cf8e9 Compare September 30, 2020 15:15
@leits
Copy link
Owner

leits commented Nov 24, 2020

@leits leits closed this Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants