diff options
| author | SND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-02-23 02:54:51 +0000 |
|---|---|---|
| committer | SND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-02-23 02:54:51 +0000 |
| commit | 56fc32e977409e38b09bf4820244b3699f1e3b4c (patch) | |
| tree | 43511dafd5af0c5ecee323784379efbfc906d08d /plugins/bladesio1 | |
| parent | d3b43b5b645e6f2f80de3fa25b43a18ba8ca2eb2 (diff) | |
| download | pcsxr-56fc32e977409e38b09bf4820244b3699f1e3b4c.tar.gz | |
.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@83100 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'plugins/bladesio1')
| -rwxr-xr-x | plugins/bladesio1/connection.c | 1 | ||||
| -rw-r--r-- | plugins/bladesio1/gui.c | 38 |
2 files changed, 21 insertions, 18 deletions
diff --git a/plugins/bladesio1/connection.c b/plugins/bladesio1/connection.c index 28478d80..221d3d20 100755 --- a/plugins/bladesio1/connection.c +++ b/plugins/bladesio1/connection.c @@ -29,6 +29,7 @@ #include <netinet/in.h> #include <netinet/tcp.h> #include <netdb.h> +#include <unistd.h> #endif #include "typedefs.h" diff --git a/plugins/bladesio1/gui.c b/plugins/bladesio1/gui.c index 1ac5e0a8..e2d2e88d 100644 --- a/plugins/bladesio1/gui.c +++ b/plugins/bladesio1/gui.c @@ -97,16 +97,14 @@ void OnCopyIP(GtkWidget *widget, gpointer user_data) { /***************************************************************************/ static -s32 configure() { +void configure() { GtkBuilder *builder; GtkWidget *widget, *MainWindow; builder = gtk_builder_new(); - if (!gtk_builder_add_from_file(builder, DATADIR "sio1.ui", NULL)) { + if(!gtk_builder_add_from_file(builder, DATADIR "sio1.ui", NULL)) g_warning("We could not load the interface!"); - return 0; - } settingsRead(); @@ -144,31 +142,26 @@ s32 configure() { settings.port = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget)); widget = gtk_builder_get_object(builder, "rbDisabled"); - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { + if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) settings.player = PLAYER_DISABLED; - } else { widget = gtk_builder_get_object(builder, "rbServer"); - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { + if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) settings.player = PLAYER_MASTER; - } else { + else settings.player = PLAYER_SLAVE; - } } settingsWrite(); gtk_widget_destroy(MainWindow); - return 1; } gtk_widget_destroy(MainWindow); - - return 0; } static -s32 about() { +void about() { const char *authors[]= {"edgbla <edgbla@yandex.ru>", NULL}; GtkWidget *widget; @@ -194,13 +187,22 @@ int main(int argc, char *argv[]) { gtk_init(&argc, &argv); - if(argc > 1) { - if(!strcmp(argv[1], "configure")) - return configure(); - if(!strcmp(argv[1], "about")) - return about(); + if (argc < 2) { + printf ("Usage: cfgBladeSio1 {about | configure}\n"); + return 0; } + if (strcmp(argv[1], "configure") != 0 && + strcmp(argv[1], "about") != 0) { + printf ("Usage: cfgBladeSio1 {about | configure}\n"); + return 0; + } + + if(!strcmp(argv[1], "configure")) + configure(); + else if(!strcmp(argv[1], "about")) + about(); + return 0; } |
