rpms/kdebase-workspace/devel kdebase-workspace-4.0.85-kde#154119.patch, NONE, 1.1 kdebase-workspace-4.0.85-plasma-default-wallpaper.patch, NONE, 1.1 kdebase-workspace.spec, 1.94, 1.95 kdebase-workspace-4.0.83-kde#154119.patch, 1.1, NONE kdebase-workspace-4.0.84-plasma-default-wallpaper-config.patch, 1.1, NONE kdebase-workspace-4.0.84-plasma-default-wallpaper.patch, 1.1, NONE
Kevin Kofler (kkofler)
fedora-extras-commits at redhat.com
Wed Jul 9 21:36:41 UTC 2008
Author: kkofler
Update of /cvs/pkgs/rpms/kdebase-workspace/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27480/devel
Modified Files:
kdebase-workspace.spec
Added Files:
kdebase-workspace-4.0.85-kde#154119.patch
kdebase-workspace-4.0.85-plasma-default-wallpaper.patch
Removed Files:
kdebase-workspace-4.0.83-kde#154119.patch
kdebase-workspace-4.0.84-plasma-default-wallpaper-config.patch
kdebase-workspace-4.0.84-plasma-default-wallpaper.patch
Log Message:
* Wed Jul 09 2008 Kevin Kofler <Kevin at tigcc.ticalc.org> 4.0.85-3
- rewrite and reapply plasma-default-wallpaper patch
- (no more separate plasma-default-wallpaper-config part)
- rediff kde#154119 patch one last time
kdebase-workspace-4.0.85-kde#154119.patch:
--- NEW FILE kdebase-workspace-4.0.85-kde#154119.patch ---
diff -ur kdebase-workspace-4.0.85/libs/plasma/containment.cpp kdebase-workspace-4.0.85-kde#154119/libs/plasma/containment.cpp
--- kdebase-workspace-4.0.85/libs/plasma/containment.cpp 2008-07-03 07:05:35.000000000 +0200
+++ kdebase-workspace-4.0.85-kde#154119/libs/plasma/containment.cpp 2008-07-09 23:31:28.000000000 +0200
@@ -397,6 +397,11 @@
desktopMenu.addSeparator();
}
+ QList<QAction*> containmentAppletActions = contextAppletActions(applet);
+ foreach(QAction* action, containmentAppletActions) {
+ desktopMenu.addAction(action);
+ }
+
QAction* closeApplet = applet->d->actions.action("remove");
if (!closeApplet) { //unlikely but not impossible
kDebug() << "no remove action!!!!!!!!";
@@ -946,6 +951,12 @@
}
}
+QList<QAction*> Containment::contextAppletActions(Applet *)
+{
+ //kDebug() << "empty context actions";
+ return QList<QAction*>();
+}
+
KActionCollection& ContainmentPrivate::actions()
{
return static_cast<Applet*>(q)->d->actions;
diff -ur kdebase-workspace-4.0.85/libs/plasma/containment.h kdebase-workspace-4.0.85-kde#154119/libs/plasma/containment.h
--- kdebase-workspace-4.0.85/libs/plasma/containment.h 2008-07-03 07:05:35.000000000 +0200
+++ kdebase-workspace-4.0.85-kde#154119/libs/plasma/containment.h 2008-07-09 23:30:11.000000000 +0200
@@ -267,6 +267,14 @@
*/
void removeAssociatedWidget(QWidget *widget);
+ /**
+ * Returns a list of applet-related QAction instances.
+ *
+ * @return A list of actions. The default implementation returns an
+ * empty list.
+ **/
+ virtual QList<QAction*> contextAppletActions(Applet *applet);
+
Q_SIGNALS:
/**
* This signal is emitted when a new applet is created by the containment
diff -ur kdebase-workspace-4.0.85/plasma/containments/panel/panel.cpp kdebase-workspace-4.0.85-kde#154119/plasma/containments/panel/panel.cpp
--- kdebase-workspace-4.0.85/plasma/containments/panel/panel.cpp 2008-07-03 07:05:38.000000000 +0200
+++ kdebase-workspace-4.0.85-kde#154119/plasma/containments/panel/panel.cpp 2008-07-09 23:30:11.000000000 +0200
@@ -23,6 +23,7 @@
#include <QApplication>
#include <QGraphicsLinearLayout>
+#include <QGraphicsSceneHoverEvent>
#include <QPainter>
#include <QBitmap>
#include <QDesktopWidget>
@@ -51,7 +52,9 @@
m_configureAction(0),
m_addPanelAction(0),
m_currentSize(QSize(QApplication::desktop()->screenGeometry(screen()).width(), 38)),
- m_lastViewGeom()
+ m_lastViewGeom(),
+ m_moveAppletAction(0),
+ m_movedApplet(0)
{
m_background = new Plasma::PanelSvg(this);
m_background->setImagePath("widgets/panel-background");
@@ -103,6 +106,37 @@
return actions;
}
+QList<QAction*> Panel::contextAppletActions(Applet *applet)
+{
+ if (!m_moveAppletAction) {
+ m_moveAppletAction = new QAction( KIcon("transform-move"), i18n("transform-move"), this);
+ }
+
+ QVariant appletV;
+ appletV.setValue((QObject*)applet);
+ m_moveAppletAction->setData(appletV);
+
+ if (!m_movedApplet || (m_movedApplet && m_movedApplet!=applet)) {
+ m_moveAppletAction->setText(i18n("Start Move of %1", applet->name()));
+ if (!m_movedApplet) {
+ m_moveAppletAction->setEnabled(true);
+ connect(m_moveAppletAction, SIGNAL(triggered(bool)), SLOT(startAppletMove()));
+ }
+ else {
+ m_moveAppletAction->setEnabled(false);
+ }
+ }
+ else {
+ m_moveAppletAction->setEnabled(true);
+ m_moveAppletAction->setText(i18n("Stop Move of %1", applet->name()));
+ connect(m_moveAppletAction, SIGNAL(triggered(bool)), SLOT(stopAppletMove()));
+ }
+
+ QList<QAction*> actions;
+ actions << m_moveAppletAction;
+ return actions;
+}
+
void Panel::backgroundChanged()
{
constraintsEvent(Plasma::LocationConstraint);
@@ -456,6 +490,83 @@
}
}
+void Panel::startAppletMove()
+{
+ QAction *action = qobject_cast<QAction*>(sender());
+ if (!action) {
+ return;
+ }
+
+ m_movedApplet = qobject_cast<Applet*>(action->data().value<QObject*>());
+ setAcceptsHoverEvents(true);
+ setCursor(Qt::SizeAllCursor);
+}
+
+void Panel::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
+{
+ if (!m_movedApplet) {
+ Applet::hoverMoveEvent(event);
+ return;
+ }
+
+ QPointF pos = event->pos();
+ m_movedApplet->setPos(pos);
+
+ // reposition the applet in our layout
+ QGraphicsLinearLayout *lay = dynamic_cast<QGraphicsLinearLayout*>(layout());
+
+ if (!lay) {
+ return;
+ }
+
+ Plasma::FormFactor f = formFactor();
+ int currentIndex = -1, insertIndex = -1;
+
+ for (int i = 0; i < lay->count(); ++i) {
+ QGraphicsLayoutItem *sibling = lay->itemAt(i);
+ if (sibling == m_movedApplet) {
+ currentIndex = i;
+ }
+ QRectF siblingGeometry = sibling->geometry();
+ if (f == Plasma::Horizontal) {
+ qreal middle = (siblingGeometry.left() + siblingGeometry.right()) / 2.0;
+ if (pos.x() < middle) {
+ insertIndex = i;
+ break;
+ } else if (pos.x() <= siblingGeometry.right()) {
+ insertIndex = i + 1;
+ break;
+ }
+ } else { // Plasma::Vertical
+ qreal middle = (siblingGeometry.top() + siblingGeometry.bottom()) / 2.0;
+ if (pos.y() < middle) {
+ insertIndex = i;
+ break;
+ } else if (pos.y() <= siblingGeometry.bottom()) {
+ insertIndex = i + 1;
+ break;
+ }
+ }
+ }
+
+ if (currentIndex != -1 && insertIndex != -1) {
+ if (insertIndex > currentIndex) {
+ --insertIndex;
+ }
+ if (insertIndex != currentIndex) {
+ lay->removeAt(currentIndex);
+ lay->insertItem(insertIndex, m_movedApplet);
+ }
+ }
+}
+
+void Panel::stopAppletMove()
+{
+ setCursor(Qt::ArrowCursor);
+ setAcceptsHoverEvents(false);
+ m_movedApplet = 0;
+}
+
K_EXPORT_PLASMA_APPLET(panel, Panel)
#include "panel.moc"
diff -ur kdebase-workspace-4.0.85/plasma/containments/panel/panel.h kdebase-workspace-4.0.85-kde#154119/plasma/containments/panel/panel.h
--- kdebase-workspace-4.0.85/plasma/containments/panel/panel.h 2008-06-18 14:41:39.000000000 +0200
+++ kdebase-workspace-4.0.85-kde#154119/plasma/containments/panel/panel.h 2008-07-09 23:30:11.000000000 +0200
@@ -49,6 +49,9 @@
const QRect &contentsRect);
void paintBackground(QPainter *painter, const QRect &contentsRect);
+ QList<QAction*> contextAppletActions(Applet *applet);
+ void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
+
protected:
void saveState(KConfigGroup &config) const;
@@ -59,6 +62,9 @@
void appletRemoved(Plasma::Applet* applet);
void addPanel();
+ void startAppletMove();
+ void stopAppletMove();
+
private:
/**
* update the formfactor based on the location
@@ -73,6 +79,8 @@
Plasma::PanelSvg *m_background;
QAction* m_configureAction;
QAction* m_addPanelAction;
+ QAction* m_moveAppletAction;
+ Applet *m_movedApplet;
//cached values
QSize m_currentSize;
kdebase-workspace-4.0.85-plasma-default-wallpaper.patch:
--- NEW FILE kdebase-workspace-4.0.85-plasma-default-wallpaper.patch ---
diff -ur kdebase-workspace-4.0.85/libs/plasma/theme.cpp kdebase-workspace-4.0.85-plasma-default-wallpaper/libs/plasma/theme.cpp
--- kdebase-workspace-4.0.85/libs/plasma/theme.cpp 2008-07-03 07:05:35.000000000 +0200
+++ kdebase-workspace-4.0.85-plasma-default-wallpaper/libs/plasma/theme.cpp 2008-07-09 23:16:58.000000000 +0200
@@ -94,6 +94,7 @@
KSharedConfigPtr colors;
KConfigGroup cfg;
QFont generalFont;
+ QString globalDefaultWallpaper;
QString defaultWallpaperTheme;
QString defaultWallpaperSuffix;
int defaultWallpaperWidth;
@@ -235,6 +236,10 @@
//kDebug() << "we're going for..." << colorsFile << "*******************";
// load the wallpaper settings, if any
+ KSharedConfigPtr config = KSharedConfig::openConfig("plasmarc");
+ KConfigGroup group = KConfigGroup(config, "Defaults");
+ d->globalDefaultWallpaper = group.readEntry("wallpaper", (const char *) 0);
+
KConfig metadata(KStandardDirs::locate("data", "desktoptheme/" + theme + "/metadata.desktop"));
KConfigGroup cg;
if (metadata.hasGroup("Wallpaper")) {
@@ -247,8 +252,8 @@
cg = d->config();
}
- d->defaultWallpaperTheme = cg.readEntry("defaultWallpaperTheme", DEFAULT_WALLPAPER_THEME);
- d->defaultWallpaperSuffix = cg.readEntry("defaultFileSuffix", DEFAULT_WALLPAPER_SUFFIX);
+ d->defaultWallpaperTheme = cg.readEntry("defaultWallpaperTheme", d->globalDefaultWallpaper.isEmpty() ? DEFAULT_WALLPAPER_THEME : (const char *) 0);
+ d->defaultWallpaperSuffix = cg.readEntry("defaultFileSuffix", d->globalDefaultWallpaper.isEmpty() ? DEFAULT_WALLPAPER_SUFFIX : (const char *) 0);
d->defaultWallpaperWidth = cg.readEntry("defaultWidth", DEFAULT_WALLPAPER_WIDTH);
d->defaultWallpaperHeight = cg.readEntry("defaultHeight", DEFAULT_WALLPAPER_HEIGHT);
@@ -300,7 +305,10 @@
QString fullPath;
QString image = d->defaultWallpaperTheme;
- image.append("/contents/images/%1x%2").append(d->defaultWallpaperSuffix);
+ if (image.isEmpty() && !d->globalDefaultWallpaper.isEmpty())
+ image = d->globalDefaultWallpaper;
+ else
+ image.append("/contents/images/%1x%2").append(d->defaultWallpaperSuffix);
QString defaultImage = image.arg(d->defaultWallpaperWidth).arg(d->defaultWallpaperHeight);
if (size.isValid()) {
Index: kdebase-workspace.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kdebase-workspace/devel/kdebase-workspace.spec,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -r1.94 -r1.95
--- kdebase-workspace.spec 9 Jul 2008 20:03:24 -0000 1.94
+++ kdebase-workspace.spec 9 Jul 2008 21:35:56 -0000 1.95
@@ -2,7 +2,7 @@
Name: kdebase-workspace
Version: 4.0.85
-Release: 2%{?dist}
+Release: 3%{?dist}
Source0: ftp://ftp.kde.org/pub/kde/unstable/%{version}/src/kdebase-workspace-%{version}.tar.bz2
License: GPLv2
Group: User Interface/Desktops
@@ -20,20 +20,17 @@
#Â 441062: packagekit tools do not show icons correctly on KDE
Patch8: kdebase-workspace-4.0.3-krdb.patch
Patch10: kdebase-workspace-4.0.72-klipper-url.patch
+# allows to define a default wallpaper via plasmarc:wallpaper
+Patch11: kdebase-workspace-4.0.85-plasma-default-wallpaper.patch
# upstream patches:
# plasma-4.0-openSUSE patches:
-# http://websvn.kde.org/?view=rev&revision=795438
-# allows to define a default wallpaper via plasmarc:wallpaper
-Patch200: kdebase-workspace-4.0.84-plasma-default-wallpaper.patch
# http://websvn.kde.org/?view=rev&revision=791852
# from Plasma review board: http://mattr.info/r/261/
# allows moving plasmoids on panels (#439587, kde#154119, kde#158301)
-Patch201: kdebase-workspace-4.0.83-kde#154119.patch
-# #444141: Initial wallpaper chooser has "EOS" preselected but wallpaper is "Fedora Waves"
-#Â http://websvn.kde.org/?view=rev&revision=801651
-Patch203: kdebase-workspace-4.0.84-plasma-default-wallpaper-config.patch
+# will no longer be needed with the next snapshot
+Patch201: kdebase-workspace-4.0.85-kde#154119.patch
Patch204: kdebase-workspace-4.0.4-kickoff-suspend.patch
# FIXME: "inconsistent naming System Monitor vs KSysGuard" http://bugs.kde.org/162151
# (gtk) systray icons
@@ -144,15 +141,13 @@
%patch7 -p0 -b .timedate-kcm
%patch8 -p0 -b .krdb
%patch10 -p1 -b .klipper-url
+%patch11 -p1 -b .plasma-default-wallpaper
# upstream patches
# plasma-4.0-openSUSE patches:
-# FIXME
-#patch200 -p1 -b .plasma-default-wallpaper
-#patch203 -p1 -b .plasma-default-wallpaper-config
-# no longer needed (?)
-#patch201 -p1 -b .kde#154119
+# patch201 will no longer be needed with the next snapshot:
+%patch201 -p1 -b .kde#154119
%patch204 -p1 -b .kickoff-suspend
pushd plasma/applets/systemtray/
%patch205 -p0 -b .kde#164786
@@ -289,6 +284,11 @@
%changelog
+* Wed Jul 09 2008 Kevin Kofler <Kevin at tigcc.ticalc.org> 4.0.85-3
+- rewrite and reapply plasma-default-wallpaper patch
+- (no more separate plasma-default-wallpaper-config part)
+- rediff kde#154119 patch one last time
+
* Wed Jul 09 2008 Rex Dieter <rdieter at fedoraproject.org> 4.0.85-2
- systray icon patch (kde#164786)
--- kdebase-workspace-4.0.83-kde#154119.patch DELETED ---
--- kdebase-workspace-4.0.84-plasma-default-wallpaper-config.patch DELETED ---
--- kdebase-workspace-4.0.84-plasma-default-wallpaper.patch DELETED ---
More information about the fedora-extras-commits
mailing list