82
80
tips = gimp_tips_from_file (filename, &error);
88
86
if (error->code == G_FILE_ERROR_NOENT)
90
tip = gimp_tip_new (_("<b>Your GIMP tips file appears to be missing!</b>"),
92
tip->thetip = g_strdup_printf (_("There should be a file called '%s'. "
93
"Please check your installation."),
88
tip = gimp_tip_new ("<b>%s</b>",
89
_("Your GIMP tips file appears to be missing!"));
91
_("There should be a file called '%s'. "
92
"Please check your installation."), filename);
98
tip = gimp_tip_new (_("<b>The GIMP tips file could not be parsed!</b>"),
96
tip = gimp_tip_new ("<b>%s</b>",
97
_("The GIMP tips file could not be parsed!"));
98
gimp_tip_set (tip, "%s", error->message);
102
101
tips = g_list_prepend (tips, tip);
127
126
tips_dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL);
128
127
gtk_window_set_type_hint (GTK_WINDOW (tips_dialog),
129
GDK_WINDOW_TYPE_HINT_DIALOG);
128
GDK_WINDOW_TYPE_HINT_DIALOG);
130
129
gtk_window_set_role (GTK_WINDOW (tips_dialog), "gimp-tip-of-the-day");
131
130
gtk_window_set_title (GTK_WINDOW (tips_dialog), _("GIMP Tip of the Day"));
132
131
gtk_window_set_position (GTK_WINDOW (tips_dialog), GTK_WIN_POS_CENTER);
133
132
gtk_window_set_resizable (GTK_WINDOW (tips_dialog), TRUE);
135
g_signal_connect (tips_dialog, "delete_event",
134
g_signal_connect (tips_dialog, "delete-event",
136
135
G_CALLBACK (gtk_widget_destroy),
139
138
g_signal_connect (tips_dialog, "destroy",
140
G_CALLBACK (tips_dialog_destroy),
139
G_CALLBACK (tips_dialog_destroy),
143
142
vbox = gtk_vbox_new (FALSE, 0);
144
143
gtk_container_add (GTK_CONTAINER (tips_dialog), vbox);
167
166
gtk_widget_show (thetip_label);
169
168
vbox2 = gtk_vbox_new (FALSE, 0);
170
gtk_box_pack_end (GTK_BOX (hbox), vbox2, FALSE, FALSE, 0);
169
gtk_box_pack_start (GTK_BOX (hbox), vbox2, FALSE, FALSE, 0);
171
170
gtk_widget_show (vbox2);
173
filename = g_build_filename (gimp_data_directory (),
174
"images", "wilber-tips.png", NULL);
175
wilber = gdk_pixbuf_new_from_file (filename, NULL);
182
image = gtk_image_new_from_pixbuf (wilber);
183
g_object_unref (wilber);
185
gtk_box_pack_start (GTK_BOX (vbox2), image, TRUE, FALSE, 0);
186
gtk_widget_show (image);
172
image = gtk_image_new_from_stock (GIMP_STOCK_INFO, GTK_ICON_SIZE_DIALOG);
173
gtk_box_pack_start (GTK_BOX (vbox2), image, TRUE, FALSE, 0);
174
gtk_widget_show (image);
189
176
hbox = gtk_hbox_new (FALSE, 12);
190
177
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
207
194
gtk_widget_show (button);
209
196
g_signal_connect_swapped (button, "clicked",
210
G_CALLBACK (gtk_widget_destroy),
197
G_CALLBACK (gtk_widget_destroy),
213
200
bbox = gtk_hbutton_box_new ();
214
201
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_END);
216
203
gtk_box_pack_end (GTK_BOX (hbox), bbox, FALSE, FALSE, 0);
217
204
gtk_widget_show (bbox);
219
button = tips_button_new (_("_Previous tip"), TRUE);
220
gtk_widget_set_sensitive (button, (tips_count > 1));
221
gtk_container_add (GTK_CONTAINER (bbox), button);
222
gtk_widget_show (button);
224
g_signal_connect (button, "clicked",
225
G_CALLBACK (tips_show_previous),
228
button = tips_button_new (_("_Next tip"), FALSE);
229
gtk_widget_set_sensitive (button, (tips_count > 1));
230
gtk_container_add (GTK_CONTAINER (bbox), button);
231
gtk_widget_show (button);
233
g_signal_connect (button, "clicked",
234
G_CALLBACK (tips_show_next),
206
button = tips_button_new (_("_Previous Tip"), TRUE);
207
gtk_widget_set_sensitive (button, (tips_count > 1));
208
gtk_container_add (GTK_CONTAINER (bbox), button);
209
gtk_widget_show (button);
211
g_signal_connect (button, "clicked",
212
G_CALLBACK (tips_show_previous),
215
button = tips_button_new (_("_Next Tip"), FALSE);
216
gtk_widget_set_sensitive (button, (tips_count > 1));
217
gtk_container_add (GTK_CONTAINER (bbox), button);
218
gtk_widget_show (button);
220
g_signal_connect (button, "clicked",
221
G_CALLBACK (tips_show_next),
237
224
gimp_help_connect (tips_dialog, gimp_standard_help_func,
238
GIMP_HELP_TIPS_DIALOG, NULL);
225
GIMP_HELP_TIPS_DIALOG, NULL);
240
227
tips_set_labels (current_tip->data);