[Konsole-devel] New NOTIFYLOCK (what to do with NOTIFYSILENCE?)

Achim Bohnet ach at mpe.mpg.de
Mon Mar 11 22:38:11 UTC 2002


Hi,
I hate users calling me because 'konsole is frozen' ;) Therefore
I've tried to added a visual indicatior for XOFF.  Some missing peaces

	o a bubble help for the sessin button telling the user
	  to unlock via ^S ;)

	o with monitor for silence on silence-icon overrides lock-icon

I'm still not sure how to best implement 2).  Suggestions?		

Achim

Index: TEmuVt102.cpp
===================================================================
RCS file: /home/kde/kdebase/konsole/konsole/TEmuVt102.cpp,v
retrieving revision 1.77
diff -u -3 -p -r1.77 TEmuVt102.cpp
--- TEmuVt102.cpp	2002/03/07 21:42:54	1.77
+++ TEmuVt102.cpp	2002/03/11 20:43:10
@@ -776,11 +776,15 @@ void TEmuVt102::scrollLock(const bool lo
   {
     holdScreen = true;
     emit sndBlock("\023", 1); // XOFF -> ^S
+    //kdDebug(1211)<<"TEmuVt102 notify lock"<<endl;
+    emit notifySessionState(NOTIFYLOCK);
   }
   else
   {
     holdScreen = false;
     emit sndBlock("\021", 1); // XON -> ^Q
+    //kdDebug(1211)<<"TEmuVt102 notify unlock"<<endl;
+    emit notifySessionState(NOTIFYNORMAL);
   }
 #if defined(HAVE_XTEST) || defined(HAVE_XKB)
   if (holdScreen)
@@ -807,7 +811,10 @@ void TEmuVt102::onScrollLock()
 void TEmuVt102::onKeyPress( QKeyEvent* ev )
 {
   if (!listenToKeyPress) return; // someone else gets the keys
-  emit notifySessionState(NOTIFYNORMAL);
+  if (!holdScreen)
+    emit notifySessionState(NOTIFYNORMAL);
+  //else
+  //  kdDebug(1211) << "blocked 'cause of holdScrren" << endl;
 
 //printf("State/Key: 0x%04x 0x%04x (%d,%d)\n",ev->state(),ev->key(),ev->text().length(),ev->text().length()?ev->text().ascii()[0]:0);
 
Index: TEmulation.h
===================================================================
RCS file: /home/kde/kdebase/konsole/konsole/TEmulation.h,v
retrieving revision 1.21
diff -u -3 -p -r1.21 TEmulation.h
--- TEmulation.h	2002/03/04 00:54:02	1.21
+++ TEmulation.h	2002/03/11 20:43:10
@@ -20,7 +20,7 @@
 #include <qtextcodec.h>
 #include <keytrans.h>
 
-enum { NOTIFYNORMAL=0, NOTIFYBELL=1, NOTIFYACTIVITY=2, NOTIFYSILENCE=3 };
+enum { NOTIFYNORMAL=0, NOTIFYBELL=1, NOTIFYACTIVITY=2, NOTIFYSILENCE=3, NOTIFYLOCK=4 };
 
 class TEmulation : public QObject
 { Q_OBJECT
Index: konsole.cpp
===================================================================
RCS file: /home/kde/kdebase/konsole/konsole/konsole.cpp,v
retrieving revision 1.257
diff -u -3 -p -r1.257 konsole.cpp
--- konsole.cpp	2002/03/02 14:23:49	1.257
+++ konsole.cpp	2002/03/11 20:43:10
@@ -1834,6 +1834,8 @@ void Konsole::notifySessionState(TESessi
                          break;
     case NOTIFYSILENCE : state_iconname = "ktip";
 			 break;
+    case NOTIFYLOCK    : state_iconname = "stop";
+			 break;
   }
   if (!state_iconname.isEmpty()
       && session->testAndSetStateIconName(state_iconname))

-- 
  To me vi is Zen.  To use vi is to practice zen. Every command is
  a koan. Profound to the user, unintelligible to the uninitiated.
  You discover truth everytime you use it.
                                      -- reddy at lion.austin.ibm.com



More information about the konsole-devel mailing list