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

commit 26b427933235f6ddddbe29841f293836941235d8
Author: James Buren <[email protected]>
Date:   Sat Mar 2 05:53:05 2013 -0600

remove locale custom UI. replaced by generic list UI.

diff --git a/new/fwsetup/local.h b/new/fwsetup/local.h
index e04c837..be0e02c 100644
--- a/new/fwsetup/local.h
+++ b/new/fwsetup/local.h
@@ -176,7 +176,6 @@ extern void ui_dialog_text(const char *title,const char 
*text);
extern bool ui_dialog_yesno(const char *title,const char *text,bool defaultno);
extern bool ui_dialog_progress(const char *title,const char *text,int percent);
extern bool ui_window_list(const char *title,const char *text,char 
**entries,char **entry);
-extern bool ui_window_locale(const char *var,char **locales,char **locale);
extern bool ui_window_layout(struct layout **layouts,struct layout **layout);
extern bool ui_window_partition(struct device **devices,struct disk **disks);
extern bool ui_window_format(struct format **targets);
diff --git a/new/fwsetup/locale.c b/new/fwsetup/locale.c
index dbb2e46..f0467e1 100644
--- a/new/fwsetup/locale.c
+++ b/new/fwsetup/locale.c
@@ -63,10 +63,13 @@ static bool locale_setup(void)

static bool locale_do_locale(void)
{
+  char text[TEXT_MAX] = {0};
const char *var = "LANG";
char *locale = 0;

-  if(!ui_window_locale(var,locales,&locale))
+  strfcpy(text,sizeof(text),LOCALE_TEXT,var);
+
+  if(!ui_window_list(LOCALE_TITLE,text,locales,&locale))
return false;

if(setenv(var,locale,true) == -1)
@@ -110,7 +113,9 @@ static bool locale_do_other_locales(void)
if(!ui_dialog_yesno(_("Other Locale Selections"),text,true))
continue;

-    if(!ui_window_locale(var,locales,&locale))
+    strfcpy(text,sizeof(text),LOCALE_TEXT,var);
+
+    if(!ui_window_list(LOCALE_TITLE,text,locales,&locale))
return false;

if(setenv(var,locale,true) == -1)
diff --git a/new/fwsetup/ui_newt.c b/new/fwsetup/ui_newt.c
index 4004479..ca35d18 100644
--- a/new/fwsetup/ui_newt.c
+++ b/new/fwsetup/ui_newt.c
@@ -967,86 +967,6 @@ extern bool ui_window_list(const char *title,const char 
*text,char **entries,cha
return true;
}

-extern bool ui_window_locale(const char *var,char **locales,char **locale)
-{
-  char text[TEXT_MAX] = {0};
-  int textbox_width = 0;
-  int textbox_height = 0;
-  int next_width = 0;
-  int next_height = 0;
-  int listbox_width = 0;
-  int listbox_height = 0;
-  newtComponent textbox = 0;
-  newtComponent next = 0;
-  newtComponent listbox = 0;
-  newtComponent form = 0;
-  struct newtExitStruct es = {0};
-  char **p = 0;
-
-  if(var == 0 || locales == 0 || locale == 0)
-  {
-    errno = EINVAL;
-    error(strerror(errno));
-    return false;
-  }
-
-  strfcpy(text,sizeof(text),LOCALE_TEXT,var);
-
-  if(!get_text_screen_size(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,LOCALE_TITLE) != 0)
-  {
-    eprintf("Failed to open a NEWT window.\n");
-    return false;
-  }
-
-  textbox = newtTextbox(0,0,textbox_width,textbox_height,0);
-
-  newtTextboxSetText(textbox,text);
-
-  next = 
newtButton(NEWT_WIDTH-next_width,NEWT_HEIGHT-next_height,NEXT_BUTTON_TEXT);
-
-  listbox = newtListbox(0,textbox_height+1,listbox_height,NEWT_FLAG_SCROLL);
-
-  newtListboxSetWidth(listbox,listbox_width);
-
-  for( p = locales ; *p != 0 ; ++p )
-    newtListboxAppendEntry(listbox,*p,*p);
-
-  newtListboxSetCurrent(listbox,0);
-
-  form = newtForm(0,0,NEWT_FLAG_NOF12);
-
-  newtFormAddComponents(form,textbox,next,listbox,(void *) 0);
-
-  newtFormSetCurrent(form,listbox);
-
-  while(true)
-  {
-    newtFormRun(form,&es);
-
-    if(es.reason == NEWT_EXIT_COMPONENT && es.u.co == next)
-    {
-      *locale = newtListboxGetCurrent(listbox);
-      break;
-    }
-  }
-
-  newtFormDestroy(form);
-
-  newtPopWindow();
-
-  return true;
-}
-
extern bool ui_window_layout(struct layout **layouts,struct layout **layout)
{
int textbox_width = 0;
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to