comparison src/xs_about.c @ 660:b0743dc9165d

Change tabs to 4 spaces, everywhere.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 02 Apr 2008 22:10:05 +0300
parents e9257f006f41
children 94186706beed
comparison
equal deleted inserted replaced
659:04ea91a61225 660:b0743dc9165d
35 * Stop playing, add XMMS-SID themetune to playlist 35 * Stop playing, add XMMS-SID themetune to playlist
36 * and start playing it. 36 * and start playing it.
37 */ 37 */
38 gint xs_about_theme(void) 38 gint xs_about_theme(void)
39 { 39 {
40 const gint iSession = 0; /* Assume session 0 */ 40 const gint iSession = 0; /* Assume session 0 */
41 gint iPos; 41 gint iPos;
42 42
43 /* Stop current song, add theme to playlist, play. */ 43 /* Stop current song, add theme to playlist, play. */
44 xmms_remote_stop(iSession); 44 xmms_remote_stop(iSession);
45 iPos = xmms_remote_get_playlist_length(iSession); 45 iPos = xmms_remote_get_playlist_length(iSession);
46 xmms_remote_playlist_add_url_string(iSession, THEMETUNE_FILE); 46 xmms_remote_playlist_add_url_string(iSession, THEMETUNE_FILE);
47 xmms_remote_set_playlist_pos(iSession, iPos); 47 xmms_remote_set_playlist_pos(iSession, iPos);
48 xmms_remote_play(iSession); 48 xmms_remote_play(iSession);
49 return 0; 49 return 0;
50 } 50 }
51 #endif 51 #endif
52 52
53 53
54 XS_DEF_WINDOW_CLOSE(about_ok, aboutwin) 54 XS_DEF_WINDOW_CLOSE(about_ok, aboutwin)
58 /* 58 /*
59 * Execute the about dialog 59 * Execute the about dialog
60 */ 60 */
61 void xs_about(void) 61 void xs_about(void)
62 { 62 {
63 GtkWidget *about_vbox1; 63 GtkWidget *about_vbox1;
64 GtkWidget *about_frame; 64 GtkWidget *about_frame;
65 GtkWidget *about_logo; 65 GtkWidget *about_logo;
66 GdkPixmap *about_logo_pixmap = NULL, *about_logo_mask = NULL; 66 GdkPixmap *about_logo_pixmap = NULL, *about_logo_mask = NULL;
67 GtkWidget *about_scrwin; 67 GtkWidget *about_scrwin;
68 GtkWidget *about_text; 68 GtkWidget *about_text;
69 GtkWidget *alignment6; 69 GtkWidget *alignment6;
70 GtkWidget *about_close; 70 GtkWidget *about_close;
71 gchar tmpStr[64]; 71 gchar tmpStr[64];
72 72
73 /* Check if there already is an open about window */ 73 /* Check if there already is an open about window */
74 if (xs_aboutwin != NULL) { 74 if (xs_aboutwin != NULL) {
75 gdk_window_raise(xs_aboutwin->window); 75 gdk_window_raise(xs_aboutwin->window);
76 return; 76 return;
77 } 77 }
78 78
79 /* No, create one ... */ 79 /* No, create one ... */
80 xs_aboutwin = gtk_window_new(GTK_WINDOW_DIALOG); 80 xs_aboutwin = gtk_window_new(GTK_WINDOW_DIALOG);
81 gtk_widget_set_name(xs_aboutwin, "xs_aboutwin"); 81 gtk_widget_set_name(xs_aboutwin, "xs_aboutwin");
82 gtk_object_set_data(GTK_OBJECT(xs_aboutwin), "xs_aboutwin", xs_aboutwin); 82 gtk_object_set_data(GTK_OBJECT(xs_aboutwin), "xs_aboutwin", xs_aboutwin);
83 g_snprintf(tmpStr, sizeof(tmpStr), _("About %s"), XS_PACKAGE_STRING); 83 g_snprintf(tmpStr, sizeof(tmpStr), _("About %s"), XS_PACKAGE_STRING);
84 gtk_window_set_title(GTK_WINDOW(xs_aboutwin), tmpStr); 84 gtk_window_set_title(GTK_WINDOW(xs_aboutwin), tmpStr);
85 gtk_window_set_default_size(GTK_WINDOW(xs_aboutwin), 350, -1); 85 gtk_window_set_default_size(GTK_WINDOW(xs_aboutwin), 350, -1);
86 86
87 XS_SIGNAL_CONNECT(xs_aboutwin, "delete_event", xs_about_delete, NULL); 87 XS_SIGNAL_CONNECT(xs_aboutwin, "delete_event", xs_about_delete, NULL);
88 88
89 about_vbox1 = gtk_vbox_new(FALSE, 0); 89 about_vbox1 = gtk_vbox_new(FALSE, 0);
90 gtk_widget_set_name(about_vbox1, "about_vbox1"); 90 gtk_widget_set_name(about_vbox1, "about_vbox1");
91 gtk_widget_ref(about_vbox1); 91 gtk_widget_ref(about_vbox1);
92 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_vbox1", about_vbox1, 92 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_vbox1", about_vbox1,
93 (GtkDestroyNotify) gtk_widget_unref); 93 (GtkDestroyNotify) gtk_widget_unref);
94 gtk_widget_show(about_vbox1); 94 gtk_widget_show(about_vbox1);
95 gtk_container_add(GTK_CONTAINER(xs_aboutwin), about_vbox1); 95 gtk_container_add(GTK_CONTAINER(xs_aboutwin), about_vbox1);
96 96
97 #ifdef HAVE_THEMETUNE 97 #ifdef HAVE_THEMETUNE
98 about_frame = gtk_button_new(); 98 about_frame = gtk_button_new();
99 #else 99 #else
100 about_frame = gtk_frame_new(NULL); 100 about_frame = gtk_frame_new(NULL);
101 #endif 101 #endif
102 gtk_widget_set_name(about_frame, "about_frame"); 102 gtk_widget_set_name(about_frame, "about_frame");
103 gtk_widget_ref(about_frame); 103 gtk_widget_ref(about_frame);
104 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_frame", about_frame, 104 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_frame", about_frame,
105 (GtkDestroyNotify) gtk_widget_unref); 105 (GtkDestroyNotify) gtk_widget_unref);
106 gtk_widget_show(about_frame); 106 gtk_widget_show(about_frame);
107 gtk_box_pack_start(GTK_BOX(about_vbox1), about_frame, FALSE, FALSE, 0); 107 gtk_box_pack_start(GTK_BOX(about_vbox1), about_frame, FALSE, FALSE, 0);
108 gtk_container_set_border_width(GTK_CONTAINER(about_frame), 4); 108 gtk_container_set_border_width(GTK_CONTAINER(about_frame), 4);
109 109
110 #ifdef HAVE_THEMETUNE 110 #ifdef HAVE_THEMETUNE
111 gtk_signal_connect(GTK_OBJECT(about_frame), "clicked", GTK_SIGNAL_FUNC(xs_about_theme), NULL); 111 gtk_signal_connect(GTK_OBJECT(about_frame), "clicked", GTK_SIGNAL_FUNC(xs_about_theme), NULL);
112 #else 112 #else
113 gtk_frame_set_shadow_type(GTK_FRAME(about_frame), GTK_SHADOW_OUT); 113 gtk_frame_set_shadow_type(GTK_FRAME(about_frame), GTK_SHADOW_OUT);
114 #endif 114 #endif
115 115
116 /* Create the Gdk data for logo pixmap */ 116 /* Create the Gdk data for logo pixmap */
117 gtk_widget_realize(xs_aboutwin); 117 gtk_widget_realize(xs_aboutwin);
118 about_logo_pixmap = gdk_pixmap_create_from_xpm_d( 118 about_logo_pixmap = gdk_pixmap_create_from_xpm_d(
119 xs_aboutwin->window, &about_logo_mask, 119 xs_aboutwin->window, &about_logo_mask,
120 NULL, (gchar **) xmms_sid_logo_xpm); 120 NULL, (gchar **) xmms_sid_logo_xpm);
121 121
122 about_logo = gtk_pixmap_new(about_logo_pixmap, about_logo_mask); 122 about_logo = gtk_pixmap_new(about_logo_pixmap, about_logo_mask);
123 123
124 /* Create logo widget */ 124 /* Create logo widget */
125 gtk_widget_set_name(about_logo, "about_logo"); 125 gtk_widget_set_name(about_logo, "about_logo");
126 gtk_widget_ref(about_logo); 126 gtk_widget_ref(about_logo);
127 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_logo", about_logo, 127 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_logo", about_logo,
128 (GtkDestroyNotify) gtk_widget_unref); 128 (GtkDestroyNotify) gtk_widget_unref);
129 gtk_widget_show(about_logo); 129 gtk_widget_show(about_logo);
130 gtk_container_add(GTK_CONTAINER(about_frame), about_logo); 130 gtk_container_add(GTK_CONTAINER(about_frame), about_logo);
131 gtk_misc_set_padding(GTK_MISC(about_logo), 0, 6); 131 gtk_misc_set_padding(GTK_MISC(about_logo), 0, 6);
132 132
133 about_scrwin = gtk_scrolled_window_new(NULL, NULL); 133 about_scrwin = gtk_scrolled_window_new(NULL, NULL);
134 gtk_widget_set_name(about_scrwin, "about_scrwin"); 134 gtk_widget_set_name(about_scrwin, "about_scrwin");
135 gtk_widget_ref(about_scrwin); 135 gtk_widget_ref(about_scrwin);
136 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_scrwin", about_scrwin, 136 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_scrwin", about_scrwin,
137 (GtkDestroyNotify) gtk_widget_unref); 137 (GtkDestroyNotify) gtk_widget_unref);
138 gtk_widget_show(about_scrwin); 138 gtk_widget_show(about_scrwin);
139 gtk_box_pack_start(GTK_BOX(about_vbox1), about_scrwin, TRUE, TRUE, 0); 139 gtk_box_pack_start(GTK_BOX(about_vbox1), about_scrwin, TRUE, TRUE, 0);
140 gtk_container_set_border_width(GTK_CONTAINER(about_scrwin), 8); 140 gtk_container_set_border_width(GTK_CONTAINER(about_scrwin), 8);
141 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(about_scrwin), 141 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(about_scrwin),
142 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); 142 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
143 143
144 about_text = gtk_text_new(NULL, NULL); 144 about_text = gtk_text_new(NULL, NULL);
145 gtk_widget_set_name(about_text, "about_text"); 145 gtk_widget_set_name(about_text, "about_text");
146 gtk_widget_ref(about_text); 146 gtk_widget_ref(about_text);
147 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_text", about_text, 147 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_text", about_text,
148 (GtkDestroyNotify) gtk_widget_unref); 148 (GtkDestroyNotify) gtk_widget_unref);
149 gtk_widget_show(about_text); 149 gtk_widget_show(about_text);
150 gtk_container_add(GTK_CONTAINER(about_scrwin), about_text); 150 gtk_container_add(GTK_CONTAINER(about_scrwin), about_text);
151 gtk_widget_set_usize(about_text, -2, 100); 151 gtk_widget_set_usize(about_text, -2, 100);
152 gtk_text_insert(GTK_TEXT(about_text), NULL, NULL, NULL, 152 gtk_text_insert(GTK_TEXT(about_text), NULL, NULL, NULL,
153 "\n" 153 "\n"
154 "This release of XMMS-SID is dedicated to\n" 154 "This release of XMMS-SID is dedicated to\n"
155 " Richard Joseph\n" 155 " Richard Joseph\n"
156 " and\n" 156 " and\n"
157 " Lauri Sipilä (aka Xaztur/PWP)\n" 157 " Lauri Sipilä (aka Xaztur/PWP)\n"
158 " - Now gone, but forever in our hearts -\n" 158 " - Now gone, but forever in our hearts -\n"
159 "\n" 159 "\n"
160 "\n" 160 "\n"
161 "(C) Copyright 1999-2008\n" 161 "(C) Copyright 1999-2008\n"
162 "\tTecnic Software productions (TNSP)\n" 162 "\tTecnic Software productions (TNSP)\n"
163 "\n" 163 "\n"
164 "Programming and design\n" 164 "Programming and design\n"
165 "\tMatti 'ccr' Hämäläinen\n" 165 "\tMatti 'ccr' Hämäläinen\n"
166 "\n" 166 "\n"
167 #ifdef HAVE_SIDPLAY1 167 #ifdef HAVE_SIDPLAY1
168 "libSIDPlay1 created by\n" 168 "libSIDPlay1 created by\n"
169 "\tMichael Schwendt\n" "\n" 169 "\tMichael Schwendt\n" "\n"
170 #endif 170 #endif
171 #ifdef HAVE_SIDPLAY2 171 #ifdef HAVE_SIDPLAY2
172 "libSIDPlay2 and reSID created by\n" 172 "libSIDPlay2 and reSID created by\n"
173 "\tSimon White, Dag Lem,\n" 173 "\tSimon White, Dag Lem,\n"
174 "\tMichael Schwendt and rest.\n" 174 "\tMichael Schwendt and rest.\n"
175 "\n" 175 "\n"
176 #endif 176 #endif
177 #ifdef HAVE_THEMETUNE 177 #ifdef HAVE_THEMETUNE
178 "\"Kummatti City\", theme of XMMS-SID 0.8\n" 178 "\"Kummatti City\", theme of XMMS-SID 0.8\n"
179 "\tby Ari 'Agemixer' Yliaho\n" 179 "\tby Ari 'Agemixer' Yliaho\n"
180 "\t(C) Copyright 1998 Scallop\n" 180 "\t(C) Copyright 1998 Scallop\n"
181 "\t(Refer to README for license)\n" "\n" 181 "\t(Refer to README for license)\n" "\n"
182 #endif 182 #endif
183 "Original XMMS-SID (v0.4) by\n" "\tWillem Monsuwe\n" "\n" 183 "Original XMMS-SID (v0.4) by\n" "\tWillem Monsuwe\n" "\n"
184 184
185 "Greetings fly out to ...\n" 185 "Greetings fly out to ...\n"
186 "\tEveryone at #Linux.Fi, #Fireball,\n" 186 "\tEveryone at #Linux.Fi, #Fireball,\n"
187 "\t#TNSP and #c-64 of IRCNet, #xmms\n" 187 "\t#TNSP and #c-64 of IRCNet, #xmms\n"
188 "\tof Freenode.net.\n" 188 "\tof Freenode.net.\n"
189 "\n" 189 "\n"
190 "\tDekadence, PWP, Byterapers,\n" 190 "\tDekadence, PWP, Byterapers,\n"
191 "\tmfx, Unique, Fairlight, iSO,\n" 191 "\tmfx, Unique, Fairlight, iSO,\n"
192 "\tWrath Designs, Padua, Extend,\n" 192 "\tWrath Designs, Padua, Extend,\n"
193 "\tPHn, Creators, Cosine, tAAt,\n" 193 "\tPHn, Creators, Cosine, tAAt,\n"
194 "\tViruz, Crest and Skalaria.\n" "\n" 194 "\tViruz, Crest and Skalaria.\n" "\n"
195 195
196 "Special thanks\n" 196 "Special thanks\n"
197 "\tGerfried 'Alfie' Fuchs\n" 197 "\tGerfried 'Alfie' Fuchs\n"
198 "\tAndreas 'mrsid' Varga\n" 198 "\tAndreas 'mrsid' Varga\n"
199 "\tAll the betatesters.\n" 199 "\tAll the betatesters.\n"
200 "\tAll the users!\n", -1); 200 "\tAll the users!\n", -1);
201 201
202 alignment6 = gtk_alignment_new(0.5, 0.5, 0.18, 1); 202 alignment6 = gtk_alignment_new(0.5, 0.5, 0.18, 1);
203 gtk_widget_set_name(alignment6, "alignment6"); 203 gtk_widget_set_name(alignment6, "alignment6");
204 gtk_widget_ref(alignment6); 204 gtk_widget_ref(alignment6);
205 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "alignment6", alignment6, 205 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "alignment6", alignment6,
206 (GtkDestroyNotify) gtk_widget_unref); 206 (GtkDestroyNotify) gtk_widget_unref);
207 gtk_widget_show(alignment6); 207 gtk_widget_show(alignment6);
208 gtk_box_pack_start(GTK_BOX(about_vbox1), alignment6, FALSE, TRUE, 0); 208 gtk_box_pack_start(GTK_BOX(about_vbox1), alignment6, FALSE, TRUE, 0);
209 gtk_container_set_border_width(GTK_CONTAINER(alignment6), 8); 209 gtk_container_set_border_width(GTK_CONTAINER(alignment6), 8);
210 210
211 about_close = gtk_button_new_with_label(_("Close")); 211 about_close = gtk_button_new_with_label(_("Close"));
212 gtk_widget_set_name(about_close, "about_close"); 212 gtk_widget_set_name(about_close, "about_close");
213 gtk_widget_ref(about_close); 213 gtk_widget_ref(about_close);
214 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_close", about_close, 214 gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_close", about_close,
215 (GtkDestroyNotify) gtk_widget_unref); 215 (GtkDestroyNotify) gtk_widget_unref);
216 gtk_widget_show(about_close); 216 gtk_widget_show(about_close);
217 gtk_container_add(GTK_CONTAINER(alignment6), about_close); 217 gtk_container_add(GTK_CONTAINER(alignment6), about_close);
218 GTK_WIDGET_SET_FLAGS(about_close, GTK_CAN_DEFAULT); 218 GTK_WIDGET_SET_FLAGS(about_close, GTK_CAN_DEFAULT);
219 219
220 XS_SIGNAL_CONNECT(about_close, "clicked", xs_about_ok, NULL); 220 XS_SIGNAL_CONNECT(about_close, "clicked", xs_about_ok, NULL);
221 221
222 gtk_widget_show(xs_aboutwin); 222 gtk_widget_show(xs_aboutwin);
223 } 223 }