summaryrefslogtreecommitdiff
authorsandman <sandman>2002-11-28 00:35:42 (UTC)
committer sandman <sandman>2002-11-28 00:35:42 (UTC)
commit57ad30fb514428e068142e31ee40aa1615291123 (patch) (side-by-side diff)
treee5fd98fec4f207730e1e7e6cbda1044e96711cad
parent27fe94d8aec5ffff56b39eb89b0e36f2b1c229ed (diff)
downloadopie-57ad30fb514428e068142e31ee40aa1615291123.zip
opie-57ad30fb514428e068142e31ee40aa1615291123.tar.gz
opie-57ad30fb514428e068142e31ee40aa1615291123.tar.bz2
two small fixes for the new "no style" list:
- changes are saved on "OK" even when the embedded lineedit has the focus - the order of the entries not reversed on each invocation anymore
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/appearance2/appearance.cpp8
-rw-r--r--noncore/settings/appearance2/exceptlistitem.h2
2 files changed, 7 insertions, 3 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index 22b12b4..f611799 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -283,12 +283,13 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
m_except-> setColumnAlignment ( 2, AlignCenter );
m_except-> setAllColumnsShowFocus ( true );
m_except-> setMinimumHeight ( 30 );
m_except-> header ( )-> setClickEnabled ( false );
m_except-> header ( )-> setResizeEnabled ( false );
m_except-> header ( )-> setMovingEnabled ( false );
+ m_except-> setSorting ( -1 );
lay-> addMultiCellWidget ( m_except, 2, 6, 0, 0 );
connect ( m_except, SIGNAL( clicked ( QListViewItem *, const QPoint &, int )), this, SLOT( clickedExcept ( QListViewItem *, const QPoint &, int )));
QToolButton *tb = new QToolButton ( tab );
tb-> setIconSet ( Resource::loadIconSet ( "appearance/add" ));
@@ -315,16 +316,17 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
connect ( tb, SIGNAL( clicked ( )), this, SLOT( downExcept ( )));
lay-> setRowStretch ( 6, 10 );
lay-> setColStretch ( 0, 10 );
QStringList sl = cfg. readListEntry ( "NoStyle", ';' );
+ QListViewItem *lvit = 0;
for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) {
int fl = ( *it ). left ( 1 ). toInt ( 0, 32 );
- new ExceptListItem ( m_except, ( *it ). mid ( 1 ), fl & 0x01, fl & 0x02, fl & 0x04 );
+ lvit = new ExceptListItem ( m_except, lvit, ( *it ). mid ( 1 ), fl & 0x01, fl & 0x02, fl & 0x04 );
}
vertLayout-> addSpacing ( 3 );
QFrame *f = new QFrame ( tab );
f-> setFrameStyle ( QFrame::HLine | QFrame::Sunken );
@@ -452,12 +454,14 @@ void Appearance::accept ( )
if ( item )
item-> save ( config );
}
+ m_except-> setFocus ( ); // if the focus was on the embedded line-edit, we have to move it away first, so the contents are updated
+
QStringList sl;
for ( ExceptListItem *it = (ExceptListItem *) m_except-> firstChild ( ); it; it = (ExceptListItem *) it-> nextSibling ( )) {
int fl = 0;
fl |= ( it-> noStyle ( ) ? 0x01 : 0 );
fl |= ( it-> noFont ( ) ? 0x02 : 0 );
fl |= ( it-> noDeco ( ) ? 0x04 : 0 );
@@ -649,13 +653,13 @@ void Appearance::deleteSchemeClicked()
}
}
void Appearance::addExcept ( )
{
- ExceptListItem *it = new ExceptListItem ( m_except, tr( "<new>" ), true, true, true );
+ ExceptListItem *it = new ExceptListItem ( m_except, 0, tr( "<new>" ), true, true, true );
m_except-> ensureItemVisible ( it );
m_except-> setSelected ( it, true );
}
void Appearance::delExcept ( )
{
diff --git a/noncore/settings/appearance2/exceptlistitem.h b/noncore/settings/appearance2/exceptlistitem.h
index 5eda79c..7b4fa48 100644
--- a/noncore/settings/appearance2/exceptlistitem.h
+++ b/noncore/settings/appearance2/exceptlistitem.h
@@ -32,13 +32,13 @@
#include <qpixmap.h>
#include <qimage.h>
#include <qpainter.h>
class ExceptListItem : public QListViewItem {
public:
- ExceptListItem ( QListView *lv, const QString &t, bool nostyle = true, bool nofont = true, bool nodeco = true ) : QListViewItem ( lv )
+ ExceptListItem ( QListView *lv, QListViewItem *after, const QString &t, bool nostyle = true, bool nofont = true, bool nodeco = true ) : QListViewItem ( lv, after )
{
m_text = t;
m_nofont = nofont;
m_nostyle = nostyle;
m_nodeco = nodeco;