summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/incsearchwidget.cpp7
-rw-r--r--kaddressbook/kabcore.cpp1
2 files changed, 6 insertions, 2 deletions
diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp
index b1ffe04..5f8b83d 100644
--- a/kaddressbook/incsearchwidget.cpp
+++ b/kaddressbook/incsearchwidget.cpp
@@ -89,67 +89,70 @@ IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name )
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()
{
emit doSearch( mSearchText->text() );
// qDebug("emit dosreach ");
}
void IncSearchWidget::announceFieldChanged()
{
emit fieldChanged();
}
void IncSearchWidget::setSize()
{
if ( KABPrefs::instance()->mHideSearchOnSwitch && QApplication::desktop()->width() == 480) {
- mFieldCombo->setMaximumWidth( 40 );
- mSearchText->setMaximumWidth( 30 );
+ setCurrentItem( 0 );
+ //mFieldCombo->setMaximumWidth( 0 );
+ mFieldCombo->hide();
+ mSearchText->setMaximumWidth( 200 );
} else {
+ mFieldCombo->show();
QFontMetrics fm ( mFieldCombo->font() );
int wid = fm.width(i18n( "All Fields" ) );
#ifdef DESKTOP_VERSION
mFieldCombo->setMinimumWidth( wid+60 );
wid = wid * 2;
#endif
mFieldCombo->setMaximumWidth( wid+60 );
mSearchText->setMaximumWidth( 1024 );
}
}
void IncSearchWidget::setFields( const KABC::Field::List &list )
{
mFieldCombo->clear();
mFieldCombo->insertItem( i18n( "All Fields" ) );
KABC::Field::List::ConstIterator it;
for ( it = list.begin(); it != list.end(); ++it ) {
mFieldCombo->insertItem( (*it)->label() );
}
mFieldList = list;
announceDoSearch();
announceFieldChanged();
setSize();
}
KABC::Field::List IncSearchWidget::fields() const
{
return mFieldList;
}
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 046cb63..b4e0b07 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -799,64 +799,65 @@ void KABCore::mailVCard( const QStringList& uids )
*/
}
/**
Beams the "WhoAmI contact.
*/
void KABCore::beamMySelf()
{
KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI();
if (!a.isEmpty())
{
QStringList uids;
uids << a.uid();
beamVCard(uids);
} else {
KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) );
}
}
void KABCore::updateMainWindow()
{
mMainWindow->showMaximized();
mMainWindow->update();
}
void KABCore::resizeEvent(QResizeEvent* e )
{
if ( !mMiniSplitter )
return;
//qDebug("KABCore::resizeEvent(QResizeEvent* e ) ");
+ if ( e->oldSize().width() != e->size().width() )
if ( QApplication::desktop()->width() >= 480 ) {
if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480
if ( mMiniSplitter->orientation() == Qt::Vertical ) {
mMiniSplitter->setOrientation( Qt::Horizontal);
mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
}
if ( QApplication::desktop()->width() <= 640 ) {
mMainWindow->showMinimized();
//mMainWindow->setMaximumSize( QApplication::desktop()->size() );
mViewManager->getFilterAction()->setComboWidth( 150 );
if ( mIncSearchWidget )
mIncSearchWidget->setSize();
QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
}
} else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640
if ( mMiniSplitter->orientation() == Qt::Horizontal ) {
mMiniSplitter->setOrientation( Qt::Vertical );
mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
}
if ( QApplication::desktop()->width() <= 640 ) {
//mMainWindow->setMaximumSize( QApplication::desktop()->size() );
mMainWindow->showMinimized();
if ( KABPrefs::instance()->mHideSearchOnSwitch ) {
if ( mIncSearchWidget ) {
mIncSearchWidget->setSize();
}
} else {
mViewManager->getFilterAction()->setComboWidth( 0 );
}
QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
}