author | andyq <andyq> | 2002-10-25 09:50:52 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-10-25 09:50:52 (UTC) |
commit | 2f2c23d398b6a47bd06aaf329a55bb455cf5ddd1 (patch) (side-by-side diff) | |
tree | 4322eef1f6306763b3bc0332b6e57c05a24341d9 | |
parent | 4a2f6dd634aa277bca3818f090d691844e219f64 (diff) | |
download | opie-2f2c23d398b6a47bd06aaf329a55bb455cf5ddd1.zip opie-2f2c23d398b6a47bd06aaf329a55bb455cf5ddd1.tar.gz opie-2f2c23d398b6a47bd06aaf329a55bb455cf5ddd1.tar.bz2 |
Modified so that you can click on a package in the documents view and
the Local IPKGS view is shown and the selected package checked
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 9 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mainwin.h | 1 | ||||
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 31 | ||||
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.h | 1 |
4 files changed, 40 insertions, 2 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp index 206d11c..9f19dfa 100644 --- a/noncore/settings/aqpkg/mainwin.cpp +++ b/noncore/settings/aqpkg/mainwin.cpp @@ -21,12 +21,13 @@ #include "mainwin.h"
#include "datamgr.h"
#include "networkpkgmgr.h"
#include "settingsimpl.h"
#include "helpwindow.h"
+#include "utils.h"
#include "global.h"
MainWindow :: MainWindow( QWidget *p, char *name )
: QMainWindow( p, name )
{
#ifdef QWS
@@ -62,12 +63,20 @@ MainWindow :: MainWindow( QWidget *p, char *name ) MainWindow :: ~MainWindow()
{
delete networkPkgWindow;
}
+void MainWindow :: setDocument( const QString &doc )
+{
+ // Remove path from package
+ QString package = Utils::getPackageNameFromIpkFilename( doc );
+ cout << "Selecting package " << package << endl;
+ networkPkgWindow->selectLocalPackage( package );
+}
+
void MainWindow :: displaySettings()
{
SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true );
if ( dlg->showDlg( 0 ) )
networkPkgWindow->updateData();
delete dlg;
diff --git a/noncore/settings/aqpkg/mainwin.h b/noncore/settings/aqpkg/mainwin.h index 2a182fc..a9e290c 100644 --- a/noncore/settings/aqpkg/mainwin.h +++ b/noncore/settings/aqpkg/mainwin.h @@ -37,11 +37,12 @@ private: DataManager *mgr;
QWidgetStack *stack;
NetworkPackageManager *networkPkgWindow;
public slots:
+ void setDocument( const QString &doc );
void displayHelp();
void displayAbout();
void displaySettings();
};
#endif
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index 6874ded..a374266 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp @@ -57,14 +57,15 @@ NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget #endif initGui(); setupConnections(); - progressDlg = 0; - timerId = startTimer( 100 ); + updateData(); +// progressDlg = 0; +// timerId = startTimer( 100 ); } NetworkPackageManager::~NetworkPackageManager() { } @@ -103,12 +104,38 @@ void NetworkPackageManager :: updateData() // set selected server to be active server if ( activeItem != -1 ) serversList->setCurrentItem( activeItem ); serverSelected( 0 ); } +void NetworkPackageManager :: selectLocalPackage( const QString &pkg ) +{ + // First select local server + for ( int i = 0 ; i < serversList->count() ; ++i ) + { + if ( serversList->text( i ) == LOCAL_IPKGS ) + { + serversList->setCurrentItem( i ); + break; + } + } + serverSelected( 0 ); + + // Now set the check box of the selected package + for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); + item != 0 ; + item = (QCheckListItem *)item->nextSibling() ) + { + if ( item->text().startsWith( pkg ) ) + { + item->setOn( true ); + break; + } + } +} + void NetworkPackageManager :: initGui() { QLabel *l = new QLabel( "Servers", this ); serversList = new QComboBox( this ); packagesList = new QListView( this ); diff --git a/noncore/settings/aqpkg/networkpkgmgr.h b/noncore/settings/aqpkg/networkpkgmgr.h index fba8155..3c437b4 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.h +++ b/noncore/settings/aqpkg/networkpkgmgr.h @@ -35,12 +35,13 @@ class NetworkPackageManager : public QWidget public: /** construtor */ NetworkPackageManager( DataManager *dataManager, QWidget* parent=0, const char *name=0); /** destructor */ ~NetworkPackageManager(); + void selectLocalPackage( const QString &pkg ); void updateData(); private: DataManager *dataMgr; QComboBox *serversList; |