# HG changeset patch # User zas_ # Date 1207229053 0 # Node ID 83f92073e74c7143b4cd436e32f7cce46499b03a # Parent 73efc1ba150fa594a5b525e8e075b2a9c0be07c4 Tidy up. Fix indentation and missing whitespaces. Make editors table creation code a bit more readable. diff -r 73efc1ba150f -r 83f92073e74c src/preferences.c --- a/src/preferences.c Thu Apr 03 08:51:32 2008 +0000 +++ b/src/preferences.c Thu Apr 03 13:24:13 2008 +0000 @@ -1215,36 +1215,41 @@ for (i = 0; i < GQVIEW_EDITOR_SLOTS; i++) { - gchar *buf; - + GtkWidget *entry; if (i < GQVIEW_EDITOR_GENERIC_SLOTS) { + gchar *buf; + buf = g_strdup_printf("%d", i+1); pref_table_label(table, 0, i+1, buf, 1.0); g_free(buf); - editor_name_entry[i] = gtk_entry_new(); - gtk_entry_set_max_length(GTK_ENTRY(editor_name_entry[i]), EDITOR_NAME_MAX_LENGTH); - gtk_widget_set_size_request(editor_name_entry[i],80,-1); - if (editor_name[i]) gtk_entry_set_text(GTK_ENTRY(editor_name_entry[i]),editor_name[i]); + entry = gtk_entry_new(); + gtk_entry_set_max_length(GTK_ENTRY(entry), EDITOR_NAME_MAX_LENGTH); + gtk_widget_set_size_request(entry, 80, -1); + if (editor_name[i]) + gtk_entry_set_text(GTK_ENTRY(entry), editor_name[i]); } else { - editor_name_entry[i] = gtk_label_new(editor_name[i]); + entry = gtk_label_new(editor_name[i]); } - gtk_table_attach(GTK_TABLE (table),editor_name_entry[i],1,2,i+1,i+2, + gtk_table_attach(GTK_TABLE (table), entry, 1, 2, i+1, i+2, GTK_FILL | GTK_EXPAND, 0, 0, 0); - gtk_widget_show(editor_name_entry[i]); + gtk_widget_show(entry); + editor_name_entry[i] = entry; - editor_command_entry[i] = gtk_entry_new(); - gtk_entry_set_max_length(GTK_ENTRY(editor_command_entry[i]), EDITOR_COMMAND_MAX_LENGTH); - gtk_widget_set_size_request(editor_command_entry[i],160,-1); - tab_completion_add_to_entry(editor_command_entry[i], NULL, NULL); - if (editor_command[i]) gtk_entry_set_text(GTK_ENTRY(editor_command_entry[i]), editor_command[i]); - gtk_table_attach(GTK_TABLE (table),editor_command_entry[i],2,3,i+1,i+2, + entry = gtk_entry_new(); + gtk_entry_set_max_length(GTK_ENTRY(entry), EDITOR_COMMAND_MAX_LENGTH); + gtk_widget_set_size_request(entry, 160, -1); + tab_completion_add_to_entry(entry, NULL, NULL); + if (editor_command[i]) + gtk_entry_set_text(GTK_ENTRY(entry), editor_command[i]); + gtk_table_attach(GTK_TABLE (table), entry, 2, 3, i+1, i+2, GTK_FILL | GTK_EXPAND, 0, 0, 0); - gtk_widget_show(editor_command_entry[i]); + gtk_widget_show(entry); + editor_command_entry[i] = entry; } hbox = pref_box_new(vbox, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); @@ -1348,8 +1353,8 @@ "if there's no ISO information in the Exif data.\n" "If a line is empty, it is removed. This allows to add lines that totally disappear when no data is available.\n" )); - -gtk_container_add(GTK_CONTAINER(scrolled), fullscreen_info_view); + + gtk_container_add(GTK_CONTAINER(scrolled), fullscreen_info_view); gtk_widget_show(fullscreen_info_view); buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(fullscreen_info_view)); @@ -1357,7 +1362,6 @@ g_signal_connect(G_OBJECT(buffer), "changed", G_CALLBACK(fullscreen_info_view_changed_cb), fullscreen_info_view); - group = pref_group_new(vbox, FALSE, _("Delete"), GTK_ORIENTATION_VERTICAL); pref_checkbox_new_int(group, _("Confirm file delete"),