Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fwlive.git;a=commitdiff;h=ff07f2a447e56101fc3540e0615759655ad000ea

commit ff07f2a447e56101fc3540e0615759655ad000ea
Author: James Buren <[email protected]>
Date:   Thu Nov 8 03:53:23 2012 -0600

extend the new UI skeleton
add basic main window text

diff --git a/src/text.h b/src/text.h
index d12298e..4b73e32 100644
--- a/src/text.h
+++ b/src/text.h
@@ -15,10 +15,12 @@
#define PASSWORD_SHORT_TEXT _("Your password must be at least 6 characters 
long.\n")
#define PASSWORD_MISMATCH_TITLE _("Passwords Do Not Match")
#define PASSWORD_MISMATCH_TEXT _("The passwords you have entered do not 
match.\n")
+#define PARTITION_TITLE _("Partition Setup")
+#define PARTITION_TEXT _("Select a disk device to setup a new partition 
table.\nSelect a partition to modify its parameters.\nSelect a disk device's 
free space to setup a new partition.\n")
#define FORMAT_TITLE _("Device Setup")
#define FORMAT_TEXT _("Select a device to setup from the list below.\n")
#define FORMAT_DIALOG_TITLE _("Filesystem Setup")
-#define FORMAT_DIALOG_TEXT _("Please select mount path, parameters, and 
filesystem.\nMount path is optional if 'swap' is the selected 
filesystem.\nParameters are custom arguments passed to the format 
program.\nSelect 'noformat' if you wish to reuse the existing filesystem.\n")
+#define FORMAT_DIALOG_TEXT _("Select mount path, parameters, and 
filesystem.\nMount path is optional if 'swap' is the selected 
filesystem.\nParameters are custom arguments passed to the format 
program.\nSelect 'noformat' if you wish to reuse the existing filesystem.\n")
#define FORMAT_PATH_TITLE _("Invalid Filesystem Parameters")
#define FORMAT_PATH_TEXT _("You have specified invalid parameters.\nPlease 
check that they meet the following requirements:\n\nMount path must begin with 
a '/'.\nMount path may only contain one directory.\nMount path must not already 
be in use.\n'noformat' cannot be chosen if there is no existing filesystem.\n")
#define FORMAT_MOUNT_ENTRY_TEXT _("Mount Path")
diff --git a/src/ui_newt.c b/src/ui_newt.c
index 13dc311..73a3132 100644
--- a/src/ui_newt.c
+++ b/src/ui_newt.c
@@ -479,6 +479,42 @@ extern bool ui_window_partition(struct device 
**devices,struct disk **disks)
return false;
}

+  if(!get_text_screen_size(PARTITION_TEXT,&textbox_width,&textbox_height))
+    return false;
+
+  if(!get_button_screen_size(NEXT_BUTTON_TEXT,&next_width,&next_height))
+    return false;
+
+  listbox_width = NEWT_WIDTH;
+
+  listbox_height = NEWT_HEIGHT - textbox_height - next_height - 2;
+
+  if(newtCenteredWindow(NEWT_WIDTH,NEWT_HEIGHT,PARTITION_TITLE) != 0)
+  {
+    eprintf("Failed to open a NEWT window.\n");
+    return false;
+  }
+
+  textbox = newtTextbox(0,0,textbox_width,textbox_height,0);
+
+  newtTextboxSetText(textbox,PARTITION_TEXT);
+
+  next = 
newtButton(NEWT_WIDTH-next_width,NEWT_HEIGHT-next_height,NEXT_BUTTON_TEXT);
+
+  listbox = 
newtListbox(0,textbox_height+1,listbox_height,NEWT_FLAG_RETURNEXIT|NEWT_FLAG_SCROLL);
+
+  newtListboxSetWidth(listbox,listbox_width);
+
+  form = newtForm(0,0,NEWT_FLAG_NOF12);
+
+  newtFormAddComponents(form,textbox,next,listbox,(void *) 0);
+
+  newtFormSetCurrent(form,listbox);
+
+  newtFormDestroy(form);
+
+  newtPopWindow();
+
return true;
}
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to