Merge pull request #160 from skybon/gtkbuilder

started XQF UI reconstruction, cmake improvements, ref #14
This commit is contained in:
Thomas Debesse 2015-06-26 01:06:22 +02:00
commit e3bddc11eb
20 changed files with 2167 additions and 425 deletions

View File

@ -4,14 +4,22 @@ cmake_minimum_required(VERSION 2.8.7)
project(xqf)
set (VERSION "1.0.6.2")
set (DOMAIN ${PROJECT_NAME})
set (DOMAIN "${PROJECT_NAME}")
set (LINGUAS ca da de es fi fr pl ru)
set (DEFAULT_GUI GTK2)
# Paths
set (PACKAGE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/xqf")
set (LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/locale")
set (PIXMAPS_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor)
if (NOT MAN_ENTRY_PATH)
set (MAN_ENTRY_PATH "${CMAKE_INSTALL_PREFIX}/share/man")
endif (NOT MAN_ENTRY_PATH)
if (NOT PIXMAPS_ENTRY_PATH)
set (PIXMAPS_ENTRY_PATH "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor")
endif (NOT PIXMAPS_ENTRY_PATH)
if (NOT CMAKE_INSTALL_PREFIX)
set (CMAKE_INSTALL_PREFIX "/usr")
@ -21,7 +29,6 @@ endif (NOT CMAKE_INSTALL_PREFIX)
add_definitions (-DPACKAGE="${PROJECT_NAME}" -DPACKAGE_VERSION="${VERSION}" -DXQF_VERSION="${VERSION}" -DDOMAIN="${DOMAIN}" -DLOCALEDIR="${LOCALEDIR}" -DPACKAGE_DATA_DIR="${PACKAGE_DATA_DIR}")
# Options
option(USE_GTK3 "Use GTK+ toolkit version 3" OFF)
option(DEPRECATED_DISABLE "Disable deprecated parts of GLib, GObject, GDK and GTK+" OFF)
option(USE_GEOIP "Depend on GeoIP library for geolocation" ON)
@ -34,10 +41,25 @@ endif (NOT WITH_QSTAT)
add_definitions (-DQSTAT_EXEC="${WITH_QSTAT}")
if (CMAKE_BUILD_TYPE EQUAL DEBUG)
if (CMAKE_BUILD_TYPE MATCHES DEBUG)
add_definitions (-DDEBUG)
endif (CMAKE_BUILD_TYPE EQUAL DEBUG)
endif (CMAKE_BUILD_TYPE MATCHES DEBUG)
# Default GUI setting
if (NOT (GUI MATCHES GTK2 OR GUI MATCHES GTK3))
set (GUI ${DEFAULT_GUI})
endif (NOT (GUI MATCHES GTK2 OR GUI MATCHES GTK3))
# GUI definitions
if (GUI MATCHES GTK2)
add_definitions (-DGUI_GTK2)
endif (GUI MATCHES GTK2)
if (GUI MATCHES GTK3)
add_definitions (-DGUI_GTK3)
endif (GUI MATCHES GTK3)
# Other definitions
if (RCON_STANDALONE)
add_definitions (-DRCON_STANDALONE)
endif (RCON_STANDALONE)
@ -55,8 +77,6 @@ set (xqf_HEADERS_DIR ${CMAKE_SOURCE_DIR}/src)
set (xqf_SOURCES
${CMAKE_SOURCE_DIR}/src/xqf.ui
${CMAKE_SOURCE_DIR}/src/addmaster.c
${CMAKE_SOURCE_DIR}/src/addserver.c
${CMAKE_SOURCE_DIR}/src/config.c
@ -281,17 +301,24 @@ find_package (Gettext REQUIRED)
pkg_check_modules (UNZIP REQUIRED minizip)
pkg_check_modules (XML REQUIRED libxml-2.0)
if (USE_GTK3)
pkg_check_modules (GTK3 REQUIRED gtk+-3.0)
include_directories (${GTK3_INCLUDE_DIRS})
link_directories (${GTK3_LIBRARY_DIRS})
add_definitions (${GTK3_CFLAGS_OTHER})
else (USE_GTK3)
if (GUI MATCHES GTK2)
pkg_check_modules (GTK2 REQUIRED gtk+-2.0)
include_directories (${GTK2_INCLUDE_DIRS})
link_directories (${GTK2_LIBRARY_DIRS})
add_definitions (${GTK2_CFLAGS_OTHER})
endif (USE_GTK3)
set (GUI_SET ON)
endif (GUI MATCHES GTK2)
if (GUI MATCHES GTK3)
pkg_check_modules (GTK3 REQUIRED gtk+-3.0)
include_directories (${GTK3_INCLUDE_DIRS})
link_directories (${GTK3_LIBRARY_DIRS})
add_definitions (${GTK3_CFLAGS_OTHER})
set (GUI_SET ON)
endif (GUI MATCHES GTK3)
if (USE_GEOIP)
pkg_check_modules (GEOIP REQUIRED geoip)
@ -318,11 +345,13 @@ add_definitions (-DGAMES_INCLUDE="${CMAKE_BINARY_DIR}/games.c")
add_executable (xqf ${xqf_SOURCES})
target_link_libraries (xqf ${UNZIP_LIBRARIES} dl)
if (USE_GTK3)
target_link_libraries (xqf ${GTK3_LIBRARIES})
else (USE_GTK3)
if (GUI MATCHES GTK2)
target_link_libraries (xqf ${GTK2_LIBRARIES})
endif (USE_GTK3)
endif (GUI MATCHES GTK2)
if (GUI MATCHES GTK3)
target_link_libraries (xqf ${GTK3_LIBRARIES})
endif (GUI MATCHES GTK3)
if (USE_GEOIP)
target_link_libraries (xqf GeoIP)
@ -366,7 +395,13 @@ install (TARGETS xqf DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
install (PROGRAMS ${CMAKE_SOURCE_DIR}/src/script/qstat_savage.sh DESTINATION "${PACKAGE_DATA_DIR}/script")
# UI
install (FILES ${CMAKE_SOURCE_DIR}/src/xqf.ui DESTINATION ${PACKAGE_DATA_DIR}/ui)
if (GUI MATCHES GTK2)
install (FILES ${CMAKE_SOURCE_DIR}/src/xqf-gtk2.ui DESTINATION ${PACKAGE_DATA_DIR}/ui)
endif (GUI MATCHES GTK2)
if (GUI MATCHES GTK3)
install (FILES ${CMAKE_SOURCE_DIR}/src/xqf-gtk3.ui DESTINATION ${PACKAGE_DATA_DIR}/ui)
endif (GUI MATCHES GTK3)
# Icons
install (FILES ${xpm_DATA} DESTINATION ${PACKAGE_DATA_DIR}/xpm)
@ -386,7 +421,7 @@ install (FILES ${CMAKE_SOURCE_DIR}/pixmaps/scalable/xqf.svg DESTINATION ${PIXMAP
install (FILES ${CMAKE_SOURCE_DIR}/src/qstat.cfg DESTINATION ${PACKAGE_DATA_DIR})
# Man pages
install (FILES ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.6 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man6)
install (FILES ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.6 DESTINATION ${MAN_ENTRY_PATH}/man6)
# i18n
foreach (LANG ${LINGUAS})

View File

@ -246,9 +246,9 @@ struct master *add_master_dialog (struct master *m) {
gtk_combo_set_case_sensitive (GTK_COMBO (master_name_combo), TRUE);
gtk_combo_set_use_arrows_always (GTK_COMBO (master_name_combo), TRUE);
gtk_combo_disable_activate (GTK_COMBO (master_name_combo));
gtk_signal_connect(
g_signal_connect(
GTK_OBJECT (GTK_COMBO (master_name_combo)->entry), "activate",
GTK_SIGNAL_FUNC (master_okbutton_callback), GTK_OBJECT (window));
G_CALLBACK (master_okbutton_callback), GTK_OBJECT (window));
GTK_WIDGET_SET_FLAGS (GTK_COMBO (master_name_combo)->entry, GTK_CAN_FOCUS);
GTK_WIDGET_UNSET_FLAGS (GTK_COMBO (master_name_combo)->button, GTK_CAN_FOCUS);
@ -266,7 +266,7 @@ struct master *add_master_dialog (struct master *m) {
/* Master Type Option Menu */
option_menu = create_server_type_menu (master_type, create_server_type_menu_filter_configured, GTK_SIGNAL_FUNC(select_master_type_callback));
option_menu = create_server_type_menu (master_type, create_server_type_menu_filter_configured, G_CALLBACK(select_master_type_callback));
gtk_box_pack_start (GTK_BOX (hbox), option_menu, FALSE, FALSE, 0);
@ -293,13 +293,13 @@ struct master *add_master_dialog (struct master *m) {
gtk_combo_set_case_sensitive (GTK_COMBO (master_addr_combo), TRUE);
gtk_combo_set_use_arrows_always (GTK_COMBO (master_addr_combo), TRUE);
gtk_combo_disable_activate (GTK_COMBO (master_addr_combo));
gtk_signal_connect (
g_signal_connect (
GTK_OBJECT (GTK_COMBO (master_addr_combo)->entry), "activate",
GTK_SIGNAL_FUNC (master_okbutton_callback), GTK_OBJECT (window));
gtk_signal_connect (
G_CALLBACK (master_okbutton_callback), GTK_OBJECT (window));
g_signal_connect (
GTK_OBJECT (GTK_COMBO (master_addr_combo)->list),
"selection-changed",
GTK_SIGNAL_FUNC
G_CALLBACK
(master_address_from_history_selected_callback),NULL);
GTK_WIDGET_SET_FLAGS (GTK_COMBO (master_addr_combo)->entry, GTK_CAN_FOCUS);
@ -331,8 +331,8 @@ struct master *add_master_dialog (struct master *m) {
if (master_to_edit) {
gtk_widget_set_sensitive (GTK_WIDGET(master_query_type_radios[i]),FALSE);
}
gtk_signal_connect(GTK_OBJECT (master_query_type_radios[i]), "toggled",
GTK_SIGNAL_FUNC (master_type_radio_callback), (gpointer)i);
g_signal_connect(GTK_OBJECT (master_query_type_radios[i]), "toggled",
G_CALLBACK (master_type_radio_callback), (gpointer)i);
gtk_widget_show (master_query_type_radios[i]);
gtk_box_pack_start (GTK_BOX (hbox),master_query_type_radios[i], FALSE, FALSE, 0);
@ -369,7 +369,7 @@ struct master *add_master_dialog (struct master *m) {
button = gtk_button_new_with_label (_("Cancel"));
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_set_usize (button, 80, -1);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect_swapped (GTK_OBJECT (button), "clicked", G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_show (button);
@ -378,7 +378,7 @@ struct master *add_master_dialog (struct master *m) {
button = gtk_button_new_with_label ("OK");
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_set_usize (button, 80, -1);
gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC(master_okbutton_callback), window);
g_signal_connect (GTK_OBJECT (button), "clicked", G_CALLBACK(master_okbutton_callback), window);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
gtk_widget_show (button);

View File

@ -108,12 +108,12 @@ char *add_server_dialog (enum server_type *type, const char* addr) {
gtk_combo_set_case_sensitive (GTK_COMBO (server_combo), TRUE);
gtk_combo_set_use_arrows_always (GTK_COMBO (server_combo), TRUE);
gtk_combo_disable_activate (GTK_COMBO (server_combo));
gtk_signal_connect (
g_signal_connect (
GTK_OBJECT (GTK_COMBO (server_combo)->entry), "activate",
GTK_SIGNAL_FUNC (server_combo_activate_callback), NULL);
gtk_signal_connect_object (
G_CALLBACK (server_combo_activate_callback), NULL);
g_signal_connect_swapped (
GTK_OBJECT (GTK_COMBO (server_combo)->entry), "activate",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
GTK_WIDGET_SET_FLAGS (GTK_COMBO (server_combo)->entry, GTK_CAN_FOCUS);
GTK_WIDGET_UNSET_FLAGS (GTK_COMBO (server_combo)->button, GTK_CAN_FOCUS);
@ -126,7 +126,7 @@ char *add_server_dialog (enum server_type *type, const char* addr) {
option_menu = create_server_type_menu (*type,
create_server_type_menu_filter_configured,
GTK_SIGNAL_FUNC(select_server_type_callback));
G_CALLBACK(select_server_type_callback));
gtk_box_pack_start (GTK_BOX (hbox), option_menu, FALSE, FALSE, 0);
gtk_widget_show (option_menu);
@ -150,8 +150,8 @@ char *add_server_dialog (enum server_type *type, const char* addr) {
button = gtk_button_new_with_label (_("Cancel"));
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_set_usize (button, 80, -1);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_show (button);
@ -160,11 +160,11 @@ char *add_server_dialog (enum server_type *type, const char* addr) {
button = gtk_button_new_with_label ("OK");
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_set_usize (button, 80, -1);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (server_combo_activate_callback),
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (server_combo_activate_callback),
GTK_OBJECT (GTK_COMBO (server_combo)->entry));
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
gtk_widget_show (button);

View File

@ -51,18 +51,18 @@ GtkWidget *dialog_create_modal_transient_window (const char *title,
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
gtk_signal_connect (GTK_OBJECT (window), "delete_event",
GTK_SIGNAL_FUNC (window_delete_event_callback), NULL);
g_signal_connect (GTK_OBJECT (window), "delete_event",
G_CALLBACK (window_delete_event_callback), NULL);
if (on_destroy) {
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (on_destroy), NULL);
g_signal_connect (GTK_OBJECT (window), "destroy",
G_CALLBACK (on_destroy), NULL);
}
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
g_signal_connect (GTK_OBJECT (window), "destroy",
G_CALLBACK (gtk_main_quit), NULL);
if (close_on_esc) {
gtk_signal_connect (GTK_OBJECT (window), "key_press_event",
GTK_SIGNAL_FUNC (destroy_on_escape), NULL);
g_signal_connect (GTK_OBJECT (window), "key_press_event",
G_CALLBACK (destroy_on_escape), NULL);
}
if (title)
@ -136,8 +136,8 @@ void dialog_ok (const char *title, const char *fmt, ...) {
button = gtk_button_new_with_label (_("OK"));
gtk_widget_set_usize (button, 96, -1);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, FALSE, 0);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
gtk_widget_show (button);
@ -211,10 +211,10 @@ int dialog_yesno (const char *title, int defbutton, char *yes, char *no,
button = gtk_button_new_with_label ((yes)? yes : _("Yes"));
gtk_widget_set_usize (button, 96, -1);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (yes_button_clicked_callback), &res);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect (GTK_OBJECT (button), "clicked",
G_CALLBACK (yes_button_clicked_callback), &res);
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
if (defbutton == 0)
gtk_widget_grab_default (button);
@ -223,8 +223,8 @@ int dialog_yesno (const char *title, int defbutton, char *yes, char *no,
button = gtk_button_new_with_label ((no)? no : _("No"));
gtk_widget_set_usize (button, 96, -1);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, FALSE, 0);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
if (defbutton == 1)
gtk_widget_grab_default (button);
@ -291,10 +291,10 @@ int dialog_yesnoredial (const char *title, int defbutton, char *yes, char *no, c
button = gtk_button_new_with_label ((yes)? yes : _("Yes"));
gtk_widget_set_usize (button, 96, -1);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (yes_button_clicked_callback), &res);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect (GTK_OBJECT (button), "clicked",
G_CALLBACK (yes_button_clicked_callback), &res);
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
if (defbutton == 0)
gtk_widget_grab_default (button);
@ -303,8 +303,8 @@ int dialog_yesnoredial (const char *title, int defbutton, char *yes, char *no, c
button = gtk_button_new_with_label ((no)? no : _("No"));
gtk_widget_set_usize (button, 96, -1);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, FALSE, 0);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
if (defbutton == 1)
gtk_widget_grab_default (button);
@ -313,10 +313,10 @@ int dialog_yesnoredial (const char *title, int defbutton, char *yes, char *no, c
button = gtk_button_new_with_label ((redial)? redial : _("Redial"));
gtk_widget_set_usize (button, 96, -1);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (redial_button_clicked_callback), &res);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect (GTK_OBJECT (button), "clicked",
G_CALLBACK (redial_button_clicked_callback), &res);
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
if (defbutton == 2)
gtk_widget_grab_default (button);
@ -384,21 +384,21 @@ static char *va_enter_string_dialog (int visible, char *optstr, int *optval, cha
gtk_entry_set_visibility (GTK_ENTRY (enter_string_entry), visible);
gtk_widget_set_usize (enter_string_entry, 128, -1);
gtk_box_pack_start (GTK_BOX (hbox), enter_string_entry, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (enter_string_entry), "activate",
GTK_SIGNAL_FUNC (enter_string_activate_callback), NULL);
gtk_signal_connect_object (GTK_OBJECT (enter_string_entry), "activate",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect (GTK_OBJECT (enter_string_entry), "activate",
G_CALLBACK (enter_string_activate_callback), NULL);
g_signal_connect_swapped (GTK_OBJECT (enter_string_entry), "activate",
G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
gtk_widget_grab_focus (enter_string_entry);
gtk_widget_show (enter_string_entry);
/* OK Button */
button = gtk_button_new_with_label (_("OK"));
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (enter_string_activate_callback),
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (enter_string_activate_callback),
GTK_OBJECT (enter_string_entry));
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
@ -406,8 +406,8 @@ static char *va_enter_string_dialog (int visible, char *optstr, int *optval, cha
button = gtk_button_new_with_label (_("Cancel"));
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
gtk_widget_show (button);
gtk_widget_show (hbox);
@ -537,17 +537,17 @@ GtkWidget* file_dialog(const char *title, GtkSignalFunc ok_callback, gpointer da
gtk_window_set_modal (GTK_WINDOW(file_selector),TRUE);
// gtk_signal_connect (GTK_OBJECT (file_selector), "destroy", (GtkSignalFunc) file_dialog_destroy_callback, &file_selector);
// g_signal_connect (GTK_OBJECT (file_selector), "destroy", (GtkSignalFunc) file_dialog_destroy_callback, &file_selector);
gtk_signal_connect (GTK_OBJECT (file_selector->ok_button),
g_signal_connect (GTK_OBJECT (file_selector->ok_button),
"clicked", ok_callback, data);
gtk_signal_connect_object (GTK_OBJECT (file_selector->ok_button),
g_signal_connect_swapped (GTK_OBJECT (file_selector->ok_button),
"clicked", (GtkSignalFunc) gtk_widget_destroy,
GTK_OBJECT (file_selector));
/* Connect the cancel_button to destroy the widget */
gtk_signal_connect_object (GTK_OBJECT (file_selector->cancel_button),
g_signal_connect_swapped (GTK_OBJECT (file_selector->cancel_button),
"clicked", (GtkSignalFunc) gtk_widget_destroy,
GTK_OBJECT (file_selector));
@ -557,7 +557,7 @@ GtkWidget* file_dialog(const char *title, GtkSignalFunc ok_callback, gpointer da
}
GtkWidget* file_dialog_textentry(const char *title, GtkWidget* entry) {
GtkWidget* filesel = file_dialog(title, GTK_SIGNAL_FUNC(file_dialog_ok_set_textentry), entry);
GtkWidget* filesel = file_dialog(title, G_CALLBACK(file_dialog_ok_set_textentry), entry);
const char* text = gtk_entry_get_text(GTK_ENTRY (entry));
if (text && *text) {
gtk_file_selection_set_filename(GTK_FILE_SELECTION(filesel), text);

View File

@ -948,8 +948,8 @@ static GtkWidget *create_filter_menu() {
menu = gtk_menu_new();
// gtk_signal_connect(GTK_OBJECT(menu_item), "activate",
// GTK_SIGNAL_FUNC(callback), (gpointer) 0);
// g_signal_connect(GTK_OBJECT(menu_item), "activate",
// G_CALLBACK(callback), (gpointer) 0);
for (i = 0;i<server_filters->len;i++) {
filter = g_array_index(server_filters, struct server_filter_vars*, i);
@ -961,8 +961,8 @@ static GtkWidget *create_filter_menu() {
gtk_menu_append(GTK_MENU(menu), menu_item);
gtk_widget_show(menu_item);
gtk_signal_connect(GTK_OBJECT(menu_item), "activate",
GTK_SIGNAL_FUNC(filter_select_callback), GINT_TO_POINTER(i+1)); // array starts from zero but filters from 1
g_signal_connect(GTK_OBJECT(menu_item), "activate",
G_CALLBACK(filter_select_callback), GINT_TO_POINTER(i+1)); // array starts from zero but filters from 1
}
gtk_widget_show (menu);
@ -1227,22 +1227,22 @@ static void server_filter_page (GtkWidget *notebook) {
button = gtk_button_new_with_label(_("New"));
gtk_widget_set_usize(button, 80, -1);
gtk_signal_connect_object(GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(filter_new_rename_callback), (gpointer)0);
g_signal_connect_swapped(GTK_OBJECT(button), "clicked",
G_CALLBACK(filter_new_rename_callback), (gpointer)0);
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
gtk_widget_show(button);
button = gtk_button_new_with_label(_("Rename"));
gtk_widget_set_usize(button, 80, -1);
gtk_signal_connect_object(GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(filter_new_rename_callback), (gpointer)1);
g_signal_connect_swapped(GTK_OBJECT(button), "clicked",
G_CALLBACK(filter_new_rename_callback), (gpointer)1);
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
gtk_widget_show(button);
button = gtk_button_new_with_label(_("Delete"));
gtk_widget_set_usize(button, 80, -1);
gtk_signal_connect_object(GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(filter_delete_callback), NULL);
g_signal_connect_swapped(GTK_OBJECT(button), "clicked",
G_CALLBACK(filter_delete_callback), NULL);
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
gtk_widget_show(button);
@ -1278,8 +1278,8 @@ static void server_filter_page (GtkWidget *notebook) {
gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(filter_ping_spinner),
GTK_UPDATE_ALWAYS);
gtk_widget_set_usize(filter_ping_spinner, 64, -1);
gtk_signal_connect_object(GTK_OBJECT(filter_ping_spinner), "changed",
GTK_SIGNAL_FUNC(server_filter_set_changed_callback),(gpointer) TRUE);
g_signal_connect_swapped(GTK_OBJECT(filter_ping_spinner), "changed",
G_CALLBACK(server_filter_set_changed_callback),(gpointer) TRUE);
gtk_table_attach_defaults(GTK_TABLE(table), filter_ping_spinner, 1, 2, row, row+1);
gtk_widget_show(filter_ping_spinner);
@ -1294,8 +1294,8 @@ static void server_filter_page (GtkWidget *notebook) {
game_contains_entry = gtk_entry_new_with_max_length(32);
gtk_widget_set_usize(game_contains_entry, 64, -1);
gtk_entry_set_editable(GTK_ENTRY(game_contains_entry), TRUE);
gtk_signal_connect_object(GTK_OBJECT(game_contains_entry), "changed",
GTK_SIGNAL_FUNC(server_filter_set_changed_callback), (gpointer) TRUE);
g_signal_connect_swapped(GTK_OBJECT(game_contains_entry), "changed",
G_CALLBACK(server_filter_set_changed_callback), (gpointer) TRUE);
gtk_table_attach_defaults(GTK_TABLE(table), game_contains_entry, 4, 5, row, row+1);
gtk_widget_show(game_contains_entry);
@ -1315,8 +1315,8 @@ static void server_filter_page (GtkWidget *notebook) {
filter_retries_spinner = gtk_spin_button_new(GTK_ADJUSTMENT(adj), 0, 0);
gtk_widget_set_usize(filter_retries_spinner, 64, -1);
gtk_signal_connect_object(GTK_OBJECT(filter_retries_spinner), "changed",
GTK_SIGNAL_FUNC(server_filter_set_changed_callback), (gpointer) TRUE);
g_signal_connect_swapped(GTK_OBJECT(filter_retries_spinner), "changed",
G_CALLBACK(server_filter_set_changed_callback), (gpointer) TRUE);
gtk_table_attach_defaults(GTK_TABLE(table), filter_retries_spinner,
1, 2, row, row+1);
gtk_widget_show(filter_retries_spinner);
@ -1331,8 +1331,8 @@ static void server_filter_page (GtkWidget *notebook) {
filter_game_type_entry = gtk_entry_new_with_max_length(32);
gtk_widget_set_usize(filter_game_type_entry, 64, -1);
gtk_entry_set_editable(GTK_ENTRY(filter_game_type_entry), TRUE);
gtk_signal_connect_object(GTK_OBJECT(filter_game_type_entry), "changed",
GTK_SIGNAL_FUNC(server_filter_set_changed_callback), (gpointer) TRUE);
g_signal_connect_swapped(GTK_OBJECT(filter_game_type_entry), "changed",
G_CALLBACK(server_filter_set_changed_callback), (gpointer) TRUE);
gtk_table_attach_defaults(GTK_TABLE(table), filter_game_type_entry, 4, 5, row, row+1);
gtk_widget_show(filter_game_type_entry);
@ -1342,8 +1342,8 @@ static void server_filter_page (GtkWidget *notebook) {
/*not full */
filter_not_full_check_button =gtk_check_button_new_with_label(_("it is not full"));
gtk_signal_connect_object(GTK_OBJECT(filter_not_full_check_button),"toggled",
GTK_SIGNAL_FUNC(server_filter_set_changed_callback), (gpointer) TRUE);
g_signal_connect_swapped(GTK_OBJECT(filter_not_full_check_button),"toggled",
G_CALLBACK(server_filter_set_changed_callback), (gpointer) TRUE);
gtk_table_attach_defaults(GTK_TABLE(table),filter_not_full_check_button, 0, 2, row, row+1);
gtk_widget_show(filter_not_full_check_button);
@ -1356,8 +1356,8 @@ static void server_filter_page (GtkWidget *notebook) {
version_contains_entry = gtk_entry_new_with_max_length(32);
gtk_widget_set_usize(version_contains_entry, 64, -1);
gtk_entry_set_editable(GTK_ENTRY(version_contains_entry), TRUE);
gtk_signal_connect_object(GTK_OBJECT(version_contains_entry), "changed",
GTK_SIGNAL_FUNC(server_filter_set_changed_callback), (gpointer) TRUE);
g_signal_connect_swapped(GTK_OBJECT(version_contains_entry), "changed",
G_CALLBACK(server_filter_set_changed_callback), (gpointer) TRUE);
gtk_table_attach_defaults(GTK_TABLE(table), version_contains_entry, 4, 5, row, row+1);
gtk_widget_show(version_contains_entry);
@ -1368,8 +1368,8 @@ static void server_filter_page (GtkWidget *notebook) {
/* not empty */
filter_not_empty_check_button =
gtk_check_button_new_with_label(_("it is not empty"));
gtk_signal_connect_object(GTK_OBJECT(filter_not_empty_check_button), "toggled",
GTK_SIGNAL_FUNC(server_filter_set_changed_callback), (gpointer) TRUE);
g_signal_connect_swapped(GTK_OBJECT(filter_not_empty_check_button), "toggled",
G_CALLBACK(server_filter_set_changed_callback), (gpointer) TRUE);
gtk_table_attach_defaults(GTK_TABLE(table), filter_not_empty_check_button,
0, 2, row, row+1);
gtk_widget_show(filter_not_empty_check_button);
@ -1383,8 +1383,8 @@ static void server_filter_page (GtkWidget *notebook) {
map_contains_entry = gtk_entry_new_with_max_length(32);
gtk_widget_set_usize(map_contains_entry, 64, -1);
gtk_entry_set_editable(GTK_ENTRY(map_contains_entry), TRUE);
gtk_signal_connect_object(GTK_OBJECT(map_contains_entry), "changed",
GTK_SIGNAL_FUNC(server_filter_set_changed_callback), (gpointer) TRUE);
g_signal_connect_swapped(GTK_OBJECT(map_contains_entry), "changed",
G_CALLBACK(server_filter_set_changed_callback), (gpointer) TRUE);
gtk_table_attach_defaults(GTK_TABLE(table), map_contains_entry, 4, 5, row, row+1);
gtk_widget_show(map_contains_entry);
@ -1395,8 +1395,8 @@ static void server_filter_page (GtkWidget *notebook) {
/* no cheats */
filter_no_cheats_check_button =
gtk_check_button_new_with_label(_("cheats are not allowed"));
gtk_signal_connect_object(GTK_OBJECT(filter_no_cheats_check_button), "toggled",
GTK_SIGNAL_FUNC(server_filter_set_changed_callback), (gpointer) TRUE);
g_signal_connect_swapped(GTK_OBJECT(filter_no_cheats_check_button), "toggled",
G_CALLBACK(server_filter_set_changed_callback), (gpointer) TRUE);
gtk_table_attach_defaults(GTK_TABLE(table), filter_no_cheats_check_button, 0, 2, row, row+1);
gtk_widget_show(filter_no_cheats_check_button);
@ -1409,8 +1409,8 @@ static void server_filter_page (GtkWidget *notebook) {
server_name_contains_entry = gtk_entry_new_with_max_length(32);
gtk_widget_set_usize(server_name_contains_entry, 64, -1);
gtk_entry_set_editable(GTK_ENTRY(server_name_contains_entry), TRUE);
gtk_signal_connect_object(GTK_OBJECT(server_name_contains_entry), "changed",
GTK_SIGNAL_FUNC(server_filter_set_changed_callback), (gpointer) TRUE);
g_signal_connect_swapped(GTK_OBJECT(server_name_contains_entry), "changed",
G_CALLBACK(server_filter_set_changed_callback), (gpointer) TRUE);
gtk_table_attach_defaults(GTK_TABLE(table),server_name_contains_entry , 4, 5, row, row+1);
gtk_widget_show(server_name_contains_entry);
@ -1421,8 +1421,8 @@ static void server_filter_page (GtkWidget *notebook) {
/* no password */
filter_no_password_check_button =
gtk_check_button_new_with_label(_("no password required"));
gtk_signal_connect_object(GTK_OBJECT(filter_no_password_check_button), "toggled",
GTK_SIGNAL_FUNC(server_filter_set_changed_callback), (gpointer) TRUE);
g_signal_connect_swapped(GTK_OBJECT(filter_no_password_check_button), "toggled",
G_CALLBACK(server_filter_set_changed_callback), (gpointer) TRUE);
gtk_table_attach_defaults(GTK_TABLE(table), filter_no_password_check_button, 0, 2, row, row+1);
gtk_widget_show(filter_no_password_check_button);
@ -1476,19 +1476,19 @@ static void server_filter_page (GtkWidget *notebook) {
gtk_container_add(GTK_CONTAINER(vbuttonbox1),
country_selection_button);
gtk_widget_set_usize(country_selection_button, 80, -1);
gtk_signal_connect(GTK_OBJECT(country_selection_button), "clicked",
GTK_SIGNAL_FUNC(country_select_button_pressed), NULL);
g_signal_connect(GTK_OBJECT(country_selection_button), "clicked",
G_CALLBACK(country_select_button_pressed), NULL);
gtk_signal_connect_object(GTK_OBJECT(country_selection_button), "clicked",
GTK_SIGNAL_FUNC(server_filter_set_changed_callback), (gpointer) TRUE);
g_signal_connect_swapped(GTK_OBJECT(country_selection_button), "clicked",
G_CALLBACK(server_filter_set_changed_callback), (gpointer) TRUE);
country_clear_button = gtk_button_new_with_label(_("clear"));
gtk_widget_set_sensitive(country_clear_button,FALSE);
gtk_signal_connect(GTK_OBJECT(country_clear_button), "clicked",
GTK_SIGNAL_FUNC(country_clear_list), NULL);
gtk_signal_connect_object(GTK_OBJECT(country_clear_button), "clicked",
GTK_SIGNAL_FUNC(server_filter_set_changed_callback), (gpointer) TRUE);
g_signal_connect(GTK_OBJECT(country_clear_button), "clicked",
G_CALLBACK(country_clear_list), NULL);
g_signal_connect_swapped(GTK_OBJECT(country_clear_button), "clicked",
G_CALLBACK(server_filter_set_changed_callback), (gpointer) TRUE);
gtk_widget_show(country_clear_button);
@ -1569,21 +1569,21 @@ int filters_cfg_dialog (int page_num) {
button = gtk_button_new_with_label(_("Cancel"));
gtk_widget_set_usize(button, 80, -1);
/* gtk_signal_connect_object(GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(filters_on_cancel), NULL);
/* g_signal_connect_swapped(GTK_OBJECT(button), "clicked",
G_CALLBACK(filters_on_cancel), NULL);
*/
gtk_signal_connect_object(GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(window));
g_signal_connect_swapped(GTK_OBJECT(button), "clicked",
G_CALLBACK(gtk_widget_destroy), GTK_OBJECT(window));
gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
gtk_widget_show(button);
button = gtk_button_new_with_label(_("OK"));
gtk_widget_set_usize(button, 80, -1);
gtk_signal_connect(GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(filters_on_ok), NULL);
gtk_signal_connect_object(GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(window));
g_signal_connect(GTK_OBJECT(button), "clicked",
G_CALLBACK(filters_on_ok), NULL);
g_signal_connect_swapped(GTK_OBJECT(button), "clicked",
G_CALLBACK(gtk_widget_destroy), GTK_OBJECT(window));
gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
gtk_widget_grab_default(button);
@ -1912,13 +1912,13 @@ static void country_create_popup_window(void) {
gtk_clist_set_column_width(GTK_CLIST(country_left_list), 0, 100);
gtk_signal_connect(GTK_OBJECT(country_left_list), "select_row",
GTK_SIGNAL_FUNC(country_selection_left_list),
g_signal_connect(GTK_OBJECT(country_left_list), "select_row",
G_CALLBACK(country_selection_left_list),
NULL);
gtk_signal_connect(GTK_OBJECT(country_left_list), "button_press_event",
GTK_SIGNAL_FUNC(country_mouse_click_left_list),
g_signal_connect(GTK_OBJECT(country_left_list), "button_press_event",
G_CALLBACK(country_mouse_click_left_list),
NULL);
/* fill the list with all countries if the flag is available*/
@ -1943,8 +1943,8 @@ static void country_create_popup_window(void) {
// gtk_button_box_set_child_size(GTK_BUTTON_BOX(vbuttonbox1), 63, -1);
button3 = gtk_button_new_with_label(">>");
gtk_signal_connect(GTK_OBJECT(button3), "clicked",
GTK_SIGNAL_FUNC(country_add_button), NULL);
g_signal_connect(GTK_OBJECT(button3), "clicked",
G_CALLBACK(country_add_button), NULL);
gtk_widget_show(button3);
gtk_container_add(GTK_CONTAINER(vbuttonbox1), button3);
GTK_WIDGET_SET_FLAGS(button3, GTK_CAN_DEFAULT);
@ -1952,8 +1952,8 @@ static void country_create_popup_window(void) {
/* << */
button4 = gtk_button_new_with_label("<<");
gtk_signal_connect(GTK_OBJECT(button4), "clicked",
GTK_SIGNAL_FUNC(country_delete_button), NULL);
g_signal_connect(GTK_OBJECT(button4), "clicked",
G_CALLBACK(country_delete_button), NULL);
gtk_widget_show(button4);
gtk_container_add(GTK_CONTAINER(vbuttonbox1), button4);
GTK_WIDGET_SET_FLAGS(button4, GTK_CAN_DEFAULT);
@ -1973,16 +1973,16 @@ static void country_create_popup_window(void) {
gtk_clist_set_column_width(GTK_CLIST(country_right_list), 0, 100);
gtk_signal_connect(GTK_OBJECT(country_right_list), "select_row",
GTK_SIGNAL_FUNC(country_selection_right_list),
g_signal_connect(GTK_OBJECT(country_right_list), "select_row",
G_CALLBACK(country_selection_right_list),
NULL);
gtk_signal_connect(GTK_OBJECT(country_right_list), "unselect_row",
GTK_SIGNAL_FUNC(country_unselection_right_list),
g_signal_connect(GTK_OBJECT(country_right_list), "unselect_row",
G_CALLBACK(country_unselection_right_list),
NULL);
gtk_signal_connect(GTK_OBJECT(country_right_list), "button_press_event",
GTK_SIGNAL_FUNC(country_mouse_click_right_list),
g_signal_connect(GTK_OBJECT(country_right_list), "button_press_event",
G_CALLBACK(country_mouse_click_right_list),
NULL);
@ -2017,8 +2017,8 @@ static void country_create_popup_window(void) {
gtk_widget_show(country_right_list);
country_show_all_check_button = gtk_check_button_new_with_label(_("Show all countries"));
gtk_signal_connect(GTK_OBJECT(country_show_all_check_button),"toggled",
GTK_SIGNAL_FUNC(country_show_all_changed_callback), (gpointer) country_left_list);
g_signal_connect(GTK_OBJECT(country_show_all_check_button),"toggled",
G_CALLBACK(country_show_all_changed_callback), (gpointer) country_left_list);
gtk_widget_show(country_show_all_check_button);
gtk_box_pack_start(GTK_BOX(vbox2), country_show_all_check_button, FALSE, FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(country_show_all_check_button), 4);
@ -2037,10 +2037,10 @@ static void country_create_popup_window(void) {
button1 = gtk_button_new_with_label(_("OK"));
// gtk_widget_set_usize(button1, 80, -1);
gtk_signal_connect(GTK_OBJECT(button1), "clicked",
GTK_SIGNAL_FUNC(country_selection_on_ok), NULL);
gtk_signal_connect_object(GTK_OBJECT(button1), "clicked",
GTK_SIGNAL_FUNC(gtk_widget_destroy),
g_signal_connect(GTK_OBJECT(button1), "clicked",
G_CALLBACK(country_selection_on_ok), NULL);
g_signal_connect_swapped(GTK_OBJECT(button1), "clicked",
G_CALLBACK(gtk_widget_destroy),
GTK_OBJECT(country_popup_window));
gtk_widget_show(button1);
@ -2049,8 +2049,8 @@ static void country_create_popup_window(void) {
button2 = gtk_button_new_with_label(_("Cancel"));
// gtk_widget_set_usize(button2, 80, -1);
gtk_signal_connect_object(GTK_OBJECT(button2), "clicked",
GTK_SIGNAL_FUNC(gtk_widget_destroy),
g_signal_connect_swapped(GTK_OBJECT(button2), "clicked",
G_CALLBACK(gtk_widget_destroy),
GTK_OBJECT(country_popup_window));
gtk_widget_show(button2);

View File

@ -662,8 +662,8 @@ static GtkWidget *player_filter_pattern_editor (void) {
pattern_entry = gtk_entry_new_with_max_length (256);
gtk_table_attach_defaults (GTK_TABLE (table), pattern_entry, 1, 2, 0, 1);
gtk_signal_connect (GTK_OBJECT (pattern_entry), "activate",
GTK_SIGNAL_FUNC (sync_pattern_data), NULL);
g_signal_connect (GTK_OBJECT (pattern_entry), "activate",
G_CALLBACK (sync_pattern_data), NULL);
gtk_widget_show (pattern_entry);
/* Mode Buttons */
@ -677,8 +677,8 @@ static GtkWidget *player_filter_pattern_editor (void) {
mode_buttons[i] = gtk_radio_button_new_with_label (group, _(mode_names[i]));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (mode_buttons[i]));
gtk_signal_connect (GTK_OBJECT (mode_buttons[i]), "clicked",
GTK_SIGNAL_FUNC (sync_pattern_data), NULL);
g_signal_connect (GTK_OBJECT (mode_buttons[i]), "clicked",
G_CALLBACK (sync_pattern_data), NULL);
gtk_box_pack_start (GTK_BOX (hbox), mode_buttons[i], FALSE, FALSE, 0);
gtk_widget_show (mode_buttons[i]);
@ -771,12 +771,12 @@ void player_filter_page (GtkWidget *notebook) {
GTK_SELECTION_BROWSE);
gtk_clist_set_reorderable (GTK_CLIST (pattern_clist), TRUE);
gtk_signal_connect (GTK_OBJECT (pattern_clist), "event",
GTK_SIGNAL_FUNC (pattern_clist_event_callback), NULL);
gtk_signal_connect (GTK_OBJECT (pattern_clist), "select_row",
GTK_SIGNAL_FUNC (pattern_clist_select_row_callback), NULL);
gtk_signal_connect (GTK_OBJECT (pattern_clist), "row_move",
GTK_SIGNAL_FUNC (pattern_clist_row_move_callback), NULL);
g_signal_connect (GTK_OBJECT (pattern_clist), "event",
G_CALLBACK (pattern_clist_event_callback), NULL);
g_signal_connect (GTK_OBJECT (pattern_clist), "select_row",
G_CALLBACK (pattern_clist_select_row_callback), NULL);
g_signal_connect (GTK_OBJECT (pattern_clist), "row_move",
G_CALLBACK (pattern_clist_row_move_callback), NULL);
for (i = 0; i < 3; i++) {
pixmap = aligned_pixmap (group_pix[i].pix, group_pix[i].mask);
@ -806,14 +806,14 @@ void player_filter_page (GtkWidget *notebook) {
button = gtk_button_new_with_label (_("New"));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (new_pattern_callback), NULL);
g_signal_connect (GTK_OBJECT (button), "clicked",
G_CALLBACK (new_pattern_callback), NULL);
gtk_widget_show (button);
delete_button = gtk_button_new_with_label (_("Delete"));
gtk_box_pack_start (GTK_BOX (vbox), delete_button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (delete_button), "clicked",
GTK_SIGNAL_FUNC (delete_pattern_callback), NULL);
g_signal_connect (GTK_OBJECT (delete_button), "clicked",
G_CALLBACK (delete_pattern_callback), NULL);
gtk_widget_show (delete_button);
alignment = gtk_alignment_new (0, 0.5, 1, 0);
@ -824,14 +824,14 @@ void player_filter_page (GtkWidget *notebook) {
up_button = gtk_button_new_with_label (_("Up"));
gtk_box_pack_start (GTK_BOX (vbox2), up_button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (up_button), "clicked",
GTK_SIGNAL_FUNC (move_up_down_pattern_callback), (void *) -1);
g_signal_connect (GTK_OBJECT (up_button), "clicked",
G_CALLBACK (move_up_down_pattern_callback), (void *) -1);
gtk_widget_show (up_button);
down_button = gtk_button_new_with_label (_("Down"));
gtk_box_pack_start (GTK_BOX (vbox2), down_button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (down_button), "clicked",
GTK_SIGNAL_FUNC (move_up_down_pattern_callback), (void *) 1);
g_signal_connect (GTK_OBJECT (down_button), "clicked",
G_CALLBACK (move_up_down_pattern_callback), (void *) 1);
gtk_widget_show (down_button);
gtk_widget_show (vbox2);

View File

@ -99,8 +99,8 @@ static void create_menu_recursive (GtkWidget *menu,
if (items->type != MENU_BRANCH && items->type != MENU_LAST_BRANCH) {
if (items->callback) {
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
GTK_SIGNAL_FUNC (items->callback), items->user_data);
g_signal_connect (GTK_OBJECT (menu_item), "activate",
G_CALLBACK (items->callback), items->user_data);
}
if (accel_group && items->accel_key) {

View File

@ -1730,8 +1730,8 @@ static GtkWidget *q1_skin_box_create (void) {
q1_top_color_button = gtk_button_new_with_label (" ");
gtk_widget_set_usize (q1_top_color_button, 40, -1);
gtk_signal_connect (GTK_OBJECT (q1_top_color_button), "event",
GTK_SIGNAL_FUNC (color_button_event_callback), NULL);
g_signal_connect (GTK_OBJECT (q1_top_color_button), "event",
G_CALLBACK (color_button_event_callback), NULL);
gtk_table_attach_defaults (GTK_TABLE (table), q1_top_color_button,
1, 2, 0, 1);
set_bg_color (q1_top_color_button, fix_qw_player_color (pref_q1_top_color));
@ -1746,8 +1746,8 @@ static GtkWidget *q1_skin_box_create (void) {
q1_bottom_color_button = gtk_button_new_with_label (" ");
gtk_widget_set_usize (q1_bottom_color_button, 40, -1);
gtk_signal_connect (GTK_OBJECT (q1_bottom_color_button), "event",
GTK_SIGNAL_FUNC (color_button_event_callback), NULL);
g_signal_connect (GTK_OBJECT (q1_bottom_color_button), "event",
G_CALLBACK (color_button_event_callback), NULL);
gtk_table_attach_defaults (GTK_TABLE (table), q1_bottom_color_button,
1, 2, 1, 2);
set_bg_color (q1_bottom_color_button,
@ -1806,8 +1806,8 @@ static GtkWidget *qw_skin_box_create (void) {
gtk_widget_set_usize(GTK_COMBO(qw_skin_combo)->entry, 112, -1);
gtk_combo_set_use_arrows_always(GTK_COMBO(qw_skin_combo), TRUE);
gtk_combo_set_case_sensitive(GTK_COMBO(qw_skin_combo), TRUE);
gtk_signal_connect (GTK_OBJECT(GTK_COMBO(qw_skin_combo)->entry),
"changed", GTK_SIGNAL_FUNC(qw_skin_combo_changed_callback), NULL);
g_signal_connect (GTK_OBJECT(GTK_COMBO(qw_skin_combo)->entry),
"changed", G_CALLBACK(qw_skin_combo_changed_callback), NULL);
gtk_container_add(GTK_CONTAINER(alignment), qw_skin_combo);
gtk_widget_show(qw_skin_combo);
@ -1829,8 +1829,8 @@ static GtkWidget *qw_skin_box_create (void) {
qw_top_color_button = gtk_button_new_with_label (" ");
gtk_widget_set_usize (qw_top_color_button, 40, -1);
gtk_signal_connect (GTK_OBJECT (qw_top_color_button), "event",
GTK_SIGNAL_FUNC (color_button_event_callback), NULL);
g_signal_connect (GTK_OBJECT (qw_top_color_button), "event",
G_CALLBACK (color_button_event_callback), NULL);
gtk_table_attach_defaults (GTK_TABLE (table), qw_top_color_button,
1, 2, 0, 1);
set_bg_color (qw_top_color_button, fix_qw_player_color (pref_qw_top_color));
@ -1845,7 +1845,7 @@ static GtkWidget *qw_skin_box_create (void) {
qw_bottom_color_button = gtk_button_new_with_label (" ");
gtk_widget_set_usize (qw_bottom_color_button, 40, -1);
gtk_signal_connect (GTK_OBJECT (qw_bottom_color_button), "event", GTK_SIGNAL_FUNC (color_button_event_callback), NULL);
g_signal_connect (GTK_OBJECT (qw_bottom_color_button), "event", G_CALLBACK (color_button_event_callback), NULL);
gtk_table_attach_defaults (GTK_TABLE (table), qw_bottom_color_button, 1, 2, 1, 2);
set_bg_color (qw_bottom_color_button, fix_qw_player_color (pref_qw_bottom_color));
gtk_widget_show (qw_bottom_color_button);
@ -1946,7 +1946,7 @@ static GtkWidget *q2_skin_box_create (void) {
gtk_widget_set_usize(GTK_COMBO(q2_skin_combo)->entry, 144, -1);
gtk_combo_set_use_arrows_always(GTK_COMBO(q2_skin_combo), TRUE);
gtk_combo_set_case_sensitive(GTK_COMBO(q2_skin_combo), TRUE);
gtk_signal_connect(GTK_OBJECT(GTK_COMBO(q2_skin_combo)->entry), "changed", GTK_SIGNAL_FUNC(q2_skin_combo_changed_callback), NULL);
g_signal_connect(GTK_OBJECT(GTK_COMBO(q2_skin_combo)->entry), "changed", G_CALLBACK(q2_skin_combo_changed_callback), NULL);
gtk_container_add(GTK_CONTAINER(alignment), q2_skin_combo);
gtk_widget_show(q2_skin_combo);
@ -2288,7 +2288,7 @@ static GtkWidget *create_wb_switch_menu(void(*callback)(GtkWidget *, int)) {
for (i = 0; i < 9; i++) {
menu_item = gtk_menu_item_new_with_label(_(wb_switch_labels[i]));
gtk_signal_connect(GTK_OBJECT(menu_item), "activate", GTK_SIGNAL_FUNC(callback), GINT_TO_POINTER(i));
g_signal_connect(GTK_OBJECT(menu_item), "activate", G_CALLBACK(callback), GINT_TO_POINTER(i));
gtk_menu_append(GTK_MENU(menu), menu_item);
gtk_widget_show(menu_item);
}
@ -2313,17 +2313,17 @@ static GtkWidget *create_noskins_menu (int qworq2) {
menu = gtk_menu_new();
menu_item = gtk_menu_item_new_with_label(_("Use skins"));
gtk_signal_connect(GTK_OBJECT(menu_item), "activate", GTK_SIGNAL_FUNC(callback), (gpointer) 0);
g_signal_connect(GTK_OBJECT(menu_item), "activate", G_CALLBACK(callback), (gpointer) 0);
gtk_menu_append(GTK_MENU(menu), menu_item);
gtk_widget_show(menu_item);
menu_item = gtk_menu_item_new_with_label(_("Don\'t use skins"));
gtk_signal_connect(GTK_OBJECT(menu_item), "activate", GTK_SIGNAL_FUNC(callback), (gpointer) 1);
g_signal_connect(GTK_OBJECT(menu_item), "activate", G_CALLBACK(callback), (gpointer) 1);
gtk_menu_append(GTK_MENU(menu), menu_item);
gtk_widget_show(menu_item);
menu_item = gtk_menu_item_new_with_label(_("Don\'t download new skins"));
gtk_signal_connect(GTK_OBJECT(menu_item), "activate", GTK_SIGNAL_FUNC(callback), (gpointer) 2);
g_signal_connect(GTK_OBJECT(menu_item), "activate", G_CALLBACK(callback), (gpointer) 2);
gtk_menu_append(GTK_MENU(menu), menu_item);
gtk_widget_show(menu_item);
@ -2713,18 +2713,18 @@ static GtkWidget *generic_game_frame (enum server_type type) {
gtk_entry_set_text(GTK_ENTRY(genprefs[type].cmd_entry), games[type].cmd);
gtk_entry_set_position(GTK_ENTRY(genprefs[type].cmd_entry), 0);
}
gtk_signal_connect_object(GTK_OBJECT(genprefs[type].cmd_entry), "activate", GTK_SIGNAL_FUNC(game_file_activate_callback), GINT_TO_POINTER(type));
g_signal_connect_swapped(GTK_OBJECT(genprefs[type].cmd_entry), "activate", G_CALLBACK(game_file_activate_callback), GINT_TO_POINTER(type));
gtk_box_pack_start(GTK_BOX(hbox),genprefs[type].cmd_entry , TRUE, TRUE, 0);
gtk_widget_show(genprefs[type].cmd_entry);
button = gtk_button_new_with_label("...");
gtk_signal_connect_object(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(game_file_dialog), GINT_TO_POINTER(type));
g_signal_connect_swapped(GTK_OBJECT(button), "clicked", G_CALLBACK(game_file_dialog), GINT_TO_POINTER(type));
gtk_box_pack_start(GTK_BOX(hbox),button , FALSE, FALSE, 3);
gtk_widget_show(button);
// translator: button for command suggestion
button = gtk_button_new_with_label(_("Suggest"));
gtk_signal_connect_object(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(pref_suggest_command), GINT_TO_POINTER(type));
g_signal_connect_swapped(GTK_OBJECT(button), "clicked", G_CALLBACK(pref_suggest_command), GINT_TO_POINTER(type));
gtk_widget_set_sensitive(button, pref_can_suggest(type));
gtk_box_pack_start(GTK_BOX(hbox),button , FALSE, FALSE, 0);
@ -2752,13 +2752,13 @@ static GtkWidget *generic_game_frame (enum server_type type) {
gtk_box_pack_start(GTK_BOX(hbox),genprefs[type].dir_entry , TRUE, TRUE, 0);
button = gtk_button_new_with_label("...");
gtk_signal_connect_object(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(game_dir_dialog), (gpointer)type);
g_signal_connect_swapped(GTK_OBJECT(button), "clicked", G_CALLBACK(game_dir_dialog), (gpointer)type);
gtk_box_pack_start(GTK_BOX(hbox),button , FALSE, FALSE, 3);
gtk_widget_show(button);
// translator: button for directory guess
button = gtk_button_new_with_label(_("Suggest"));
gtk_signal_connect_object(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(game_file_activate_callback), (gpointer)type);
g_signal_connect_swapped(GTK_OBJECT(button), "clicked", G_CALLBACK(game_file_activate_callback), (gpointer)type);
gtk_box_pack_start(GTK_BOX(hbox),button , FALSE, FALSE, 0);
gtk_tooltips_set_tip(tooltips, button, _("Tries to guess the working directory based on the command line"), NULL);
@ -2766,13 +2766,13 @@ static GtkWidget *generic_game_frame (enum server_type type) {
if (games[type].custom_cfgs) {
gtk_object_set_user_data(GTK_OBJECT(genprefs[type].dir_entry), (gpointer) type);
gtk_signal_connect(GTK_OBJECT(genprefs[type].dir_entry),
g_signal_connect(GTK_OBJECT(genprefs[type].dir_entry),
"activate",
GTK_SIGNAL_FUNC(dir_entry_activate_callback),
G_CALLBACK(dir_entry_activate_callback),
NULL);
gtk_signal_connect(GTK_OBJECT(genprefs[type].dir_entry),
g_signal_connect(GTK_OBJECT(genprefs[type].dir_entry),
"focus_out_event",
GTK_SIGNAL_FUNC(dir_entry_activate_callback),
G_CALLBACK(dir_entry_activate_callback),
NULL);
}
gtk_widget_show(genprefs[type].dir_entry);
@ -2873,7 +2873,7 @@ static GtkWidget *custom_args_options_page (enum server_type type) {
gtk_widget_show(arguments_clist);
gtk_container_add(GTK_CONTAINER(scrolledwindow1), arguments_clist);
gtk_clist_column_titles_show(GTK_CLIST(arguments_clist));
gtk_signal_connect(GTK_OBJECT(arguments_clist), "select_row", GTK_SIGNAL_FUNC(custom_args_clist_select_row_callback), arguments_clist);
g_signal_connect(GTK_OBJECT(arguments_clist), "select_row", G_CALLBACK(custom_args_clist_select_row_callback), arguments_clist);
gtk_object_set_user_data(GTK_OBJECT(arguments_clist), (gpointer) type);
game_label = gtk_label_new(_("Game"));
@ -2961,23 +2961,23 @@ static GtkWidget *custom_args_options_page (enum server_type type) {
GTK_WIDGET_SET_FLAGS(custom_args_add_button[type], GTK_CAN_DEFAULT);
gtk_object_set_user_data(GTK_OBJECT(new_button), (gpointer) type);
gtk_signal_connect(GTK_OBJECT(new_button), "clicked",
GTK_SIGNAL_FUNC(new_custom_args_callback),
g_signal_connect(GTK_OBJECT(new_button), "clicked",
G_CALLBACK(new_custom_args_callback),
(gpointer) arguments_clist);
gtk_object_set_user_data(GTK_OBJECT(delete_button), (gpointer) type);
gtk_signal_connect(GTK_OBJECT(delete_button), "clicked",
GTK_SIGNAL_FUNC(delete_custom_args_callback),
g_signal_connect(GTK_OBJECT(delete_button), "clicked",
G_CALLBACK(delete_custom_args_callback),
(gpointer) arguments_clist);
gtk_object_set_user_data(GTK_OBJECT(defaults_button), (gpointer) type);
gtk_signal_connect(GTK_OBJECT(defaults_button), "clicked",
GTK_SIGNAL_FUNC(add_custom_args_defaults),
g_signal_connect(GTK_OBJECT(defaults_button), "clicked",
G_CALLBACK(add_custom_args_defaults),
(gpointer) arguments_clist);
gtk_object_set_user_data(GTK_OBJECT(custom_args_add_button[type]), (gpointer) type);
gtk_signal_connect(GTK_OBJECT(custom_args_add_button[type]), "clicked",
GTK_SIGNAL_FUNC(add_custom_args_callback),
g_signal_connect(GTK_OBJECT(custom_args_add_button[type]), "clicked",
G_CALLBACK(add_custom_args_callback),
(gpointer) arguments_clist);
// Populate clist with custom_args from g_slist
@ -3054,8 +3054,8 @@ static GtkWidget *games_config_page (int defgame) {
gtk_container_add (GTK_CONTAINER (genprefs[i].game_button), game_pixmap_with_label (i));
gtk_signal_connect (GTK_OBJECT (genprefs[i].game_button), "select",
GTK_SIGNAL_FUNC (game_listitem_selected_callback), GINT_TO_POINTER(i));
g_signal_connect (GTK_OBJECT (genprefs[i].game_button), "select",
G_CALLBACK (game_listitem_selected_callback), GINT_TO_POINTER(i));
gtk_widget_show(genprefs[i].game_button);
gtk_container_add (GTK_CONTAINER (gtklist), genprefs[i].game_button);
@ -3384,17 +3384,17 @@ static GtkWidget *q3_mem_options_page (void) {
button = gtk_button_new_with_label(_("Default"));
gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (q3_set_memory_callback), (gpointer) 0);
g_signal_connect (GTK_OBJECT (button), "clicked", G_CALLBACK (q3_set_memory_callback), (gpointer) 0);
gtk_widget_show (button);
button = gtk_button_new_with_label(_("128MB"));
gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (q3_set_memory_callback), (gpointer) 1);
g_signal_connect (GTK_OBJECT (button), "clicked", G_CALLBACK (q3_set_memory_callback), (gpointer) 1);
gtk_widget_show (button);
button = gtk_button_new_with_label(_(">256MB"));
gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (q3_set_memory_callback), (gpointer) 2);
g_signal_connect (GTK_OBJECT (button), "clicked", G_CALLBACK (q3_set_memory_callback), (gpointer) 2);
gtk_widget_show (button);
gtk_widget_show (hbox2);
@ -3929,7 +3929,7 @@ static GtkWidget *general_options_page (void) {
GtkWidget* button = gtk_button_new_with_label(_("scan now"));
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_misc_set_padding(GTK_MISC(GTK_BIN(button)->child),4,0);
gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (scan_maps_callback), NULL);
g_signal_connect (GTK_OBJECT (button), "clicked", G_CALLBACK (scan_maps_callback), NULL);
gtk_widget_show (button);
}
@ -3954,7 +3954,7 @@ static GtkWidget *general_options_page (void) {
terminate_check_button = gtk_check_button_new_with_label (_("Terminate XQF"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (terminate_check_button), default_terminate);
gtk_signal_connect (GTK_OBJECT (terminate_check_button), "toggled", GTK_SIGNAL_FUNC (terminate_toggled_callback), NULL);
g_signal_connect (GTK_OBJECT (terminate_check_button), "toggled", G_CALLBACK (terminate_toggled_callback), NULL);
gtk_box_pack_start (GTK_BOX (hbox), terminate_check_button, FALSE, FALSE, 0);
gtk_widget_show (terminate_check_button);
@ -3967,7 +3967,7 @@ static GtkWidget *general_options_page (void) {
launchinfo_check_button = gtk_check_button_new_with_label (_("Create LaunchInfo.txt"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (launchinfo_check_button), default_launchinfo);
gtk_signal_connect (GTK_OBJECT (launchinfo_check_button), "toggled", GTK_SIGNAL_FUNC (launchinfo_toggled_callback), NULL);
g_signal_connect (GTK_OBJECT (launchinfo_check_button), "toggled", G_CALLBACK (launchinfo_toggled_callback), NULL);
gtk_box_pack_start (GTK_BOX (hbox), launchinfo_check_button, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, launchinfo_check_button, _("Creates the file ~/.config/xqf/LaunchInfo.txt with: ping ip:port name map curplayers maxplayers"), NULL);
gtk_widget_show (launchinfo_check_button);
@ -3981,7 +3981,7 @@ static GtkWidget *general_options_page (void) {
prelaunchexec_check_button = gtk_check_button_new_with_label (_("Execute prelaunch"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prelaunchexec_check_button), default_prelaunchexec);
gtk_signal_connect (GTK_OBJECT (prelaunchexec_check_button), "toggled", GTK_SIGNAL_FUNC (prelaunchexec_toggled_callback), NULL);
g_signal_connect (GTK_OBJECT (prelaunchexec_check_button), "toggled", G_CALLBACK (prelaunchexec_toggled_callback), NULL);
gtk_box_pack_start (GTK_BOX (hbox), prelaunchexec_check_button, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, prelaunchexec_check_button, _("Executes ~/.config/xqf/PreLaunch (if it exists) before launching the game"), NULL);
gtk_widget_show (prelaunchexec_check_button);
@ -4020,7 +4020,7 @@ static GtkWidget *general_options_page (void) {
save_srvinfo_check_button = gtk_check_button_new_with_label (_("Save server information"));
gtk_box_pack_start (GTK_BOX (hbox), save_srvinfo_check_button, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (save_srvinfo_check_button), default_save_srvinfo);
gtk_signal_connect (GTK_OBJECT (save_srvinfo_check_button), "toggled", GTK_SIGNAL_FUNC (save_srvinfo_toggled_callback), NULL);
g_signal_connect (GTK_OBJECT (save_srvinfo_check_button), "toggled", G_CALLBACK (save_srvinfo_toggled_callback), NULL);
gtk_widget_show (save_srvinfo_check_button);
gtk_widget_show (hbox);
@ -4241,7 +4241,7 @@ static GtkWidget *sound_options_page (void) {
sound_enable_check_button = gtk_check_button_new_with_label (_("Enable Sound"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sound_enable_check_button), sound_enable);
gtk_signal_connect (GTK_OBJECT (sound_enable_check_button), "toggled", GTK_SIGNAL_FUNC (sound_enable_toggled_callback), NULL);
g_signal_connect (GTK_OBJECT (sound_enable_check_button), "toggled", G_CALLBACK (sound_enable_toggled_callback), NULL);
gtk_table_attach (GTK_TABLE (table), sound_enable_check_button, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (sound_enable_check_button);
@ -4263,7 +4263,7 @@ static GtkWidget *sound_options_page (void) {
// File selection dialog
sound_player_file_dialog_button = gtk_button_new_with_label ("...");
gtk_signal_connect_object (GTK_OBJECT (sound_player_file_dialog_button), "clicked", GTK_SIGNAL_FUNC (sound_player_file_dialog), NULL);
g_signal_connect_swapped (GTK_OBJECT (sound_player_file_dialog_button), "clicked", G_CALLBACK (sound_player_file_dialog), NULL);
gtk_table_attach (GTK_TABLE (table), sound_player_file_dialog_button, 2, 3, 1, 2, 0, 0, 0, 0);
gtk_widget_show (sound_player_file_dialog_button);
@ -4300,13 +4300,13 @@ static GtkWidget *sound_options_page (void) {
// File selection dialog
sound_xqf_start_file_dialog_button = gtk_button_new_with_label ("...");
gtk_signal_connect_object (GTK_OBJECT (sound_xqf_start_file_dialog_button), "clicked", GTK_SIGNAL_FUNC (sound_xqf_start_file_dialog), NULL);
g_signal_connect_swapped (GTK_OBJECT (sound_xqf_start_file_dialog_button), "clicked", G_CALLBACK (sound_xqf_start_file_dialog), NULL);
gtk_table_attach (GTK_TABLE (table), sound_xqf_start_file_dialog_button, 2, 3, 0, 1, 0, 0, 0, 0);
gtk_widget_show (sound_xqf_start_file_dialog_button);
// Test button
sound_xqf_start_file_test_button = sound_test_button_new();
gtk_signal_connect_object (GTK_OBJECT (sound_xqf_start_file_test_button), "clicked", GTK_SIGNAL_FUNC (play_sound_pref), (gpointer)sound_xqf_start_entry);
g_signal_connect_swapped (GTK_OBJECT (sound_xqf_start_file_test_button), "clicked", G_CALLBACK (play_sound_pref), (gpointer)sound_xqf_start_entry);
gtk_table_attach (GTK_TABLE (table), sound_xqf_start_file_test_button, 3, 4, 0, 1, 0, 0, 0, 0);
gtk_widget_show (sound_xqf_start_file_test_button);
@ -4328,13 +4328,13 @@ static GtkWidget *sound_options_page (void) {
// File selection dialog
sound_xqf_quit_file_dialog_button = gtk_button_new_with_label ("...");
gtk_signal_connect_object (GTK_OBJECT (sound_xqf_quit_file_dialog_button), "clicked", GTK_SIGNAL_FUNC (sound_xqf_quit_file_dialog), NULL);
g_signal_connect_swapped (GTK_OBJECT (sound_xqf_quit_file_dialog_button), "clicked", G_CALLBACK (sound_xqf_quit_file_dialog), NULL);
gtk_table_attach (GTK_TABLE (table), sound_xqf_quit_file_dialog_button, 2, 3, 1, 2, 0, 0, 0, 0);
gtk_widget_show (sound_xqf_quit_file_dialog_button);
// Test button
sound_xqf_quit_file_test_button = sound_test_button_new();
gtk_signal_connect_object (GTK_OBJECT (sound_xqf_quit_file_test_button), "clicked", GTK_SIGNAL_FUNC (play_sound_pref), (gpointer)sound_xqf_quit_entry);
g_signal_connect_swapped (GTK_OBJECT (sound_xqf_quit_file_test_button), "clicked", G_CALLBACK (play_sound_pref), (gpointer)sound_xqf_quit_entry);
gtk_table_attach (GTK_TABLE (table), sound_xqf_quit_file_test_button, 3, 4, 1, 2, 0, 0, 0, 0);
gtk_widget_show (sound_xqf_quit_file_test_button);
@ -4356,14 +4356,14 @@ static GtkWidget *sound_options_page (void) {
// File selection dialog
sound_update_done_file_dialog_button = gtk_button_new_with_label ("...");
gtk_signal_connect_object (GTK_OBJECT (sound_update_done_file_dialog_button), "clicked", GTK_SIGNAL_FUNC (sound_update_done_file_dialog), NULL);
g_signal_connect_swapped (GTK_OBJECT (sound_update_done_file_dialog_button), "clicked", G_CALLBACK (sound_update_done_file_dialog), NULL);
gtk_table_attach (GTK_TABLE (table), sound_update_done_file_dialog_button, 2, 3, 2, 3, 0, 0, 0, 0);
gtk_widget_show (sound_update_done_file_dialog_button);
// Test button
sound_update_done_file_test_button = sound_test_button_new();
gtk_signal_connect_object (GTK_OBJECT (sound_update_done_file_test_button), "clicked", GTK_SIGNAL_FUNC (play_sound_pref), (gpointer)sound_update_done_entry);
g_signal_connect_swapped (GTK_OBJECT (sound_update_done_file_test_button), "clicked", G_CALLBACK (play_sound_pref), (gpointer)sound_update_done_entry);
gtk_table_attach (GTK_TABLE (table), sound_update_done_file_test_button, 3, 4, 2, 3, 0, 0, 0, 0);
gtk_widget_show (sound_update_done_file_test_button);
@ -4385,14 +4385,14 @@ static GtkWidget *sound_options_page (void) {
// File selection dialog
sound_refresh_done_file_dialog_button = gtk_button_new_with_label ("...");
gtk_signal_connect_object (GTK_OBJECT (sound_refresh_done_file_dialog_button), "clicked", GTK_SIGNAL_FUNC (sound_refresh_done_file_dialog), NULL);
g_signal_connect_swapped (GTK_OBJECT (sound_refresh_done_file_dialog_button), "clicked", G_CALLBACK (sound_refresh_done_file_dialog), NULL);
gtk_table_attach (GTK_TABLE (table), sound_refresh_done_file_dialog_button, 2, 3, 3, 4, 0, 0, 0, 0);
gtk_widget_show (sound_refresh_done_file_dialog_button);
// Test button
sound_refresh_done_file_test_button = sound_test_button_new();
gtk_signal_connect_object (GTK_OBJECT (sound_refresh_done_file_test_button), "clicked", GTK_SIGNAL_FUNC (play_sound_pref), (gpointer)sound_refresh_done_entry);
g_signal_connect_swapped (GTK_OBJECT (sound_refresh_done_file_test_button), "clicked", G_CALLBACK (play_sound_pref), (gpointer)sound_refresh_done_entry);
gtk_table_attach (GTK_TABLE (table), sound_refresh_done_file_test_button, 3, 4, 3, 4, 0, 0, 0, 0);
gtk_widget_show (sound_refresh_done_file_test_button);
@ -4414,14 +4414,14 @@ static GtkWidget *sound_options_page (void) {
// File selection dialog
sound_stop_file_dialog_button = gtk_button_new_with_label ("...");
gtk_signal_connect_object (GTK_OBJECT (sound_stop_file_dialog_button), "clicked", GTK_SIGNAL_FUNC (sound_stop_file_dialog), NULL);
g_signal_connect_swapped (GTK_OBJECT (sound_stop_file_dialog_button), "clicked", G_CALLBACK (sound_stop_file_dialog), NULL);
gtk_table_attach (GTK_TABLE (table), sound_stop_file_dialog_button, 2, 3, 4, 5, 0, 0, 0, 0);
gtk_widget_show (sound_stop_file_dialog_button);
// Test button
sound_stop_file_test_button = sound_test_button_new();
gtk_signal_connect_object (GTK_OBJECT (sound_stop_file_test_button), "clicked", GTK_SIGNAL_FUNC (play_sound_pref), (gpointer)sound_stop_entry);
g_signal_connect_swapped (GTK_OBJECT (sound_stop_file_test_button), "clicked", G_CALLBACK (play_sound_pref), (gpointer)sound_stop_entry);
gtk_table_attach (GTK_TABLE (table), sound_stop_file_test_button, 3, 4, 4, 5, 0, 0, 0, 0);
gtk_widget_show (sound_stop_file_test_button);
@ -4443,14 +4443,14 @@ static GtkWidget *sound_options_page (void) {
// File selection dialog
sound_server_connect_file_dialog_button = gtk_button_new_with_label ("...");
gtk_signal_connect_object (GTK_OBJECT (sound_server_connect_file_dialog_button), "clicked", GTK_SIGNAL_FUNC (sound_server_connect_file_dialog), NULL);
g_signal_connect_swapped (GTK_OBJECT (sound_server_connect_file_dialog_button), "clicked", G_CALLBACK (sound_server_connect_file_dialog), NULL);
gtk_table_attach (GTK_TABLE (table), sound_server_connect_file_dialog_button, 2, 3, 5, 6, 0, 0, 0, 0);
gtk_widget_show (sound_server_connect_file_dialog_button);
// Test button
sound_server_connect_file_test_button = sound_test_button_new();
gtk_signal_connect_object (GTK_OBJECT (sound_server_connect_file_test_button), "clicked", GTK_SIGNAL_FUNC (play_sound_pref), (gpointer)sound_server_connect_entry);
g_signal_connect_swapped (GTK_OBJECT (sound_server_connect_file_test_button), "clicked", G_CALLBACK (play_sound_pref), (gpointer)sound_server_connect_entry);
gtk_table_attach (GTK_TABLE (table), sound_server_connect_file_test_button, 3, 4, 5, 6, 0, 0, 0, 0);
gtk_widget_show (sound_server_connect_file_test_button);
@ -4472,14 +4472,14 @@ static GtkWidget *sound_options_page (void) {
// File selection dialog
sound_redial_success_file_dialog_button = gtk_button_new_with_label ("...");
gtk_signal_connect_object (GTK_OBJECT (sound_redial_success_file_dialog_button), "clicked", GTK_SIGNAL_FUNC (sound_redial_success_file_dialog), NULL);
g_signal_connect_swapped (GTK_OBJECT (sound_redial_success_file_dialog_button), "clicked", G_CALLBACK (sound_redial_success_file_dialog), NULL);
gtk_table_attach (GTK_TABLE (table), sound_redial_success_file_dialog_button, 2, 3, 6, 7, 0, 0, 0, 0);
gtk_widget_show (sound_redial_success_file_dialog_button);
// Test button
sound_redial_success_file_test_button = sound_test_button_new();
gtk_signal_connect_object (GTK_OBJECT (sound_redial_success_file_test_button), "clicked", GTK_SIGNAL_FUNC (play_sound_pref), (gpointer)sound_redial_success_entry);
g_signal_connect_swapped (GTK_OBJECT (sound_redial_success_file_test_button), "clicked", G_CALLBACK (play_sound_pref), (gpointer)sound_redial_success_entry);
gtk_table_attach (GTK_TABLE (table), sound_redial_success_file_test_button, 3, 4, 6, 7, 0, 0, 0, 0);
gtk_widget_show (sound_redial_success_file_test_button);
@ -4678,14 +4678,14 @@ void preferences_dialog (int page_num) {
button = gtk_button_new_with_label (_("Cancel"));
gtk_widget_set_usize (button, 80, -1);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect_swapped (GTK_OBJECT (button), "clicked", G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_show (button);
button = gtk_button_new_with_label (_("OK"));
gtk_widget_set_usize (button, 80, -1);
gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (ok_callback), GTK_OBJECT(window));
g_signal_connect (GTK_OBJECT (button), "clicked", G_CALLBACK (ok_callback), GTK_OBJECT(window));
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
@ -5125,7 +5125,7 @@ void game_file_activate_callback (enum server_type type) {
}
void game_file_dialog(enum server_type type) {
file_dialog(_("Game Command Selection"), GTK_SIGNAL_FUNC(game_file_dialog_ok_callback), GINT_TO_POINTER(type));
file_dialog(_("Game Command Selection"), G_CALLBACK(game_file_dialog_ok_callback), GINT_TO_POINTER(type));
}
void game_dir_dialog(enum server_type type) {

View File

@ -198,10 +198,10 @@ int find_player_dialog (void) {
gtk_entry_select_region (GTK_ENTRY (GTK_COMBO (psearch_combo)->entry), 0,
strlen ((char *) psearch_history->items->data));
}
gtk_signal_connect (GTK_OBJECT (GTK_COMBO (psearch_combo)->entry),
"activate", GTK_SIGNAL_FUNC (psearch_combo_activate_callback), NULL);
gtk_signal_connect_object (GTK_OBJECT (GTK_COMBO (psearch_combo)->entry),
"activate", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect (GTK_OBJECT (GTK_COMBO (psearch_combo)->entry),
"activate", G_CALLBACK (psearch_combo_activate_callback), NULL);
g_signal_connect_swapped (GTK_OBJECT (GTK_COMBO (psearch_combo)->entry),
"activate", G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
gtk_box_pack_start (GTK_BOX (hbox), psearch_combo, TRUE, TRUE, 0);
gtk_widget_grab_focus (GTK_COMBO (psearch_combo)->entry);
gtk_widget_show (psearch_combo);
@ -209,19 +209,19 @@ int find_player_dialog (void) {
/* OK Button */
button = gtk_button_new_with_label (_("OK"));
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (psearch_combo_activate_callback),
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (psearch_combo_activate_callback),
GTK_OBJECT (psearch_combo));
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
/* Cancel Button */
button = gtk_button_new_with_label (_("Cancel"));
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);

View File

@ -458,7 +458,7 @@ void rcon_dialog (const struct server *s, const char *passwd) {
g_snprintf (buf, 256, "Remote Console [%s]", srv);
window = dialog_create_modal_transient_window (buf, TRUE, TRUE,
GTK_SIGNAL_FUNC(rcon_save_geometry));
G_CALLBACK(rcon_save_geometry));
gtk_window_set_policy (GTK_WINDOW (window), TRUE, TRUE, TRUE);
rcon_restore_geometry (window);
@ -527,8 +527,8 @@ void rcon_dialog (const struct server *s, const char *passwd) {
gtk_combo_set_case_sensitive (GTK_COMBO (rcon_combo), TRUE);
gtk_combo_set_use_arrows_always (GTK_COMBO (rcon_combo), TRUE);
gtk_combo_disable_activate (GTK_COMBO (rcon_combo));
gtk_signal_connect (GTK_OBJECT (GTK_COMBO (rcon_combo)->entry), "activate",
GTK_SIGNAL_FUNC (rcon_combo_activate_callback), NULL);
g_signal_connect (GTK_OBJECT (GTK_COMBO (rcon_combo)->entry), "activate",
G_CALLBACK (rcon_combo_activate_callback), NULL);
GTK_WIDGET_SET_FLAGS (GTK_COMBO (rcon_combo)->entry, GTK_CAN_FOCUS);
GTK_WIDGET_UNSET_FLAGS (GTK_COMBO (rcon_combo)->button, GTK_CAN_FOCUS);
gtk_box_pack_start (GTK_BOX (hbox), rcon_combo, TRUE, TRUE, 0);
@ -544,8 +544,8 @@ void rcon_dialog (const struct server *s, const char *passwd) {
/* Send Button */
button = gtk_button_new_with_label (_("Send"));
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (rcon_combo_activate_callback), NULL);
g_signal_connect (GTK_OBJECT (button), "clicked",
G_CALLBACK (rcon_combo_activate_callback), NULL);
GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
gtk_widget_show (button);
@ -553,8 +553,8 @@ void rcon_dialog (const struct server *s, const char *passwd) {
/* Status Button */
button = gtk_button_new_with_label (_("Status"));
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (rcon_status_button_clicked_callback), NULL);
g_signal_connect (GTK_OBJECT (button), "clicked",
G_CALLBACK (rcon_status_button_clicked_callback), NULL);
GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
gtk_widget_show (button);
@ -562,8 +562,8 @@ void rcon_dialog (const struct server *s, const char *passwd) {
/* Clear Button */
button = gtk_button_new_with_label (_("Clear"));
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (rcon_clear_button_clicked_callback), NULL);
g_signal_connect (GTK_OBJECT (button), "clicked",
G_CALLBACK (rcon_clear_button_clicked_callback), NULL);
GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
gtk_widget_show (button);
@ -586,8 +586,8 @@ void rcon_dialog (const struct server *s, const char *passwd) {
button = gtk_button_new_with_label (_("Close"));
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_set_usize (button, 80, -1);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
gtk_widget_show (button);

View File

@ -213,8 +213,8 @@ static GtkWidget* create_redialwindow (void) {
gtk_container_add (GTK_CONTAINER (hbuttonbox1), cancelbutton);
GTK_WIDGET_SET_FLAGS (cancelbutton, GTK_CAN_DEFAULT);
gtk_signal_connect (GTK_OBJECT (launchbutton), "clicked", GTK_SIGNAL_FUNC (on_launchbutton_clicked), NULL);
gtk_signal_connect (GTK_OBJECT (cancelbutton), "clicked", GTK_SIGNAL_FUNC (on_cancelbutton_clicked), NULL);
g_signal_connect (GTK_OBJECT (launchbutton), "clicked", G_CALLBACK (on_launchbutton_clicked), NULL);
g_signal_connect (GTK_OBJECT (cancelbutton), "clicked", G_CALLBACK (on_cancelbutton_clicked), NULL);
gtk_widget_grab_focus (cancelbutton);
gtk_widget_grab_default (cancelbutton);

View File

@ -606,7 +606,7 @@ GtkWidget *scripts_config_page () {
button = gtk_button_new_with_label(_("Install..."));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button),
g_signal_connect (GTK_OBJECT (button),
"clicked", G_CALLBACK(install_button_callback), NULL);
#if have_time_to_implement_that
@ -637,8 +637,8 @@ GtkWidget *scripts_config_page () {
gtk_container_add (GTK_CONTAINER (item), gtk_label_new(filename));
gtk_signal_connect (GTK_OBJECT (item), "select",
GTK_SIGNAL_FUNC(scripts_page_select_callback), GINT_TO_POINTER(i));
g_signal_connect (GTK_OBJECT (item), "select",
G_CALLBACK(scripts_page_select_callback), GINT_TO_POINTER(i));
gtk_widget_show_all(item);
gtk_container_add (GTK_CONTAINER (gtklist), item);

View File

@ -385,8 +385,8 @@ GtkWidget *create_color_menu (void (*callback) (GtkWidget*, int)) {
menu_item = gtk_menu_item_new ();
gtk_container_add (GTK_CONTAINER (menu_item), button);
gtk_menu_append (GTK_MENU (menu), menu_item);
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
GTK_SIGNAL_FUNC (callback), GINT_TO_POINTER(i));
g_signal_connect (GTK_OBJECT (menu_item), "activate",
G_CALLBACK (callback), GINT_TO_POINTER(i));
gtk_widget_show (menu_item);
set_bg_color (menu_item, i);

View File

@ -830,18 +830,18 @@ void properties_dialog (struct server *s) {
button = gtk_button_new_with_label (_("Cancel"));
gtk_widget_set_usize (button, 80, -1);
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_show (button);
button = gtk_button_new_with_label (_("OK"));
gtk_widget_set_usize (button, 80, -1);
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (set_new_properties), (gpointer) s);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect (GTK_OBJECT (button), "clicked",
G_CALLBACK (set_new_properties), (gpointer) s);
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
gtk_widget_show (button);

View File

@ -569,7 +569,7 @@ static GtkWidget *archs_stats_page (void) {
option_menu = create_server_type_menu (to_activate,
create_server_type_menu_filter_hasharch,
GTK_SIGNAL_FUNC(select_server_type_callback));
G_CALLBACK(select_server_type_callback));
gtk_box_pack_start (GTK_BOX (hbox), option_menu, TRUE, FALSE, 0);
@ -694,7 +694,7 @@ static GtkWidget *country_stats_page (void) {
option_menu = create_server_type_menu (to_activate == GAMES_TOTAL?-1:to_activate,
create_server_type_menu_filter_hascountries,
GTK_SIGNAL_FUNC(select_country_server_type_callback));
G_CALLBACK(select_country_server_type_callback));
{
GtkWidget* menu_item = gtk_menu_item_new ();
GtkWidget* label = gtk_label_new(_("All Games"));
@ -709,8 +709,8 @@ static GtkWidget *country_stats_page (void) {
gtk_menu_prepend (GTK_MENU (menu), menu_item);
gtk_container_add (GTK_CONTAINER (menu_item), label);
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
GTK_SIGNAL_FUNC (select_country_server_type_callback), (gpointer)GAMES_TOTAL);
g_signal_connect (GTK_OBJECT (menu_item), "activate",
G_CALLBACK (select_country_server_type_callback), (gpointer)GAMES_TOTAL);
gtk_widget_show (menu_item);
gtk_widget_show (label);
@ -778,7 +778,7 @@ void statistics_dialog (void) {
collect_statistics ();
window = dialog_create_modal_transient_window (_("Statistics"),
TRUE, TRUE, GTK_SIGNAL_FUNC(statistics_save_geometry));
TRUE, TRUE, G_CALLBACK(statistics_save_geometry));
statistics_restore_geometry(window);
@ -826,10 +826,10 @@ void statistics_dialog (void) {
button = gtk_button_new_with_label (_("Close"));
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_set_usize (button, 80, -1);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (grab_defaults), NULL);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
g_signal_connect (GTK_OBJECT (button), "clicked",
G_CALLBACK (grab_defaults), NULL);
g_signal_connect_swapped (GTK_OBJECT (button), "clicked",
G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (window));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
gtk_widget_show (button);

View File

@ -224,7 +224,7 @@ int main (int argc, char* argv[]) {
close(fd);
main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_signal_connect (GTK_OBJECT (main_window), "destroy", GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
g_signal_connect (GTK_OBJECT (main_window), "destroy", G_CALLBACK (gtk_main_quit), NULL);
if (0) {
@ -247,7 +247,7 @@ int main (int argc, char* argv[]) {
//gtk_widget_set_size_request (darea, IMAGE_WIDTH, IMAGE_HEIGHT);
gtk_widget_set_usize (darea, gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height(pixbuf));
gtk_container_add (GTK_CONTAINER (main_window), darea);
gtk_signal_connect (GTK_OBJECT (darea), "expose-event", GTK_SIGNAL_FUNC (on_darea_expose), pixbuf);
g_signal_connect (GTK_OBJECT (darea), "expose-event", G_CALLBACK (on_darea_expose), pixbuf);
gtk_widget_show_all (main_window);
pixbuf2rgbbuf(pixbuf);

1668
src/xqf-gtk3.ui Normal file

File diff suppressed because it is too large Load Diff

View File

@ -628,7 +628,7 @@ GtkWidget *create_progress_bar (void) {
info = g_malloc0 (sizeof (struct pbarinfo));
gtk_object_set_user_data (GTK_OBJECT (pbar), info);
gtk_signal_connect (GTK_OBJECT (pbar), "destroy",
g_signal_connect (GTK_OBJECT (pbar), "destroy",
(GtkSignalFunc) progress_bar_destroy_event, NULL);
gtk_progress_set_format_string (GTK_PROGRESS (pbar), "%1p%%");
@ -835,7 +835,7 @@ GtkWidget *create_server_type_menu (int active_type,
gtk_container_add (GTK_CONTAINER (menu_item), game_pixmap_with_label (i));
if (callback)
gtk_signal_connect (GTK_OBJECT (menu_item), "activate", GTK_SIGNAL_FUNC (callback), GINT_TO_POINTER (i));
g_signal_connect (GTK_OBJECT (menu_item), "activate", G_CALLBACK (callback), GINT_TO_POINTER (i));
gtk_widget_show (menu_item);

327
src/xqf.c
View File

@ -1188,14 +1188,11 @@ static void launch_server_handler (struct stat_job *job, struct server *s) {
}
}
// Restructure: Front callback calls callback core with specified action, action sits in another function
void launch_core1_callback () {
static void launch_callback (GtkWidget *widget, enum launch_mode mode) {
int spectate = FALSE;
char *demo = NULL;
struct condef *con = NULL;
debug (6, "launc_callback() --");
debug (6, "launch_callback() --");
if (stat_process || !cur_server || (games[cur_server->type].flags & GAME_CONNECT) == 0) {
return;
}
@ -1205,38 +1202,9 @@ static void launch_callback (GtkWidget *widget, enum launch_mode mode) {
return;
}
switch (mode) {
}
case LAUNCH_NORMAL:
break;
case LAUNCH_SPECTATE:
if ((cur_server->flags & SERVER_SPECTATE) == 0) {
return;
}
spectate = TRUE;
break;
case LAUNCH_RECORD:
if ((games[cur_server->type].flags & GAME_RECORD) == 0) {
return;
}
if ((games[cur_server->type].flags & GAME_SPECTATE) != 0) {
demo = enter_string_with_option_dialog (TRUE, _("Spectator"), &spectate, _("Demo name:"));
}
else {
demo = enter_string_dialog (TRUE, _("Demo name:"));
}
if (!demo) {
return;
}
break;
}
void launch_core2_callback (int spectate, char *demo, struct condef *con) {
con = condef_new (cur_server);
con->demo = demo;
@ -1259,6 +1227,71 @@ static void launch_callback (GtkWidget *widget, enum launch_mode mode) {
stat_start (stat_process);
set_widgets_sensitivity ();
return;
}
static void launch_normal_callback (GtkWidget *widget) {
int spectate = FALSE;
char *demo = NULL;
struct condef *con = NULL;
launch_core1_callback ();
launch_core2_callback (spectate, demo, con);
return;
}
static void launch_spectate_callback (GtkWidget *widget) {
int spectate = FALSE;
char *demo = NULL;
struct condef *con = NULL;
launch_core1_callback ();
if ((cur_server->flags & SERVER_SPECTATE) == 0) {
return;
}
spectate = TRUE;
launch_core2_callback (spectate, demo, con);
return;
}
static void launch_record_callback (GtkWidget *widget) {
int spectate = FALSE;
char *demo = NULL;
struct condef *con = NULL;
launch_core1_callback ();
if ((games[cur_server->type].flags & GAME_RECORD) == 0) {
return;
}
if ((games[cur_server->type].flags & GAME_SPECTATE) != 0) {
demo = enter_string_with_option_dialog (TRUE, _("Spectator"), &spectate, _("Demo name:"));
}
else {
demo = enter_string_dialog (TRUE, _("Demo name:"));
}
if (!demo) {
return;
}
launch_core2_callback (spectate, demo, con);
return;
}
static int server_clist_sort_mode = SORT_SERVER_PING;
@ -1969,7 +2002,7 @@ static void server_clist_select_callback (GtkWidget *widget, int row,
if (bevent && bevent->type == GDK_2BUTTON_PRESS && bevent->button == 1 &&
!((column == 6) && cur_server && (games[cur_server->type].get_mapshot))) // not for map preview
{
launch_callback (NULL, LAUNCH_NORMAL);
launch_normal_callback (NULL);
}
}
@ -1996,7 +2029,7 @@ static gboolean server_clist_keypress_callback (GtkWidget *widget, GdkEventKey *
}
return TRUE;
} else if (event->keyval == GDK_Return || event->keyval == GDK_KP_Enter) {
launch_callback (widget, LAUNCH_NORMAL);
launch_normal_callback (widget);
return TRUE;
}
return FALSE;
@ -2414,7 +2447,7 @@ static void statistics_callback (GtkWidget *widget, gpointer data) {
}
#ifdef GUI_GTK2
struct __menuitem {
char *label;
char accel_key;
@ -2433,7 +2466,7 @@ static const struct menuitem srvopt_menu_items[] = {
N_("Connect"),
0,
0,
GTK_SIGNAL_FUNC (launch_callback),
G_CALLBACK (launch_normal_callback),
(gpointer) LAUNCH_NORMAL,
&connect_menu_item
},
@ -2442,8 +2475,8 @@ static const struct menuitem srvopt_menu_items[] = {
N_("Observe"),
0,
0,
GTK_SIGNAL_FUNC (launch_callback),
(gpointer) LAUNCH_SPECTATE,
G_CALLBACK (launch_spectate_callback),
NULL,
&observe_menu_item
},
{
@ -2451,8 +2484,8 @@ static const struct menuitem srvopt_menu_items[] = {
N_("Record Demo"),
0,
0,
GTK_SIGNAL_FUNC (launch_callback),
(gpointer) LAUNCH_RECORD,
G_CALLBACK (launch_record_callback),
NULL,
&record_menu_item
},
/*
@ -2461,7 +2494,7 @@ static const struct menuitem srvopt_menu_items[] = {
N_("Cancel Redial"),
0,
0,
GTK_SIGNAL_FUNC (cancelredial_callback),
G_CALLBACK (cancelredial_callback),
NULL,
&cancel_redial_menu_item
},
@ -2480,7 +2513,7 @@ static const struct menuitem srvopt_menu_items[] = {
N_("Add new Server"),
0,
0,
GTK_SIGNAL_FUNC (add_server_callback),
G_CALLBACK (add_server_callback),
NULL,
&add_menu_item
},
@ -2489,7 +2522,7 @@ static const struct menuitem srvopt_menu_items[] = {
N_("Add to Favorites"),
0,
0,
GTK_SIGNAL_FUNC (add_to_favorites_callback),
G_CALLBACK (add_to_favorites_callback),
NULL,
&favadd_menu_item
},
@ -2498,7 +2531,7 @@ static const struct menuitem srvopt_menu_items[] = {
N_("Remove"),
0,
0,
GTK_SIGNAL_FUNC (del_server_callback),
G_CALLBACK (del_server_callback),
NULL,
&delete_menu_item
},
@ -2507,7 +2540,7 @@ static const struct menuitem srvopt_menu_items[] = {
N_("Copy"),
0,
0,
GTK_SIGNAL_FUNC (copy_server_callback),
G_CALLBACK (copy_server_callback),
NULL,
NULL
},
@ -2516,7 +2549,7 @@ static const struct menuitem srvopt_menu_items[] = {
N_("Copy+"),
0,
0,
GTK_SIGNAL_FUNC (copy_server_callback_plus),
G_CALLBACK (copy_server_callback_plus),
NULL,
NULL
},
@ -2533,7 +2566,7 @@ static const struct menuitem srvopt_menu_items[] = {
N_("Refresh"),
0,
0,
GTK_SIGNAL_FUNC (refresh_callback),
G_CALLBACK (refresh_callback),
NULL,
&refresh_menu_item
},
@ -2542,7 +2575,7 @@ static const struct menuitem srvopt_menu_items[] = {
N_("Refresh Selected"),
0,
0,
GTK_SIGNAL_FUNC (refresh_selected_callback),
G_CALLBACK (refresh_selected_callback),
NULL,
&refrsel_menu_item
},
@ -2560,7 +2593,7 @@ static const struct menuitem srvopt_menu_items[] = {
N_("DNS Lookup"),
0,
0,
GTK_SIGNAL_FUNC (resolve_callback),
G_CALLBACK (resolve_callback),
NULL,
&resolve_menu_item
},
@ -2578,7 +2611,7 @@ static const struct menuitem srvopt_menu_items[] = {
N_("RCon"),
0,
0,
GTK_SIGNAL_FUNC (rcon_callback),
G_CALLBACK (rcon_callback),
NULL,
&rcon_menu_item
},
@ -2587,7 +2620,7 @@ static const struct menuitem srvopt_menu_items[] = {
N_("Properties"),
0,
0,
GTK_SIGNAL_FUNC (properties_callback),
G_CALLBACK (properties_callback),
NULL,
&properties_menu_item
},
@ -2608,7 +2641,7 @@ static const struct menuitem srvinfo_menu_items[] = {
N_("Copy"),
0,
0,
GTK_SIGNAL_FUNC (copy_server_info_callback), NULL,
G_CALLBACK (copy_server_info_callback), NULL,
NULL
},
{
@ -2627,7 +2660,7 @@ static const struct menuitem file_menu_items[] = {
N_("_Statistics"),
0,
0,
GTK_SIGNAL_FUNC (statistics_callback),
G_CALLBACK (statistics_callback),
NULL,
&file_statistics_menu_item
},
@ -2667,7 +2700,7 @@ static const struct menuitem source_ctree_popup_menu[] = {
N_("Add _Master"),
'M',
GDK_CONTROL_MASK,
GTK_SIGNAL_FUNC (add_master_callback),
G_CALLBACK (add_master_callback),
NULL,
&source_add_master_menu_item
},
@ -2676,7 +2709,7 @@ static const struct menuitem source_ctree_popup_menu[] = {
N_("_Rename Master"),
0,
0,
GTK_SIGNAL_FUNC (edit_master_callback),
G_CALLBACK (edit_master_callback),
NULL,
&source_edit_master_menu_item
},
@ -2684,7 +2717,7 @@ static const struct menuitem source_ctree_popup_menu[] = {
MENU_ITEM,
N_("D_elete Master"),
0, 0,
GTK_SIGNAL_FUNC (del_master_callback),
G_CALLBACK (del_master_callback),
NULL,
&source_delete_master_menu_item
},
@ -2692,7 +2725,7 @@ static const struct menuitem source_ctree_popup_menu[] = {
MENU_ITEM,
N_("_Clear Servers"),
0, 0,
GTK_SIGNAL_FUNC (clear_master_servers_callback),
G_CALLBACK (clear_master_servers_callback),
NULL,
&source_clear_master_servers_menu_item
},
@ -2712,7 +2745,7 @@ static const struct menuitem edit_menu_items[] = {
N_("_Add new Server"),
'N',
GDK_CONTROL_MASK,
GTK_SIGNAL_FUNC (add_server_callback),
G_CALLBACK (add_server_callback),
NULL,
&edit_add_menu_item
},
@ -2721,7 +2754,7 @@ static const struct menuitem edit_menu_items[] = {
N_("Add to _Favorites"),
0,
0,
GTK_SIGNAL_FUNC (add_to_favorites_callback),
G_CALLBACK (add_to_favorites_callback),
NULL,
&edit_favadd_menu_item
},
@ -2730,7 +2763,7 @@ static const struct menuitem edit_menu_items[] = {
N_("_Remove"),
'D',
GDK_CONTROL_MASK,
GTK_SIGNAL_FUNC (del_server_callback),
G_CALLBACK (del_server_callback),
NULL,
&edit_delete_menu_item
},
@ -2739,7 +2772,7 @@ static const struct menuitem edit_menu_items[] = {
N_("_Copy"),
'C',
GDK_CONTROL_MASK,
GTK_SIGNAL_FUNC (copy_server_callback),
G_CALLBACK (copy_server_callback),
NULL,
NULL
},
@ -2748,7 +2781,7 @@ static const struct menuitem edit_menu_items[] = {
N_("_Copy+"),
'O',
GDK_CONTROL_MASK,
GTK_SIGNAL_FUNC (copy_server_callback_plus),
G_CALLBACK (copy_server_callback_plus),
NULL,
NULL
},
@ -2766,7 +2799,7 @@ static const struct menuitem edit_menu_items[] = {
N_("Add Default Masters"),
0,
GDK_CONTROL_MASK,
GTK_SIGNAL_FUNC (update_master_builtin_callback),
G_CALLBACK (update_master_builtin_callback),
NULL,
&edit_update_master_builtin_menu_item
},
@ -2775,7 +2808,7 @@ static const struct menuitem edit_menu_items[] = {
N_("Add Gslist Masters"),
0,
GDK_CONTROL_MASK,
GTK_SIGNAL_FUNC (update_master_gslist_callback),
G_CALLBACK (update_master_gslist_callback),
NULL,
&edit_update_master_gslist_menu_item
},
@ -2784,7 +2817,7 @@ static const struct menuitem edit_menu_items[] = {
N_("Add _Master"),
'M',
GDK_CONTROL_MASK,
GTK_SIGNAL_FUNC (add_master_callback),
G_CALLBACK (add_master_callback),
NULL,
&edit_add_master_menu_item
},
@ -2793,7 +2826,7 @@ static const struct menuitem edit_menu_items[] = {
N_("_Rename Master"),
0,
0,
GTK_SIGNAL_FUNC (edit_master_callback),
G_CALLBACK (edit_master_callback),
NULL,
&edit_edit_master_menu_item
},
@ -2802,7 +2835,7 @@ static const struct menuitem edit_menu_items[] = {
N_("D_elete Master"),
0,
0,
GTK_SIGNAL_FUNC (del_master_callback),
G_CALLBACK (del_master_callback),
NULL,
&edit_delete_master_menu_item
},
@ -2811,7 +2844,7 @@ static const struct menuitem edit_menu_items[] = {
N_("_Clear Servers"),
0,
0,
GTK_SIGNAL_FUNC (clear_master_servers_callback),
G_CALLBACK (clear_master_servers_callback),
NULL,
&edit_clear_master_servers_menu_item
},
@ -2829,7 +2862,7 @@ static const struct menuitem edit_menu_items[] = {
N_("_Find Player"),
'F',
GDK_CONTROL_MASK,
GTK_SIGNAL_FUNC (find_player_callback),
G_CALLBACK (find_player_callback),
(gpointer) FALSE,
&edit_find_player_menu_item
},
@ -2838,7 +2871,7 @@ static const struct menuitem edit_menu_items[] = {
N_("Find A_gain"),
'G',
GDK_CONTROL_MASK,
GTK_SIGNAL_FUNC (find_player_callback),
G_CALLBACK (find_player_callback),
(gpointer) TRUE,
&edit_find_again_menu_item
},
@ -2856,7 +2889,7 @@ static const struct menuitem edit_menu_items[] = {
N_("Properties"),
0,
0,
GTK_SIGNAL_FUNC (properties_callback),
G_CALLBACK (properties_callback),
NULL,
&properties_menu_item
},
@ -2876,14 +2909,14 @@ static const struct menuitem view_menu_items[] = {
MENU_ITEM,
N_("_Refresh"),
'R', GDK_CONTROL_MASK,
GTK_SIGNAL_FUNC (refresh_callback), NULL,
G_CALLBACK (refresh_callback), NULL,
&view_refresh_menu_item
},
{
MENU_ITEM,
N_("Refresh _Selected"),
'S', GDK_CONTROL_MASK,
GTK_SIGNAL_FUNC (refresh_selected_callback),
G_CALLBACK (refresh_selected_callback),
NULL,
&view_refrsel_menu_item
},
@ -2892,7 +2925,7 @@ static const struct menuitem view_menu_items[] = {
N_("_Update From Master"),
'U',
GDK_CONTROL_MASK,
GTK_SIGNAL_FUNC (update_source_callback),
G_CALLBACK (update_source_callback),
NULL,
&view_update_menu_item
},
@ -2910,7 +2943,7 @@ static const struct menuitem view_menu_items[] = {
N_("Show _Host Names"),
'H',
GDK_CONTROL_MASK,
GTK_SIGNAL_FUNC (show_hostnames_callback),
G_CALLBACK (show_hostnames_callback),
NULL,
&view_hostnames_menu_item
},
@ -2919,7 +2952,7 @@ static const struct menuitem view_menu_items[] = {
N_("Show Default _Port"),
0,
0,
GTK_SIGNAL_FUNC (show_default_port_callback),
G_CALLBACK (show_default_port_callback),
NULL,
&view_defport_menu_item
},
@ -2960,8 +2993,8 @@ static const struct menuitem server_menu_items[] = {
N_("_Connect"),
0,
0,
GTK_SIGNAL_FUNC (launch_callback),
(gpointer) LAUNCH_NORMAL,
G_CALLBACK (launch_normal_callback),
NULL,
&server_connect_menu_item
},
{
@ -2969,8 +3002,8 @@ static const struct menuitem server_menu_items[] = {
N_("_Observe"),
0,
0,
GTK_SIGNAL_FUNC (launch_callback),
(gpointer) LAUNCH_SPECTATE,
G_CALLBACK (launch_spectate_callback),
NULL,
&server_observe_menu_item
},
{
@ -2978,8 +3011,8 @@ static const struct menuitem server_menu_items[] = {
N_("Record _Demo"),
0,
0,
GTK_SIGNAL_FUNC (launch_callback),
(gpointer) LAUNCH_RECORD,
G_CALLBACK (launch_record_callback),
NULL,
&server_record_menu_item
},
/*
@ -2988,7 +3021,7 @@ static const struct menuitem server_menu_items[] = {
N_("Cancel Redial"),
0,
0,
GTK_SIGNAL_FUNC (cancelredial_callback),
G_CALLBACK (cancelredial_callback),
NULL,
&server_cancel_redial_menu_item
},
@ -3007,7 +3040,7 @@ static const struct menuitem server_menu_items[] = {
N_("_Add new Server"),
0,
0,
GTK_SIGNAL_FUNC (add_server_callback),
G_CALLBACK (add_server_callback),
NULL,
&edit_add_menu_item
},
@ -3016,7 +3049,7 @@ static const struct menuitem server_menu_items[] = {
N_("Add to _Favorites"),
0,
0,
GTK_SIGNAL_FUNC (add_to_favorites_callback),
G_CALLBACK (add_to_favorites_callback),
NULL,
&server_favadd_menu_item
},
@ -3025,7 +3058,7 @@ static const struct menuitem server_menu_items[] = {
N_("_Remove"),
0,
0,
GTK_SIGNAL_FUNC (del_server_callback),
G_CALLBACK (del_server_callback),
NULL,
&server_delete_menu_item
},
@ -3034,7 +3067,7 @@ static const struct menuitem server_menu_items[] = {
N_("DNS _Lookup"),
'L',
GDK_CONTROL_MASK,
GTK_SIGNAL_FUNC (resolve_callback),
G_CALLBACK (resolve_callback),
NULL,
&server_resolve_menu_item
},
@ -3052,7 +3085,7 @@ static const struct menuitem server_menu_items[] = {
N_("_RCon"),
0,
0,
GTK_SIGNAL_FUNC (rcon_callback),
G_CALLBACK (rcon_callback),
NULL,
&server_rcon_menu_item
},
@ -3061,7 +3094,7 @@ static const struct menuitem server_menu_items[] = {
N_("_Properties"),
0,
0,
GTK_SIGNAL_FUNC (properties_callback),
G_CALLBACK (properties_callback),
NULL,
&server_properties_menu_item
},
@ -3082,7 +3115,7 @@ static const struct menuitem preferences_menu_items[] = {
N_("_General"),
0,
0,
GTK_SIGNAL_FUNC (start_preferences_dialog),
G_CALLBACK (start_preferences_dialog),
(gpointer) (PREF_PAGE_GENERAL + UNKNOWN_SERVER * 256),
NULL
},
@ -3091,7 +3124,7 @@ static const struct menuitem preferences_menu_items[] = {
N_("_Games"),
0,
0,
GTK_SIGNAL_FUNC (start_preferences_dialog),
G_CALLBACK (start_preferences_dialog),
(gpointer) (PREF_PAGE_GAMES + UNKNOWN_SERVER * 256),
NULL
},
@ -3100,7 +3133,7 @@ static const struct menuitem preferences_menu_items[] = {
N_("_Appearance"),
0,
0,
GTK_SIGNAL_FUNC (start_preferences_dialog),
G_CALLBACK (start_preferences_dialog),
(gpointer) (PREF_PAGE_APPEARANCE + UNKNOWN_SERVER * 256),
NULL
},
@ -3109,7 +3142,7 @@ static const struct menuitem preferences_menu_items[] = {
N_("_QStat"),
0,
0,
GTK_SIGNAL_FUNC (start_preferences_dialog),
G_CALLBACK (start_preferences_dialog),
(gpointer) (PREF_PAGE_QSTAT + UNKNOWN_SERVER * 256),
NULL
},
@ -3118,7 +3151,7 @@ static const struct menuitem preferences_menu_items[] = {
N_("_Sounds"),
0,
0,
GTK_SIGNAL_FUNC (start_preferences_dialog),
G_CALLBACK (start_preferences_dialog),
(gpointer) (PREF_PAGE_SOUNDS + UNKNOWN_SERVER * 256),
NULL
},
@ -3127,7 +3160,7 @@ static const struct menuitem preferences_menu_items[] = {
N_("S_cripts"),
0,
0,
GTK_SIGNAL_FUNC (start_preferences_dialog),
G_CALLBACK (start_preferences_dialog),
(gpointer) (PREF_PAGE_SCRIPTS + UNKNOWN_SERVER * 256),
NULL
},
@ -3145,7 +3178,7 @@ static const struct menuitem preferences_menu_items[] = {
N_("_Server Filter"),
0,
0,
GTK_SIGNAL_FUNC (start_filters_cfg_dialog),
G_CALLBACK (start_filters_cfg_dialog),
(gpointer) FILTER_SERVER,
NULL
},
@ -3154,7 +3187,7 @@ static const struct menuitem preferences_menu_items[] = {
N_("Player _Filter"),
0,
0,
GTK_SIGNAL_FUNC (start_filters_cfg_dialog),
G_CALLBACK (start_filters_cfg_dialog),
(gpointer) FILTER_PLAYER,
NULL
},
@ -3175,7 +3208,7 @@ static const struct menuitem help_menu_items[] = {
N_("_About"),
0,
0,
GTK_SIGNAL_FUNC (about_dialog),
G_CALLBACK (about_dialog),
NULL,
NULL
},
@ -3266,7 +3299,6 @@ static const struct menuitem menubar_menu_items[] = {
}
};
static GtkWidget *create_player_menu_item (char *str, int i) {
GtkWidget *menu_item;
GtkWidget *hbox;
@ -3303,22 +3335,22 @@ static GtkWidget *create_player_menu (GtkAccelGroup *accel_group) {
menu_item = create_player_menu_item (_("Mark as Red"), 0);
gtk_menu_append (GTK_MENU (marker_menu), menu_item);
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
GTK_SIGNAL_FUNC (add_to_player_filter_callback),
g_signal_connect (GTK_OBJECT (menu_item), "activate",
G_CALLBACK (add_to_player_filter_callback),
(gpointer) PLAYER_GROUP_RED);
gtk_widget_show (menu_item);
menu_item = create_player_menu_item (_("Mark as Green"), 1);
gtk_menu_append (GTK_MENU (marker_menu), menu_item);
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
GTK_SIGNAL_FUNC (add_to_player_filter_callback),
g_signal_connect (GTK_OBJECT (menu_item), "activate",
G_CALLBACK (add_to_player_filter_callback),
(gpointer) PLAYER_GROUP_GREEN);
gtk_widget_show (menu_item);
menu_item = create_player_menu_item (_("Mark as Blue"), 2);
gtk_menu_append (GTK_MENU (marker_menu), menu_item);
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
GTK_SIGNAL_FUNC (add_to_player_filter_callback),
g_signal_connect (GTK_OBJECT (menu_item), "activate",
G_CALLBACK (add_to_player_filter_callback),
(gpointer) PLAYER_GROUP_BLUE);
gtk_widget_show (menu_item);
@ -3346,7 +3378,7 @@ static void populate_main_toolbar (void) {
connect_button = gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar),
_("Connect"), _("Connect"), NULL,
pixmap,
GTK_SIGNAL_FUNC (launch_callback), (gpointer) LAUNCH_NORMAL);
G_CALLBACK (launch_normal_callback), NULL);
*/
update_button = GTK_WIDGET (gtk_builder_get_object (builder, "update-button"));
@ -3359,7 +3391,7 @@ static void populate_main_toolbar (void) {
g_signal_connect (G_OBJECT (refresh_button), "clicked", G_CALLBACK (refresh_callback), NULL);
g_signal_connect (G_OBJECT (refrsel_button), "clicked", G_CALLBACK (refresh_selected_callback), NULL);
g_signal_connect (G_OBJECT (stop_button), "clicked", G_CALLBACK (stop_callback), NULL);
g_signal_connect (G_OBJECT (connect_button), "clicked", G_CALLBACK (launch_callback), (gpointer) LAUNCH_NORMAL); // TODO test... ^^'
g_signal_connect (G_OBJECT (connect_button), "clicked", G_CALLBACK (launch_normal_callback), NULL); // TODO test... ^^'
gtk_image_set_from_file (GTK_IMAGE (gtk_builder_get_object (builder, "update-image")),
g_build_filename (xqf_PACKAGE_DATA_DIR, "xpm", "update.xpm", NULL));
@ -3377,8 +3409,8 @@ static void populate_main_toolbar (void) {
observe_button = GTK_WIDGET (gtk_builder_get_object (builder, "observe-button"));
record_button = GTK_WIDGET (gtk_builder_get_object (builder, "record-button"));
g_signal_connect (G_OBJECT (observe_button), "clicked", G_CALLBACK (launch_callback), (gpointer) LAUNCH_SPECTATE);
g_signal_connect (G_OBJECT (record_button), "clicked", G_CALLBACK (launch_callback), (gpointer) LAUNCH_RECORD);
g_signal_connect (G_OBJECT (observe_button), "clicked", G_CALLBACK (launch_spectate_callback), NULL);
g_signal_connect (G_OBJECT (record_button), "clicked", G_CALLBACK (launch_record_callback), NULL);
gtk_image_set_from_file (GTK_IMAGE (gtk_builder_get_object (builder, "observe-image")),
g_build_filename (xqf_PACKAGE_DATA_DIR, "xpm", "observe.xpm", NULL));
@ -3406,7 +3438,7 @@ static void populate_main_toolbar (void) {
GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL,
_(filters[i].short_name), buf, NULL,
pixmap,
GTK_SIGNAL_FUNC (filter_toggle_callback), GINT_TO_POINTER (mask));
G_CALLBACK (filter_toggle_callback), GINT_TO_POINTER (mask));
*/
filter_buttons[i] = GTK_WIDGET (gtk_toggle_tool_button_new ());
g_signal_connect (G_OBJECT (filter_buttons[i]), "toggled", G_CALLBACK (filter_toggle_callback), GINT_TO_POINTER (mask));
@ -3439,7 +3471,7 @@ static void populate_main_toolbar (void) {
gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar),
_(filters[i].short_cfg_name), buf, NULL,
pixmap,
GTK_SIGNAL_FUNC (start_filters_cfg_dialog), (gpointer) i);
G_CALLBACK (start_filters_cfg_dialog), (gpointer) i);
}
gtk_toolbar_append_space (GTK_TOOLBAR (main_toolbar));
@ -3494,7 +3526,7 @@ static GtkWidget* create_filter_menu_toolbar () {
gtk_menu_append (GTK_MENU (menu), menu_item);
gtk_widget_show (menu_item);
gtk_signal_connect (GTK_OBJECT (menu_item), "activate", GTK_SIGNAL_FUNC (server_filter_select_callback_toolbar), (gpointer)i); // array starts from zero but filters from 1
g_signal_connect (GTK_OBJECT (menu_item), "activate", G_CALLBACK (server_filter_select_callback_toolbar), (gpointer)i); // array starts from zero but filters from 1
}
@ -3503,6 +3535,8 @@ static GtkWidget* create_filter_menu_toolbar () {
}
#endif
#endif
/** build server filter menu for toolbar */
static GtkWidget* create_filter_menu () {
unsigned int i;
@ -3519,7 +3553,7 @@ static GtkWidget* create_filter_menu () {
gtk_menu_append (GTK_MENU (menu), menu_item);
gtk_widget_show (menu_item);
gtk_signal_connect (GTK_OBJECT (menu_item), "activate", GTK_SIGNAL_FUNC (start_filters_cfg_dialog), (gpointer) FILTER_SERVER);
g_signal_connect (GTK_OBJECT (menu_item), "activate", G_CALLBACK (start_filters_cfg_dialog), (gpointer) FILTER_SERVER);
menu_item = gtk_menu_item_new ();
gtk_widget_set_sensitive (menu_item, FALSE);
@ -3546,7 +3580,7 @@ static GtkWidget* create_filter_menu () {
gtk_widget_show (menu_item);
// array starts from zero but filters from 1
gtk_signal_connect (GTK_OBJECT (menu_item), "activate", GTK_SIGNAL_FUNC (server_filter_select_callback), GINT_TO_POINTER(i));
g_signal_connect (GTK_OBJECT (menu_item), "activate", G_CALLBACK (server_filter_select_callback), GINT_TO_POINTER(i));
/*
// add separator
@ -3595,21 +3629,26 @@ void quickfilter_delete_button_clicked (GtkWidget *widget, GtkWidget* entry) {
static void create_main_window (void) {
GError *error = NULL;
#if defined GUI_GTK3
builder = gtk_builder_new_from_file (g_build_filename (xqf_PACKAGE_DATA_DIR, "ui", "xqf-gtk3.ui", NULL));
#elif defined GUI_GTK2
builder = gtk_builder_new ();
gtk_builder_add_from_file (builder, g_build_filename (xqf_PACKAGE_DATA_DIR, "ui", "xqf.ui", NULL), &error);
gtk_builder_add_from_file (builder, g_build_filename (xqf_PACKAGE_DATA_DIR, "ui", "xqf-gtk2.ui", NULL), &error);
#else
fprintf (stderr, "No UI has been compiled!\n");
return;
#endif
if (G_UNLIKELY (error != NULL)) {
fprintf (stderr, "Could not load UI: %s\n", error->message);
g_clear_error (&error);
return;
}
main_window = GTK_WIDGET (gtk_builder_get_object (builder, "main-window")); // gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_signal_connect (GTK_OBJECT (main_window), "delete_event",
GTK_SIGNAL_FUNC (window_delete_event_callback), NULL);
gtk_signal_connect (GTK_OBJECT (main_window), "destroy",
GTK_SIGNAL_FUNC (ui_done), NULL);
gtk_signal_connect (GTK_OBJECT (main_window), "destroy",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
main_window = GTK_WIDGET (gtk_builder_get_object (builder, "main-window"));
g_signal_connect (main_window, "delete_event", G_CALLBACK (window_delete_event_callback), NULL);
g_signal_connect (main_window, "destroy", G_CALLBACK (ui_done), NULL);
g_signal_connect (main_window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
gtk_window_set_title (GTK_WINDOW (main_window), "XQF");
register_window (main_window);
@ -3672,7 +3711,7 @@ static void populate_main_window (void) {
server_filter_menu_items[i].label = _("None");
server_filter_menu_items[i].accel_key = 0;
server_filter_menu_items[i].accel_mods = 0;
server_filter_menu_items[i].callback = GTK_SIGNAL_FUNC (server_filter_select_callback);
server_filter_menu_items[i].callback = G_CALLBACK (server_filter_select_callback);
server_filter_menu_items[i].user_data = (gpointer) j;
server_filter_menu_items[i].widget = &server_filter_widget[i];
@ -3686,7 +3725,7 @@ static void populate_main_window (void) {
server_filter_menu_items[i].label = buf;
server_filter_menu_items[i].accel_key = 0;
server_filter_menu_items[i].accel_mods = 0;
server_filter_menu_items[i].callback = GTK_SIGNAL_FUNC (server_filter_select_callback);
server_filter_menu_items[i].callback = G_CALLBACK (server_filter_select_callback);
server_filter_menu_items[i].user_data = (gpointer) j;
server_filter_menu_items[i].widget = &server_filter_widget[i];
}
@ -3739,7 +3778,7 @@ static void populate_main_window (void) {
server_filter_menu_items = g_array_new (FALSE, FALSE, sizeof (GtkWidget*));
gtk_menu_item_set_submenu (GTK_MENU_ITEM (server_serverfilter_menu_item), create_filter_menu ());
gtk_signal_connect_object (GTK_OBJECT (file_quit_menu_item), "activate", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (main_window));
g_signal_connect_swapped (GTK_OBJECT (file_quit_menu_item), "activate", G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (main_window));
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (view_hostnames_menu_item), show_hostnames);
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (view_defport_menu_item), show_default_port);
@ -3766,9 +3805,9 @@ static void populate_main_window (void) {
source_ctree = create_source_ctree (scrollwin);
gtk_widget_show (source_ctree);
gtk_signal_connect (GTK_OBJECT (source_ctree), "tree_select_row", GTK_SIGNAL_FUNC (source_ctree_selection_changed_callback), NULL);
gtk_signal_connect (GTK_OBJECT (source_ctree), "tree_unselect_row", GTK_SIGNAL_FUNC (source_ctree_selection_changed_callback), NULL);
gtk_signal_connect (GTK_OBJECT (source_ctree), "event", GTK_SIGNAL_FUNC (source_ctree_event_callback), NULL);
g_signal_connect (GTK_OBJECT (source_ctree), "tree_select_row", G_CALLBACK (source_ctree_selection_changed_callback), NULL);
g_signal_connect (GTK_OBJECT (source_ctree), "tree_unselect_row", G_CALLBACK (source_ctree_selection_changed_callback), NULL);
g_signal_connect (GTK_OBJECT (source_ctree), "event", G_CALLBACK (source_ctree_event_callback), NULL);
gtk_widget_show (scrollwin);
@ -3786,19 +3825,19 @@ static void populate_main_window (void) {
gtk_widget_show_all (button);
entry = GTK_WIDGET (gtk_builder_get_object (builder, "entry"));
gtk_signal_connect (GTK_OBJECT (entry), "changed", G_CALLBACK (quick_filter_entry_changed), NULL);
g_signal_connect (GTK_OBJECT (entry), "changed", G_CALLBACK (quick_filter_entry_changed), NULL);
gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (quickfilter_delete_button_clicked), entry);
g_signal_connect (GTK_OBJECT (button), "clicked", G_CALLBACK (quickfilter_delete_button_clicked), entry);
scrollwin = GTK_WIDGET (gtk_builder_get_object (builder, "scrollwin-server"));
server_clist = GTK_CLIST (create_cwidget (scrollwin, &server_clist_def));
gtk_signal_connect (GTK_OBJECT (server_clist), "click_column", GTK_SIGNAL_FUNC (clist_set_sort_column), &server_clist_def);
gtk_signal_connect (GTK_OBJECT (server_clist), "event", GTK_SIGNAL_FUNC (server_clist_event_callback), NULL);
gtk_signal_connect (GTK_OBJECT (server_clist), "select_row", GTK_SIGNAL_FUNC (server_clist_select_callback), NULL);
gtk_signal_connect (GTK_OBJECT (server_clist), "unselect_row", GTK_SIGNAL_FUNC (server_clist_unselect_callback), NULL);
gtk_signal_connect (GTK_OBJECT (server_clist), "key_press_event", GTK_SIGNAL_FUNC (server_clist_keypress_callback), NULL);
g_signal_connect (GTK_OBJECT (server_clist), "click_column", G_CALLBACK (clist_set_sort_column), &server_clist_def);
g_signal_connect (GTK_OBJECT (server_clist), "event", G_CALLBACK (server_clist_event_callback), NULL);
g_signal_connect (GTK_OBJECT (server_clist), "select_row", G_CALLBACK (server_clist_select_callback), NULL);
g_signal_connect (GTK_OBJECT (server_clist), "unselect_row", G_CALLBACK (server_clist_unselect_callback), NULL);
g_signal_connect (GTK_OBJECT (server_clist), "key_press_event", G_CALLBACK (server_clist_keypress_callback), NULL);
gtk_clist_set_compare_func (server_clist, (GtkCListCompareFunc) server_clist_compare_func);
@ -3814,8 +3853,8 @@ static void populate_main_window (void) {
player_clist = GTK_CLIST (create_cwidget (scrollwin, &player_clist_def));
gtk_signal_connect (GTK_OBJECT (player_clist), "click_column", GTK_SIGNAL_FUNC (clist_set_sort_column), &player_clist_def);
gtk_signal_connect (GTK_OBJECT (player_clist), "event", GTK_SIGNAL_FUNC (player_clist_event_callback), NULL);
g_signal_connect (GTK_OBJECT (player_clist), "click_column", G_CALLBACK (clist_set_sort_column), &player_clist_def);
g_signal_connect (GTK_OBJECT (player_clist), "event", G_CALLBACK (player_clist_event_callback), NULL);
gtk_clist_set_compare_func (player_clist, (GtkCListCompareFunc) player_clist_compare_func);
@ -3829,8 +3868,8 @@ static void populate_main_window (void) {
srvinf_ctree = GTK_CTREE (create_cwidget (scrollwin, &srvinf_clist_def));
gtk_signal_connect (GTK_OBJECT (srvinf_ctree), "click_column", GTK_SIGNAL_FUNC (clist_set_sort_column), &srvinf_clist_def);
gtk_signal_connect (GTK_OBJECT (srvinf_ctree), "event", GTK_SIGNAL_FUNC (server_info_clist_event_callback), NULL);
g_signal_connect (GTK_OBJECT (srvinf_ctree), "click_column", G_CALLBACK (clist_set_sort_column), &srvinf_clist_def);
g_signal_connect (GTK_OBJECT (srvinf_ctree), "event", G_CALLBACK (server_info_clist_event_callback), NULL);
gtk_clist_set_compare_func (GTK_CLIST (srvinf_ctree), (GtkCListCompareFunc) srvinf_clist_compare_func);