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

List:       konq-e
Subject:    Key Accelerators patch
From:       Arnaud Rolly <arolly () anfora ! fr>
Date:       2001-06-11 14:39:26
[Download RAW message or body]

Here's a patch to add few key accelerators :
Alt+Key_Left : Backward
Alt+Key_Right : Forward
Key_F5 : Reload

Three more infos about the patch :
1) These accelerators are only defined if QT_NO_ACCEL is not defined
2) I applied the same principle to already existing bindings CTRL+Key_W 
and Key_Escape
3) My bindings conforms to the original Konqueror ones. (I tried!)

["accel_patch" (text/plain)]

*** kdenox/konq-embed/src/mainwindow.cc	Sat Jun  9 16:13:52 2001
--- anfora/konq-embed/src/mainwindow.cc	Mon Jun 11 16:21:52 2001
***************
*** 73,78 ****
--- 73,93 ----
  #define MAINWINDOW_FLAGS WType_TopLevel|WDestructiveClose
  #endif
  
+ // Enable few keys accelerators if QT_NO_ACCEL is not defined
+ #if defined(QT_NO_ACCEL)
+ #define CLOSE_ACCEL 0
+ #define STOP_ACCEL 0
+ #define BACKWARD_ACCEL 0
+ #define FORWARD_ACCEL 0
+ #define RELOAD_ACCEL 0
+ #else
+ #define CLOSE_ACCEL CTRL+Key_W
+ #define STOP_ACCEL Key_Escape
+ #define BACKWARD_ACCEL ALT+Key_Left
+ #define FORWARD_ACCEL ALT+Key_Right
+ #define RELOAD_ACCEL Key_F5
+ #endif
+ 
  MainWindow::MainWindow()
      : QMainWindow( 0, 0, MAINWINDOW_FLAGS )
  {
***************
*** 129,144 ****
      m_menu = new PopupAction( m_mainMenu, i18n( "Menu" ), QIconSet( QPixmap( \
menu_xpm ) ),  QString::null, 0, this );
  
!     m_close = new QAction( i18n( "Close View" ), QIconSet(), QString::null, CTRL + \
Key_W, this, "close" );  connect( m_close, SIGNAL( activated() ),
               this, SLOT( closeView() ) );
  
!     m_stop = new QAction( i18n( "Stop" ), QIconSet( QPixmap( stop_xpm ) ), i18n( \
"Stop Loading" ), Key_Escape, this, "stop" );  m_stop->setEnabled( false );
  
!     m_back = new QAction( i18n( "Backward" ), QIconSet( QPixmap( back_xpm ) ), \
QString::null, 0, this, "back" );  
!     m_forward = new QAction( i18n( "Forward" ), QIconSet( QPixmap( forward_xpm ) ), \
QString::null, 0, this, "forward" );  
      m_back->setEnabled( false );
      m_forward->setEnabled( false );
--- 144,159 ----
      m_menu = new PopupAction( m_mainMenu, i18n( "Menu" ), QIconSet( QPixmap( \
menu_xpm ) ),  QString::null, 0, this );
  
!     m_close = new QAction( i18n( "Close View" ), QIconSet(), QString::null, \
CLOSE_ACCEL, this, "close" );  connect( m_close, SIGNAL( activated() ),
               this, SLOT( closeView() ) );
  
!     m_stop = new QAction( i18n( "Stop" ), QIconSet( QPixmap( stop_xpm ) ), i18n( \
"Stop Loading" ), STOP_ACCEL, this, "stop" );  m_stop->setEnabled( false );
  
!     m_back = new QAction( i18n( "Backward" ), QIconSet( QPixmap( back_xpm ) ), \
QString::null, BACKWARD_ACCEL, this, "back" );  
!     m_forward = new QAction( i18n( "Forward" ), QIconSet( QPixmap( forward_xpm ) ), \
QString::null, FORWARD_ACCEL, this, "forward" );  
      m_back->setEnabled( false );
      m_forward->setEnabled( false );
***************
*** 151,157 ****
      connect( m_home, SIGNAL( activated() ),
               this, SLOT( home() ) );
  
!     m_reload = new QAction( i18n( "Reload" ), QIconSet( QPixmap( reload_xpm ) ), \
QString::null, 0, this );  
      m_find = new QAction( i18n( "Find in Document" ), QIconSet(), QString::null, 0, \
this );  connect( m_find, SIGNAL( activated() ),
--- 166,172 ----
      connect( m_home, SIGNAL( activated() ),
               this, SLOT( home() ) );
  
!     m_reload = new QAction( i18n( "Reload" ), QIconSet( QPixmap( reload_xpm ) ), \
QString::null, RELOAD_ACCEL, this );  
      m_find = new QAction( i18n( "Find in Document" ), QIconSet(), QString::null, 0, \
this );  connect( m_find, SIGNAL( activated() ),


_______________________________________________
Konq-e mailing list
Konq-e@master.kde.org
http://master.kde.org/mailman/listinfo/konq-e


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

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