Diffstat (limited to 'korganizer/koeditorgeneral.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | korganizer/koeditorgeneral.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index aa55d82..e601eef 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp | |||
@@ -80,97 +80,102 @@ 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, 50); | 86 | mSummaryEdit = new KOLocationBox(TRUE,parent, 50); |
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,30); | 108 | mLocationEdit = new KOLocationBox(TRUE,parent,30); |
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, 3); | 128 | int str = 3; |
129 | if ( QApplication::desktop()->width() < 320 ) { | ||
130 | --str; | ||
131 | --str; | ||
132 | } | ||
133 | headerLayout->setColStretch( 1, str); | ||
129 | headerLayout->setColStretch( 2, 1); | 134 | headerLayout->setColStretch( 2, 1); |
130 | } | 135 | } |
131 | 136 | ||
132 | } | 137 | } |
133 | void KOEditorGeneral::setFocusOn( int i ) | 138 | void KOEditorGeneral::setFocusOn( int i ) |
134 | { | 139 | { |
135 | mNextFocus = i; | 140 | mNextFocus = i; |
136 | QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() )); | 141 | QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() )); |
137 | } | 142 | } |
138 | void KOEditorGeneral::slotSetFocusOn() | 143 | void KOEditorGeneral::slotSetFocusOn() |
139 | { | 144 | { |
140 | mNextFocus; | 145 | mNextFocus; |
141 | if ( mNextFocus == 1 ) { | 146 | if ( mNextFocus == 1 ) { |
142 | mDescriptionEdit->setFocus(); | 147 | mDescriptionEdit->setFocus(); |
143 | mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); | 148 | mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); |
144 | } | 149 | } |
145 | if ( mNextFocus == 2 ) { | 150 | if ( mNextFocus == 2 ) { |
146 | mSummaryEdit->setFocus(); | 151 | mSummaryEdit->setFocus(); |
147 | } | 152 | } |
148 | } | 153 | } |
149 | void KOEditorGeneral::editCategories() | 154 | void KOEditorGeneral::editCategories() |
150 | { | 155 | { |
151 | // qDebug("KOEditorGeneral::editCategories() "); | 156 | // qDebug("KOEditorGeneral::editCategories() "); |
152 | KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); | 157 | KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); |
153 | connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &))); | 158 | connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &))); |
154 | //KOGlobals::fitDialogToScreen( csd ); | 159 | //KOGlobals::fitDialogToScreen( csd ); |
155 | csd->setColorEnabled(); | 160 | csd->setColorEnabled(); |
156 | csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) ); | 161 | csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) ); |
157 | csd->exec(); | 162 | csd->exec(); |
158 | delete csd; | 163 | delete csd; |
159 | } | 164 | } |
160 | 165 | ||
161 | void KOEditorGeneral::showCatPopup() | 166 | void KOEditorGeneral::showCatPopup() |
162 | { | 167 | { |
163 | mCatPopup->clear(); | 168 | mCatPopup->clear(); |
164 | QStringList checkedCategories = QStringList::split (",", mCategoriesLabel->text()); | 169 | QStringList checkedCategories = QStringList::split (",", mCategoriesLabel->text()); |
165 | int index = 0; | 170 | int index = 0; |
166 | for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); | 171 | for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); |
167 | it != KOPrefs::instance()->mCustomCategories.end (); | 172 | it != KOPrefs::instance()->mCustomCategories.end (); |
168 | ++it) { | 173 | ++it) { |
169 | mCatPopup->insertItem (*it, index ); | 174 | mCatPopup->insertItem (*it, index ); |
170 | //mCategory[index] = *it; | 175 | //mCategory[index] = *it; |
171 | if (checkedCategories.find (*it) != checkedCategories.end ()) mCatPopup->setItemChecked (index, true); | 176 | if (checkedCategories.find (*it) != checkedCategories.end ()) mCatPopup->setItemChecked (index, true); |
172 | ++index; | 177 | ++index; |
173 | } | 178 | } |
174 | } | 179 | } |
175 | void KOEditorGeneral::selectedCatPopup( int index ) | 180 | void KOEditorGeneral::selectedCatPopup( int index ) |
176 | { | 181 | { |