improved popover (on first launch)
This commit is contained in:
parent
b637588228
commit
7a7d8f20ea
|
@ -81,7 +81,6 @@ extern os_log_t logHandle;
|
||||||
os_log_debug(logHandle, "is disabled, didn't start monitor");
|
os_log_debug(logHandle, "is disabled, didn't start monitor");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//automatically check for updates?
|
//automatically check for updates?
|
||||||
if(YES != [NSUserDefaults.standardUserDefaults boolForKey:PREF_NO_UPDATE_MODE])
|
if(YES != [NSUserDefaults.standardUserDefaults boolForKey:PREF_NO_UPDATE_MODE])
|
||||||
{
|
{
|
||||||
|
|
|
@ -54,7 +54,7 @@ enum menuItems
|
||||||
|
|
||||||
//first time?
|
//first time?
|
||||||
// show popover
|
// show popover
|
||||||
if(YES == [[[NSProcessInfo processInfo] arguments] containsObject:INITIAL_LAUNCH])
|
if(YES == [NSProcessInfo.processInfo.arguments containsObject:INITIAL_LAUNCH])
|
||||||
{
|
{
|
||||||
//dbg msg
|
//dbg msg
|
||||||
os_log_debug(logHandle, "initial launch, will show popover");
|
os_log_debug(logHandle, "initial launch, will show popover");
|
||||||
|
@ -136,7 +136,7 @@ enum menuItems
|
||||||
|
|
||||||
//show popover
|
//show popover
|
||||||
// have to wait cuz...
|
// have to wait cuz...
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1.0 * NSEC_PER_SEC), dispatch_get_main_queue(),
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1.5 * NSEC_PER_SEC), dispatch_get_main_queue(),
|
||||||
^{
|
^{
|
||||||
//show
|
//show
|
||||||
[self.popover showRelativeToRect:self.statusItem.button.bounds ofView:self.statusItem.button preferredEdge:NSMinYEdge];
|
[self.popover showRelativeToRect:self.statusItem.button.bounds ofView:self.statusItem.button preferredEdge:NSMinYEdge];
|
||||||
|
@ -144,7 +144,7 @@ enum menuItems
|
||||||
|
|
||||||
//wait a bit
|
//wait a bit
|
||||||
// then automatically hide popup if user has not closed it
|
// then automatically hide popup if user has not closed it
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 3 * NSEC_PER_SEC), dispatch_get_main_queue(),
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 3.5 * NSEC_PER_SEC), dispatch_get_main_queue(),
|
||||||
^{
|
^{
|
||||||
//still visible?
|
//still visible?
|
||||||
// close it then...
|
// close it then...
|
||||||
|
|
|
@ -1110,7 +1110,7 @@ BOOL toggleLoginItem(NSURL* loginItem, int toggleFlag)
|
||||||
if(ACTION_INSTALL_FLAG == toggleFlag)
|
if(ACTION_INSTALL_FLAG == toggleFlag)
|
||||||
{
|
{
|
||||||
//dbg msg
|
//dbg msg
|
||||||
os_log_debug(logHandle, "adding login item %@", loginItem);
|
os_log_debug(logHandle, "adding login item %{public}@", loginItem);
|
||||||
|
|
||||||
//grab existing login items
|
//grab existing login items
|
||||||
loginItems = LSSharedFileListCopySnapshot(loginItemsRef, nil);
|
loginItems = LSSharedFileListCopySnapshot(loginItemsRef, nil);
|
||||||
|
@ -1158,7 +1158,7 @@ BOOL toggleLoginItem(NSURL* loginItem, int toggleFlag)
|
||||||
if(NULL != itemRef)
|
if(NULL != itemRef)
|
||||||
{
|
{
|
||||||
//dbg msg
|
//dbg msg
|
||||||
os_log_debug(logHandle, "added %@/%@", loginItem, itemRef);
|
os_log_debug(logHandle, "added %{public}@/%{public}@", loginItem, itemRef);
|
||||||
|
|
||||||
//release
|
//release
|
||||||
CFRelease(itemRef);
|
CFRelease(itemRef);
|
||||||
|
|
Loading…
Reference in New Issue