summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-12-22 18:24:31 (UTC)
committer llornkcor <llornkcor>2002-12-22 18:24:31 (UTC)
commit3ae485ccb47ca618bc00d96a0e81c978a1cfbdaf (patch) (unidiff)
treef4a50457221d593f258d2f3f3d55c7b47a7b976d
parentc82ed38520b4038678ab0ab0c9f0ba147d8791ea (diff)
downloadopie-3ae485ccb47ca618bc00d96a0e81c978a1cfbdaf.zip
opie-3ae485ccb47ca618bc00d96a0e81c978a1cfbdaf.tar.gz
opie-3ae485ccb47ca618bc00d96a0e81c978a1cfbdaf.tar.bz2
use ofontselector, and temp fix for dialog crash
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/view/kateview.cpp2
-rw-r--r--noncore/apps/tinykate/libkate/view/kateviewdialog.cpp37
-rw-r--r--noncore/apps/tinykate/libkate/view/kateviewdialog.h2
3 files changed, 30 insertions, 11 deletions
diff --git a/noncore/apps/tinykate/libkate/view/kateview.cpp b/noncore/apps/tinykate/libkate/view/kateview.cpp
index 6453458..63e941f 100644
--- a/noncore/apps/tinykate/libkate/view/kateview.cpp
+++ b/noncore/apps/tinykate/libkate/view/kateview.cpp
@@ -2285,129 +2285,129 @@ void KateView::configDialog()
2285 2285
2286 page = kd->addPage(i18n("Fonts")); 2286 page = kd->addPage(i18n("Fonts"));
2287 (new QVBoxLayout(page))->setAutoAdd(true); 2287 (new QVBoxLayout(page))->setAutoAdd(true);
2288 2288
2289 FontConfig *fontConfig = new FontConfig(page); 2289 FontConfig *fontConfig = new FontConfig(page);
2290 fontConfig->setFont (myDoc->getFont()); 2290 fontConfig->setFont (myDoc->getFont());
2291 2291
2292 // indent options 2292 // indent options
2293 page=kd->addPage(i18n("Indent")); 2293 page=kd->addPage(i18n("Indent"));
2294 (new QVBoxLayout(page))->setAutoAdd(true); 2294 (new QVBoxLayout(page))->setAutoAdd(true);
2295 2295
2296 IndentConfigTab *indentConfig = new IndentConfigTab(page, this); 2296 IndentConfigTab *indentConfig = new IndentConfigTab(page, this);
2297 2297
2298 // select options 2298 // select options
2299 page=kd->addPage(i18n("Select")); 2299 page=kd->addPage(i18n("Select"));
2300 (new QVBoxLayout(page))->setAutoAdd(true); 2300 (new QVBoxLayout(page))->setAutoAdd(true);
2301 2301
2302 SelectConfigTab *selectConfig = new SelectConfigTab(page, this); 2302 SelectConfigTab *selectConfig = new SelectConfigTab(page, this);
2303 2303
2304 // edit options 2304 // edit options
2305 page=kd->addPage(i18n("Edit")); 2305 page=kd->addPage(i18n("Edit"));
2306 (new QVBoxLayout(page))->setAutoAdd(true); 2306 (new QVBoxLayout(page))->setAutoAdd(true);
2307 2307
2308 EditConfigTab *editConfig = new EditConfigTab(page, this); 2308 EditConfigTab *editConfig = new EditConfigTab(page, this);
2309 2309
2310 2310
2311 2311
2312 HighlightDialogPage *hlPage; 2312 HighlightDialogPage *hlPage;
2313 HlManager *hlManager; 2313 HlManager *hlManager;
2314 HlDataList hlDataList; 2314 HlDataList hlDataList;
2315 ItemStyleList defaultStyleList; 2315 ItemStyleList defaultStyleList;
2316 2316
2317 hlManager = HlManager::self(); 2317 hlManager = HlManager::self();
2318 2318
2319 defaultStyleList.setAutoDelete(true); 2319 defaultStyleList.setAutoDelete(true);
2320 hlManager->getDefaults(defaultStyleList); 2320 hlManager->getDefaults(defaultStyleList);
2321 2321
2322 hlDataList.setAutoDelete(true); 2322 hlDataList.setAutoDelete(true);
2323 //this gets the data from the KConfig object 2323 //this gets the data from the KConfig object
2324 hlManager->getHlDataList(hlDataList); 2324 hlManager->getHlDataList(hlDataList);
2325 2325
2326 page=kd->addPage(i18n("Highlighting")); 2326 page=kd->addPage(i18n("Highlighting"));
2327 (new QVBoxLayout(page))->setAutoAdd(true); 2327 (new QVBoxLayout(page))->setAutoAdd(true);
2328 2328
2329 hlPage = new HighlightDialogPage(hlManager, &defaultStyleList, &hlDataList, 0, page); 2329 hlPage = new HighlightDialogPage(hlManager, &defaultStyleList, &hlDataList, 0, page);
2330 kd->showMaximized(); 2330 kd->showMaximized();
2331 if (kd->exec()) { 2331 if (kd->exec()) {
2332 // color options 2332 // color options
2333 colorConfig->getColors(colors); 2333 colorConfig->getColors(colors);
2334 myDoc->setFont (fontConfig->getFont()); 2334 myDoc->setFont (fontConfig->getFont());
2335 2335
2336 applyColors(); 2336 applyColors();
2337 // indent options 2337 // indent options
2338 indentConfig->getData(this); 2338 indentConfig->getData(this);
2339 // select options 2339 // select options
2340 selectConfig->getData(this); 2340 selectConfig->getData(this);
2341 // edit options 2341 // edit options
2342 editConfig->getData(this); 2342 editConfig->getData(this);
2343 // spell checker 2343 // spell checker
2344 hlManager->setHlDataList(hlDataList); 2344 hlManager->setHlDataList(hlDataList);
2345 hlManager->setDefaults(defaultStyleList); 2345 hlManager->setDefaults(defaultStyleList);
2346 hlPage->saveData(); 2346 hlPage->saveData();
2347 } 2347 }
2348 2348
2349 delete kd; 2349// delete kd;
2350 2350
2351#endif 2351#endif
2352} 2352}
2353 2353
2354int KateView::getHl() { 2354int KateView::getHl() {
2355 return myDoc->highlightNum(); 2355 return myDoc->highlightNum();
2356} 2356}
2357 2357
2358void KateView::setDontChangeHlOnSave() 2358void KateView::setDontChangeHlOnSave()
2359{ 2359{
2360 myDoc->setDontChangeHlOnSave(); 2360 myDoc->setDontChangeHlOnSave();
2361} 2361}
2362 2362
2363void KateView::setHl(int n) { 2363void KateView::setHl(int n) {
2364 myDoc->setHighlight(n); 2364 myDoc->setHighlight(n);
2365 myDoc->setDontChangeHlOnSave(); 2365 myDoc->setDontChangeHlOnSave();
2366 myDoc->updateViews(); 2366 myDoc->updateViews();
2367} 2367}
2368 2368
2369int KateView::getEol() { 2369int KateView::getEol() {
2370 return myDoc->eolMode; 2370 return myDoc->eolMode;
2371} 2371}
2372 2372
2373void KateView::setEol(int eol) { 2373void KateView::setEol(int eol) {
2374 if (isReadOnly()) 2374 if (isReadOnly())
2375 return; 2375 return;
2376 2376
2377 myDoc->eolMode = eol; 2377 myDoc->eolMode = eol;
2378 myDoc->setModified(true); 2378 myDoc->setModified(true);
2379} 2379}
2380 2380
2381 2381
2382 2382
2383void KateView::paintEvent(QPaintEvent *e) { 2383void KateView::paintEvent(QPaintEvent *e) {
2384 int x, y; 2384 int x, y;
2385 2385
2386 QRect updateR = e->rect(); // update rectangle 2386 QRect updateR = e->rect(); // update rectangle
2387// debug("Update rect = ( %i, %i, %i, %i )", 2387// debug("Update rect = ( %i, %i, %i, %i )",
2388// updateR.x(),updateR.y(), updateR.width(), updateR.height() ); 2388// updateR.x(),updateR.y(), updateR.width(), updateR.height() );
2389 2389
2390 int ux1 = updateR.x(); 2390 int ux1 = updateR.x();
2391 int uy1 = updateR.y(); 2391 int uy1 = updateR.y();
2392 int ux2 = ux1 + updateR.width(); 2392 int ux2 = ux1 + updateR.width();
2393 int uy2 = uy1 + updateR.height(); 2393 int uy2 = uy1 + updateR.height();
2394 2394
2395 QPainter paint; 2395 QPainter paint;
2396 paint.begin(this); 2396 paint.begin(this);
2397 2397
2398 QColorGroup g = colorGroup(); 2398 QColorGroup g = colorGroup();
2399 x = width(); 2399 x = width();
2400 y = height(); 2400 y = height();
2401 2401
2402 paint.setPen(g.dark()); 2402 paint.setPen(g.dark());
2403 if (uy1 <= 0) paint.drawLine(0,0,x-2,0); 2403 if (uy1 <= 0) paint.drawLine(0,0,x-2,0);
2404 if (ux1 <= 0) paint.drawLine(0,1,0,y-2); 2404 if (ux1 <= 0) paint.drawLine(0,1,0,y-2);
2405 2405
2406 paint.setPen(black); 2406 paint.setPen(black);
2407 if (uy1 <= 1) paint.drawLine(1,1,x-3,1); 2407 if (uy1 <= 1) paint.drawLine(1,1,x-3,1);
2408 if (ux1 <= 1) paint.drawLine(1,2,1,y-3); 2408 if (ux1 <= 1) paint.drawLine(1,2,1,y-3);
2409 2409
2410 paint.setPen(g.midlight()); 2410 paint.setPen(g.midlight());
2411 if (uy2 >= y-1) paint.drawLine(1,y-2,x-3,y-2); 2411 if (uy2 >= y-1) paint.drawLine(1,y-2,x-3,y-2);
2412 if (ux2 >= x-1) paint.drawLine(x-2,1,x-2,y-2); 2412 if (ux2 >= x-1) paint.drawLine(x-2,1,x-2,y-2);
2413 2413
diff --git a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp
index a311042..6a19e01 100644
--- a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp
+++ b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp
@@ -1,112 +1,114 @@
1/*************************************************************************** 1/***************************************************************************
2 kateviewdialog.cpp - description 2 kateviewdialog.cpp - description
3 ------------------- 3 -------------------
4 copyright : (C) 2001 by The Kate Team 4 copyright : (C) 2001 by The Kate Team
5 (C) 2002 by Joseph Wenninger 5 (C) 2002 by Joseph Wenninger
6 email : kwrite-devel@kde.org 6 email : kwrite-devel@kde.org
7 jowenn@kde.org 7 jowenn@kde.org
8 8
9 ***************************************************************************/ 9 ***************************************************************************/
10 10
11/*************************************************************************** 11/***************************************************************************
12 * * 12 * *
13 * This program is free software; you can redistribute it and/or modify * 13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by * 14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or * 15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. * 16 * (at your option) any later version. *
17 * * 17 * *
18 ***************************************************************************/ 18 ***************************************************************************/
19// Dialogs 19// Dialogs
20 20
21#include <stdio.h> 21#include <stdio.h>
22#include <stdlib.h> 22#include <stdlib.h>
23 23
24#include <qgrid.h> 24#include <qgrid.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qlistbox.h> 27#include <qlistbox.h>
28#include <qspinbox.h> 28#include <qspinbox.h>
29#include <qcombobox.h> 29#include <qcombobox.h>
30#include <qgroupbox.h> 30#include <qgroupbox.h>
31#include <qlineedit.h> 31#include <qlineedit.h>
32#include <qcheckbox.h> 32#include <qcheckbox.h>
33#include <qcollection.h> 33#include <qcollection.h>
34#include <qpushbutton.h> 34#include <qpushbutton.h>
35#include <qobjectlist.h> 35#include <qobjectlist.h>
36#include <qradiobutton.h> 36#include <qradiobutton.h>
37#include <qwhatsthis.h> 37#include <qwhatsthis.h>
38#include <qstringlist.h> 38#include <qstringlist.h>
39#include <klocale.h> 39#include <klocale.h>
40#include <kcolorbtn.h> 40#include <kcolorbtn.h>
41#include <qcombobox.h> 41#include <qcombobox.h>
42#include <kglobal.h> 42#include <kglobal.h>
43#include <qvbox.h> 43#include <qvbox.h>
44#include <qspinbox.h> 44#include <qspinbox.h>
45#include <kfontdialog.h> 45#include <kfontdialog.h>
46 46
47#include "../document/katedocument.h" 47#include "../document/katedocument.h"
48#include "kateviewdialog.h" 48#include "kateviewdialog.h"
49#include <opie/ofontselector.h>
50
49 51
50SearchDialog::SearchDialog( QWidget *parent, QStringList &searchFor, QStringList &replaceWith, int flags ) 52SearchDialog::SearchDialog( QWidget *parent, QStringList &searchFor, QStringList &replaceWith, int flags )
51 : KDialogBase( parent, 0L, true, i18n( "Find Text" ), Ok | Cancel, Ok ) 53 : KDialogBase( parent, 0L, true, i18n( "Find Text" ), Ok | Cancel, Ok )
52 , m_replace( 0L ) 54 , m_replace( 0L )
53{ 55{
54 QWidget *page = new QWidget( this ); 56 QWidget *page = new QWidget( this );
55 setMainWidget( page ); 57 setMainWidget( page );
56 58
57 QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); 59 QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );
58 60
59 m_search = new QComboBox( true, page ); 61 m_search = new QComboBox( true, page );
60 m_search->insertStringList( searchFor ); 62 m_search->insertStringList( searchFor );
61 m_search->setMinimumWidth( m_search->sizeHint().width() ); 63 m_search->setMinimumWidth( m_search->sizeHint().width() );
62 m_search->lineEdit()->selectAll(); 64 m_search->lineEdit()->selectAll();
63 QLabel *label = new QLabel( m_search, i18n( "&Text To Find:" ), page ); 65 QLabel *label = new QLabel( m_search, i18n( "&Text To Find:" ), page );
64 m_optRegExp = new QCheckBox( i18n( "Regular Expression" ), page ); 66 m_optRegExp = new QCheckBox( i18n( "Regular Expression" ), page );
65 topLayout->addWidget( label ); 67 topLayout->addWidget( label );
66 topLayout->addWidget( m_search ); 68 topLayout->addWidget( m_search );
67 topLayout->addWidget( m_optRegExp ); 69 topLayout->addWidget( m_optRegExp );
68 70
69 if( flags & KateView::sfReplace ) 71 if( flags & KateView::sfReplace )
70 { 72 {
71 // make it a replace dialog 73 // make it a replace dialog
72 setCaption( i18n( "Replace Text" ) ); 74 setCaption( i18n( "Replace Text" ) );
73 m_replace = new QComboBox( true, page ); 75 m_replace = new QComboBox( true, page );
74 m_replace->insertStringList( replaceWith ); 76 m_replace->insertStringList( replaceWith );
75 m_replace->setMinimumWidth( m_search->sizeHint().width() ); 77 m_replace->setMinimumWidth( m_search->sizeHint().width() );
76 label = new QLabel( m_replace, i18n( "&Replace With:" ), page ); 78 label = new QLabel( m_replace, i18n( "&Replace With:" ), page );
77 //m_optPlaceholders = new QCheckBox( i18n( "&Use Placeholders" ), page ); 79 //m_optPlaceholders = new QCheckBox( i18n( "&Use Placeholders" ), page );
78 topLayout->addWidget( label ); 80 topLayout->addWidget( label );
79 topLayout->addWidget( m_replace ); 81 topLayout->addWidget( m_replace );
80 //topLayout->addWidget( m_optPlaceholders ); 82 //topLayout->addWidget( m_optPlaceholders );
81 } 83 }
82 84
83 QGroupBox *group = new QGroupBox( i18n( "Options" ), page ); 85 QGroupBox *group = new QGroupBox( i18n( "Options" ), page );
84 topLayout->addWidget( group, 10 ); 86 topLayout->addWidget( group, 10 );
85 87
86 QGridLayout *gbox = new QGridLayout( group, 5, 2, spacingHint() ); 88 QGridLayout *gbox = new QGridLayout( group, 5, 2, spacingHint() );
87 gbox->addRowSpacing( 0, fontMetrics().lineSpacing() ); 89 gbox->addRowSpacing( 0, fontMetrics().lineSpacing() );
88 gbox->setRowStretch( 4, 10 ); 90 gbox->setRowStretch( 4, 10 );
89 91
90 m_opt1 = new QCheckBox( i18n( "C&ase Sensitive" ), group ); 92 m_opt1 = new QCheckBox( i18n( "C&ase Sensitive" ), group );
91 gbox->addWidget( m_opt1, 1, 0 ); 93 gbox->addWidget( m_opt1, 1, 0 );
92 94
93 m_opt2 = new QCheckBox(i18n("&Whole Words Only" ), group ); 95 m_opt2 = new QCheckBox(i18n("&Whole Words Only" ), group );
94 gbox->addWidget( m_opt2, 2, 0 ); 96 gbox->addWidget( m_opt2, 2, 0 );
95 97
96 m_opt3 = new QCheckBox(i18n("&From Beginning" ), group ); 98 m_opt3 = new QCheckBox(i18n("&From Beginning" ), group );
97 gbox->addWidget( m_opt3, 3, 0 ); 99 gbox->addWidget( m_opt3, 3, 0 );
98 100
99 m_opt4 = new QCheckBox(i18n("Find &Backwards" ), group ); 101 m_opt4 = new QCheckBox(i18n("Find &Backwards" ), group );
100 gbox->addWidget( m_opt4, 1, 1 ); 102 gbox->addWidget( m_opt4, 1, 1 );
101 103
102 m_opt5 = new QCheckBox(i18n("&Selected Text" ), group ); 104 m_opt5 = new QCheckBox(i18n("&Selected Text" ), group );
103 gbox->addWidget( m_opt5, 2, 1 ); 105 gbox->addWidget( m_opt5, 2, 1 );
104 106
105 m_opt1->setChecked( flags & KateView::sfCaseSensitive ); 107 m_opt1->setChecked( flags & KateView::sfCaseSensitive );
106 m_opt2->setChecked( flags & KateView::sfWholeWords ); 108 m_opt2->setChecked( flags & KateView::sfWholeWords );
107 m_opt3->setChecked( flags & KateView::sfFromBeginning ); 109 m_opt3->setChecked( flags & KateView::sfFromBeginning );
108 m_optRegExp->setChecked( flags & KateView::sfRegularExpression ); 110 m_optRegExp->setChecked( flags & KateView::sfRegularExpression );
109 m_opt4->setChecked( flags & KateView::sfBackward ); 111 m_opt4->setChecked( flags & KateView::sfBackward );
110 m_opt5->setChecked( flags & KateView::sfSelected ); 112 m_opt5->setChecked( flags & KateView::sfSelected );
111 113
112 if( m_replace ) 114 if( m_replace )
@@ -464,93 +466,108 @@ void EditConfigTab::getData(KateView *view)
464 int configFlags, z; 466 int configFlags, z;
465 467
466 configFlags = view->config(); 468 configFlags = view->config();
467 for (z = 1; z < numFlags; z++) { 469 for (z = 1; z < numFlags; z++) {
468 configFlags &= ~flags[z]; 470 configFlags &= ~flags[z];
469 if (opt[z]->isChecked()) configFlags |= flags[z]; 471 if (opt[z]->isChecked()) configFlags |= flags[z];
470 } 472 }
471 view->setConfig(configFlags); 473 view->setConfig(configFlags);
472 474
473 view->setEncoding (encoding->currentText()); 475 view->setEncoding (encoding->currentText());
474 view->doc()->setWordWrapAt(e1->value()); 476 view->doc()->setWordWrapAt(e1->value());
475 view->doc()->setWordWrap (opt[0]->isChecked()); 477 view->doc()->setWordWrap (opt[0]->isChecked());
476 view->setTabWidth(e2->value()); 478 view->setTabWidth(e2->value());
477 view->setUndoSteps(e3->value()); 479 view->setUndoSteps(e3->value());
478} 480}
479 481
480ColorConfig::ColorConfig( QWidget *parent, char *name ) 482ColorConfig::ColorConfig( QWidget *parent, char *name )
481 : QWidget( parent, name ) 483 : QWidget( parent, name )
482{ 484{
483 QGridLayout *glay = new QGridLayout( this, 6, 2, 0, KDialog::spacingHint()); 485 QGridLayout *glay = new QGridLayout( this, 6, 2, 0, KDialog::spacingHint());
484 glay->setColStretch(1,1); 486 glay->setColStretch(1,1);
485 glay->setRowStretch(5,1); 487 glay->setRowStretch(5,1);
486 488
487 QLabel *label; 489 QLabel *label;
488 490
489 label = new QLabel( i18n("Background:"), this); 491 label = new QLabel( i18n("Background:"), this);
490 label->setAlignment( AlignRight|AlignVCenter ); 492 label->setAlignment( AlignRight|AlignVCenter );
491 m_back = new KColorButton( this ); 493 m_back = new KColorButton( this );
492 glay->addWidget( label, 0, 0 ); 494 glay->addWidget( label, 0, 0 );
493 glay->addWidget( m_back, 0, 1 ); 495 glay->addWidget( m_back, 0, 1 );
494 496
495 label = new QLabel( i18n("Selected:"), this); 497 label = new QLabel( i18n("Selected:"), this);
496 label->setAlignment( AlignRight|AlignVCenter ); 498 label->setAlignment( AlignRight|AlignVCenter );
497 m_selected = new KColorButton( this ); 499 m_selected = new KColorButton( this );
498 glay->addWidget( label, 2, 0 ); 500 glay->addWidget( label, 2, 0 );
499 glay->addWidget( m_selected, 2, 1 ); 501 glay->addWidget( m_selected, 2, 1 );
500 502
501 // QWhatsThis help 503 // QWhatsThis help
502 QWhatsThis::add(m_back, i18n("Sets the background color of the editing area")); 504 QWhatsThis::add(m_back, i18n("Sets the background color of the editing area"));
503 QWhatsThis::add(m_selected, i18n("Sets the background color of the selection. To set the text color for selected text, use the &quot;<b>Configure Highlighting</b>&quot; dialog.")); 505 QWhatsThis::add(m_selected, i18n("Sets the background color of the selection. To set the text color for selected text, use the &quot;<b>Configure Highlighting</b>&quot; dialog."));
504} 506}
505 507
506 508
507ColorConfig::~ColorConfig() 509ColorConfig::~ColorConfig()
508{ 510{
509} 511}
510 512
511void ColorConfig::setColors(QColor *colors) 513void ColorConfig::setColors(QColor *colors)
512{ 514{
513 m_back->setColor( colors[0] ); 515 m_back->setColor( colors[0] );
514 m_selected->setColor( colors[1] ); 516 m_selected->setColor( colors[1] );
515} 517}
516 518
517void ColorConfig::getColors(QColor *colors) 519void ColorConfig::getColors(QColor *colors)
518{ 520{
519 colors[0] = m_back->color(); 521 colors[0] = m_back->color();
520 colors[1] = m_selected->color(); 522 colors[1] = m_selected->color();
521} 523}
522 524
523FontConfig::FontConfig( QWidget *parent, char *name ) 525FontConfig::FontConfig( QWidget *parent, char *name )
524 : QWidget( parent, name ) 526 : QWidget( parent, name )
525{ 527{
526 // sizemanagment 528 // sizemanagment
527 QGridLayout *grid = new QGridLayout( this, 1, 1 ); 529 QGridLayout *grid = new QGridLayout( this, 1, 1 );
528#if 0 530// QString familyStr = cfg. readEntry ( "FontFamily", "Helvetica" );
529 m_fontchooser = new KFontChooser ( this ); 531// QString styleStr = cfg. readEntry ( "FontStyle", "Regular" );
530 m_fontchooser->enableColumn(KFontChooser::StyleList, false); 532// int size = cfg. readNumEntry ( "FontSize", 10 );
531 grid->addWidget( m_fontchooser, 0, 0); 533// OFontSelector *m_fontselect;
532 534
533 connect (m_fontchooser, SIGNAL (fontSelected( const QFont & )), this, SLOT (slotFontSelected( const QFont & ))); 535 m_fontselect = new OFontSelector ( false, this, "FontTab" );
534#endif 536// m_fontselect-> setSelectedFont ( familyStr, styleStr, size );
537// QWhatsThis::add( m_fontselect,
538// tr( "Select the desired name, style and size of the default font applications will use." ) );
539
540 connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )),
541 this, SLOT( slotFontSelected( const QFont & )));
542 grid->addWidget( m_fontselect, 0, 0);
543
544
545// #if 0
546// m_fontchooser = new KFontChooser ( this );
547// m_fontchooser->enableColumn(KFontChooser::StyleList, false);
548// grid->addWidget( m_fontchooser, 0, 0);
549
550// connect (m_fontchooser, SIGNAL (fontSelected( const QFont & )), this, SLOT (slotFontSelected( const QFont & )));
551// #endif
535} 552}
536 553
537FontConfig::~FontConfig() 554FontConfig::~FontConfig()
538{ 555{
539} 556}
540 557
541void FontConfig::setFont ( const QFont &font ) 558void FontConfig::setFont ( const QFont &font )
542{ 559{
543#if 0 560//#if 0
544 m_fontchooser->setFont (font); 561m_fontselect->setFont (font);
545 myFont = font; 562 myFont = font;
546#endif 563//#endif
547} 564}
548 565
549void FontConfig::slotFontSelected( const QFont &font ) 566void FontConfig::slotFontSelected( const QFont &font )
550{ 567{
551 myFont = font; 568 myFont = font;
552} 569}
553 570
554 571
555 572
556 573
diff --git a/noncore/apps/tinykate/libkate/view/kateviewdialog.h b/noncore/apps/tinykate/libkate/view/kateviewdialog.h
index 60f30bd..2ce5a11 100644
--- a/noncore/apps/tinykate/libkate/view/kateviewdialog.h
+++ b/noncore/apps/tinykate/libkate/view/kateviewdialog.h
@@ -1,97 +1,98 @@
1/*************************************************************************** 1/***************************************************************************
2 kateviewdialog.h - description 2 kateviewdialog.h - description
3 ------------------- 3 -------------------
4 copyright : (C) 2001 by The Kate Team 4 copyright : (C) 2001 by The Kate Team
5 (C) 2002 by Joseph Wenninger 5 (C) 2002 by Joseph Wenninger
6 email : kwrite-devel@kde.org 6 email : kwrite-devel@kde.org
7 jowenn@kde.org 7 jowenn@kde.org
8 8
9 ***************************************************************************/ 9 ***************************************************************************/
10 10
11/*************************************************************************** 11/***************************************************************************
12 * * 12 * *
13 * This program is free software; you can redistribute it and/or modify * 13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by * 14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or * 15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. * 16 * (at your option) any later version. *
17 * * 17 * *
18 ***************************************************************************/ 18 ***************************************************************************/
19// Dialogs 19// Dialogs
20 20
21#ifndef _KWDIALOG_H_ 21#ifndef _KWDIALOG_H_
22#define _KWDIALOG_H_ 22#define _KWDIALOG_H_
23 23
24 24
25class QCheckBox; 25class QCheckBox;
26class QLineEdit; 26class QLineEdit;
27class QPushButton; 27class QPushButton;
28class QRadioButton; 28class QRadioButton;
29class QSpinBox; 29class QSpinBox;
30class KColorButton; 30class KColorButton;
31class QComboBox; 31class QComboBox;
32 32
33#include <kdialogbase.h> 33#include <kdialogbase.h>
34#include <opie/ofontselector.h>
34#include "kateview.h" 35#include "kateview.h"
35 36
36class SearchDialog : public KDialogBase 37class SearchDialog : public KDialogBase
37{ 38{
38 Q_OBJECT 39 Q_OBJECT
39 40
40 public: 41 public:
41 SearchDialog( QWidget *parent, QStringList &searchFor, QStringList &replaceWith, int flags ); 42 SearchDialog( QWidget *parent, QStringList &searchFor, QStringList &replaceWith, int flags );
42 QString getSearchFor(); 43 QString getSearchFor();
43 QString getReplaceWith(); 44 QString getReplaceWith();
44 int getFlags(); 45 int getFlags();
45 void setSearchText( const QString &searchstr ); 46 void setSearchText( const QString &searchstr );
46 47
47 protected slots: 48 protected slots:
48 void slotOk(); 49 void slotOk();
49 50
50 protected: 51 protected:
51 QComboBox *m_search; 52 QComboBox *m_search;
52 QComboBox *m_replace; 53 QComboBox *m_replace;
53 QCheckBox *m_opt1; 54 QCheckBox *m_opt1;
54 QCheckBox *m_opt2; 55 QCheckBox *m_opt2;
55 QCheckBox *m_opt3; 56 QCheckBox *m_opt3;
56 QCheckBox *m_optRegExp; 57 QCheckBox *m_optRegExp;
57 QCheckBox *m_opt4; 58 QCheckBox *m_opt4;
58 QCheckBox *m_opt5; 59 QCheckBox *m_opt5;
59 QCheckBox *m_opt6; 60 QCheckBox *m_opt6;
60}; 61};
61 62
62class ReplacePrompt : public KDialogBase 63class ReplacePrompt : public KDialogBase
63{ 64{
64 Q_OBJECT 65 Q_OBJECT
65 66
66 public: 67 public:
67 68
68 ReplacePrompt(QWidget *parent); 69 ReplacePrompt(QWidget *parent);
69 70
70 signals: 71 signals:
71 72
72 void clicked(); 73 void clicked();
73 74
74 protected slots: 75 protected slots:
75 76
76 void slotUser1( void ); // All 77 void slotUser1( void ); // All
77 void slotUser2( void ); // No 78 void slotUser2( void ); // No
78 void slotUser3( void ); // Yes 79 void slotUser3( void ); // Yes
79 virtual void done(int); 80 virtual void done(int);
80 81
81 protected: 82 protected:
82 83
83 void closeEvent(QCloseEvent *); 84 void closeEvent(QCloseEvent *);
84}; 85};
85 86
86class GotoLineDialog : public KDialogBase 87class GotoLineDialog : public KDialogBase
87{ 88{
88 Q_OBJECT 89 Q_OBJECT
89 90
90 public: 91 public:
91 92
92 GotoLineDialog(QWidget *parent, int line, int max); 93 GotoLineDialog(QWidget *parent, int line, int max);
93 int getLine(); 94 int getLine();
94 95
95 protected: 96 protected:
96 97
97 QSpinBox *e1; 98 QSpinBox *e1;
@@ -122,73 +123,74 @@ class SelectConfigTab : public QWidget
122 123
123 SelectConfigTab(QWidget *parent, KateView *); 124 SelectConfigTab(QWidget *parent, KateView *);
124 void getData(KateView *); 125 void getData(KateView *);
125 126
126 protected: 127 protected:
127 128
128 static const int numFlags = 6; 129 static const int numFlags = 6;
129 static const int flags[numFlags]; 130 static const int flags[numFlags];
130 QCheckBox *opt[numFlags]; 131 QCheckBox *opt[numFlags];
131}; 132};
132 133
133class EditConfigTab : public QWidget 134class EditConfigTab : public QWidget
134{ 135{
135 Q_OBJECT 136 Q_OBJECT
136 137
137 public: 138 public:
138 139
139 EditConfigTab(QWidget *parent, KateView *); 140 EditConfigTab(QWidget *parent, KateView *);
140 void getData(KateView *); 141 void getData(KateView *);
141 142
142 protected: 143 protected:
143 144
144 static const int numFlags = 9; 145 static const int numFlags = 9;
145 static const int flags[numFlags]; 146 static const int flags[numFlags];
146 QCheckBox *opt[numFlags]; 147 QCheckBox *opt[numFlags];
147 QComboBox *encoding; 148 QComboBox *encoding;
148 149
149 150
150 QSpinBox *e1; 151 QSpinBox *e1;
151 QSpinBox *e2; 152 QSpinBox *e2;
152 QSpinBox *e3; 153 QSpinBox *e3;
153}; 154};
154 155
155class ColorConfig : public QWidget 156class ColorConfig : public QWidget
156{ 157{
157 Q_OBJECT 158 Q_OBJECT
158 159
159public: 160public:
160 161
161 ColorConfig( QWidget *parent = 0, char *name = 0 ); 162 ColorConfig( QWidget *parent = 0, char *name = 0 );
162 ~ColorConfig(); 163 ~ColorConfig();
163 164
164 void setColors( QColor * ); 165 void setColors( QColor * );
165 void getColors( QColor * ); 166 void getColors( QColor * );
166 167
167private: 168private:
168 169
169 KColorButton *m_back; 170 KColorButton *m_back;
170 KColorButton *m_selected; 171 KColorButton *m_selected;
171}; 172};
172 173
173class FontConfig : public QWidget 174class FontConfig : public QWidget
174{ 175{
175 Q_OBJECT 176 Q_OBJECT
176 177
177public: 178public:
178 179
179 FontConfig( QWidget *parent = 0, char *name = 0 ); 180 FontConfig( QWidget *parent = 0, char *name = 0 );
180 ~FontConfig(); 181 ~FontConfig();
181 182
182 void setFont ( const QFont &font ); 183 void setFont ( const QFont &font );
183 QFont getFont ( ) { return myFont; }; 184 QFont getFont ( ) { return myFont; };
184 185
185 private: 186 private:
187 OFontSelector *m_fontselect;
186// class KFontChooser *m_fontchooser; 188// class KFontChooser *m_fontchooser;
187 QFont myFont; 189 QFont myFont;
188 190
189 private slots: 191 private slots:
190 void slotFontSelected( const QFont &font ); 192 void slotFontSelected( const QFont &font );
191}; 193};
192 194
193 195
194#endif //_KWDIALOG_H_ 196#endif //_KWDIALOG_H_