[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Problems with Select/Select All command in kfm ...
From:       Dawit Alemayehu <adawit () earthlink ! net>
Date:       1999-01-28 10:08:01
[Download RAW message or body]

Neither the "Select - CTRL-S" nor the "Select All   CRTL-A" commands 
work when kfm is in HTML mode ( browsing a web page).  No matter what 
I did to fix this, the only thing that will get selected is all the hyperlinks
on the page.  Here is the final changes I tried 

In kfmGui.cpp replaced the slotSelectAll method with the following

void KfmGui::slotSelectAll()
{
  KLined *lined = toolbarURL->getLined(TOOLBAR_URL_ID);
  // if the URL editor is focused, the user really intends to go to
  // the beginning of the line when they press CTRL-A (a la sh, emacs).

  // WHY ??? CTRL-A is clearly defined as select All !!! Not as in emacs
  // mode.  Is it wise to have a defined key action perform many different
  // functions based on context within the same application ???????  (DAWIT A.)
  if ( focusWidget() == lined )
  {
      // Simulate a key event to the widget focused
      // We use Key_Home because Ctrl+A calls this function !
      // Using QLineEdit members methods don't work, since we don't 
      // whether focusWidget() is a QLineEdit.
      QKeyEvent e( Event_KeyPress, Key_Home, 0, 0);
      QApplication::sendEvent( focusWidget(), &e);
  }
  else if ( ( focusWidget() == view ) && bHtmlMode )
  {
      // If the web page has the focus send the CTRL-A
      // action to it anbd select the whole page.  (DAWIT A.)
      QRegExp e ( "[a-zA-Z0-9]*" );
      view->getActiveView()->select( e, true );  // still does not work asintended
       //QKeyEvent e( Event_KeyPress, CTRL+Key_A, 0, 0);
      //QApplication::sendEvent( focusWidget(), &e);  would be nice, but only selects URLs (DAWIT A.)
  }
  else
    view->getActiveView()->select( 0L, true );
}

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic