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) (unidiff)
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
@@ -56,12 +56,13 @@
56#include <qapplication.h> 56#include <qapplication.h>
57#endif 57#endif
58 58
59KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) : 59KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) :
60 QObject( parent, name) 60 QObject( parent, name)
61{ 61{
62 mNextFocus = 0;
62} 63}
63 64
64KOEditorGeneral::~KOEditorGeneral() 65KOEditorGeneral::~KOEditorGeneral()
65{ 66{
66} 67}
67 68
@@ -102,21 +103,25 @@ void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout)
102 connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); 103 connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) );
103 headerLayout->addWidget(mLocationEdit,2,1); 104 headerLayout->addWidget(mLocationEdit,2,1);
104 headerLayout->setColStretch( 1, 10); 105 headerLayout->setColStretch( 1, 10);
105} 106}
106void KOEditorGeneral::setFocusOn( int i ) 107void KOEditorGeneral::setFocusOn( int i )
107{ 108{
108 qApp->processEvents(); 109 mNextFocus = i;
109 if ( i == 1 ) { 110 QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() ));
111}
112void KOEditorGeneral::slotSetFocusOn()
113{
114 mNextFocus;
115 if ( mNextFocus == 1 ) {
110 mDescriptionEdit->setFocus(); 116 mDescriptionEdit->setFocus();
111 mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); 117 mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333);
112 } 118 }
113 if ( i == 2 ) { 119 if ( mNextFocus == 2 ) {
114 mSummaryEdit->setFocus(); 120 mSummaryEdit->setFocus();
115 } 121 }
116
117} 122}
118void KOEditorGeneral::editCategories() 123void KOEditorGeneral::editCategories()
119{ 124{
120 // qDebug("KOEditorGeneral::editCategories() "); 125 // qDebug("KOEditorGeneral::editCategories() ");
121 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); 126 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 );
122 connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &))); 127 connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &)));