alternative-browser-select branch

13 views
Skip to first unread message

hiroshi saito

unread,
Jan 5, 2010, 11:13:30 AM1/5/10
to wave-notifie...@googlegroups.com
Brandon,

Thanks for the branch

At first it failed to launch on my mac:

2010-01-06 00:46:47.927 Unofficial Google Wave Notifier[1091:10b] Path
(null) given to -[NSWorkspace iconForFile:] is not a full path.
2010-01-06 00:46:47.961 Unofficial Google Wave Notifier[1091:10b] ***
Assertion failure in -[NSMenuItem
initWithTitle:action:keyEquivalent:],
/SourceCache/AppKit/AppKit-949.54/Menus.subproj/NSMenuItem.m:182
2010-01-06 00:46:47.961 Unofficial Google Wave Notifier[1091:10b] An
uncaught exception was raised
2010-01-06 00:46:47.963 Unofficial Google Wave Notifier[1091:10b]
Invalid parameter not satisfying: aString != nil
2010-01-06 00:46:47.963 Unofficial Google Wave Notifier[1091:10b] ***
Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: 'Invalid parameter not
satisfying: aString != nil'

This happen when a browser app doesn't have app icon. MobileSafari.app
of iPhoneSDK is a case.

However I'v done a small fix.
http://github.com/hiroshi/Unofficial-Google-Wave-Notifier/commit/5f0c3534c67f2044ae4bbe622aa1037726239b40#comment_40950

Nice popup menu with icon!

I didn't see the changes of codes well yet, but I'll do.
--
Hiroshi Saito

Brandon

unread,
Jan 5, 2010, 3:56:05 PM1/5/10
to Wave Notifier for Mac dev
Thanks for catching that. For whatever reason, that problem wasn't
happening on my machine, even with the same missing icon you referred
too (MobileSafari.app).

Let me know if there is anything else i should do or if it's Ok as is
and ready to be pulled into the master in your repo.

B


On Jan 5, 8:13 am, hiroshi saito <hiroshi3...@gmail.com> wrote:
> Brandon,
>
> Thanks for the branch
>
> At first it failed to launch on my mac:
>
> 2010-01-06 00:46:47.927 Unofficial Google Wave Notifier[1091:10b] Path
> (null) given to -[NSWorkspace iconForFile:] is not a full path.
> 2010-01-06 00:46:47.961 Unofficial Google Wave Notifier[1091:10b] ***
> Assertion failure in -[NSMenuItem
> initWithTitle:action:keyEquivalent:],
> /SourceCache/AppKit/AppKit-949.54/Menus.subproj/NSMenuItem.m:182
> 2010-01-06 00:46:47.961 Unofficial Google Wave Notifier[1091:10b] An
> uncaught exception was raised
> 2010-01-06 00:46:47.963 Unofficial Google Wave Notifier[1091:10b]
> Invalid parameter not satisfying: aString != nil
> 2010-01-06 00:46:47.963 Unofficial Google Wave Notifier[1091:10b] ***
> Terminating app due to uncaught exception
> 'NSInternalInconsistencyException', reason: 'Invalid parameter not
> satisfying: aString != nil'
>
> This happen when a browser app doesn't have app icon. MobileSafari.app
> of iPhoneSDK is a case.
>

> However I'v done a small fix.http://github.com/hiroshi/Unofficial-Google-Wave-Notifier/commit/5f0c...

hiroshi saito

unread,
Jan 6, 2010, 10:54:54 AM1/6/10
to wave-notifie...@googlegroups.com
Sorry, It made a mistake that the culprit isn't MobileSafari.

In my popup menu there are two safari. One of them doesn't have icon.
http://dl.dropbox.com/u/348426/browser-select.png

From output of experiments/launch_service_test,
"org.participatoryculture.Democracy" seems to be a same position of
no-icon safari.

$ ./experiments/launch_service_test
2010-01-07 00:39:47.816 launch_service_test[1738:10b] browsers: (
"com.google.Chrome",
"com.apple.safari",
"org.participatoryculture.Democracy",
"org.webkit.nightly.WebKit",
"org.songbirdnest.songbird",
"com.RealNetworks.RealPlayer",
"com.apple.mobilesafari",
"org.mozilla.firefox",
"com.evernote.Evernote"
)

I cannot found the Democracy.app. Maybe I deleted it from disk long ago.
I don't know why the system has inconsistent list...

---
Hiroshi

hiroshi saito

unread,
Jan 6, 2010, 11:04:30 AM1/6/10
to wave-notifie...@googlegroups.com
Brandon,

> Let me know if there is anything else i should do or if it's Ok as is
> and ready to be pulled into the master in your repo.

Give me a time to review the code.
At this moment, I feel uneasy about
SettingsWindowController.m has unnecessary wide scope variables
and
a some of global variables.

--
Hiroshi

On Wed, Jan 6, 2010 at 5:56 AM, Brandon <bmte...@gmail.com> wrote:

Brandon

unread,
Jan 6, 2010, 11:52:59 AM1/6/10
to Wave Notifier for Mac dev
Hiroshi,

Specifically does NSPopUpButton being a public property and
WaveClientBundleIDKey being an extern make you uneasy?

I can remove the property with no issue but i think the NSUserDefaults
keys should be accessible from anywhere, doesn't have to be an extern
though.

B


On Jan 6, 8:04 am, hiroshi saito <hiroshi3...@gmail.com> wrote:
> Brandon,
>

Brandon

unread,
Jan 7, 2010, 12:41:37 AM1/7/10
to Wave Notifier for Mac dev

After thinking about this for a bit, I believe the problem is because
the Democracy.app file was deleted but not the
org.participatoryculture.Democracy.plist from ~/Library/Preferences/
which would explain the system reporting an application that handles
the HTTPS schema but doesn't actually exist.

B

On Jan 6, 7:54 am, hiroshi saito <hiroshi3...@gmail.com> wrote:
> Sorry, It made a mistake that the culprit isn't MobileSafari.
>

> In my popup menu there are two safari. One of them doesn't have icon.http://dl.dropbox.com/u/348426/browser-select.png

hiroshi saito

unread,
Jan 9, 2010, 12:36:55 PM1/9/10
to wave-notifie...@googlegroups.com
Brandon,

You know, as a programmer I think global variable are evil. On the
other hand, I learnt that Apple uses extern for constant like
NSStrings (e.g. NSFontAttributeName).

Even if we follow Apple's convention, we should reduce dependencies
against such implementation details. To do that extern declarations
and the variable definition are remove from AppDelegate.m and
SettingsWindowsController.[mh] and add new files like constatns.[hm]
to store and declare global variables and include(import) the header
form rest of them. I think it seems to be an overkill. Instead, how
about using old plain macro?

constants.h:
#define WaveClientBundleIDKey @"WaveClientBundleID"

See http://github.com/hiroshi/Unofficial-Google-Wave-Notifier/commits/alternative-browser-select

As you know, I used NSString literals for keys. They are vulnerable
against typos. I'll refactor them with same strategy.

I'm afraid that this seems to be a trivial topic, but consistency
among the codes is necessary to keep the code is maintainable...
--
Hiroshi

Brandon

unread,
Jan 10, 2010, 5:19:36 PM1/10/10
to Wave Notifier for Mac dev
Hiroshi,

I typically use #define macros in a constants file as well but was
attempting to follow the more Apple convention of the extern. If
macros are your preference, I have no problem with that and will
follow that convention.

Brandon

On Jan 9, 9:36 am, hiroshi saito <hiroshi3...@gmail.com> wrote:
> Brandon,
>

> You know, as a programmer I think global variable are evil. On the
> other hand, I learnt that Apple uses extern for constant like
> NSStrings (e.g. NSFontAttributeName).
>
> Even if we follow Apple's convention, we should reduce dependencies
> against such implementation details. To do that extern declarations
> and the variable definition are remove from AppDelegate.m and
> SettingsWindowsController.[mh] and add new files like constatns.[hm]
> to store and declare global variables and include(import) the header
> form rest of them. I think it seems to be an overkill. Instead, how
> about using old plain macro?
>
> constants.h:
> #define WaveClientBundleIDKey @"WaveClientBundleID"
>

> Seehttp://github.com/hiroshi/Unofficial-Google-Wave-Notifier/commits/alt...

hiroshi saito

unread,
Jan 10, 2010, 9:39:30 PM1/10/10
to wave-notifie...@googlegroups.com
Brandon,

I just wouldn't like to have extern every file. I think extern
declarations in headers and hiding variable definitions strategy is
suitable for frameworks or libraries.

--
Hiroshi

--
==========
齋藤 宏
Hiroshi Saito
hiros...@gmail.com
http://blog.yakitara.com/
http://github.com/hiroshi
http://www.linkedin.com/pub/hiroshi-saito/8/aab/260

hiroshi saito

unread,
Jan 11, 2010, 3:11:05 AM1/11/10
to wave-notifie...@googlegroups.com
Brandon,

I did found that reset button doesn't work for the popup button.
"Path to Ruby" setting uses Cocoa Bindings so that
-[NSUserDefaultController revertToInitialValues:] will work.

Is it possible to use Cocoa Bindings for the popup?

--
Hiroshi

Reply all
Reply to author
Forward
0 new messages