Bug 279372

Summary: Show combined file sizes when selection is done into icon-view
Product: [Applications] digikam Reporter: Eelis <bugs.kde.org>
Component: Albums-IconViewAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: caulier.gilles, iwannaberich, kartikx2000, metzpinguin
Priority: NOR    
Version: 1.9.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 7.0.0
Sentry Crash Report:

Description Eelis 2011-08-04 11:56:35 UTC
Version:           1.9.0 (using KDE 4.6.0) 
OS:                Linux

There does not appear to be a way to view the combined file size of a bunch of selected photos.

I'm thinking this could just be shown in the left side of the status bar where it currently says "X / Y items selected". It could be changed to say "X / Y items selected (A MiB / B MiB)".

Another neat (but strictly separate) feature would be if the combined file size could (optionally) be shown in tree views as well, analogous to the very useful "Show a count of items in tree views" option we already have.


Reproducible: Always



Expected Results:  
See above.
Comment 1 caulier.gilles 2015-05-10 14:27:34 UTC
I like this idea. 

But this will require to implement a stacked view on image properties tab from the right sidebar (where we show current selection info).

Typically, one item selected, we display all details about.
More than one item selected, we show statistic, including file selected size (and more if other ideas need to be done at this place)

What do you think about ?

Gilles
Comment 2 Kartik 2020-04-04 07:06:26 UTC
Hello Gilles,

I would like to fix the first part of this report. Displaying the sizes of the items selected as (A mB/B mB). 

I understand that I will need to make changes in the statusBarSelectionText of slotImageSelected in digikamapp.cpp. This method takes in ItemInfoList parameters, however ItemInfoList doesn't provide any convenience methods to return the sum of file sizes in the list. 

I may provide such a method in ItemInfoList, and subsequently use it in slotImageSelected, would it be appropriate?

Thanks
Kartik
Comment 3 Maik Qualmann 2020-04-04 07:15:38 UTC
An ItemInfoList is a QList with ItemInfo's. Look into the ItemInfo class, the ItemInfo also provides the file size. You only have to add up all ItemInfo's that are available in the ItemInfoList. I think the space in the status bar is getting scarce. I'm more for the solution Gilles suggests in comment 1.

Maik
Comment 4 Maik Qualmann 2020-04-04 08:26:08 UTC
You can also create a patch to display the file size in the status bar.

Maik
Comment 5 Kartik 2020-04-04 11:40:05 UTC
Hello Maik,

I've made a merge request to display File Size in status bar. I'm working on implementing the Right Side Bar currently.

https://invent.kde.org/kde/digikam/-/merge_requests/18
Comment 7 Kartik 2020-04-07 07:06:34 UTC
Hello Maik,

I had some doubts regarding the Stack View implementation. 

Currently, ItemPropertiesTab is inheriting DExpanderBox. I plan to implement a QStackedLayout within the constructor of ItemPropertiesTab, and instantiate two DExpanderBox for each of the pages of the Stack View, and populate them as in the current implementation.

I might still have to inherit DExpanderBox (or some other appropriate Class), to allow readSettings() and writeSettings().

Is this an appropriate implementation?

Thanks
Kartik.
Comment 8 caulier.gilles 2020-04-07 08:23:40 UTC
My stacked view proposal is more a top level challenge.

Typically, make a stacked view for the whole item properties sidebar tab, not only for few item inside.

On the stacked view you plug :

1 - the current item properties view used to show all information when 1 item is selected only.

2 - a new properties view to show a resume of all information when more than one items is selected. This will include the total size, the stats about different formats, etc...

The switch between 1 and 2 must be done somewhere on top level. 

Gilles Caulier
Comment 9 Kartik 2020-04-09 12:03:50 UTC
Hello Gilles,

I've submitted a patch for the implementation you suggested. 
https://invent.kde.org/kde/digikam/-/merge_requests/20

Thanks
Kartik
Comment 10 Maik Qualmann 2020-04-17 18:44:56 UTC
Kartik has added a selection properties tab. Additional properties can be added in the future. I now close the bug.


https://invent.kde.org/kde/digikam/-/merge_requests/20
https://invent.kde.org/kde/digikam/-/commit/58cd80536443903565f6655a78899a91bcb72399

Maik