summaryrefslogtreecommitdiffabout
path: root/korganizer/koeditorgeneral.cpp
authorzautrix <zautrix>2005-04-06 09:41:54 (UTC)
committer zautrix <zautrix>2005-04-06 09:41:54 (UTC)
commit03c5656deeec67eefcefb4faa1bfc9a9bc3254ef (patch) (side-by-side diff)
treeb514080a9b5256373967602d3a0ec41c68a70126 /korganizer/koeditorgeneral.cpp
parentcf4848d972efe96640f2d5f5d52704306d0cbe4c (diff)
downloadkdepimpi-03c5656deeec67eefcefb4faa1bfc9a9bc3254ef.zip
kdepimpi-03c5656deeec67eefcefb4faa1bfc9a9bc3254ef.tar.gz
kdepimpi-03c5656deeec67eefcefb4faa1bfc9a9bc3254ef.tar.bz2
focus fix
Diffstat (limited to 'korganizer/koeditorgeneral.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeditorgeneral.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index abc80d4..f54660f 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -50,24 +50,25 @@
#include "koeditorgeneral.h"
#include "kolocationbox.h"
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#else
#include <qapplication.h>
#endif
KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) :
QObject( parent, name)
{
+ mNextFocus = 0;
}
KOEditorGeneral::~KOEditorGeneral()
{
}
void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout)
{
QGridLayout *headerLayout = new QGridLayout(topLayout);
#if 0
mOwnerLabel = new QLabel(i18n("Owner:"),parent);
@@ -96,33 +97,37 @@ void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout)
mLocationEdit = new KOLocationBox(TRUE,parent,10);
mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
if ( QApplication::desktop()->width() > 320 )
mLocationEdit->setMaximumHeight( hei + 6);
// mLocationEdit = new QLineEdit(parent);
connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) );
headerLayout->addWidget(mLocationEdit,2,1);
headerLayout->setColStretch( 1, 10);
}
void KOEditorGeneral::setFocusOn( int i )
{
- qApp->processEvents();
- if ( i == 1 ) {
+ mNextFocus = i;
+ QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() ));
+}
+void KOEditorGeneral::slotSetFocusOn()
+{
+ mNextFocus;
+ if ( mNextFocus == 1 ) {
mDescriptionEdit->setFocus();
mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333);
}
- if ( i == 2 ) {
+ if ( mNextFocus == 2 ) {
mSummaryEdit->setFocus();
}
-
}
void KOEditorGeneral::editCategories()
{
// qDebug("KOEditorGeneral::editCategories() ");
KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 );
connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &)));
//KOGlobals::fitDialogToScreen( csd );
csd->setColorEnabled();
csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) );
csd->exec();
delete csd;
}