From 5361dd49c582f601dbc5cb5a47a38f65bec9d8d4 Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Thu, 6 Jan 2011 03:01:13 +0000 Subject: - dfnet, dfinput: migrated to gtkbuilder. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@61799 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- plugins/dfnet/Makefile.am | 2 +- plugins/dfnet/dfnet.glade2 | 265 -------------------------------------------- plugins/dfnet/dfnet.ui | 270 +++++++++++++++++++++++++++++++++++++++++++++ plugins/dfnet/gui.c | 26 ++--- 4 files changed, 284 insertions(+), 279 deletions(-) delete mode 100644 plugins/dfnet/dfnet.glade2 create mode 100644 plugins/dfnet/dfnet.ui (limited to 'plugins/dfnet') diff --git a/plugins/dfnet/Makefile.am b/plugins/dfnet/Makefile.am index eb0fa50e..4db81928 100644 --- a/plugins/dfnet/Makefile.am +++ b/plugins/dfnet/Makefile.am @@ -15,6 +15,6 @@ bin_PROGRAMS = cfgDFNet cfgDFNet_SOURCES = gui.c cfgDFNet_LDADD = $(GTK2_LIBS) $(GLADE2_LIBS) -glade_DATA = dfnet.glade2 +glade_DATA = dfnet.ui gladedir = $(datadir)/psemu/ EXTRA_DIST = $(glade_DATA) diff --git a/plugins/dfnet/dfnet.glade2 b/plugins/dfnet/dfnet.glade2 deleted file mode 100644 index 36c9b4b6..00000000 --- a/plugins/dfnet/dfnet.glade2 +++ /dev/null @@ -1,265 +0,0 @@ - - - - - - 5 - False - True - center - normal - False - - - True - 5 - - - True - 12 - - - True - Select here if you'll be Server (Player1) or Client (Player2). - -If you select Server you must Copy your IP address to the Clipboard and paste if (Ctrl+V) wherever the Client can see it. - -If you selected Client please enter the IP address the Server gave to you in the IP Address Control. - True - - - 0 - - - - - True - 2 - 2 - 8 - 12 - - - True - True - True - - - True - - - True - gtk-copy - - - False - False - 0 - - - - - True - Copy PC IP to Clipboard - - - 1 - - - - - - - 1 - 2 - - - - - True - True - 15 - - - - - 1 - 2 - 1 - 2 - - - - - Server (Player1) - True - True - False - True - True - - - - - Client (Player2) - True - True - False - True - True - rbServer - - - 1 - 2 - - - - - 2 - 1 - - - - - True - 6 - - - True - Do not change if not necessary (remember it must be changed on both sides). - True - - - 0 - - - - - True - - - True - Port Number - - - 0 - - - - - True - True - 5 - - - - 1 - - - - - 1 - - - - - 2 - - - - - 1 - - - - - True - end - - - -5 - True - True - True - - - True - - - True - gtk-network - - - False - False - 0 - - - - - True - Start Game - - - 1 - - - - - - - False - False - 0 - - - - - -6 - True - True - True - - - True - - - True - gtk-no - - - False - False - 0 - - - - - True - Play Offline - - - 1 - - - - - - - False - False - 1 - - - - - False - end - 0 - - - - - - diff --git a/plugins/dfnet/dfnet.ui b/plugins/dfnet/dfnet.ui new file mode 100644 index 00000000..957c449c --- /dev/null +++ b/plugins/dfnet/dfnet.ui @@ -0,0 +1,270 @@ + + + + + + 5 + False + True + center + normal + False + + + True + vertical + 5 + + + True + vertical + 12 + + + True + Select here if you'll be Server (Player1) or Client (Player2). + +If you select Server you must Copy your IP address to the Clipboard and paste if (Ctrl+V) wherever the Client can see it. + +If you selected Client please enter the IP address the Server gave to you in the IP Address Control. + True + + + 0 + + + + + True + 2 + 2 + 8 + 12 + + + True + True + True + + + True + + + True + gtk-copy + + + False + False + 0 + + + + + True + Copy PC IP to Clipboard + + + 1 + + + + + + + 1 + 2 + + + + + True + True + 15 + + + + + 1 + 2 + 1 + 2 + + + + + Server (Player1) + True + True + False + True + True + + + + + Client (Player2) + True + True + False + True + True + rbServer + + + 1 + 2 + + + + + 2 + 1 + + + + + True + vertical + 6 + + + True + Do not change if not necessary (remember it must be changed on both sides). + True + + + 0 + + + + + True + + + True + Port Number + + + 0 + + + + + True + True + 5 + + + + 1 + + + + + 1 + + + + + 2 + + + + + 1 + + + + + True + end + + + True + True + True + + + True + + + True + gtk-network + + + False + False + 0 + + + + + True + Start Game + + + 1 + + + + + + + False + False + 0 + + + + + True + True + True + + + True + + + True + gtk-no + + + False + False + 0 + + + + + True + Play Offline + + + 1 + + + + + + + False + False + 1 + + + + + False + end + 0 + + + + + + btnStart + btnOffline + + + diff --git a/plugins/dfnet/gui.c b/plugins/dfnet/gui.c index 60e165a7..181fecb4 100644 --- a/plugins/dfnet/gui.c +++ b/plugins/dfnet/gui.c @@ -11,7 +11,6 @@ #include #include -#include #include #include "cfg.c" @@ -96,48 +95,49 @@ void OnCopyIP(GtkWidget *widget, gpointer user_data) { } long CFGopen() { - GladeXML *xml; + GtkBuilder *builder; GtkWidget *widget, *MainWindow; char buf[256]; LoadConf(); - xml = glade_xml_new(DATADIR "dfnet.glade2", "dlgStart", NULL); - if (xml == NULL) { + builder = gtk_builder_new(); + + if (!gtk_builder_add_from_file(builder, DATADIR "dfnet.ui", NULL)) { g_warning("We could not load the interface!"); return 0; } - MainWindow = glade_xml_get_widget(xml, "dlgStart"); + MainWindow = gtk_builder_get_object(builder, "dlgStart"); gtk_window_set_title(GTK_WINDOW(MainWindow), _("NetPlay")); - widget = glade_xml_get_widget(xml, "btnCopyIP"); + widget = gtk_builder_get_object(builder, "btnCopyIP"); g_signal_connect_data(GTK_OBJECT(widget), "clicked", GTK_SIGNAL_FUNC(OnCopyIP), NULL, NULL, G_CONNECT_AFTER); - widget = glade_xml_get_widget(xml, "tbServerIP"); + widget = gtk_builder_get_object(builder, "tbServerIP"); gtk_entry_set_text(GTK_ENTRY(widget), conf.ipAddress); - widget = glade_xml_get_widget(xml, "tbPort"); + widget = gtk_builder_get_object(builder, "tbPort"); sprintf(buf, "%d", conf.PortNum); gtk_entry_set_text(GTK_ENTRY(widget), buf); if (conf.PlayerNum == 1) { - widget = glade_xml_get_widget(xml, "rbServer"); + widget = gtk_builder_get_object(builder, "rbServer"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE); } else { - widget = glade_xml_get_widget(xml, "rbClient"); + widget = gtk_builder_get_object(builder, "rbClient"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE); } if (gtk_dialog_run(GTK_DIALOG(MainWindow)) == GTK_RESPONSE_OK) { - widget = glade_xml_get_widget(xml, "tbServerIP"); + widget = gtk_builder_get_object(builder, "tbServerIP"); strcpy(conf.ipAddress, gtk_entry_get_text(GTK_ENTRY(widget))); - widget = glade_xml_get_widget(xml, "tbPort"); + widget = gtk_builder_get_object(builder, "tbPort"); conf.PortNum = atoi(gtk_entry_get_text(GTK_ENTRY(widget))); - widget = glade_xml_get_widget(xml, "rbServer"); + widget = gtk_builder_get_object(builder, "rbServer"); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { conf.PlayerNum = 1; } else { -- cgit v1.2.3