summaryrefslogtreecommitdiff
authortille <tille>2002-07-01 13:31:20 (UTC)
committer tille <tille>2002-07-01 13:31:20 (UTC)
commit1f42fc6dd4ef09b5a9526e81784ab3d05b9300b1 (patch) (side-by-side diff)
treeeaf5284b3841c247c9f048e6c529053ca9ded412
parent346ea8fa0d904e940659bc35fad0fc0da8cc7f80 (diff)
downloadopie-1f42fc6dd4ef09b5a9526e81784ab3d05b9300b1.zip
opie-1f42fc6dd4ef09b5a9526e81784ab3d05b9300b1.tar.gz
opie-1f42fc6dd4ef09b5a9526e81784ab3d05b9300b1.tar.bz2
cosmetics
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp35
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp21
-rw-r--r--noncore/unsupported/oipkg/utils.cpp9
-rw-r--r--noncore/unsupported/oipkg/utils.h9
4 files changed, 37 insertions, 37 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index 084900d..53db477 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -56,27 +56,21 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
listViewPackages->addList( tr("documents"), &packageListDocLnk );
ipkg = new PmIpkg( settings, this );
packageListServers.setSettings( settings );
packageListSearch.setSettings( settings );
packageListDocLnk.setSettings( settings );
pvDebug(9,"packageListServers.update");
packageListServers.update();
pvDebug(9,"packageListDocLnk.update");
- pvDebug(0,"no UPDATE of DocLnk");
packageListDocLnk.update();
pvDebug(9,"makeMenu");
makeMenu();
makeChannel();
- //opie is hardcoded default ;)
-// pvDebug(9,"section->setCurrentItem");
-// for (int i=0;i<section->count();i++)
-// if (section->text(i)=="opie")
-// section->setCurrentItem(i);
-// sectionChanged();
+
connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) );
connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) );
connect( settings->removeLinksButton, SIGNAL( clicked()),
SLOT(removeLinks()) );
connect( settings->createLinksButton, SIGNAL( clicked()),
SLOT(createLinks()) );
@@ -146,38 +140,44 @@ void MainWindow::makeMenu()
cfgact->addTo( cfgMenu );
QAction *a;
// SECTIONS
sectionBar = new QPEToolBar( this );
addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE );
sectionBar->setHorizontalStretchable( true );
- QLabel *label = new QLabel( tr("Section: "), sectionBar );
- label->setBackgroundColor( sectionBar->backgroundColor() );
+ QLabel *label = new QLabel( sectionBar, "section" );
+// label->setBackgroundMode( NoBackground );
+ label->font().setPointSize( 8 );
+ label->setText( tr( "Section:" ) );
+ sectionBar->setStretchableWidget( label );
section = new QComboBox( false, sectionBar );
+ section->font().setPointSize( 8 );
label = new QLabel( " / ", sectionBar );
- label->setBackgroundColor( sectionBar->backgroundColor() );
+ label->font().setPointSize( 8 );
+// label->setBackgroundMode( PaletteForeground );
subsection = new QComboBox( false, sectionBar );
+ subsection->font().setPointSize( 8 );
a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) );
a->addTo( sectionBar );
setSections();
setSubSections();
sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 );
connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) );
sectionAction->setToggleAction( true );
sectionAction->addTo( viewMenu );
- sectionBar->setStretchableWidget( section );
+// sectionBar->setStretchableWidget( section );
//FIND
findBar = new QPEToolBar(this);
addToolBar( findBar, "Filter", QMainWindow::Top, TRUE );
label = new QLabel( tr("Filter: "), findBar );
- label->setBackgroundColor( findBar->backgroundColor() );
+// label->setBackgroundMode( PaletteForeground );
findBar->setHorizontalStretchable( TRUE );
findEdit = new QLineEdit( findBar, "findEdit" );
findBar->setStretchableWidget( findEdit );
connect( findEdit, SIGNAL( textChanged( const QString & ) ),
this, SLOT( displayList() ) );
a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) );
a->addTo( findBar );
@@ -188,17 +188,17 @@ void MainWindow::makeMenu()
connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) );
findAction->setToggleAction( true );
findAction->addTo( viewMenu );
//SEARCH
searchBar = new QPEToolBar(this);
addToolBar( searchBar, "Search", QMainWindow::Top, TRUE );
label = new QLabel( tr("ipkgfind: "), searchBar );
- label->setBackgroundColor( searchBar->backgroundColor() );
+// label->setBackgroundMode( PaletteForeground );
searchBar->setHorizontalStretchable( TRUE );
searchEdit = new QLineEdit( searchBar, "seachEdit" );
searchBar->setStretchableWidget( searchEdit );
// connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
// this, SLOT( displayList() ) );
a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) );
a->addTo( searchBar );
@@ -212,27 +212,27 @@ void MainWindow::makeMenu()
connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) );
searchAction->setToggleAction( true );
searchAction->addTo( viewMenu );
//DEST
destBar = new QPEToolBar(this);
addToolBar( destBar, "Destination", QMainWindow::Top, TRUE );
label = new QLabel( tr("Destination: "), destBar );
- label->setBackgroundColor( destBar->backgroundColor() );
+// label->setBackgroundMode( PaletteForeground );
destBar->setHorizontalStretchable( TRUE );
destination = new QComboBox( false, destBar );
destination->insertStringList( settings->getDestinationNames() );
setComboName(destination,settings->getDestinationName());
connect( destination, SIGNAL(activated(int)),
settings, SLOT(activeDestinationChange(int)) );
spacer = new QLabel( " ", destBar );
- spacer->setBackgroundColor( destBar->backgroundColor() );
+// spacer->setBackgroundMode( PaletteForeground );
CheckBoxLink = new QCheckBox( tr("Link"), destBar);
- CheckBoxLink->setBackgroundColor( destBar->backgroundColor() );
+// CheckBoxLink->setBackgroundMode( PaletteForeground );
CheckBoxLink->setChecked( settings->createLinks() );
connect( CheckBoxLink, SIGNAL(toggled(bool)),
settings, SLOT(linkEnabled(bool)) );
destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 );
connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) );
a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), SLOT( destClose() ) );
a->addTo( destBar );
@@ -280,26 +280,29 @@ void MainWindow::makeMenu()
// configure the menus
Config cfg( "oipkg", Config::User );
cfg.setGroup( "gui" );
findShow( cfg.readBoolEntry( "findBar", true ) );
searchShow( cfg.readBoolEntry( "searchBar", true ) );
sectionShow( cfg.readBoolEntry( "sectionBar", true ) );
destShow( cfg.readBoolEntry( "destBar", false ) );
+ setComboName(section,cfg.readEntry("default_section"));
+ sectionChanged();
}
MainWindow::~MainWindow()
{
Config cfg( "oipkg", Config::User );
cfg.setGroup( "gui" );
cfg.writeEntry( "findBar", !findBar->isHidden() );
cfg.writeEntry( "searchBar", !searchBar->isHidden() );
cfg.writeEntry( "sectionBar", !sectionBar->isHidden() );
cfg.writeEntry( "destBar", !destBar->isHidden() );
+ cfg.writeEntry( "default_section", section->currentText() );
}
void MainWindow::runIpkg()
{
packageListServers.allPackages();
ipkg->loadList( &packageListSearch );
ipkg->loadList( &packageListDocLnk );
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index de1f162..4a8a389 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -62,16 +62,17 @@ PmIpkg::~PmIpkg()
}
bool PmIpkg::runIpkg(const QString& args, const QString& dest )
{
bool ret=false;
QDir::setCurrent("/tmp");
QString cmd = "/usr/bin/ipkg ";
#ifdef OPROCESS
+ ipkgProcess->kill();
ipkgProcess->clearArguments();
*ipkgProcess << "/usr/bin/ipkg ";
cmd = "";
#endif
pvDebug( 3,"PmIpkg::runIpkg got dest="+dest);
if ( dest == "" )
cmd += " -dest "+settings->getDestinationName();
else
@@ -94,16 +95,18 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
out( "running:\n"+cmd+"\n" );
pvDebug(2,"running:"+cmd);
#ifdef OPROCESS
*ipkgProcess << args;
out( "running:\n" + cmd);
*ipkgProcess << cmd;
//debug
+ delete ipkgProcess;
+ ipkgProcess = new OProcess();
ipkgProcess->clearArguments();
*ipkgProcess << "/bin/ls ";
//debug
QValueList<QCString> a = ipkgProcess->args();
QValueList<QCString>::Iterator it;
for( it = a.begin(); it != a.end(); ++it )
{
out( *it );
@@ -165,41 +168,49 @@ void PmIpkg::makeLinks(Package *pack)
QString pn = pack->name();
linkPackage( pack->packageName(), pack->dest() );
}
QStringList* PmIpkg::getList( QString packFileName, QString d )
{
QString dest = settings->getDestinationUrlByName( d );
dest = dest==""?d:dest;
- if (dest == "/" ) return 0;
+ // if (dest == "/" ) return 0;
{
Config cfg( "oipkg", Config::User );
cfg.setGroup( "Common" );
QString statusDir = cfg.readEntry( "statusDir", "" );
}
- packFileName = dest+"/"+statusDir+"/info/"+packFileName+".list";
+ QString packFileDir = dest+"/"+statusDir+"/info/"+packFileName+".list";
QFile f( packFileName );
if ( ! f.open(IO_ReadOnly) )
{
- pvDebug(1," Panik! Could not open");
- out( "Panik!\n Could not open:\n"+packFileName );
- return (QStringList*)0;
+ out( "Could not open:\n"+packFileDir );
+ f.close();
+ packFileDir = "/"+statusDir+"/info/"+packFileName+".list";
+ f.setName( packFileDir );
+ if ( ! f.open(IO_ReadOnly) )
+ {
+ qDebug(" Panik! Could not open"+packFileDir);
+ out( "Could not open:\n"+packFileDir+"\n Panik!" );
+ }
}
QStringList *fileList = new QStringList();
QTextStream t( &f );
while ( !t.eof() )
{
*fileList += t.readLine();
}
+ f.close();
return fileList;
}
void PmIpkg::linkPackage( QString packFileName, QString dest )
{
+ if (dest == "root" || dest == "/" ) return;
QStringList *fileList = getList( packFileName, dest );
processFileList( fileList, dest );
delete fileList;
}
void PmIpkg::processFileList( QStringList *fileList, QString d )
{
if (!fileList) return;
diff --git a/noncore/unsupported/oipkg/utils.cpp b/noncore/unsupported/oipkg/utils.cpp
index 66dcf10..6821343 100644
--- a/noncore/unsupported/oipkg/utils.cpp
+++ b/noncore/unsupported/oipkg/utils.cpp
@@ -1,24 +1,17 @@
/***************************************************************************
- utils.cpp - description
- -------------------
- begin : Sun Apr 28 2002
- copyright : (C) 2002 by tille
- email : tille@handhelds.org
- ***************************************************************************/
-
-/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
+// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
#include <qcombobox.h>
#include <qstring.h>
#include "utils.h"
void setComboName( QComboBox* combo, QString s)
{
for ( int i = 0; i < combo->count(); i++)
diff --git a/noncore/unsupported/oipkg/utils.h b/noncore/unsupported/oipkg/utils.h
index ecc70dc..da33eda 100644
--- a/noncore/unsupported/oipkg/utils.h
+++ b/noncore/unsupported/oipkg/utils.h
@@ -1,18 +1,11 @@
/***************************************************************************
- utils.h - description
- -------------------
- begin : Sun Apr 28 2002
- copyright : (C) 2002 by tille
- email : tille@handhelds.org
- ***************************************************************************/
-
-/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
+// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
void setComboName( QComboBox*, QString );