added a scrolled window in page 2, since the list of directories is too

* app/gui/user-install-dialog.c (user_install_dialog_run): added a
	scrolled window in page 2, since the list of directories is too long
	to fit in a 1024x768 screen.  The user install dialog should now fit
	into a 800x600 screen.  This should close #122211
This commit is contained in:
David Odin 2003-12-22 19:47:05 +00:00
parent ecedfa1131
commit 0632251cff
3 changed files with 345 additions and 324 deletions

View File

@ -1,3 +1,10 @@
2003-12-22 DindinX <david@dindinx.org>
* app/gui/user-install-dialog.c (user_install_dialog_run): added a
scrolled window in page 2, since the list of directories is too long
to fit in a 1024x768 screen. The user install dialog should now fit
into a 800x600 screen. This should close #122211
2003-12-21 Michael Natterer <mitch@gimp.org> 2003-12-21 Michael Natterer <mitch@gimp.org>
* plug-ins/common/convmatrix.c: indentation & whitespace cleanup. * plug-ins/common/convmatrix.c: indentation & whitespace cleanup.

View File

@ -322,7 +322,7 @@ tree_items[] =
static void static void
user_install_notebook_set_page (GtkNotebook *notebook, user_install_notebook_set_page (GtkNotebook *notebook,
gint index) gint index)
{ {
GtkWidget *page; GtkWidget *page;
gchar *title; gchar *title;
@ -437,8 +437,8 @@ user_install_response (GtkWidget *widget,
static gboolean static gboolean
user_install_corner_expose (GtkWidget *widget, user_install_corner_expose (GtkWidget *widget,
GdkEventExpose *eevent, GdkEventExpose *eevent,
gpointer data) gpointer data)
{ {
GtkCornerType corner; GtkCornerType corner;
@ -463,46 +463,46 @@ user_install_corner_expose (GtkWidget *widget,
{ {
case GTK_CORNER_TOP_LEFT: case GTK_CORNER_TOP_LEFT:
gdk_draw_arc (widget->window, gdk_draw_arc (widget->window,
widget->style->white_gc, widget->style->white_gc,
TRUE, TRUE,
0, 0, 0, 0,
widget->allocation.width * 2, widget->allocation.width * 2,
widget->allocation.height * 2, widget->allocation.height * 2,
90 * 64, 90 * 64,
180 * 64); 180 * 64);
break; break;
case GTK_CORNER_BOTTOM_LEFT: case GTK_CORNER_BOTTOM_LEFT:
gdk_draw_arc (widget->window, gdk_draw_arc (widget->window,
widget->style->white_gc, widget->style->white_gc,
TRUE, TRUE,
0, -widget->allocation.height, 0, -widget->allocation.height,
widget->allocation.width * 2, widget->allocation.width * 2,
widget->allocation.height * 2, widget->allocation.height * 2,
180 * 64, 180 * 64,
270 * 64); 270 * 64);
break; break;
case GTK_CORNER_TOP_RIGHT: case GTK_CORNER_TOP_RIGHT:
gdk_draw_arc (widget->window, gdk_draw_arc (widget->window,
widget->style->white_gc, widget->style->white_gc,
TRUE, TRUE,
-widget->allocation.width, 0, -widget->allocation.width, 0,
widget->allocation.width * 2, widget->allocation.width * 2,
widget->allocation.height * 2, widget->allocation.height * 2,
0 * 64, 0 * 64,
90 * 64); 90 * 64);
break; break;
case GTK_CORNER_BOTTOM_RIGHT: case GTK_CORNER_BOTTOM_RIGHT:
gdk_draw_arc (widget->window, gdk_draw_arc (widget->window,
widget->style->white_gc, widget->style->white_gc,
TRUE, TRUE,
-widget->allocation.width, -widget->allocation.height, -widget->allocation.width, -widget->allocation.height,
widget->allocation.width * 2, widget->allocation.width * 2,
widget->allocation.height * 2, widget->allocation.height * 2,
270 * 64, 270 * 64,
360 * 64); 360 * 64);
break; break;
default: default:
@ -514,8 +514,8 @@ user_install_corner_expose (GtkWidget *widget,
static GtkWidget * static GtkWidget *
user_install_notebook_append_page (GtkNotebook *notebook, user_install_notebook_append_page (GtkNotebook *notebook,
gchar *title, gchar *title,
gchar *footer, gchar *footer,
gint vbox_spacing) gint vbox_spacing)
{ {
GtkWidget *page; GtkWidget *page;
@ -531,7 +531,7 @@ user_install_notebook_append_page (GtkNotebook *notebook,
static void static void
add_label (GtkBox *box, add_label (GtkBox *box,
gchar *text) gchar *text)
{ {
GtkWidget *label; GtkWidget *label;
@ -548,7 +548,7 @@ add_label (GtkBox *box,
static void static void
user_install_sel_changed (GtkTreeSelection *sel, user_install_sel_changed (GtkTreeSelection *sel,
gpointer data) gpointer data)
{ {
GtkNotebook *notebook = GTK_NOTEBOOK (data); GtkNotebook *notebook = GTK_NOTEBOOK (data);
GtkTreeModel *model; GtkTreeModel *model;
@ -563,12 +563,12 @@ user_install_sel_changed (GtkTreeSelection *sel,
static void static void
user_install_tv_fix_size_request (GtkWidget *widget, user_install_tv_fix_size_request (GtkWidget *widget,
GtkAllocation *allocation) GtkAllocation *allocation)
{ {
gtk_widget_set_size_request (widget, allocation->width, allocation->height); gtk_widget_set_size_request (widget, allocation->width, allocation->height);
g_signal_handlers_disconnect_by_func (widget, g_signal_handlers_disconnect_by_func (widget,
user_install_tv_fix_size_request, user_install_tv_fix_size_request,
NULL); NULL);
} }
void void
@ -594,12 +594,12 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
dialog = user_install_dialog = dialog = user_install_dialog =
gimp_dialog_new (_("GIMP User Installation"), "user_installation", gimp_dialog_new (_("GIMP User Installation"), "user_installation",
NULL, 0, NULL, 0,
NULL, NULL, NULL, NULL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
_("Continue"), GTK_RESPONSE_OK, _("Continue"), GTK_RESPONSE_OK,
NULL); NULL);
g_signal_connect (dialog, "response", g_signal_connect (dialog, "response",
G_CALLBACK (user_install_response), G_CALLBACK (user_install_response),
@ -639,7 +639,7 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
page_style->base[GTK_STATE_NORMAL] = white_color; page_style->base[GTK_STATE_NORMAL] = white_color;
page_style->color_flags[GTK_STATE_NORMAL] |= (GTK_RC_FG | GTK_RC_BG | page_style->color_flags[GTK_STATE_NORMAL] |= (GTK_RC_FG | GTK_RC_BG |
GTK_RC_TEXT | GTK_RC_BASE); GTK_RC_TEXT | GTK_RC_BASE);
page_style->fg[GTK_STATE_ACTIVE] = black_color; page_style->fg[GTK_STATE_ACTIVE] = black_color;
page_style->bg[GTK_STATE_ACTIVE] = white_color; page_style->bg[GTK_STATE_ACTIVE] = white_color;
@ -724,7 +724,7 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
G_CALLBACK (user_install_corner_expose), G_CALLBACK (user_install_corner_expose),
GINT_TO_POINTER (GTK_CORNER_TOP_LEFT)); GINT_TO_POINTER (GTK_CORNER_TOP_LEFT));
gtk_table_attach (GTK_TABLE (table), darea, 0, 1, 0, 1, gtk_table_attach (GTK_TABLE (table), darea, 0, 1, 0, 1,
GTK_SHRINK, GTK_SHRINK, 0, 0); GTK_SHRINK, GTK_SHRINK, 0, 0);
gtk_widget_show (darea); gtk_widget_show (darea);
darea = gtk_drawing_area_new (); darea = gtk_drawing_area_new ();
@ -734,7 +734,7 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
G_CALLBACK (user_install_corner_expose), G_CALLBACK (user_install_corner_expose),
GINT_TO_POINTER (GTK_CORNER_BOTTOM_LEFT)); GINT_TO_POINTER (GTK_CORNER_BOTTOM_LEFT));
gtk_table_attach (GTK_TABLE (table), darea, 0, 1, 2, 3, gtk_table_attach (GTK_TABLE (table), darea, 0, 1, 2, 3,
GTK_SHRINK, GTK_SHRINK, 0, 0); GTK_SHRINK, GTK_SHRINK, 0, 0);
gtk_widget_show (darea); gtk_widget_show (darea);
notebook = gtk_notebook_new (); notebook = gtk_notebook_new ();
@ -747,16 +747,16 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
/* Page 1 */ /* Page 1 */
page = user_install_notebook_append_page (GTK_NOTEBOOK (notebook), page = user_install_notebook_append_page (GTK_NOTEBOOK (notebook),
_("Welcome to\n" _("Welcome to\n"
"The GIMP User Installation"), "The GIMP User Installation"),
_("Click \"Continue\" to enter " _("Click \"Continue\" to enter "
"the GIMP user installation."), "the GIMP user installation."),
16); 16);
add_label (GTK_BOX (page), add_label (GTK_BOX (page),
_("<b>The GIMP - GNU Image Manipulation Program</b>\n" _("<b>The GIMP - GNU Image Manipulation Program</b>\n"
"Copyright (C) 1995-2003\n" "Copyright (C) 1995-2003\n"
"Spencer Kimball, Peter Mattis and the GIMP Development Team.")); "Spencer Kimball, Peter Mattis and the GIMP Development Team."));
sep = gtk_hseparator_new (); sep = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (page), sep, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (page), sep, FALSE, FALSE, 2);
@ -785,6 +785,7 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
{ {
GtkWidget *hbox; GtkWidget *hbox;
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *scr;
GtkWidget *tv; GtkWidget *tv;
GdkPixbuf *file_pixbuf; GdkPixbuf *file_pixbuf;
GdkPixbuf *folder_pixbuf; GdkPixbuf *folder_pixbuf;
@ -800,9 +801,9 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
gint i; gint i;
page = user_install_notebook_append_page (GTK_NOTEBOOK (notebook), page = user_install_notebook_append_page (GTK_NOTEBOOK (notebook),
_("Personal GIMP Folder"), _("Personal GIMP Folder"),
_("Click \"Continue\" to create " _("Click \"Continue\" to create "
"your personal GIMP folder."), "your personal GIMP folder."),
0); 0);
hbox = gtk_hbox_new (FALSE, 16); hbox = gtk_hbox_new (FALSE, 16);
@ -810,7 +811,7 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
gtk_widget_show (hbox); gtk_widget_show (hbox);
tree = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING, GDK_TYPE_PIXBUF, tree = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING, GDK_TYPE_PIXBUF,
G_TYPE_INT); G_TYPE_INT);
tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (tree)); tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (tree));
g_object_unref (tree); g_object_unref (tree);
@ -819,20 +820,26 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
cell = gtk_cell_renderer_pixbuf_new (); cell = gtk_cell_renderer_pixbuf_new ();
gtk_tree_view_column_pack_start (column, cell, FALSE); gtk_tree_view_column_pack_start (column, cell, FALSE);
gtk_tree_view_column_set_attributes (column, cell, gtk_tree_view_column_set_attributes (column, cell,
"pixbuf", PIXBUF_COLUMN, "pixbuf", PIXBUF_COLUMN,
NULL); NULL);
cell = gtk_cell_renderer_text_new (); cell = gtk_cell_renderer_text_new ();
gtk_tree_view_column_pack_start (column, cell, TRUE); gtk_tree_view_column_pack_start (column, cell, TRUE);
gtk_tree_view_column_set_attributes (column, cell, gtk_tree_view_column_set_attributes (column, cell,
"text", DIRENT_COLUMN, "text", DIRENT_COLUMN,
NULL); NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tv), column); gtk_tree_view_append_column (GTK_TREE_VIEW (tv), column);
PAGE_STYLE (tv); PAGE_STYLE (tv);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tv), FALSE); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tv), FALSE);
gtk_box_pack_start (GTK_BOX (hbox), tv, FALSE, FALSE, 0); scr = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (hbox), scr, FALSE, FALSE, 0);
gtk_widget_show (scr);
gtk_container_add (GTK_CONTAINER (scr), tv);
gtk_widget_show (tv); gtk_widget_show (tv);
vbox = gtk_vbox_new (FALSE, 8); vbox = gtk_vbox_new (FALSE, 8);
@ -840,15 +847,15 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
gtk_widget_show (vbox); gtk_widget_show (vbox);
str = g_strdup_printf (_("For a proper GIMP installation, a folder named\n" str = g_strdup_printf (_("For a proper GIMP installation, a folder named\n"
"'<b>%s</b>' needs to be created."), "'<b>%s</b>' needs to be created."),
gimp_directory ()); gimp_directory ());
add_label (GTK_BOX (vbox), str); add_label (GTK_BOX (vbox), str);
g_free (str); g_free (str);
add_label (GTK_BOX (vbox), add_label (GTK_BOX (vbox),
_("This folder will contain a number of important files.\n" _("This folder will contain a number of important files.\n"
"Click on one of the files or folders in the tree\n" "Click on one of the files or folders in the tree\n"
"to get more information about the selected item.")); "to get more information about the selected item."));
notebook2 = gtk_notebook_new (); notebook2 = gtk_notebook_new ();
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook2), FALSE); gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook2), FALSE);
@ -863,8 +870,8 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tv)); sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tv));
g_signal_connect (sel, "changed", g_signal_connect (sel, "changed",
G_CALLBACK (user_install_sel_changed), G_CALLBACK (user_install_sel_changed),
notebook2); notebook2);
file_pixbuf = gtk_widget_render_icon (tv, file_pixbuf = gtk_widget_render_icon (tv,
GTK_STOCK_NEW, GTK_ICON_SIZE_MENU, GTK_STOCK_NEW, GTK_ICON_SIZE_MENU,
@ -875,10 +882,10 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
gtk_tree_store_append (tree, &iter, NULL); gtk_tree_store_append (tree, &iter, NULL);
gtk_tree_store_set (tree, &iter, gtk_tree_store_set (tree, &iter,
DIRENT_COLUMN, gimp_directory (), DIRENT_COLUMN, gimp_directory (),
PIXBUF_COLUMN, folder_pixbuf, PIXBUF_COLUMN, folder_pixbuf,
DESC_COLUMN, 0, DESC_COLUMN, 0,
-1); -1);
for (i = 0; i < G_N_ELEMENTS (tree_items); i++) for (i = 0; i < G_N_ELEMENTS (tree_items); i++)
{ {
@ -887,43 +894,43 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
if (!tree_items[i].description) if (!tree_items[i].description)
continue; continue;
gtk_tree_store_append (tree, &child, &iter); gtk_tree_store_append (tree, &child, &iter);
gtk_tree_store_set (tree, &child, gtk_tree_store_set (tree, &child,
DIRENT_COLUMN, tree_items[i].name, DIRENT_COLUMN, tree_items[i].name,
PIXBUF_COLUMN, PIXBUF_COLUMN,
tree_items[i].directory ? folder_pixbuf tree_items[i].directory ? folder_pixbuf
: file_pixbuf, : file_pixbuf,
DESC_COLUMN, i + 1, DESC_COLUMN, i + 1,
-1); -1);
page2 = gtk_vbox_new (FALSE, 8); page2 = gtk_vbox_new (FALSE, 8);
foo = g_strdup_printf ("<b>%s</b>", tree_items[i].name); foo = g_strdup_printf ("<b>%s</b>", tree_items[i].name);
label = gtk_label_new (NULL); label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), foo); gtk_label_set_markup (GTK_LABEL (label), foo);
g_free (foo); g_free (foo);
PAGE_STYLE (label); PAGE_STYLE (label);
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
gtk_box_pack_start (GTK_BOX (page2), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (page2), label, FALSE, FALSE, 0);
gtk_widget_show (label); gtk_widget_show (label);
label = gtk_label_new (gettext (tree_items[i].description)); label = gtk_label_new (gettext (tree_items[i].description));
PAGE_STYLE (label); PAGE_STYLE (label);
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
gtk_box_pack_start (GTK_BOX (page2), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (page2), label, FALSE, FALSE, 0);
gtk_widget_show (label); gtk_widget_show (label);
gtk_widget_show (page2); gtk_widget_show (page2);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook2), page2, NULL); gtk_notebook_append_page (GTK_NOTEBOOK (notebook2), page2, NULL);
} }
gtk_tree_view_expand_all (GTK_TREE_VIEW (tv)); gtk_tree_view_expand_all (GTK_TREE_VIEW (tv));
g_signal_connect (tv, "size_allocate", g_signal_connect (tv, "size_allocate",
G_CALLBACK (user_install_tv_fix_size_request), G_CALLBACK (user_install_tv_fix_size_request),
NULL); NULL);
g_object_unref (file_pixbuf); g_object_unref (file_pixbuf);
g_object_unref (folder_pixbuf); g_object_unref (folder_pixbuf);
@ -932,7 +939,7 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
/* Page 3 */ /* Page 3 */
page = log_page = page = log_page =
user_install_notebook_append_page (GTK_NOTEBOOK (notebook), user_install_notebook_append_page (GTK_NOTEBOOK (notebook),
_("User Installation Log"), _("User Installation Log"),
_("Please wait while your personal\n" _("Please wait while your personal\n"
"GIMP folder is being created..."), "GIMP folder is being created..."),
0); 0);
@ -940,28 +947,28 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
/* Page 4 */ /* Page 4 */
page = tuning_page = page = tuning_page =
user_install_notebook_append_page (GTK_NOTEBOOK (notebook), user_install_notebook_append_page (GTK_NOTEBOOK (notebook),
_("GIMP Performance Tuning"), _("GIMP Performance Tuning"),
_("Click \"Continue\" to accept the settings above."), _("Click \"Continue\" to accept the settings above."),
24); 24);
add_label (GTK_BOX (page), add_label (GTK_BOX (page),
_("<b>For optimal GIMP performance, some settings may have to be adjusted.</b>")); _("<b>For optimal GIMP performance, some settings may have to be adjusted.</b>"));
/* Page 5 */ /* Page 5 */
page = resolution_page = page = resolution_page =
user_install_notebook_append_page (GTK_NOTEBOOK (notebook), user_install_notebook_append_page (GTK_NOTEBOOK (notebook),
_("Monitor Resolution"), _("Monitor Resolution"),
_("Click \"Continue\" to start The GIMP."), _("Click \"Continue\" to start The GIMP."),
24); 24);
add_label (GTK_BOX (resolution_page), add_label (GTK_BOX (resolution_page),
_("<b>To display images in their natural size, " _("<b>To display images in their natural size, "
"GIMP needs to know your monitor resolution.</b>")); "GIMP needs to know your monitor resolution.</b>"));
/* EEK page */ /* EEK page */
page = user_install_notebook_append_page (GTK_NOTEBOOK (notebook), page = user_install_notebook_append_page (GTK_NOTEBOOK (notebook),
_("Aborting Installation..."), _("Aborting Installation..."),
NULL, 0); NULL, 0);
user_install_notebook_set_page (GTK_NOTEBOOK (notebook), 0); user_install_notebook_set_page (GTK_NOTEBOOK (notebook), 0);
@ -1023,16 +1030,16 @@ user_install_run (void)
scrolled_window = gtk_scrolled_window_new (NULL, NULL); scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC); GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (log_page), scrolled_window, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (log_page), scrolled_window, TRUE, TRUE, 0);
gtk_widget_show (scrolled_window); gtk_widget_show (scrolled_window);
log_buffer = gtk_text_buffer_new (NULL); log_buffer = gtk_text_buffer_new (NULL);
gtk_text_buffer_create_tag (log_buffer, "bold", gtk_text_buffer_create_tag (log_buffer, "bold",
"weight", PANGO_WEIGHT_BOLD, "weight", PANGO_WEIGHT_BOLD,
NULL); NULL);
log_view = gtk_text_view_new_with_buffer (log_buffer); log_view = gtk_text_view_new_with_buffer (log_buffer);
g_object_unref (log_buffer); g_object_unref (log_buffer);
@ -1067,54 +1074,54 @@ user_install_run (void)
for (i = 0; i < G_N_ELEMENTS (tree_items); i++) for (i = 0; i < G_N_ELEMENTS (tree_items); i++)
{ {
g_snprintf (dest, sizeof (dest), "%s%c%s", g_snprintf (dest, sizeof (dest), "%s%c%s",
gimp_directory (), G_DIR_SEPARATOR, tree_items[i].name); gimp_directory (), G_DIR_SEPARATOR, tree_items[i].name);
switch (tree_items[i].type) switch (tree_items[i].type)
{ {
case TREE_ITEM_DO_NOTHING: case TREE_ITEM_DO_NOTHING:
break; break;
case TREE_ITEM_MKDIR: case TREE_ITEM_MKDIR:
g_snprintf (log_line, sizeof (log_line), g_snprintf (log_line, sizeof (log_line),
_("Creating folder '%s'..."), dest); _("Creating folder '%s'..."), dest);
gtk_text_buffer_insert_at_cursor (log_buffer, log_line, -1); gtk_text_buffer_insert_at_cursor (log_buffer, log_line, -1);
while (gtk_events_pending ()) while (gtk_events_pending ())
gtk_main_iteration (); gtk_main_iteration ();
if (mkdir (dest, if (mkdir (dest,
S_IRUSR | S_IWUSR | S_IXUSR | S_IRUSR | S_IWUSR | S_IXUSR |
S_IRGRP | S_IXGRP | S_IRGRP | S_IXGRP |
S_IROTH | S_IXOTH) == -1) S_IROTH | S_IXOTH) == -1)
{ {
g_set_error (&error, g_set_error (&error,
G_FILE_ERROR, g_file_error_from_errno (errno), G_FILE_ERROR, g_file_error_from_errno (errno),
_("Cannot create folder: %s"), g_strerror (errno)); _("Cannot create folder: %s"), g_strerror (errno));
goto break_out_of_loop; goto break_out_of_loop;
} }
break; break;
case TREE_ITEM_FROM_SYSCONF_DIR: case TREE_ITEM_FROM_SYSCONF_DIR:
g_snprintf (source, sizeof (source), "%s%c%s", g_snprintf (source, sizeof (source), "%s%c%s",
gimp_sysconf_directory (), G_DIR_SEPARATOR, gimp_sysconf_directory (), G_DIR_SEPARATOR,
tree_items[i].name); tree_items[i].name);
g_assert (! tree_items[i].directory); g_assert (! tree_items[i].directory);
g_snprintf (log_line, sizeof (log_line), g_snprintf (log_line, sizeof (log_line),
_("Copying file '%s' from '%s'..."), dest, source); _("Copying file '%s' from '%s'..."), dest, source);
gtk_text_buffer_insert_at_cursor (log_buffer, log_line, -1); gtk_text_buffer_insert_at_cursor (log_buffer, log_line, -1);
while (gtk_events_pending ()) while (gtk_events_pending ())
gtk_main_iteration (); gtk_main_iteration ();
if (! gimp_config_file_copy (source, dest, &error)) if (! gimp_config_file_copy (source, dest, &error))
goto break_out_of_loop; goto break_out_of_loop;
break;
default:
g_assert_not_reached ();
break; break;
}
default:
g_assert_not_reached ();
break;
}
if (tree_items[i].type != TREE_ITEM_DO_NOTHING) if (tree_items[i].type != TREE_ITEM_DO_NOTHING)
print_log (log_view, log_buffer, NULL); print_log (log_view, log_buffer, NULL);
@ -1147,9 +1154,9 @@ user_install_tuning (GimpRc *gimprc)
gtk_widget_show (vbox); gtk_widget_show (vbox);
add_label (GTK_BOX (vbox), add_label (GTK_BOX (vbox),
_("GIMP uses a limited amount of memory to store image data, the so-called\n" _("GIMP uses a limited amount of memory to store image data, the so-called\n"
"\"Tile Cache\". You should adjust its size to fit into memory. Consider\n" "\"Tile Cache\". You should adjust its size to fit into memory. Consider\n"
"the amount of memory used by other running processes.")); "the amount of memory used by other running processes."));
hbox = gtk_hbox_new (FALSE, 8); hbox = gtk_hbox_new (FALSE, 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
@ -1171,18 +1178,18 @@ user_install_tuning (GimpRc *gimprc)
gtk_widget_show (vbox); gtk_widget_show (vbox);
add_label (GTK_BOX (vbox), add_label (GTK_BOX (vbox),
_("All image and undo data which doesn't fit into the Tile Cache will be\n" _("All image and undo data which doesn't fit into the Tile Cache will be\n"
"written to a swap file. This file should be located on a local filesystem\n" "written to a swap file. This file should be located on a local filesystem\n"
"with enough free space (several hundred MB). On a UNIX system, you\n" "with enough free space (several hundred MB). On a UNIX system, you\n"
"may want to use the system-wide temp-dir (\"/tmp\" or \"/var/tmp\").")); "may want to use the system-wide temp-dir (\"/tmp\" or \"/var/tmp\")."));
hbox = gtk_hbox_new (FALSE, 8); hbox = gtk_hbox_new (FALSE, 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox); gtk_widget_show (hbox);
entry = gimp_prop_file_entry_new (G_OBJECT (gimprc), "swap-path", entry = gimp_prop_file_entry_new (G_OBJECT (gimprc), "swap-path",
_("Select Swap Dir"), _("Select Swap Dir"),
TRUE, TRUE); TRUE, TRUE);
gtk_box_pack_end (GTK_BOX (hbox), entry, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
gtk_widget_show (entry); gtk_widget_show (entry);
@ -1194,7 +1201,7 @@ user_install_tuning (GimpRc *gimprc)
static void static void
user_install_resolution_calibrate (GtkWidget *button, user_install_resolution_calibrate (GtkWidget *button,
gpointer data) gpointer data)
{ {
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
gchar *filename; gchar *filename;
@ -1207,9 +1214,9 @@ user_install_resolution_calibrate (GtkWidget *button,
resolution_calibrate_dialog (GTK_WIDGET (data), resolution_calibrate_dialog (GTK_WIDGET (data),
pixbuf, pixbuf,
title_style, title_style,
page_style, page_style,
G_CALLBACK (user_install_corner_expose)); G_CALLBACK (user_install_corner_expose));
if (pixbuf) if (pixbuf)
g_object_unref (pixbuf); g_object_unref (pixbuf);
@ -1237,8 +1244,8 @@ user_install_resolution (GimpRc *gimprc)
gtk_widget_show (vbox); gtk_widget_show (vbox);
add_label (GTK_BOX (vbox), add_label (GTK_BOX (vbox),
_("GIMP can obtain this information from the windowing system.\n" _("GIMP can obtain this information from the windowing system.\n"
"However, usually this does not give useful values.")); "However, usually this does not give useful values."));
hbox = gtk_hbox_new (FALSE, 0); hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
@ -1250,8 +1257,8 @@ user_install_resolution (GimpRc *gimprc)
toggle = toggle =
gimp_prop_check_button_new (G_OBJECT (gimprc), gimp_prop_check_button_new (G_OBJECT (gimprc),
"monitor-resolution-from-windowing-system", "monitor-resolution-from-windowing-system",
str); str);
g_free (str); g_free (str);
PAGE_STYLE (GTK_BIN (toggle)->child); PAGE_STYLE (GTK_BIN (toggle)->child);
@ -1270,23 +1277,23 @@ user_install_resolution (GimpRc *gimprc)
pixels_per_unit = g_strconcat (_("Pixels"), "/%s", NULL); pixels_per_unit = g_strconcat (_("Pixels"), "/%s", NULL);
entry = gimp_prop_coordinates_new (G_OBJECT (gimprc), entry = gimp_prop_coordinates_new (G_OBJECT (gimprc),
"monitor-xresolution", "monitor-xresolution",
"monitor-yresolution", "monitor-yresolution",
NULL, NULL,
pixels_per_unit, pixels_per_unit,
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION, GIMP_SIZE_ENTRY_UPDATE_RESOLUTION,
0.0, 0.0, TRUE); 0.0, 0.0, TRUE);
gtk_table_set_col_spacings (GTK_TABLE (entry), 4); gtk_table_set_col_spacings (GTK_TABLE (entry), 4);
gtk_table_set_row_spacings (GTK_TABLE (entry), 2); gtk_table_set_row_spacings (GTK_TABLE (entry), 2);
g_free (pixels_per_unit); g_free (pixels_per_unit);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry), gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry),
_("Horizontal"), 0, 1, 0.0); _("Horizontal"), 0, 1, 0.0);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry), gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry),
_("Vertical"), 0, 2, 0.0); _("Vertical"), 0, 2, 0.0);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry), gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry),
_("dpi"), 1, 4, 0.0); _("dpi"), 1, 4, 0.0);
chain = GIMP_COORDINATES_CHAINBUTTON (entry); chain = GIMP_COORDINATES_CHAINBUTTON (entry);
PAGE_STYLE (GTK_WIDGET (chain->line1)); PAGE_STYLE (GTK_WIDGET (chain->line1));
@ -1297,7 +1304,7 @@ user_install_resolution (GimpRc *gimprc)
GtkTableChild *child = (GtkTableChild *) list->data; GtkTableChild *child = (GtkTableChild *) list->data;
if (child && GTK_IS_LABEL (child->widget)) if (child && GTK_IS_LABEL (child->widget))
PAGE_STYLE (GTK_WIDGET (child->widget)); PAGE_STYLE (GTK_WIDGET (child->widget));
} }
gtk_box_pack_end (GTK_BOX (hbox), entry, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
@ -1310,8 +1317,8 @@ user_install_resolution (GimpRc *gimprc)
gtk_widget_show (hbox); gtk_widget_show (hbox);
add_label (GTK_BOX (hbox), add_label (GTK_BOX (hbox),
_("You can also press the \"Calibrate\" button to open a window\n" _("You can also press the \"Calibrate\" button to open a window\n"
"which lets you determine your monitor resolution interactively.")); "which lets you determine your monitor resolution interactively."));
button = gtk_button_new_with_label (_("Calibrate")); button = gtk_button_new_with_label (_("Calibrate"));
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 4, 0); gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 4, 0);

View File

@ -322,7 +322,7 @@ tree_items[] =
static void static void
user_install_notebook_set_page (GtkNotebook *notebook, user_install_notebook_set_page (GtkNotebook *notebook,
gint index) gint index)
{ {
GtkWidget *page; GtkWidget *page;
gchar *title; gchar *title;
@ -437,8 +437,8 @@ user_install_response (GtkWidget *widget,
static gboolean static gboolean
user_install_corner_expose (GtkWidget *widget, user_install_corner_expose (GtkWidget *widget,
GdkEventExpose *eevent, GdkEventExpose *eevent,
gpointer data) gpointer data)
{ {
GtkCornerType corner; GtkCornerType corner;
@ -463,46 +463,46 @@ user_install_corner_expose (GtkWidget *widget,
{ {
case GTK_CORNER_TOP_LEFT: case GTK_CORNER_TOP_LEFT:
gdk_draw_arc (widget->window, gdk_draw_arc (widget->window,
widget->style->white_gc, widget->style->white_gc,
TRUE, TRUE,
0, 0, 0, 0,
widget->allocation.width * 2, widget->allocation.width * 2,
widget->allocation.height * 2, widget->allocation.height * 2,
90 * 64, 90 * 64,
180 * 64); 180 * 64);
break; break;
case GTK_CORNER_BOTTOM_LEFT: case GTK_CORNER_BOTTOM_LEFT:
gdk_draw_arc (widget->window, gdk_draw_arc (widget->window,
widget->style->white_gc, widget->style->white_gc,
TRUE, TRUE,
0, -widget->allocation.height, 0, -widget->allocation.height,
widget->allocation.width * 2, widget->allocation.width * 2,
widget->allocation.height * 2, widget->allocation.height * 2,
180 * 64, 180 * 64,
270 * 64); 270 * 64);
break; break;
case GTK_CORNER_TOP_RIGHT: case GTK_CORNER_TOP_RIGHT:
gdk_draw_arc (widget->window, gdk_draw_arc (widget->window,
widget->style->white_gc, widget->style->white_gc,
TRUE, TRUE,
-widget->allocation.width, 0, -widget->allocation.width, 0,
widget->allocation.width * 2, widget->allocation.width * 2,
widget->allocation.height * 2, widget->allocation.height * 2,
0 * 64, 0 * 64,
90 * 64); 90 * 64);
break; break;
case GTK_CORNER_BOTTOM_RIGHT: case GTK_CORNER_BOTTOM_RIGHT:
gdk_draw_arc (widget->window, gdk_draw_arc (widget->window,
widget->style->white_gc, widget->style->white_gc,
TRUE, TRUE,
-widget->allocation.width, -widget->allocation.height, -widget->allocation.width, -widget->allocation.height,
widget->allocation.width * 2, widget->allocation.width * 2,
widget->allocation.height * 2, widget->allocation.height * 2,
270 * 64, 270 * 64,
360 * 64); 360 * 64);
break; break;
default: default:
@ -514,8 +514,8 @@ user_install_corner_expose (GtkWidget *widget,
static GtkWidget * static GtkWidget *
user_install_notebook_append_page (GtkNotebook *notebook, user_install_notebook_append_page (GtkNotebook *notebook,
gchar *title, gchar *title,
gchar *footer, gchar *footer,
gint vbox_spacing) gint vbox_spacing)
{ {
GtkWidget *page; GtkWidget *page;
@ -531,7 +531,7 @@ user_install_notebook_append_page (GtkNotebook *notebook,
static void static void
add_label (GtkBox *box, add_label (GtkBox *box,
gchar *text) gchar *text)
{ {
GtkWidget *label; GtkWidget *label;
@ -548,7 +548,7 @@ add_label (GtkBox *box,
static void static void
user_install_sel_changed (GtkTreeSelection *sel, user_install_sel_changed (GtkTreeSelection *sel,
gpointer data) gpointer data)
{ {
GtkNotebook *notebook = GTK_NOTEBOOK (data); GtkNotebook *notebook = GTK_NOTEBOOK (data);
GtkTreeModel *model; GtkTreeModel *model;
@ -563,12 +563,12 @@ user_install_sel_changed (GtkTreeSelection *sel,
static void static void
user_install_tv_fix_size_request (GtkWidget *widget, user_install_tv_fix_size_request (GtkWidget *widget,
GtkAllocation *allocation) GtkAllocation *allocation)
{ {
gtk_widget_set_size_request (widget, allocation->width, allocation->height); gtk_widget_set_size_request (widget, allocation->width, allocation->height);
g_signal_handlers_disconnect_by_func (widget, g_signal_handlers_disconnect_by_func (widget,
user_install_tv_fix_size_request, user_install_tv_fix_size_request,
NULL); NULL);
} }
void void
@ -594,12 +594,12 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
dialog = user_install_dialog = dialog = user_install_dialog =
gimp_dialog_new (_("GIMP User Installation"), "user_installation", gimp_dialog_new (_("GIMP User Installation"), "user_installation",
NULL, 0, NULL, 0,
NULL, NULL, NULL, NULL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
_("Continue"), GTK_RESPONSE_OK, _("Continue"), GTK_RESPONSE_OK,
NULL); NULL);
g_signal_connect (dialog, "response", g_signal_connect (dialog, "response",
G_CALLBACK (user_install_response), G_CALLBACK (user_install_response),
@ -639,7 +639,7 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
page_style->base[GTK_STATE_NORMAL] = white_color; page_style->base[GTK_STATE_NORMAL] = white_color;
page_style->color_flags[GTK_STATE_NORMAL] |= (GTK_RC_FG | GTK_RC_BG | page_style->color_flags[GTK_STATE_NORMAL] |= (GTK_RC_FG | GTK_RC_BG |
GTK_RC_TEXT | GTK_RC_BASE); GTK_RC_TEXT | GTK_RC_BASE);
page_style->fg[GTK_STATE_ACTIVE] = black_color; page_style->fg[GTK_STATE_ACTIVE] = black_color;
page_style->bg[GTK_STATE_ACTIVE] = white_color; page_style->bg[GTK_STATE_ACTIVE] = white_color;
@ -724,7 +724,7 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
G_CALLBACK (user_install_corner_expose), G_CALLBACK (user_install_corner_expose),
GINT_TO_POINTER (GTK_CORNER_TOP_LEFT)); GINT_TO_POINTER (GTK_CORNER_TOP_LEFT));
gtk_table_attach (GTK_TABLE (table), darea, 0, 1, 0, 1, gtk_table_attach (GTK_TABLE (table), darea, 0, 1, 0, 1,
GTK_SHRINK, GTK_SHRINK, 0, 0); GTK_SHRINK, GTK_SHRINK, 0, 0);
gtk_widget_show (darea); gtk_widget_show (darea);
darea = gtk_drawing_area_new (); darea = gtk_drawing_area_new ();
@ -734,7 +734,7 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
G_CALLBACK (user_install_corner_expose), G_CALLBACK (user_install_corner_expose),
GINT_TO_POINTER (GTK_CORNER_BOTTOM_LEFT)); GINT_TO_POINTER (GTK_CORNER_BOTTOM_LEFT));
gtk_table_attach (GTK_TABLE (table), darea, 0, 1, 2, 3, gtk_table_attach (GTK_TABLE (table), darea, 0, 1, 2, 3,
GTK_SHRINK, GTK_SHRINK, 0, 0); GTK_SHRINK, GTK_SHRINK, 0, 0);
gtk_widget_show (darea); gtk_widget_show (darea);
notebook = gtk_notebook_new (); notebook = gtk_notebook_new ();
@ -747,16 +747,16 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
/* Page 1 */ /* Page 1 */
page = user_install_notebook_append_page (GTK_NOTEBOOK (notebook), page = user_install_notebook_append_page (GTK_NOTEBOOK (notebook),
_("Welcome to\n" _("Welcome to\n"
"The GIMP User Installation"), "The GIMP User Installation"),
_("Click \"Continue\" to enter " _("Click \"Continue\" to enter "
"the GIMP user installation."), "the GIMP user installation."),
16); 16);
add_label (GTK_BOX (page), add_label (GTK_BOX (page),
_("<b>The GIMP - GNU Image Manipulation Program</b>\n" _("<b>The GIMP - GNU Image Manipulation Program</b>\n"
"Copyright (C) 1995-2003\n" "Copyright (C) 1995-2003\n"
"Spencer Kimball, Peter Mattis and the GIMP Development Team.")); "Spencer Kimball, Peter Mattis and the GIMP Development Team."));
sep = gtk_hseparator_new (); sep = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (page), sep, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (page), sep, FALSE, FALSE, 2);
@ -785,6 +785,7 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
{ {
GtkWidget *hbox; GtkWidget *hbox;
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *scr;
GtkWidget *tv; GtkWidget *tv;
GdkPixbuf *file_pixbuf; GdkPixbuf *file_pixbuf;
GdkPixbuf *folder_pixbuf; GdkPixbuf *folder_pixbuf;
@ -800,9 +801,9 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
gint i; gint i;
page = user_install_notebook_append_page (GTK_NOTEBOOK (notebook), page = user_install_notebook_append_page (GTK_NOTEBOOK (notebook),
_("Personal GIMP Folder"), _("Personal GIMP Folder"),
_("Click \"Continue\" to create " _("Click \"Continue\" to create "
"your personal GIMP folder."), "your personal GIMP folder."),
0); 0);
hbox = gtk_hbox_new (FALSE, 16); hbox = gtk_hbox_new (FALSE, 16);
@ -810,7 +811,7 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
gtk_widget_show (hbox); gtk_widget_show (hbox);
tree = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING, GDK_TYPE_PIXBUF, tree = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING, GDK_TYPE_PIXBUF,
G_TYPE_INT); G_TYPE_INT);
tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (tree)); tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (tree));
g_object_unref (tree); g_object_unref (tree);
@ -819,20 +820,26 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
cell = gtk_cell_renderer_pixbuf_new (); cell = gtk_cell_renderer_pixbuf_new ();
gtk_tree_view_column_pack_start (column, cell, FALSE); gtk_tree_view_column_pack_start (column, cell, FALSE);
gtk_tree_view_column_set_attributes (column, cell, gtk_tree_view_column_set_attributes (column, cell,
"pixbuf", PIXBUF_COLUMN, "pixbuf", PIXBUF_COLUMN,
NULL); NULL);
cell = gtk_cell_renderer_text_new (); cell = gtk_cell_renderer_text_new ();
gtk_tree_view_column_pack_start (column, cell, TRUE); gtk_tree_view_column_pack_start (column, cell, TRUE);
gtk_tree_view_column_set_attributes (column, cell, gtk_tree_view_column_set_attributes (column, cell,
"text", DIRENT_COLUMN, "text", DIRENT_COLUMN,
NULL); NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tv), column); gtk_tree_view_append_column (GTK_TREE_VIEW (tv), column);
PAGE_STYLE (tv); PAGE_STYLE (tv);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tv), FALSE); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tv), FALSE);
gtk_box_pack_start (GTK_BOX (hbox), tv, FALSE, FALSE, 0); scr = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (hbox), scr, FALSE, FALSE, 0);
gtk_widget_show (scr);
gtk_container_add (GTK_CONTAINER (scr), tv);
gtk_widget_show (tv); gtk_widget_show (tv);
vbox = gtk_vbox_new (FALSE, 8); vbox = gtk_vbox_new (FALSE, 8);
@ -840,15 +847,15 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
gtk_widget_show (vbox); gtk_widget_show (vbox);
str = g_strdup_printf (_("For a proper GIMP installation, a folder named\n" str = g_strdup_printf (_("For a proper GIMP installation, a folder named\n"
"'<b>%s</b>' needs to be created."), "'<b>%s</b>' needs to be created."),
gimp_directory ()); gimp_directory ());
add_label (GTK_BOX (vbox), str); add_label (GTK_BOX (vbox), str);
g_free (str); g_free (str);
add_label (GTK_BOX (vbox), add_label (GTK_BOX (vbox),
_("This folder will contain a number of important files.\n" _("This folder will contain a number of important files.\n"
"Click on one of the files or folders in the tree\n" "Click on one of the files or folders in the tree\n"
"to get more information about the selected item.")); "to get more information about the selected item."));
notebook2 = gtk_notebook_new (); notebook2 = gtk_notebook_new ();
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook2), FALSE); gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook2), FALSE);
@ -863,8 +870,8 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tv)); sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tv));
g_signal_connect (sel, "changed", g_signal_connect (sel, "changed",
G_CALLBACK (user_install_sel_changed), G_CALLBACK (user_install_sel_changed),
notebook2); notebook2);
file_pixbuf = gtk_widget_render_icon (tv, file_pixbuf = gtk_widget_render_icon (tv,
GTK_STOCK_NEW, GTK_ICON_SIZE_MENU, GTK_STOCK_NEW, GTK_ICON_SIZE_MENU,
@ -875,10 +882,10 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
gtk_tree_store_append (tree, &iter, NULL); gtk_tree_store_append (tree, &iter, NULL);
gtk_tree_store_set (tree, &iter, gtk_tree_store_set (tree, &iter,
DIRENT_COLUMN, gimp_directory (), DIRENT_COLUMN, gimp_directory (),
PIXBUF_COLUMN, folder_pixbuf, PIXBUF_COLUMN, folder_pixbuf,
DESC_COLUMN, 0, DESC_COLUMN, 0,
-1); -1);
for (i = 0; i < G_N_ELEMENTS (tree_items); i++) for (i = 0; i < G_N_ELEMENTS (tree_items); i++)
{ {
@ -887,43 +894,43 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
if (!tree_items[i].description) if (!tree_items[i].description)
continue; continue;
gtk_tree_store_append (tree, &child, &iter); gtk_tree_store_append (tree, &child, &iter);
gtk_tree_store_set (tree, &child, gtk_tree_store_set (tree, &child,
DIRENT_COLUMN, tree_items[i].name, DIRENT_COLUMN, tree_items[i].name,
PIXBUF_COLUMN, PIXBUF_COLUMN,
tree_items[i].directory ? folder_pixbuf tree_items[i].directory ? folder_pixbuf
: file_pixbuf, : file_pixbuf,
DESC_COLUMN, i + 1, DESC_COLUMN, i + 1,
-1); -1);
page2 = gtk_vbox_new (FALSE, 8); page2 = gtk_vbox_new (FALSE, 8);
foo = g_strdup_printf ("<b>%s</b>", tree_items[i].name); foo = g_strdup_printf ("<b>%s</b>", tree_items[i].name);
label = gtk_label_new (NULL); label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), foo); gtk_label_set_markup (GTK_LABEL (label), foo);
g_free (foo); g_free (foo);
PAGE_STYLE (label); PAGE_STYLE (label);
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
gtk_box_pack_start (GTK_BOX (page2), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (page2), label, FALSE, FALSE, 0);
gtk_widget_show (label); gtk_widget_show (label);
label = gtk_label_new (gettext (tree_items[i].description)); label = gtk_label_new (gettext (tree_items[i].description));
PAGE_STYLE (label); PAGE_STYLE (label);
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
gtk_box_pack_start (GTK_BOX (page2), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (page2), label, FALSE, FALSE, 0);
gtk_widget_show (label); gtk_widget_show (label);
gtk_widget_show (page2); gtk_widget_show (page2);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook2), page2, NULL); gtk_notebook_append_page (GTK_NOTEBOOK (notebook2), page2, NULL);
} }
gtk_tree_view_expand_all (GTK_TREE_VIEW (tv)); gtk_tree_view_expand_all (GTK_TREE_VIEW (tv));
g_signal_connect (tv, "size_allocate", g_signal_connect (tv, "size_allocate",
G_CALLBACK (user_install_tv_fix_size_request), G_CALLBACK (user_install_tv_fix_size_request),
NULL); NULL);
g_object_unref (file_pixbuf); g_object_unref (file_pixbuf);
g_object_unref (folder_pixbuf); g_object_unref (folder_pixbuf);
@ -932,7 +939,7 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
/* Page 3 */ /* Page 3 */
page = log_page = page = log_page =
user_install_notebook_append_page (GTK_NOTEBOOK (notebook), user_install_notebook_append_page (GTK_NOTEBOOK (notebook),
_("User Installation Log"), _("User Installation Log"),
_("Please wait while your personal\n" _("Please wait while your personal\n"
"GIMP folder is being created..."), "GIMP folder is being created..."),
0); 0);
@ -940,28 +947,28 @@ user_install_dialog_run (const gchar *alternate_system_gimprc,
/* Page 4 */ /* Page 4 */
page = tuning_page = page = tuning_page =
user_install_notebook_append_page (GTK_NOTEBOOK (notebook), user_install_notebook_append_page (GTK_NOTEBOOK (notebook),
_("GIMP Performance Tuning"), _("GIMP Performance Tuning"),
_("Click \"Continue\" to accept the settings above."), _("Click \"Continue\" to accept the settings above."),
24); 24);
add_label (GTK_BOX (page), add_label (GTK_BOX (page),
_("<b>For optimal GIMP performance, some settings may have to be adjusted.</b>")); _("<b>For optimal GIMP performance, some settings may have to be adjusted.</b>"));
/* Page 5 */ /* Page 5 */
page = resolution_page = page = resolution_page =
user_install_notebook_append_page (GTK_NOTEBOOK (notebook), user_install_notebook_append_page (GTK_NOTEBOOK (notebook),
_("Monitor Resolution"), _("Monitor Resolution"),
_("Click \"Continue\" to start The GIMP."), _("Click \"Continue\" to start The GIMP."),
24); 24);
add_label (GTK_BOX (resolution_page), add_label (GTK_BOX (resolution_page),
_("<b>To display images in their natural size, " _("<b>To display images in their natural size, "
"GIMP needs to know your monitor resolution.</b>")); "GIMP needs to know your monitor resolution.</b>"));
/* EEK page */ /* EEK page */
page = user_install_notebook_append_page (GTK_NOTEBOOK (notebook), page = user_install_notebook_append_page (GTK_NOTEBOOK (notebook),
_("Aborting Installation..."), _("Aborting Installation..."),
NULL, 0); NULL, 0);
user_install_notebook_set_page (GTK_NOTEBOOK (notebook), 0); user_install_notebook_set_page (GTK_NOTEBOOK (notebook), 0);
@ -1023,16 +1030,16 @@ user_install_run (void)
scrolled_window = gtk_scrolled_window_new (NULL, NULL); scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC); GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (log_page), scrolled_window, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (log_page), scrolled_window, TRUE, TRUE, 0);
gtk_widget_show (scrolled_window); gtk_widget_show (scrolled_window);
log_buffer = gtk_text_buffer_new (NULL); log_buffer = gtk_text_buffer_new (NULL);
gtk_text_buffer_create_tag (log_buffer, "bold", gtk_text_buffer_create_tag (log_buffer, "bold",
"weight", PANGO_WEIGHT_BOLD, "weight", PANGO_WEIGHT_BOLD,
NULL); NULL);
log_view = gtk_text_view_new_with_buffer (log_buffer); log_view = gtk_text_view_new_with_buffer (log_buffer);
g_object_unref (log_buffer); g_object_unref (log_buffer);
@ -1067,54 +1074,54 @@ user_install_run (void)
for (i = 0; i < G_N_ELEMENTS (tree_items); i++) for (i = 0; i < G_N_ELEMENTS (tree_items); i++)
{ {
g_snprintf (dest, sizeof (dest), "%s%c%s", g_snprintf (dest, sizeof (dest), "%s%c%s",
gimp_directory (), G_DIR_SEPARATOR, tree_items[i].name); gimp_directory (), G_DIR_SEPARATOR, tree_items[i].name);
switch (tree_items[i].type) switch (tree_items[i].type)
{ {
case TREE_ITEM_DO_NOTHING: case TREE_ITEM_DO_NOTHING:
break; break;
case TREE_ITEM_MKDIR: case TREE_ITEM_MKDIR:
g_snprintf (log_line, sizeof (log_line), g_snprintf (log_line, sizeof (log_line),
_("Creating folder '%s'..."), dest); _("Creating folder '%s'..."), dest);
gtk_text_buffer_insert_at_cursor (log_buffer, log_line, -1); gtk_text_buffer_insert_at_cursor (log_buffer, log_line, -1);
while (gtk_events_pending ()) while (gtk_events_pending ())
gtk_main_iteration (); gtk_main_iteration ();
if (mkdir (dest, if (mkdir (dest,
S_IRUSR | S_IWUSR | S_IXUSR | S_IRUSR | S_IWUSR | S_IXUSR |
S_IRGRP | S_IXGRP | S_IRGRP | S_IXGRP |
S_IROTH | S_IXOTH) == -1) S_IROTH | S_IXOTH) == -1)
{ {
g_set_error (&error, g_set_error (&error,
G_FILE_ERROR, g_file_error_from_errno (errno), G_FILE_ERROR, g_file_error_from_errno (errno),
_("Cannot create folder: %s"), g_strerror (errno)); _("Cannot create folder: %s"), g_strerror (errno));
goto break_out_of_loop; goto break_out_of_loop;
} }
break; break;
case TREE_ITEM_FROM_SYSCONF_DIR: case TREE_ITEM_FROM_SYSCONF_DIR:
g_snprintf (source, sizeof (source), "%s%c%s", g_snprintf (source, sizeof (source), "%s%c%s",
gimp_sysconf_directory (), G_DIR_SEPARATOR, gimp_sysconf_directory (), G_DIR_SEPARATOR,
tree_items[i].name); tree_items[i].name);
g_assert (! tree_items[i].directory); g_assert (! tree_items[i].directory);
g_snprintf (log_line, sizeof (log_line), g_snprintf (log_line, sizeof (log_line),
_("Copying file '%s' from '%s'..."), dest, source); _("Copying file '%s' from '%s'..."), dest, source);
gtk_text_buffer_insert_at_cursor (log_buffer, log_line, -1); gtk_text_buffer_insert_at_cursor (log_buffer, log_line, -1);
while (gtk_events_pending ()) while (gtk_events_pending ())
gtk_main_iteration (); gtk_main_iteration ();
if (! gimp_config_file_copy (source, dest, &error)) if (! gimp_config_file_copy (source, dest, &error))
goto break_out_of_loop; goto break_out_of_loop;
break;
default:
g_assert_not_reached ();
break; break;
}
default:
g_assert_not_reached ();
break;
}
if (tree_items[i].type != TREE_ITEM_DO_NOTHING) if (tree_items[i].type != TREE_ITEM_DO_NOTHING)
print_log (log_view, log_buffer, NULL); print_log (log_view, log_buffer, NULL);
@ -1147,9 +1154,9 @@ user_install_tuning (GimpRc *gimprc)
gtk_widget_show (vbox); gtk_widget_show (vbox);
add_label (GTK_BOX (vbox), add_label (GTK_BOX (vbox),
_("GIMP uses a limited amount of memory to store image data, the so-called\n" _("GIMP uses a limited amount of memory to store image data, the so-called\n"
"\"Tile Cache\". You should adjust its size to fit into memory. Consider\n" "\"Tile Cache\". You should adjust its size to fit into memory. Consider\n"
"the amount of memory used by other running processes.")); "the amount of memory used by other running processes."));
hbox = gtk_hbox_new (FALSE, 8); hbox = gtk_hbox_new (FALSE, 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
@ -1171,18 +1178,18 @@ user_install_tuning (GimpRc *gimprc)
gtk_widget_show (vbox); gtk_widget_show (vbox);
add_label (GTK_BOX (vbox), add_label (GTK_BOX (vbox),
_("All image and undo data which doesn't fit into the Tile Cache will be\n" _("All image and undo data which doesn't fit into the Tile Cache will be\n"
"written to a swap file. This file should be located on a local filesystem\n" "written to a swap file. This file should be located on a local filesystem\n"
"with enough free space (several hundred MB). On a UNIX system, you\n" "with enough free space (several hundred MB). On a UNIX system, you\n"
"may want to use the system-wide temp-dir (\"/tmp\" or \"/var/tmp\").")); "may want to use the system-wide temp-dir (\"/tmp\" or \"/var/tmp\")."));
hbox = gtk_hbox_new (FALSE, 8); hbox = gtk_hbox_new (FALSE, 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox); gtk_widget_show (hbox);
entry = gimp_prop_file_entry_new (G_OBJECT (gimprc), "swap-path", entry = gimp_prop_file_entry_new (G_OBJECT (gimprc), "swap-path",
_("Select Swap Dir"), _("Select Swap Dir"),
TRUE, TRUE); TRUE, TRUE);
gtk_box_pack_end (GTK_BOX (hbox), entry, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
gtk_widget_show (entry); gtk_widget_show (entry);
@ -1194,7 +1201,7 @@ user_install_tuning (GimpRc *gimprc)
static void static void
user_install_resolution_calibrate (GtkWidget *button, user_install_resolution_calibrate (GtkWidget *button,
gpointer data) gpointer data)
{ {
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
gchar *filename; gchar *filename;
@ -1207,9 +1214,9 @@ user_install_resolution_calibrate (GtkWidget *button,
resolution_calibrate_dialog (GTK_WIDGET (data), resolution_calibrate_dialog (GTK_WIDGET (data),
pixbuf, pixbuf,
title_style, title_style,
page_style, page_style,
G_CALLBACK (user_install_corner_expose)); G_CALLBACK (user_install_corner_expose));
if (pixbuf) if (pixbuf)
g_object_unref (pixbuf); g_object_unref (pixbuf);
@ -1237,8 +1244,8 @@ user_install_resolution (GimpRc *gimprc)
gtk_widget_show (vbox); gtk_widget_show (vbox);
add_label (GTK_BOX (vbox), add_label (GTK_BOX (vbox),
_("GIMP can obtain this information from the windowing system.\n" _("GIMP can obtain this information from the windowing system.\n"
"However, usually this does not give useful values.")); "However, usually this does not give useful values."));
hbox = gtk_hbox_new (FALSE, 0); hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
@ -1250,8 +1257,8 @@ user_install_resolution (GimpRc *gimprc)
toggle = toggle =
gimp_prop_check_button_new (G_OBJECT (gimprc), gimp_prop_check_button_new (G_OBJECT (gimprc),
"monitor-resolution-from-windowing-system", "monitor-resolution-from-windowing-system",
str); str);
g_free (str); g_free (str);
PAGE_STYLE (GTK_BIN (toggle)->child); PAGE_STYLE (GTK_BIN (toggle)->child);
@ -1270,23 +1277,23 @@ user_install_resolution (GimpRc *gimprc)
pixels_per_unit = g_strconcat (_("Pixels"), "/%s", NULL); pixels_per_unit = g_strconcat (_("Pixels"), "/%s", NULL);
entry = gimp_prop_coordinates_new (G_OBJECT (gimprc), entry = gimp_prop_coordinates_new (G_OBJECT (gimprc),
"monitor-xresolution", "monitor-xresolution",
"monitor-yresolution", "monitor-yresolution",
NULL, NULL,
pixels_per_unit, pixels_per_unit,
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION, GIMP_SIZE_ENTRY_UPDATE_RESOLUTION,
0.0, 0.0, TRUE); 0.0, 0.0, TRUE);
gtk_table_set_col_spacings (GTK_TABLE (entry), 4); gtk_table_set_col_spacings (GTK_TABLE (entry), 4);
gtk_table_set_row_spacings (GTK_TABLE (entry), 2); gtk_table_set_row_spacings (GTK_TABLE (entry), 2);
g_free (pixels_per_unit); g_free (pixels_per_unit);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry), gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry),
_("Horizontal"), 0, 1, 0.0); _("Horizontal"), 0, 1, 0.0);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry), gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry),
_("Vertical"), 0, 2, 0.0); _("Vertical"), 0, 2, 0.0);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry), gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry),
_("dpi"), 1, 4, 0.0); _("dpi"), 1, 4, 0.0);
chain = GIMP_COORDINATES_CHAINBUTTON (entry); chain = GIMP_COORDINATES_CHAINBUTTON (entry);
PAGE_STYLE (GTK_WIDGET (chain->line1)); PAGE_STYLE (GTK_WIDGET (chain->line1));
@ -1297,7 +1304,7 @@ user_install_resolution (GimpRc *gimprc)
GtkTableChild *child = (GtkTableChild *) list->data; GtkTableChild *child = (GtkTableChild *) list->data;
if (child && GTK_IS_LABEL (child->widget)) if (child && GTK_IS_LABEL (child->widget))
PAGE_STYLE (GTK_WIDGET (child->widget)); PAGE_STYLE (GTK_WIDGET (child->widget));
} }
gtk_box_pack_end (GTK_BOX (hbox), entry, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
@ -1310,8 +1317,8 @@ user_install_resolution (GimpRc *gimprc)
gtk_widget_show (hbox); gtk_widget_show (hbox);
add_label (GTK_BOX (hbox), add_label (GTK_BOX (hbox),
_("You can also press the \"Calibrate\" button to open a window\n" _("You can also press the \"Calibrate\" button to open a window\n"
"which lets you determine your monitor resolution interactively.")); "which lets you determine your monitor resolution interactively."));
button = gtk_button_new_with_label (_("Calibrate")); button = gtk_button_new_with_label (_("Calibrate"));
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 4, 0); gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 4, 0);