summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-04-06 09:41:54 (UTC)
committer zautrix <zautrix>2005-04-06 09:41:54 (UTC)
commit03c5656deeec67eefcefb4faa1bfc9a9bc3254ef (patch) (unidiff)
treeb514080a9b5256373967602d3a0ec41c68a70126
parentcf4848d972efe96640f2d5f5d52704306d0cbe4c (diff)
downloadkdepimpi-03c5656deeec67eefcefb4faa1bfc9a9bc3254ef.zip
kdepimpi-03c5656deeec67eefcefb4faa1bfc9a9bc3254ef.tar.gz
kdepimpi-03c5656deeec67eefcefb4faa1bfc9a9bc3254ef.tar.bz2
focus fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt4
-rw-r--r--korganizer/koeditorgeneral.cpp13
-rw-r--r--korganizer/koeditorgeneral.h3
-rw-r--r--korganizer/koeventeditor.cpp1
4 files changed, 15 insertions, 6 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 524f6fc..c598214 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,50 +1,54 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 2.0.25 ************
4
5And again fixed some bugs.
6
3********** VERSION 2.0.24 ************ 7********** VERSION 2.0.24 ************
4 8
5Fixed again a lot of small bugs. 9Fixed again a lot of small bugs.
6Some performance optimizations in date navigator. 10Some performance optimizations in date navigator.
7Month view displays now multi days events on top of each cell, such that it is more likely that all multi days items of one event are in the same row. 11Month view displays now multi days events on top of each cell, such that it is more likely that all multi days items of one event are in the same row.
8 12
9********** VERSION 2.0.23 ************ 13********** VERSION 2.0.23 ************
10 14
11Fixed again a lot of small and strange bugs, e.g. the missing toolbar of KA/Pi after a new installation. 15Fixed again a lot of small and strange bugs, e.g. the missing toolbar of KA/Pi after a new installation.
12Fixed the (agenda) layout of KO/Pi on 5500er. 16Fixed the (agenda) layout of KO/Pi on 5500er.
13Some usebility enhancements (e.g. reselection the current item of the todo view after some changes). 17Some usebility enhancements (e.g. reselection the current item of the todo view after some changes).
14 18
15********** VERSION 2.0.22 ************ 19********** VERSION 2.0.22 ************
16 20
17KO/Pi: 21KO/Pi:
18Fix for creating events/todos via the abgenda context menu. 22Fix for creating events/todos via the abgenda context menu.
19Added option to split toolbar to 3 toolbars. 23Added option to split toolbar to 3 toolbars.
20(Toolbar moving s disabled for this option due to a bug in Qt somewhere). 24(Toolbar moving s disabled for this option due to a bug in Qt somewhere).
21Added option to show one small filter-view-toolbar. 25Added option to show one small filter-view-toolbar.
22Added a print option to the desktop version: 26Added a print option to the desktop version:
23Now you can print out the view of the "Event Viewer". 27Now you can print out the view of the "Event Viewer".
24That means you can print all data of one particular event/todo. 28That means you can print all data of one particular event/todo.
25Added scaling options to printout of Event Viewer and What'sNext View. 29Added scaling options to printout of Event Viewer and What'sNext View.
26Fixed some problems in the month view in "week start sunday" mode. 30Fixed some problems in the month view in "week start sunday" mode.
27KA/Pi: 31KA/Pi:
28Added two more config options. 32Added two more config options.
29Fixed resizing problem of address request dialog when orientation was switched. 33Fixed resizing problem of address request dialog when orientation was switched.
30Cleaned up the menu structure. 34Cleaned up the menu structure.
31Fixed some more problems. 35Fixed some more problems.
32 36
33Fixed the annoying problem that scrolling continued after the key was released in KO/Pi Monthview and the KA/Pi views. 37Fixed the annoying problem that scrolling continued after the key was released in KO/Pi Monthview and the KA/Pi views.
34 38
35And, this is a really cool option (Ben did suggest it): 39And, this is a really cool option (Ben did suggest it):
36Now KO/Pi and KA/Pi can be run from a USB stick: 40Now KO/Pi and KA/Pi can be run from a USB stick:
37All data is read from and written to the stick. 41All data is read from and written to the stick.
38You can enable this in the global configure option TAB with: 42You can enable this in the global configure option TAB with:
39Save using LOCAL storage. 43Save using LOCAL storage.
40Just put KDE-Pim/Pi on a memory stick and you can access all your PIM data on every computer with Windows XP. It will work with the ME and Linux versions as well. I will put a memory stick version for teh next stable release online. 44Just put KDE-Pim/Pi on a memory stick and you can access all your PIM data on every computer with Windows XP. It will work with the ME and Linux versions as well. I will put a memory stick version for teh next stable release online.
41 45
42********** VERSION 2.0.21 ************ 46********** VERSION 2.0.21 ************
43 47
44Fixed another SMTP problem in OM/Pi. 48Fixed another SMTP problem in OM/Pi.
45Some small changed in the new datenavigator in KO/Pi. 49Some small changed in the new datenavigator in KO/Pi.
46Changed default setting for new filter in KA/Pi to "exclude categories". 50Changed default setting for new filter in KA/Pi to "exclude categories".
47Changed the default font size for 640x480 display . 51Changed the default font size for 640x480 display .
48Changed popup menu behaviour in agenda and list view. 52Changed popup menu behaviour in agenda and list view.
49Fixed some layout problems of the date label size in the month view. 53Fixed some layout problems of the date label size in the month view.
50Made month view update faster. 54Made month view update faster.
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index abc80d4..f54660f 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -14,151 +14,156 @@
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qwidget.h> 24#include <qwidget.h>
25#include <qtooltip.h> 25#include <qtooltip.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qvbox.h> 27#include <qvbox.h>
28#include <qbuttongroup.h> 28#include <qbuttongroup.h>
29#include <qvgroupbox.h> 29#include <qvgroupbox.h>
30#include <qwidgetstack.h> 30#include <qwidgetstack.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qfile.h> 32#include <qfile.h>
33 33
34 34
35#include <kglobal.h> 35#include <kglobal.h>
36#include <kdebug.h> 36#include <kdebug.h>
37#include <klocale.h> 37#include <klocale.h>
38#include <kiconloader.h> 38#include <kiconloader.h>
39#include <kmessagebox.h> 39#include <kmessagebox.h>
40#include <kfiledialog.h> 40#include <kfiledialog.h>
41#include <kstandarddirs.h> 41#include <kstandarddirs.h>
42 42
43#include <libkcal/todo.h> 43#include <libkcal/todo.h>
44#include <libkcal/event.h> 44#include <libkcal/event.h>
45#include <libkdepim/categoryselectdialog.h> 45#include <libkdepim/categoryselectdialog.h>
46#include <libkdepim/kdateedit.h> 46#include <libkdepim/kdateedit.h>
47 47
48#include "koprefs.h" 48#include "koprefs.h"
49#include "koglobals.h" 49#include "koglobals.h"
50 50
51#include "koeditorgeneral.h" 51#include "koeditorgeneral.h"
52#include "kolocationbox.h" 52#include "kolocationbox.h"
53#ifndef DESKTOP_VERSION 53#ifndef DESKTOP_VERSION
54#include <qpe/qpeapplication.h> 54#include <qpe/qpeapplication.h>
55#else 55#else
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
68void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) 69void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout)
69{ 70{
70 QGridLayout *headerLayout = new QGridLayout(topLayout); 71 QGridLayout *headerLayout = new QGridLayout(topLayout);
71 72
72#if 0 73#if 0
73 mOwnerLabel = new QLabel(i18n("Owner:"),parent); 74 mOwnerLabel = new QLabel(i18n("Owner:"),parent);
74 headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1); 75 headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1);
75#endif 76#endif
76 77
77 QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent); 78 QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent);
78 headerLayout->addWidget(summaryLabel,1,0); 79 headerLayout->addWidget(summaryLabel,1,0);
79 80
80 mSummaryEdit = new KOLocationBox(TRUE,parent, 10); 81 mSummaryEdit = new KOLocationBox(TRUE,parent, 10);
81 mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); 82 mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
82 //mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) ); 83 //mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) );
83 //qDebug("h %d %d ", summaryLabel->sizeHint().height(),mSummaryEdit->sizeHint().height() ); 84 //qDebug("h %d %d ", summaryLabel->sizeHint().height(),mSummaryEdit->sizeHint().height() );
84 int hei = (summaryLabel->sizeHint().height() + mSummaryEdit->sizeHint().height())/2; 85 int hei = (summaryLabel->sizeHint().height() + mSummaryEdit->sizeHint().height())/2;
85 if ( QApplication::desktop()->width() > 320 ) 86 if ( QApplication::desktop()->width() > 320 )
86 mSummaryEdit->setMaximumHeight( hei +6 ); 87 mSummaryEdit->setMaximumHeight( hei +6 );
87 //qDebug("%d %d %d %d %d %d ", QSizePolicy::Fixed , QSizePolicy::Minimum , QSizePolicy:: Maximum , QSizePolicy:: Preferred , QSizePolicy:: MinimumExpanding , QSizePolicy::Expanding ); 88 //qDebug("%d %d %d %d %d %d ", QSizePolicy::Fixed , QSizePolicy::Minimum , QSizePolicy:: Maximum , QSizePolicy:: Preferred , QSizePolicy:: MinimumExpanding , QSizePolicy::Expanding );
88 // SizeType { Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow|MayShrink, MinimumExpanding = Minimum|ExpMask, Expanding = MinimumExpanding|MayShrink } 89 // SizeType { Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow|MayShrink, MinimumExpanding = Minimum|ExpMask, Expanding = MinimumExpanding|MayShrink }
89 // mSummaryEdit = new QLineEdit(parent); 90 // mSummaryEdit = new QLineEdit(parent);
90 headerLayout->addWidget(mSummaryEdit,1,1); 91 headerLayout->addWidget(mSummaryEdit,1,1);
91 connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); 92 connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) );
92 93
93 QLabel *locationLabel = new QLabel(i18n("Location:"),parent); 94 QLabel *locationLabel = new QLabel(i18n("Location:"),parent);
94 headerLayout->addWidget(locationLabel,2,0); 95 headerLayout->addWidget(locationLabel,2,0);
95 96
96 mLocationEdit = new KOLocationBox(TRUE,parent,10); 97 mLocationEdit = new KOLocationBox(TRUE,parent,10);
97 mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); 98 mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
98 if ( QApplication::desktop()->width() > 320 ) 99 if ( QApplication::desktop()->width() > 320 )
99 mLocationEdit->setMaximumHeight( hei + 6); 100 mLocationEdit->setMaximumHeight( hei + 6);
100 101
101 // mLocationEdit = new QLineEdit(parent); 102 // mLocationEdit = new QLineEdit(parent);
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 &)));
123 //KOGlobals::fitDialogToScreen( csd ); 128 //KOGlobals::fitDialogToScreen( csd );
124 csd->setColorEnabled(); 129 csd->setColorEnabled();
125 csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) ); 130 csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) );
126 csd->exec(); 131 csd->exec();
127 delete csd; 132 delete csd;
128} 133}
129void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) 134void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout)
130{ 135{
131 QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout ); 136 QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout );
132 137
133 mCategoriesButton = new QPushButton(parent); 138 mCategoriesButton = new QPushButton(parent);
134 mCategoriesButton->setText(i18n("Categories...")); 139 mCategoriesButton->setText(i18n("Categories..."));
135 connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); 140 connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() ));
136 categoriesLayout->addWidget(mCategoriesButton); 141 categoriesLayout->addWidget(mCategoriesButton);
137 142
138 mCategoriesLabel = new QLabel(parent); 143 mCategoriesLabel = new QLabel(parent);
139 mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); 144 mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken);
140 categoriesLayout->addWidget(mCategoriesLabel,1); 145 categoriesLayout->addWidget(mCategoriesLabel,1);
141} 146}
142 147
143void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) 148void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout)
144{ 149{
145 QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); 150 QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout );
146 151
147 QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); 152 QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent);
148 mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); 153 mCancelBox = new QCheckBox ( i18n("Cancelled"), parent);
149 secrecyLayout->addWidget(mCancelBox); 154 secrecyLayout->addWidget(mCancelBox);
150 secrecyLayout->addWidget(secrecyLabel); 155 secrecyLayout->addWidget(secrecyLabel);
151 156
152 mSecrecyCombo = new QComboBox(parent); 157 mSecrecyCombo = new QComboBox(parent);
153 mSecrecyCombo->insertStringList(Incidence::secrecyList()); 158 mSecrecyCombo->insertStringList(Incidence::secrecyList());
154 secrecyLayout->addWidget(mSecrecyCombo); 159 secrecyLayout->addWidget(mSecrecyCombo);
155} 160}
156 161
157void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) 162void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout)
158{ 163{
159 mDescriptionEdit = new KTextEdit(parent); 164 mDescriptionEdit = new KTextEdit(parent);
160 mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont ); 165 mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont );
161 mDescriptionEdit->append(""); 166 mDescriptionEdit->append("");
162 mDescriptionEdit->setReadOnly(false); 167 mDescriptionEdit->setReadOnly(false);
163 mDescriptionEdit->setOverwriteMode(false); 168 mDescriptionEdit->setOverwriteMode(false);
164 mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth ); 169 mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth );
diff --git a/korganizer/koeditorgeneral.h b/korganizer/koeditorgeneral.h
index f4728c7..2069e9c 100644
--- a/korganizer/koeditorgeneral.h
+++ b/korganizer/koeditorgeneral.h
@@ -36,79 +36,80 @@
36#include <qspinbox.h> 36#include <qspinbox.h>
37 37
38#include <ktextedit.h> 38#include <ktextedit.h>
39#include <krestrictedline.h> 39#include <krestrictedline.h>
40 40
41#include <libkcal/incidence.h> 41#include <libkcal/incidence.h>
42 42
43#include "ktimeedit.h" 43#include "ktimeedit.h"
44 44
45class KDateEdit; 45class KDateEdit;
46class KOLocationBox; 46class KOLocationBox;
47using namespace KCal; 47using namespace KCal;
48 48
49class KOEditorGeneral : public QObject 49class KOEditorGeneral : public QObject
50{ 50{
51 Q_OBJECT 51 Q_OBJECT
52 public: 52 public:
53 KOEditorGeneral (QObject* parent=0,const char* name=0); 53 KOEditorGeneral (QObject* parent=0,const char* name=0);
54 virtual ~KOEditorGeneral(); 54 virtual ~KOEditorGeneral();
55 void setFocusOn( int i ); 55 void setFocusOn( int i );
56 void initHeader(QWidget *,QBoxLayout *); 56 void initHeader(QWidget *,QBoxLayout *);
57 void initDescription(QWidget *,QBoxLayout *); 57 void initDescription(QWidget *,QBoxLayout *);
58 void initSecrecy(QWidget *,QBoxLayout *); 58 void initSecrecy(QWidget *,QBoxLayout *);
59 void initCategories(QWidget *,QBoxLayout *); 59 void initCategories(QWidget *,QBoxLayout *);
60 void initAlarm(QWidget *,QBoxLayout *); 60 void initAlarm(QWidget *,QBoxLayout *);
61 61
62 /** Set widgets to default values */ 62 /** Set widgets to default values */
63 void setDefaults(bool allDay); 63 void setDefaults(bool allDay);
64 /** Read event object and setup widgets accordingly */ 64 /** Read event object and setup widgets accordingly */
65 void readIncidence(Incidence *); 65 void readIncidence(Incidence *);
66 /** Write event settings to event object */ 66 /** Write event settings to event object */
67 void writeIncidence(Incidence *); 67 void writeIncidence(Incidence *);
68 68
69 /** Check if the input is valid. */ 69 /** Check if the input is valid. */
70 bool validateInput() { return true; } 70 bool validateInput() { return true; }
71 71
72 void enableAlarm( bool enable ); 72 void enableAlarm( bool enable );
73 void setSecrecy( int num ); 73 void setSecrecy( int num );
74 public slots: 74 public slots:
75 void setCategories(const QString &); 75 void setCategories(const QString &);
76 void editCategories(); 76 void editCategories();
77 77
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;
96 QSpinBox *mAlarmTimeEdit; 97 QSpinBox *mAlarmTimeEdit;
97 QPushButton *mAlarmSoundButton; 98 QPushButton *mAlarmSoundButton;
98 QPushButton *mAlarmProgramButton; 99 QPushButton *mAlarmProgramButton;
99 QComboBox *mAlarmIncrCombo; 100 QComboBox *mAlarmIncrCombo;
100 KTextEdit *mDescriptionEdit; 101 KTextEdit *mDescriptionEdit;
101 QLabel *mOwnerLabel; 102 QLabel *mOwnerLabel;
102 QComboBox *mSecrecyCombo; 103 QComboBox *mSecrecyCombo;
103 QCheckBox *mCancelBox; 104 QCheckBox *mCancelBox;
104 QPushButton *mCategoriesButton; 105 QPushButton *mCategoriesButton;
105 QLabel *mCategoriesLabel; 106 QLabel *mCategoriesLabel;
106 107
107 private: 108 private:
108 QString getFittingPath( const QString ) ; 109 QString getFittingPath( const QString ) ;
109 QString mAlarmSound; 110 QString mAlarmSound;
110 QString mAlarmProgram; 111 QString mAlarmProgram;
111 QString mAlarmMessage; 112 QString mAlarmMessage;
112}; 113};
113 114
114#endif 115#endif
diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp
index 337db9b..e23e680 100644
--- a/korganizer/koeventeditor.cpp
+++ b/korganizer/koeventeditor.cpp
@@ -141,97 +141,96 @@ void KOEventEditor::setupGeneral()
141 141
142 QFrame *topFrame2 = addPage(i18n("Details")); 142 QFrame *topFrame2 = addPage(i18n("Details"));
143 143
144 QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); 144 QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2);
145 topLayout2->setSpacing(spacingHint()); 145 topLayout2->setSpacing(spacingHint());
146 146
147 mGeneral->initClass(topFrame2,topLayout2); 147 mGeneral->initClass(topFrame2,topLayout2);
148 mGeneral->initSecrecy( topFrame2, topLayout2 ); 148 mGeneral->initSecrecy( topFrame2, topLayout2 );
149 mGeneral->initDescription(topFrame2,topLayout2); 149 mGeneral->initDescription(topFrame2,topLayout2);
150 150
151 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); 151 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
152 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); 152 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
153 } else { 153 } else {
154 QFrame *topFrame = addPage(i18n("General")); 154 QFrame *topFrame = addPage(i18n("General"));
155 155
156 QBoxLayout *topLayout = new QVBoxLayout(topFrame); 156 QBoxLayout *topLayout = new QVBoxLayout(topFrame);
157 topLayout->setSpacing(spacingHint()); 157 topLayout->setSpacing(spacingHint());
158 158
159 mGeneral->initHeader(topFrame,topLayout); 159 mGeneral->initHeader(topFrame,topLayout);
160 mGeneral->initTime(topFrame,topLayout); 160 mGeneral->initTime(topFrame,topLayout);
161 QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); 161 QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout);
162 mGeneral->initAlarm(topFrame,alarmLineLayout); 162 mGeneral->initAlarm(topFrame,alarmLineLayout);
163 mGeneral->initClass(topFrame,alarmLineLayout); 163 mGeneral->initClass(topFrame,alarmLineLayout);
164 mGeneral->initDescription(topFrame,topLayout); 164 mGeneral->initDescription(topFrame,topLayout);
165 QBoxLayout *detailsLayout = new QHBoxLayout(topLayout); 165 QBoxLayout *detailsLayout = new QHBoxLayout(topLayout);
166 mGeneral->initCategories( topFrame, detailsLayout ); 166 mGeneral->initCategories( topFrame, detailsLayout );
167 mGeneral->initSecrecy( topFrame, detailsLayout ); 167 mGeneral->initSecrecy( topFrame, detailsLayout );
168 } 168 }
169 169
170 mGeneral->finishSetup(); 170 mGeneral->finishSetup();
171 171
172} 172}
173 173
174void KOEventEditor::setupRecurrence() 174void KOEventEditor::setupRecurrence()
175{ 175{
176 QFrame *topFrame = addPage( i18n("Recurrence") ); 176 QFrame *topFrame = addPage( i18n("Recurrence") );
177 QBoxLayout *topLayout = new QVBoxLayout( topFrame ); 177 QBoxLayout *topLayout = new QVBoxLayout( topFrame );
178 178
179 mRecurrence = new KOEditorRecurrence( topFrame ); 179 mRecurrence = new KOEditorRecurrence( topFrame );
180 topLayout->addWidget( mRecurrence ); 180 topLayout->addWidget( mRecurrence );
181} 181}
182 182
183void KOEventEditor::editEvent(Event *event, bool showDescription) 183void 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 );
196 } 195 }
197} 196}
198 197
199void KOEventEditor::newEvent( QDateTime from, QDateTime to, bool allDay ) 198void KOEventEditor::newEvent( QDateTime from, QDateTime to, bool allDay )
200{ 199{
201 // init(); 200 // init();
202 201
203 mEvent = 0; 202 mEvent = 0;
204 setDefaults(from,to,allDay); 203 setDefaults(from,to,allDay);
205} 204}
206 205
207void KOEventEditor::loadDefaults() 206void KOEventEditor::loadDefaults()
208{ 207{
209 int fmt = KOPrefs::instance()->mStartTime; 208 int fmt = KOPrefs::instance()->mStartTime;
210 209
211 QDateTime from(QDate::currentDate(), QTime(fmt,0,0)); 210 QDateTime from(QDate::currentDate(), QTime(fmt,0,0));
212 QDateTime to(QDate::currentDate(), 211 QDateTime to(QDate::currentDate(),
213 QTime(fmt+KOPrefs::instance()->mDefaultDuration,0,0)); 212 QTime(fmt+KOPrefs::instance()->mDefaultDuration,0,0));
214 213
215 setDefaults(from,to,false); 214 setDefaults(from,to,false);
216} 215}
217 216
218bool KOEventEditor::processInput( bool emitTime ) 217bool KOEventEditor::processInput( bool emitTime )
219{ 218{
220 if (!validateInput()) return false; 219 if (!validateInput()) return false;
221 220
222 Event *event = 0; 221 Event *event = 0;
223 222
224 if (mEvent) event = mEvent; 223 if (mEvent) event = mEvent;
225 else { 224 else {
226 event = new Event; 225 event = new Event;
227 event->setOrganizer(KOPrefs::instance()->email()); 226 event->setOrganizer(KOPrefs::instance()->email());
228 } 227 }
229 228
230 writeEvent(event); 229 writeEvent(event);
231 if ( emitTime ) { 230 if ( emitTime ) {
232 globalFlagBlockAgenda = 1; 231 globalFlagBlockAgenda = 1;
233 emit showAgendaView( false ); 232 emit showAgendaView( false );
234 emit jumpToTime( event->dtStart().date() ); 233 emit jumpToTime( event->dtStart().date() );
235 globalFlagBlockAgenda = 2; 234 globalFlagBlockAgenda = 2;
236 235
237 } 236 }