Store visibility of right panels ("Variables", "Help", etc) separately for each worksheet
ClosedPublic

Authored by sirgienko on Jun 23 2018, 8:26 AM.

Diff Detail

Repository
R55 Cantor
Branch
right-dock-tab-improvments
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 566
Build 578: arc lint + arc unit
sirgienko created this revision.Jun 23 2018, 8:26 AM
Restricted Application added a project: KDE Edu. · View Herald TranscriptJun 23 2018, 8:26 AM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
sirgienko requested review of this revision.Jun 23 2018, 8:26 AM

This code works, but there are two problems

  1. I can't save, what right tab was choosen before user changes worksheet
  2. This code not good integrate in existing code

@asemke, I hope, you could help with second problem.

asemke added a comment.Jul 1 2018, 7:38 PM

This code works, but there are two problems

  1. I can't save, what right tab was choosen before user changes worksheet
  2. This code not good integrate in existing code @asemke, I hope, you could help with second problem.

We can add the information about the active panels to CantorPart directly. When switching between the different worksheets we can save the list of names of the opened panels to the corresponding CantorPart. This QStringList can be used as the paratemer in CantorShell::updateList() when the CantorPart/Worksheet gets activated again. With this there is no need to introduce a new class and to touch the already existing code.

sirgienko updated this revision to Diff 37020.Jul 1 2018, 9:17 PM

Change store code

asemke added inline comments.Jul 2 2018, 5:49 AM
src/cantor.h
109 ↗(On Diff #37020)

why not to use a more simpler container QMap<KParts::ReadWritePart*, QStringList> and to store the names of the visible panels only? We don't need to track the invisible panels explicitly. If the name is not in the list, the panel is invisible.

sirgienko added inline comments.Jul 2 2018, 7:17 AM
src/cantor.h
109 ↗(On Diff #37020)

When we disable all panels, names list will be empty.
When we create new worksheet names list also will be empty.
So, how we should differ this situations?

asemke added inline comments.Jul 2 2018, 10:04 AM
src/cantor.h
109 ↗(On Diff #37020)

When we create a new worksheet, there is not pointer/key for the Part in the map available yet. In this case we show all panels (default behaviour). For existing worksheets where the user closed all panels there will be a key in the map pointing to an empty QStringList.

asemke accepted this revision.Jul 2 2018, 7:31 PM
This revision is now accepted and ready to land.Jul 2 2018, 7:31 PM
This revision was automatically updated to reflect the committed changes.