Expose installer app title into config.ini. Prep for nsbeta2+ bug 38587.

[r=ssu]
This commit is contained in:
sgehani%netscape.com 2000-06-10 02:03:59 +00:00
Родитель 61506a1e9b
Коммит 51b3ef8145
4 изменённых файлов: 25 добавлений и 6 удалений

Просмотреть файл

@ -2,6 +2,7 @@
[General]
;-------------------------------------------------------------------------
Default Location=/u/sgehani/foo
Title=Le Mozilla Installer
;-------------------------------------------------------------------------

Просмотреть файл

@ -28,7 +28,7 @@
nsINIParser::nsINIParser(char *aFilename)
{
FILE *fd = NULL;
fpos_t eofpos = (fpos_t) NULL;
long eofpos = 0;
int rd = 0;
mFileBuf = NULL;
@ -51,7 +51,8 @@ nsINIParser::nsINIParser(char *aFilename)
/* get file size */
if (fseek(fd, 0, SEEK_END) != 0)
goto bail;
if (fgetpos(fd, &eofpos) != 0)
eofpos = ftell(fd);
if (eofpos == 0)
goto bail;
/* malloc an internal buf the size of the file */

Просмотреть файл

@ -28,12 +28,14 @@
nsXIContext *gCtx = NULL;
nsXInstaller::nsXInstaller()
nsXInstaller::nsXInstaller() :
mTitle(NULL)
{
}
nsXInstaller::~nsXInstaller()
{
XI_IF_FREE(mTitle);
XI_IF_DELETE(gCtx);
}
@ -121,7 +123,10 @@ nsXInstaller::RunWizard(int argc, char **argv)
gtk_widget_set_usize(gCtx->window, XI_WIN_WIDTH, XI_WIN_HEIGHT);
gtk_container_set_border_width(GTK_CONTAINER(gCtx->window), 5);
gtk_window_set_title(GTK_WINDOW(gCtx->window), "Mozilla Installer"); // XXX
if (mTitle)
gtk_window_set_title(GTK_WINDOW(gCtx->window), mTitle);
else
gtk_window_set_title(GTK_WINDOW(gCtx->window), DEFAULT_TITLE);
gtk_widget_show(gCtx->window);
// create and display the logo and cancel button
@ -274,13 +279,23 @@ int
nsXInstaller::ParseGeneral(nsINIParser *aParser)
{
int err = OK;
char *dest = NULL;
char *dest = NULL, *title = NULL;
int size = 0;
/* optional: destination directory can be specified in config.ini */
err = aParser->GetStringAlloc(GENERAL, DEFAULT_LOCATION, &dest, &size);
if (err == OK)
if (err == OK && size > 0)
gCtx->opt->mDestination = dest;
else
err = OK; /* optional so no error if we didn't find it */
/* optional: installer app window title */
size = 0;
err = aParser->GetStringAlloc(GENERAL, TITLE, &title, &size);
if (err == OK && size > 0)
mTitle = title;
else
err = OK; /* optional so no error if we didn't find it */
return err;
}

Просмотреть файл

@ -54,6 +54,8 @@ private:
GtkWidget *DrawLogo();
int DrawCancelButton(GtkWidget *aLogoVBox);
int DrawNavButtons();
char *mTitle;
};
int main(int argc, char **argv);