LibreCAD 3 GUI Revamp – GSoC 2020 Final Report

This is my final report for GSoC 2020. I’ve finished all my tasks laid out in my proposal and also managed to get a few more tasks done. I’d like to thank my mentors Florian and Armin for their tremendous help and swift reply to my doubts. I’d also like to thank members of the community like Rupak Bajgain, Guruprasad Rane and flywire for their help and advice.

Major PRs :-

Other PRs :-

Important Links :-


Brief description of work done

GUI shift from Lua to C++

  • The GUI has been entirely shifted from lua to C++.
  • Created MainWindow class, updated layer,toolbar,clicommand classes.
  • All qt related code removed from qtbridge, now renamed to lua bridge.
  • All lua ui files removed.

Lua GUI API

  • Added Lua GUI API to allow lua plugin scripts to interact with the gui elements like the mainwindow, toolbar buttons, menu buttons, layer, clicommand etc.
  • Added many dialog widget GUI classes, which allow the user to form his own gui widget for the user using a plugin.
  • Lua GUI API Documentation added to the wiki.

Unit Tests

  • Updated unit tests for the widgets like layers, clicommand, toolbar and mainwindow unit tests.
  • Added Lua GUI API unit tests

Operation Loading

Loading of operation and generation and connection of the correct buttons, menu items, cli commands, context operations etc happen automatically by using the properties specified in the beginning of each lua operation file, making it easier to add new lua files without needing to change code elsewhere

Customize Toolbar Widget

  • Ability to customize and order the toolbar buttons in the user’s desired order
  • Order can be saved and loaded by the user (saved in json format)
  • Added ui settings json file which stores ui settings and is validated by a schema on loading.

Property Editor

  • Property editor added which allows the user to change the properties of the created entities, the change in properties updates the entity with new properties instantaneously.
  • Uses the input gui widgets developed earlier in the lua gui api.
  • Also contains meta info and layer properties.

Context Menu

  • Context menu can be opened by right clicking, it has three states, active,inactive and selected.
  • Can easily access create and modify tools using the context menu
  • Contains undo, last command, copy, paste etc.
  • Allows transition between different methods while creating an entity.

Other

  • Copying and pasting of entities among different librecadv3 windows.
  • Few missing arc operations implemented.
  • Added text operations lua file and a text dialog which allows adding more customized text with different style and font.

What I’ve learned

GSoC at librecad has been a great learning experience for me and I had a lot of fun working on the project. Some of the things I’ve learned

  • Gained confidence in writing C++ object oriented code, as well learned the importance of writing comments and readable code.
  • Learnt lua while preparing and working on my gsoc project.
  • Learnt how to work with tools like CMake, which I was initially intimidated by but am now fairly comfortable with.
  • Learnt the importance of approaching problems properly, like how florian pointed out that using the visitor design pattern in a certain problem was better than the approach I was going for.
  • Gained confidence in using git and github, learning how to work with branches, squash commits, merge etc.
  • Learnt how to use the Qt framework and about qt’s signal and slots system, model/view programming etc.
  • Importance of discussing the task and problem, instead of diving head first into implementing it, and to also take into account the user’s perspective.
  • Learned how to properly debug and track down problems.

I was lucky to have great mentors to help guide me through the summer, Florian has been extremely helpful and responsive from the very start when I started contributing at the end of December. Armin too has been very helpful and made the setting up of the required accounts for wiki and the blog a breeze.

Thanks for taking the time to read my final report, I’d again like to thank everyone involved for their help and advice. GSoC was a great experience and has helped me gain confidence to continue contributing to LibreCAD and other open source organizations in the future.

Akhil Nair

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.