[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/sysadmin/shaman
From: Lukas Appelhans <l.appelhans () gmx ! de>
Date: 2008-06-21 10:53:57
Message-ID: 1214045637.018163.31758.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 822751 by lappelhans:
Make the UpdateDatabaseDialog working again, fix connections, layouts and icons
M +1 -1 libshaman/Repository.h
M +10 -6 plugins/updatedatabase/UpdateDatabaseDialog.cpp
M +7 -4 plugins/updatedatabase/UpdateDatabaseDialog.h
--- trunk/playground/sysadmin/shaman/libshaman/Repository.h #822750:822751
@@ -39,7 +39,7 @@
Status status();
signals:
- void statusChanged(Status status);
+ void statusChanged(Repository::Status status);
private:
class Private;
--- trunk/playground/sysadmin/shaman/plugins/updatedatabase/UpdateDatabaseDialog.cpp \
#822750:822751 @@ -17,16 +17,20 @@
#include <QVBoxLayout>
#include <QPixmap>
-RepositoryWidget::RepositoryWidget(Shaman::Repository *repo, QWidget *parent)
+using namespace Shaman;
+
+RepositoryWidget::RepositoryWidget(Repository *repo, QWidget *parent)
: QWidget(parent),
m_repo(repo)
{
m_layout = new QHBoxLayout(this);
m_textLabel = new QLabel(repo->name(), this);
+ m_layout->addWidget(m_textLabel);
m_pixmapLabel = new QLabel(this);
+ m_layout->addWidget(m_pixmapLabel);
m_pixmapLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- m_pixmapLabel->setPixmap(KIcon("history").pixmap(32, 32));
- connect(m_repo, SIGNAL(statusChanged(Shaman::Repository::Status)), \
SLOT(updateStatus(Shaman::Repository::Status))); + \
m_pixmapLabel->setPixmap(KIcon("edit-clear-history").pixmap(32, 32)); + \
connect(m_repo, SIGNAL(statusChanged(Repository::Status)), \
SLOT(updateStatus(Repository::Status))); }
RepositoryWidget::~RepositoryWidget()
@@ -36,14 +40,14 @@
void RepositoryWidget::updateStatus(Shaman::Repository::Status status)
{
if (status == Shaman::Repository::Idling)
- m_pixmapLabel->setPixmap(KIcon("dialog-apply").pixmap(32, 32));
+ m_pixmapLabel->setPixmap(KIcon("dialog-ok-apply").pixmap(32, 32));
else if (status == Shaman::Repository::Downloading)
m_pixmapLabel->setPixmap(KIcon("kget").pixmap(32, 32));//TODO: replace icon
else if (status == Shaman::Repository::Updating)
m_pixmapLabel->setPixmap(KIcon("edit-redo").pixmap(32, 32));
}
-UpdateDatabaseDialog::UpdateDatabaseDialog(Shaman::Repository::List repoList, \
QWidget * parent) +UpdateDatabaseDialog::UpdateDatabaseDialog(Repository::List \
repoList, QWidget * parent) : KDialog(parent),
m_repoList(repoList)
{
@@ -51,7 +55,7 @@
setButtons(KDialog::Cancel);
QWidget * widget = new QWidget(this);
m_layout = new QVBoxLayout(widget);
- foreach (Shaman::Repository *repo, m_repoList)
+ foreach (Repository *repo, m_repoList)
m_layout->addWidget(new RepositoryWidget(repo, widget));
setMainWidget(widget);
}
--- trunk/playground/sysadmin/shaman/plugins/updatedatabase/UpdateDatabaseDialog.h \
#822750:822751 @@ -18,14 +18,17 @@
class QHBoxLayout;
class QLabel;
+using namespace Shaman;
+
class RepositoryWidget : public QWidget
{
Q_OBJECT
public:
- RepositoryWidget(Shaman::Repository *repo, QWidget *parent = 0);
+ RepositoryWidget(Repository *repo, QWidget *parent = 0);
~RepositoryWidget();
- void updateStatus(Shaman::Repository::Status status);
+ public slots:
+ void updateStatus(Repository::Status status);
private:
Shaman::Repository *m_repo;
@@ -38,11 +41,11 @@
{
Q_OBJECT
public:
- UpdateDatabaseDialog(Shaman::Repository::List repoList, QWidget * parent = \
0); + UpdateDatabaseDialog(Repository::List repoList, QWidget * parent = 0);
~UpdateDatabaseDialog();
private:
- Shaman::Repository::List m_repoList;
+ Repository::List m_repoList;
QVBoxLayout * m_layout;
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic