155
153
gtk_clist_set_selection_mode(GTK_CLIST(shrinkList), GTK_SELECTION_MULTIPLE);
157
155
Wiper_Init(NULL);
158
plist = WiperPartition_Open();
160
for (i=0; i < plist->size; i++) {
161
if (strlen(plist->partitions[i].comment) == 0) {
162
partkb = (WiperPartition *)malloc(sizeof (WiperPartition));
163
memcpy(partkb, &(plist->partitions[i]), sizeof (WiperPartition));
164
items = partkb->mountPoint;
156
if (WiperPartition_Open(&plist)) {
157
DblLnkLst_Links *curr, *next;
159
DblLnkLst_ForEachSafe(curr, next, &plist.link) {
160
WiperPartition *part = DblLnkLst_Container(curr, WiperPartition, link);
162
if (part->type != PARTITION_UNSUPPORTED) {
164
* Detach the element we are interested in so it is not
165
* destroyed when we call WiperPartition_Close.
167
DblLnkLst_Unlink1(&part->link);
168
items = part->mountPoint;
165
169
newrow = gtk_clist_append(GTK_CLIST(shrinkList), &items);
166
gtk_clist_set_row_data(GTK_CLIST(shrinkList), newrow,
170
gtk_clist_set_row_data_full(GTK_CLIST(shrinkList), newrow,
171
part, (GDestroyNotify)WiperSinglePartition_Close);
170
WiperPartition_Close(plist);
174
WiperPartition_Close(&plist);
173
177
label = gtk_label_new(SHRINK_DISABLED_ERR);
184
188
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
185
189
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
186
190
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
231
234
rnum = GPOINTER_TO_UINT(slist->data);
232
part = (WiperPartition *)(gtk_clist_get_row_data(GTK_CLIST(shrinkList),
235
part = gtk_clist_get_row_data(GTK_CLIST(shrinkList), rnum);
234
236
if (Shrink_DoWipe(part, mainWnd)) {
235
237
disks_to_shrink++;
236
238
slist = slist->next;
244
246
if (ToolsMain_YesNoBox("Shrink Disk",
245
247
"Do you want to shrink the disk(s)?\n")) {
246
248
if (GuestApp_DiskShrink()) {
247
ToolsMain_MsgBox("Information", "The shrink process is complete.");
249
ToolsMain_MsgBox("Information", "The shrink process has finished.");
249
251
gtk_clist_unselect_all(GTK_CLIST(shrinkList));