author | harlekin <harlekin> | 2002-09-20 20:19:14 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-09-20 20:19:14 (UTC) |
commit | d2d73b6391fbc7f743199f48387d13e887bbac1e (patch) (side-by-side diff) | |
tree | 7f289628796ee4bf0bf1f32d952b5455a42b17bd /core/pim/today/todayconfig.cpp | |
parent | 681e6e75efaa5577d376d0bb191afdf323cb4e75 (diff) | |
download | opie-d2d73b6391fbc7f743199f48387d13e887bbac1e.zip opie-d2d73b6391fbc7f743199f48387d13e887bbac1e.tar.gz opie-d2d73b6391fbc7f743199f48387d13e887bbac1e.tar.bz2 |
fixed the crash when closing config dialog and also sorting of the plugins is working now
Diffstat (limited to 'core/pim/today/todayconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/today/todayconfig.cpp | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp index 4f23471..532d126 100644 --- a/core/pim/today/todayconfig.cpp +++ b/core/pim/today/todayconfig.cpp @@ -37,3 +37,2 @@ public: : QToolButton( parent, name ) { - // setTextLabel( name ); setPixmap( Resource::loadPixmap( icon ) ); @@ -71,2 +70,3 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal, WFlags m_appletListView->header()->hide(); + m_appletListView->setSorting( -1 ); QVBox *vbox1 = new QVBox( hbox1 ); @@ -75,15 +75,10 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal, WFlags tab2Layout->addWidget( hbox1 ); - TabWidget3->insertTab( tab_2, tr( "active/order" ) ); + tab_3 = new QWidget( TabWidget3, "tab_3" ); QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 ); - QHBox *hbox_clip = new QHBox( tab_3 ); - TextLabel1 = new QLabel( hbox_clip, "TextLabel1" ); - TextLabel1->setText( tr( "Clip after how\n" - "many letters" ) ); - SpinBox7 = new QSpinBox( hbox_clip, "SpinBox7" ); - SpinBox7->setMaxValue( 80 ); + tab3Layout->setMargin( 20 ); QHBox *hbox_auto = new QHBox( tab_3 ); TextLabel2 = new QLabel( hbox_auto, "AutoStart" ); - TextLabel2->setText( tr( "autostart on \nresume? (Opie only)" ) ); + TextLabel2->setText( tr( "autostart on \nresume?\n (Opie only)" ) ); CheckBoxAuto = new QCheckBox( hbox_auto, "CheckBoxAuto" ); @@ -92,4 +87,3 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal, WFlags TimeLabel->setText( tr( "minutes inactive" ) ); - SpinBoxTime = new QSpinBox( hbox_inactive, "TimeSpinner"); - tab3Layout->addWidget( hbox_clip ); + SpinBoxTime = new QSpinBox( hbox_inactive, "TimeSpinner" ); tab3Layout->addWidget( hbox_auto ); @@ -114,3 +108,3 @@ void TodayConfig::setAutoStart() { cfg.setGroup( "Autostart" ); - int autostart = cfg.readNumEntry( "autostart", 1); + int autostart = cfg.readNumEntry( "autostart", 1 ); if ( autostart ) { @@ -138,3 +132,3 @@ void TodayConfig::readConfig() { - cfg.setGroup( "Applets" ); + cfg.setGroup( "Plugins" ); m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); @@ -147,3 +141,3 @@ void TodayConfig::writeConfig() { Config cfg( "today" ); - cfg. setGroup ( "Applets" ); + cfg.setGroup( "Plugins" ); if ( m_applets_changed ) { @@ -151,8 +145,18 @@ void TodayConfig::writeConfig() { QStringList include; - QMap <QString, QCheckListItem *>::Iterator it; - for ( it = m_applets.begin(); it != m_applets. end (); ++it ) { - if ( !(*it)-> isOn () ) { - exclude << it.key(); - } else { - include << it.key(); + QStringList all_applets; + + QListViewItemIterator list_it( m_appletListView ); + + // this makes sure the names get saved in the order selected + for ( ; list_it.current(); ++list_it ) { + QMap <QString, QCheckListItem *>::Iterator it; + for ( it = m_applets.begin(); it != m_applets. end (); ++it ) { + if ( list_it.current() == (*it) && !(*it)-> isOn () ) { + exclude << it.key(); + } else if ( list_it.current() == (*it) && (*it)-> isOn () ){ + include << it.key(); + } + if ( list_it.current() == (*it) ) { + all_applets << it.key(); + } } @@ -161,2 +165,3 @@ void TodayConfig::writeConfig() { cfg.writeEntry( "IncludeApplets", include, ',' ); + cfg.writeEntry( "AllApplets", all_applets, ',' ); } @@ -165,3 +170,3 @@ void TodayConfig::writeConfig() { m_autoStart = CheckBoxAuto->isChecked(); - cfg.writeEntry( "autostart", m_autoStart ); + cfg.writeEntry( "autostart", m_autoStart ); m_autoStartTimer = SpinBoxTime->value(); @@ -173,3 +178,3 @@ void TodayConfig::moveSelectedUp() { QListViewItem *item = m_appletListView->selectedItem(); - if ( item && item->itemAbove() ) { + if ( item && item->itemAbove() ) { item->itemAbove()->moveItem( item ); @@ -199,3 +204,2 @@ void TodayConfig::pluginManagement( QString libName, QString name, QPixmap icon - qDebug (" SUCHNAME: " + name ); if ( m_excludeApplets.find( libName ) == m_excludeApplets.end() ) { @@ -203,2 +207,3 @@ void TodayConfig::pluginManagement( QString libName, QString name, QPixmap icon } + m_applets[libName] = item; |