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

commit f8823c7654d85c61559b0eab8fa7c5159a772bd5
Author: James Buren <[email protected]>
Date:   Wed Oct 24 21:44:26 2012 -0500

adjust text alignment and ensure a listbox entry is highlighted after config

diff --git a/src/format.c b/src/format.c
index 6070314..5450dfe 100644
--- a/src/format.c
+++ b/src/format.c
@@ -108,7 +108,7 @@ static bool format_setup(void)

target->devicepath = strdup(device_get_path(device));

-      size_to_string(buf,PATH_MAX,device_get_size(device),true);
+      size_to_string(buf,PATH_MAX,device_get_size(device),false);

target->size = strdup(buf);

@@ -135,7 +135,7 @@ static bool format_setup(void)

target->devicepath = strdup(buf);

-        size_to_string(buf,PATH_MAX,disk_partition_get_size(disk,i),true);
+        size_to_string(buf,PATH_MAX,disk_partition_get_size(disk,i),false);

target->size = strdup(buf);

diff --git a/src/ui_newt.c b/src/ui_newt.c
index 8e1266a..9be35ce 100644
--- a/src/ui_newt.c
+++ b/src/ui_newt.c
@@ -502,11 +502,13 @@ extern bool ui_window_format(struct format **targets)
{
struct format *target = *p;

-    snprintf(text,NEWT_WIDTH+1,"%11s %s 
%8s",target->devicepath,target->size,target->filesystem);
+    snprintf(text,NEWT_WIDTH+1,"%11s %11s 
%11s",target->devicepath,target->size,target->filesystem);

newtListboxAppendEntry(listbox,text,target);
}

+  newtListboxSetCurrentByKey(listbox,targets[0]);
+
form = newtForm(0,0,NEWT_FLAG_NOF12);

newtFormAddComponents(form,textbox,next,listbox,(void *) 0);
@@ -525,11 +527,13 @@ extern bool ui_window_format(struct format **targets)

if(target->newfilesystem != 0 && target->options != 0 && target->mountpath != 0)
{
-        snprintf(text,NEWT_WIDTH+1,"%11s %s %8s 
%5s",target->devicepath,target->size,target->newfilesystem,target->mountpath);
+        snprintf(text,NEWT_WIDTH+1,"%11s %11s %11s 
%11s",target->devicepath,target->size,target->newfilesystem,target->mountpath);

newtListboxInsertEntry(listbox,text,target,target);

-        newtListboxDeleteEntry(listbox,target);
+        newtListboxDeleteEntry(listbox,target);
+
+        newtListboxSetCurrentByKey(listbox,target);
}

continue;
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to