--- np2/x11/gtk2/dialog_newdisk.c 2004/07/14 16:01:40 1.1 +++ np2/x11/gtk2/dialog_newdisk.c 2005/03/12 12:36:57 1.3 @@ -1,4 +1,4 @@ -/* $Id: dialog_newdisk.c,v 1.1 2004/07/14 16:01:40 monaka Exp $ */ +/* $Id: dialog_newdisk.c,v 1.3 2005/03/12 12:36:57 monaka Exp $ */ /* * Copyright (c) 2004 NONAKA Kimihiro @@ -12,8 +12,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -44,9 +42,10 @@ * create hard disk image */ -static int +static gint anex_newdisk_dialog(GtkWidget *dialog) { + static const int cnv[] = { 0, 1, 2, 3, 5, 6 }; static const int hddsize[] = { 5, 10, 15, 20, 30, 40 }; static int last = 0; @@ -81,14 +80,15 @@ anex_newdisk_dialog(GtkWidget *dialog) if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK) { for (i = 0; i < NELEMENTS(hddsize); i++) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button[i]))) { - return i; + last = i; + return cnv[i]; } } } - return 0; + return -1; } -static int +static gint t98_newdisk_dialog(GtkWidget *dialog, const int kind) { static const char *hddsizestr[] = { @@ -206,7 +206,7 @@ create_newdisk_hd_dialog(const char *fil switch (kind) { case 1: /* HDI */ hdsize = anex_newdisk_dialog(dialog); - if (hdsize > 0) { + if (hdsize >= 0) { newdisk_hdi(filename, hdsize); } break; @@ -226,7 +226,6 @@ create_newdisk_hd_dialog(const char *fil break; } gtk_widget_destroy(dialog); - }