[SCM] ktp-kded-integration-module packaging branch, master, updated. debian/15.12.1-2-382-gbd961c2
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:15:09 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-kded-module.git;a=commitdiff;h=68d2b69
The following commit has been merged in the master branch:
commit 68d2b69a99b1f0eddf256578273890f99fdc8a93
Author: Lucas Betschart <lucasbetschart at gmail.com>
Date: Sat May 4 11:07:48 2013 +0200
Plugin to set status "Away" when screen gets locked
REVIEW: 110260
BUG: 290998
FIXED-IN: 0.7.0
---
CMakeLists.txt | 1 +
config/telepathy-kded-config.cpp | 26 +++++++++++
config/telepathy-kded-config.h | 1 +
config/telepathy-kded-config.ui | 96 +++++++++++++++++++++++++++++++++++++++-
telepathy-module.cpp | 11 ++++-
telepathy-module.h | 2 +
6 files changed, 134 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a339495..1c4086b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,6 +38,7 @@ set (kded_ktp_integration_module_SRCS
autoconnect.cpp
error-handler.cpp
contactnotify.cpp
+ screensaveraway.cpp
)
kde4_add_plugin (kded_ktp_integration_module
diff --git a/config/telepathy-kded-config.cpp b/config/telepathy-kded-config.cpp
index 5a7e91d..d8f68b4 100644
--- a/config/telepathy-kded-config.cpp
+++ b/config/telepathy-kded-config.cpp
@@ -87,6 +87,9 @@ TelepathyKDEDConfig::TelepathyKDEDConfig(QWidget *parent, const QVariantList& ar
ui->m_xaMessage->setClickMessage(i18n("Leave empty for no message"));
ui->m_xaMessage->setToolTip(ui->m_xaMessage->clickMessage()); //use the same i18n string
+ ui->m_screenSaverAwayMessage->setClickMessage(i18n("Leave empty for no message"));
+ ui->m_screenSaverAwayMessage->setToolTip(ui->m_screenSaverAwayMessage->clickMessage()); //use the same i18n stringToMode
+
connect(ui->m_downloadUrlRequester, SIGNAL(textChanged(QString)),
this, SLOT(settingsHasChanged()));
connect(ui->m_autoAcceptCheckBox, SIGNAL(stateChanged(int)),
@@ -111,6 +114,10 @@ TelepathyKDEDConfig::TelepathyKDEDConfig(QWidget *parent, const QVariantList& ar
this, SLOT(settingsHasChanged()));
connect(ui->m_autoOfflineCheckBox, SIGNAL(stateChanged(int)),
this, SLOT(settingsHasChanged()));
+ connect(ui->m_screenSaverAwayCheckBox, SIGNAL(stateChanged(int)),
+ this, SLOT(settingsHasChanged()));
+ connect(ui->m_screenSaverAwayMessage, SIGNAL(textChanged(QString)),
+ this, SLOT(settingsHasChanged()));
connect(ui->m_awayCheckBox, SIGNAL(clicked(bool)),
this, SLOT(autoAwayChecked(bool)));
@@ -120,6 +127,8 @@ TelepathyKDEDConfig::TelepathyKDEDConfig(QWidget *parent, const QVariantList& ar
this, SLOT(nowPlayingChecked(bool)));
connect(ui->m_autoOfflineCheckBox, SIGNAL(clicked(bool)),
this, SLOT(autoOfflineChecked(bool)));
+ connect(ui->m_screenSaverAwayCheckBox, SIGNAL(clicked(bool)),
+ this, SLOT(screenSaverAwayChecked(bool)));
}
TelepathyKDEDConfig::~TelepathyKDEDConfig()
@@ -176,6 +185,15 @@ void TelepathyKDEDConfig::load()
ui->m_xaMessage->setText(xaMessage);
ui->m_xaMessage->setEnabled(autoXAEnabled && autoAwayEnabled);
+ //check if screen-server-away is enabled
+ bool screenSaverAwayEnabled = kdedConfig.readEntry(QLatin1String("screenSaverAwayEnabled"), true);
+
+ QString screenSaverAwayMessage = kdedConfig.readEntry(QLatin1String("screenSaverAwayMessage"), QString());
+
+ ui->m_screenSaverAwayCheckBox->setChecked(screenSaverAwayEnabled);
+ ui->m_screenSaverAwayMessage->setText(screenSaverAwayMessage);
+ ui->m_screenSaverAwayMessage->setEnabled(screenSaverAwayEnabled);
+
//check if 'Now playing..' is enabled
bool nowPlayingEnabled = kdedConfig.readEntry(QLatin1String("nowPlayingEnabled"), false);
ui->m_nowPlayingCheckBox->setChecked(nowPlayingEnabled);
@@ -254,6 +272,8 @@ void TelepathyKDEDConfig::save()
kdedConfig.writeEntry(QLatin1String("xaAfter"), ui->m_xaMins->value());
kdedConfig.writeEntry(QLatin1String("xaMessage"), ui->m_xaMessage->text());
kdedConfig.writeEntry(QLatin1String("nowPlayingEnabled"), ui->m_nowPlayingCheckBox->isChecked());
+ kdedConfig.writeEntry(QLatin1String("screenSaverAwayEnabled"), ui->m_screenSaverAwayCheckBox->isChecked());
+ kdedConfig.writeEntry(QLatin1String("screenSaverAwayMessage"), ui->m_screenSaverAwayMessage->text());
//we store a nowPlayingText version with untranslated tag names
QString modifiedNowPlayingText = ui->m_nowPlayingText->text();
@@ -309,6 +329,12 @@ void TelepathyKDEDConfig::autoAwayChecked(bool checked)
Q_EMIT changed(true);
}
+void TelepathyKDEDConfig::screenSaverAwayChecked(bool checked)
+{
+ ui->m_screenSaverAwayMessage->setEnabled(checked);
+ Q_EMIT changed(true);
+}
+
void TelepathyKDEDConfig::autoXAChecked(bool checked)
{
ui->m_xaMins->setEnabled(checked);
diff --git a/config/telepathy-kded-config.h b/config/telepathy-kded-config.h
index b1bf626..a73494e 100644
--- a/config/telepathy-kded-config.h
+++ b/config/telepathy-kded-config.h
@@ -46,6 +46,7 @@ private Q_SLOTS:
void autoXAChecked(bool checked);
void nowPlayingChecked(bool checked);
void autoOfflineChecked(bool checked);
+ void screenSaverAwayChecked(bool checked);
private:
QStringList m_tagNames;
diff --git a/config/telepathy-kded-config.ui b/config/telepathy-kded-config.ui
index 74ce51e..37231ec 100644
--- a/config/telepathy-kded-config.ui
+++ b/config/telepathy-kded-config.ui
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>497</width>
- <height>584</height>
+ <height>725</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@@ -128,7 +128,7 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
- <cstring>m_awayMessage</cstring>
+ <cstring>m_screenSaverAwayMessage</cstring>
</property>
</widget>
</item>
@@ -238,6 +238,98 @@
</item>
</layout>
</item>
+ <item>
+ <spacer name="verticalSpacerScreenSaverAway">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>5</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="Line" name="line_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QLabel" name="labelScreenSaverAway">
+ <property name="text">
+ <string>Set my status to Away when screen saver is activated:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayoutScreenSaverAway">
+ <item>
+ <layout class="QHBoxLayout" name="away_check_layout">
+ <item>
+ <widget class="QCheckBox" name="m_screenSaverAwayCheckBox">
+ <property name="text">
+ <string>Enabled</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="screenSaverAway_spaces">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="screenSaverAway_layout">
+ <item>
+ <widget class="QLabel" name="m_screenSaverAwayLabel">
+ <property name="text">
+ <string>With &message:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>m_screenSaverAwayMessage</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="KLineEdit" name="m_screenSaverAwayMessage"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
</item>
diff --git a/telepathy-module.cpp b/telepathy-module.cpp
index d3f223a..3e71015 100644
--- a/telepathy-module.cpp
+++ b/telepathy-module.cpp
@@ -36,6 +36,7 @@
#include "error-handler.h"
#include "telepathy-kded-module-plugin.h"
#include "contactnotify.h"
+#include "screensaveraway.h"
#include <KConfigGroup>
#include "contact-request-handler.h"
@@ -52,6 +53,7 @@ TelepathyModule::TelepathyModule(QObject* parent, const QList<QVariant>& args)
, m_globalPresence( 0 )
, m_contactHandler( 0 )
, m_contactNotify( 0 )
+ , m_screenSaverAway( 0 )
{
Q_UNUSED(args)
@@ -112,6 +114,13 @@ void TelepathyModule::onAccountManagerReady(Tp::PendingOperation* op)
connect(this, SIGNAL(settingsChanged()),
m_autoAway, SLOT(onSettingsChanged()));
+ m_screenSaverAway = new ScreenSaverAway(m_globalPresence, this);
+ connect(m_screenSaverAway, SIGNAL(activate(bool)),
+ this, SLOT(onPluginActivated(bool)));
+
+ connect(this, SIGNAL(settingsChanged()),
+ m_screenSaverAway, SLOT(onSettingsChanged()));
+
m_mpris = new TelepathyMPRIS(m_globalPresence, this);
connect(m_mpris, SIGNAL(activate(bool)),
this, SLOT(onPluginActivated(bool)));
@@ -123,7 +132,7 @@ void TelepathyModule::onAccountManagerReady(Tp::PendingOperation* op)
m_autoConnect->setAccountManager(m_accountManager);
//earlier in list = higher priority
- m_pluginStack << m_autoAway << m_mpris;
+ m_pluginStack << m_autoAway << m_screenSaverAway << m_mpris;
m_errorHandler = new ErrorHandler(m_accountManager, this);
m_contactHandler = new ContactRequestHandler(m_accountManager, this);
diff --git a/telepathy-module.h b/telepathy-module.h
index 748437d..ec08c6e 100644
--- a/telepathy-module.h
+++ b/telepathy-module.h
@@ -41,6 +41,7 @@ class TelepathyMPRIS;
class AutoAway;
class AutoConnect;
class ContactNotify;
+class ScreenSaverAway;
class TelepathyModule : public KDEDModule
{
@@ -72,6 +73,7 @@ private:
KTp::GlobalPresence *m_globalPresence;
ContactRequestHandler *m_contactHandler;
ContactNotify *m_contactNotify;
+ ScreenSaverAway *m_screenSaverAway;
QList<TelepathyKDEDModulePlugin*> m_pluginStack;
KTp::Presence m_lastUserPresence;
--
ktp-kded-integration-module packaging
More information about the pkg-kde-commits
mailing list