2 * DO NOT EDIT THIS FILE - it is generated by Glade.
18 #include "callbacks.h"
19 #include "interface.h"
22 #define GLADE_HOOKUP_OBJECT(component,widget,name) \
23 g_object_set_data_full (G_OBJECT (component), name, \
24 gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
26 #define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
27 g_object_set_data (G_OBJECT (component), name, widget)
29 static GnomeUIInfo file1_menu_uiinfo
[] =
32 GNOME_APP_UI_ITEM
, N_("Play _Directory"),
34 (gpointer
) on_open_directory1_activate
, NULL
, NULL
,
35 GNOME_APP_PIXMAP_STOCK
, "gtk-open",
36 GDK_d
, (GdkModifierType
) GDK_CONTROL_MASK
, NULL
39 GNOME_APP_UI_ITEM
, N_("Play _File"),
41 (gpointer
) on_open_file1_activate
, NULL
, NULL
,
42 GNOME_APP_PIXMAP_STOCK
, "gtk-open",
43 GDK_o
, (GdkModifierType
) GDK_CONTROL_MASK
, NULL
45 GNOMEUIINFO_SEPARATOR
,
46 GNOMEUIINFO_MENU_EXIT_ITEM (on_quit1_activate
, NULL
),
50 static GnomeUIInfo repeat_all1_uiinfo
[] =
53 GNOME_APP_UI_ITEM
, N_("_Repeat All"),
55 (gpointer
) on_repeat_all1_activate
, NULL
, NULL
,
56 GNOME_APP_PIXMAP_NONE
, NULL
,
57 GDK_r
, (GdkModifierType
) GDK_CONTROL_MASK
, NULL
60 GNOME_APP_UI_ITEM
, N_("Repeat _One"),
62 (gpointer
) on_repeat_one1_activate
, NULL
, NULL
,
63 GNOME_APP_PIXMAP_NONE
, NULL
,
64 GDK_o
, (GdkModifierType
) GDK_CONTROL_MASK
, NULL
67 GNOME_APP_UI_ITEM
, N_("_Shuffle"),
69 (gpointer
) on_shuffle1_activate
, NULL
, NULL
,
70 GNOME_APP_PIXMAP_NONE
, NULL
,
71 GDK_s
, (GdkModifierType
) GDK_CONTROL_MASK
, NULL
74 GNOME_APP_UI_ITEM
, N_("_No Repeat"),
76 (gpointer
) on_no_repeat1_activate
, NULL
, NULL
,
77 GNOME_APP_PIXMAP_NONE
, NULL
,
78 GDK_n
, (GdkModifierType
) GDK_CONTROL_MASK
, NULL
83 static GnomeUIInfo mode1_menu_uiinfo
[] =
86 GNOME_APP_UI_RADIOITEMS
, NULL
, NULL
, repeat_all1_uiinfo
,
87 NULL
, NULL
, GNOME_APP_PIXMAP_NONE
, NULL
, 0,
88 (GdkModifierType
) 0, NULL
93 static GnomeUIInfo tools1_menu_uiinfo
[] =
96 GNOME_APP_UI_ITEM
, N_("_last.fm"),
98 (gpointer
) on_lastfm1_activate
, NULL
, NULL
,
99 GNOME_APP_PIXMAP_NONE
, NULL
,
100 0, (GdkModifierType
) 0, NULL
105 static GnomeUIInfo help1_menu_uiinfo
[] =
108 GNOME_APP_UI_ITEM
, N_("How to _Use"),
110 (gpointer
) on_how_to_use1_activate
, NULL
, NULL
,
111 GNOME_APP_PIXMAP_STOCK
, "gtk-help",
112 GDK_u
, (GdkModifierType
) GDK_CONTROL_MASK
, NULL
114 GNOMEUIINFO_MENU_ABOUT_ITEM (on_about1_activate
, NULL
),
118 static GnomeUIInfo menubar1_uiinfo
[] =
120 GNOMEUIINFO_MENU_FILE_TREE (file1_menu_uiinfo
),
122 GNOME_APP_UI_SUBTREE
, N_("_Mode"),
124 mode1_menu_uiinfo
, NULL
, NULL
,
125 GNOME_APP_PIXMAP_NONE
, NULL
,
126 GDK_m
, (GdkModifierType
) GDK_MOD1_MASK
, NULL
129 GNOME_APP_UI_ITEM
, N_("_Recent"),
131 (gpointer
) on_recent1_activate
, NULL
, NULL
,
132 GNOME_APP_PIXMAP_NONE
, NULL
,
133 GDK_r
, (GdkModifierType
) GDK_MOD1_MASK
, NULL
136 GNOME_APP_UI_SUBTREE
, N_("_Tools"),
138 tools1_menu_uiinfo
, NULL
, NULL
,
139 GNOME_APP_PIXMAP_NONE
, NULL
,
140 0, (GdkModifierType
) 0, NULL
142 GNOMEUIINFO_MENU_HELP_TREE (help1_menu_uiinfo
),
147 create_window1 (void)
168 GtkWidget
*statusbar1
;
169 GtkAccelGroup
*accel_group
;
171 accel_group
= gtk_accel_group_new ();
173 window1
= gtk_window_new (GTK_WINDOW_TOPLEVEL
);
174 gtk_window_set_title (GTK_WINDOW (window1
), _("Gnome Simple Stateful Music Player"));
176 vbox1
= gtk_vbox_new (FALSE
, 0);
177 gtk_widget_show (vbox1
);
178 gtk_container_add (GTK_CONTAINER (window1
), vbox1
);
180 menubar1
= gtk_menu_bar_new ();
181 gtk_widget_show (menubar1
);
182 gtk_box_pack_start (GTK_BOX (vbox1
), menubar1
, FALSE
, FALSE
, 4);
183 gnome_app_fill_menu (GTK_MENU_SHELL (menubar1
), menubar1_uiinfo
,
184 accel_group
, FALSE
, 0);
186 hbox3
= gtk_hbox_new (FALSE
, 0);
187 gtk_widget_show (hbox3
);
188 gtk_box_pack_start (GTK_BOX (vbox1
), hbox3
, TRUE
, TRUE
, 0);
190 vbox2
= gtk_vbox_new (FALSE
, 0);
191 gtk_widget_show (vbox2
);
192 gtk_box_pack_start (GTK_BOX (hbox3
), vbox2
, TRUE
, TRUE
, 0);
194 label4
= gtk_label_new (_("<span size=\"large\"> </span>"));
195 gtk_widget_show (label4
);
196 gtk_box_pack_start (GTK_BOX (vbox2
), label4
, TRUE
, TRUE
, 0);
197 GTK_WIDGET_SET_FLAGS (label4
, GTK_CAN_FOCUS
);
198 gtk_label_set_use_markup (GTK_LABEL (label4
), TRUE
);
199 gtk_label_set_line_wrap (GTK_LABEL (label4
), TRUE
);
200 gtk_label_set_selectable (GTK_LABEL (label4
), TRUE
);
201 gtk_misc_set_alignment (GTK_MISC (label4
), 0, 0.5);
202 gtk_misc_set_padding (GTK_MISC (label4
), 8, 5);
204 hbox4
= gtk_hbox_new (FALSE
, 0);
205 gtk_widget_show (hbox4
);
206 gtk_box_pack_start (GTK_BOX (vbox2
), hbox4
, TRUE
, TRUE
, 0);
208 label5
= gtk_label_new (_("Use the File menu to choose some music to play"));
209 gtk_widget_show (label5
);
210 gtk_box_pack_start (GTK_BOX (hbox4
), label5
, TRUE
, TRUE
, 0);
211 GTK_WIDGET_SET_FLAGS (label5
, GTK_CAN_FOCUS
);
212 gtk_label_set_line_wrap (GTK_LABEL (label5
), TRUE
);
213 gtk_label_set_selectable (GTK_LABEL (label5
), TRUE
);
214 gtk_misc_set_alignment (GTK_MISC (label5
), 0, 0);
215 gtk_misc_set_padding (GTK_MISC (label5
), 16, 4);
217 label8
= gtk_label_new ("");
218 gtk_widget_show (label8
);
219 gtk_box_pack_start (GTK_BOX (hbox4
), label8
, TRUE
, TRUE
, 0);
220 gtk_label_set_justify (GTK_LABEL (label8
), GTK_JUSTIFY_RIGHT
);
221 gtk_misc_set_alignment (GTK_MISC (label8
), 1, 0.5);
223 hbox1
= gtk_hbox_new (FALSE
, 0);
224 gtk_widget_show (hbox1
);
225 gtk_box_pack_start (GTK_BOX (vbox2
), hbox1
, FALSE
, TRUE
, 4);
227 button1
= gtk_button_new_from_stock ("gtk-media-previous");
228 gtk_widget_show (button1
);
229 gtk_box_pack_start (GTK_BOX (hbox1
), button1
, FALSE
, FALSE
, 0);
230 gtk_widget_set_size_request (button1
, 90, -1);
231 gtk_widget_add_accelerator (button1
, "activate", accel_group
,
232 GDK_Page_Up
, (GdkModifierType
) 0,
234 gtk_widget_add_accelerator (button1
, "activate", accel_group
,
235 GDK_Left
, (GdkModifierType
) GDK_CONTROL_MASK
,
238 button2
= gtk_button_new_from_stock ("gtk-media-play");
239 gtk_widget_show (button2
);
240 gtk_box_pack_start (GTK_BOX (hbox1
), button2
, FALSE
, FALSE
, 0);
241 gtk_widget_set_size_request (button2
, 90, -1);
242 gtk_widget_add_accelerator (button2
, "activate", accel_group
,
243 GDK_space
, (GdkModifierType
) 0,
246 button3
= gtk_button_new_from_stock ("gtk-media-pause");
247 gtk_widget_show (button3
);
248 gtk_box_pack_start (GTK_BOX (hbox1
), button3
, FALSE
, FALSE
, 0);
249 gtk_widget_set_size_request (button3
, 90, -1);
250 gtk_widget_add_accelerator (button3
, "activate", accel_group
,
251 GDK_space
, (GdkModifierType
) 0,
254 button4
= gtk_button_new_from_stock ("gtk-media-next");
255 gtk_widget_show (button4
);
256 gtk_box_pack_start (GTK_BOX (hbox1
), button4
, FALSE
, FALSE
, 0);
257 gtk_widget_set_size_request (button4
, 90, -1);
258 gtk_widget_add_accelerator (button4
, "activate", accel_group
,
259 GDK_Page_Down
, (GdkModifierType
) 0,
261 gtk_widget_add_accelerator (button4
, "activate", accel_group
,
262 GDK_Right
, (GdkModifierType
) GDK_CONTROL_MASK
,
265 hscale1
= gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 0, 10, 10, 0)));
266 gtk_widget_show (hscale1
);
267 gtk_box_pack_start (GTK_BOX (hbox1
), hscale1
, TRUE
, TRUE
, 2);
268 gtk_widget_set_size_request (hscale1
, 200, -1);
269 gtk_scale_set_draw_value (GTK_SCALE (hscale1
), FALSE
);
270 gtk_scale_set_digits (GTK_SCALE (hscale1
), 0);
272 label7
= gtk_label_new (_("0m 00s"));
273 gtk_widget_show (label7
);
274 gtk_box_pack_start (GTK_BOX (hbox1
), label7
, FALSE
, FALSE
, 0);
275 gtk_label_set_justify (GTK_LABEL (label7
), GTK_JUSTIFY_RIGHT
);
276 gtk_misc_set_alignment (GTK_MISC (label7
), 1, 0.5);
278 vbox3
= gtk_vbox_new (FALSE
, 0);
279 gtk_widget_show (vbox3
);
280 gtk_box_pack_start (GTK_BOX (hbox3
), vbox3
, FALSE
, FALSE
, 5);
282 image8
= gtk_image_new_from_stock ("gnome-stock-volume", GTK_ICON_SIZE_BUTTON
);
283 gtk_widget_show (image8
);
284 gtk_box_pack_start (GTK_BOX (vbox3
), image8
, FALSE
, TRUE
, 0);
286 vscale1
= gtk_vscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 0, 1.1, 0.1, 0.1, 0.1)));
287 gtk_widget_show (vscale1
);
288 gtk_box_pack_start (GTK_BOX (vbox3
), vscale1
, TRUE
, TRUE
, 0);
289 gtk_scale_set_draw_value (GTK_SCALE (vscale1
), FALSE
);
290 gtk_scale_set_digits (GTK_SCALE (vscale1
), 0);
291 gtk_range_set_inverted (GTK_RANGE (vscale1
), TRUE
);
293 statusbar1
= gtk_statusbar_new ();
294 gtk_widget_show (statusbar1
);
295 gtk_box_pack_start (GTK_BOX (vbox1
), statusbar1
, FALSE
, FALSE
, 4);
297 g_signal_connect ((gpointer
) window1
, "delete_event",
298 G_CALLBACK (on_window1_delete_event
),
300 g_signal_connect ((gpointer
) button1
, "clicked",
301 G_CALLBACK (on_button1_clicked
),
303 g_signal_connect ((gpointer
) button2
, "clicked",
304 G_CALLBACK (on_button2_clicked
),
306 g_signal_connect ((gpointer
) button3
, "clicked",
307 G_CALLBACK (on_button3_clicked
),
309 g_signal_connect ((gpointer
) button4
, "clicked",
310 G_CALLBACK (on_button4_clicked
),
312 g_signal_connect ((gpointer
) hscale1
, "change_value",
313 G_CALLBACK (on_hscale1_change_value
),
315 g_signal_connect ((gpointer
) vscale1
, "change_value",
316 G_CALLBACK (on_vscale1_change_value
),
319 /* Store pointers to all widgets, for use by lookup_widget(). */
320 GLADE_HOOKUP_OBJECT_NO_REF (window1
, window1
, "window1");
321 GLADE_HOOKUP_OBJECT (window1
, vbox1
, "vbox1");
322 GLADE_HOOKUP_OBJECT (window1
, menubar1
, "menubar1");
323 GLADE_HOOKUP_OBJECT (window1
, menubar1_uiinfo
[0].widget
, "file1");
324 GLADE_HOOKUP_OBJECT (window1
, file1_menu_uiinfo
[0].widget
, "open_directory1");
325 GLADE_HOOKUP_OBJECT (window1
, file1_menu_uiinfo
[1].widget
, "open_file1");
326 GLADE_HOOKUP_OBJECT (window1
, file1_menu_uiinfo
[2].widget
, "separator1");
327 GLADE_HOOKUP_OBJECT (window1
, file1_menu_uiinfo
[3].widget
, "quit1");
328 GLADE_HOOKUP_OBJECT (window1
, menubar1_uiinfo
[1].widget
, "mode1");
329 GLADE_HOOKUP_OBJECT (window1
, repeat_all1_uiinfo
[0].widget
, "repeat_all1");
330 GLADE_HOOKUP_OBJECT (window1
, repeat_all1_uiinfo
[1].widget
, "repeat_one1");
331 GLADE_HOOKUP_OBJECT (window1
, repeat_all1_uiinfo
[2].widget
, "shuffle1");
332 GLADE_HOOKUP_OBJECT (window1
, repeat_all1_uiinfo
[3].widget
, "no_repeat1");
333 GLADE_HOOKUP_OBJECT (window1
, menubar1_uiinfo
[2].widget
, "recent1");
334 GLADE_HOOKUP_OBJECT (window1
, menubar1_uiinfo
[3].widget
, "tools1");
335 GLADE_HOOKUP_OBJECT (window1
, tools1_menu_uiinfo
[0].widget
, "lastfm1");
336 GLADE_HOOKUP_OBJECT (window1
, menubar1_uiinfo
[4].widget
, "help1");
337 GLADE_HOOKUP_OBJECT (window1
, help1_menu_uiinfo
[0].widget
, "how_to_use1");
338 GLADE_HOOKUP_OBJECT (window1
, help1_menu_uiinfo
[1].widget
, "about1");
339 GLADE_HOOKUP_OBJECT (window1
, hbox3
, "hbox3");
340 GLADE_HOOKUP_OBJECT (window1
, vbox2
, "vbox2");
341 GLADE_HOOKUP_OBJECT (window1
, label4
, "label4");
342 GLADE_HOOKUP_OBJECT (window1
, hbox4
, "hbox4");
343 GLADE_HOOKUP_OBJECT (window1
, label5
, "label5");
344 GLADE_HOOKUP_OBJECT (window1
, label8
, "label8");
345 GLADE_HOOKUP_OBJECT (window1
, hbox1
, "hbox1");
346 GLADE_HOOKUP_OBJECT (window1
, button1
, "button1");
347 GLADE_HOOKUP_OBJECT (window1
, button2
, "button2");
348 GLADE_HOOKUP_OBJECT (window1
, button3
, "button3");
349 GLADE_HOOKUP_OBJECT (window1
, button4
, "button4");
350 GLADE_HOOKUP_OBJECT (window1
, hscale1
, "hscale1");
351 GLADE_HOOKUP_OBJECT (window1
, label7
, "label7");
352 GLADE_HOOKUP_OBJECT (window1
, vbox3
, "vbox3");
353 GLADE_HOOKUP_OBJECT (window1
, image8
, "image8");
354 GLADE_HOOKUP_OBJECT (window1
, vscale1
, "vscale1");
355 GLADE_HOOKUP_OBJECT (window1
, statusbar1
, "statusbar1");
357 gtk_widget_grab_focus (button2
);
358 gtk_window_add_accel_group (GTK_WINDOW (window1
), accel_group
);
364 create_aboutdialog1 (void)
366 GtkWidget
*aboutdialog1
;
367 const gchar
*authors
[] = {
371 /* TRANSLATORS: Replace this string with your names, one name per line. */
372 gchar
*translators
= _("translator-credits");
374 aboutdialog1
= gtk_about_dialog_new ();
375 gtk_about_dialog_set_version (GTK_ABOUT_DIALOG (aboutdialog1
), VERSION
);
376 gtk_about_dialog_set_name (GTK_ABOUT_DIALOG (aboutdialog1
), _("GSSMP"));
377 gtk_about_dialog_set_copyright (GTK_ABOUT_DIALOG (aboutdialog1
), _("Copyright (c) 2007 by Andy Balaam"));
378 gtk_about_dialog_set_license (GTK_ABOUT_DIALOG (aboutdialog1
), _("Gnome Simple Stateful Music Player is copyright (C) 2007 Andy Balaam.\n\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n\nSee the file COPYING for more details."));
379 gtk_about_dialog_set_wrap_license (GTK_ABOUT_DIALOG (aboutdialog1
), TRUE
);
380 gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (aboutdialog1
), "http://gssmp.sourceforge.net");
381 gtk_about_dialog_set_website_label (GTK_ABOUT_DIALOG (aboutdialog1
), _("http://gssmp.sourceforge.net"));
382 gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG (aboutdialog1
), authors
);
383 gtk_about_dialog_set_translator_credits (GTK_ABOUT_DIALOG (aboutdialog1
), translators
);
385 /* Store pointers to all widgets, for use by lookup_widget(). */
386 GLADE_HOOKUP_OBJECT_NO_REF (aboutdialog1
, aboutdialog1
, "aboutdialog1");
388 g_signal_connect ((gpointer
) aboutdialog1
, "response",
389 G_CALLBACK (on_about_response
),
392 g_signal_connect ((gpointer
) aboutdialog1
, "delete_event",
393 G_CALLBACK (gtk_widget_hide_on_delete
),
400 create_lastfmwindow (void)
402 GtkWidget
*lastfmwindow
;
404 GtkWidget
*checkbutton1
;
413 lastfmwindow
= gtk_window_new (GTK_WINDOW_TOPLEVEL
);
414 gtk_window_set_title (GTK_WINDOW (lastfmwindow
), _("GSSMP last.fm settings"));
415 gtk_window_set_position (GTK_WINDOW (lastfmwindow
), GTK_WIN_POS_CENTER_ON_PARENT
);
416 gtk_window_set_modal (GTK_WINDOW (lastfmwindow
), TRUE
);
417 gtk_window_set_type_hint (GTK_WINDOW (lastfmwindow
), GDK_WINDOW_TYPE_HINT_DIALOG
);
419 vbox4
= gtk_vbox_new (FALSE
, 0);
420 gtk_widget_show (vbox4
);
421 gtk_container_add (GTK_CONTAINER (lastfmwindow
), vbox4
);
423 checkbutton1
= gtk_check_button_new_with_mnemonic (_("Enable sending tracks to last.fm"));
424 gtk_widget_show (checkbutton1
);
425 gtk_box_pack_start (GTK_BOX (vbox4
), checkbutton1
, FALSE
, FALSE
, 4);
427 hbox5
= gtk_hbox_new (FALSE
, 0);
428 gtk_widget_show (hbox5
);
429 gtk_box_pack_start (GTK_BOX (vbox4
), hbox5
, TRUE
, TRUE
, 4);
431 label9
= gtk_label_new (_("lastfmsubmit executable:"));
432 gtk_widget_show (label9
);
433 gtk_box_pack_start (GTK_BOX (hbox5
), label9
, FALSE
, FALSE
, 0);
435 entry1
= gtk_entry_new ();
436 gtk_widget_show (entry1
);
437 gtk_box_pack_start (GTK_BOX (hbox5
), entry1
, TRUE
, TRUE
, 4);
438 gtk_entry_set_invisible_char (GTK_ENTRY (entry1
), 9679);
440 label10
= gtk_label_new (_("(Edit /etc/lastfmsubmitd.conf to give\nyour last.fm username and password)"));
441 gtk_widget_show (label10
);
442 gtk_box_pack_start (GTK_BOX (vbox4
), label10
, FALSE
, FALSE
, 4);
444 hbox6
= gtk_hbox_new (FALSE
, 0);
445 gtk_widget_show (hbox6
);
446 gtk_box_pack_start (GTK_BOX (vbox4
), hbox6
, TRUE
, TRUE
, 0);
448 label11
= gtk_label_new ("");
449 gtk_widget_show (label11
);
450 gtk_box_pack_start (GTK_BOX (hbox6
), label11
, TRUE
, FALSE
, 0);
452 button5
= gtk_button_new_with_mnemonic (_("Close"));
453 gtk_widget_show (button5
);
454 gtk_box_pack_start (GTK_BOX (hbox6
), button5
, FALSE
, FALSE
, 4);
456 g_signal_connect ((gpointer
) lastfmwindow
, "delete_event",
457 G_CALLBACK (on_lastfmwindow_delete_event
),
459 g_signal_connect ((gpointer
) checkbutton1
, "toggled",
460 G_CALLBACK (on_checkbutton1_toggled
),
462 g_signal_connect ((gpointer
) entry1
, "changed",
463 G_CALLBACK (on_entry1_changed
),
465 g_signal_connect ((gpointer
) button5
, "clicked",
466 G_CALLBACK (on_button5_clicked
),
469 /* Store pointers to all widgets, for use by lookup_widget(). */
470 GLADE_HOOKUP_OBJECT_NO_REF (lastfmwindow
, lastfmwindow
, "lastfmwindow");
471 GLADE_HOOKUP_OBJECT (lastfmwindow
, vbox4
, "vbox4");
472 GLADE_HOOKUP_OBJECT (lastfmwindow
, checkbutton1
, "checkbutton1");
473 GLADE_HOOKUP_OBJECT (lastfmwindow
, hbox5
, "hbox5");
474 GLADE_HOOKUP_OBJECT (lastfmwindow
, label9
, "label9");
475 GLADE_HOOKUP_OBJECT (lastfmwindow
, entry1
, "entry1");
476 GLADE_HOOKUP_OBJECT (lastfmwindow
, label10
, "label10");
477 GLADE_HOOKUP_OBJECT (lastfmwindow
, hbox6
, "hbox6");
478 GLADE_HOOKUP_OBJECT (lastfmwindow
, label11
, "label11");
479 GLADE_HOOKUP_OBJECT (lastfmwindow
, button5
, "button5");