minor housecleaning bits: double click in applet dialog works now; put back lines for what the center background painting *shoudl* be were it not for QSvgRenderer being buggy

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=728613
This commit is contained in:
Aaron J. Seigo 2007-10-23 20:14:29 +00:00
parent 1db6f236e7
commit c810963a94
2 changed files with 10 additions and 8 deletions

View File

@ -268,6 +268,9 @@ public:
p.drawTiledPixmap(QRect(contentLeft, bottomOffset, contentWidth, bottomHeight), bottom);
}
// re-enable this once Qt's svg rendering is un-buggered
//background->resize(contentWidth, contentHeight);
//background->paint(&p, QRect(contentLeft, contentTop, contentWidth, contentHeight), "center");
}
p2->drawPixmap(leftOffset, topOffset, *cachedBackground);

View File

@ -50,14 +50,12 @@ public:
Plasma::Corona *corona;
Plasma::Containment *containment;
KCategorizedItemsView *appletList;
KConfig config;
KConfigGroup configGroup;
PlasmaAppletItemModel itemModel;
KCategorizedItemsViewModels::DefaultFilterModel filterModel;
};
AppletBrowser::AppletBrowser(Plasma::Corona * corona, QWidget * parent, Qt::WindowFlags f)
@ -77,6 +75,7 @@ AppletBrowser::AppletBrowser(Plasma::Containment * containment, QWidget * parent
void AppletBrowser::init()
{
d->appletList = new KCategorizedItemsView(this);
connect(d->appletList, SIGNAL(activated(const QModelIndex &)), this, SLOT(addApplet()));
setMainWidget(d->appletList);
setWindowTitle("Add Applets");
@ -94,25 +93,25 @@ void AppletBrowser::init()
d->filterModel.addFilter(i18n("All Applets"),
KCategorizedItemsViewModels::Filter(), new KIcon("application-x-plasma"));
// Recommended emblems and filters
QRegExp rx("recommended[.]([0-9A-Za-z]+)[.]caption");
QMapIterator<QString, QString> i(d->configGroup.entryMap());
while (i.hasNext()) {
i.next();
if (!rx.exactMatch(i.key())) continue;
kDebug() << "These are the key/vals in rc file " << rx.cap(1) << "\n";
//kDebug() << "These are the key/vals in rc file " << rx.cap(1) << "\n";
QString id = rx.cap(1);
QString caption = d->configGroup.readEntry("recommended." + id + ".caption");
QString icon = d->configGroup.readEntry("recommended." + id + ".icon");
QString plugins = d->configGroup.readEntry("recommended." + id + ".plugins");
d->appletList->addEmblem(i18n("Recommended by %1", caption), new KIcon(icon),
KCategorizedItemsViewModels::Filter("recommended." + id, true));
d->filterModel.addFilter(i18n("Recommended by %1", caption),
KCategorizedItemsViewModels::Filter("recommended." + id, true), new KIcon(icon));
//foreach (QString plugin, plugins.split(",")) {}
}