/* This file is part of the OPIE Project =. Copyright (c) 2002 Andy Qua .=l. Dan Williams .>+-= _;:, .> :=|. This file is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -`: PARTICULAR PURPOSE. See the GNU General ..}^=.= = ; Public License for more details. ++= -. .` .: : = ...= . :.=- You should have received a copy of the GNU -. .:....=;==+<; General Public License along with this file; -_. . . )=. = see the file COPYING. If not, write to the -- :-=` Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "packagewin.h" #include "package.h" #include "datamgr.h" #include #include #include #include #include PackageWindow::PackageWindow( Package *package, const QString &server ) : QWidget( 0, 0, 0 ) { QString str; if ( package ) { Package *local = package->getLocalPackage(); setCaption( package->getPackageName() ); QString destName; if ( local ) { if ( local->getInstalledTo() ) destName = package->getLocalPackage()->getInstalledTo()->getDestinationName(); } else { if ( package->getInstalledTo() ) destName = package->getInstalledTo()->getDestinationName(); } if ( !package->isPackageStoredLocally() ) { str.append( tr( "Description - " ) ); str.append( package->getDescription() ); if ( !destName.isNull() ) { str.append( tr( "

Installed To - " ) ); str.append( destName ); } str.append( tr( "

Size - " ) ); str.append( package->getPackageSize() ); str.append( tr( "

Section - " ) ); str.append( package->getSection() ); } else { str.append( tr( "

Filename - " ) ); str.append( package->getFilename() ); } if ( server == LOCAL_SERVER ) { str.append( tr( "

Version Installed - " ) ); str.append( package->getVersion() ); } else { str.append( tr( "

Version Available - " ) ); str.append( package->getVersion() ); if ( local ) { if ( package->isInstalled() ) { str.append( tr( "

Version Installed - " ) ); str.append( package->getInstalledVersion() ); } } } } else { setCaption( tr( "Package Information" ) ); str = tr( "Package information is unavailable" ); } QVBoxLayout *layout = new QVBoxLayout( this, 4, 4 ); QTextView *l = new QTextView( str, QString::null, this ); layout->addWidget( l ); QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "enter", Opie::Core::OResource::SmallIcon ), tr( "Close" ), this ); layout->addWidget( btn ); connect( btn, SIGNAL( clicked() ), this, SLOT( close() ) ); } PackageWindow::~PackageWindow() { }