[MassifVisualizer] New feature proposal : Open differents files at one time

Milian Wolff mail at milianw.de
Wed Oct 30 11:00:39 UTC 2013


On Tuesday 29 October 2013 20:48:17 Arnold Dumas wrote:
> On 12.10.2013 11:16, Milian Wolff wrote:
> > On Friday 11 October 2013 19:12:34 Arnold Dumas wrote:
> >> Le 11/10/2013 09:46, Milian Wolff a écrit :
> >>> On Thursday 10 October 2013 18:03:50 Arnold Dumas wrote:
> >>>> Le 10/10/2013 14:55, Arnold Dumas a écrit :
> >>>>> Le 10/10/2013 14:51, Milian Wolff a écrit :
> >>>>>> On Tuesday 08 October 2013 19:37:34 Arnold Dumas wrote:
> >>>>>>> Hello everybody,
> >>>>>>> 
> >>>>>>> I've tought about a new feature for massif-visualizer. It could
> >>>>>>> be
> >>>>>>> nice
> >>>>>>> to open different massif.* at one time.
> >>>>>>> I've done some UI simulation, please see in the attachements.
> >>>>>>> Before
> >>>>>>> going through all the implementation stuff, I'd like to collect
> >>>>>>> some
> >>>>>>> feedback.
> >>>>>>> Do you guys think it worth it ?
> >>>>>> 
> >>>>>> Personally I just looked at the screenshot and didn't find any
> >>>>>> difference. A
> >>>>>> friend here had the same issue. Sideways tabs are I think not a
> >>>>>> good
> >>>>>> choice
> >>>>>> here, I'm afraid. They are not very well discoverable.
> >>>>>> 
> >>>>>> It is difficult though to find a proper GUI to enable an MDI in
> >>>>>> massif
> >>>>>> visualizer. Do you have any other ideas? Maybe we add the
> >>>>>> documents
> >>>>>> tab on top
> >>>>>> and put the graph tabs on bottom? I.e. similar to the custom
> >>>>>> allocators /
> >>>>>> massif data?
> >>>>>> 
> >>>>>> Bye
> >>>>> 
> >>>>> Actually it's not really eye-catching this way, I really need to
> >>>>> think
> >>>>> more about it.
> >>>>> Your idea seems to be good. I'll do some UI tests later on to see
> >>>>> what
> >>>>> is the best options.
> >>> 
> >>> Jup, that looks OK I think. Now, if you could add some icons to the
> >>> tabs
> >>> that would be even better. "office-chart-area-stacked" for the
> >>> stacked
> >>> diagram, and "kgraphviewer" for the callgraph tab. For the document
> >>> tabs
> >>> we can simply use "unknown" or maybe
> >>> "application-vnd.oasis.opendocument.chart". Otherwise try out
> >>> "kdialog
> >>> --geticon blub" and look at the icons to find something you think
> >>> could
> >>> fit.
> >>> 
> >>> Thanks for working on this!
> >>> 
> >>> PS: Please register on the Massif-Visualizer mailing list
> >>> (https://mail.kde.org/mailman/listinfo/massif-visualizer) so that I
> >>> don't
> >>> have to manually accept your emails every time there ;-)
> >> 
> >> I've already suscribed to the Massif-visualizer mailing list but when
> >> I
> >> attach an image, it sends an extra email to you to check wether it's
> >> spam or not.
> >> Regarding to your advices, I've improved the UI by adding the icons
> >> on
> >> each tabs.
> >> Should I consider this could be the "finalized" UI and work further
> >> on
> >> the code-side ?
> > 
> > Yep, that looks fine now.
> > 
> > Bye!
> 
> Hi,

Hey!

> I'm posting to show some improvments done to massif-visualizer.
> Due to problems to install kgraphviewer on my system, I didn't work on
> this part yet.

Yeah, KGraphViewer really needs some love with the recent graphviz changes...

> But apart from that, and from the reload method that
> isn't implemented yet, everything sould be working now. \o/
> To enable multi-document interface in massif-visualizer, I've basically
> replaced all MyClass m_something members by MyClass currentSomething()
> methods and QVector<MyClass> m_something. This way, all the existing
> logic is preserved.

This is not nice imo. Rather, extract the logic of a single document into its 
own class. This should basically be a QWidget which could internally use a tab 
widget for the graph viewer if available. Furthermore it needs an accessor to 
the data it represents, such that we can display it in the tree view to the 
right. Finally we need a way to forward the actions and settings from the 
mainwindow to each view, some slots should do I think. Do you agree that 
having the same settings in all views is good?

So essentially, we rip out most of the code which currently lives in the 
mainwindow and put it into a DocumentWidget or similar. The mainwindow then 
just instantiates the top-most tab widget, the dock widgets on the side and 
the actions and toolbar and the menu. When a file is opened, it adds a new 
DocumentWidget to its tab widget and hooks up the triggered signals of the 
toolbar/menu actions to the widget.

When a different file is selected, we swap the model of the tree view in the 
dockwidget and that should be it.

One more thing: You should enable the "document mode", i.e. 
setDocumentMode(true), on the top-most tab widget. This reduces the border-
clutter and should thus look better.

> Apropos of the parseWorker thread, a list of KUrl is maintained. This
> list contains all the files we want to be loaded. When the openFile
> method is called, if the parseWorker is running, the file is added to
> the list, and with a QTimer trick, the method openFileLater is called
> again and again untill the file is finally loaded. I know this is ugly
> but I didn't find any proper solution yet.

The worker thread needs to be replaced by a ThreadWeaver thread pool. Opening 
a file, we create the document widget (see above) and have it show the loading 
progress bar. Furthermore, a parse job is created and added to the weaver 
pool. Then the parse job emits a data-available signal once its finished 
parsing which is connected to the document widget where it is then used to 
replace the progress bar by the actual document contents.

> I've attached pictures to show the progress, please give some feedback.

Cool stuff. I hope you can sort out what I have in mind from the stuff I wrote 
above. Cheers and thanks for working on this!

Bye
-- 
Milian Wolff
mail at milianw.de
http://milianw.de


More information about the Massif-visualizer mailing list