portable mode enabled in runtime
This commit is contained in:
parent
bb33a3c4c4
commit
ca904e4334
|
@ -0,0 +1,14 @@
|
||||||
|
#include <io.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
portable_mode ()
|
||||||
|
{
|
||||||
|
if ((_access( "portable-mode", 0 )) != -1)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
int portable_mode ();
|
|
@ -1,5 +1,4 @@
|
||||||
#X64 = YES
|
#X64 = YES
|
||||||
#PORTABLE = YES
|
|
||||||
IPV6 = YES
|
IPV6 = YES
|
||||||
|
|
||||||
CC = cl
|
CC = cl
|
||||||
|
@ -65,10 +64,6 @@ PYTHONOUTPUT = xcpython.dll
|
||||||
TCLLIB = tcl85
|
TCLLIB = tcl85
|
||||||
TCLOUTPUT = xctcl.dll
|
TCLOUTPUT = xctcl.dll
|
||||||
|
|
||||||
!ifdef PORTABLE
|
|
||||||
CFLAGS = $(CFLAGS) -DPORTABLE_BUILD
|
|
||||||
!endif
|
|
||||||
|
|
||||||
!ifdef IPV6
|
!ifdef IPV6
|
||||||
CFLAGS = $(CFLAGS) -DUSE_IPV6
|
CFLAGS = $(CFLAGS) -DUSE_IPV6
|
||||||
LIBS = $(LIBS) ws2_32.lib
|
LIBS = $(LIBS) ws2_32.lib
|
||||||
|
@ -90,6 +85,7 @@ notify.obj \
|
||||||
outbound.obj \
|
outbound.obj \
|
||||||
plugin.obj \
|
plugin.obj \
|
||||||
plugin-timer.obj \
|
plugin-timer.obj \
|
||||||
|
portable.obj \
|
||||||
proto-irc.obj \
|
proto-irc.obj \
|
||||||
server.obj \
|
server.obj \
|
||||||
servlist.obj \
|
servlist.obj \
|
||||||
|
|
|
@ -137,7 +137,7 @@ diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/xdcc/xdcc.c xchat-wdk/plugi
|
||||||
|
|
||||||
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/cfgfiles.c xchat-wdk/src/common/cfgfiles.c
|
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/cfgfiles.c xchat-wdk/src/common/cfgfiles.c
|
||||||
--- xchat-wdk.orig/src/common/cfgfiles.c 2010-08-07 09:14:45 +0200
|
--- xchat-wdk.orig/src/common/cfgfiles.c 2010-08-07 09:14:45 +0200
|
||||||
+++ xchat-wdk/src/common/cfgfiles.c 2010-08-17 06:30:32 +0200
|
+++ xchat-wdk/src/common/cfgfiles.c 2010-08-18 23:18:04 +0200
|
||||||
@@ -17,7 +17,6 @@
|
@@ -17,7 +17,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -146,36 +146,45 @@ diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/cfgfiles.c xchat-wdk/src
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -32,7 +31,11 @@
|
@@ -30,10 +29,9 @@
|
||||||
|
#include "fe.h"
|
||||||
|
#include "text.h"
|
||||||
#include "xchatc.h"
|
#include "xchatc.h"
|
||||||
|
+#include "portable.h"
|
||||||
|
|
||||||
#ifdef WIN32
|
-#ifdef WIN32
|
||||||
+#ifdef PORTABLE_BUILD
|
-#define XCHAT_DIR "X-Chat 2"
|
||||||
+#define XCHAT_DIR "config"
|
-#else
|
||||||
+#else
|
+#ifndef WIN32
|
||||||
#define XCHAT_DIR "X-Chat 2"
|
|
||||||
+#endif
|
|
||||||
#else
|
|
||||||
#define XCHAT_DIR ".xchat2"
|
#define XCHAT_DIR ".xchat2"
|
||||||
#endif
|
#endif
|
||||||
@@ -308,12 +311,16 @@
|
#define DEF_FONT "Monospace 9"
|
||||||
|
@@ -308,12 +306,19 @@
|
||||||
{
|
{
|
||||||
if (!xdir_fs)
|
if (!xdir_fs)
|
||||||
{
|
{
|
||||||
+#ifdef PORTABLE_BUILD
|
- char out[256];
|
||||||
+ xdir_fs = XCHAT_DIR;
|
+ if (portable_mode ())
|
||||||
+#else
|
+ {
|
||||||
char out[256];
|
+ xdir_fs = "config";
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ char out[256];
|
||||||
|
|
||||||
if (!get_reg_str ("Software\\Microsoft\\Windows\\CurrentVersion\\"
|
- if (!get_reg_str ("Software\\Microsoft\\Windows\\CurrentVersion\\"
|
||||||
"Explorer\\Shell Folders", "AppData", out, sizeof (out)))
|
- "Explorer\\Shell Folders", "AppData", out, sizeof (out)))
|
||||||
return "./config";
|
- return "./config";
|
||||||
xdir_fs = g_strdup_printf ("%s\\" XCHAT_DIR, out);
|
- xdir_fs = g_strdup_printf ("%s\\" XCHAT_DIR, out);
|
||||||
+#endif
|
+ if (!get_reg_str ("Software\\Microsoft\\Windows\\CurrentVersion\\"
|
||||||
|
+ "Explorer\\Shell Folders", "AppData", out, sizeof (out)))
|
||||||
|
+ return "./config";
|
||||||
|
+ xdir_fs = g_strdup_printf ("%s\\" "X-Chat 2", out);
|
||||||
|
+ }
|
||||||
}
|
}
|
||||||
return xdir_fs;
|
return xdir_fs;
|
||||||
}
|
}
|
||||||
@@ -648,6 +655,7 @@
|
@@ -648,6 +653,7 @@
|
||||||
prefs.dialog_height = 256;
|
prefs.dialog_height = 256;
|
||||||
prefs.gui_join_dialog = 1;
|
prefs.gui_join_dialog = 1;
|
||||||
prefs.gui_quit_dialog = 1;
|
prefs.gui_quit_dialog = 1;
|
||||||
|
@ -583,16 +592,16 @@ diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/xchat.h xchat-wdk/src/co
|
||||||
#define X_OK 1
|
#define X_OK 1
|
||||||
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/about.c xchat-wdk/src/fe-gtk/about.c
|
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/about.c xchat-wdk/src/fe-gtk/about.c
|
||||||
--- xchat-wdk.orig/src/fe-gtk/about.c 2010-05-16 09:43:49 +0200
|
--- xchat-wdk.orig/src/fe-gtk/about.c 2010-05-16 09:43:49 +0200
|
||||||
+++ xchat-wdk/src/fe-gtk/about.c 2010-08-17 06:30:32 +0200
|
+++ xchat-wdk/src/fe-gtk/about.c 2010-08-18 23:11:24 +0200
|
||||||
@@ -113,11 +113,15 @@
|
@@ -39,6 +39,7 @@
|
||||||
gtk_container_add (GTK_CONTAINER (vbox), label);
|
|
||||||
g_get_charset (&locale);
|
#include "../common/xchat.h"
|
||||||
(snprintf) (buf, sizeof (buf),
|
#include "../common/util.h"
|
||||||
+#ifdef PORTABLE_BUILD
|
+#include "../common/portable.h"
|
||||||
+ "<span size=\"x-large\"><b>"DISPLAY_NAME" "PACKAGE_VERSION"</b></span>\n<span size=\"x-large\"><b>Portable Version</b></span>\n\n"
|
#include "palette.h"
|
||||||
+#else
|
#include "pixmaps.h"
|
||||||
"<span size=\"x-large\"><b>"DISPLAY_NAME" "PACKAGE_VERSION"</b></span>\n\n"
|
#include "gtkutil.h"
|
||||||
+#endif
|
@@ -117,7 +118,7 @@
|
||||||
"%s\n\n"
|
"%s\n\n"
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
/* leave this message to avoid time wasting bug reports! */
|
/* leave this message to avoid time wasting bug reports! */
|
||||||
|
@ -601,14 +610,29 @@ diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/about.c xchat-wdk/src/fe
|
||||||
#endif
|
#endif
|
||||||
"%s\n"
|
"%s\n"
|
||||||
"<b>Charset</b>: %s "
|
"<b>Charset</b>: %s "
|
||||||
@@ -127,6 +131,7 @@
|
@@ -126,7 +127,11 @@
|
||||||
|
#else
|
||||||
"<b>Renderer</b>: %s\n"
|
"<b>Renderer</b>: %s\n"
|
||||||
#endif
|
#endif
|
||||||
"<b>Compiled</b>: "__DATE__"\n\n"
|
- "<b>Compiled</b>: "__DATE__"\n\n"
|
||||||
|
+ "<b>Compiled</b>: "__DATE__"\n"
|
||||||
|
+#ifdef WIN32
|
||||||
|
+ "<b>Portable Mode</b>: %s\n\n"
|
||||||
+ "<b>XChat Base</b>: 2.8.8\n\n"
|
+ "<b>XChat Base</b>: 2.8.8\n\n"
|
||||||
|
+#endif
|
||||||
"<small>\302\251 1998-2010 Peter \305\275elezn\303\275 <zed@xchat.org></small>",
|
"<small>\302\251 1998-2010 Peter \305\275elezn\303\275 <zed@xchat.org></small>",
|
||||||
_("A multiplatform IRC Client"),
|
_("A multiplatform IRC Client"),
|
||||||
get_cpu_str(),
|
get_cpu_str(),
|
||||||
|
@@ -134,7 +139,8 @@
|
||||||
|
#ifdef WIN32
|
||||||
|
gtk_major_version,
|
||||||
|
gtk_minor_version,
|
||||||
|
- gtk_micro_version
|
||||||
|
+ gtk_micro_version,
|
||||||
|
+ (portable_mode() ? "Yes" : "No")
|
||||||
|
#else
|
||||||
|
#ifdef USE_XFT
|
||||||
|
"Xft"
|
||||||
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/banlist.c xchat-wdk/src/fe-gtk/banlist.c
|
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/banlist.c xchat-wdk/src/fe-gtk/banlist.c
|
||||||
--- xchat-wdk.orig/src/fe-gtk/banlist.c 2010-05-16 05:20:22 +0200
|
--- xchat-wdk.orig/src/fe-gtk/banlist.c 2010-05-16 05:20:22 +0200
|
||||||
+++ xchat-wdk/src/fe-gtk/banlist.c 2010-08-17 06:30:32 +0200
|
+++ xchat-wdk/src/fe-gtk/banlist.c 2010-08-17 06:30:32 +0200
|
||||||
|
|
Loading…
Reference in New Issue