summaryrefslogtreecommitdiffabout
path: root/kaddressbook/incsearchwidget.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/incsearchwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/incsearchwidget.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp
index 78eaf65..dd2121a 100644
--- a/kaddressbook/incsearchwidget.cpp
+++ b/kaddressbook/incsearchwidget.cpp
@@ -11,96 +11,97 @@
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qlabel.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qcombobox.h>
#include <kdialog.h>
#include <klineedit.h>
#include <klocale.h>
#include <kglobal.h>
#include <kglobal.h>
#include "kabprefs.h"
#include "incsearchwidget.h"
IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name )
: QWidget( parent, name )
{
#ifndef KAB_EMBEDDED
//US setCaption( i18n( "Incremental Search" ) );
#endif //KAB_EMBEDDED
QHBoxLayout *layout = new QHBoxLayout( this, 2, KDialog::spacingHint() );
#ifdef DESKTOP_VERSION
QLabel *label = new QLabel( i18n( "Search:" ), this );
label->setAlignment( QLabel::AlignVCenter | QLabel::AlignRight );
layout->addWidget( label );
#endif //KAB_EMBEDDED
mSearchText = new KLineEdit( this );
layout->addWidget( mSearchText );
// #ifdef KAB_EMBEDDED
// if (KGlobal::getOrientation() == KGlobal::Portrait)
// mSearchText->setMaximumWidth(30);
// #endif //KAB_EMBEDDED
+ //mSearchText->setMaximumWidth(60);
mFieldCombo = new QComboBox( false, this );
layout->addWidget( mFieldCombo );
mFieldCombo->setMaximumHeight( 34 );
QToolTip::add( mFieldCombo, i18n( "Select Incremental Search Field" ) );
// #ifndef KAB_EMBEDDED
// resize( QSize(420, 50).expandedTo( sizeHint() ) );
// #else //KAB_EMBEDDED
// resize( QSize(30, 10).expandedTo( sizeHint() ) );
// #endif //KAB_EMBEDDED
// for performance reasons, we do a search on the pda only after return is pressed
connect( mSearchText, SIGNAL( textChanged( const QString& ) ),
SLOT( announceDoSearch2() ) );
connect( mFieldCombo, SIGNAL( activated( const QString& ) ),
SLOT( announceDoSearch2() ) );
connect( mSearchText, SIGNAL( returnPressed() ),
SLOT( announceDoSearch() ) );
connect( mFieldCombo, SIGNAL( activated( const QString& ) ),
SLOT( announceFieldChanged() ) );
connect( mSearchText, SIGNAL( scrollUP() ), this, SIGNAL( scrollUP() ));
connect( mSearchText, SIGNAL( scrollDOWN() ), this, SIGNAL( scrollDOWN() ));
setFocusProxy( mSearchText );
}
IncSearchWidget::~IncSearchWidget()
{
}
void IncSearchWidget::announceDoSearch2()
{
if ( KABPrefs::instance()->mSearchWithReturn )
return;
emit doSearch( mSearchText->text() );
//qDebug("emit dosreach ");
}
void IncSearchWidget::announceDoSearch()
{