summaryrefslogtreecommitdiff
authortille <tille>2002-05-02 19:53:56 (UTC)
committer tille <tille>2002-05-02 19:53:56 (UTC)
commit7833ad013239d04669edd54041287563a47728ec (patch) (side-by-side diff)
tree9b733caf7880a052580ecbb496cb2914e17a2a69
parentce6758eccada41f5c3fef13e6b4808c525213bee (diff)
downloadopie-7833ad013239d04669edd54041287563a47728ec.zip
opie-7833ad013239d04669edd54041287563a47728ec.tar.gz
opie-7833ad013239d04669edd54041287563a47728ec.tar.bz2
fixed
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/packagelistdoclnk.cpp9
-rw-r--r--noncore/unsupported/oipkg/packagelistdoclnk.h1
-rw-r--r--noncore/unsupported/oipkg/packagelistview.cpp13
3 files changed, 21 insertions, 2 deletions
diff --git a/noncore/unsupported/oipkg/packagelistdoclnk.cpp b/noncore/unsupported/oipkg/packagelistdoclnk.cpp
index 575ac62..5787fdf 100644
--- a/noncore/unsupported/oipkg/packagelistdoclnk.cpp
+++ b/noncore/unsupported/oipkg/packagelistdoclnk.cpp
@@ -1,36 +1,43 @@
#include "packagelistdoclnk.h"
#include <qpe/applnk.h>
+#include <qpe/config.h>
#include <qlist.h>
#include "package.h"
#include "pksettings.h"
PackageListDocLnk::PackageListDocLnk(PackageManagerSettings* s)
: PackageList(s)
{
PackageListDocLnk();
}
PackageListDocLnk::PackageListDocLnk()
: PackageList()
{
- doclnkset = new DocLnkSet("/mnt/nfs/ipk","application/ipkg");
+ Config cfg( "oipkg", Config::User );
+ cfg.setGroup( "Common" );
+ docLnkDir = cfg.readEntry( "docLnkDir", "/root/" );
+ doclnkset = new DocLnkSet(docLnkDir,"application/ipkg");
}
PackageListDocLnk::~PackageListDocLnk()
{
+ Config cfg( "oipkg", Config::User );
+ cfg.setGroup( "Common" );
+ cfg.writeEntry( "docLnkDir", docLnkDir );
}
void PackageListDocLnk::update()
{
pvDebug(2,"PackageListDocLnk::update ");
QList<DocLnk> packlist = doclnkset->children();
for (DocLnk *pack =packlist.first(); pack != 0; pack=packlist.next() )
{
insertPackage( new Package(pack->file(), settings) );
}
}
diff --git a/noncore/unsupported/oipkg/packagelistdoclnk.h b/noncore/unsupported/oipkg/packagelistdoclnk.h
index 3864ace..fe73658 100644
--- a/noncore/unsupported/oipkg/packagelistdoclnk.h
+++ b/noncore/unsupported/oipkg/packagelistdoclnk.h
@@ -1,22 +1,23 @@
#ifndef PACKAGELISTDOCLNK_H
#define PACKAGELISTDOCLNK_H
#include "packagelist.h"
#include "debug.h"
class DocLnkSet;
class PackageListDocLnk : public PackageList
{
public:
PackageListDocLnk();
PackageListDocLnk( PackageManagerSettings* s);
virtual ~PackageListDocLnk();
public slots:
void update();
private:
DocLnkSet *doclnkset;
+ QString docLnkDir;
};
#endif
diff --git a/noncore/unsupported/oipkg/packagelistview.cpp b/noncore/unsupported/oipkg/packagelistview.cpp
index b6b520b..70aa48a 100644
--- a/noncore/unsupported/oipkg/packagelistview.cpp
+++ b/noncore/unsupported/oipkg/packagelistview.cpp
@@ -1,86 +1,97 @@
#include "packagelistview.h"
#include <qpopupmenu.h>
#include <qaction.h>
#include "packagelistitem.h"
#include "pksettings.h"
PackageListView::PackageListView(QWidget *p, const char* n, PackageManagerSettings *s)
: QListView(p,n)
{
settings = s;
popupMenu = new QPopupMenu( this );
destsMenu = new QPopupMenu( popupMenu );
popupTimer = new QTimer( this );
setSelectionMode(QListView::NoSelection);
addColumn( tr("Package") );
setRootIsDecorated( true );
connect( popupTimer, SIGNAL(timeout()),
this, SLOT(showPopup()) );
connect( this, SIGNAL( pressed( QListViewItem* ) ),
this, SLOT( setCurrent( QListViewItem* ) ) );
connect( this, SIGNAL( clicked( QListViewItem* ) ),
this, SLOT( stopTimer( QListViewItem* ) ) );
}
//PackageListView::~PackageListView()
//{
//}
void PackageListView::setCurrent( QListViewItem* p )
{
if ( !p ) return;
activePackageListItem = (PackageListItem*)p;
activePackage = activePackageListItem->getPackage();
- if (!activePackage) return;
+ if (!activePackage)
+ {
+// QDictIterator<QCheckListItem> it( rootItems );
+// while ( it.current() )
+// {
+// if ( it.current()==p )
+// pvDebug(2,"current item");
+// ++it;
+// }
+
+ return;
+ }
popupTimer->start( 750, true );
}
void PackageListView::showPopup()
{
popupMenu->clear();
destsMenu->clear();
QAction *popupAction;
if ( !activePackage->installed() )
{
popupMenu->insertItem( QObject::tr("Install to"), destsMenu );
QStringList dests = settings->getDestinationNames();
QString ad = settings->getDestinationName();
for (uint i = 0; i < dests.count(); i++ )
{
popupAction = new QAction( dests[i], QString::null, 0, this, 0 );
popupAction->addTo( destsMenu );
if ( dests[i] == ad && activePackage->toInstall() )
{
popupAction->setToggleAction( true );
popupAction->setOn(true);
};
}
connect( destsMenu, SIGNAL( activated( int ) ),
this, SLOT( changePackageDest( int ) ) );
}else{
popupAction = new QAction( QObject::tr("Remove"),QString::null, 0, this, 0 );
popupAction->addTo( popupMenu );
connect( popupAction, SIGNAL( activated() ),
this , SLOT( toggleProcess() ) );
popupAction = new QAction( QObject::tr("Reinstall"),QString::null, 0, this, 0 );
popupAction->addTo( popupMenu );
popupAction->setEnabled( false );
}
popupMenu->popup( QCursor::pos() );
}
void PackageListView::stopTimer( QListViewItem* )
{
popupTimer->stop();
}
void PackageListView::changePackageDest( int i )
{
activePackage->setDest( destsMenu->text(i) );