-rw-r--r-- | korganizer/koeditorgeneral.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index 753630b..407a5d5 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp | |||
@@ -80,97 +80,98 @@ void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) | |||
80 | // 1 on pda | 80 | // 1 on pda |
81 | // 11 on desktop | 81 | // 11 on desktop |
82 | headerLayout->setSpacing( (KDialog::spacingHint()-3)*2+1 ); | 82 | headerLayout->setSpacing( (KDialog::spacingHint()-3)*2+1 ); |
83 | QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent); | 83 | QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent); |
84 | headerLayout->addWidget(summaryLabel,0,0); | 84 | headerLayout->addWidget(summaryLabel,0,0); |
85 | 85 | ||
86 | mSummaryEdit = new KOLocationBox(TRUE,parent, 10); | 86 | mSummaryEdit = new KOLocationBox(TRUE,parent, 10); |
87 | mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); | 87 | mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); |
88 | //mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) ); | 88 | //mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) ); |
89 | //qDebug("h %d %d ", summaryLabel->sizeHint().height(),mSummaryEdit->sizeHint().height() ); | 89 | //qDebug("h %d %d ", summaryLabel->sizeHint().height(),mSummaryEdit->sizeHint().height() ); |
90 | int hei = (summaryLabel->sizeHint().height() + mSummaryEdit->sizeHint().height())/2; | 90 | int hei = (summaryLabel->sizeHint().height() + mSummaryEdit->sizeHint().height())/2; |
91 | if ( QApplication::desktop()->width() > 320 ) | 91 | if ( QApplication::desktop()->width() > 320 ) |
92 | mSummaryEdit->setMaximumHeight( hei +6 ); | 92 | mSummaryEdit->setMaximumHeight( hei +6 ); |
93 | //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 ); |
94 | // 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 } |
95 | // mSummaryEdit = new QLineEdit(parent); | 95 | // mSummaryEdit = new QLineEdit(parent); |
96 | if ( QApplication::desktop()->height() < 320 ) | 96 | if ( QApplication::desktop()->height() < 320 ) |
97 | headerLayout->addWidget(mSummaryEdit,0,1); | 97 | headerLayout->addWidget(mSummaryEdit,0,1); |
98 | else | 98 | else |
99 | headerLayout->addMultiCellWidget(mSummaryEdit,0,0,1,2); | 99 | headerLayout->addMultiCellWidget(mSummaryEdit,0,0,1,2); |
100 | connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); | 100 | connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); |
101 | 101 | ||
102 | QLabel *locationLabel = new QLabel(i18n("Location:"),parent); | 102 | QLabel *locationLabel = new QLabel(i18n("Location:"),parent); |
103 | if ( QApplication::desktop()->height() < 320 ) | 103 | if ( QApplication::desktop()->height() < 320 ) |
104 | headerLayout->addWidget(locationLabel,0,2); | 104 | headerLayout->addWidget(locationLabel,0,2); |
105 | else | 105 | else |
106 | headerLayout->addWidget(locationLabel,1,0); | 106 | headerLayout->addWidget(locationLabel,1,0); |
107 | 107 | ||
108 | mLocationEdit = new KOLocationBox(TRUE,parent,10); | 108 | mLocationEdit = new KOLocationBox(TRUE,parent,10); |
109 | mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); | 109 | mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); |
110 | if ( QApplication::desktop()->width() > 320 && QApplication::desktop()->height() > 240 ) | 110 | if ( QApplication::desktop()->width() > 320 && QApplication::desktop()->height() > 240 ) |
111 | mLocationEdit->setMaximumHeight( hei + 6); | 111 | mLocationEdit->setMaximumHeight( hei + 6); |
112 | 112 | ||
113 | // mLocationEdit = new QLineEdit(parent); | 113 | // mLocationEdit = new QLineEdit(parent); |
114 | connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); | 114 | connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); |
115 | 115 | ||
116 | mCalendarBox = new QComboBox ( parent ); | 116 | mCalendarBox = new QComboBox ( parent ); |
117 | mCalendarBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); | 117 | mCalendarBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); |
118 | if ( QApplication::desktop()->height() < 320 ) { | 118 | if ( QApplication::desktop()->height() < 320 ) { |
119 | headerLayout->addWidget(mLocationEdit,0,3); | 119 | headerLayout->addWidget(mLocationEdit,0,3); |
120 | headerLayout->addWidget(mCalendarBox,0,4); | 120 | headerLayout->addWidget(mCalendarBox,0,4); |
121 | headerLayout->setColStretch( 1, 10); | 121 | headerLayout->setColStretch( 1, 10); |
122 | headerLayout->setColStretch( 3, 10); | 122 | headerLayout->setColStretch( 3, 10); |
123 | mCalendarBox->setMaximumWidth( 64 ); | 123 | mCalendarBox->setMaximumWidth( 64 ); |
124 | } | 124 | } |
125 | else { | 125 | else { |
126 | headerLayout->addWidget(mLocationEdit,1,1); | 126 | headerLayout->addWidget(mLocationEdit,1,1); |
127 | headerLayout->addWidget(mCalendarBox,1,2); | 127 | headerLayout->addWidget(mCalendarBox,1,2); |
128 | headerLayout->setColStretch( 1, 10); | 128 | headerLayout->setColStretch( 1, 3); |
129 | headerLayout->setColStretch( 2, 1); | ||
129 | } | 130 | } |
130 | 131 | ||
131 | } | 132 | } |
132 | void KOEditorGeneral::setFocusOn( int i ) | 133 | void KOEditorGeneral::setFocusOn( int i ) |
133 | { | 134 | { |
134 | mNextFocus = i; | 135 | mNextFocus = i; |
135 | QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() )); | 136 | QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() )); |
136 | } | 137 | } |
137 | void KOEditorGeneral::slotSetFocusOn() | 138 | void KOEditorGeneral::slotSetFocusOn() |
138 | { | 139 | { |
139 | mNextFocus; | 140 | mNextFocus; |
140 | if ( mNextFocus == 1 ) { | 141 | if ( mNextFocus == 1 ) { |
141 | mDescriptionEdit->setFocus(); | 142 | mDescriptionEdit->setFocus(); |
142 | mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); | 143 | mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); |
143 | } | 144 | } |
144 | if ( mNextFocus == 2 ) { | 145 | if ( mNextFocus == 2 ) { |
145 | mSummaryEdit->setFocus(); | 146 | mSummaryEdit->setFocus(); |
146 | } | 147 | } |
147 | } | 148 | } |
148 | void KOEditorGeneral::editCategories() | 149 | void KOEditorGeneral::editCategories() |
149 | { | 150 | { |
150 | // qDebug("KOEditorGeneral::editCategories() "); | 151 | // qDebug("KOEditorGeneral::editCategories() "); |
151 | KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); | 152 | KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); |
152 | connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &))); | 153 | connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &))); |
153 | //KOGlobals::fitDialogToScreen( csd ); | 154 | //KOGlobals::fitDialogToScreen( csd ); |
154 | csd->setColorEnabled(); | 155 | csd->setColorEnabled(); |
155 | csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) ); | 156 | csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) ); |
156 | csd->exec(); | 157 | csd->exec(); |
157 | delete csd; | 158 | delete csd; |
158 | } | 159 | } |
159 | 160 | ||
160 | void KOEditorGeneral::showCatPopup() | 161 | void KOEditorGeneral::showCatPopup() |
161 | { | 162 | { |
162 | mCatPopup->clear(); | 163 | mCatPopup->clear(); |
163 | QStringList checkedCategories = QStringList::split (",", mCategoriesLabel->text()); | 164 | QStringList checkedCategories = QStringList::split (",", mCategoriesLabel->text()); |
164 | int index = 0; | 165 | int index = 0; |
165 | for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); | 166 | for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); |
166 | it != KOPrefs::instance()->mCustomCategories.end (); | 167 | it != KOPrefs::instance()->mCustomCategories.end (); |
167 | ++it) { | 168 | ++it) { |
168 | mCatPopup->insertItem (*it, index ); | 169 | mCatPopup->insertItem (*it, index ); |
169 | //mCategory[index] = *it; | 170 | //mCategory[index] = *it; |
170 | if (checkedCategories.find (*it) != checkedCategories.end ()) mCatPopup->setItemChecked (index, true); | 171 | if (checkedCategories.find (*it) != checkedCategories.end ()) mCatPopup->setItemChecked (index, true); |
171 | ++index; | 172 | ++index; |
172 | } | 173 | } |
173 | } | 174 | } |
174 | void KOEditorGeneral::selectedCatPopup( int index ) | 175 | void KOEditorGeneral::selectedCatPopup( int index ) |
175 | { | 176 | { |
176 | QStringList categories = QStringList::split (",", mCategoriesLabel->text()); | 177 | QStringList categories = QStringList::split (",", mCategoriesLabel->text()); |