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

List:       kde-core-devel
Subject:    Fwd: listview search line in kkeydialog
From:       Cristian Tibirna <tibirna () kde ! org>
Date:       2004-05-13 1:04:29
Message-ID: 200405122104.29490.tibirna () kde ! org
[Download RAW message or body]

Hello

I had this message sent to Ellis a week ago. Since no answer, I take the 
liberty to forward it here. Please advise.

Cristian

----------  Forwarded Message  ----------

Subject: listview search line in kkeydialog
Date: Tuesday 04 May 2004 22:11
From: Cristian Tibirna <tibirna@kde.org>
To: ellis@kde.org

Hello Ellis

Long time, no "hear".

Do you agree with this patch to the kkeydialog? It adds a searchline for the
keyb shortcuts listview that makes much easier to find a given shortcut (by
name or by key combination)

Thanks a lot for your attention.

--
Cristian Tibirna
KDE developer .. tibirna@kde.org .. http://www.kde.org

-------------------------------------------------------



-- 
Cristian Tibirna
KDE developer .. tibirna@kde.org .. http://www.kde.org

["kkeydialog-add-listviewsearchline.patch" (text/x-diff)]

Index: kkeydialog.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kkeydialog.cpp,v
retrieving revision 1.157
diff -u -b -t -p -r1.157 kkeydialog.cpp
--- kkeydialog.cpp	30 Mar 2004 12:03:22 -0000	1.157
+++ kkeydialog.cpp	5 May 2004 02:07:43 -0000
@@ -32,6 +32,7 @@
 #include <qpainter.h>
 #include <qradiobutton.h>
 #include <qregexp.h>
+#include <qtoolbutton.h>
 #include <qwhatsthis.h>
 
 #include <kaccel.h>
@@ -43,6 +44,8 @@
 #include <kdebug.h>
 #include <kglobal.h>
 #include <kglobalaccel.h>
+#include <kiconloader.h>
+#include <klistviewsearchline.h>
 #include <klocale.h>
 #include <kmessagebox.h>
 #include <kshortcut.h>
@@ -291,19 +294,37 @@ void KKeyChooser::initGUI( ActionType ty
 
   QBoxLayout *topLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() );
 
-  QGridLayout *stackLayout = new QGridLayout(2, 2, 2);
-  topLayout->addLayout( stackLayout, 10 );
-  stackLayout->setRowStretch( 1, 10 ); // Only list will stretch
+  // ADD SEARCHLINE
+  //
+  QHBoxLayout* searchLayout = new QHBoxLayout(this, 0, KDialog::spacingHint());
+  topLayout->addLayout(searchLayout, 10);
+
+  QToolButton *clearSearch = new QToolButton(this);
+  clearSearch->setTextLabel(i18n("Clear Search"), true);
+  clearSearch->setIconSet(SmallIconSet("locationbar_erase"));
+  searchLayout->addWidget(clearSearch);
+  searchLayout->addWidget(new QLabel(i18n("Search"), this));
+  KListViewSearchLine* listViewSearch = new KListViewSearchLine(this);
+  searchLayout->addWidget(listViewSearch);
+
+  connect(clearSearch, SIGNAL(pressed()), listViewSearch, SLOT(clear()));
+
 
   //
   // CREATE SPLIT LIST BOX
   //
   // fill up the split list box with the action/key pairs.
   //
+  QGridLayout *stackLayout = new QGridLayout(2, 2, 2);
+  topLayout->addLayout( stackLayout, 10 );
+  stackLayout->setRowStretch( 1, 10 ); // Only list will stretch
+
   d->pList = new KListView( this );
   d->pList->setFocus();
+  listViewSearch->setListView(d->pList); // Plug into search line
 
   stackLayout->addMultiCellWidget( d->pList, 1, 1, 0, 1 );
+
   QString wtstr = i18n("Here you can see a list of key bindings, "
                        "i.e. associations between actions (e.g. 'Copy') "
                        "shown in the left column and keys or combination "


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

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