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

Allow multiple submenus (Issue #13 & Issue #26) #36

Closed
wants to merge 5 commits into from

Conversation

thoro
Copy link
Contributor

@thoro thoro commented Jul 17, 2013

Moved the submenu creation into separate methods which allows for a
recursive menu generation and therefore multiple submenus

Moved the submenu creation into separate methods which allows for a
recursive menu generation and therefore multiple submenus
@fitztrev
Copy link
Owner

Could you please share a sample config file to demonstrate the nested menu functionality? I was unable to get it working.

@thoro
Copy link
Contributor Author

thoro commented Jul 20, 2013

I've added a sample section to the default config, I opted to use the Dictionary within Array syntax you used for the "hosts" property.

Maybe we could change the group definition into something similar to the item definition - to add additional properties!

Updated the path expansion to work with ~
@thoro
Copy link
Contributor Author

thoro commented Jul 20, 2013

I added a sample for the icon, I noticed that it won't expand tildes so I added that too.

@numberwhun
Copy link

I downloaded the newest version from the website (which I assume is the newest), and I am unable to get the sub-submenu's working.

Here is what I was hoping to support:

{
"hosts": [
{
"sublevel 1": [
{
"name": "test",
"cmd": ""
}
{
"sub-sublevel": [
{
"name": "test",
"cmd": ""
}
]
}
]
}
]
}

Is this possible?

@thoro
Copy link
Contributor Author

thoro commented Jul 20, 2013

Yes it is possible, just that the current master doesn't have this pull request embedded ;-)

And you are missing a comma:

"cmd": ""
}, <-----
{
"sub-sublevel": [

I've merged it in mine and you can download the code here: https://github.com/Thoro/shuttle

@numberwhun
Copy link

I typed that in and missed that, sorry! I just downloaded and tested and its working perfectly. Thank you! You guys rock! I will keep testing and open tickets if I find anything.

@fitztrev
Copy link
Owner

@thoro Just tested it. Works well. 👍

Would you have any desire to expand this same functionality to support submenus with .ssh/config files?

Host Group1/Subgroup1/web01.example.com

@thoro
Copy link
Contributor Author

thoro commented Jul 25, 2013

Yeah, but in that move I'd like to add subclasses for a Menu and a MenuItem, to better support future functionality. I'm having my eye on automation through applescript and a bunch of additional properties!

The ssh_config parsing now creates an equivalent to the parsed JSON
content and appends it to the read config.

The parsed content then gets modeled into a Class-Hierarchy - for
future extensibility.

Finally the Class-Hierarchy is converted into a NSMenu tree
@thoro
Copy link
Contributor Author

thoro commented Jul 25, 2013

I added a bunch of functionality and prepared it for future extension via a class hierarchy for the menu items, I've also added "sort_alphabetical" as a option as requested in #47 - but maybe we have to rename my option (I think the name is not quite right)

@fitztrev
Copy link
Owner

Nested menus have now been added in 89e05b8. See a couple example config files to see how they can be implemented.

@thoro Thank you very much for your contribution.

@fitztrev fitztrev closed this Nov 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants