Back to index

scribus-ng  1.3.4.dfsg+svn20071115
tabkeyboardshortcutswidget.cpp
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /***************************************************************************
00008 *   Copyright (C) 2006 by Craig Bradney                                   *
00009 *   cbradney@zip.com.au                                                   *
00010 *                                                                         *
00011 *   This program is free software; you can redistribute it and/or modify  *
00012 *   it under the terms of the GNU General Public License as published by  *
00013 *   the Free Software Foundation; either version 2 of the License, or     *
00014 *   (at your option) any later version.                                   *
00015 *                                                                         *
00016 *   This program is distributed in the hope that it will be useful,       *
00017 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00019 *   GNU General Public License for more details.                          *
00020 *                                                                         *
00021 *   You should have received a copy of the GNU General Public License     *
00022 *   along with this program; if not, write to the                         *
00023 *   Free Software Foundation, Inc.,                                       *
00024 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00025 ***************************************************************************/
00026 #include "tabkeyboardshortcutswidget.h"
00027 #include "tabkeyboardshortcutswidget.moc"
00028 
00029 #include <qcombobox.h>
00030 #include <qdir.h>
00031 #include <qdom.h>
00032 #include <qfile.h>
00033 #include <qfileinfo.h>
00034 #include <qfiledialog.h>
00035 #include <qinputdialog.h>
00036 #include <qkeysequence.h>
00037 #include <qlabel.h>
00038 #include <qlistview.h>
00039 #include <qmessagebox.h>
00040 #include <qpushbutton.h>
00041 #include <qradiobutton.h>
00042 #include <qstring.h>
00043 #include <qstringlist.h>
00044 
00045 #include "actionmanager.h"
00046 #include "commonstrings.h"
00047 #include "prefsmanager.h"
00048 #include "prefsfile.h"
00049 #include "prefscontext.h"
00050 #include "scpaths.h"
00051 #include "scraction.h"
00052 #include "util.h"
00053 
00054 TabKeyboardShortcutsWidget::TabKeyboardShortcutsWidget(QMap<QString, Keys> oldKeyMap, QWidget *parent, const char *name)
00055     :TabKeyboardShortcutsWidgetBase(parent, name)
00056 {
00057        ActionManager::createDefaultMenus();
00058        ActionManager::createDefaultNonMenuActions();
00059        defMenus=ActionManager::defaultMenus();
00060        defNonMenuActions=ActionManager::defaultNonMenuActions();
00061        Q_CHECK_PTR(defMenus);
00062        lviToActionMap.clear();
00063        lviToMenuMap.clear();
00064        keyTable->clear();
00065        keyMap.clear();
00066        keyMap = oldKeyMap;
00067        Part0 = "";
00068        Part1 = "";
00069        Part2 = "";
00070        Part3 = "";
00071        Part4 = "";
00072        keyCode = 0;
00073        keyDisplay->setMinimumWidth(fontMetrics().width("CTRL+ALT+SHIFT+W"));
00074        keyDisplay->setText("");
00075 
00076        keyTable->setSorting(-1);
00077        // switched off as it's called in main prefs classes - PV
00078        //restoreDefaults();
00079 
00080        clearSearchButton->setPixmap(loadIcon("clear_right.png"));
00081        // signals and slots connections
00082        connect( keyTable, SIGNAL(clicked(QListViewItem*)), this, SLOT(dispKey(QListViewItem*)));
00083        connect( noKey, SIGNAL(clicked()), this, SLOT(setNoKey()));
00084        connect( setKeyButton, SIGNAL(clicked()), this, SLOT(setKeyText()));
00085        connect( loadSetButton, SIGNAL(clicked()), this, SLOT(loadKeySetFile()));
00086        connect( importSetButton, SIGNAL(clicked()), this, SLOT(importKeySetFile()));
00087        connect( exportSetButton, SIGNAL(clicked()), this, SLOT(exportKeySetFile()));
00088        connect( resetSetButton, SIGNAL(clicked()), this, SLOT(resetKeySet()));
00089        connect( clearSearchButton, SIGNAL(clicked()), this, SLOT(clearSearchString()));
00090        connect( searchTextLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(applySearch(const QString&)));
00091 }
00092 
00093 void TabKeyboardShortcutsWidget::restoreDefaults()
00094 {
00095        loadableSets->clear();
00096        loadableSets->insertStringList(scanForSets());
00097        insertActions();
00098        dispKey(0);
00099 }
00100 
00101 const QMap<QString, Keys> TabKeyboardShortcutsWidget::getNewKeyMap()
00102 {
00103        return keyMap;
00104 }
00105 
00106 void TabKeyboardShortcutsWidget::setNoKey()
00107 {
00108        if (noKey->isChecked())
00109        {
00110               if (selectedLVI!=0)
00111               {
00112                      selectedLVI->setText(1,"");
00113                      keyMap[lviToActionMap[selectedLVI]].keySequence=QKeySequence();
00114               }
00115               keyDisplay->setText("");
00116               noKey->setChecked(true);
00117        }
00118 }
00119 
00120 void TabKeyboardShortcutsWidget::loadKeySetFile()
00121 {
00122        if (keySetList[loadableSets->currentText()])
00123               importKeySet(keySetList[loadableSets->currentText()]);
00124 }
00125 
00126 void TabKeyboardShortcutsWidget::importKeySetFile()
00127 {
00128        PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
00129        QString currentPath = dirs->get("keymapprefs_import", ".");
00130        QString s = QFileDialog::getOpenFileName(currentPath, tr("Key Set XML Files (*.ksxml)"), this, "load open file dialog", "Choose a file to open" );
00131        if (!s.isEmpty())
00132               importKeySet(s);
00133 }
00134 void TabKeyboardShortcutsWidget::exportKeySetFile()
00135 {   
00136        PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
00137        QString currentPath= dirs->get("keymapprefs_export", ".");
00138        QString s = QFileDialog::getSaveFileName(currentPath, tr("Key Set XML Files (*.ksxml)"), this, "save open file dialog", "Choose a file to save" );
00139        if (!s.isEmpty())
00140               exportKeySet(s);
00141 }
00142 
00143 void TabKeyboardShortcutsWidget::importKeySet(QString filename)
00144 {
00145        searchTextLineEdit->clear();
00146        QFileInfo fi = QFileInfo(filename);
00147        if (fi.exists())
00148        {
00149               //import the file into qdomdoc
00150               QDomDocument doc( "keymapentries" );
00151               QFile file( filename );
00152               if ( !file.open( IO_ReadOnly ) )
00153                      return;
00154               QTextStream ts(&file);
00155               ts.setEncoding(QTextStream::UnicodeUTF8);
00156               QString errorMsg;
00157               int eline;
00158               int ecol;
00159               if ( !doc.setContent( ts.read(), &errorMsg, &eline, &ecol )) 
00160               {
00161                      qDebug("%s", QString("Could not open key set file: %1\nError:%2 at line: %3, row: %4").arg(filename).arg(errorMsg).arg(eline).arg(ecol).ascii());
00162                      file.close();
00163                      return;
00164               }
00165               file.close();
00166               //load the file now
00167               QDomElement docElem = doc.documentElement();
00168               if (docElem.tagName()=="shortcutset" && docElem.hasAttribute("name"))
00169               {
00170                      QDomAttr keysetAttr = docElem.attributeNode( "name" );
00171 
00172                      //clear current menu entries
00173                      for (QMap<QString,Keys>::Iterator it=keyMap.begin(); it!=keyMap.end(); ++it)
00174                             it.data().keySequence = QKeySequence();
00175                      
00176                      //load in new set
00177                      QDomNode n = docElem.firstChild();
00178                      while( !n.isNull() ) 
00179                      {
00180                             QDomElement e = n.toElement(); // try to convert the node to an element.
00181                             if( !e.isNull() ) 
00182                             {
00183                                    if (e.hasAttribute("name")  && e.hasAttribute( "shortcut" )) 
00184                                    {
00185                                           QDomAttr nameAttr = e.attributeNode( "name" );
00186                                           QDomAttr shortcutAttr = e.attributeNode( "shortcut" );
00187                                           if (keyMap.contains(nameAttr.value()))
00188                                                  keyMap[nameAttr.value()].keySequence=QKeySequence(shortcutAttr.value());
00189                                    }
00190                             }
00191                             n = n.nextSibling();
00192                      }
00193               }
00194        }
00195        insertActions();
00196 }
00197 
00198 bool TabKeyboardShortcutsWidget::exportKeySet(QString filename)
00199 {
00200        QFileInfo fi = QFileInfo(filename);
00201        QString exportFileName;
00202        if (filename.endsWith(".ksxml"))
00203               exportFileName = filename;
00204        else
00205               exportFileName = filename+".ksxml";
00206        if (overwrite(this, exportFileName))
00207        {
00208               bool ok;
00209               QString setName = QInputDialog::getText("Export Keyboard Shortcuts to File", "Enter the name of the shortcut set:", QLineEdit::Normal, QString::null, &ok, this );
00210               if (!( ok && !setName.isEmpty()) ) 
00211                      return false;
00212               
00213               QDomDocument doc( "keymapentries" );
00214               QString keyset=QString("<shortcutset name=\"%1\"></shortcutset>").arg(setName);
00215               doc.setContent(keyset);
00216               QDomElement keySetElement=doc.documentElement();
00217               QMap<QString,Keys>::Iterator itEnd=keyMap.end();
00218               for (QMap<QString,Keys>::Iterator it=keyMap.begin(); it!=itEnd; ++it)
00219               {
00220                      if (it.data().keySequence.isEmpty() && it.key().isEmpty())
00221                             continue;
00222                      QDomElement function_shortcut=doc.createElement("function");
00223                      function_shortcut.setAttribute("name",it.key());
00224                      function_shortcut.setAttribute("shortcut",getKeyText(it.data().keySequence));
00225                      keySetElement.appendChild(function_shortcut);
00226               }
00227               QFile f(filename);
00228               if(!f.open(IO_WriteOnly))
00229                      return false;
00230               QTextStream s(&f);
00231               s.setEncoding(QTextStream::UnicodeUTF8);
00232               QString xmltag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
00233               s.writeRawBytes(xmltag, xmltag.length());
00234               QString xmldoc = doc.toString(4);
00235               s.writeRawBytes(xmldoc, xmldoc.length());
00236               f.close();
00237        }
00238        return true;
00239 }
00240 
00241 void TabKeyboardShortcutsWidget::resetKeySet()
00242 {
00243        QString location=ScPaths::instance().libDir();
00244        QString defaultKeySetFileName=QDir::convertSeparators(location+"keysets/scribus13.ksxml");
00245        importKeySet(defaultKeySetFileName);      
00246 }
00247 
00248 QStringList TabKeyboardShortcutsWidget::scanForSets()
00249 {
00250        keySetList.clear();
00251        QString location=ScPaths::instance().libDir();
00252        QString keySetLocation=QDir::convertSeparators(location+"keysets/");
00253        QDir keySetsDir(keySetLocation, "*.ksxml", QDir::Name, QDir::Files | QDir::NoSymLinks);
00254        if ((keySetsDir.exists()) && (keySetsDir.count() != 0))
00255        {
00256               QStringList appNames;
00257               for (uint fileCounter = 0; fileCounter < keySetsDir.count(); ++fileCounter)
00258               {
00259                      QString filename=QDir::convertSeparators(location+"keysets/"+keySetsDir[fileCounter]);
00260                      
00261                      QDomDocument doc( "keymapentries" );
00262                      QFile file( filename );
00263                      if ( !file.open( IO_ReadOnly ) )
00264                             continue;
00265                      QString errorMsg;
00266                      int eline;
00267                      int ecol;
00268                      
00269                      if ( !doc.setContent( &file, &errorMsg, &eline, &ecol )) 
00270                      {
00271                             qDebug("%s", QString("Could not open key set file: %1\nError:%2 at line: %3, row: %4").arg(keySetsDir[fileCounter]).arg(errorMsg).arg(eline).arg(ecol).ascii());
00272                             file.close();
00273                             continue;
00274                      }
00275                      file.close();
00276               
00277                      QDomElement docElem = doc.documentElement();
00278                      if (docElem.tagName()=="shortcutset" && docElem.hasAttribute("name"))
00279                      {
00280                             QDomAttr nameAttr = docElem.attributeNode( "name" );
00281                             appNames.append(nameAttr.value());
00282                             keySetList.insert(nameAttr.value(), filename);
00283                      }
00284               }
00285               return QStringList(appNames);
00286        }
00287        return NULL;
00288 }
00289 
00290 QString TabKeyboardShortcutsWidget::getKeyText(int KeyC)
00291 {
00292        if ((KeyC & ~(Qt::META | Qt::CTRL | Qt::ALT | Qt::SHIFT)) == 0)
00293               return "";
00294        // on OSX Qt translates modifiers to forsaken symbols, arrows and the like
00295        // we prefer plain English
00296        QString res;
00297        if ((KeyC & Qt::META) != 0)
00298               res += "Meta+";
00299        if ((KeyC & Qt::CTRL) != 0)
00300               res += "Ctrl+";
00301        if ((KeyC & Qt::ALT) != 0)
00302               res += "Alt+";
00303        if ((KeyC & Qt::SHIFT) != 0)
00304               res += "Shift+";
00305        return res + QString(QKeySequence(KeyC & ~(Qt::META | Qt::CTRL | Qt::ALT | Qt::SHIFT)));
00306 }
00307 
00308 void TabKeyboardShortcutsWidget::setKeyText()
00309 {
00310        if (setKeyButton->isOn())
00311        {
00312               keyCode = 0;
00313               Part0 = "";
00314               Part1 = "";
00315               Part2 = "";
00316               Part3 = "";
00317               Part4 = "";
00318               grabKeyboard();
00319        }
00320        else
00321               releaseKeyboard();
00322 }
00323 
00324 void TabKeyboardShortcutsWidget::insertActions()
00325 {
00326        lviToActionMap.clear();
00327        lviToMenuMap.clear();
00328        keyTable->clear();
00329        bool first, firstMenu=true;
00330        QListViewItem *currLVI = NULL;
00331        QListViewItem *currMenuLVI = NULL;
00332        QListViewItem *prevLVI = NULL;
00333        QListViewItem *prevMenuLVI = NULL;
00334        for (QValueVector< QPair<QString, QStringList> >::Iterator itmenu = defMenus->begin(); itmenu != defMenus->end(); ++itmenu )
00335        {
00336               if (firstMenu)
00337               {
00338                      currMenuLVI=new QListViewItem(keyTable);
00339                      firstMenu=false;
00340               }
00341               else
00342                      currMenuLVI=new QListViewItem(keyTable, prevMenuLVI);
00343               Q_CHECK_PTR(currMenuLVI);
00344               lviToMenuMap.append(currMenuLVI);
00345               currMenuLVI->setText(0, itmenu->first);
00346               currMenuLVI->setOpen(true);
00347               prevMenuLVI=currMenuLVI;
00348               first=true;
00349               currLVI=0;
00350               prevLVI=0;
00351               for ( QStringList::Iterator it = itmenu->second.begin(); it != itmenu->second.end(); ++it )
00352               {
00353                      if (first)
00354                      {
00355                             currLVI=new QListViewItem(currMenuLVI);
00356                             first=false;
00357                      }
00358                      else
00359                             currLVI=new QListViewItem(currMenuLVI, prevLVI);
00360                      Q_CHECK_PTR(currLVI);
00361                      lviToActionMap.insert(currLVI, *it);
00362                      currLVI->setText(0, keyMap[*it].cleanMenuText);
00363                      currLVI->setText(1, keyMap[*it].keySequence);
00364                      prevLVI=currLVI;
00365               }
00366        }
00367        //Non menu actions
00368        for (QValueVector< QPair<QString, QStringList> >::Iterator itmenu = defNonMenuActions->begin(); itmenu != defNonMenuActions->end(); ++itmenu )
00369        {
00370               if (firstMenu)
00371               {
00372                      currMenuLVI=new QListViewItem(keyTable);
00373                      firstMenu=false;
00374               }
00375               else
00376                      currMenuLVI=new QListViewItem(keyTable, prevMenuLVI);
00377               Q_CHECK_PTR(currMenuLVI);
00378               lviToMenuMap.append(currMenuLVI);
00379               currMenuLVI->setText(0, itmenu->first);
00380               currMenuLVI->setOpen(true);
00381               prevMenuLVI=currMenuLVI;
00382               first=true;
00383               currLVI=0;
00384               prevLVI=0;
00385               for ( QStringList::Iterator it = itmenu->second.begin(); it != itmenu->second.end(); ++it )
00386               {
00387                      if (first)
00388                      {
00389                             currLVI=new QListViewItem(currMenuLVI);
00390                             first=false;
00391                      }
00392                      else
00393                             currLVI=new QListViewItem(currMenuLVI, prevLVI);
00394                      Q_CHECK_PTR(currLVI);
00395                      lviToActionMap.insert(currLVI, *it);
00396                      currLVI->setText(0, keyMap[*it].cleanMenuText);
00397                      currLVI->setText(1, keyMap[*it].keySequence);
00398                      prevLVI=currLVI;
00399               }
00400        }
00401 }
00402 
00403 void TabKeyboardShortcutsWidget::applySearch( const QString & newss )
00404 {
00405        //Must run this as if newss is not empty and we go to the next for loop, the set visible doesnt work
00406        for (QPtrList<QListViewItem>::iterator it=lviToMenuMap.begin(); it!=lviToMenuMap.end(); ++it)
00407               (*it)->setVisible(true);
00408        if (newss.isEmpty())
00409        {                    
00410               for (QMap<QListViewItem*, QString>::iterator it=lviToActionMap.begin(); it!=lviToActionMap.end(); ++it)
00411                      it.key()->setVisible(true);
00412               return;
00413        }
00414        //Seem to need to do this.. isOpen doesnt seem to do what it says
00415        for (QMap<QListViewItem*, QString>::iterator it=lviToActionMap.begin(); it!=lviToActionMap.end(); ++it)
00416        {
00417               if (it.key()->text(0).contains(newss, false))
00418                      it.key()->setVisible(true);
00419               else
00420                      it.key()->setVisible(false);
00421        }
00422        for (QPtrList<QListViewItem>::iterator it=lviToMenuMap.begin(); it!=lviToMenuMap.end(); ++it)
00423        {
00424               bool toBeVisible=false;
00425               QListViewItem* fc=(*it)->firstChild();
00426               if (fc!=0)
00427               {
00428                      if (fc->isVisible())
00429                             toBeVisible=true;
00430                      else
00431                      {
00432                             QListViewItem* sibling=fc->nextSibling();
00433                             while (sibling!=0)
00434                             {
00435                                    if (sibling->isVisible())
00436                                    {
00437                                           toBeVisible=true;
00438                                           break;
00439                                    }
00440                                    sibling=sibling->nextSibling();
00441                             }
00442                      }
00443               }
00444               (*it)->setVisible(toBeVisible);
00445        }
00446 }
00447 
00448 void TabKeyboardShortcutsWidget::dispKey(QListViewItem* qlvi)
00449 {
00450        if (qlvi!=0 && lviToActionMap.contains(qlvi))
00451        {
00452               selectedLVI=qlvi;
00453               QString actionName=lviToActionMap[qlvi];
00454               if (actionName.isEmpty())
00455                      return;
00456               keyDisplay->setText(keyMap[actionName].keySequence);
00457               if (keyMap[actionName].keySequence.isEmpty())
00458                      noKey->setChecked(true);
00459               else
00460                      userDef->setChecked(true);
00461        }
00462        else
00463        {
00464               noKey->setChecked(true);
00465               keyDisplay->setText("");
00466               selectedLVI=0;
00467        }
00468 }
00469 
00470 bool TabKeyboardShortcutsWidget::event( QEvent* ev )
00471 {
00472        bool ret = QWidget::event( ev );
00473        if ( ev->type() == QEvent::KeyPress )
00474               keyPressEvent((QKeyEvent*)ev);
00475        if ( ev->type() == QEvent::KeyRelease )
00476               keyReleaseEvent((QKeyEvent*)ev);
00477        return ret;
00478 }
00479 
00480 void TabKeyboardShortcutsWidget::keyPressEvent(QKeyEvent *k)
00481 {
00482        if (setKeyButton->isOn())
00483        {
00484               QStringList tl;
00485               if (!keyDisplay->text().isEmpty())
00486               {
00487                      tl = tl.split("+", keyDisplay->text());
00488                      Part4 = tl[tl.count()-1];
00489                      if (Part4 == tr("Alt") || Part4 == tr("Ctrl") || Part4 == tr("Shift") || Part4 == tr("Meta"))
00490                             Part4 = "";
00491               }
00492               else
00493                      Part4 = "";
00494               switch (k->key())
00495               {
00496                      case Key_Meta:
00497                             Part0 = tr("Meta+");
00498                             keyCode |= Qt::META;
00499                             break;
00500                      case Key_Shift:
00501                             Part3 = tr("Shift+");
00502                             keyCode |= Qt::SHIFT;
00503                             break;
00504                      case Key_Alt:
00505                             Part2 = tr("Alt+");
00506                             keyCode |= Qt::ALT;
00507                             break;
00508                      case Key_Control:
00509                             Part1 = tr("Ctrl+");
00510                             keyCode |= Qt::CTRL;
00511                             break;
00512                      default:
00513                             keyCode |= k->key();
00514                             keyDisplay->setText(getKeyText(keyCode));
00515                             if (checkKey(keyCode))
00516                             {
00517                                    QMessageBox::information(this, CommonStrings::trWarning,
00518                                                                              tr("This key sequence is already in use"),
00519                                                                              CommonStrings::tr_OK);
00520                                    selectedLVI->setText(1,keyMap[lviToActionMap[selectedLVI]].keySequence);
00521                                    keyDisplay->setText(keyMap[lviToActionMap[selectedLVI]].keySequence);
00522                             }
00523                             else
00524                             {
00525                                    QKeySequence newKeySequence(keyCode);
00526                                    selectedLVI->setText(1, QString(newKeySequence));
00527                                    keyMap[lviToActionMap[selectedLVI]].keySequence=newKeySequence;
00528                                    userDef->setChecked(true);
00529                             }
00530                             setKeyButton->setOn(false);
00531                             releaseKeyboard();
00532               }
00533        }
00534        if (setKeyButton->isOn())
00535               keyDisplay->setText(Part0+Part1+Part2+Part3+Part4);
00536 }
00537 
00538 void TabKeyboardShortcutsWidget::keyReleaseEvent(QKeyEvent *k)
00539 {
00540        if (setKeyButton->isOn())
00541        {
00542               if (!keyDisplay->text().isEmpty())
00543               {
00544                      QStringList tl;
00545                      tl = tl.split("+", keyDisplay->text());
00546                      Part4 = tl[tl.count()-1];
00547                      if (Part4 == tr("Alt") || Part4 == tr("Ctrl") || Part4 == tr("Shift") || Part4 == tr("Meta"))
00548                             Part4 = "";
00549               }
00550               else
00551                      Part4 = "";
00552               if (k->key() == Qt::Key_Meta)
00553               {
00554                      Part0 = "";
00555                      keyCode &= ~Qt::META;
00556               }
00557               if (k->key() == Qt::Key_Shift)
00558               {
00559                      Part3 = "";
00560                      keyCode &= ~Qt::SHIFT;
00561               }
00562               if (k->key() == Qt::Key_Alt)
00563               {
00564                      Part2 = "";
00565                      keyCode &= ~ALT;
00566               }
00567               if (k->key() == Qt::Key_Control)
00568               {
00569                      Part1 = "";
00570                      keyCode &= ~Qt::CTRL;
00571               }
00572               keyDisplay->setText(Part0+Part1+Part2+Part3+Part4);
00573        }
00574 }
00575 
00576 bool TabKeyboardShortcutsWidget::checkKey(int code)
00577 {
00578        bool ret = false;
00579        QKeySequence key = QKeySequence(code);
00580        for (QMap<QString,Keys>::Iterator it=keyMap.begin(); it!=keyMap.end(); ++it)
00581        {
00582               if (key.matches(it.data().keySequence) != Qt::NoMatch)
00583               {
00584                      ret = true;
00585                      break;
00586               }
00587        }
00588        return ret;
00589 }
00590 
00591 void TabKeyboardShortcutsWidget::clearSearchString( )
00592 {
00593        searchTextLineEdit->clear();
00594 }