Keep catalog entry selected

19 views
Skip to first unread message

Craig Francis

unread,
Aug 24, 2012, 10:31:25 AM8/24/12
to quicksilver-...@googlegroups.com
I'm fairly new to ObjectiveC, but with my basic plugin, the entry that appears in the "Catalog / Plugins" keeps getting de-selected each time I restart Quicksilver.

Any thoughts?
Presume I'm missing something in the plist file?

Rob McBroom

unread,
Aug 24, 2012, 2:08:49 PM8/24/12
to quicksilver-...@googlegroups.com
On Aug 24, 2012, at 10:31 AM, Craig Francis <craig....@gmail.com> wrote:

I'm fairly new to ObjectiveC, but with my basic plugin, the entry that appears in the "Catalog / Plugins" keeps getting de-selected each time I restart Quicksilver.

Any thoughts?

Tried it out and I get the same thing. If I look at my Catalog.plist, it's not there. I'm guessing it's just the bug where Quicksilver doesn't always save changes to catalog entries when it should. See Patrick's comment on the issue.

Presume I'm missing something in the plist file?

I don't think so, but you could add a boolean named "enabled" to turn it on by default.

But honestly, for something like this, it's unlikely that you'll be able to include a useful preset. People probably have such things spread all over the place. You can add an interface that lets users create custom entries. I recently figured out the process and did it for Spotlight and Remote Hosts. I tried to document the steps.


But I may have missed something. If you get stuck, best thing to do is look at a working plug-in.

Let us know if you have further questions.

-- 
Rob McBroom
<http://www.skurfer.com/>

Craig Francis

unread,
Sep 3, 2012, 1:55:21 PM9/3/12
to quicksilver-...@googlegroups.com, mailin...@skurfer.com
Hi Rob,

Thanks for getting back to me (unfortunately I didn't get a notification, hence the delay).

I have noticed that the AddressBook module sometimes adds a key in "Catalog.plist" under "enabledPresets".

        <key>enabledPresets</key>
        <dict>
                <key>QSPresetAddressBook</key>
                <true/>
        </dict>

However this does seem a little buggy... as in, quite often I would un-check it in the catalog, it won't update the "Catalog.plist", and on re-start it would re-enable it (default on? - I would like that!)

Going into in their source code, this key only appears in the plist QSPresetAdditions... which I have, and have pretty much copied:


As to your comment about adding a boolean named "enabled", I'm not sure what you mean by that, the guide only really seems to talk about it in the contexts of an "action":


The "QSObjectSources" dictionary (which I think it what it uses) only stores the class:


I've also tried editing the "Catalog.plist" file by hand to include:

        <key>enabledPresets</key>
        <dict>
                <key>QSPresetAddressBook</key>
                <true/>
                <key>QSProjectsFolder</key>
                <true/>
        </dict>

But that doesn't work either :-S

I also noticed these two functions in the AddressBook module, and just tried copying them over (just incase they might do it):

- (BOOL)usesGlobalSettings {return YES;}
- (BOOL)scanInMainThread { return YES;}


Thanks for your help so far though.

Craig

Rob McBroom

unread,
Sep 4, 2012, 9:07:33 AM9/4/12
to quicksilver-...@googlegroups.com
On Sep 3, 2012, at 1:55 PM, Craig Francis <craig....@gmail.com> wrote:

I have noticed that the AddressBook module sometimes adds a key in "Catalog.plist" under "enabledPresets".

        <key>enabledPresets</key>
        <dict>
                <key>QSPresetAddressBook</key>
                <true/>
        </dict>

However this does seem a little buggy... as in, quite often I would un-check it in the catalog, it won't update the "Catalog.plist", and on re-start it would re-enable it (default on? - I would like that!)

Yes, I think that's just #569 again. You wouldn't want it to enable things you've disabled, but you can have it on by default (meaning the first time the plug-in is loaded). That's what adding a boolean for "enabled" should do.

As to your comment about adding a boolean named "enabled", I'm not sure what you mean by that, the guide only really seems to talk about it in the contexts of an "action":

Somewhere in this dictionary, add this:

<key>enabled</key>
<true/>

Which can also be done in Xcode's GUI, of course, but it's not as easy to explain. Like I said, that only determines the state when the preset is seen for the first time, so you might not see any difference unless to remove references to it from your Catalog.plist and make it look "new".

The guide talks about QSPresetAdditions, but since the contents are tailored to the specific object source and its options, it's not really covered other than to say go look at examples from other plug-ins.

Craig Francis

unread,
Sep 5, 2012, 5:35:58 AM9/5/12
to quicksilver-...@googlegroups.com, mailin...@skurfer.com
Thanks Rob, 

The enabled key in "QSPresetAdditions > Item 0" seems to work.

So I'm happy, and it does everything I need it to do.

But I must admit, I am unsure how the AddressBook module does it:


As it seems to enable it by default, without that key... not that it really matters though.

Anyway, thanks again, thats been really helpful.

Craig

Rob McBroom

unread,
Sep 5, 2012, 9:47:52 AM9/5/12
to quicksilver-...@googlegroups.com
On Sep 5, 2012, at 5:35 AM, Craig Francis <craig....@gmail.com> wrote:

> The enabled key in "QSPresetAdditions > Item 0" seems to work.
>
> So I'm happy, and it does everything I need it to do.

Good.

> But I must admit, I am unsure how the AddressBook module does it:
>
> https://github.com/quicksilver/com.apple.AddressBook-qsplugin/blob/master/Info.plist#L131
>
> As it seems to enable it by default, without that key... not that it really matters though.

My educated guess is that it defaults to enabling new presets if they don't say one way or the other. I know you have evidence to the contrary that inspired this thread in the first place, but I'm sticking with it. :-)

Craig Francis

unread,
Sep 5, 2012, 10:27:05 AM9/5/12
to quicksilver-...@googlegroups.com, mailin...@skurfer.com
On Wednesday, 5 September 2012 14:48:03 UTC+1, Rob McBroom wrote:
My educated guess is that it defaults to enabling new presets if they don't say one way or the other. I know you have evidence to the contrary that inspired this thread in the first place, but I'm sticking with it. :-)


That seems fair enough... looks like QuickSilver is a complicated beast (and with good reason, considering everything its trying to do).
Reply all
Reply to author
Forward
0 new messages