Redesigning Lokalize's Translation Memory Tab - GSoC Week 2 and 3
The past two weeks went by fast. The learnings I gained while building the toy project I experimented around with Qt during Contribution Period are quite useful now. In the second week of GSoC, I ported the TM Manager from a separate dialogbox to TM Tab. It was done mainly for ease and with the reasoning that everything related to TMs can be in a single place. I kept most of the things as is. A lot of thought went into the UI Design.
The TM Manager is currently a standalone window which is accesible from any tab.

The "Manage Translation Memories" option is already available in the Tools Menu and again in the ToolBar of TM Tab since it's specific to it.

After the changes, pressing F7 or "Translation Memory" option from Tools menu will directly lead to TM Manager too as it is set on the left of TM Tab with a QSplitter. I believe this takes away a little redundancy in the design. This change is also justified pertaing to the future changes regarding Multi-TM selection and quering.

The buttons restrict resizing the splitter horizontally. Intially I put all the actions in a QToolButton as I thought putting them in a right-click context menu might render them undiscovered. But such menus were already being used in some other parts of the app( and obviously other KDE apps).
From coding perspective, all I had to do was instantiate it in TM Tab instead. Since, it was no longer being used as a window( which would also have worked), it no longer inherits from KMainWindow. It used Grid Layout which I think is not exactly needed and just used a VBoxLayout for simplicity.
The splitter state is saved and restored using existing methods.
The obsolete references and methods for TM Manager are cleaned up.
During Week 3, I added checkboxes to DBFilesModel for TM selection which will be used in querying later in TM View for suggestions, autofill etc. and TM Tab for search. In th beginning of the project, I proposed adding another proxy layer over DBFilesModel for the checkboxes to not to disturb other things. But for ease of work, consistent architecture( couldn't find multiple proxy layers being used in the codebase) and with the solace that it won't impact other methods using DBFilesModel for their specific purpose, I went ahead to add checkboxes directly to it.

This is a deviation from my GSoc Proposal wherein I proposed to replace Combo Box with a List Widget having entries with checkboxes for Multi-TM selection. Since there would be TM dbs on the left of the tab anyways, I thought of enabling selection there itself, than to have two places(TM Manager and the List Widget) listing all the TMs.
Setting new flag for checking, showing checked state with data() and storing selected TM names to a set is done. The checked state persistence is to be worked upon. This is where I got stuck. TM names were to be saved and loaded from global and local config based on user's selection but when my mentor reviewed that this complex setup probably is not the best, we reached back to translators who originally requested the feature.