[ekg2-commit] ekg2: vars.c (HEAD) windows.c (HEAD) [peres]

CVS commit cvs w toxygen.net
Czw, 3 Maj 2007, 22:51:54 CEST


Module name:	ekg2
Changes by:	peres	2007-05-03 22:51:51

Modified files:
	vars.c windows.c

Log message:
- typo (windows_session_allow->window_session_allow),
- var map for window_session_allow,
- const for locks change,
- additional value for window_session_allow:
  when 4, it first switches to status window, then changes session.

Index: vars.c
===================================================================
RCS file: /home/cvs/ekg2/ekg/vars.c,v
diff -d -u -r1.94 -r1.95
--- vars.c	3 May 2007 15:45:11 -0000	1.94
+++ vars.c	3 May 2007 20:51:51 -0000	1.95
@@ -47,7 +47,7 @@
 list_t variables = NULL;
 char *console_charset;
 
-void changed_session_locks(char *varname); /* sessions.c */
+void changed_session_locks(const char *varname); /* sessions.c */
 
 /*
  * dd_*()
@@ -150,7 +150,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, ("window_session_allow"), VAR_INT, 1, &config_window_session_allow, NULL, variable_map(4, 0, 0, "deny", 1, 6, "uid-capable", 2, 5, "any", 4, 3, "switch-to-status"), 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.83 -r1.84
--- windows.c	2 May 2007 21:35:24 -0000	1.83
+++ windows.c	3 May 2007 20:51:51 -0000	1.84
@@ -887,7 +887,8 @@
  * @note	behaviour of window_session_cycle() based on values of config_window_session_allow:
  * 		 0 - change session only if w->target == NULL
  * 		 1 - like 0 + if w->target is set than new session must accept that uid	[default && other values]
- * 		 2 - change to any next session.
+ * 		 2 - change to any next session
+ * 		 4 - jump to status window before cycling.
  *
  * @note	If w->session was changed than UI_WINDOW_TARGET_CHANGED will be emited.
  * 		If w == window_current than SESSION_CHANGED will be emited also.
@@ -915,6 +916,15 @@
 		return -1;
 	}
 
+	if (config_window_session_allow == 4) { /* higher level of magic */
+			/* switch to status window */
+		command_exec(NULL, NULL, "/window switch 1", 1);
+		w			= window_status;
+			/* and change switching order
+			 * we don't need to emit anything, because this function will (should?) change it again */
+		window_status->session	= w->session;
+	}
+
 	if (config_window_session_allow == 0 && w->target) {
 		print("session_cannot_change");
 		return -1;


Więcej informacji o liście dyskusyjnej ekg2-commit