author | llornkcor <llornkcor> | 2002-12-22 18:24:31 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-12-22 18:24:31 (UTC) |
commit | 3ae485ccb47ca618bc00d96a0e81c978a1cfbdaf (patch) (unidiff) | |
tree | f4a50457221d593f258d2f3f3d55c7b47a7b976d | |
parent | c82ed38520b4038678ab0ab0c9f0ba147d8791ea (diff) | |
download | opie-3ae485ccb47ca618bc00d96a0e81c978a1cfbdaf.zip opie-3ae485ccb47ca618bc00d96a0e81c978a1cfbdaf.tar.gz opie-3ae485ccb47ca618bc00d96a0e81c978a1cfbdaf.tar.bz2 |
use ofontselector, and temp fix for dialog crash
-rw-r--r-- | noncore/apps/tinykate/libkate/view/kateview.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/tinykate/libkate/view/kateviewdialog.cpp | 37 | ||||
-rw-r--r-- | noncore/apps/tinykate/libkate/view/kateviewdialog.h | 2 |
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 | |||
@@ -2333,33 +2333,33 @@ void KateView::configDialog() | |||
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 | ||
2354 | int KateView::getHl() { | 2354 | int KateView::getHl() { |
2355 | return myDoc->highlightNum(); | 2355 | return myDoc->highlightNum(); |
2356 | } | 2356 | } |
2357 | 2357 | ||
2358 | void KateView::setDontChangeHlOnSave() | 2358 | void KateView::setDontChangeHlOnSave() |
2359 | { | 2359 | { |
2360 | myDoc->setDontChangeHlOnSave(); | 2360 | myDoc->setDontChangeHlOnSave(); |
2361 | } | 2361 | } |
2362 | 2362 | ||
2363 | void KateView::setHl(int n) { | 2363 | void KateView::setHl(int n) { |
2364 | myDoc->setHighlight(n); | 2364 | myDoc->setHighlight(n); |
2365 | myDoc->setDontChangeHlOnSave(); | 2365 | myDoc->setDontChangeHlOnSave(); |
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 | |||
@@ -33,32 +33,34 @@ | |||
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 | ||
50 | SearchDialog::SearchDialog( QWidget *parent, QStringList &searchFor, QStringList &replaceWith, int flags ) | 52 | SearchDialog::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 ); |
@@ -512,45 +514,60 @@ void 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 | ||
517 | void ColorConfig::getColors(QColor *colors) | 519 | void 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 | ||
523 | FontConfig::FontConfig( QWidget *parent, char *name ) | 525 | FontConfig::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 | ||
537 | FontConfig::~FontConfig() | 554 | FontConfig::~FontConfig() |
538 | { | 555 | { |
539 | } | 556 | } |
540 | 557 | ||
541 | void FontConfig::setFont ( const QFont &font ) | 558 | void FontConfig::setFont ( const QFont &font ) |
542 | { | 559 | { |
543 | #if 0 | 560 | //#if 0 |
544 | m_fontchooser->setFont (font); | 561 | m_fontselect->setFont (font); |
545 | myFont = font; | 562 | myFont = font; |
546 | #endif | 563 | //#endif |
547 | } | 564 | } |
548 | 565 | ||
549 | void FontConfig::slotFontSelected( const QFont &font ) | 566 | void 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 | |||
@@ -18,32 +18,33 @@ | |||
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 | ||
25 | class QCheckBox; | 25 | class QCheckBox; |
26 | class QLineEdit; | 26 | class QLineEdit; |
27 | class QPushButton; | 27 | class QPushButton; |
28 | class QRadioButton; | 28 | class QRadioButton; |
29 | class QSpinBox; | 29 | class QSpinBox; |
30 | class KColorButton; | 30 | class KColorButton; |
31 | class QComboBox; | 31 | class 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 | ||
36 | class SearchDialog : public KDialogBase | 37 | class 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 | ||
@@ -170,25 +171,26 @@ private: | |||
170 | KColorButton *m_selected; | 171 | KColorButton *m_selected; |
171 | }; | 172 | }; |
172 | 173 | ||
173 | class FontConfig : public QWidget | 174 | class FontConfig : public QWidget |
174 | { | 175 | { |
175 | Q_OBJECT | 176 | Q_OBJECT |
176 | 177 | ||
177 | public: | 178 | public: |
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_ |