[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/sysadmin/kpackagekit
From: Daniel Nicoletti <dantti85-kde () yahoo ! com ! br>
Date: 2010-10-01 2:00:48
Message-ID: 20101001020048.647ADAC891 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1181442 by dantti:
Show package version in the description if it's being shown in the list.
M +1 -0 AddRm/BrowseView.cpp
M +15 -1 AddRm/KpkPackageDetails.cpp
M +2 -0 AddRm/KpkPackageDetails.h
M +1 -1 libkpackagekit/KpkPackageModel.cpp
--- trunk/playground/sysadmin/kpackagekit/AddRm/BrowseView.cpp #1181441:1181442
@@ -108,6 +108,7 @@
void BrowseView::showVersions(bool enabled)
{
packageView->header()->setSectionHidden(1, !enabled);
+ packageDetails->hidePackageVersion(enabled);
}
void BrowseView::on_packageView_customContextMenuRequested(const QPoint &pos)
--- trunk/playground/sysadmin/kpackagekit/AddRm/KpkPackageDetails.cpp #1181441:1181442
@@ -44,7 +44,6 @@
#include <KDebug>
-#include <QGraphicsDropShadowEffect>
#include "GraphicsOpacityDropShadowEffect.h"
#define BLUR_RADIUS 15
@@ -56,6 +55,7 @@
: QWidget(parent),
m_busySeq(0),
m_display(false),
+ m_hideVersion(false),
m_transaction(0),
m_hasDetails(false),
m_hasFileList(false),
@@ -172,6 +172,7 @@
shadow->setOpacity(0);
shadow->setBlurRadius(BLUR_RADIUS);
shadow->setOffset(2);
+ shadow->setColor(QApplication::palette().dark().color());
screenshotL->setGraphicsEffect(shadow);
m_fadeScreenshot = new QPropertyAnimation(shadow, "opacity");
@@ -269,6 +270,11 @@
view->show();
}
+void KpkPackageDetails::hidePackageVersion(bool hide)
+{
+ m_hideVersion = hide;
+}
+
void KpkPackageDetails::actionActivated(QAction *action)
{
// don't fade the screenshot
@@ -525,8 +531,16 @@
}
if (!details->license().isEmpty() && details->license() != "unknown") {
+ // We have a license, check if we have and should show show package version
+ if (!m_hideVersion && !m_package->version().isEmpty()) {
+ licenseL->setText(m_package->version() + " - " + details->license());
+ } else {
licenseL->setText(details->license());
+ }
licenseL->show();
+ } else if (!m_hideVersion) {
+ licenseL->setText(m_package->version());
+ licenseL->show();
} else {
licenseL->hide();
}
--- trunk/playground/sysadmin/kpackagekit/AddRm/KpkPackageDetails.h #1181441:1181442
@@ -51,6 +51,7 @@
~KpkPackageDetails();
void setPackage(const QModelIndex &index);
+ void hidePackageVersion(bool hide);
void hide();
private slots:
@@ -84,6 +85,7 @@
QPropertyAnimation *m_fadeStacked;
QPropertyAnimation *m_fadeScreenshot;
bool m_display;
+ bool m_hideVersion;
// We need a copy of prety much every thing
// we have, so that we update only when we are
--- trunk/playground/sysadmin/kpackagekit/libkpackagekit/KpkPackageModel.cpp #1181441:1181442
@@ -320,7 +320,7 @@
bool KpkPackageModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
- if (role == Qt::CheckStateRole && m_packages.size() > index.row()) {
+ if (role == Qt::CheckStateRole && m_packageCount > index.row()) {
if (value.toBool()) {
checkPackage(m_packages.at(index.row()));
} else {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic