mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 02:42:50 +00:00
activities cleanup
This commit is contained in:
parent
d8d361c429
commit
b942e203c5
10 changed files with 8 additions and 229 deletions
|
@ -1,6 +0,0 @@
|
|||
Until the KActivity* classes go to kdelibs, the
|
||||
following files in kdebase need to be synced
|
||||
|
||||
workspace/libs/kworkspace/org.kde.ActivityManager.xml
|
||||
runtime/activitymanager/org.kde.ActivityManager.xml
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
<node>
|
||||
<interface name="org.kde.ActivityManager">
|
||||
<signal name="CurrentActivityChanged">
|
||||
<arg name="id" type="s" direction="out"/>
|
||||
</signal>
|
||||
<signal name="ActivityAdded">
|
||||
<arg name="id" type="s" direction="out"/>
|
||||
</signal>
|
||||
<signal name="ActivityStarted">
|
||||
<arg name="id" type="s" direction="out"/>
|
||||
</signal>
|
||||
<signal name="ActivityStopped">
|
||||
<arg name="id" type="s" direction="out"/>
|
||||
</signal>
|
||||
<signal name="ActivityRemoved">
|
||||
<arg name="id" type="s" direction="out"/>
|
||||
</signal>
|
||||
<signal name="ActivityChanged">
|
||||
<arg name="id" type="s" direction="out"/>
|
||||
</signal>
|
||||
<signal name="ActivityStateChanged">
|
||||
<arg name="id" type="s" direction="out"/>
|
||||
<arg name="state" type="i" direction="out"/>
|
||||
</signal>
|
||||
<signal name="ResourceAccessed">
|
||||
<arg name="application" type="s" direction="out"/>
|
||||
<arg name="uri" type="s" direction="out"/>
|
||||
</signal>
|
||||
<signal name="ResourceOpened">
|
||||
<arg name="application" type="s" direction="out"/>
|
||||
<arg name="windowId" type="u" direction="out"/>
|
||||
<arg name="uri" type="s" direction="out"/>
|
||||
</signal>
|
||||
<signal name="ResourceModified">
|
||||
<arg name="windowId" type="u" direction="out"/>
|
||||
<arg name="uri" type="s" direction="out"/>
|
||||
</signal>
|
||||
<signal name="ResourceClosed">
|
||||
<arg name="windowId" type="u" direction="out"/>
|
||||
<arg name="uri" type="s" direction="out"/>
|
||||
</signal>
|
||||
<method name="Start">
|
||||
</method>
|
||||
<method name="Stop">
|
||||
</method>
|
||||
<method name="CurrentActivity">
|
||||
<arg type="s" direction="out"/>
|
||||
</method>
|
||||
<method name="SetCurrentActivity">
|
||||
<arg type="b" direction="out"/>
|
||||
<arg name="id" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="AddActivity">
|
||||
<arg type="s" direction="out"/>
|
||||
<arg name="name" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="StartActivity">
|
||||
<arg name="id" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="StopActivity">
|
||||
<arg name="id" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="ActivityState">
|
||||
<arg type="i" direction="out"/>
|
||||
<arg name="id" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="RemoveActivity">
|
||||
<arg name="id" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="ListActivities">
|
||||
<arg type="as" direction="out"/>
|
||||
</method>
|
||||
<method name="ListActivities">
|
||||
<arg type="as" direction="out"/>
|
||||
<arg name="state" type="i" direction="in"/>
|
||||
</method>
|
||||
<method name="ActivityName">
|
||||
<arg type="s" direction="out"/>
|
||||
<arg name="id" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="SetActivityName">
|
||||
<arg name="id" type="s" direction="in"/>
|
||||
<arg name="name" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="ActivityDescription">
|
||||
<arg type="s" direction="out"/>
|
||||
<arg name="id" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="SetActivityDescription">
|
||||
<arg name="id" type="s" direction="in"/>
|
||||
<arg name="description" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="ActivityIcon">
|
||||
<arg type="s" direction="out"/>
|
||||
<arg name="id" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="SetActivityIcon">
|
||||
<arg name="id" type="s" direction="in"/>
|
||||
<arg name="icon" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="IsBackstoreAvailable">
|
||||
<arg type="b" direction="out"/>
|
||||
</method>
|
||||
<method name="NotifyResourceAccessed">
|
||||
<arg name="application" type="s" direction="in"/>
|
||||
<arg name="uri" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="NotifyResourceOpened">
|
||||
<arg name="application" type="s" direction="in"/>
|
||||
<arg name="windowId" type="u" direction="in"/>
|
||||
<arg name="uri" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="NotifyResourceModified">
|
||||
<arg name="windowId" type="u" direction="in"/>
|
||||
<arg name="uri" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="NotifyResourceClosed">
|
||||
<arg name="windowId" type="u" direction="in"/>
|
||||
<arg name="uri" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="ActivitiesForResource">
|
||||
<arg type="as" direction="out"/>
|
||||
<arg name="uri" type="s" direction="in"/>
|
||||
</method>
|
||||
</interface>
|
||||
</node>
|
|
@ -48,8 +48,6 @@
|
|||
#include <Plasma/DeclarativeWidget>
|
||||
#include <Plasma/Package>
|
||||
|
||||
#include <KActivities/Consumer>
|
||||
|
||||
#include <taskmanager/task.h>
|
||||
|
||||
const int FAST_UPDATE_DELAY = 100;
|
||||
|
@ -133,10 +131,6 @@ void Pager::init()
|
|||
recalculateGridSizes(m_rows);
|
||||
|
||||
setCurrentDesktop(KWindowSystem::currentDesktop());
|
||||
|
||||
KActivities::Consumer *act = new KActivities::Consumer(this);
|
||||
connect(act, SIGNAL(currentActivityChanged(QString)), this, SLOT(currentActivityChanged(QString)));
|
||||
m_currentActivity = act->currentActivity();
|
||||
}
|
||||
|
||||
void Pager::updatePagerStyle()
|
||||
|
@ -576,17 +570,6 @@ void Pager::recalculateWindowRects()
|
|||
continue;
|
||||
}
|
||||
|
||||
//check activity
|
||||
unsigned long properties[] = { 0, NET::WM2Activities };
|
||||
NETWinInfo netInfo(QX11Info::display(), window, QX11Info::appRootWindow(), properties, 2);
|
||||
QString result(netInfo.activities());
|
||||
if (!result.isEmpty() && result != "00000000-0000-0000-0000-000000000000") {
|
||||
QStringList activities = result.split(',');
|
||||
if (!activities.contains(m_currentActivity)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < m_desktopCount; i++) {
|
||||
if (!info.isOnDesktop(i+1)) {
|
||||
continue;
|
||||
|
@ -659,12 +642,6 @@ void Pager::currentDesktopChanged(int desktop)
|
|||
startTimerFast();
|
||||
}
|
||||
|
||||
void Pager::currentActivityChanged(const QString &activity)
|
||||
{
|
||||
m_currentActivity = activity;
|
||||
startTimerFast();
|
||||
}
|
||||
|
||||
void Pager::numberOfDesktopsChanged(int num)
|
||||
{
|
||||
if (num < 1) {
|
||||
|
|
|
@ -96,7 +96,6 @@ class Pager : public Plasma::Applet
|
|||
|
||||
void configAccepted();
|
||||
void currentDesktopChanged(int desktop);
|
||||
void currentActivityChanged(const QString &activity);
|
||||
void desktopsSizeChanged();
|
||||
void numberOfDesktopsChanged(int num);
|
||||
void desktopNamesChanged();
|
||||
|
@ -146,7 +145,6 @@ class Pager : public Plasma::Applet
|
|||
int m_columns;
|
||||
int m_desktopCount;
|
||||
int m_currentDesktop;
|
||||
QString m_currentActivity;
|
||||
qreal m_widthScaleFactor;
|
||||
qreal m_heightScaleFactor;
|
||||
QSizeF m_size;
|
||||
|
|
|
@ -37,7 +37,6 @@ Item {
|
|||
property int maxStripes: 2
|
||||
property bool forceStripes: false
|
||||
property bool showOnlyCurrentDesktop: false
|
||||
property bool showOnlyCurrentActivity: false
|
||||
property bool showOnlyMinimized: false
|
||||
property bool showToolTip: true
|
||||
property bool highlightWindows: false
|
||||
|
@ -113,21 +112,6 @@ Item {
|
|||
subTextEntries.push(i18n("On %1", task.DesktopName));
|
||||
}
|
||||
|
||||
if (task.OnAllActivities) {
|
||||
subTextEntries.push(i18nc("Which virtual desktop a window is currently on",
|
||||
"Available on all activities"));
|
||||
} else if (tasks.showOnlyCurrentActivity) {
|
||||
if (task.OtherActivityNames.length > 0) {
|
||||
subTextEntries.push(i18nc("Activities a window is currently on (apart from the current one)",
|
||||
"Also available on %1",
|
||||
task.OtherActivityNames.join(", ")));
|
||||
}
|
||||
} else if (task.ActivityNames.length > 0) {
|
||||
subTextEntries.push(i18nc("Which activities a window is currently on",
|
||||
"Available on %1",
|
||||
task.ActivityNames.join(", ")));
|
||||
}
|
||||
|
||||
return subTextEntries.join("<br />");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -399,13 +399,6 @@ void Tasks::configChanged()
|
|||
changed = true;
|
||||
}
|
||||
|
||||
const bool showOnlyCurrentActivity = cg.readEntry("showOnlyCurrentActivity", true);
|
||||
if (showOnlyCurrentActivity != m_groupManager->showOnlyCurrentActivity()) {
|
||||
m_groupManager->setShowOnlyCurrentActivity(showOnlyCurrentActivity);
|
||||
m_declarativeWidget->rootObject()->setProperty("showOnlyCurrentActivity", showOnlyCurrentActivity);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
const bool showOnlyCurrentScreen = cg.readEntry("showOnlyCurrentScreen", false);
|
||||
if (showOnlyCurrentScreen != m_groupManager->showOnlyCurrentScreen()) {
|
||||
m_groupManager->setShowOnlyCurrentScreen(showOnlyCurrentScreen);
|
||||
|
@ -500,7 +493,6 @@ void Tasks::createConfigurationInterface(KConfigDialog *parent)
|
|||
m_ui.showTooltip->setChecked(m_declarativeWidget->rootObject()->property("showToolTip").toBool());
|
||||
m_ui.highlightWindows->setChecked(m_highlightWindows);
|
||||
m_ui.showOnlyCurrentDesktop->setChecked(m_groupManager->showOnlyCurrentDesktop());
|
||||
m_ui.showOnlyCurrentActivity->setChecked(m_groupManager->showOnlyCurrentActivity());
|
||||
m_ui.showOnlyCurrentScreen->setChecked(m_groupManager->showOnlyCurrentScreen());
|
||||
m_ui.showOnlyMinimized->setChecked(m_groupManager->showOnlyMinimized());
|
||||
m_ui.fillRows->setChecked(m_declarativeWidget->rootObject()->property("forceStripes").toBool());
|
||||
|
@ -567,7 +559,6 @@ void Tasks::createConfigurationInterface(KConfigDialog *parent)
|
|||
connect(m_ui.sortingStrategy, SIGNAL(currentIndexChanged(int)), parent, SLOT(settingsModified()));
|
||||
connect(m_ui.showOnlyCurrentScreen, SIGNAL(toggled(bool)), parent, SLOT(settingsModified()));
|
||||
connect(m_ui.showOnlyCurrentDesktop, SIGNAL(toggled(bool)), parent, SLOT(settingsModified()));
|
||||
connect(m_ui.showOnlyCurrentActivity, SIGNAL(toggled(bool)), parent, SLOT(settingsModified()));
|
||||
connect(m_ui.showOnlyMinimized, SIGNAL(toggled(bool)), parent, SLOT(settingsModified()));
|
||||
}
|
||||
|
||||
|
@ -581,7 +572,6 @@ void Tasks::configAccepted()
|
|||
KConfigGroup cg = config();
|
||||
|
||||
cg.writeEntry("showOnlyCurrentDesktop", m_ui.showOnlyCurrentDesktop->isChecked());
|
||||
cg.writeEntry("showOnlyCurrentActivity", m_ui.showOnlyCurrentActivity->isChecked());
|
||||
cg.writeEntry("showOnlyCurrentScreen", m_ui.showOnlyCurrentScreen->isChecked());
|
||||
cg.writeEntry("showOnlyMinimized", m_ui.showOnlyMinimized->isChecked());
|
||||
|
||||
|
|
|
@ -6,11 +6,14 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>479</width>
|
||||
<height>366</height>
|
||||
<width>483</width>
|
||||
<height>324</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="sizePolicy">
|
||||
|
@ -232,7 +235,7 @@
|
|||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QComboBox" name="sortingStrategy">
|
||||
<property name="minimumSize">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
|
@ -315,26 +318,6 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>Only show tasks from the current activity</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>showOnlyCurrentActivity</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<widget class="QCheckBox" name="showOnlyCurrentActivity">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>Only show tasks that are minimized</string>
|
||||
|
@ -347,14 +330,14 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="1">
|
||||
<item row="12" column="1">
|
||||
<widget class="QCheckBox" name="showOnlyMinimized">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="1">
|
||||
<item row="13" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
|
|
@ -27,7 +27,6 @@ if (freeEdges["bottom"] == true) {
|
|||
|
||||
panel.height = screenGeometry(panel.screen).height > 1024 ? 35 : 27
|
||||
panel.addWidget("launcher")
|
||||
panel.addWidget("org.kde.showActivityManager")
|
||||
pager = panel.addWidget("pager")
|
||||
pager.writeConfig("hideWhenSingleDesktop", "true")
|
||||
tasks = panel.addWidget("tasks")
|
||||
|
|
|
@ -98,8 +98,6 @@ void TaskSource::updateTask(::TaskManager::TaskChanges taskChanges)
|
|||
setData("onCurrentDesktop", taskPtr->isOnCurrentDesktop());
|
||||
setData("onAllDesktops", taskPtr->isOnAllDesktops());
|
||||
setData("desktop", taskPtr->desktop());
|
||||
setData("onCurrentActivity", taskPtr->isOnCurrentActivity());
|
||||
setData("onAllActivities", taskPtr->isOnAllActivities());
|
||||
setData("activities", taskPtr->activities());
|
||||
setData("icon", taskPtr->icon());
|
||||
setData("actionMinimize", taskPtr->info().actionSupported(NET::ActionMinimize));
|
||||
|
@ -135,10 +133,6 @@ void TaskSource::updateTask(::TaskManager::TaskChanges taskChanges)
|
|||
setData("onAllDesktops", taskPtr->isOnAllDesktops());
|
||||
setData("desktop", taskPtr->desktop());
|
||||
break;
|
||||
case TaskManager::ActivitiesChanged:
|
||||
setData("onCurrentActivity", taskPtr->isOnCurrentActivity());
|
||||
setData("onAllActivities", taskPtr->isOnAllActivities());
|
||||
setData("activities", taskPtr->activities());
|
||||
case TaskManager::ActionsChanged:
|
||||
setData("actionMinimize", taskPtr->info().actionSupported(NET::ActionMinimize));
|
||||
setData("actionMaximize", taskPtr->info().actionSupported(NET::ActionMax));
|
||||
|
@ -168,17 +162,5 @@ void TaskSource::updateDesktop()
|
|||
}
|
||||
}
|
||||
|
||||
void TaskSource::updateActivity()
|
||||
{
|
||||
if (!m_task) {
|
||||
return;
|
||||
}
|
||||
|
||||
const bool onCurrentActivity = m_task.data()->isOnCurrentActivity();
|
||||
if (data()["onCurrentActivity"].toBool() != onCurrentActivity) {
|
||||
setData("onCurrentActivity", onCurrentActivity);
|
||||
checkForUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
#include "tasksource.moc"
|
||||
|
|
|
@ -49,7 +49,6 @@ class TaskSource : public Plasma::DataContainer
|
|||
void updateStartup(::TaskManager::TaskChanges startupChanges);
|
||||
void updateTask(::TaskManager::TaskChanges taskChanges);
|
||||
void updateDesktop();
|
||||
void updateActivity();
|
||||
|
||||
private:
|
||||
QWeakPointer< ::TaskManager::Startup > m_startup;
|
||||
|
|
Loading…
Add table
Reference in a new issue