rpms/kdebase-workspace/devel kdebase-workspace-4.3.85-brightness_keys.patch, NONE, 1.1 .cvsignore, 1.43, 1.44 kdebase-workspace.spec, 1.329, 1.330 sources, 1.51, 1.52 kdebase-workspace-4.3.80-brightness-keys.patch, 1.1, NONE kdebase-workspace-4.3.80-cmake-targets.patch, 1.1, NONE
Rex Dieter
rdieter at fedoraproject.org
Fri Dec 18 16:04:38 UTC 2009
Author: rdieter
Update of /cvs/pkgs/rpms/kdebase-workspace/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv23057
Modified Files:
.cvsignore kdebase-workspace.spec sources
Added Files:
kdebase-workspace-4.3.85-brightness_keys.patch
Removed Files:
kdebase-workspace-4.3.80-brightness-keys.patch
kdebase-workspace-4.3.80-cmake-targets.patch
Log Message:
* Fri Dec 18 2009 Rex Dieter <rdieter at fedoraproject.org> - 4.3.85-1
- kde-4.3.85 (4.4beta2)
kdebase-workspace-4.3.85-brightness_keys.patch:
libs/solid/control/powermanager.cpp | 11 +++-
plasma/generic/applets/battery/battery.cpp | 74 ++++++++++++++++++++++++----
plasma/generic/applets/battery/battery.h | 10 +++
powerdevil/daemon/PowerDevilDaemon.cpp | 75 +++++++++++++++++++++++++----
powerdevil/daemon/PowerDevilDaemon.h | 6 ++
powerdevil/daemon/org.kde.PowerDevil.xml | 8 +++
6 files changed, 161 insertions(+), 23 deletions(-)
--- NEW FILE kdebase-workspace-4.3.85-brightness_keys.patch ---
diff -up kdebase-workspace-4.3.85/libs/solid/control/powermanager.cpp.brightness_keys kdebase-workspace-4.3.85/libs/solid/control/powermanager.cpp
--- kdebase-workspace-4.3.85/libs/solid/control/powermanager.cpp.brightness_keys 2009-12-17 10:35:15.000000000 -0600
+++ kdebase-workspace-4.3.85/libs/solid/control/powermanager.cpp 2009-12-18 10:00:30.638575226 -0600
@@ -25,6 +25,8 @@
#include "ifaces/powermanager.h"
#include <kdebug.h>
#include <kglobal.h>
+#include <QDBusInterface>
+#include <QDBusPendingCall>
#include <QX11Info>
K_GLOBAL_STATIC(Solid::Control::PowerManagerPrivate, globalPowerManager)
@@ -160,7 +162,8 @@ bool Solid::Control::PowerManager::setBr
#ifdef Q_WS_WIN
return false;
#else
- return ( xrandr_brightlight( QX11Info::display(), brightness ) >= 0 );
+ if ( xrandr_brightlight( QX11Info::display(), brightness ) < 0 )
+ return false;
#endif
}
else
@@ -170,8 +173,12 @@ bool Solid::Control::PowerManager::setBr
SOLID_CALL(Ifaces::PowerManager *, globalPowerManager->managerBackend(), setBrightness(brightness, device));
}
//TODO - This should be done better, it will return true even if one of the calls returns false. SOLID_CALL does not allow us to get the return value.
- return true;
}
+
+ QDBusConnection dbus(QDBusConnection::sessionBus());
+ QDBusInterface iface("org.kde.kded", "/modules/powerdevil", "org.kde.PowerDevil", dbus);
+ iface.asyncCall("notifyOfBrightnessChange", (int) Solid::Control::PowerManager::brightness());
+ return true;
}
else
{
diff -up kdebase-workspace-4.3.85/plasma/generic/applets/battery/battery.cpp.brightness_keys kdebase-workspace-4.3.85/plasma/generic/applets/battery/battery.cpp
--- kdebase-workspace-4.3.85/plasma/generic/applets/battery/battery.cpp.brightness_keys 2009-12-18 10:00:30.608565397 -0600
+++ kdebase-workspace-4.3.85/plasma/generic/applets/battery/battery.cpp 2009-12-18 10:02:00.157566459 -0600
@@ -24,7 +24,9 @@
#include <QApplication>
#include <QDBusConnection>
#include <QDBusInterface>
+#include <QDesktopWidget>
#include <QPainter>
+#include <QProgressBar>
#include <QStyleOptionGraphicsItem>
#include <QFont>
#include <QGraphicsSceneHoverEvent>
@@ -33,7 +35,9 @@
#include <QDBusPendingCall>
#include <QLabel>
#include <QPropertyAnimation>
+#include <QTimer>
+#include <KApplication>
#include <KDebug>
#include <KIcon>
#include <KSharedConfig>
@@ -86,7 +90,8 @@ Battery::Battery(QObject *parent, const
m_labelAlpha(0),
m_labelAnimation(0),
m_acAlpha(0),
- m_acAnimation(0)
+ m_acAnimation(0),
+ m_brightnessDisplay(0)
{
//kDebug() << "Loading applet battery";
setAcceptsHoverEvents(true);
@@ -318,6 +323,7 @@ void Battery::hoverLeaveEvent(QGraphicsS
Battery::~Battery()
{
+ delete m_brightnessDisplay;
}
void Battery::suspend()
@@ -338,13 +344,17 @@ void Battery::hibernate()
void Battery::brightnessChanged(const int brightness)
{
- Solid::Control::PowerManager::setBrightness(brightness);
+ if (!m_ignoreBrightnessChange) {
+ Solid::Control::PowerManager::setBrightness(brightness);
+ }
}
-void Battery::updateSlider(const float brightness)
+void Battery::updateSlider(int brightness)
{
- if (m_brightnessSlider->value() != (int)brightness) {
- m_brightnessSlider->setValue((int) brightness);
+ if (m_brightnessSlider->value() != brightness) {
+ m_ignoreBrightnessChange = true;
+ m_brightnessSlider->setValue(brightness);
+ m_ignoreBrightnessChange = false;
}
}
@@ -367,6 +377,7 @@ void Battery::initExtenderItem(Plasma::E
// as the battery applet is also embedded into the battery's extender.
if (!m_isEmbedded && item->name() == "powermanagement") {
int row = 0;
+ m_ignoreBrightnessChange = false;
QGraphicsWidget *controls = new QGraphicsWidget(item);
controls->setMinimumWidth(360);
@@ -431,16 +442,12 @@ void Battery::initExtenderItem(Plasma::E
m_brightnessSlider = new Plasma::Slider(controls);
m_brightnessSlider->setRange(0, 100);
- m_brightnessSlider->setValue(Solid::Control::PowerManager::brightness());
+ updateSlider(Solid::Control::PowerManager::brightness());
m_brightnessSlider->nativeWidget()->setTickInterval(10);
m_brightnessSlider->setOrientation(Qt::Horizontal);
connect(m_brightnessSlider, SIGNAL(valueChanged(int)),
this, SLOT(brightnessChanged(int)));
- Solid::Control::PowerManager::Notifier *notifier = Solid::Control::PowerManager::notifier();
-
- connect(notifier, SIGNAL(brightnessChanged(float)),
- this, SLOT(updateSlider(float)));
m_controlsLayout->addItem(m_brightnessSlider, row, 1);
row++;
@@ -530,6 +537,21 @@ void Battery::initExtenderItem(Plasma::E
item->setWidget(controls);
item->setTitle(i18n("Power Management"));
+ m_brightnessDisplay = new QProgressBar();
+ m_brightnessDisplay->setWindowFlags(Qt::X11BypassWindowManagerHint);
+ QDesktopWidget* desktop = KApplication::kApplication()->desktop();
+ //Getting QRect of the screen where cursor is positioned
+ QRect rect = desktop->screenGeometry(QCursor::pos());
+ int width = (rect.width()/2) - (m_brightnessDisplay->width()/2);
+ int height = (rect.height()/2) - (m_brightnessDisplay->height()/2);
+ width += rect.x();
+ height += rect.y();
+ m_brightnessDisplay->move(width, height);
+ m_brightnessDisplayTimer = new QTimer(this);
+ connect(m_brightnessDisplayTimer, SIGNAL(timeout()), this, SLOT(hideOSD()));
+ QDBusConnection::sessionBus().connect("org.kde.kded", "/modules/powerdevil", "org.kde.PowerDevil",
+ "brightnessChanged", this, SLOT(showBrightnessOSD(int,bool)));
+
setupFonts();
}
}
@@ -656,7 +678,7 @@ void Battery::updateStatus()
}
if (m_brightnessSlider) {
- m_brightnessSlider->setValue(Solid::Control::PowerManager::brightness());
+ updateSlider(Solid::Control::PowerManager::brightness());
}
}
@@ -995,4 +1017,34 @@ qreal Battery::acAlpha()
return m_acAlpha;
}
+void Battery::showBrightnessOSD(int brightness, bool byFnKey)
+{
+ if (byFnKey) {
+ m_brightnessDisplay->setValue(brightness);
+ m_brightnessDisplay->show();
+
+ //FIXME, how to get this to work before it is displayed for the first time?
+ QDesktopWidget* desktop = KApplication::kApplication()->desktop();
+ //Getting QRect of the screen where cursor is positioned
+ QRect rect = desktop->screenGeometry(QCursor::pos());
+ int width = (rect.width()/2) - (m_brightnessDisplay->width()/2);
+ int height = (rect.height()/2) - (m_brightnessDisplay->height()/2);
+ width += rect.x();
+ height += rect.y();
+ m_brightnessDisplay->move(width, height);
+
+ m_brightnessDisplayTimer->setInterval(2000);
+ m_brightnessDisplayTimer->start();
+
+ if (m_extenderVisible && m_brightnessSlider) {
+ updateSlider(brightness);
+ }
+ }
+}
+
+void Battery::hideOSD()
+{
+ m_brightnessDisplay->hide();
+}
+
#include "battery.moc"
diff -up kdebase-workspace-4.3.85/plasma/generic/applets/battery/battery.h.brightness_keys kdebase-workspace-4.3.85/plasma/generic/applets/battery/battery.h
--- kdebase-workspace-4.3.85/plasma/generic/applets/battery/battery.h.brightness_keys 2009-11-30 18:31:24.000000000 -0600
+++ kdebase-workspace-4.3.85/plasma/generic/applets/battery/battery.h 2009-12-18 10:00:30.640576179 -0600
@@ -39,6 +39,8 @@ namespace Plasma
class Slider;
}
+class QProgressBar;
+
class Battery : public Plasma::PopupApplet
{
Q_OBJECT
@@ -83,7 +85,7 @@ class Battery : public Plasma::PopupAppl
void sourceAdded(const QString &source);
void sourceRemoved(const QString &source);
void brightnessChanged(const int brightness);
- void updateSlider(const float brightness);
+ void updateSlider(int brightness);
void setFullBrightness();
void openConfig();
void setProfile(const QString &profile);
@@ -91,6 +93,8 @@ class Battery : public Plasma::PopupAppl
void hibernate();
void updateBattery();
void setupFonts();
+ void showBrightnessOSD(int brightness, bool byFnKey);
+ void hideOSD();
private:
void connectSources();
@@ -171,6 +175,10 @@ class Battery : public Plasma::PopupAppl
QPropertyAnimation *m_labelAnimation;
qreal m_acAlpha;
QPropertyAnimation *m_acAnimation;
+
+ bool m_ignoreBrightnessChange;
+ QProgressBar* m_brightnessDisplay;
+ QTimer* m_brightnessDisplayTimer;
};
K_EXPORT_PLASMA_APPLET(battery, Battery)
diff -up kdebase-workspace-4.3.85/powerdevil/daemon/org.kde.PowerDevil.xml.brightness_keys kdebase-workspace-4.3.85/powerdevil/daemon/org.kde.PowerDevil.xml
--- kdebase-workspace-4.3.85/powerdevil/daemon/org.kde.PowerDevil.xml.brightness_keys 2009-09-04 06:30:55.000000000 -0500
+++ kdebase-workspace-4.3.85/powerdevil/daemon/org.kde.PowerDevil.xml 2009-12-18 10:00:30.640576179 -0600
@@ -42,6 +42,10 @@
<arg type="as" direction="out" />
</method>
+ <method name="notifyOfBrightnessChange">
+ <arg type="i" direction="in" />
+ </method>
+
<signal name="lidClosed">
<arg type="i" direction="out" />
<arg type="s" direction="out" />
@@ -56,5 +60,9 @@
</signal>
<signal name="DPMSconfigUpdated">
</signal>
+ <signal name="brightnessChanged">
+ <arg type="i" direction="out" />
+ <arg type="b" direction="out" />
+ </signal>
</interface>
</node>
diff -up kdebase-workspace-4.3.85/powerdevil/daemon/PowerDevilDaemon.cpp.brightness_keys kdebase-workspace-4.3.85/powerdevil/daemon/PowerDevilDaemon.cpp
--- kdebase-workspace-4.3.85/powerdevil/daemon/PowerDevilDaemon.cpp.brightness_keys 2009-12-10 17:14:04.000000000 -0600
+++ kdebase-workspace-4.3.85/powerdevil/daemon/PowerDevilDaemon.cpp 2009-12-18 10:00:30.642567355 -0600
@@ -26,6 +26,8 @@
#include <kdemacros.h>
#include <KAboutData>
+#include <KAction>
+#include <KActionCollection>
#include <KPluginFactory>
#include <KNotification>
#include <KIcon>
@@ -93,6 +95,7 @@ public:
: notifier(Solid::Control::PowerManager::notifier())
, currentConfig(0)
, status(PowerDevilDaemon::NoAction)
+ , brightnessInHardware(false)
, ckSessionInterface(0) {}
Solid::Control::PowerManager::Notifier *notifier;
@@ -119,7 +122,9 @@ public:
int batteryPercent;
int brightness;
+ int cachedBrightness;
bool isPlugged;
+ bool brightnessInHardware;
// ConsoleKit stuff
QDBusInterface *ckSessionInterface;
@@ -174,6 +179,18 @@ PowerDevilDaemon::PowerDevilDaemon(QObje
d->ksmServerIface = new OrgKdeKSMServerInterfaceInterface("org.kde.ksmserver", "/KSMServer",
QDBusConnection::sessionBus(), this);
+ QDBusInterface halManager("org.freedesktop.Hal",
+ "/org/freedesktop/Hal/Manager", "org.freedesktop.Hal.Manager",
+ QDBusConnection::systemBus());
+ QStringList panelDevices = halManager.call("FindDeviceByCapability",
+ "laptop_panel").arguments().at(0).toStringList();
+ if (!panelDevices.empty()) {
+ QDBusInterface deviceInterface("org.freedesktop.Hal", panelDevices.at(0), "org.freedesktop.Hal.Device",
+ QDBusConnection::systemBus());
+ d->brightnessInHardware = deviceInterface.call("GetPropertyBoolean",
+ "laptop_panel.brightness_in_hardware").arguments().at(0).toBool();
+ }
+
/* Not needed anymore; I am not sure if we will need that in a future, so I leave it here
* just in case.
*
@@ -198,6 +215,17 @@ PowerDevilDaemon::PowerDevilDaemon(QObje
QDBusConnection::sessionBus().registerService("org.kde.powerdevil");
// All systems up Houston, let's go!
refreshStatus();
+
+ d->cachedBrightness = (int) Solid::Control::PowerManager::brightness();
+ KActionCollection* actionCollection = new KActionCollection( this );
+
+ KAction* globalAction = static_cast< KAction* >( actionCollection->addAction( "Increase Screen Brightness" ));
+ globalAction->setGlobalShortcut(KShortcut(Qt::Key_MonBrightnessUp));
+ connect(globalAction, SIGNAL(triggered(bool)), SLOT(increaseBrightness()));
+
+ globalAction = static_cast< KAction* >( actionCollection->addAction( "Decrease Screen Brightness" ));
+ globalAction->setGlobalShortcut(KShortcut(Qt::Key_MonBrightnessDown));
+ connect(globalAction, SIGNAL(triggered(bool)), SLOT(decreaseBrightness()));
}
PowerDevilDaemon::~PowerDevilDaemon()
@@ -661,24 +689,40 @@ void PowerDevilDaemon::buttonPressed(int
}
}
-void PowerDevilDaemon::decreaseBrightness()
+void PowerDevilDaemon::incDecBrightness(bool increase)
{
if (!checkIfCurrentSessionActive()) {
return;
}
- int currentBrightness = qMax(0, (int)(Solid::Control::PowerManager::brightness() - 10));
- Solid::Control::PowerManager::setBrightness(currentBrightness);
+ int currentBrightness = (int) Solid::Control::PowerManager::brightness();
+ if ((currentBrightness == d->cachedBrightness) && !d->brightnessInHardware)
+ {
+ int newBrightness;
+ if (increase) {
+ newBrightness = qMin(100, currentBrightness + 10);
+ }
+ else {
+ newBrightness = qMax(0, currentBrightness - 10);
+ }
+
+ Solid::Control::PowerManager::setBrightness(newBrightness);
+ currentBrightness = (int) Solid::Control::PowerManager::brightness();
+ }
+
+ if (!d->brightnessInHardware) {
+ emitBrightnessChanged(currentBrightness, true);
+ }
}
-void PowerDevilDaemon::increaseBrightness()
+void PowerDevilDaemon::decreaseBrightness()
{
- if (!checkIfCurrentSessionActive()) {
- return;
- }
+ incDecBrightness(false);
+}
- int currentBrightness = qMin(100, (int)(Solid::Control::PowerManager::brightness() + 10));
- Solid::Control::PowerManager::setBrightness(currentBrightness);
+void PowerDevilDaemon::increaseBrightness()
+{
+ incDecBrightness(true);
}
void PowerDevilDaemon::shutdownNotification(bool automated)
@@ -1463,4 +1507,17 @@ void PowerDevilDaemon::setUpConsoleKit()
SLOT(refreshStatus()));
}
+void PowerDevilDaemon::notifyOfBrightnessChange(int brightness)
+{
+ emitBrightnessChanged(brightness, false);
+}
+
+void PowerDevilDaemon::emitBrightnessChanged(int brightness, bool byFnKey)
+{
+ if ((d->cachedBrightness != brightness) || byFnKey) {
+ d->cachedBrightness = brightness;
+ emit brightnessChanged(brightness, byFnKey);
+ }
+}
+
#include "PowerDevilDaemon.moc"
diff -up kdebase-workspace-4.3.85/powerdevil/daemon/PowerDevilDaemon.h.brightness_keys kdebase-workspace-4.3.85/powerdevil/daemon/PowerDevilDaemon.h
--- kdebase-workspace-4.3.85/powerdevil/daemon/PowerDevilDaemon.h.brightness_keys 2009-11-30 18:30:27.000000000 -0600
+++ kdebase-workspace-4.3.85/powerdevil/daemon/PowerDevilDaemon.h 2009-12-18 10:00:30.643567133 -0600
@@ -61,10 +61,13 @@ public Q_SLOTS:
SuspensionLockHandler *lockHandler();
+ void notifyOfBrightnessChange(int brightness);
+
private Q_SLOTS:
void acAdapterStateChanged(int state, bool forced = false);
void batteryChargePercentChanged(int percent, const QString &udi);
+ void incDecBrightness(bool increase);
void decreaseBrightness();
void increaseBrightness();
@@ -106,6 +109,7 @@ Q_SIGNALS:
void stateChanged(int, bool);
void profileChanged(const QString &, const QStringList &);
void DPMSconfigUpdated();
+ void brightnessChanged(int brightness, bool byFnKey);
private:
void lockScreen();
@@ -127,6 +131,8 @@ private:
bool checkIfCurrentSessionActive();
+ void emitBrightnessChanged(int brightness, bool byFnKey);
+
public:
enum IdleAction {
None = 0,
Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/kdebase-workspace/devel/.cvsignore,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -p -r1.43 -r1.44
--- .cvsignore 1 Dec 2009 15:23:46 -0000 1.43
+++ .cvsignore 18 Dec 2009 16:04:37 -0000 1.44
@@ -1 +1 @@
-kdebase-workspace-4.3.80.tar.bz2
+kdebase-workspace-4.3.85.tar.bz2
Index: kdebase-workspace.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kdebase-workspace/devel/kdebase-workspace.spec,v
retrieving revision 1.329
retrieving revision 1.330
diff -u -p -r1.329 -r1.330
--- kdebase-workspace.spec 16 Dec 2009 12:35:23 -0000 1.329
+++ kdebase-workspace.spec 18 Dec 2009 16:04:38 -0000 1.330
@@ -1,3 +1,4 @@
+
%if 0%{?fedora} && 0%{?fedora} < 12
%define with_polkit_09 1
%endif
@@ -5,14 +6,14 @@
%{!?python_sitearch:%global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
Summary: KDE Workspace
-Name: kdebase-workspace
-Version: 4.3.80
-Release: 5%{?dist}
+Name: kdebase-workspace
+Version: 4.3.85
+Release: 1%{?dist}
-Source0: ftp://ftp.kde.org/pub/kde/unstable/%{version}/src/kdebase-workspace-%{version}.tar.bz2
License: GPLv2
-Group: User Interface/Desktops
-URL: http://www.kde.org/
+Group: User Interface/Desktops
+URL: http://www.kde.org/
+Source0: ftp://ftp.kde.org/pub/kde/unstable/%{version}/src/kdebase-workspace-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch1: kdebase-workspace-4.3.75-redhat-startkde.patch
@@ -36,7 +37,6 @@ Patch16: kdebase-workspace-4.3.75-batter
# default Leave submenu
Patch17: kdebase-workspace-4.3.75-classicmenu-logout.patch
# Fix the version
-Patch18: kdebase-workspace-4.3.80-cmake-targets.patch
Patch19: kdebase-workspace-4.3.3-kdm_plymouth.patch
Patch20: kdebase-workspace-4.3.80-xsession_errors_O_APPEND.patch
@@ -46,7 +46,7 @@ Patch50: kdebase-workspace-4.3.3-kde#171
# kubuntu working to upstream this
# FIXME: Not upstreamed yet --Ben (4.3.80)
#Patch51: http://bazaar.launchpad.net/~kubuntu-members/kdebase-workspace/ubuntu/annotate/head%3A/debian/patches/kubuntu_101_brightness_fn_keys_and_osd.diff
-Patch51: kdebase-workspace-4.3.80-brightness-keys.patch
+Patch51: kdebase-workspace-4.3.85-brightness_keys.patch
# moving to non-multilib hack
Obsoletes: kdebase-workspace < 4.3.0-2
@@ -273,7 +273,6 @@ Requires: akonadi
%patch15 -p1 -b .kio_sysinfo
%patch16 -p1 -b .showremainingtime
%patch17 -p1 -b .classicmenu-logout
-%patch18 -p1 -b .cmake-targets
%patch19 -p1 -b .kdm_plymouth
%patch20 -p1 -b .xsession_errors_O_APPEND
@@ -615,6 +614,9 @@ fi
%changelog
+* Fri Dec 18 2009 Rex Dieter <rdieter at fedoraproject.org> - 4.3.85-1
+- kde-4.3.85 (4.4beta2)
+
* Wed Dec 16 2009 Jaroslav Reznik <jreznik at redhat.com> - 4.3.80-5
- Repositioning the KDE Brand (#547361)
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/kdebase-workspace/devel/sources,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -p -r1.51 -r1.52
--- sources 1 Dec 2009 15:23:46 -0000 1.51
+++ sources 18 Dec 2009 16:04:38 -0000 1.52
@@ -1 +1 @@
-68177b5c0dd8ab4bebe682393871f82c kdebase-workspace-4.3.80.tar.bz2
+b727b668858a4ddbe4649643f62ebd4a kdebase-workspace-4.3.85.tar.bz2
--- kdebase-workspace-4.3.80-brightness-keys.patch DELETED ---
--- kdebase-workspace-4.3.80-cmake-targets.patch DELETED ---
More information about the scm-commits
mailing list