Freeciv-3.2
Loading...
Searching...
No Matches
soundset_dlg.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18#include <gtk/gtk.h>
19
20/* utility */
21#include "fcintl.h"
22
23/* common */
24#include "game.h"
25
26/* client */
27#include "audio.h"
28#include "client_main.h"
29
30/* client/gui-gtk-3.22 */
31#include "gui_main.h"
32#include "gui_stuff.h"
33
34#include "dialogs_g.h"
35
36static void soundset_suggestion_callback(GtkWidget *dlg, gint arg);
37static void musicset_suggestion_callback(GtkWidget *dlg, gint arg);
38
39/************************************************************************/
43{
44 if (arg == GTK_RESPONSE_YES) {
45 /* User accepted soundset loading */
48 }
49}
50
51/************************************************************************/
56{
57 GtkWidget *dialog, *label;
58 char buf[1024];
59
60 dialog = gtk_dialog_new_with_buttons(_("Preferred soundset"),
61 NULL,
62 0,
63 _("_Load soundset"),
65 _("_Keep current soundset"),
67 NULL);
68 setup_dialog(dialog, toplevel);
71
72 fc_snprintf(buf, sizeof(buf),
73 _("Modpack suggests using %s soundset.\n"
74 "It might not work with other soundsets.\n"
75 "You are currently using soundset %s."),
77
78 label = gtk_label_new(buf);
81 gtk_widget_show(label);
82
83 g_signal_connect(dialog, "response",
85
86 /* In case incoming rulesets are incompatible with current soundset
87 * we need to block their receive before user has accepted loading
88 * of the correct soundset. */
90
91 gtk_widget_destroy(dialog);
92}
93
94/************************************************************************/
98{
99 if (arg == GTK_RESPONSE_YES) {
100 /* User accepted musicset loading */
102 }
103}
104
105/************************************************************************/
110{
111 GtkWidget *dialog, *label;
112 char buf[1024];
113
114 dialog = gtk_dialog_new_with_buttons(_("Preferred musicset"),
115 NULL,
116 0,
117 _("_Load musicset"),
119 _("_Keep current musicset"),
121 NULL);
124
125 fc_snprintf(buf, sizeof(buf),
126 _("Modpack suggests using %s musicset.\n"
127 "It might not work with other musicsets.\n"
128 "You are currently using musicset %s."),
130
131 label = gtk_label_new(buf);
134 gtk_widget_show(label);
135
136 g_signal_connect(dialog, "response",
138
139 /* In case incoming rulesets are incompatible with current musicset
140 * we need to block their receive before user has accepted loading
141 * of the correct musicset. */
142 gtk_dialog_run(GTK_DIALOG(dialog));
143
144 gtk_widget_destroy(dialog);
145}
void audio_restart(const char *soundset_name, const char *musicset_name)
Definition audio.c:376
char music_set_name[512]
char sound_set_name[512]
char * incite_cost
Definition comments.c:75
#define _(String)
Definition fcintl.h:67
struct civ_game game
Definition game.c:62
GtkWidget * toplevel
Definition gui_main.c:125
void setup_dialog(GtkWidget *shell, GtkWidget *parent)
Definition gui_stuff.c:287
void popup_musicset_suggestion_dialog(void)
void popup_soundset_suggestion_dialog(void)
static void musicset_suggestion_callback(GtkWidget *dlg, gint arg)
static void soundset_suggestion_callback(GtkWidget *dlg, gint arg)
struct packet_ruleset_control control
Definition game.h:83
char preferred_soundset[MAX_LEN_NAME]
char preferred_musicset[MAX_LEN_NAME]
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:974
#define TRUE
Definition support.h:46