~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201207201942

« back to all changes in this revision

Viewing changes to toolbox/toolboxShrink.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-10-18 12:28:19 UTC
  • mfrom: (1.1.7 upstream) (2.4.9 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091018122819-00vqew6m0ztpqcqp
Tags: 2009.10.15-201664-1
MergingĀ upstreamĀ versionĀ 2009.10.15-201664.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
   GtkWidget *viewport;
72
72
   GtkWidget *ebox;
73
73
 
74
 
   int i;
75
 
   WiperPartition_List *plist;
76
 
   WiperPartition *partkb;
 
74
   WiperPartition_List plist;
77
75
   gchar *items;
78
76
   int newrow;
79
77
 
155
153
            gtk_clist_set_selection_mode(GTK_CLIST(shrinkList), GTK_SELECTION_MULTIPLE);
156
154
 
157
155
            Wiper_Init(NULL);
158
 
            plist = WiperPartition_Open();
159
 
            if (plist != NULL) {
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;
 
158
 
 
159
               DblLnkLst_ForEachSafe(curr, next, &plist.link) {
 
160
                  WiperPartition *part = DblLnkLst_Container(curr, WiperPartition, link);
 
161
 
 
162
                  if (part->type != PARTITION_UNSUPPORTED) {
 
163
                     /*
 
164
                      * Detach the element we are interested in so it is not
 
165
                      * destroyed when we call WiperPartition_Close.
 
166
                      */
 
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,
167
 
                                            partkb);
 
170
                     gtk_clist_set_row_data_full(GTK_CLIST(shrinkList), newrow,
 
171
                                 part, (GDestroyNotify)WiperSinglePartition_Close);
168
172
                  }
169
173
               }
170
 
               WiperPartition_Close(plist);
 
174
               WiperPartition_Close(&plist);
171
175
            }
172
176
         } else {
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);
187
 
 
188
191
      }
189
192
   }
190
193
 
229
232
      }
230
233
      do {
231
234
         rnum =  GPOINTER_TO_UINT(slist->data);
232
 
         part = (WiperPartition *)(gtk_clist_get_row_data(GTK_CLIST(shrinkList),
233
 
                                                          rnum));
 
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.");
248
250
            }
249
251
            gtk_clist_unselect_all(GTK_CLIST(shrinkList));
250
252
         }