(C) Heikki Holstila 2010
*/
-#include <QtNetwork>
+#include <Qt>
#include <QDBusConnection>
#include <QDBusInterface>
#include "blacklistselect.h"
#include "aaptinterface.h"
#include "settings.h"
+#include "mainwindow.h"
-PackageSelector::PackageSelector(Package* pkg, AAptInterface* apt, Settings* set, QWidget *parent) :
+PackageSelector::PackageSelector(Package* pkg, AAptInterface* apt, Settings* set, MainWindow* mw, QWidget *parent) :
QDialog(parent),
- ui(new Ui::PackageSelector)
+ ui(new Ui::PackageSelector), iNetworkAccessManager(0), iChangelogFetched(false), iFetchInProgress(false)
{
- ui->setupUi(this);
+ ui->setupUi(this);
iPkg = pkg;
iAptInterface = apt;
iSettings = set;
- iNetworkAccessManager = 0;
- iChangelogFetched = false;
- iFetchInProgress = false;
+ iMainWindow = mw;
iChangelog = "";
ui->pushButton_website->setIcon(QPixmap("/usr/share/icons/hicolor/48x48/hildon/general_web.png"));
ui->pushButton_blacklist->setEnabled(false);
if( pkg->icon() && !pkg->icon()->isNull() ) {
- ui->label_appicon->setPixmap( *pkg->icon() );
+ QPixmap aicon( *pkg->icon() );
+ ui->label_appicon->setPixmap( aicon.scaled(48,48) );
} else {
ui->label_appicon->setPixmap( QPixmap(":/icons/icons/appdefault.png") );
}
ui->radioTabBasic->setText("Info");
ui->radioTabChanges->setText("Chgs");
ui->radioTabDepends->setText("Deps");
+ ui->scrollAreaWidgetContents->setMaximumWidth( QApplication::desktop()->width() - 15 );
}
Package* upg_pkg = iPkg->availablePackage();
if( iPkg->isInstalled() && !iPkg->isUpgradeable() )
{
ui->radioInstall->setEnabled(false);
- ui->radioInstall->hide();
+ ui->radioInstall->hide();
} else if( !iPkg->isInstalled() ) {
ui->radioRemove->setEnabled(false);
ui->radioRemove->hide();
}
}
+ if( !iPkg->maintainerRichText().isEmpty() ) {
+ longtext +="Maintainer: " + iPkg->maintainerRichText() + "<br>";
+ }
+
longtext += "<br>" + iPkg->descShort();
QString descLong = iPkg->descLong();
if( descLong.length()>0 ) {
if( iChangelogFetched || iFetchInProgress )
return;
+ if( iMainWindow )
+ iMainWindow->openNetworkConnection();
+
iChangelogFetched = false;
iFetchInProgress = true;
iChangelog = "";
if( !iNetworkAccessManager ) {
iNetworkAccessManager = new QNetworkAccessManager(this);
- connect(iNetworkAccessManager,SIGNAL(finished(QNetworkReply*)),this,SLOT(changelogFetchNetworkReply(QNetworkReply*)));
+ connect(iNetworkAccessManager,SIGNAL(finished(QNetworkReply*)),this,SLOT(changelogFetchNetworkReply(QNetworkReply*)));
if( iSettings->qsettings()->value("use_proxies").toBool() && !iSettings->qsettings()->value("http_proxy").toString().isEmpty() )
{
qDebug() << "changelog fetched";
} else {
- iChangelog = "Not available (Network error)";
+ iChangelog = "Not available ( error)";
qDebug() << "changelog fetch error:" << reply->error() << reply->errorString();
}