[ekg2-commit] ekg2: stuff.c (HEAD) stuff.h (HEAD) vars.c (HEAD) windows.c (HEAD) [darkjames]
CVS commit
cvs w toxygen.net
Śro, 2 Maj 2007, 22:57:23 CEST
Module name: ekg2
Changes by: darkjames 2007-05-02 22:57:21
Modified files:
stuff.c stuff.h vars.c windows.c
Log message:
- make variable windows_session_allow
- print info about invalid session on ^X
Index: stuff.c
===================================================================
RCS file: /home/cvs/ekg2/ekg/stuff.c,v
diff -d -u -r1.190 -r1.191
--- stuff.c 2 May 2007 17:34:14 -0000 1.190
+++ stuff.c 2 May 2007 20:57:20 -0000 1.191
@@ -162,6 +162,7 @@
char *config_display_color_map = NULL;
char *config_session_default = NULL;
int config_sessions_save = 0;
+int config_window_session_allow = 0;
int config_windows_save = 0;
char *config_windows_layout = NULL;
char *config_profile = NULL;
Index: stuff.h
===================================================================
RCS file: /home/cvs/ekg2/ekg/stuff.h,v
diff -d -u -r1.100 -r1.101
--- stuff.h 2 May 2007 16:31:09 -0000 1.100
+++ stuff.h 2 May 2007 20:57:21 -0000 1.101
@@ -229,6 +229,7 @@
extern int config_use_unicode; /* for instance in jabber plugin if this is on, than we don't need to make iconv from / to unicode.. */
extern int config_use_iso; /* this for ncurses */
extern char *config_console_charset; /* */
+extern int config_window_session_allow;
extern char *config_windows_layout;
extern int config_windows_save;
extern char *config_dcc_dir;
Index: vars.c
===================================================================
RCS file: /home/cvs/ekg2/ekg/vars.c,v
diff -d -u -r1.91 -r1.92
--- vars.c 1 May 2007 14:09:08 -0000 1.91
+++ vars.c 2 May 2007 20:57:21 -0000 1.92
@@ -147,6 +147,7 @@
variable_add(NULL, ("time_deviation"), VAR_INT, 1, &config_time_deviation, NULL, NULL, NULL);
variable_add(NULL, ("timestamp"), VAR_STR, 1, &config_timestamp, NULL, NULL, NULL); /* ? */
variable_add(NULL, ("timestamp_show"), VAR_BOOL, 1, &config_timestamp_show, NULL, NULL, NULL);
+ variable_add(NULL, ("windows_session_allow"), VAR_INT, 1, &config_window_session_allow, NULL, /* XXX */ NULL, NULL);
variable_add(NULL, ("windows_layout"), VAR_STR, 2, &config_windows_layout, NULL, NULL, NULL);
variable_add(NULL, ("windows_save"), VAR_BOOL, 1, &config_windows_save, NULL, NULL, NULL);
Index: windows.c
===================================================================
RCS file: /home/cvs/ekg2/ekg/windows.c,v
diff -d -u -r1.81 -r1.82
--- windows.c 2 May 2007 20:04:32 -0000 1.81
+++ windows.c 2 May 2007 20:57:21 -0000 1.82
@@ -879,8 +879,6 @@
return 0;
}
-int config_window_session_allow = 1;
-
/**
* window_session_cycle()
*
@@ -909,11 +907,19 @@
{
list_t l;
session_t *new_session = NULL;
+ int once = 0;
char *uid;
char *nickname;
- if (!w || !sessions || (config_window_session_allow == 0 && w->target))
+ if (!w || !sessions) {
+ return -1;
+ }
+
+ if (config_window_session_allow == 0 && w->target) {
+ print("session_cannot_change");
return -1;
+ }
+
/* find sessions->(...next..)->data == w->session */
for (l = sessions; l; l = l->next) {
@@ -937,6 +943,8 @@
if (s == w->session)
break;
+ once = 1;
+
if (config_window_session_allow == 2 || !w->target || (config_window_session_allow != 0 && get_uid(s, uid))) {
new_session = s;
break;
@@ -949,8 +957,12 @@
goto again;
}
- if (!new_session) /* not found */
+ if (!new_session) { /* not found */
+ if (once) { /* here config_window_session_allow don't allow to change session */
+ print("session_cannot_change");
+ }
return -1;
+ }
w->session = new_session;
Więcej informacji o liście dyskusyjnej ekg2-commit