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

commit 2fe77008f5774d6c35f2470cb73d53542532361b
Author: James Buren <[email protected]>
Date:   Wed Dec 5 07:51:28 2012 -0600

put some polishing touches on current window

diff --git a/src/ui_newt.c b/src/ui_newt.c
index 8e7b5b3..f8be164 100644
--- a/src/ui_newt.c
+++ b/src/ui_newt.c
@@ -420,7 +420,7 @@ static bool ui_dialog_partition_modify_partition(struct 
disk *disk,int n)

newtFormAddComponents(form,textbox,ok,cancel,checkbox,label,entry,listbox,(void 
*) 0);

-  newtFormSetCurrent(form,listbox);
+  newtFormSetCurrent(form,entry);

while(true)
{
@@ -431,7 +431,24 @@ static bool ui_dialog_partition_modify_partition(struct 
disk *disk,int n)
break;
}
else if(es.reason == NEWT_EXIT_COMPONENT && es.u.co == ok)
-    {
+    {
+      purpose = newtListboxGetCurrent(listbox);
+
+      if(!isasciistring(name) || strlen(name) > 36 || 
(strcmp(disk_get_type(disk),"gpt") != 0 && strcmp(purpose,"bios") == 0))
+      {
+        
ui_dialog_text(PARTITION_DIALOG_MODIFY_PARTITION_ERROR_TITLE,PARTITION_DIALOG_MODIFY_PARTITION_ERROR_TEXT);
+        continue;
+      }
+
+      if(strcmp(disk_get_type(disk),"gpt") == 0)
+        disk_partition_set_name(disk,n,name);
+
+      disk_partition_set_active(disk,n,(active == '*'));
+
+      disk_partition_set_purpose(disk,n,purpose);
+
+      modified = true;
+
break;
}
}
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to