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

List:       kde-commits
Subject:    KDE/kdeadmin/ksystemlog/src/lib
From:       Laurent Montel <montel () kde ! org>
Date:       2009-03-19 13:05:07
Message-ID: 1237467907.574305.32145.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 941306 by mlaurent:

disable/enable next/previous button when text is not empty


 M  +10 -2     logViewSearchWidget.cpp  
 M  +2 -1      logViewSearchWidget.h  


--- trunk/KDE/kdeadmin/ksystemlog/src/lib/logViewSearchWidget.cpp #941305:941306
@@ -79,7 +79,7 @@
 	
 	searchLabel->setBuddy(searchLine);
 	
-	connect(searchLine, SIGNAL(textEdited(const QString&)), this, SLOT(findFirst()));
+	connect(searchLine, SIGNAL(textEdited(const QString&)), this, SLOT(findFirst(const QString &)));
 	connect(searchLine, SIGNAL(textEdited(const QString&)), this, SLOT(highlightAll()));
 	
 	connect(searchLine, SIGNAL(returnPressed()), this, SLOT(findNext()));
@@ -89,8 +89,8 @@
 	connect(caseSensitive, SIGNAL(clicked()), this, SLOT(highlightAll()));
 	connect(highlightAllButton, SIGNAL(clicked()), this, SLOT(highlightAll()));
 	
+        findFirst(searchLine->text());	
 	
-	
 }
 
 LogViewSearchWidget::~LogViewSearchWidget() {
@@ -110,6 +110,14 @@
 	d->logViewWidget = logViewWidget;
 }
 
+void LogViewSearchWidget::findFirst(const QString & text) {
+        bool textIsNotEmpty = !text.isEmpty();
+ 	next->setEnabled(textIsNotEmpty);
+        previous->setEnabled(textIsNotEmpty);
+        if(textIsNotEmpty)
+		findFirst();
+}
+
 void LogViewSearchWidget::findFirst() {
 	internalFind(NULL, LogViewSearchWidget::Next);
 }
--- trunk/KDE/kdeadmin/ksystemlog/src/lib/logViewSearchWidget.h #941305:941306
@@ -47,7 +47,8 @@
 	void displaySearch();
 	
 	void findFirst();
-	
+        
+        void findFirst(const QString &);	
 	void findNext();
 	void findPrevious();
 	
[prev in list] [next in list] [prev in thread] [next in thread] 

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