-rw-r--r-- | korganizer/koeditorgeneral.cpp | 13 | ||||
-rw-r--r-- | korganizer/koeditorgeneral.h | 3 | ||||
-rw-r--r-- | korganizer/koeventeditor.cpp | 1 |
3 files changed, 11 insertions, 6 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 | ||
59 | KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) : | 59 | KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) : |
60 | QObject( parent, name) | 60 | QObject( parent, name) |
61 | { | 61 | { |
62 | mNextFocus = 0; | ||
62 | } | 63 | } |
63 | 64 | ||
64 | KOEditorGeneral::~KOEditorGeneral() | 65 | KOEditorGeneral::~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 | } |
106 | void KOEditorGeneral::setFocusOn( int i ) | 107 | void KOEditorGeneral::setFocusOn( int i ) |
107 | { | 108 | { |
108 | qApp->processEvents(); | 109 | mNextFocus = i; |
109 | if ( i == 1 ) { | 110 | QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() )); |
111 | } | ||
112 | void 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 | } |
118 | void KOEditorGeneral::editCategories() | 123 | void 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 &))); |
diff --git a/korganizer/koeditorgeneral.h b/korganizer/koeditorgeneral.h index f4728c7..2069e9c 100644 --- a/korganizer/koeditorgeneral.h +++ b/korganizer/koeditorgeneral.h | |||
@@ -78,18 +78,19 @@ class KOEditorGeneral : public QObject | |||
78 | protected slots: | 78 | protected slots: |
79 | void enableAlarmEdit( bool enable ); | 79 | void enableAlarmEdit( bool enable ); |
80 | void disableAlarmEdit( bool disable ); | 80 | void disableAlarmEdit( bool disable ); |
81 | void alarmDisable( bool disable ); | 81 | void alarmDisable( bool disable ); |
82 | void pickAlarmSound(); | 82 | void pickAlarmSound(); |
83 | void pickAlarmProgram(); | 83 | void pickAlarmProgram(); |
84 | 84 | void slotSetFocusOn(); | |
85 | signals: | 85 | signals: |
86 | void openCategoryDialog(); | 86 | void openCategoryDialog(); |
87 | void allAccepted(); | 87 | void allAccepted(); |
88 | 88 | ||
89 | protected: | 89 | protected: |
90 | int mNextFocus; | ||
90 | //QLineEdit *mSummaryEdit; | 91 | //QLineEdit *mSummaryEdit; |
91 | //QLineEdit *mLocationEdit; | 92 | //QLineEdit *mLocationEdit; |
92 | KOLocationBox *mSummaryEdit; | 93 | KOLocationBox *mSummaryEdit; |
93 | KOLocationBox *mLocationEdit; | 94 | KOLocationBox *mLocationEdit; |
94 | QLabel *mAlarmBell; | 95 | QLabel *mAlarmBell; |
95 | QCheckBox *mAlarmButton; | 96 | QCheckBox *mAlarmButton; |
diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp index 337db9b..e23e680 100644 --- a/korganizer/koeventeditor.cpp +++ b/korganizer/koeventeditor.cpp | |||
@@ -183,13 +183,12 @@ void KOEventEditor::setupRecurrence() | |||
183 | void KOEventEditor::editEvent(Event *event, bool showDescription) | 183 | void KOEventEditor::editEvent(Event *event, bool showDescription) |
184 | { | 184 | { |
185 | // init(); | 185 | // init(); |
186 | 186 | ||
187 | mEvent = event; | 187 | mEvent = event; |
188 | readEvent(mEvent); | 188 | readEvent(mEvent); |
189 | qApp->processEvents(); | ||
190 | if ( showDescription ) { | 189 | if ( showDescription ) { |
191 | showPage( 1 ); | 190 | showPage( 1 ); |
192 | mGeneral->setFocusOn( 1 ); | 191 | mGeneral->setFocusOn( 1 ); |
193 | } else { | 192 | } else { |
194 | showPage( 0 ); | 193 | showPage( 0 ); |
195 | mGeneral->setFocusOn( 2 ); | 194 | mGeneral->setFocusOn( 2 ); |