author | andyq <andyq> | 2002-10-18 22:40:08 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-10-18 22:40:08 (UTC) |
commit | f899c1a0d216a1197c947a533d82085a02fed259 (patch) (side-by-side diff) | |
tree | d0bf68d5fbf2021acc35973978e063cb6a8a5906 | |
parent | eea247f2664f0c70247399b2f4d969ddb00df7ba (diff) | |
download | opie-f899c1a0d216a1197c947a533d82085a02fed259.zip opie-f899c1a0d216a1197c947a533d82085a02fed259.tar.gz opie-f899c1a0d216a1197c947a533d82085a02fed259.tar.bz2 |
Added option to settings to show or hide Jump To letters
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 27 | ||||
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.h | 1 | ||||
-rw-r--r-- | noncore/settings/aqpkg/settingsimpl.cpp | 23 | ||||
-rw-r--r-- | noncore/settings/aqpkg/settingsimpl.h | 2 |
4 files changed, 40 insertions, 13 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index ed5bf75..3aee7bd 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp @@ -54,4 +54,5 @@ NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget cfg.setGroup( "settings" ); currentlySelectedServer = cfg.readEntry( "selectedServer", "local" ); + showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" ); #endif @@ -125,15 +126,19 @@ void NetworkPackageManager :: initGui() QHBoxLayout *hbox4 = new QHBoxLayout( vbox, -1, "HBox1" ); - char text[2]; - text[1] = '\0'; - for ( int i = 0 ; i < 26 ; ++i ) - { - text[0] = 'A' + i; - LetterPushButton *b = new LetterPushButton( text, this ); - connect( b, SIGNAL( released( QString ) ), this, SLOT( letterPushed( QString ) ) ); - if ( i < 16 ) - hbox3->addWidget( b ); - else - hbox4->addWidget( b ); + + if ( showJumpTo ) + { + char text[2]; + text[1] = '\0'; + for ( int i = 0 ; i < 26 ; ++i ) + { + text[0] = 'A' + i; + LetterPushButton *b = new LetterPushButton( text, this ); + connect( b, SIGNAL( released( QString ) ), this, SLOT( letterPushed( QString ) ) ); + if ( i < 16 ) + hbox3->addWidget( b ); + else + hbox4->addWidget( b ); + } } diff --git a/noncore/settings/aqpkg/networkpkgmgr.h b/noncore/settings/aqpkg/networkpkgmgr.h index 7efa42c..fba8155 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.h +++ b/noncore/settings/aqpkg/networkpkgmgr.h @@ -54,4 +54,5 @@ private: QString currentlySelectedServer; + bool showJumpTo; int timerId; diff --git a/noncore/settings/aqpkg/settingsimpl.cpp b/noncore/settings/aqpkg/settingsimpl.cpp index 9ee3a33..a18a178 100644 --- a/noncore/settings/aqpkg/settingsimpl.cpp +++ b/noncore/settings/aqpkg/settingsimpl.cpp @@ -67,6 +67,6 @@ void SettingsImpl :: setupData() for ( it = dataMgr->getServerList().begin() ; it != dataMgr->getServerList().end() ; ++it ) { - if ( it->getServerName() == LOCAL_SERVER || it->getServerName() == LOCAL_IPKGS ) - continue; + if ( it->getServerName() == LOCAL_SERVER || it->getServerName() == LOCAL_IPKGS ) + continue; servers->insertItem( it->getServerName() ); @@ -78,4 +78,11 @@ void SettingsImpl :: setupData() destinations->insertItem( it2->getDestinationName() ); +#ifdef QWS + Config cfg( "aqpkg" ); + cfg.setGroup( "settings" ); + jumpTo->setChecked( cfg.readBoolEntry( "showJumpTo", "true" ) ); +#else + jumpTo->setChecked( true ); +#endif } @@ -225,2 +232,14 @@ void SettingsImpl :: changeDestinationDetails() } } + +//------------------ General tab ---------------------- + +void SettingsImpl :: toggleJumpTo( bool val ) +{ +#ifdef QWS + Config cfg( "aqpkg" ); + cfg.setGroup( "settings" ); + cfg.writeEntry( "showJumpTo", val ); +#endif +} + diff --git a/noncore/settings/aqpkg/settingsimpl.h b/noncore/settings/aqpkg/settingsimpl.h index bc231a1..971516b 100644 --- a/noncore/settings/aqpkg/settingsimpl.h +++ b/noncore/settings/aqpkg/settingsimpl.h @@ -50,3 +50,5 @@ private: void newDestination(); void removeDestination(); + + void toggleJumpTo( bool val ); }; |