Merge lp:~victored/beat-box/lp-914063 into lp:beat-box/1.x

Proposed by Victor Martinez
Status: Rejected
Rejected by: Victor Martinez
Proposed branch: lp:~victored/beat-box/lp-914063
Merge into: lp:beat-box/1.x
Diff against target: 86 lines (+17/-20)
1 file modified
src/Views/DeviceSummaryWidget.vala (+17/-20)
To merge this branch: bzr merge lp:~victored/beat-box/lp-914063
Reviewer Review Type Date Requested Status
Victor Martinez (community) Disapprove
BeatBox Team Pending
Review via email: mp+98959@code.launchpad.net

Commit message

Reflect actual free space on device piece bar (lp:914063)

Description of the change

Reflect actual free space on device piece bar (lp:914063)

To post a comment you must log in.
Revision history for this message
Danielle Foré (danrabbit) wrote :

Hey Victor, this appears to be working, but for some reason the numbers are reported a little differently in iOS. My iPhone claims that I have "7.5 GB Free of 13.7 GB" but Beatbox claims I have 8.3 GB Free of 14.8 GB"

I'm not sure if maybe iOS reserves 1 GB for downloads or something but I thought I'd mention it. Otherwise it appears to be working :)

Revision history for this message
Victor Martinez (victored) wrote :

That sounds like a logical explanation since we're about 1.1 GB (blame iOS's approximations here) above what iOS shows. You've found another by the way: our approximations are wrong too. With the current code, 8.39 GB would be displayed at 8.3 GB. We could either improve the approximations or show a second digit.

review: Needs Fixing
Revision history for this message
Victor Martinez (victored) wrote :

I wonder if BeatBox would actually use that reserved gigabyte while syncing the libraries.

Revision history for this message
Danielle Foré (danrabbit) wrote :

IF that's what it actually is, we might have to respect that just in case having a full disk causes problems/prevents updates/etc.

I would probably vote for making BeatBox's approximations a little smarter, but I'm sure that would be more work than just showing the extra digit xD

Revision history for this message
Victor Martinez (victored) :
review: Needs Resubmitting
Revision history for this message
Victor Martinez (victored) :
review: Disapprove

Unmerged revisions

594. By Victor Martinez

Reflect actual free space on device piece bar (lp:914063)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Views/DeviceSummaryWidget.vala'
2--- src/Views/DeviceSummaryWidget.vala 2012-03-18 23:26:20 +0000
3+++ src/Views/DeviceSummaryWidget.vala 2012-03-23 03:07:19 +0000
4@@ -45,6 +45,7 @@
5
6 int music_index;
7 int podcast_index;
8+ int files_index;
9 //int audiobook_index;
10
11 public DeviceSummaryWidget(LibraryManager lm, LibraryWindow lw, Device d) {
12@@ -82,7 +83,8 @@
13
14 music_index = spaceWidget.add_item(_("Music"), 0.0, SpaceWidget.ItemColor.BLUE);
15 podcast_index = spaceWidget.add_item(_("Podcasts"), 0.0, SpaceWidget.ItemColor.PURPLE);
16- //audiobook_index = spaceWidget.add_item("Audiobooks", 0.0, SpaceWidget.ItemColor.GREEN);
17+ files_index = spaceWidget.add_item(_("Other Files"), 0.0, SpaceWidget.ItemColor.GREEN);
18+ //audiobook_index = spaceWidget.add_item("Audiobooks", 0.0, SpaceWidget.ItemColor.RED);
19
20 refreshSpaceWidget();
21
22@@ -111,31 +113,22 @@
23
24 var syncOptionsBox = new VBox(false, 0);
25 syncOptionsBox.pack_start(musicBox, false, false, 0);
26- if(dev.supports_podcasts()) syncOptionsBox.pack_start(podcastBox, false, false, 0);
27- //if(dev.supports_audiobooks()) syncOptionsBox.pack_start(audiobookBox, false, false, 0);
28+
29+ if(dev.supports_podcasts())
30+ syncOptionsBox.pack_start(podcastBox, false, false, 0);
31+ //if(dev.supports_audiobooks())
32+ // syncOptionsBox.pack_start(audiobookBox, false, false, 0);
33
34 var syncHBox = new HBox(true, 6);
35 syncHBox.pack_start(syncOptionsLabel, false, true, 0);
36 syncHBox.pack_start(syncOptionsBox, false, true, 0);
37-
38- // create bottom section
39- //var syncBox = new VBox(false, 0);
40- //var syncButtonBox = new VButtonBox();
41- //syncButtonBox.set_layout(ButtonBoxStyle.END);
42- //syncButtonBox.pack_end(syncButton, false, false, 0);
43- //syncBox.pack_end(syncButton, false, false, 0);
44-
45- //var bottomBox = new HBox(false, 0);
46- //bottomBox.pack_start(deviceImage, false, true, 0);
47- //bottomBox.pack_start(spaceWidgetScroll, true, true, 0);
48- //bottomBox.pack_start(syncButtonBox, false, false, 0);
49-
50+
51 // put it all together
52 content.pack_start(deviceNameBox, false, true, 0);
53 content.pack_start(autoSyncBox, false, true, 0);
54 content.pack_start(syncHBox, false, true, 0);
55
56- /* put it in event box so we can color background white */
57+ // put it in event box so we can add custom theming
58 EventBox eb = new EventBox();
59
60 // add content-view styling
61@@ -222,10 +215,10 @@
62 }
63
64 void refreshSpaceWidget() {
65- double media_size = 0.0; double podcast_size = 0.0; /*double audiobook_size = 0.0;*/
66+ double music_size = 0.0, podcast_size = 0.0, other_files_size = 0.0; /*double audiobook_size = 0.0;*/
67
68 foreach(int i in dev.get_songs()) {
69- media_size += (double)(lm.media_from_id(i).file_size);
70+ music_size += (double)(lm.media_from_id(i).file_size);
71 }
72 foreach(int i in dev.get_podcasts()) {
73 podcast_size += (double)(lm.media_from_id(i).file_size);
74@@ -234,8 +227,12 @@
75 // audiobook_size += (double)(lm.media_from_id(i).file_size);
76 //}
77
78- spaceWidget.update_item_size(music_index, media_size);
79+ // Get other used space
80+ other_files_size = (double)dev.get_used_space()/1000000 - music_size - podcast_size;
81+
82+ spaceWidget.update_item_size(music_index, music_size);
83 spaceWidget.update_item_size(podcast_index, podcast_size);
84+ spaceWidget.update_item_size(files_index, other_files_size);
85 //spaceWidget.update_item_size(audiobook_index, audiobook_size);
86 }
87

Subscribers

People subscribed via source and target branches