Merge lp:~agateau/unity-2d/move-bfb-to-launcher into lp:unity-2d

Proposed by Aurélien Gâteau on 2011-07-28
Status: Merged
Approved by: Florian Boucault on 2011-08-11
Approved revision: 631
Merged at revision: 644
Proposed branch: lp:~agateau/unity-2d/move-bfb-to-launcher
Merge into: lp:unity-2d
Diff against target: 1208 lines (+468/-430)
19 files modified
.bzrignore (+2/-0)
launcher/Launcher.qml (+5/-0)
libunity-2d-private/Unity2d/plugin.cpp (+4/-0)
libunity-2d-private/src/CMakeLists.txt (+2/-0)
libunity-2d-private/src/bfb.cpp (+119/-0)
libunity-2d-private/src/bfb.h (+75/-0)
libunity-2d-private/src/dashclient.cpp (+155/-0)
libunity-2d-private/src/dashclient.h (+68/-0)
libunity-2d-private/src/placeentry.cpp (+13/-80)
libunity-2d-private/src/placeentry.h (+2/-8)
panel/app/panelmanager.cpp (+1/-14)
panel/applets/CMakeLists.txt (+0/-3)
panel/applets/appname/appnameapplet.cpp (+20/-9)
panel/applets/homebutton/homebutton.cpp (+0/-63)
panel/applets/homebutton/homebutton.h (+0/-43)
panel/applets/homebutton/homebuttonapplet.cpp (+0/-111)
panel/applets/homebutton/homebuttonapplet.h (+0/-53)
panel/tests/CMakeLists.txt (+2/-4)
panel/tests/homebuttonapplettest.cpp (+0/-42)
To merge this branch: bzr merge lp:~agateau/unity-2d/move-bfb-to-launcher
Reviewer Review Type Date Requested Status
Florian Boucault (community) 2011-07-28 Needs Fixing on 2011-08-11
Review via email: mp+69677@code.launchpad.net

Commit message

[panel][launcher] Turn the HomeButtonApplet into a launcher item.

Description of the change

This branch turns the panel HomeButtonApplet (aka BFB) into a launcher item.

It does not introduce any known regression so it should be good to merge, but it is not completely done yet: it is missing the following features:
- Item quicklist should contain a list of available Dash lenses
- Window buttons should control the Dash size (desktop to fullscreen and back)

Note that I merged lp:~agateau/unity-2d/themed-window-buttons in this branch because both branches touch the window button code. You probably went to review the themed-window-buttons branch first ( https://code.launchpad.net/~agateau/unity-2d/themed-window-buttons/+merge/69495 )

To post a comment you must log in.
Florian Boucault (fboucault) wrote :

bfb.* needs to be moved from libunity-2d-private/Unity2d to libunity-2d-private/src

review: Needs Fixing
Florian Boucault (fboucault) wrote :

opening the dash and then dismissing it either by clicking outside it or pressing ESC does not remove the 'active' arrow from the tile.

review: Needs Fixing
Florian Boucault (fboucault) wrote :

> bfb.* needs to be moved from libunity-2d-private/Unity2d to libunity-2d-
> private/src

Merge lp:unity-2d/4.0 and you will probably understand better what I mean.

Florian Boucault (fboucault) wrote :

The specification says that the window buttons should not be visible until the user hovers the panel, just like for the application's menu.

review: Needs Fixing
Florian Boucault (fboucault) wrote :

In bfb.cpp:

QString BfbItem::icon() const {
    return "unity-icon-theme/distributor-logo";
}

Was there an agreement with Unity's developers on the icon to use there?

625. By Aurélien Gâteau on 2011-08-10

Sync with 4.0

626. By Aurélien Gâteau on 2011-08-10

Move bfb.{h,cpp} from Unity2d/ to src/

627. By Aurélien Gâteau on 2011-08-10

[launcher] Update Bfb::active() when Dash is closed by clicking outside

628. By Aurélien Gâteau on 2011-08-10

[panel] Only show window buttons when mouse is over the panel

Aurélien Gâteau (agateau) wrote :

All issues should be fixed now.

Regarding the icon, it has not been discussed with Unity developers but it is the icon which was used in the HomeButton and it looks like the one in the spec, only smaller because the biggest available size is 24x24. Design needs to provide a 48x48 version.

Florian Boucault (fboucault) wrote :

Revision 627:

- we do not want to startup the dash when starting up the launcher (at login) in order to reduce the login time (remember all the efforts put in that last cycle?); look at placeentry.cpp for the strategy employed to avoid it
- in BfbItem::activate:
        m_dashInterface->call(QDBus::Block, "activateHome");

making the call blocking is not a good idea. Now that the proper monitoring of the active property will be in place, I suppose it won't be necessary anymore

- what happens if the dash dies for a reason or another, does the monitoring of the active property still work?

review: Needs Fixing
Florian Boucault (fboucault) wrote :

> All issues should be fixed now.
>
> Regarding the icon, it has not been discussed with Unity developers but it is
> the icon which was used in the HomeButton and it looks like the one in the
> spec, only smaller because the biggest available size is 24x24. Design needs
> to provide a 48x48 version.

Please agree with the Unity developers so that we have the same solution and in the end the right icon (the trash icon followed the same path last cycle and we ended up with the wrong one)

Florian Boucault (fboucault) wrote :

> > All issues should be fixed now.
> >
> > Regarding the icon, it has not been discussed with Unity developers but it
> is
> > the icon which was used in the HomeButton and it looks like the one in the
> > spec, only smaller because the biggest available size is 24x24. Design needs
> > to provide a 48x48 version.
>
> Please agree with the Unity developers so that we have the same solution and
> in the end the right icon (the trash icon followed the same path last cycle
> and we ended up with the wrong one)

And also, chase up design to make sure the right icon size will be provided.

629. By Aurélien Gâteau on 2011-08-11

[launcher] Do not block when calling activateHome()

630. By Aurélien Gâteau on 2011-08-11

[dash] Introduce DashClient, extracted from PlaceEntry to monitor the Dash

631. By Aurélien Gâteau on 2011-08-11

[launcher] Use DashClient in PlaceEntry

Aurélien Gâteau (agateau) wrote :

- Fixed dash communication issues by extracting dash code from PlaceEntry into a singleton: DashClient and using it in BfbItem.

- Sent an email to dx and John Lea regarding the icon issue.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2011-08-09 08:05:28 +0000
3+++ .bzrignore 2011-08-11 09:46:13 +0000
4@@ -17,6 +17,8 @@
5 panel/app/unity-2d-panel
6 panel/applets/indicator-config.h
7 panel/applets/registraradaptor.*
8+panel/lib/libuqpanel.so*
9+panel/tests/Testing
10 panel/tests/homebuttonapplettest
11
12 libunity-2d-private/src/libunity-2d-private.so.*
13
14=== modified file 'launcher/Launcher.qml'
15--- launcher/Launcher.qml 2011-08-11 08:03:02 +0000
16+++ launcher/Launcher.qml 2011-08-11 09:46:13 +0000
17@@ -112,6 +112,10 @@
18 filterRegExp: RegExp("^true$")
19 }
20
21+ BfbModel {
22+ id: bfbModel
23+ }
24+
25 LauncherApplicationsList {
26 id: applications
27 }
28@@ -136,6 +140,7 @@
29 }
30
31 Component.onCompleted: {
32+ items.appendModel(bfbModel);
33 items.appendModel(applications);
34 items.appendModel(workspaces);
35 items.appendModel(visiblePlaces);
36
37=== modified file 'libunity-2d-private/Unity2d/plugin.cpp'
38--- libunity-2d-private/Unity2d/plugin.cpp 2011-07-27 11:59:05 +0000
39+++ libunity-2d-private/Unity2d/plugin.cpp 2011-08-11 09:46:13 +0000
40@@ -56,6 +56,7 @@
41 #include "autohidebehavior.h"
42 #include "intellihidebehavior.h"
43 #include "forcevisiblebehavior.h"
44+#include "bfb.h"
45
46 #include <QtDeclarative/qdeclarative.h>
47 #include <QDeclarativeEngine>
48@@ -101,6 +102,9 @@
49
50 qmlRegisterType<ListAggregatorModel>(uri, 0, 1, "ListAggregatorModel");
51
52+ qmlRegisterType<BfbModel>(uri, 0, 1, "BfbModel");
53+ qmlRegisterType<BfbItem>(uri, 0, 1, "BfbItem");
54+
55 qmlRegisterType<LauncherApplicationsList>(uri, 0, 1, "LauncherApplicationsList");
56 qmlRegisterType<LauncherApplication>(uri, 0, 1, "LauncherApplication");
57
58
59=== modified file 'libunity-2d-private/src/CMakeLists.txt'
60--- libunity-2d-private/src/CMakeLists.txt 2011-08-08 11:02:59 +0000
61+++ libunity-2d-private/src/CMakeLists.txt 2011-08-11 09:46:13 +0000
62@@ -2,6 +2,8 @@
63
64 # Sources
65 set(lib${LIB_NAME}_SRCS
66+ bfb.cpp
67+ dashclient.cpp
68 debug.cpp
69 gconnector.cpp
70 gimageutils.cpp
71
72=== added file 'libunity-2d-private/src/bfb.cpp'
73--- libunity-2d-private/src/bfb.cpp 1970-01-01 00:00:00 +0000
74+++ libunity-2d-private/src/bfb.cpp 2011-08-11 09:46:13 +0000
75@@ -0,0 +1,119 @@
76+/*
77+ * Copyright (C) 2011 Canonical, Ltd.
78+ *
79+ * Authors:
80+ * Aurélien Gâteau <aurelien.gateau@canonical.com>
81+ *
82+ * This program is free software; you can redistribute it and/or modify
83+ * it under the terms of the GNU General Public License as published by
84+ * the Free Software Foundation; version 3.
85+ *
86+ * This program is distributed in the hope that it will be useful,
87+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
88+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
89+ * GNU General Public License for more details.
90+ *
91+ * You should have received a copy of the GNU General Public License
92+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
93+ */
94+
95+#include "bfb.h"
96+
97+// libunity-2d
98+#include <dashclient.h>
99+#include <debug_p.h>
100+#include <unity2dtr.h>
101+
102+// Qt
103+
104+BfbItem::BfbItem()
105+: m_active(false)
106+{
107+ connect(DashClient::instance(), SIGNAL(activePageChanged(const QString&)),
108+ SLOT(slotActivePageChanged(const QString&)));
109+}
110+
111+BfbItem::~BfbItem()
112+{
113+}
114+
115+bool BfbItem::active() const
116+{
117+ return m_active;
118+}
119+
120+void BfbItem::slotActivePageChanged(const QString& page)
121+{
122+ bool active = page == "home";
123+ if (m_active != active) {
124+ m_active = active;
125+ activeChanged(m_active);
126+ }
127+}
128+
129+bool BfbItem::running() const
130+{
131+ return false;
132+}
133+
134+int BfbItem::windowCount() const
135+{
136+ return 0;
137+}
138+
139+bool BfbItem::urgent() const
140+{
141+ return false;
142+}
143+
144+QString BfbItem::name() const
145+{
146+ return u2dTr("Dash");
147+}
148+
149+QString BfbItem::icon() const
150+{
151+ return "unity-icon-theme/distributor-logo";
152+}
153+
154+bool BfbItem::launching() const
155+{
156+ return false;
157+}
158+
159+void BfbItem::activate()
160+{
161+ DashClient::instance()->setActivePage(m_active ? "" : "home");
162+}
163+
164+void BfbItem::createMenuActions()
165+{
166+}
167+
168+////////////////////////////////////////////////////////////
169+BfbModel::BfbModel(QObject* parent)
170+: QAbstractListModel(parent)
171+, m_bfbItem(new BfbItem)
172+{
173+}
174+
175+BfbModel::~BfbModel()
176+{
177+ delete m_bfbItem;
178+}
179+
180+int BfbModel::rowCount(const QModelIndex& /*parent*/) const
181+{
182+ return 1;
183+}
184+
185+QVariant BfbModel::data(const QModelIndex& index, int /*role*/) const
186+{
187+ if (!index.isValid()) {
188+ return QVariant();
189+ }
190+
191+ return QVariant::fromValue(m_bfbItem);
192+}
193+
194+#include <bfb.moc>
195
196=== added file 'libunity-2d-private/src/bfb.h'
197--- libunity-2d-private/src/bfb.h 1970-01-01 00:00:00 +0000
198+++ libunity-2d-private/src/bfb.h 2011-08-11 09:46:13 +0000
199@@ -0,0 +1,75 @@
200+/*
201+ * Copyright (C) 2011 Canonical, Ltd.
202+ *
203+ * Authors:
204+ * Aurélien Gâteau <aurelien.gateau@canonical.com>
205+ *
206+ * This program is free software; you can redistribute it and/or modify
207+ * it under the terms of the GNU General Public License as published by
208+ * the Free Software Foundation; version 3.
209+ *
210+ * This program is distributed in the hope that it will be useful,
211+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
212+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
213+ * GNU General Public License for more details.
214+ *
215+ * You should have received a copy of the GNU General Public License
216+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
217+ */
218+
219+#ifndef BFB_H
220+#define BFB_H
221+
222+#include "launcheritem.h"
223+
224+// Qt
225+#include <QAbstractListModel>
226+#include <QMetaType>
227+
228+class BfbItem : public LauncherItem
229+{
230+ Q_OBJECT
231+public:
232+ BfbItem();
233+ ~BfbItem();
234+
235+ /* getters */
236+ virtual bool active() const;
237+ virtual bool running() const;
238+ virtual int windowCount() const;
239+ virtual bool urgent() const;
240+ virtual QString name() const;
241+ virtual QString icon() const;
242+ virtual bool launching() const;
243+
244+ /* methods */
245+ Q_INVOKABLE virtual void activate();
246+ Q_INVOKABLE virtual void createMenuActions();
247+
248+private Q_SLOTS:
249+ void slotActivePageChanged(const QString&);
250+
251+private:
252+ Q_DISABLE_COPY(BfbItem)
253+ bool m_active;
254+};
255+
256+Q_DECLARE_METATYPE(BfbItem*)
257+
258+
259+class BfbModel : public QAbstractListModel
260+{
261+ Q_OBJECT
262+public:
263+ BfbModel(QObject* parent = 0);
264+ ~BfbModel();
265+
266+ QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
267+ int rowCount(const QModelIndex& parent = QModelIndex()) const;
268+
269+private:
270+ Q_DISABLE_COPY(BfbModel)
271+ BfbItem* m_bfbItem;
272+};
273+
274+#endif // BFB_H
275
276=== added file 'libunity-2d-private/src/dashclient.cpp'
277--- libunity-2d-private/src/dashclient.cpp 1970-01-01 00:00:00 +0000
278+++ libunity-2d-private/src/dashclient.cpp 2011-08-11 09:46:13 +0000
279@@ -0,0 +1,155 @@
280+/*
281+ * This file is part of unity-2d
282+ *
283+ * Copyright 2011 Canonical Ltd.
284+ *
285+ * Authors:
286+ * - Aurélien Gâteau <aurelien.gateau@canonical.com>
287+ *
288+ * This program is free software; you can redistribute it and/or modify
289+ * it under the terms of the GNU General Public License as published by
290+ * the Free Software Foundation; version 3.
291+ *
292+ * This program is distributed in the hope that it will be useful,
293+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
294+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
295+ * GNU General Public License for more details.
296+ *
297+ * You should have received a copy of the GNU General Public License
298+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
299+ */
300+// Self
301+#include "dashclient.h"
302+
303+// Local
304+
305+// libunity-2d
306+#include <debug_p.h>
307+
308+// Qt
309+#include <QApplication>
310+#include <QDBusConnection>
311+#include <QDBusConnectionInterface>
312+#include <QDBusInterface>
313+#include <QDBusServiceWatcher>
314+
315+static const char* DASH_DBUS_SERVICE = "com.canonical.Unity2d.Dash";
316+static const char* DASH_DBUS_PATH = "/Dash";
317+static const char* DASH_DBUS_INTERFACE = "com.canonical.Unity2d.Dash";
318+
319+DashClient::DashClient(QObject* parent)
320+: QObject(parent)
321+, m_dashDbusIface(0)
322+, m_dashActive(false)
323+{
324+ /* Check if the dash is already up and running by asking the bus instead of
325+ trying to create an instance of the interface. Creating an instance would
326+ cause D-Bus to activate the dash and we don’t want this to happen, the
327+ dash should be started on demand only. */
328+ QDBusConnectionInterface* sessionBusIFace = QDBusConnection::sessionBus().interface();
329+ QDBusReply<bool> reply = sessionBusIFace->isServiceRegistered(DASH_DBUS_SERVICE);
330+ if (reply.isValid() && reply.value()) {
331+ connectToDash();
332+ } else {
333+ /* The dash is not running: monitor its registration on the bus so we
334+ can connect to it when it comes up. */
335+ QDBusServiceWatcher* watcher = new QDBusServiceWatcher(DASH_DBUS_SERVICE,
336+ QDBusConnection::sessionBus(),
337+ QDBusServiceWatcher::WatchForRegistration,
338+ this);
339+ connect(watcher, SIGNAL(serviceRegistered(QString)), SLOT(connectToDash()));
340+ }
341+}
342+
343+void DashClient::connectToDash()
344+{
345+ if (m_dashDbusIface) {
346+ return;
347+ }
348+
349+ m_dashDbusIface = new QDBusInterface(DASH_DBUS_SERVICE, DASH_DBUS_PATH, DASH_DBUS_INTERFACE,
350+ QDBusConnection::sessionBus(), this);
351+ connect(m_dashDbusIface, SIGNAL(activeChanged(bool)),
352+ SLOT(slotDashActiveChanged(bool)));
353+ connect(m_dashDbusIface, SIGNAL(activePlaceEntryChanged(const QString&)),
354+ SLOT(slotDashActivePlaceEntryChanged(const QString&)));
355+
356+ QVariant value = m_dashDbusIface->property("active");
357+ if (value.isValid()) {
358+ m_dashActive = value.toBool();
359+ } else {
360+ UQ_WARNING << "Fetching Dash.active property failed";
361+ }
362+ value = m_dashDbusIface->property("activePlaceEntry");
363+ if (value.isValid()) {
364+ m_dashActivePlaceEntry = value.toString();
365+ } else {
366+ UQ_WARNING << "Fetching Dash.activePlaceEntry property failed";
367+ }
368+
369+ updateActivePage();
370+}
371+
372+DashClient* DashClient::instance()
373+{
374+ static DashClient* client = new DashClient(qApp);
375+ return client;
376+}
377+
378+void DashClient::slotDashActiveChanged(bool value)
379+{
380+ if (m_dashActive != value) {
381+ m_dashActive = value;
382+ updateActivePage();
383+ }
384+}
385+
386+void DashClient::slotDashActivePlaceEntryChanged(const QString& entry)
387+{
388+ if (m_dashActivePlaceEntry != entry) {
389+ m_dashActivePlaceEntry = entry;
390+ updateActivePage();
391+ }
392+}
393+
394+QString DashClient::activePage() const
395+{
396+ return m_activePage;
397+}
398+
399+void DashClient::setActivePage(const QString& page, const QString& fileName, const QString& groupName, int section)
400+{
401+ if (m_activePage == page) {
402+ return;
403+ }
404+ if (page.isEmpty()) {
405+ // Use m_dashDbusIface to close the dash, but only if it is running
406+ if (m_dashDbusIface) {
407+ m_dashDbusIface->setProperty("active", false);
408+ }
409+ return;
410+ }
411+ // Use a separate QDBusInterface so that the dash is started if it is not
412+ // already running
413+ QDBusInterface iface(DASH_DBUS_SERVICE, DASH_DBUS_PATH, DASH_DBUS_INTERFACE);
414+ if (page == "home") {
415+ iface.asyncCall("activateHome");
416+ } else {
417+ iface.asyncCall("activatePlaceEntry", fileName, groupName, section);
418+ }
419+}
420+
421+void DashClient::updateActivePage()
422+{
423+ QString activePage;
424+ if (m_dashActive) {
425+ activePage = m_dashActivePlaceEntry.isEmpty() ? "home" : m_dashActivePlaceEntry;
426+ }
427+
428+ if (m_activePage != activePage) {
429+ m_activePage = activePage;
430+ activePageChanged(m_activePage);
431+ }
432+}
433+
434+#include "dashclient.moc"
435
436=== added file 'libunity-2d-private/src/dashclient.h'
437--- libunity-2d-private/src/dashclient.h 1970-01-01 00:00:00 +0000
438+++ libunity-2d-private/src/dashclient.h 2011-08-11 09:46:13 +0000
439@@ -0,0 +1,68 @@
440+/*
441+ * This file is part of unity-2d
442+ *
443+ * Copyright 2011 Canonical Ltd.
444+ *
445+ * Authors:
446+ * - Aurélien Gâteau <aurelien.gateau@canonical.com>
447+ *
448+ * This program is free software; you can redistribute it and/or modify
449+ * it under the terms of the GNU General Public License as published by
450+ * the Free Software Foundation; version 3.
451+ *
452+ * This program is distributed in the hope that it will be useful,
453+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
454+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
455+ * GNU General Public License for more details.
456+ *
457+ * You should have received a copy of the GNU General Public License
458+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
459+ */
460+#ifndef DASHCLIENT_H
461+#define DASHCLIENT_H
462+
463+// Local
464+
465+// Qt
466+#include <QObject>
467+
468+class QDBusInterface;
469+
470+/**
471+ * Monitors the dash and provide a single point of entry to its status
472+ */
473+class DashClient : public QObject
474+{
475+ Q_OBJECT
476+public:
477+ static DashClient* instance();
478+
479+ /**
480+ * Returns the active page. This is either:
481+ * - The object path of the active place entry
482+ * - "home" if the home is visible
483+ * - "" if the dash is not visible
484+ */
485+ QString activePage() const;
486+
487+ void setActivePage(const QString& page, const QString& fileName=QString(), const QString& groupName=QString(), int section=0);
488+
489+Q_SIGNALS:
490+ void activePageChanged(const QString&);
491+
492+private Q_SLOTS:
493+ void connectToDash();
494+ void slotDashActiveChanged(bool);
495+ void slotDashActivePlaceEntryChanged(const QString&);
496+
497+private:
498+ DashClient(QObject* parent=0);
499+ void updateActivePage();
500+
501+ QDBusInterface* m_dashDbusIface;
502+ bool m_dashActive;
503+ QString m_dashActivePlaceEntry;
504+ QString m_activePage;
505+};
506+
507+#endif /* DASHCLIENT_H */
508
509=== modified file 'libunity-2d-private/src/placeentry.cpp'
510--- libunity-2d-private/src/placeentry.cpp 2011-08-10 18:56:18 +0000
511+++ libunity-2d-private/src/placeentry.cpp 2011-08-11 09:46:13 +0000
512@@ -22,14 +22,12 @@
513 #include "launchermenu.h"
514
515 // libunity-2d
516+#include <dashclient.h>
517 #include <debug_p.h>
518
519 #include <QDBusMetaType>
520 #include <QAction>
521 #include <QDebug>
522-#include <QDBusServiceWatcher>
523-#include <QDBusConnectionInterface>
524-#include <QDBusReply>
525
526 // Marshall the RendererInfoStruct data into a D-Bus argument
527 QDBusArgument &operator<<(QDBusArgument &argument, const RendererInfoStruct &r)
528@@ -146,10 +144,6 @@
529 static const char* UNITY_PLACE_ENTRY_INTERFACE = "com.canonical.Unity.PlaceEntry";
530 static const char* SECTION_PROPERTY = "section";
531
532-static const char* DASH_DBUS_SERVICE = "com.canonical.Unity2d.Dash";
533-static const char* DASH_DBUS_PATH = "/Dash";
534-static const char* DASH_DBUS_INTERFACE = "com.canonical.Unity2d.Dash";
535-
536 PlaceEntry::PlaceEntry(QObject* parent) :
537 LauncherItem(parent),
538 m_position(0),
539@@ -163,32 +157,15 @@
540 m_entryResultsModel(NULL),
541 m_globalGroupsModel(NULL),
542 m_globalResultsModel(NULL),
543- m_dbusIface(NULL),
544- m_dashDbusIface(NULL),
545- m_dashActive(false)
546+ m_dbusIface(NULL)
547 {
548 qDBusRegisterMetaType<RendererInfoStruct>();
549 qDBusRegisterMetaType<PlaceEntryInfoStruct>();
550 qDBusRegisterMetaType<QList<PlaceEntryInfoStruct> >();
551 qDBusRegisterMetaType<QHash<QString, QString>>();
552
553- /* Check if the dash is already up and running by asking the bus instead of
554- trying to create an instance of the interface. Creating an instance would
555- cause D-Bus to activate the dash and we don’t want this to happen, the
556- dash should be started on demand only. */
557- QDBusConnectionInterface* sessionBusIFace = QDBusConnection::sessionBus().interface();
558- QDBusReply<bool> reply = sessionBusIFace->isServiceRegistered(DASH_DBUS_SERVICE);
559- if (reply.isValid() && reply.value()) {
560- connectToDash();
561- } else {
562- /* The dash is not running: monitor its registration on the bus so we
563- can connect to it when it comes up. */
564- QDBusServiceWatcher* watcher = new QDBusServiceWatcher(DASH_DBUS_SERVICE,
565- QDBusConnection::sessionBus(),
566- QDBusServiceWatcher::WatchForRegistration,
567- this);
568- connect(watcher, SIGNAL(serviceRegistered(QString)), SLOT(connectToDash()));
569- }
570+ connect(DashClient::instance(), SIGNAL(activePageChanged(const QString&)),
571+ SLOT(slotActivePageChanged(const QString&)));
572 }
573
574 PlaceEntry::PlaceEntry(const PlaceEntry& other) :
575@@ -752,59 +729,12 @@
576 Q_EMIT globalRendererHintsChanged();
577 }
578
579-void
580-PlaceEntry::connectToDash()
581-{
582- if (m_dashDbusIface != NULL) {
583- return;
584- }
585-
586- m_dashDbusIface = new QDBusInterface(DASH_DBUS_SERVICE, DASH_DBUS_PATH, DASH_DBUS_INTERFACE,
587- QDBusConnection::sessionBus(), this);
588- connect(m_dashDbusIface, SIGNAL(activeChanged(bool)),
589- SLOT(slotDashActiveChanged(bool)));
590- connect(m_dashDbusIface, SIGNAL(activePlaceEntryChanged(const QString&)),
591- SLOT(slotDashActivePlaceEntryChanged(const QString&)));
592-
593- QVariant value = m_dashDbusIface->property("active");
594- if (value.isValid()) {
595- m_dashActive = value.toBool();
596- } else {
597- UQ_WARNING << "Fetching Dash.active property failed";
598- }
599- value = m_dashDbusIface->property("activePlaceEntry");
600- if (value.isValid()) {
601- m_dashActivePlaceEntry = value.toString();
602- } else {
603- UQ_WARNING << "Fetching Dash.activePlaceEntry property failed";
604- }
605-
606- updateActiveState();
607-}
608-
609-void
610-PlaceEntry::slotDashActiveChanged(bool value)
611-{
612- if (m_dashActive != value) {
613- m_dashActive = value;
614- updateActiveState();
615- }
616-}
617-
618-void
619-PlaceEntry::slotDashActivePlaceEntryChanged(const QString& entry)
620-{
621- if (m_dashActivePlaceEntry != entry) {
622- m_dashActivePlaceEntry = entry;
623- updateActiveState();
624- }
625-}
626-
627-void
628-PlaceEntry::updateActiveState()
629+
630+void
631+PlaceEntry::slotActivePageChanged(const QString& page)
632 {
633 bool active = false;
634- if (m_dashActive && !m_dbusObjectPath.isEmpty() && (m_dashActivePlaceEntry == m_dbusObjectPath)) {
635+ if (!m_dbusObjectPath.isEmpty() && page == m_dbusObjectPath) {
636 active = true;
637 }
638
639@@ -827,8 +757,11 @@
640 startRemotePlaceOnDemand();
641 }
642
643- QDBusInterface iface(DASH_DBUS_SERVICE, DASH_DBUS_PATH, DASH_DBUS_INTERFACE);
644- iface.asyncCall(QLatin1String("activatePlaceEntry"), m_fileName, m_groupName, section);
645+ if (m_active) {
646+ DashClient::instance()->setActivePage(QString());
647+ } else {
648+ DashClient::instance()->setActivePage(m_dbusObjectPath, m_fileName, m_groupName, section);
649+ }
650 }
651
652 void
653
654=== modified file 'libunity-2d-private/src/placeentry.h'
655--- libunity-2d-private/src/placeentry.h 2011-07-29 13:49:34 +0000
656+++ libunity-2d-private/src/placeentry.h 2011-08-11 09:46:13 +0000
657@@ -261,9 +261,6 @@
658 QMap<QString, QVariant> m_globalRendererHints;
659
660 QDBusInterface* m_dbusIface;
661- QDBusInterface* m_dashDbusIface;
662- bool m_dashActive;
663- QString m_dashActivePlaceEntry;
664
665 void setSection(const QString&);
666 void activateEntry(const int section);
667@@ -273,15 +270,12 @@
668 private Q_SLOTS:
669 void onRendererInfoChanged(const RendererInfoStruct&);
670
671- void connectToDash();
672- void updateActiveState();
673- void slotDashActiveChanged(bool);
674- void slotDashActivePlaceEntryChanged(const QString&);
675-
676 void startMonitoringSections();
677 void stopMonitoringSections();
678 void slotSectionsChanged();
679
680+ void slotActivePageChanged(const QString& page);
681+
682 /* Contextual menu callbacks */
683 void onSectionTriggered();
684 };
685
686=== modified file 'panel/app/panelmanager.cpp'
687--- panel/app/panelmanager.cpp 2011-07-27 19:25:45 +0000
688+++ panel/app/panelmanager.cpp 2011-08-11 09:46:13 +0000
689@@ -30,7 +30,6 @@
690 // Applets
691 #include <appindicator/appindicatorapplet.h>
692 #include <appname/appnameapplet.h>
693-#include <homebutton/homebuttonapplet.h>
694 #include <indicator/indicatorapplet.h>
695 #include <legacytray/legacytrayapplet.h>
696
697@@ -44,14 +43,6 @@
698
699 using namespace Unity2d;
700
701-static QWidget* createSeparator()
702-{
703- // Just a quick-hack: homebutton is going away anyway
704- QWidget* widget = new QWidget;
705- widget->setFixedWidth(6);
706- return widget;
707-}
708-
709 PanelManager::PanelManager(QObject* parent)
710 : QObject(parent)
711 {
712@@ -79,13 +70,9 @@
713
714 IndicatorsManager* indicatorsManager = new IndicatorsManager(panel);
715
716+ panel->addWidget(new AppNameApplet(indicatorsManager));
717 int leftmost = QApplication::desktop()->screenNumber(QPoint());
718 if (screen == leftmost) {
719- panel->addWidget(new HomeButtonApplet);
720- panel->addWidget(createSeparator());
721- }
722- panel->addWidget(new AppNameApplet(indicatorsManager));
723- if (screen == leftmost) {
724 /* It doesn’t make sense to have more than one instance of the systray,
725 XEmbed’ed windows can be displayed only once anyway. */
726 panel->addWidget(new LegacyTrayApplet);
727
728=== modified file 'panel/applets/CMakeLists.txt'
729--- panel/applets/CMakeLists.txt 2011-07-28 09:45:37 +0000
730+++ panel/applets/CMakeLists.txt 2011-08-11 09:46:13 +0000
731@@ -20,8 +20,6 @@
732 common/indicatorwidget.cpp
733 common/cairoutils.cpp
734 common/panelstyle.cpp
735- homebutton/homebuttonapplet.cpp
736- homebutton/homebutton.cpp
737 indicator/indicatorapplet.cpp
738 legacytray/legacytrayapplet.cpp
739 legacytray/fdoselectionmanager.cpp
740@@ -38,7 +36,6 @@
741 ${CMAKE_CURRENT_SOURCE_DIR}/appindicator
742 ${CMAKE_CURRENT_SOURCE_DIR}/appname
743 ${CMAKE_CURRENT_SOURCE_DIR}/common
744- ${CMAKE_CURRENT_SOURCE_DIR}/homebutton
745 ${CMAKE_CURRENT_SOURCE_DIR}/indicator
746 ${CMAKE_CURRENT_SOURCE_DIR}/unitycore
747 ${QTBAMF_INCLUDE_DIRS}
748
749=== modified file 'panel/applets/appname/appnameapplet.cpp'
750--- panel/applets/appname/appnameapplet.cpp 2011-07-27 15:34:57 +0000
751+++ panel/applets/appname/appnameapplet.cpp 2011-08-11 09:46:13 +0000
752@@ -31,6 +31,7 @@
753 // Unity-2d
754 #include <debug_p.h>
755 #include <keyboardmodifiersmonitor.h>
756+#include <launcherclient.h>
757
758 // Bamf
759 #include <bamf-application.h>
760@@ -47,8 +48,6 @@
761 #include <QApplication>
762 #include <QDesktopWidget>
763
764-static const int WINDOW_BUTTONS_RIGHT_MARGIN = 4;
765-
766 static const int APPNAME_LABEL_LEFT_MARGIN = 6;
767
768 namespace Unity2d
769@@ -62,7 +61,11 @@
770 , m_buttonType(buttonType)
771 {
772 loadPixmaps();
773- setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
774+ if (buttonType == PanelStyle::MinimizeWindowButton) {
775+ setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
776+ } else {
777+ setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
778+ }
779 setAttribute(Qt::WA_Hover);
780 }
781
782@@ -91,7 +94,13 @@
783 } else {
784 pix = m_normalPix;
785 }
786- painter.drawPixmap((width() - pix.width()) / 2, (height() - pix.height()) / 2, pix);
787+ int posX;
788+ if (m_buttonType == PanelStyle::CloseWindowButton) {
789+ posX = width() - pix.width();
790+ } else {
791+ posX = 0;
792+ }
793+ painter.drawPixmap(posX, (height() - pix.height()) / 2, pix);
794 }
795
796 private:
797@@ -137,7 +146,7 @@
798 m_windowButtonWidget = new QWidget;
799 m_windowButtonWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
800 QHBoxLayout* layout = new QHBoxLayout(m_windowButtonWidget);
801- layout->setContentsMargins(0, 0, WINDOW_BUTTONS_RIGHT_MARGIN, 0);
802+ layout->setMargin(0);
803 layout->setSpacing(0);
804 m_closeButton = new WindowButton(PanelStyle::CloseWindowButton);
805 m_minimizeButton = new WindowButton(PanelStyle::MinimizeWindowButton);
806@@ -145,6 +154,7 @@
807 layout->addWidget(m_closeButton);
808 layout->addWidget(m_minimizeButton);
809 layout->addWidget(m_maximizeButton);
810+ m_windowButtonWidget->setFixedWidth(LauncherClient::MaximumWidth);
811 QObject::connect(m_closeButton, SIGNAL(clicked()), m_windowHelper, SLOT(close()));
812 QObject::connect(m_minimizeButton, SIGNAL(clicked()), m_windowHelper, SLOT(minimize()));
813 QObject::connect(m_maximizeButton, SIGNAL(clicked()), m_windowHelper, SLOT(unmaximize()));
814@@ -190,7 +200,7 @@
815 QHBoxLayout* layout = new QHBoxLayout(this);
816 layout->setMargin(0);
817 layout->setSpacing(0);
818- layout->addWidget(d->m_windowButtonWidget, 0, Qt::AlignLeft);
819+ layout->addWidget(d->m_windowButtonWidget);
820 layout->addWidget(d->m_label);
821 layout->addWidget(d->m_menuBarWidget);
822
823@@ -209,14 +219,15 @@
824 bool isMaximized = d->m_windowHelper->isMaximized();
825 bool isUserVisibleApp = app ? app->user_visible() : false;
826 bool isOnSameScreen = d->m_windowHelper->isMostlyOnScreen(QApplication::desktop()->screenNumber(this));
827+ bool isUnderMouse = rect().contains(mapFromGlobal(QCursor::pos()));
828 bool showMenu = (!d->m_menuBarWidget->isEmpty() && isUserVisibleApp && isOnSameScreen)
829- && (rect().contains(mapFromGlobal(QCursor::pos()))
830+ && (isUnderMouse
831 || KeyboardModifiersMonitor::instance()->keyboardModifiers() == Qt::AltModifier
832 || d->m_menuBarWidget->isOpened()
833 );
834 bool showLabel = !(isMaximized && showMenu) && isUserVisibleApp && isOnSameScreen;
835
836- d->m_windowButtonWidget->setVisible(isOnSameScreen && isMaximized);
837+ d->m_windowButtonWidget->setVisible(isOnSameScreen && isMaximized && isUnderMouse);
838
839 d->m_label->setVisible(showLabel);
840 if (showLabel) {
841@@ -238,7 +249,7 @@
842
843 // Define width
844 if (!isMaximized && showMenu) {
845- d->m_label->setMaximumWidth(d->m_windowButtonWidget->sizeHint().width());
846+ d->m_label->setMaximumWidth(LauncherClient::MaximumWidth);
847 } else {
848 d->m_label->setMaximumWidth(QWIDGETSIZE_MAX);
849 }
850
851=== removed directory 'panel/applets/homebutton'
852=== removed file 'panel/applets/homebutton/homebutton.cpp'
853--- panel/applets/homebutton/homebutton.cpp 2011-07-27 14:19:07 +0000
854+++ panel/applets/homebutton/homebutton.cpp 1970-01-01 00:00:00 +0000
855@@ -1,63 +0,0 @@
856-/*
857- * This file is part of unity-2d
858- *
859- * Copyright 2011 Canonical Ltd.
860- *
861- * Authors:
862- * - Alberto Mardegan <mardy@users.sourceforge.net>
863- *
864- * This program is free software; you can redistribute it and/or modify
865- * it under the terms of the GNU General Public License as published by
866- * the Free Software Foundation; version 3.
867- *
868- * This program is distributed in the hope that it will be useful,
869- * but WITHOUT ANY WARRANTY; without even the implied warranty of
870- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
871- * GNU General Public License for more details.
872- *
873- * You should have received a copy of the GNU General Public License
874- * along with this program. If not, see <http://www.gnu.org/licenses/>.
875- */
876-
877-// Self
878-#include "homebutton.h"
879-
880-// Local
881-#include <debug_p.h>
882-
883-// Qt
884-#include <QApplication>
885-
886-HomeButton::HomeButton(QWidget *parent)
887-: QToolButton(parent)
888-{
889- setAutoRaise(true);
890- setIconSize(QSize(24, 24));
891- QString themeIconName = QIcon::hasThemeIcon("start-here") ? "start-here" : "distributor-logo";
892- setIcon(QIcon::fromTheme(themeIconName));
893- setCheckable(true);
894-
895- setStyleSheet(
896- "QToolButton { border: none; margin: 0; padding: 0; width: 61 }"
897- "QToolButton:checked, QToolButton:pressed {"
898- " padding-top: 1px;"
899- " padding-left: 1px;"
900- " padding-right: -1px;"
901- " padding-bottom: -1px;"
902- "}"
903- );
904-}
905-
906-void HomeButton::mousePressEvent(QMouseEvent *event)
907-{
908- if (lastClickTime.isValid() &&
909- lastClickTime.elapsed() < QApplication::doubleClickInterval()) {
910- /* ignore this click */
911- return;
912- }
913-
914- QToolButton::mousePressEvent(event);
915- lastClickTime.restart();
916-}
917-
918-#include "homebutton.moc"
919
920=== removed file 'panel/applets/homebutton/homebutton.h'
921--- panel/applets/homebutton/homebutton.h 2011-05-26 16:41:04 +0000
922+++ panel/applets/homebutton/homebutton.h 1970-01-01 00:00:00 +0000
923@@ -1,43 +0,0 @@
924-/*
925- * This file is part of unity-2d
926- *
927- * Copyright 2011 Canonical Ltd.
928- *
929- * Authors:
930- * - Alberto Mardegan <mardy@users.sourceforge.net>
931- *
932- * This program is free software; you can redistribute it and/or modify
933- * it under the terms of the GNU General Public License as published by
934- * the Free Software Foundation; version 3.
935- *
936- * This program is distributed in the hope that it will be useful,
937- * but WITHOUT ANY WARRANTY; without even the implied warranty of
938- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
939- * GNU General Public License for more details.
940- *
941- * You should have received a copy of the GNU General Public License
942- * along with this program. If not, see <http://www.gnu.org/licenses/>.
943- */
944-
945-#ifndef HOMEBUTTON_H
946-#define HOMEBUTTON_H
947-
948-// Qt
949-#include <QTime>
950-#include <QToolButton>
951-
952-class HomeButton : public QToolButton
953-{
954-Q_OBJECT
955-public:
956- HomeButton(QWidget *parent = 0);
957-
958-protected:
959- void mousePressEvent(QMouseEvent*);
960-
961-private:
962- Q_DISABLE_COPY(HomeButton)
963- QTime lastClickTime;
964-};
965-
966-#endif /* HOMEBUTTON_H */
967
968=== removed file 'panel/applets/homebutton/homebuttonapplet.cpp'
969--- panel/applets/homebutton/homebuttonapplet.cpp 2011-05-26 16:41:04 +0000
970+++ panel/applets/homebutton/homebuttonapplet.cpp 1970-01-01 00:00:00 +0000
971@@ -1,111 +0,0 @@
972-/*
973- * This file is part of unity-2d
974- *
975- * Copyright 2010 Canonical Ltd.
976- *
977- * Authors:
978- * - Aurélien Gâteau <aurelien.gateau@canonical.com>
979- *
980- * This program is free software; you can redistribute it and/or modify
981- * it under the terms of the GNU General Public License as published by
982- * the Free Software Foundation; version 3.
983- *
984- * This program is distributed in the hope that it will be useful,
985- * but WITHOUT ANY WARRANTY; without even the implied warranty of
986- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
987- * GNU General Public License for more details.
988- *
989- * You should have received a copy of the GNU General Public License
990- * along with this program. If not, see <http://www.gnu.org/licenses/>.
991- */
992-
993-// Self
994-#include "homebuttonapplet.h"
995-
996-// Local
997-#include <debug_p.h>
998-
999-// libunity-2d
1000-#include <launcherclient.h>
1001-
1002-// Qt
1003-#include <QHBoxLayout>
1004-#include <QDBusInterface>
1005-#include <QDBusServiceWatcher>
1006-#include <QDBusConnectionInterface>
1007-
1008-static const char* DBUS_SERVICE = "com.canonical.Unity2d.Dash";
1009-static const char* DBUS_PATH = "/Dash";
1010-static const char* DBUS_IFACE = "com.canonical.Unity2d.Dash";
1011-
1012-HomeButtonApplet::HomeButtonApplet()
1013-: m_button(new HomeButton)
1014-, m_dashInterface(NULL)
1015-, m_launcherClient(new LauncherClient(this))
1016-{
1017- connect(m_button, SIGNAL(clicked()), SLOT(toggleDash()));
1018-
1019- QHBoxLayout* layout = new QHBoxLayout(this);
1020- layout->setMargin(0);
1021- layout->addWidget(m_button);
1022-
1023- /* Check if the dash is already up and running by asking the bus instead of
1024- trying to create an instance of the interface. Creating an instance
1025- will cause DBUS to activate the dash and we don't want this to happen, especially
1026- during startup where the dash is started with a delay. */
1027- QDBusConnectionInterface* sessionBusIFace = QDBusConnection::sessionBus().interface();
1028- QDBusReply<bool> reply = sessionBusIFace->isServiceRegistered(DBUS_SERVICE);
1029- if (reply.isValid() && reply.value() == true) {
1030- connectToDash();
1031- } else {
1032- /* If the dash is not running, setup a notification so that we can
1033- connect to it later when it comes up */
1034- QDBusServiceWatcher* serviceWatcher = new QDBusServiceWatcher(DBUS_SERVICE, QDBusConnection::sessionBus(),
1035- QDBusServiceWatcher::WatchForRegistration, this);
1036- connect(serviceWatcher, SIGNAL(serviceRegistered(QString)), SLOT(connectToDash()));
1037- }
1038-}
1039-
1040-void HomeButtonApplet::connectToDash()
1041-{
1042- if (m_dashInterface != NULL) {
1043- return;
1044- }
1045-
1046- m_dashInterface = new QDBusInterface(DBUS_SERVICE, DBUS_PATH, DBUS_IFACE,
1047- QDBusConnection::sessionBus(), this);
1048- m_button->connect(m_dashInterface, SIGNAL(activeChanged(bool)), SLOT(setChecked(bool)));
1049-
1050- /* Immediately update the home button with the current state of the dash */
1051- m_button->setChecked(m_dashInterface->property("active").toBool());
1052-}
1053-
1054-void HomeButtonApplet::toggleDash()
1055-{
1056- if (m_dashInterface == NULL || !m_dashInterface->isValid()) {
1057- connectToDash();
1058- }
1059-
1060- bool dashActive = m_dashInterface->property("active").toBool();
1061-
1062- if (dashActive) {
1063- m_dashInterface->setProperty("active", false);
1064- } else {
1065- /* Call com.canonical.Unity2d.Dash.activateHome (will set com.canonical.Unity2d.Dash.active to true */
1066- m_dashInterface->call(QDBus::Block, "activateHome");
1067- }
1068-}
1069-
1070-void HomeButtonApplet::enterEvent(QEvent* event)
1071-{
1072- Unity2d::Applet::enterEvent(event);
1073- m_launcherClient->beginForceVisible();
1074-}
1075-
1076-void HomeButtonApplet::leaveEvent(QEvent* event)
1077-{
1078- Unity2d::Applet::leaveEvent(event);
1079- m_launcherClient->endForceVisible();
1080-}
1081-
1082-#include "homebuttonapplet.moc"
1083
1084=== removed file 'panel/applets/homebutton/homebuttonapplet.h'
1085--- panel/applets/homebutton/homebuttonapplet.h 2011-05-26 16:41:04 +0000
1086+++ panel/applets/homebutton/homebuttonapplet.h 1970-01-01 00:00:00 +0000
1087@@ -1,53 +0,0 @@
1088-/*
1089- * This file is part of unity-2d
1090- *
1091- * Copyright 2010 Canonical Ltd.
1092- *
1093- * Authors:
1094- * - Aurélien Gâteau <aurelien.gateau@canonical.com>
1095- *
1096- * This program is free software; you can redistribute it and/or modify
1097- * it under the terms of the GNU General Public License as published by
1098- * the Free Software Foundation; version 3.
1099- *
1100- * This program is distributed in the hope that it will be useful,
1101- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1102- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1103- * GNU General Public License for more details.
1104- *
1105- * You should have received a copy of the GNU General Public License
1106- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1107- */
1108-
1109-#ifndef HOMEBUTTONAPPLET_H
1110-#define HOMEBUTTONAPPLET_H
1111-
1112-// Local
1113-#include <applet.h>
1114-#include "homebutton.h"
1115-
1116-class QDBusInterface;
1117-class LauncherClient;
1118-
1119-class HomeButtonApplet : public Unity2d::Applet
1120-{
1121-Q_OBJECT
1122-public:
1123- HomeButtonApplet();
1124-
1125-protected:
1126- void enterEvent(QEvent*);
1127- void leaveEvent(QEvent*);
1128-
1129-private Q_SLOTS:
1130- void toggleDash();
1131- void connectToDash();
1132-
1133-private:
1134- Q_DISABLE_COPY(HomeButtonApplet)
1135- HomeButton* m_button;
1136- QDBusInterface* m_dashInterface;
1137- LauncherClient* m_launcherClient;
1138-};
1139-
1140-#endif /* HOMEBUTTONAPPLET_H */
1141
1142=== modified file 'panel/tests/CMakeLists.txt'
1143--- panel/tests/CMakeLists.txt 2011-01-27 16:23:33 +0000
1144+++ panel/tests/CMakeLists.txt 2011-08-11 09:46:13 +0000
1145@@ -17,7 +17,6 @@
1146 endmacro(panel_tests)
1147
1148 include_directories(
1149- ${uqapplets_SOURCE_DIR}/homebutton
1150 ${uqapplets_SOURCE_DIR}/common
1151 ${CMAKE_CURRENT_BINARY_DIR}
1152 ${QT_QTTEST_INCLUDE_DIR}
1153@@ -25,6 +24,5 @@
1154
1155 enable_testing()
1156
1157-panel_tests(
1158- homebuttonapplettest
1159- )
1160+#panel_tests(
1161+# )
1162
1163=== removed file 'panel/tests/homebuttonapplettest.cpp'
1164--- panel/tests/homebuttonapplettest.cpp 2011-01-15 01:41:03 +0000
1165+++ panel/tests/homebuttonapplettest.cpp 1970-01-01 00:00:00 +0000
1166@@ -1,42 +0,0 @@
1167-/*
1168- * This file is part of unity-2d
1169- *
1170- * Copyright 2010 Canonical Ltd.
1171- *
1172- * Authors:
1173- * - Aurélien Gâteau <aurelien.gateau@canonical.com>
1174- *
1175- * This program is free software; you can redistribute it and/or modify
1176- * it under the terms of the GNU General Public License as published by
1177- * the Free Software Foundation; version 3.
1178- *
1179- * This program is distributed in the hope that it will be useful,
1180- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1181- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1182- * GNU General Public License for more details.
1183- *
1184- * You should have received a copy of the GNU General Public License
1185- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1186- */
1187-
1188-// Local
1189-#include <homebuttonapplet.h>
1190-
1191-// Qt
1192-#include <QtTestGui>
1193-
1194-using namespace Unity2d;
1195-
1196-class HomeButtonAppletTest : public QObject
1197-{
1198- Q_OBJECT
1199-private Q_SLOTS:
1200- void testCreateButton()
1201- {
1202- HomeButtonApplet applet;
1203- }
1204-};
1205-
1206-QTEST_MAIN(HomeButtonAppletTest)
1207-
1208-#include "homebuttonapplettest.moc"

Subscribers

People subscribed via source and target branches