summaryrefslogtreecommitdiffabout
path: root/korganizer/koeditorgeneral.cpp
Unidiff
Diffstat (limited to 'korganizer/koeditorgeneral.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeditorgeneral.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index e07bc53..29e68b3 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -22,32 +22,33 @@
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 <qtimer.h> 32#include <qtimer.h>
33#include <qfile.h> 33#include <qfile.h>
34#include <qregexp.h> 34#include <qregexp.h>
35 35
36 36
37#include <kglobal.h> 37#include <kglobal.h>
38#include <kdialog.h>
38#include <kdebug.h> 39#include <kdebug.h>
39#include <klocale.h> 40#include <klocale.h>
40#include <kiconloader.h> 41#include <kiconloader.h>
41#include <kmessagebox.h> 42#include <kmessagebox.h>
42#include <kfiledialog.h> 43#include <kfiledialog.h>
43#include <kstandarddirs.h> 44#include <kstandarddirs.h>
44 45
45#include <libkcal/todo.h> 46#include <libkcal/todo.h>
46#include <libkcal/event.h> 47#include <libkcal/event.h>
47#include <libkdepim/categoryselectdialog.h> 48#include <libkdepim/categoryselectdialog.h>
48#include <libkdepim/kdateedit.h> 49#include <libkdepim/kdateedit.h>
49 50
50#include "koprefs.h" 51#include "koprefs.h"
51#include "koglobals.h" 52#include "koglobals.h"
52 53
53#include "koeditorgeneral.h" 54#include "koeditorgeneral.h"
@@ -63,57 +64,59 @@ KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) :
63{ 64{
64 mNextFocus = 0; 65 mNextFocus = 0;
65} 66}
66 67
67KOEditorGeneral::~KOEditorGeneral() 68KOEditorGeneral::~KOEditorGeneral()
68{ 69{
69} 70}
70 71
71void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) 72void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout)
72{ 73{
73 QGridLayout *headerLayout = new QGridLayout(topLayout); 74 QGridLayout *headerLayout = new QGridLayout(topLayout);
74 75
75#if 0 76#if 0
76 mOwnerLabel = new QLabel(i18n("Owner:"),parent); 77 mOwnerLabel = new QLabel(i18n("Owner:"),parent);
77 headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1); 78 headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1);
78#endif 79#endif
79 80 // 1 on pda
81 // 11 on desktop
82 headerLayout->setSpacing( (KDialog::spacingHint()-3)*2+1 );
80 QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent); 83 QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent);
81 headerLayout->addWidget(summaryLabel,1,0); 84 headerLayout->addWidget(summaryLabel,1,0);
82 85
83 mSummaryEdit = new KOLocationBox(TRUE,parent, 10); 86 mSummaryEdit = new KOLocationBox(TRUE,parent, 10);
84 mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); 87 mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
85 //mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) ); 88 //mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) );
86 //qDebug("h %d %d ", summaryLabel->sizeHint().height(),mSummaryEdit->sizeHint().height() ); 89 //qDebug("h %d %d ", summaryLabel->sizeHint().height(),mSummaryEdit->sizeHint().height() );
87 int hei = (summaryLabel->sizeHint().height() + mSummaryEdit->sizeHint().height())/2; 90 int hei = (summaryLabel->sizeHint().height() + mSummaryEdit->sizeHint().height())/2;
88 if ( QApplication::desktop()->width() > 320 ) 91 if ( QApplication::desktop()->width() > 320 )
89 mSummaryEdit->setMaximumHeight( hei +6 ); 92 mSummaryEdit->setMaximumHeight( hei +6 );
90 //qDebug("%d %d %d %d %d %d ", QSizePolicy::Fixed , QSizePolicy::Minimum , QSizePolicy:: Maximum , QSizePolicy:: Preferred , QSizePolicy:: MinimumExpanding , QSizePolicy::Expanding ); 93 //qDebug("%d %d %d %d %d %d ", QSizePolicy::Fixed , QSizePolicy::Minimum , QSizePolicy:: Maximum , QSizePolicy:: Preferred , QSizePolicy:: MinimumExpanding , QSizePolicy::Expanding );
91 // SizeType { Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow|MayShrink, MinimumExpanding = Minimum|ExpMask, Expanding = MinimumExpanding|MayShrink } 94 // SizeType { Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow|MayShrink, MinimumExpanding = Minimum|ExpMask, Expanding = MinimumExpanding|MayShrink }
92 // mSummaryEdit = new QLineEdit(parent); 95 // mSummaryEdit = new QLineEdit(parent);
93 headerLayout->addWidget(mSummaryEdit,1,1); 96 headerLayout->addWidget(mSummaryEdit,1,1);
94 connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); 97 connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) );
95 98
96 QLabel *locationLabel = new QLabel(i18n("Location:"),parent); 99 QLabel *locationLabel = new QLabel(i18n("Location:"),parent);
97 if ( QApplication::desktop()->height() < 320 ) 100 if ( QApplication::desktop()->height() < 320 )
98 headerLayout->addWidget(locationLabel,1,2); 101 headerLayout->addWidget(locationLabel,1,2);
99 else 102 else
100 headerLayout->addWidget(locationLabel,2,0); 103 headerLayout->addWidget(locationLabel,2,0);
101 104
102 mLocationEdit = new KOLocationBox(TRUE,parent,10); 105 mLocationEdit = new KOLocationBox(TRUE,parent,10);
103 mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); 106 mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
104 if ( QApplication::desktop()->width() > 320 && QApplication::desktop()->height() > 240 ) 107 if ( QApplication::desktop()->width() > 320 && QApplication::desktop()->height() > 240 )
105 mLocationEdit->setMaximumHeight( hei + 6); 108 mLocationEdit->setMaximumHeight( hei + 6);
106 109
107 // mLocationEdit = new QLineEdit(parent); 110 // mLocationEdit = new QLineEdit(parent);
108 connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); 111 connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) );
109 if ( QApplication::desktop()->height() < 320 ) { 112 if ( QApplication::desktop()->height() < 320 ) {
110 headerLayout->addWidget(mLocationEdit,1,3); 113 headerLayout->addWidget(mLocationEdit,1,3);
111 headerLayout->setColStretch( 1, 10); 114 headerLayout->setColStretch( 1, 10);
112 headerLayout->setColStretch( 3, 10); 115 headerLayout->setColStretch( 3, 10);
113 } 116 }
114 else { 117 else {
115 headerLayout->addWidget(mLocationEdit,2,1); 118 headerLayout->addWidget(mLocationEdit,2,1);
116 headerLayout->setColStretch( 1, 10); 119 headerLayout->setColStretch( 1, 10);
117 } 120 }
118} 121}
119void KOEditorGeneral::setFocusOn( int i ) 122void KOEditorGeneral::setFocusOn( int i )
@@ -176,33 +179,33 @@ void KOEditorGeneral::selectedCatPopup( int index )
176 setCategories( categories.join(",") ); 179 setCategories( categories.join(",") );
177} 180}
178 181
179void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) 182void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout)
180{ 183{
181 QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout ); 184 QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout );
182 mCatPopup = new QPopupMenu ( parent ); 185 mCatPopup = new QPopupMenu ( parent );
183 mCatPopup->setCheckable (true); 186 mCatPopup->setCheckable (true);
184 connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup())); 187 connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup()));
185 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int ))); 188 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int )));
186 mCategoriesButton = new QPushButton(parent); 189 mCategoriesButton = new QPushButton(parent);
187 mCategoriesButton->setText(i18n("Categories...")); 190 mCategoriesButton->setText(i18n("Categories..."));
188 connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); 191 connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() ));
189 //connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); 192 //connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() ));
190 categoriesLayout->addWidget(mCategoriesButton); 193 categoriesLayout->addWidget(mCategoriesButton);
191 mCategoriesLabel = new QPushButton(parent);//new QLabel(parent); 194 mCategoriesLabel = new QPushButton(parent);//new QLabel(parent);
192 mCategoriesLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); 195 mCategoriesLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) );
193 mCategoriesLabel->setPopup( mCatPopup ); 196 mCategoriesLabel->setPopup( mCatPopup );
194 //mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); 197 //mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken);
195 categoriesLayout->addWidget(mCategoriesLabel,1); 198 categoriesLayout->addWidget(mCategoriesLabel,1);
196} 199}
197 200
198void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) 201void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout)
199{ 202{
200 QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); 203 QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout );
201 204
202 QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); 205 QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent);
203 mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); 206 mCancelBox = new QCheckBox ( i18n("Cancelled"), parent);
204 secrecyLayout->addWidget(mCancelBox); 207 secrecyLayout->addWidget(mCancelBox);
205 secrecyLayout->addWidget(secrecyLabel); 208 secrecyLayout->addWidget(secrecyLabel);
206 209
207 mSecrecyCombo = new QComboBox(parent); 210 mSecrecyCombo = new QComboBox(parent);
208 mSecrecyCombo->insertStringList(Incidence::secrecyList()); 211 mSecrecyCombo->insertStringList(Incidence::secrecyList());