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
=== modified file 'src/Views/DeviceSummaryWidget.vala'
--- src/Views/DeviceSummaryWidget.vala 2012-03-18 23:26:20 +0000
+++ src/Views/DeviceSummaryWidget.vala 2012-03-23 03:07:19 +0000
@@ -45,6 +45,7 @@
45 45
46 int music_index;46 int music_index;
47 int podcast_index;47 int podcast_index;
48 int files_index;
48 //int audiobook_index;49 //int audiobook_index;
49 50
50 public DeviceSummaryWidget(LibraryManager lm, LibraryWindow lw, Device d) {51 public DeviceSummaryWidget(LibraryManager lm, LibraryWindow lw, Device d) {
@@ -82,7 +83,8 @@
8283
83 music_index = spaceWidget.add_item(_("Music"), 0.0, SpaceWidget.ItemColor.BLUE);84 music_index = spaceWidget.add_item(_("Music"), 0.0, SpaceWidget.ItemColor.BLUE);
84 podcast_index = spaceWidget.add_item(_("Podcasts"), 0.0, SpaceWidget.ItemColor.PURPLE);85 podcast_index = spaceWidget.add_item(_("Podcasts"), 0.0, SpaceWidget.ItemColor.PURPLE);
85 //audiobook_index = spaceWidget.add_item("Audiobooks", 0.0, SpaceWidget.ItemColor.GREEN);86 files_index = spaceWidget.add_item(_("Other Files"), 0.0, SpaceWidget.ItemColor.GREEN);
87 //audiobook_index = spaceWidget.add_item("Audiobooks", 0.0, SpaceWidget.ItemColor.RED);
86 88
87 refreshSpaceWidget();89 refreshSpaceWidget();
88 90
@@ -111,31 +113,22 @@
111 113
112 var syncOptionsBox = new VBox(false, 0);114 var syncOptionsBox = new VBox(false, 0);
113 syncOptionsBox.pack_start(musicBox, false, false, 0);115 syncOptionsBox.pack_start(musicBox, false, false, 0);
114 if(dev.supports_podcasts()) syncOptionsBox.pack_start(podcastBox, false, false, 0);116
115 //if(dev.supports_audiobooks()) syncOptionsBox.pack_start(audiobookBox, false, false, 0);117 if(dev.supports_podcasts())
118 syncOptionsBox.pack_start(podcastBox, false, false, 0);
119 //if(dev.supports_audiobooks())
120 // syncOptionsBox.pack_start(audiobookBox, false, false, 0);
116 121
117 var syncHBox = new HBox(true, 6);122 var syncHBox = new HBox(true, 6);
118 syncHBox.pack_start(syncOptionsLabel, false, true, 0);123 syncHBox.pack_start(syncOptionsLabel, false, true, 0);
119 syncHBox.pack_start(syncOptionsBox, false, true, 0);124 syncHBox.pack_start(syncOptionsBox, false, true, 0);
120 125
121 // create bottom section
122 //var syncBox = new VBox(false, 0);
123 //var syncButtonBox = new VButtonBox();
124 //syncButtonBox.set_layout(ButtonBoxStyle.END);
125 //syncButtonBox.pack_end(syncButton, false, false, 0);
126 //syncBox.pack_end(syncButton, false, false, 0);
127
128 //var bottomBox = new HBox(false, 0);
129 //bottomBox.pack_start(deviceImage, false, true, 0);
130 //bottomBox.pack_start(spaceWidgetScroll, true, true, 0);
131 //bottomBox.pack_start(syncButtonBox, false, false, 0);
132
133 // put it all together126 // put it all together
134 content.pack_start(deviceNameBox, false, true, 0);127 content.pack_start(deviceNameBox, false, true, 0);
135 content.pack_start(autoSyncBox, false, true, 0);128 content.pack_start(autoSyncBox, false, true, 0);
136 content.pack_start(syncHBox, false, true, 0);129 content.pack_start(syncHBox, false, true, 0);
137 130
138 /* put it in event box so we can color background white */131 // put it in event box so we can add custom theming
139 EventBox eb = new EventBox();132 EventBox eb = new EventBox();
140 133
141 // add content-view styling134 // add content-view styling
@@ -222,10 +215,10 @@
222 }215 }
223 216
224 void refreshSpaceWidget() {217 void refreshSpaceWidget() {
225 double media_size = 0.0; double podcast_size = 0.0; /*double audiobook_size = 0.0;*/218 double music_size = 0.0, podcast_size = 0.0, other_files_size = 0.0; /*double audiobook_size = 0.0;*/
226 219
227 foreach(int i in dev.get_songs()) {220 foreach(int i in dev.get_songs()) {
228 media_size += (double)(lm.media_from_id(i).file_size);221 music_size += (double)(lm.media_from_id(i).file_size);
229 }222 }
230 foreach(int i in dev.get_podcasts()) {223 foreach(int i in dev.get_podcasts()) {
231 podcast_size += (double)(lm.media_from_id(i).file_size);224 podcast_size += (double)(lm.media_from_id(i).file_size);
@@ -234,8 +227,12 @@
234 // audiobook_size += (double)(lm.media_from_id(i).file_size);227 // audiobook_size += (double)(lm.media_from_id(i).file_size);
235 //}228 //}
236 229
237 spaceWidget.update_item_size(music_index, media_size);230 // Get other used space
231 other_files_size = (double)dev.get_used_space()/1000000 - music_size - podcast_size;
232
233 spaceWidget.update_item_size(music_index, music_size);
238 spaceWidget.update_item_size(podcast_index, podcast_size);234 spaceWidget.update_item_size(podcast_index, podcast_size);
235 spaceWidget.update_item_size(files_index, other_files_size);
239 //spaceWidget.update_item_size(audiobook_index, audiobook_size);236 //spaceWidget.update_item_size(audiobook_index, audiobook_size);
240 }237 }
241 238

Subscribers

People subscribed via source and target branches