summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBerke Viktor <berkeviktor@aol.com>2011-11-25 10:10:11 +0100
committerBerke Viktor <berkeviktor@aol.com>2011-11-25 10:10:11 +0100
commit0c3c36fdf3663bc428254254a790c1bc7e3500fc (patch)
tree13235362f3025c1779d21994d2cb15d46ade84fb
parentfb1a986332a7ff6db6f2a70df447c5d484af7cdc (diff)
disable one instance option in portable mode
-rw-r--r--src/common/xchat.c5
-rw-r--r--src/fe-gtk/setup.c31
2 files changed, 32 insertions, 4 deletions
diff --git a/src/common/xchat.c b/src/common/xchat.c
index 8dca6de8..c0847a32 100644
--- a/src/common/xchat.c
+++ b/src/common/xchat.c
@@ -49,6 +49,7 @@
 #include "text.h"
 #include "url.h"
 #include "xchatc.h"
+#include "wdkutil.h"
 
 #ifdef USE_OPENSSL
 #include <openssl/ssl.h>		  /* SSL_() */
@@ -927,7 +928,7 @@ main (int argc, char *argv[])
 	load_config ();
 
 #ifdef WIN32
-	if (prefs.gui_one_instance)
+	if (prefs.gui_one_instance && !portable_mode ())
 	{
 		DWORD error;
 
@@ -967,7 +968,7 @@ main (int argc, char *argv[])
 #ifdef WIN32
 	WSACleanup ();
 
-	if (prefs.gui_one_instance)
+	if (prefs.gui_one_instance && !portable_mode ())
 	{
 		CloseHandle (mutex);
 	}
diff --git a/src/fe-gtk/setup.c b/src/fe-gtk/setup.c
index 8fbed277..5b242508 100644
--- a/src/fe-gtk/setup.c
+++ b/src/fe-gtk/setup.c
@@ -14,6 +14,7 @@
 #include "../common/text.h"
 #include "../common/userlist.h"
 #include "../common/util.h"
+#include "../common/wdkutil.h"
 #include "../common/xchatc.h"
 #include "fe-gtk.h"
 #include "gtkutil.h"
@@ -403,6 +404,22 @@ static const setting advanced_settings[] =
 	{ST_TOGGLE,	N_("Display MODEs in raw form"), P_OFFINTNL(raw_modes), 0, 0, 0},
 	{ST_TOGGLE,	N_("Whois on notify"), P_OFFINTNL(whois_on_notifyonline), N_("Sends a /WHOIS when a user comes online in your notify list"), 0, 0},
 	{ST_TOGGLE,	N_("Hide join and part messages"), P_OFFINTNL(confmode), N_("Hide channel join/part messages by default"), 0, 0},
+	{ST_ENTRY,	N_("License Text:"), P_OFFSETNL(gui_license), 0, 0, sizeof prefs.gui_license},
+	{ST_HEADER,	N_("Auto Open DCC Windows"),0,0,0},
+	{ST_TOGGLE, N_("Send window"), P_OFFINTNL(autoopendccsendwindow), 0, 0, 0},
+	{ST_TOGGLE, N_("Receive window"), P_OFFINTNL(autoopendccrecvwindow), 0, 0, 0},
+	{ST_TOGGLE, N_("Chat window"), P_OFFINTNL(autoopendccchatwindow), 0, 0, 0},
+
+	{ST_END, 0, 0, 0, 0, 0}
+};
+
+static const setting advanced_settings_oneinstance[] =
+{
+	{ST_HEADER,	N_("Advanced Settings"),0,0,0},
+	{ST_NUMBER,	N_("Auto reconnect delay:"), P_OFFINTNL(recon_delay), 0, 0, 9999},
+	{ST_TOGGLE,	N_("Display MODEs in raw form"), P_OFFINTNL(raw_modes), 0, 0, 0},
+	{ST_TOGGLE,	N_("Whois on notify"), P_OFFINTNL(whois_on_notifyonline), N_("Sends a /WHOIS when a user comes online in your notify list"), 0, 0},
+	{ST_TOGGLE,	N_("Hide join and part messages"), P_OFFINTNL(confmode), N_("Hide channel join/part messages by default"), 0, 0},
 	{ST_TOGGLE,	N_("Allow only one instance of XChat to run"), P_OFFINTNL(gui_one_instance), 0, 0, 0},
 	{ST_ENTRY,	N_("License Text:"), P_OFFSETNL(gui_license), 0, 0, sizeof prefs.gui_license},
 	{ST_HEADER,	N_("Auto Open DCC Windows"),0,0,0},
@@ -1770,7 +1787,8 @@ setup_create_pages (GtkWidget *box)
 	if (xtray_mode ())
 	{
 		setup_add_page (cata[8], book, setup_create_page (alert_settings_xtray));
-	} else
+	}
+	else
 	{
 		setup_add_page (cata[8], book, setup_create_page (alert_settings));
 	}
@@ -1778,7 +1796,16 @@ setup_create_pages (GtkWidget *box)
 	setup_add_page (cata[9], book, setup_create_page (general_settings));
 	setup_add_page (cata[10], book, setup_create_page (logging_settings));
 	setup_add_page (cata[11], book, setup_create_sound_page ());
-	setup_add_page (cata[12], book, setup_create_page (advanced_settings));
+
+	if (portable_mode ())
+	{
+		setup_add_page (cata[12], book, setup_create_page (advanced_settings));
+	}
+	else
+	{
+		setup_add_page (cata[12], book, setup_create_page (advanced_settings_oneinstance));
+	}
+
 	setup_add_page (cata[14], book, setup_create_page (network_settings));
 	setup_add_page (cata[15], book, setup_create_page (filexfer_settings));