summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Rules.make6
-rw-r--r--config.in8
-rw-r--r--library/library.pro6
-rw-r--r--library/qpeapplication.cpp40
-rw-r--r--library/qpeapplication.h5
-rw-r--r--library/qt_override.cpp170
-rw-r--r--library/qt_override_p.h25
-rw-r--r--noncore/settings/appearance2/appearance.cpp210
-rw-r--r--noncore/settings/appearance2/appearance.h8
9 files changed, 5 insertions, 473 deletions
diff --git a/Rules.make b/Rules.make
index 3fbce76..64237cf 100644
--- a/Rules.make
+++ b/Rules.make
@@ -54,18 +54,12 @@ ifeq ($(CONFIG_SQL_PIM_BACKEND),y)
54else 54else
55 echo ENABLE_SQL_PIM_BACKEND=n >> $@ 55 echo ENABLE_SQL_PIM_BACKEND=n >> $@
56endif 56endif
57ifeq ($(CONFIG_OPIE_NO_OVERRIDE_QT),y)
58 echo CONFIG += no-override >> $@
59endif
60ifeq ($(CONFIG_OPIELOGIN_USEPAM),y) 57ifeq ($(CONFIG_OPIELOGIN_USEPAM),y)
61 echo CONFIG += OPIELOGIN_USEPAM >> $@ 58 echo CONFIG += OPIELOGIN_USEPAM >> $@
62endif 59endif
63ifeq ($(CONFIG_LIBQPE_WITHROHFEEDBACK),y) 60ifeq ($(CONFIG_LIBQPE_WITHROHFEEDBACK),y)
64 echo CONFIG += LIBQPE_WITHROHFEEDBACK >> $@ 61 echo CONFIG += LIBQPE_WITHROHFEEDBACK >> $@
65endif 62endif
66ifeq ($(CONFIG_OPIE_NO_ERASERECT_FIX),y)
67 echo DEFINES += OPIE_NO_ERASE_RECT_HACKFIX >> $@
68endif
69ifeq ($(CONFIG_OPIE_NO_BUILTIN_SHUTDOWN),y) 63ifeq ($(CONFIG_OPIE_NO_BUILTIN_SHUTDOWN),y)
70 echo DEFINES += OPIE_NO_BUILTIN_SHUTDOWN >> $@ 64 echo DEFINES += OPIE_NO_BUILTIN_SHUTDOWN >> $@
71endif 65endif
diff --git a/config.in b/config.in
index 323ca51..f913aad 100644
--- a/config.in
+++ b/config.in
@@ -123,14 +123,6 @@ config USE_CCACHE
123endmenu 123endmenu
124 124
125menu "Configuration" 125menu "Configuration"
126config OPIE_NO_OVERRIDE_QT
127 boolean "Build Opie against an unpatched version of Qt"
128 default n
129
130config OPIE_NO_ERASERECT_FIX
131 boolean "Disable Fixup eraseRect for HancomMobileWord,neocal.. to make libopiecore work on Sharps libqpe"
132 default n
133
134config OPIE_NO_BUILTIN_SHUTDOWN 126config OPIE_NO_BUILTIN_SHUTDOWN
135 boolean "Disable the built in shutdown application" 127 boolean "Disable the built in shutdown application"
136 default y 128 default y
diff --git a/library/library.pro b/library/library.pro
index 04e125f..95c18a2 100644
--- a/library/library.pro
+++ b/library/library.pro
@@ -59,7 +59,6 @@ HEADERS = calendar.h \
59 windowdecorationinterface.h \ 59 windowdecorationinterface.h \
60 textcodecinterface.h \ 60 textcodecinterface.h \
61 imagecodecinterface.h \ 61 imagecodecinterface.h \
62 qt_override_p.h \
63 qpeglobal.h 62 qpeglobal.h
64 63
65 SOURCES= calendar.cpp \ 64 SOURCES= calendar.cpp \
@@ -117,7 +116,6 @@ SOURCES = calendar.cpp \
117 findwidget_p.cpp \ 116 findwidget_p.cpp \
118 finddialog.cpp \ 117 finddialog.cpp \
119 lnkproperties.cpp \ 118 lnkproperties.cpp \
120 qt_override.cpp \
121 widget_showing.cpp 119 widget_showing.cpp
122 120
123 121
@@ -134,10 +132,6 @@ VERSION = 1.5.0.1
134 132
135include( $(OPIEDIR)/include.pro ) 133include( $(OPIEDIR)/include.pro )
136 134
137contains( CONFIG, no-override ){
138 DEFINES += OPIE_NO_OVERRIDE_QT
139}
140
141contains( CONFIG, LIBQPE_WITHROHFEEDBACK ){ 135contains( CONFIG, LIBQPE_WITHROHFEEDBACK ){
142 DEFINES += OPIE_WITHROHFEEDBACK 136 DEFINES += OPIE_WITHROHFEEDBACK
143 SOURCES += backend/rohfeedback.cpp 137 SOURCES += backend/rohfeedback.cpp
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 1c5ced3..2bd7cbe 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -96,7 +96,6 @@
96#ifndef QT_NO_SOUND 96#ifndef QT_NO_SOUND
97#include <sys/soundcard.h> 97#include <sys/soundcard.h>
98#endif 98#endif
99#include "qt_override_p.h"
100 99
101#include <backend/rohfeedback.h> 100#include <backend/rohfeedback.h>
102 101
@@ -1352,31 +1351,9 @@ void QPEApplication::applyStyle()
1352 config.setGroup( "Appearance" ); 1351 config.setGroup( "Appearance" );
1353 1352
1354#if QT_VERSION > 233 1353#if QT_VERSION > 233
1355#if !defined(OPIE_NO_OVERRIDE_QT)
1356 // don't block ourselves ...
1357 Opie::force_appearance = 0;
1358
1359 static QString appname = Opie::binaryName ( );
1360
1361 QStringList ex = config. readListEntry ( "NoStyle", ';' );
1362 int nostyle = 0;
1363 for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) {
1364 if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) {
1365 nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 );
1366 break;
1367 }
1368 }
1369#else
1370 int nostyle = 0;
1371#endif
1372
1373 // Widget style 1354 // Widget style
1374 QString style = config.readEntry( "Style", "FlatStyle" ); 1355 QString style = config.readEntry( "Style", "FlatStyle" );
1375 1356
1376 // don't set a custom style
1377 if ( nostyle & Opie::Force_Style )
1378 style = "FlatStyle";
1379
1380 internalSetStyle ( style ); 1357 internalSetStyle ( style );
1381 1358
1382 // Colors - from /etc/colors/Liquid.scheme 1359 // Colors - from /etc/colors/Liquid.scheme
@@ -1407,11 +1384,6 @@ void QPEApplication::applyStyle()
1407 // Window Decoration 1384 // Window Decoration
1408 QString dec = config.readEntry( "Decoration", "Flat" ); 1385 QString dec = config.readEntry( "Decoration", "Flat" );
1409 1386
1410 // don't set a custom deco
1411 if ( nostyle & Opie::Force_Decoration )
1412 dec = "";
1413
1414
1415 if ( dec != d->decorationName ) { 1387 if ( dec != d->decorationName ) {
1416 qwsSetDecoration( new QPEDecoration( dec ) ); 1388 qwsSetDecoration( new QPEDecoration( dec ) );
1417 d->decorationName = dec; 1389 d->decorationName = dec;
@@ -1421,19 +1393,7 @@ void QPEApplication::applyStyle()
1421 QString ff = config.readEntry( "FontFamily", font().family() ); 1393 QString ff = config.readEntry( "FontFamily", font().family() );
1422 int fs = config.readNumEntry( "FontSize", font().pointSize() ); 1394 int fs = config.readNumEntry( "FontSize", font().pointSize() );
1423 1395
1424 // don't set a custom font
1425 if ( nostyle & Opie::Force_Font ) {
1426 ff = "Vera";
1427 fs = 10;
1428 }
1429
1430 setFont ( QFont ( ff, fs ), true ); 1396 setFont ( QFont ( ff, fs ), true );
1431
1432#if !defined(OPIE_NO_OVERRIDE_QT)
1433 // revert to global blocking policy ...
1434 Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None;
1435 Opie::force_appearance &= ~nostyle;
1436#endif
1437#endif 1397#endif
1438} 1398}
1439 1399
diff --git a/library/qpeapplication.h b/library/qpeapplication.h
index 849d5b3..167fe69 100644
--- a/library/qpeapplication.h
+++ b/library/qpeapplication.h
@@ -166,11 +166,6 @@ protected:
166 void timerEvent( QTimerEvent * ); 166 void timerEvent( QTimerEvent * );
167 bool raiseAppropriateWindow(); 167 bool raiseAppropriateWindow();
168 virtual void tryQuit(); 168 virtual void tryQuit();
169#ifndef OPIE_NO_ERASE_RECT_HACKFIX
170 #if QT_VERSION > 233
171 virtual void polish ( QWidget * ); // this is actually implemented in qt_override.cpp (!)
172 #endif
173#endif
174private: 169private:
175 void mapToDefaultAction( QWSKeyEvent *ke, int defKey ); 170 void mapToDefaultAction( QWSKeyEvent *ke, int defKey );
176 void processQCopFile(); 171 void processQCopFile();
diff --git a/library/qt_override.cpp b/library/qt_override.cpp
deleted file mode 100644
index a0d753b..0000000
--- a/library/qt_override.cpp
+++ b/dev/null
@@ -1,170 +0,0 @@
1
2#include <qpe/qpeapplication.h>
3#include <qfontdatabase.h>
4
5#include <unistd.h>
6#include <stdlib.h>
7#include <stdio.h>
8#include <limits.h>
9#include <sys/param.h> // for toolchains with old libc headers
10
11#include <qtopia/qpeglobal.h>
12#include "qt_override_p.h"
13
14#if QT_VERSION > 233
15
16#ifndef OPIE_NO_ERASE_RECT_HACKFIX
17struct color_fix_t {
18 char *m_app;
19 char *m_class;
20 char *m_name;
21 QColorGroup::ColorRole m_set;
22 QColorGroup::ColorRole m_get;
23};
24
25
26
27static const color_fix_t apps_that_need_special_colors [] = {
28 { "HancomMobileWord", "HTextEdit", 0, QColorGroup::Background, QColorGroup::Base },
29 { "neocal", "Display", 0, QColorGroup::Background, QColorGroup::Base },
30
31 { 0, 0, 0, QColorGroup::Base, QColorGroup::Base }
32};
33
34#endif
35
36#ifndef OPIE_NO_OVERRIDE_QT
37
38static const char * const apps_that_need_pointsizes_times_10 [] = {
39 "HancomMobileWord",
40 "hancomsheet",
41 "HancomPresenterViewer",
42
43 0
44};
45
46
47
48
49int Opie::force_appearance = 0;
50
51
52// Return the *real* name of the binary - not just a quick guess
53// by looking at argv [0] (which could be anything)
54
55static void binaryNameFree ( )
56{
57 ::free ((void *) Opie::binaryName ( )); // we need to cast away the const here
58}
59
60const char *Opie::binaryName ( )
61{
62 static const char *appname = 0;
63
64 if ( !appname ) {
65 char dst [PATH_MAX + 1];
66 int l = ::readlink ( "/proc/self/exe", dst, PATH_MAX );
67
68 if ( l <= 0 )
69 l = 0;
70
71 dst [l] = 0;
72 const char *b = ::strrchr ( dst, '/' );
73 appname = ::strdup ( b ? b + 1 : dst );
74
75 ::atexit ( binaryNameFree );
76 }
77 return appname;
78}
79
80#else
81int Opie::force_appearance = 0;
82#endif
83
84// Fix for a toolchain incompatibility (binaries compiled with
85// old tcs using shared libs compiled with newer tcs)
86
87extern "C" {
88
89extern void __gmon_start__ ( ) QPE_WEAK_SYMBOL;
90extern void __gmon_start__ ( )
91{
92}
93
94}
95
96
97#ifndef OPIE_NO_ERASE_RECT_HACKFIX
98// Fix for apps, that use QPainter::eraseRect() which doesn't work with styles
99// that set a background pixmap (it would be easier to fix eraseRect(), but
100// TT made it an inline ...)
101
102void QPEApplication::polish ( QWidget *w )
103{
104#ifndef OPIE_NO_OVERRIDE_QT
105 for ( const color_fix_t *ptr = apps_that_need_special_colors; ptr-> m_app; ptr++ ) {
106 if (( ::strcmp ( Opie::binaryName ( ), ptr-> m_app ) == 0 ) &&
107 ( ptr-> m_class ? w-> inherits ( ptr-> m_class ) : true ) &&
108 ( ptr-> m_name ? ( ::strcmp ( w-> name ( ), ptr-> m_name ) == 0 ) : true )) {
109 QPalette pal = w-> palette ( );
110 pal. setColor ( ptr-> m_set, pal. color ( QPalette::Active, ptr-> m_get ));
111 w-> setPalette ( pal );
112 }
113 }
114#endif
115 QApplication::polish ( w );
116}
117#endif
118
119
120#ifndef OPIE_NO_OVERRIDE_QT
121// Fix for the binary incompatibility that TT introduced in Qt/E 2.3.4 -- point sizes
122// were multiplied by 10 (which was incorrect)
123
124QValueList <int> QFontDatabase::pointSizes ( QString const &family, QString const &style, QString const &charset )
125{
126 QValueList <int> sl = pointSizes_NonWeak ( family, style, charset );
127
128 for ( const char * const *ptr = apps_that_need_pointsizes_times_10; *ptr; ptr++ ) {
129 if ( ::strcmp ( Opie::binaryName ( ), *ptr ) == 0 ) {
130 for ( QValueList <int>::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
131 *it *= 10;
132 }
133 }
134 return sl;
135}
136
137
138// Various style/font/color related overrides for weak symbols in Qt/E,
139// which allows us to force the usage of the global Opie appearance.
140
141void QApplication::setStyle ( QStyle *style )
142{
143 if ( Opie::force_appearance & Opie::Force_Style )
144 delete style;
145 else
146 QApplication::setStyle_NonWeak ( style );
147}
148
149void QApplication::setPalette ( const QPalette &pal, bool informWidgets, const char *className )
150{
151 if (!( Opie::force_appearance & Opie::Force_Style ))
152 QApplication::setPalette_NonWeak ( pal, informWidgets, className );
153}
154
155void QApplication::setFont ( const QFont &fnt, bool informWidgets, const char *className )
156{
157 if (!( Opie::force_appearance & Opie::Force_Font ))
158 QApplication::setFont_NonWeak ( fnt, informWidgets, className );
159}
160
161
162void QApplication::qwsSetDecoration ( QWSDecoration *deco )
163{
164 if ( Opie::force_appearance & Opie::Force_Decoration )
165 delete deco;
166 else
167 QApplication::qwsSetDecoration_NonWeak ( deco );
168}
169#endif
170#endif
diff --git a/library/qt_override_p.h b/library/qt_override_p.h
deleted file mode 100644
index cb05d15..0000000
--- a/library/qt_override_p.h
+++ b/dev/null
@@ -1,25 +0,0 @@
1#ifndef __QT_OVERRIDE_H__
2#define __QT_OVERRIDE_H__
3
4#if QT_VERSION > 233
5
6namespace Opie {
7
8enum ForceAppearance {
9 Force_Style = 0x01,
10 Force_Font = 0x02,
11 Force_Decoration = 0x04,
12
13 Force_All = 0xff,
14 Force_None = 0x00,
15};
16
17extern const char *binaryName ( );
18
19extern int force_appearance;
20
21}
22
23#endif // (QT_VERSION >233)
24
25#endif
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index 088171c..d649ed6 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -293,85 +293,6 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
293 QWidget *tab = new QWidget ( parent ); 293 QWidget *tab = new QWidget ( parent );
294 QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); 294 QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 );
295 295
296 QGridLayout *lay = new QGridLayout ( vertLayout, 0, 0, 3, 0 );
297
298 m_force = new QCheckBox ( tr( "Force styling for all applications." ), tab );
299 m_force-> setChecked ( cfg. readBoolEntry ( "ForceStyle" ));
300 lay-> addMultiCellWidget ( m_force, 0, 0, 0, 1 );
301 QWhatsThis::add( m_force, tr( "Click here to allow all applications to use global appearance settings." ) );
302
303 QLabel *l = new QLabel ( tab );
304 l-> setText ( QString ( "<p>%1</p>" ). arg ( tr( "Disable styling for these applications ( <b>*</b> can be used as a wildcard):" )));
305 lay-> addMultiCellWidget ( l, 1, 1, 0, 1 );
306 QWhatsThis::add( l, tr( "If some applications do not display correctly with the global appearance settings, certain features can be turned off for that application.\n\nThis area allows you to select an application and which settings you wish to disable." ) );
307
308 m_except = new QListView ( tab );
309 m_except-> addColumn ( Resource::loadIconSet ( "appearance" ), "", 24 );
310 m_except-> addColumn ( Resource::loadIconSet ( "font" ), "", 24 );
311 m_except-> addColumn ( Resource::loadIconSet ( "appearance/deco" ), "", 24 );
312 m_except-> addColumn ( tr( "Binary file(s)" ));
313 m_except-> setColumnAlignment ( 0, AlignCenter );
314 m_except-> setColumnAlignment ( 1, AlignCenter );
315 m_except-> setColumnAlignment ( 2, AlignCenter );
316 m_except-> setAllColumnsShowFocus ( true );
317 m_except-> setMinimumHeight ( 30 );
318 m_except-> header ( )-> setClickEnabled ( false );
319 m_except-> header ( )-> setResizeEnabled ( false );
320 m_except-> header ( )-> setMovingEnabled ( false );
321 m_except-> setSorting ( -1 );
322 lay-> addMultiCellWidget ( m_except, 2, 6, 0, 0 );
323 QWhatsThis::add( m_except, tr( "If some applications do not display correctly with the global appearance settings, certain features can be turned off for that application.\n\nThis area allows you to select an application and which settings you wish to disable." ) );
324
325 connect ( m_except, SIGNAL( clicked(QListViewItem*,const QPoint&,int)), this, SLOT( clickedExcept(QListViewItem*,const QPoint&,int)));
326
327 QToolButton *tb = new QToolButton ( tab );
328 tb-> setIconSet ( Resource::loadIconSet ( "appearance/add" ));
329 tb-> setFocusPolicy ( QWidget::StrongFocus );
330 lay-> addWidget ( tb, 2, 1 );
331 connect ( tb, SIGNAL( clicked()), this, SLOT( addExcept()));
332 QWhatsThis::add( tb, tr( "Click here to add an application to the list above." ) );
333
334 tb = new QToolButton ( tab );
335 tb-> setIconSet ( Resource::loadIconSet ( "editdelete" ));
336 tb-> setFocusPolicy ( QWidget::StrongFocus );
337 lay-> addWidget ( tb, 3, 1 );
338 connect ( tb, SIGNAL( clicked()), this, SLOT( delExcept()));
339 QWhatsThis::add( tb, tr( "Click here to delete the currently selected application." ) );
340
341 tb = new QToolButton ( tab );
342 tb-> setIconSet ( Resource::loadIconSet ( "up" ));
343 tb-> setFocusPolicy ( QWidget::StrongFocus );
344 lay-> addWidget ( tb, 4, 1 );
345 connect ( tb, SIGNAL( clicked()), this, SLOT( upExcept()));
346 QWhatsThis::add( tb, tr( "Click here to move the currently selected application up in the list." ) );
347
348 tb = new QToolButton ( tab );
349 tb-> setIconSet ( Resource::loadIconSet ( "down" ));
350 tb-> setFocusPolicy ( QWidget::StrongFocus );
351 lay-> addWidget ( tb, 5, 1 );
352 connect ( tb, SIGNAL( clicked()), this, SLOT( downExcept()));
353 QWhatsThis::add( tb, tr( "Click here to move the currently selected application down in the list." ) );
354
355 lay-> setRowStretch ( 6, 10 );
356 lay-> setColStretch ( 0, 10 );
357
358 QStringList sl = cfg. readListEntry ( "NoStyle", ';' );
359 QListViewItem *lvit = 0;
360 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
361 {
362 int fl = ( *it ). left ( 1 ). toInt ( 0, 32 );
363
364 lvit = new ExceptListItem ( m_except, lvit, ( *it ). mid ( 1 ), fl & 0x01, fl & 0x02, fl & 0x04 );
365 }
366
367
368 vertLayout-> addSpacing ( 3 );
369 QFrame *f = new QFrame ( tab );
370 f-> setFrameStyle ( QFrame::HLine | QFrame::Sunken );
371 vertLayout-> addWidget ( f );
372 vertLayout-> addSpacing ( 3 );
373
374
375 QGridLayout* gridLayout = new QGridLayout ( vertLayout, 0, 0, 3, 0 ); 296 QGridLayout* gridLayout = new QGridLayout ( vertLayout, 0, 0, 3, 0 );
376 297
377 int style = cfg. readNumEntry ( "TabStyle", 2 ) - 1; 298 int style = cfg. readNumEntry ( "TabStyle", 2 ) - 1;
@@ -455,6 +376,11 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
455 m_rotdir_ccw-> setChecked ( rot == CCW ); 376 m_rotdir_ccw-> setChecked ( rot == CCW );
456 m_rotdir_flip-> setChecked ( rot == Flip ); 377 m_rotdir_flip-> setChecked ( rot == Flip );
457 378
379
380 /*
381 * add a spacing
382 */
383 vertLayout->addItem( new QSpacerItem( 1, 1, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) );
458 return tab; 384 return tab;
459} 385}
460 386
@@ -567,23 +493,6 @@ void Appearance::accept ( )
567 } 493 }
568 config. writeEntry ( "rotatedir", (int)rot ); 494 config. writeEntry ( "rotatedir", (int)rot );
569 495
570 m_except-> setFocus ( ); // if the focus was on the embedded line-edit, we have to move it away first, so the contents are updated
571
572 QStringList sl;
573 QString exceptstr;
574 for ( ExceptListItem *it = (ExceptListItem *) m_except-> firstChild ( ); it; it = (ExceptListItem *) it-> nextSibling ( ))
575 {
576 int fl = 0;
577 fl |= ( it-> noStyle ( ) ? 0x01 : 0 );
578 fl |= ( it-> noFont ( ) ? 0x02 : 0 );
579 fl |= ( it-> noDeco ( ) ? 0x04 : 0 );
580 exceptstr = QString::number ( fl, 32 );
581 exceptstr.append( it-> pattern ( ));
582 sl << exceptstr;
583 }
584 config. writeEntry ( "NoStyle", sl, ';' );
585 config. writeEntry ( "ForceStyle", m_force-> isChecked ( ));
586
587 config. write ( ); // need to flush the config info first 496 config. write ( ); // need to flush the config info first
588 Global::applyStyle ( ); 497 Global::applyStyle ( );
589 498
@@ -781,112 +690,3 @@ void Appearance::deleteSchemeClicked()
781 QMessageBox::information( this, tr( "Delete scheme" ), tr( "Unable to delete current scheme." )); 690 QMessageBox::information( this, tr( "Delete scheme" ), tr( "Unable to delete current scheme." ));
782 } 691 }
783} 692}
784
785
786void Appearance::addExcept ( )
787{
788 ExceptListItem *it = new ExceptListItem ( m_except, 0, tr( "<new>" ), true, true, true );
789 m_except-> ensureItemVisible ( it );
790 m_except-> setSelected ( it, true );
791}
792
793void Appearance::delExcept ( )
794{
795 if ( m_except-> selectedItem ( ))
796 {
797 m_except-> setFocus ( );
798 delete m_except-> selectedItem ( );
799 }
800}
801
802void Appearance::upExcept ( )
803{
804 ExceptListItem *it = (ExceptListItem *) m_except-> selectedItem ( );
805
806 if ( it && it-> itemAbove ( ))
807 it-> itemAbove ( )-> moveItem ( it );
808}
809
810void Appearance::downExcept ( )
811{
812 ExceptListItem *it = (ExceptListItem *) m_except-> selectedItem ( );
813
814 if ( it && it-> itemBelow ( ))
815 it-> moveItem ( it-> itemBelow ( ));
816}
817
818class ExEdit : public QLineEdit
819{
820public:
821 ExEdit ( ExceptListItem *item )
822 : QLineEdit ( item-> listView ( )-> viewport ( ), "exedit" ), it ( item )
823 {
824 setFrame ( false );
825
826 QRect r = it-> listView ( )-> itemRect ( it );
827
828 int x = it-> listView ( )-> header ( )-> cellPos ( 3 ) - 1;
829 int y = r. y ( );
830 int w = it-> listView ( )-> viewport ( )-> width ( ) - x;
831 int h = r. height ( ); // + 2;
832
833 setText ( it-> pattern ( ));
834 setGeometry ( x, y, w, h );
835
836 odebug << "ExEdit: [" << it->text(2).latin1() << "] at "
837 << x << "," << y << " " << w << "," << h << oendl;
838
839 m_out = true;
840
841 show ( );
842 setFocus ( );
843 selectAll ( );
844 end ( true );
845 }
846
847 virtual void focusOutEvent ( QFocusEvent * )
848 {
849 hide ( );
850 if ( m_out )
851 it-> setPattern ( text ( ));
852 delete this;
853 }
854
855 virtual void keyPressEvent ( QKeyEvent *e )
856 {
857 if ( e-> key ( ) == Key_Return )
858 it-> listView ( )-> setFocus ( );
859 else if ( e-> key ( ) == Key_Escape )
860 {
861 m_out = false;
862 it-> listView ( )-> setFocus ( );
863 }
864 else
865 QLineEdit::keyPressEvent ( e );
866 }
867
868private:
869 ExceptListItem *it;
870 bool m_out;
871};
872
873void Appearance::clickedExcept ( QListViewItem *item, const QPoint &, int c )
874{
875 if ( !item || c < 0 || c > 3 )
876 return;
877
878 ExceptListItem *it = (ExceptListItem *) item;
879
880 if ( c == 0 )
881 it-> setNoStyle ( !it-> noStyle ( ));
882 else if ( c == 1 )
883 it-> setNoFont ( !it-> noFont ( ));
884 else if ( c == 2 )
885 it-> setNoDeco ( !it-> noDeco ( ));
886 else if ( c == 3 )
887 {
888 m_except-> ensureItemVisible ( it );
889 new ExEdit ( it );
890 }
891}
892
diff --git a/noncore/settings/appearance2/appearance.h b/noncore/settings/appearance2/appearance.h
index 134a918..de2f1ab 100644
--- a/noncore/settings/appearance2/appearance.h
+++ b/noncore/settings/appearance2/appearance.h
@@ -78,12 +78,6 @@ protected slots:
78 78
79 void tabChanged ( QWidget * ); 79 void tabChanged ( QWidget * );
80 80
81 void addExcept ( );
82 void delExcept ( );
83 void upExcept ( );
84 void downExcept ( );
85 void clickedExcept ( QListViewItem *, const QPoint &, int );
86
87private: 81private:
88 void changeText(); 82 void changeText();
89 83
@@ -125,8 +119,6 @@ private:
125 QRadioButton *m_rotdir_flip; 119 QRadioButton *m_rotdir_flip;
126 120
127 QWidget * m_advtab; 121 QWidget * m_advtab;
128 QListView * m_except;
129 QCheckBox * m_force;
130}; 122};
131 123
132#endif 124#endif