-rw-r--r-- | noncore/apps/tinykate/libkate/view/kateviewdialog.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp index b7cf9f5..d6fde62 100644 --- a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp +++ b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp | |||
@@ -169,128 +169,131 @@ void SearchDialog::slotOk() | |||
169 | accept(); | 169 | accept(); |
170 | } | 170 | } |
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
174 | void SearchDialog::setSearchText( const QString &searchstr ) | 174 | void SearchDialog::setSearchText( const QString &searchstr ) |
175 | { | 175 | { |
176 | m_search->insertItem( searchstr, 0 ); | 176 | m_search->insertItem( searchstr, 0 ); |
177 | m_search->setCurrentItem( 0 ); | 177 | m_search->setCurrentItem( 0 ); |
178 | m_search->lineEdit()->selectAll(); | 178 | m_search->lineEdit()->selectAll(); |
179 | } | 179 | } |
180 | 180 | ||
181 | // this dialog is not modal | 181 | // this dialog is not modal |
182 | ReplacePrompt::ReplacePrompt( QWidget *parent ) | 182 | ReplacePrompt::ReplacePrompt( QWidget *parent ) |
183 | : KDialogBase(parent, 0L, false, i18n( "Replace Text" ), | 183 | : KDialogBase(parent, 0L, false, i18n( "Replace Text" ), |
184 | User3 | User2 | User1 | Close, User3, true, | 184 | User3 | User2 | User1 | Close, User3, true, |
185 | i18n("&All"), i18n("&No"), i18n("&Yes")) { | 185 | i18n("&All"), i18n("&No"), i18n("&Yes")) { |
186 | 186 | ||
187 | QWidget *page = new QWidget(this); | 187 | QWidget *page = new QWidget(this); |
188 | setMainWidget(page); | 188 | setMainWidget(page); |
189 | 189 | ||
190 | QBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); | 190 | QBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); |
191 | QLabel *label = new QLabel(i18n("Replace this occurrence?"),page); | 191 | QLabel *label = new QLabel(i18n("Replace this occurrence?"),page); |
192 | topLayout->addWidget(label ); | 192 | topLayout->addWidget(label ); |
193 | } | 193 | } |
194 | 194 | ||
195 | void ReplacePrompt::slotUser1( void ) { // All | 195 | void ReplacePrompt::slotUser1( void ) { // All |
196 | done(KateView::srAll); | 196 | done(KateView::srAll); |
197 | } | 197 | } |
198 | 198 | ||
199 | void ReplacePrompt::slotUser2( void ) { // No | 199 | void ReplacePrompt::slotUser2( void ) { // No |
200 | done(KateView::srNo); | 200 | done(KateView::srNo); |
201 | } | 201 | } |
202 | 202 | ||
203 | void ReplacePrompt::slotUser3( void ) { // Yes | 203 | void ReplacePrompt::slotUser3( void ) { // Yes |
204 | accept(); | 204 | accept(); |
205 | } | 205 | } |
206 | 206 | ||
207 | void ReplacePrompt::done(int r) { | 207 | void ReplacePrompt::done(int r) { |
208 | setResult(r); | 208 | setResult(r); |
209 | emit clicked(); | 209 | emit clicked(); |
210 | } | 210 | } |
211 | 211 | ||
212 | void ReplacePrompt::closeEvent(QCloseEvent *) { | 212 | void ReplacePrompt::closeEvent(QCloseEvent *) { |
213 | reject(); | 213 | reject(); |
214 | } | 214 | } |
215 | 215 | ||
216 | GotoLineDialog::GotoLineDialog(QWidget *parent, int line, int max) | 216 | GotoLineDialog::GotoLineDialog(QWidget *parent, int line, int max) |
217 | : KDialogBase(parent, 0L, true, i18n("Goto Line"), Ok | Cancel, Ok) { | 217 | : KDialogBase(parent, 0L, true, i18n("Goto Line"), Ok | Cancel, Ok) { |
218 | 218 | ||
219 | QWidget *page = new QWidget(this); | 219 | QWidget *page = new QWidget(this); |
220 | setMainWidget(page); | 220 | setMainWidget(page); |
221 | 221 | ||
222 | QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); | 222 | QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); |
223 | e1 = new QSpinBox(page); | 223 | e1 = new QSpinBox(page); |
224 | e1->setMinValue(1); | 224 | e1->setMinValue(1); |
225 | e1->setMaxValue(max); | 225 | e1->setMaxValue(max); |
226 | e1->setValue((int)line); | 226 | e1->setValue((int)line); |
227 | 227 | ||
228 | QLabel *label = new QLabel( e1,i18n("&Goto Line:"), page ); | 228 | QLabel *label = new QLabel( e1,i18n("&Goto Line:"), page ); |
229 | topLayout->addWidget(label); | 229 | topLayout->addWidget(label); |
230 | topLayout->addWidget(e1); | 230 | topLayout->addWidget(e1); |
231 | topLayout->addSpacing(spacingHint()); // A little bit extra space | 231 | topLayout->addSpacing(spacingHint()); // A little bit extra space |
232 | topLayout->addStretch(10); | 232 | topLayout->addStretch(10); |
233 | |||
234 | page->setMinimumWidth(100); | ||
235 | |||
233 | e1->setFocus(); | 236 | e1->setFocus(); |
234 | } | 237 | } |
235 | 238 | ||
236 | int GotoLineDialog::getLine() { | 239 | int GotoLineDialog::getLine() { |
237 | return e1->value(); | 240 | return e1->value(); |
238 | } | 241 | } |
239 | 242 | ||
240 | const int IndentConfigTab::flags[] = {KateView::cfAutoIndent, KateView::cfSpaceIndent, | 243 | const int IndentConfigTab::flags[] = {KateView::cfAutoIndent, KateView::cfSpaceIndent, |
241 | KateView::cfBackspaceIndents,KateView::cfTabIndents, KateView::cfKeepIndentProfile, KateView::cfKeepExtraSpaces}; | 244 | KateView::cfBackspaceIndents,KateView::cfTabIndents, KateView::cfKeepIndentProfile, KateView::cfKeepExtraSpaces}; |
242 | 245 | ||
243 | IndentConfigTab::IndentConfigTab(QWidget *parent, KateView *view) | 246 | IndentConfigTab::IndentConfigTab(QWidget *parent, KateView *view) |
244 | : QWidget(parent, 0L) | 247 | : QWidget(parent, 0L) |
245 | { | 248 | { |
246 | QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() ); | 249 | QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() ); |
247 | int configFlags = view->config(); | 250 | int configFlags = view->config(); |
248 | 251 | ||
249 | opt[0] = new QCheckBox(i18n("&Auto Indent"), this); | 252 | opt[0] = new QCheckBox(i18n("&Auto Indent"), this); |
250 | layout->addWidget(opt[0], 0, AlignLeft); | 253 | layout->addWidget(opt[0], 0, AlignLeft); |
251 | opt[0]->setChecked(configFlags & flags[0]); | 254 | opt[0]->setChecked(configFlags & flags[0]); |
252 | 255 | ||
253 | opt[1] = new QCheckBox(i18n("Indent With &Spaces"), this); | 256 | opt[1] = new QCheckBox(i18n("Indent With &Spaces"), this); |
254 | layout->addWidget(opt[1], 0, AlignLeft); | 257 | layout->addWidget(opt[1], 0, AlignLeft); |
255 | opt[1]->setChecked(configFlags & flags[1]); | 258 | opt[1]->setChecked(configFlags & flags[1]); |
256 | 259 | ||
257 | opt[2] = new QCheckBox(i18n("&Backspace Key Indents"), this); | 260 | opt[2] = new QCheckBox(i18n("&Backspace Key Indents"), this); |
258 | layout->addWidget(opt[2], 0, AlignLeft); | 261 | layout->addWidget(opt[2], 0, AlignLeft); |
259 | opt[2]->setChecked(configFlags & flags[2]); | 262 | opt[2]->setChecked(configFlags & flags[2]); |
260 | 263 | ||
261 | opt[3] = new QCheckBox(i18n("&Tab Key Indents"), this); | 264 | opt[3] = new QCheckBox(i18n("&Tab Key Indents"), this); |
262 | layout->addWidget(opt[3], 0, AlignLeft); | 265 | layout->addWidget(opt[3], 0, AlignLeft); |
263 | opt[3]->setChecked(configFlags & flags[3]); | 266 | opt[3]->setChecked(configFlags & flags[3]); |
264 | 267 | ||
265 | opt[4] = new QCheckBox(i18n("Keep Indent &Profile"), this); | 268 | opt[4] = new QCheckBox(i18n("Keep Indent &Profile"), this); |
266 | layout->addWidget(opt[4], 0, AlignLeft); | 269 | layout->addWidget(opt[4], 0, AlignLeft); |
267 | // opt[4]->setChecked(configFlags & flags[4]); | 270 | // opt[4]->setChecked(configFlags & flags[4]); |
268 | opt[4]->setChecked(true); | 271 | opt[4]->setChecked(true); |
269 | opt[4]->hide(); | 272 | opt[4]->hide(); |
270 | 273 | ||
271 | opt[5] = new QCheckBox(i18n("&Keep Extra Spaces"), this); | 274 | opt[5] = new QCheckBox(i18n("&Keep Extra Spaces"), this); |
272 | layout->addWidget(opt[5], 0, AlignLeft); | 275 | layout->addWidget(opt[5], 0, AlignLeft); |
273 | opt[5]->setChecked(configFlags & flags[5]); | 276 | opt[5]->setChecked(configFlags & flags[5]); |
274 | 277 | ||
275 | layout->addStretch(); | 278 | layout->addStretch(); |
276 | 279 | ||
277 | // What is this? help | 280 | // What is this? help |
278 | QWhatsThis::add(opt[0], i18n("When <b>Auto indent</b> is on, KateView will indent new lines to equal the indent on the previous line.<p>If the previous line is blank, the nearest line above with text is used")); | 281 | QWhatsThis::add(opt[0], i18n("When <b>Auto indent</b> is on, KateView will indent new lines to equal the indent on the previous line.<p>If the previous line is blank, the nearest line above with text is used")); |
279 | QWhatsThis::add(opt[1], i18n("Check this if you want to indent with spaces rather than tabs.<br>A Tab will be converted to <u>Tab-width</u> as set in the <b>edit</b> options")); | 282 | QWhatsThis::add(opt[1], i18n("Check this if you want to indent with spaces rather than tabs.<br>A Tab will be converted to <u>Tab-width</u> as set in the <b>edit</b> options")); |
280 | QWhatsThis::add(opt[2], i18n("This allows the <b>backspace</b> key to be used to indent.")); | 283 | QWhatsThis::add(opt[2], i18n("This allows the <b>backspace</b> key to be used to indent.")); |
281 | QWhatsThis::add(opt[3], i18n("This allows the <b>tab</b> key to be used to indent.")); | 284 | QWhatsThis::add(opt[3], i18n("This allows the <b>tab</b> key to be used to indent.")); |
282 | QWhatsThis::add(opt[4], i18n("This retains current indentation settings for future documents.")); | 285 | QWhatsThis::add(opt[4], i18n("This retains current indentation settings for future documents.")); |
283 | QWhatsThis::add(opt[5], i18n("Indentations of more than the selected number of spaces will not be shortened.")); | 286 | QWhatsThis::add(opt[5], i18n("Indentations of more than the selected number of spaces will not be shortened.")); |
284 | } | 287 | } |
285 | 288 | ||
286 | void IndentConfigTab::getData(KateView *view) { | 289 | void IndentConfigTab::getData(KateView *view) { |
287 | int configFlags, z; | 290 | int configFlags, z; |
288 | 291 | ||
289 | configFlags = view->config(); | 292 | configFlags = view->config(); |
290 | for (z = 0; z < numFlags; z++) { | 293 | for (z = 0; z < numFlags; z++) { |
291 | configFlags &= ~flags[z]; | 294 | configFlags &= ~flags[z]; |
292 | if (opt[z]->isChecked()) configFlags |= flags[z]; | 295 | if (opt[z]->isChecked()) configFlags |= flags[z]; |
293 | } | 296 | } |
294 | view->setConfig(configFlags); | 297 | view->setConfig(configFlags); |
295 | } | 298 | } |
296 | 299 | ||