(Sorry, I send the email again because I forgot to put a subject.  Please
don't reply to my previous message.)

Hello all!

I started to work on an experimental branch to try to get ride of all
QAction dependencies in the core of stellarium.  This is something that
we could eventually merge in the simplegles-qml branch (the Qt5 branch).

The rational to remove QAction is that in Qt5 they are not part of
QtCore, but QtWidget, and they don't interact well with qml.

List of changes (sorry for the long mail):

- There is a new class StelAction, that behaves like a qt QAction, with
  the ability to handle secondary shortcuts.  This class replaces the
  current use of QAction and StelShortcut.

- All the StelAction are registered and connected by modules during
  initialization.  This is different from the current code where the
  actions are first created from the default_shortcut.json file, and then
  connected to the proper QObject slot during the gui and plugins
  initialization.

- To simplify the code, I added a method of StelModule that creates a new
  StelAction and automatically connects it to an object slot or property.
  The interesting thing is that using Qt class introspection, we can
  directly decide if the action is checkable or not.  Plus, when an
  action is linked to a Qt property that defines a signal handler, the
  change in the property will automatically change the state of the
  StelAction.  I think this has the potential to fix a few tricky issues
  with the synchronisation of GUI buttons and module states.

- StelAction are identified by the action id only, and not by the group
  id as it is currently the case.  The group id is now only used to sort
  the actions in the shortcut editor.  This makes the code much simpler,
  the drawback is that we have to ensure that all actions have unique
  names, but that can be enforced at runtime.

- This is not implemented yet, but I am thinking of replacing the json
  file to store the redefined shortcut, by a much simpler ini file (or
  even just as a '[shortcuts'] usection in config.ini).  It could simply
  be a list of <action-name> =
  <new-key-sequence><new-secondary-key-sequence>.

- I am also thinking of giving each script a default action name (for
  example "actionScript/landscapes.ssc"), that way we can also redefine
  their shortcut shortcuts in the .ini file with the same syntax.

I am still working on the branch, but I'd like your input on those changes.

This is the branch simplegles-qml-noqaction on launchpad.

Best regards,

    guillaume

-- 
Guillaume
guillaume.cher...@gmail.com
+886 970422910

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Stellarium-pubdevel mailing list
Stellarium-pubdevel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stellarium-pubdevel

Reply via email to