-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 @@ -32,48 +32,49 @@ using namespace std; #endif #include <qlabel.h> #include <qfile.h> #include <qmessagebox.h> #include "datamgr.h" #include "networkpkgmgr.h" #include "installdlgimpl.h" #include "ipkg.h" #include "inputdlg.h" #include "letterpushbutton.h" #include "global.h" NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget *parent, const char *name) : QWidget(parent, name) { dataMgr = dataManager; #ifdef QWS // read download directory from config file Config cfg( "aqpkg" ); cfg.setGroup( "settings" ); currentlySelectedServer = cfg.readEntry( "selectedServer", "local" ); + showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" ); #endif initGui(); setupConnections(); progressDlg = 0; timerId = startTimer( 100 ); } NetworkPackageManager::~NetworkPackageManager() { } void NetworkPackageManager :: timerEvent ( QTimerEvent * ) { killTimer( timerId ); // showProgressDialog(); // Add server names to listbox updateData(); // progressDlg->hide(); } @@ -103,59 +104,63 @@ void NetworkPackageManager :: updateData() if ( activeItem != -1 ) serversList->setCurrentItem( activeItem ); serverSelected( 0 ); } void NetworkPackageManager :: initGui() { QLabel *l = new QLabel( "Servers", this ); serversList = new QComboBox( this ); packagesList = new QListView( this ); update = new QPushButton( "Refresh List", this ); download = new QPushButton( "Download", this ); upgrade = new QPushButton( "Upgrade", this ); apply = new QPushButton( "Apply", this ); QVBoxLayout *vbox = new QVBoxLayout( this, 0, -1, "VBox" ); QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1, "HBox1" ); hbox1->addWidget( l ); hbox1->addWidget( serversList ); QHBoxLayout *hbox3 = new QHBoxLayout( vbox, -1, "HBox1" ); 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 ); + } } vbox->addWidget( packagesList ); packagesList->addColumn( "Packages" ); QHBoxLayout *hbox2 = new QHBoxLayout( vbox, -1, "HBox2" ); hbox2->addWidget( update ); hbox2->addWidget( download ); hbox2->addWidget( upgrade ); hbox2->addWidget( apply ); } void NetworkPackageManager :: setupConnections() { connect( serversList, SIGNAL(activated( int )), this, SLOT(serverSelected( int ))); connect( apply, SIGNAL(released()), this, SLOT(applyChanges()) ); connect( download, SIGNAL(released()), this, SLOT(downloadPackage()) ); connect( upgrade, SIGNAL( released()), this, SLOT(upgradePackages()) ); connect( update, SIGNAL(released()), this, SLOT(updateServer()) ); } void NetworkPackageManager :: showProgressDialog( char *initialText ) { if ( !progressDlg ) 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 @@ -32,45 +32,46 @@ class InstallData; class NetworkPackageManager : public QWidget { Q_OBJECT public: /** construtor */ NetworkPackageManager( DataManager *dataManager, QWidget* parent=0, const char *name=0); /** destructor */ ~NetworkPackageManager(); void updateData(); private: DataManager *dataMgr; QComboBox *serversList; QListView *packagesList; QPushButton *update; QPushButton *upgrade; QPushButton *download; QPushButton *apply; ProgressDlg *progressDlg; QString currentlySelectedServer; + bool showJumpTo; int timerId; void timerEvent ( QTimerEvent * ); void initGui(); void setupConnections(); void showProgressDialog( char *initialText ); InstallData dealWithItem( QCheckListItem *item ); QString stickyOption; public slots: void serverSelected( int index ); void applyChanges(); void upgradePackages(); void downloadPackage(); void updateServer(); void displayText( const QString &t ); void letterPushed( QString t ); }; #endif 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 @@ -45,59 +45,66 @@ SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const SettingsImpl :: ~SettingsImpl() { } bool SettingsImpl :: showDlg( int i ) { TabWidget->setCurrentPage( i ); showMaximized(); exec(); if ( changed ) dataMgr->writeOutIpkgConf(); return changed; } void SettingsImpl :: setupData() { // add servers vector<Server>::iterator it; 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() ); } // add destinations vector<Destination>::iterator it2; for ( it2 = dataMgr->getDestinationList().begin() ; it2 != dataMgr->getDestinationList().end() ; ++it2 ) destinations->insertItem( it2->getDestinationName() ); +#ifdef QWS + Config cfg( "aqpkg" ); + cfg.setGroup( "settings" ); + jumpTo->setChecked( cfg.readBoolEntry( "showJumpTo", "true" ) ); +#else + jumpTo->setChecked( true ); +#endif } //------------------ Servers tab ---------------------- void SettingsImpl :: editServer( int sel ) { currentSelectedServer = sel; Server *s = dataMgr->getServer( servers->currentText() ); serverName = s->getServerName(); servername->setText( s->getServerName() ); serverurl->setText( s->getServerUrl() ); active->setChecked( s->isServerActive() ); } void SettingsImpl :: newServer() { newserver = true; servername->setText( "" ); serverurl->setText( "" ); servername->setFocus(); active->setChecked( true ); } void SettingsImpl :: removeServer() @@ -203,24 +210,36 @@ void SettingsImpl :: changeDestinationDetails() // Update list box destinations->changeItem( newName, currentSelectedDestination ); } #ifdef QWS QString key = newName; key += "_linkToRoot"; int val = d->linkToRoot(); cfg.writeEntry( key, val ); #endif } else { dataMgr->getDestinationList().push_back( Destination( newName, destinationurl->text() ) ); destinations->insertItem( newName ); destinations->setCurrentItem( destinations->count() ); newdestination = false; #ifdef QWS QString key = newName; key += "_linkToRoot"; cfg.writeEntry( key, true ); #endif } } + +//------------------ 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 @@ -28,25 +28,27 @@ public: bool showDlg( int i ); private: DataManager *dataMgr; QString serverName; QString destinationName; int currentSelectedServer; int currentSelectedDestination; bool changed; bool newserver; bool newdestination; void setupConnections(); void setupData(); void editServer( int s ); void changeServerDetails(); void newServer(); void removeServer(); void editDestination( int s ); void changeDestinationDetails(); void newDestination(); void removeDestination(); + + void toggleJumpTo( bool val ); }; |