summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/mainwindow.cpp
authortille <tille>2002-05-03 19:08:09 (UTC)
committer tille <tille>2002-05-03 19:08:09 (UTC)
commit4eddfebd1b4f70bbfe9106a16e9a3eeb6601f653 (patch) (side-by-side diff)
tree66d77ffe196c448782ce0d04877641280e74890d /noncore/unsupported/oipkg/mainwindow.cpp
parent6bf450ac622d22ba7e9156e474a7abb714167eba (diff)
downloadopie-4eddfebd1b4f70bbfe9106a16e9a3eeb6601f653.zip
opie-4eddfebd1b4f70bbfe9106a16e9a3eeb6601f653.tar.gz
opie-4eddfebd1b4f70bbfe9106a16e9a3eeb6601f653.tar.bz2
fixes
Diffstat (limited to 'noncore/unsupported/oipkg/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index 259a789..4f6e4cc 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -205,99 +205,99 @@ void MainWindow::makeMenu()
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() );
CheckBoxLink = new QCheckBox( tr("Link"), destBar);
CheckBoxLink->setBackgroundColor( destBar->backgroundColor() );
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 );
destBar->setStretchableWidget( CheckBoxLink );
destAction->setToggleAction( true );
// destAction->addTo( viewMenu );
// 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 ) );
}
MainWindow::~MainWindow()
{
pvDebug(7,"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() );
pvDebug(7,"MainWindow::~MainWindow ");
}
void MainWindow::runIpkg()
{
packageListServers.allPackages();
- ipkg->loadList( packageListSearch );
- ipkg->loadList( packageListDocLnk );
- ipkg->loadList( packageListServers );
+ ipkg->loadList( &packageListSearch );
+ ipkg->loadList( &packageListDocLnk );
+ ipkg->loadList( &packageListServers );
ipkg->commit();
// ##### If we looked in the list of files, we could send out accurate
// ##### messages. But we don't bother yet, and just do an "all".
QCopEnvelope e("QPE/System", "linkChanged(QString)");
QString lf = QString::null;
e << lf;
displayList();
}
void MainWindow::updateList()
{
// wait->show();
QTimer *t = new QTimer( this );
connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) );
t->start( 0, false );
packageListServers.clear();
packageListSearch.clear();
packageListDocLnk.clear();
ipkg->update();
packageListServers.update();
packageListSearch.update();
packageListDocLnk.update();
t->stop();
// wait->hide();
}
void MainWindow::filterList()
{
// wait->show();
QString f = "";
if ( findAction->isOn() ) f = findEdit->text();
packageListServers.filterPackages( f );
// wait->hide();
}
void MainWindow::displayList()
{
// wait->hide();
filterList();
listViewPackages->display();
}
void MainWindow::sectionChanged()
{
disconnect( section, SIGNAL( activated(int) ),
this, SLOT( sectionChanged() ) );
disconnect( subsection, SIGNAL(activated(int) ),
this, SLOT( subSectionChanged() ) );
@@ -377,111 +377,113 @@ void MainWindow::findClose()
{
findAction->setOn( false );
}
void MainWindow::searchShow(bool b)
{
if (b) searchBar->show();
else searchBar->hide();
searchAction->setOn( b );
}
void MainWindow::searchClose()
{
searchAction->setOn( false );
}
void MainWindow::destShow(bool b)
{
if (b) destBar->show();
else destBar->hide();
destAction->setOn( b );
}
void MainWindow::destClose()
{
destAction->setOn( false );
}
void MainWindow::rotateUpdateIcon()
{
pvDebug(2, "MainWindow::rotateUpdateIcon");
if ( updateIcon )
updateAction->setIconSet( Resource::loadIconSet( "oipkg/update" ) );
else
updateAction->setIconSet( Resource::loadIconSet( "oipkg/update2" ) );
updateIcon = !updateIcon;
}
void MainWindow::setDocument(const QString &fileName)
{
installFile(fileName);
// ##### If we looked in the list of files, we could send out accurate
// ##### messages. But we don't bother yet, and just do an "all".
QCopEnvelope e("QPE/System", "linkChanged(QString)");
QString lf = QString::null;
e << lf;
- displayList();
+ // displayList();
+ exit;
}
void MainWindow::installFile(const QString &fileName)
{
pvDebug(3, "MainWindow::installFile "+fileName);
if ( !QFile::exists( fileName ) ) return;
ipkg->installFile( fileName );
// ##### If we looked in the list of files, we could send out accurate
// ##### messages. But we don't bother yet, and just do an "all".
QCopEnvelope e("QPE/System", "linkChanged(QString)");
QString lf = QString::null;
e << lf;
displayList();
}
void MainWindow::makeChannel()
{
channel = new QCopChannel( "QPE/Application/oipkg", this );
connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
this, SLOT(receive(const QCString&, const QByteArray&)) );
}
void MainWindow::receive(const QCString &msg, const QByteArray &arg)
{
pvDebug(3, "QCop "+msg+" "+QCString(arg));
if ( msg == "installFile(QString)" )
{
ipkg->installFile( QString(arg) );
}else if( msg == "removeFile(QString)" )
{
ipkg->removeFile( QString(arg) );
}else if( msg == "createLinks(QString)" )
{
ipkg->createLinks( QString(arg) );
}else if( msg == "removeLinks(QString)" )
{
ipkg->removeLinks( QString(arg) );
}else{
pvDebug(2,"Huh what do ya want")
}
}
void MainWindow::createLinks()
{
pvDebug(2,"creating links...");
ipkg->createLinks( settings->destinationurl->text() );
}
void MainWindow::removeLinks()
{
pvDebug(2,"removing links...");
ipkg->removeLinks( settings->destinationurl->text() );
}
void MainWindow::remotePackageQuery()
{
packageListSearch.query( searchEdit->text() );
+ packageListSearch.update();
displayList();
}