Merge lp:~fboucault/unity-2d/dconf_migration_super_key into lp:unity-2d/3.0

Proposed by Florian Boucault
Status: Merged
Approved by: Didier Roche-Tolomelli
Approved revision: 634
Merged at revision: 634
Proposed branch: lp:~fboucault/unity-2d/dconf_migration_super_key
Merge into: lp:unity-2d/3.0
Diff against target: 304 lines (+78/-20)
13 files modified
.bzrignore (+1/-0)
CMakeLists.txt (+26/-0)
data/com.canonical.Unity2d.gschema.xml (+9/-0)
data/unity-2d.convert (+2/-0)
debian/20_unity-2d-gconf-default (+0/-1)
debian/changelog (+10/-1)
debian/control (+1/-0)
debian/gconf/schemas/unity-2d.schemas (+0/-12)
debian/unity-2d.install (+2/-0)
launcher/app/CMakeLists.txt (+3/-0)
launcher/app/launcherview.cpp (+12/-3)
launcher/app/launcherview.h (+4/-3)
libunity-2d-private/src/unity2dapplication.cpp (+8/-0)
To merge this branch: bzr merge lp:~fboucault/unity-2d/dconf_migration_super_key
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+67971@code.launchpad.net

Description of the change

[launcher] Migrated GConf key /desktop/unity-2d/launcher/super_key_enable to dconf

Added a GSettings schemas file and a GConf-to-GSettings conversion file.

Packaging changes:
* debian/unity-2d.install:
  - install GSettings schemas into usr/share/glib-2.0/schemas
  - install GConf to GSettings conversion into usr/share/GConf/gsettings
* debian/gconf/schemas/unity-2d.schemas:
  - remove GConf schema for /desktop/unity-2d/launcher/super_key_enable
* debian/control:
  - add dependency on libdconf-qt-dev

To post a comment you must log in.
632. By Florian Boucault

* debian/20_unity-2d-gconf-default:
  - remove default value for /desktop/unity-2d/launcher/super_key_enable

633. By Florian Boucault

Merged lp:unity-2d

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

compile and works well.

However, we try now to enforce sane dconf values, and not only for desrt ;)
so, can you please use as a gsettings path some /com/canonical/ one? instead of /desktop/unity-2d (it should match the id com.canonical.* for non relocatable schemas)

Maybe a stupid question, but shouldn't updateSuperKeyMonitoring() SLOT take the bool parameter rather than asking dconf again about which value for this property?

Apart from that, all looks good, it works and changing the value in dconf-editor has indeed some effect. Nice work :)

review: Needs Fixing
Revision history for this message
Florian Boucault (fboucault) wrote :

> compile and works well.
>
> However, we try now to enforce sane dconf values, and not only for desrt ;)
> so, can you please use as a gsettings path some /com/canonical/ one? instead
> of /desktop/unity-2d (it should match the id com.canonical.* for non
> relocatable schemas)
>

I was not sure so I followed what Unity was doing. Should I definitely do what you suggest?

>
> Maybe a stupid question, but shouldn't updateSuperKeyMonitoring() SLOT take
> the bool parameter rather than asking dconf again about which value for this
> property?
>

Not a stupid question. I wanted the change to be minimal and strictly about migrating to dconf so I kept it as is.

> Apart from that, all looks good, it works and changing the value in dconf-
> editor has indeed some effect. Nice work :)

Thanks for the testing!

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

> > compile and works well.
> >
> > However, we try now to enforce sane dconf values, and not only for desrt ;)
> > so, can you please use as a gsettings path some /com/canonical/ one? instead
> > of /desktop/unity-2d (it should match the id com.canonical.* for non
> > relocatable schemas)
> >
>
> I was not sure so I followed what Unity was doing. Should I definitely do what
> you suggest?
Yeah, Unity will change that in the coming release

>
> >
> > Maybe a stupid question, but shouldn't updateSuperKeyMonitoring() SLOT take
> > the bool parameter rather than asking dconf again about which value for this
> > property?
> >
>
> Not a stupid question. I wanted the change to be minimal and strictly about
> migrating to dconf so I kept it as is.

Ok, nice enhancement target for the future then?
>
> > Apart from that, all looks good, it works and changing the value in dconf-
> > editor has indeed some effect. Nice work :)
>
> Thanks for the testing!

So, approved with once the change #1 is done :)

review: Approve
Revision history for this message
Florian Boucault (fboucault) wrote :

> > > compile and works well.
> > >
> > > However, we try now to enforce sane dconf values, and not only for desrt
> ;)
> > > so, can you please use as a gsettings path some /com/canonical/ one?
> instead
> > > of /desktop/unity-2d (it should match the id com.canonical.* for non
> > > relocatable schemas)
> > >
> >
> > I was not sure so I followed what Unity was doing. Should I definitely do
> what
> > you suggest?
> Yeah, Unity will change that in the coming release
>

Done.

> >
> > >
> > > Maybe a stupid question, but shouldn't updateSuperKeyMonitoring() SLOT
> take
> > > the bool parameter rather than asking dconf again about which value for
> this
> > > property?
> > >
> >
> > Not a stupid question. I wanted the change to be minimal and strictly about
> > migrating to dconf so I kept it as is.
>
> Ok, nice enhancement target for the future then?

Yes

> >
> > > Apart from that, all looks good, it works and changing the value in dconf-
> > > editor has indeed some effect. Nice work :)
> >
> > Thanks for the testing!
>
> So, approved with once the change #1 is done :)

634. By Florian Boucault

Changed schema path to match com.canonical.*

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2011-06-15 14:39:35 +0000
+++ .bzrignore 2011-07-22 16:53:25 +0000
@@ -78,3 +78,4 @@
78debian/unity-qt-spread78debian/unity-qt-spread
79debian/libuqpanel-dev79debian/libuqpanel-dev
80debian/libuqpanel080debian/libuqpanel0
81data/gschemas.compiled
8182
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2011-06-27 13:40:51 +0000
+++ CMakeLists.txt 2011-07-22 16:53:25 +0000
@@ -4,6 +4,7 @@
4# Dirs4# Dirs
5set(UNITY_2D_DIR share/unity-2d)5set(UNITY_2D_DIR share/unity-2d)
6set(UNITY_DIR /usr/share/unity/)6set(UNITY_DIR /usr/share/unity/)
7set(UNITY_2D_DATA_DIR "${CMAKE_SOURCE_DIR}/data")
78
8configure_file(config.h.in config.h)9configure_file(config.h.in config.h)
910
@@ -24,6 +25,31 @@
24find_package(X11 REQUIRED)25find_package(X11 REQUIRED)
25find_package(Gettext REQUIRED)26find_package(Gettext REQUIRED)
2627
28
29# GSettings schemas
30pkg_check_modules(GLIB REQUIRED glib-2.0)
31set (UNITY_2D_SCHEMAS "com.canonical.Unity2d.gschema.xml")
32set (UNITY_2D_GCONF_CONVERT "unity-2d.convert")
33set (GSETTINGS_DIR "${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas/")
34set (GCONF_CONVERT_DIR "${CMAKE_INSTALL_PREFIX}/share/GConf/gsettings")
35execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas OUTPUT_VARIABLE GLIB_COMPILE_SCHEMAS OUTPUT_STRIP_TRAILING_WHITESPACE)
36
37# Run the schemas validator and error if it fails
38execute_process (COMMAND ${GLIB_COMPILE_SCHEMAS} ${UNITY_2D_DATA_DIR} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE)
39
40if (_schemas_invalid)
41 message (SEND_ERROR "Schemas validation error: ${_schemas_invalid}")
42endif (_schemas_invalid)
43
44# Actually install and recompile the schemas
45message (STATUS "GSettings schemas will be installed into ${GSETTINGS_DIR}")
46install (FILES ${UNITY_2D_DATA_DIR}/${UNITY_2D_SCHEMAS} DESTINATION ${GSETTINGS_DIR})
47install (CODE "message (STATUS \"Compiling GSettings schemas\")")
48install (CODE "execute_process (COMMAND ${GLIB_COMPILE_SCHEMAS} ${GSETTINGS_DIR})")
49
50# Install GConf to GSettings conversion file
51install (FILES ${UNITY_2D_DATA_DIR}/${UNITY_2D_GCONF_CONVERT} DESTINATION ${GCONF_CONVERT_DIR})
52
27include_directories(53include_directories(
28 ${CMAKE_BINARY_DIR}54 ${CMAKE_BINARY_DIR}
29 ${QT_INCLUDE_DIR}55 ${QT_INCLUDE_DIR}
3056
=== added directory 'data'
=== added file 'data/com.canonical.Unity2d.gschema.xml'
--- data/com.canonical.Unity2d.gschema.xml 1970-01-01 00:00:00 +0000
+++ data/com.canonical.Unity2d.gschema.xml 2011-07-22 16:53:25 +0000
@@ -0,0 +1,9 @@
1<schemalist>
2 <schema path="/com/canonical/unity-2d/launcher/" id="com.canonical.Unity2d.Launcher" gettext-domain="unity-2d">
3 <key type="b" name="super-key-enable">
4 <default>true</default>
5 <summary>Super key activation.</summary>
6 <description>Whether or not the super (also called windows key) key is used.</description>
7 </key>
8 </schema>
9</schemalist>
010
=== added file 'data/unity-2d.convert'
--- data/unity-2d.convert 1970-01-01 00:00:00 +0000
+++ data/unity-2d.convert 2011-07-22 16:53:25 +0000
@@ -0,0 +1,2 @@
1[com.canonical.Unity2d.Launcher]
2super-key-enable = /desktop/unity-2d/launcher/super_key_enable
03
=== modified file 'debian/20_unity-2d-gconf-default'
--- debian/20_unity-2d-gconf-default 2011-06-15 13:05:38 +0000
+++ debian/20_unity-2d-gconf-default 2011-07-22 16:53:25 +0000
@@ -3,7 +3,6 @@
3/desktop/unity-2d/launcher/favorites [ubiquity-gtkui.desktop,nautilus-home.desktop,firefox.desktop,libreoffice-writer.desktop,libreoffice-calc.desktop,libreoffice-impress.desktop,ubuntu-software-center.desktop,ubuntuone-control-panel-gtk.desktop]3/desktop/unity-2d/launcher/favorites [ubiquity-gtkui.desktop,nautilus-home.desktop,firefox.desktop,libreoffice-writer.desktop,libreoffice-calc.desktop,libreoffice-impress.desktop,ubuntu-software-center.desktop,ubuntuone-control-panel-gtk.desktop]
4/desktop/unity-2d/launcher/hide_mode 24/desktop/unity-2d/launcher/hide_mode 2
5/desktop/unity-2d/launcher/use_strut false5/desktop/unity-2d/launcher/use_strut false
6/desktop/unity-2d/launcher/super_key_enable true
7/desktop/gnome/applications/window_manager/default /usr/bin/metacity6/desktop/gnome/applications/window_manager/default /usr/bin/metacity
8/desktop/gnome/applications/window_manager/current /usr/bin/metacity7/desktop/gnome/applications/window_manager/current /usr/bin/metacity
9/apps/metacity/general/show_maximized_titlebars false8/apps/metacity/general/show_maximized_titlebars false
109
=== modified file 'debian/changelog'
--- debian/changelog 2011-07-19 07:02:13 +0000
+++ debian/changelog 2011-07-22 16:53:25 +0000
@@ -4,13 +4,22 @@
4 * do not run pkgbinarymangler to convert images to 8bit since this breaks4 * do not run pkgbinarymangler to convert images to 8bit since this breaks
5 the launcher icon background handling. (LP: #809205)5 the launcher icon background handling. (LP: #809205)
6 (QT upstream bug: http://bugreports.qt.nokia.com/browse/QTBUG-4459)6 (QT upstream bug: http://bugreports.qt.nokia.com/browse/QTBUG-4459)
7 * debian/unity-2d.install:
8 - install GSettings schemas into usr/share/glib-2.0/schemas
9 - install GConf to GSettings conversion into usr/share/GConf/gsettings
10 * debian/gconf/schemas/unity-2d.schemas:
11 - remove GConf schema for /desktop/unity-2d/launcher/super_key_enable
12 * debian/20_unity-2d-gconf-default:
13 - remove default value for /desktop/unity-2d/launcher/super_key_enable
14 * debian/control:
15 - add dependency on libdconf-qt-dev
716
8 [ Didier Roche ]17 [ Didier Roche ]
9 * Fix typo in trigger (debian/unity-2d.triggers): (LP: #807358)18 * Fix typo in trigger (debian/unity-2d.triggers): (LP: #807358)
10 * Install the apport hook in the right directory so that it's not launched19 * Install the apport hook in the right directory so that it's not launched
11 unconditionally (LP: #712343)20 unconditionally (LP: #712343)
1221
13 -- Didier Roche <didrocks@ubuntu.com> Mon, 18 Jul 2011 11:02:17 +020022 -- Florian Boucault <florian.boucault@canonical.com> Fri, 22 Jul 2011 16:44:37 +0200
1423
15unity-2d (3.8.10-0ubuntu1) natty; urgency=low24unity-2d (3.8.10-0ubuntu1) natty; urgency=low
1625
1726
=== modified file 'debian/control'
--- debian/control 2011-06-22 21:17:49 +0000
+++ debian/control 2011-07-22 16:53:25 +0000
@@ -12,6 +12,7 @@
12 libglib2.0-dev,12 libglib2.0-dev,
13 libwnck-dev,13 libwnck-dev,
14 libqtgconf-dev,14 libqtgconf-dev,
15 libdconf-qt-dev,
15 libqtbamf-dev,16 libqtbamf-dev,
16 libqtdee-dev,17 libqtdee-dev,
17 libdbusmenu-qt-dev,18 libdbusmenu-qt-dev,
1819
=== modified file 'debian/gconf/schemas/unity-2d.schemas'
--- debian/gconf/schemas/unity-2d.schemas 2011-06-15 13:10:14 +0000
+++ debian/gconf/schemas/unity-2d.schemas 2011-07-22 16:53:25 +0000
@@ -39,18 +39,6 @@
39 <long>Use EWMH standard to reserve an area of the desktop (struts) so that no window can use the launcher's area</long>39 <long>Use EWMH standard to reserve an area of the desktop (struts) so that no window can use the launcher's area</long>
40 </locale>40 </locale>
41 </schema>41 </schema>
42
43 <schema>
44 <key>/schemas/desktop/unity-2d/launcher/super_key_enable</key>
45 <applyto>/desktop/unity-2d/launcher/super_key_enable</applyto>
46 <owner>unity-2d</owner>
47 <type>bool</type>
48 <default>true</default>
49 <locale name="C">
50 <short>Super key activation</short>
51 <long>Whether or not the super (also called windows key) key is used</long>
52 </locale>
53 </schema>
54</schemalist>42</schemalist>
55</gconfschemafile>43</gconfschemafile>
5644
5745
=== modified file 'debian/unity-2d.install'
--- debian/unity-2d.install 2011-07-19 07:02:13 +0000
+++ debian/unity-2d.install 2011-07-22 16:53:25 +0000
@@ -5,3 +5,5 @@
5debian/20_unity-2d-gconf-mandatory /usr/share/gconf/unity-2d/mandatory5debian/20_unity-2d-gconf-mandatory /usr/share/gconf/unity-2d/mandatory
6debian/20_unity-2d-gconf-default /usr/share/gconf/unity-2d/default6debian/20_unity-2d-gconf-default /usr/share/gconf/unity-2d/default
7usr/share/locale/*/LC_MESSAGES/unity-2d.mo7usr/share/locale/*/LC_MESSAGES/unity-2d.mo
8usr/share/glib-2.0/schemas/com.canonical.Unity2d.gschema.xml
9usr/share/GConf/gsettings
810
=== modified file 'launcher/app/CMakeLists.txt'
--- launcher/app/CMakeLists.txt 2011-06-11 11:33:52 +0000
+++ launcher/app/CMakeLists.txt 2011-07-22 16:53:25 +0000
@@ -3,6 +3,7 @@
3pkg_check_modules(X11 REQUIRED x11)3pkg_check_modules(X11 REQUIRED x11)
4pkg_check_modules(GEIS REQUIRED libutouch-geis)4pkg_check_modules(GEIS REQUIRED libutouch-geis)
5pkg_check_modules(QTGCONF REQUIRED libqtgconf)5pkg_check_modules(QTGCONF REQUIRED libqtgconf)
6pkg_check_modules(DCONFQT REQUIRED dconf-qt)
67
7# Sources8# Sources
8set(launcher_SRCS9set(launcher_SRCS
@@ -38,6 +39,7 @@
38 ${X11_INCLUDE_DIRS}39 ${X11_INCLUDE_DIRS}
39 ${GEIS_INCLUDE_DIRS}40 ${GEIS_INCLUDE_DIRS}
40 ${QTGCONF_INCLUDE_DIRS}41 ${QTGCONF_INCLUDE_DIRS}
42 ${DCONFQT_INCLUDE_DIRS}
41 ${libunity-2d-private_SOURCE_DIR}/src43 ${libunity-2d-private_SOURCE_DIR}/src
42 )44 )
4345
@@ -50,6 +52,7 @@
50 ${X11_LDFLAGS}52 ${X11_LDFLAGS}
51 ${GEIS_LDFLAGS}53 ${GEIS_LDFLAGS}
52 ${QTGCONF_LDFLAGS}54 ${QTGCONF_LDFLAGS}
55 ${DCONFQT_LDFLAGS}
53 unity-2d-private56 unity-2d-private
54 )57 )
5558
5659
=== modified file 'launcher/app/launcherview.cpp'
--- launcher/app/launcherview.cpp 2011-06-22 08:54:52 +0000
+++ launcher/app/launcherview.cpp 2011-07-22 16:53:25 +0000
@@ -36,6 +36,9 @@
36#include <X11/Xlib.h>36#include <X11/Xlib.h>
37#include <X11/Xatom.h>37#include <X11/Xatom.h>
3838
39// libdconf-qt
40#include "qconf.h"
41
39#include <keyboardmodifiersmonitor.h>42#include <keyboardmodifiersmonitor.h>
40#include <hotkey.h>43#include <hotkey.h>
41#include <hotkeymonitor.h>44#include <hotkeymonitor.h>
@@ -55,6 +58,7 @@
55static const char* SPREAD_DBUS_METHOD_IS_SHOWN = "IsShown";58static const char* SPREAD_DBUS_METHOD_IS_SHOWN = "IsShown";
56static const char* APPLICATIONS_PLACE = "/usr/share/unity/places/applications.place";59static const char* APPLICATIONS_PLACE = "/usr/share/unity/places/applications.place";
57static const char* COMMANDS_PLACE_ENTRY = "Runner";60static const char* COMMANDS_PLACE_ENTRY = "Runner";
61static const char* LAUNCHER_DCONF_SCHEMA = "com.canonical.Unity2d.Launcher";
5862
59LauncherView::LauncherView(QWidget* parent) :63LauncherView::LauncherView(QWidget* parent) :
60 Unity2DDeclarativeView(parent),64 Unity2DDeclarativeView(parent),
@@ -67,8 +71,8 @@
67 connect(&m_superKeyHoldTimer, SIGNAL(timeout()), SLOT(updateSuperKeyHoldState()));71 connect(&m_superKeyHoldTimer, SIGNAL(timeout()), SLOT(updateSuperKeyHoldState()));
68 connect(this, SIGNAL(superKeyTapped()), SLOT(toggleDash()));72 connect(this, SIGNAL(superKeyTapped()), SLOT(toggleDash()));
6973
70 m_enableSuperKey.setKey("/desktop/unity-2d/launcher/super_key_enable");74 m_dconf_launcher = new QConf(LAUNCHER_DCONF_SCHEMA);
71 connect(&m_enableSuperKey, SIGNAL(valueChanged()), SLOT(updateSuperKeyMonitoring()));75 connect(m_dconf_launcher, SIGNAL(superKeyEnableChanged(bool)), SLOT(updateSuperKeyMonitoring()));
72 updateSuperKeyMonitoring();76 updateSuperKeyMonitoring();
7377
74 /* Alt+F1 gives the keyboard focus to the launcher. */78 /* Alt+F1 gives the keyboard focus to the launcher. */
@@ -86,6 +90,11 @@
86 }90 }
87}91}
8892
93LauncherView::~LauncherView()
94{
95 delete m_dconf_launcher;
96}
97
89void98void
90LauncherView::activateWindow()99LauncherView::activateWindow()
91{100{
@@ -111,7 +120,7 @@
111{120{
112 KeyboardModifiersMonitor *modifiersMonitor = KeyboardModifiersMonitor::instance();121 KeyboardModifiersMonitor *modifiersMonitor = KeyboardModifiersMonitor::instance();
113122
114 QVariant value = m_enableSuperKey.getValue();123 QVariant value = m_dconf_launcher->property("superKeyEnable");
115 if (!value.isValid() || value.toBool() == true) {124 if (!value.isValid() || value.toBool() == true) {
116 QObject::connect(modifiersMonitor,125 QObject::connect(modifiersMonitor,
117 SIGNAL(keyboardModifiersChanged(Qt::KeyboardModifiers)),126 SIGNAL(keyboardModifiersChanged(Qt::KeyboardModifiers)),
118127
=== modified file 'launcher/app/launcherview.h'
--- launcher/app/launcherview.h 2011-06-22 08:54:52 +0000
+++ launcher/app/launcherview.h 2011-07-22 16:53:25 +0000
@@ -24,13 +24,13 @@
24#include <QList>24#include <QList>
25#include <QUrl>25#include <QUrl>
26#include <QTimer>26#include <QTimer>
2727#include <QVariant>
28#include "gconfitem-qml-wrapper.h"
2928
30#include <unity2ddeclarativeview.h>29#include <unity2ddeclarativeview.h>
3130
32class DeclarativeDragDropEvent;31class DeclarativeDragDropEvent;
33class LauncherDBus;32class LauncherDBus;
33class QConf;
3434
35class LauncherView : public Unity2DDeclarativeView35class LauncherView : public Unity2DDeclarativeView
36{36{
@@ -40,6 +40,7 @@
4040
41public:41public:
42 explicit LauncherView(QWidget* parent = NULL);42 explicit LauncherView(QWidget* parent = NULL);
43 ~LauncherView();
4344
44 bool superKeyHeld() const { return m_superKeyHeld; }45 bool superKeyHeld() const { return m_superKeyHeld; }
4546
@@ -66,7 +67,7 @@
66 void focusOutEvent(QFocusEvent* event);67 void focusOutEvent(QFocusEvent* event);
6768
68private:69private:
69 GConfItemQmlWrapper m_enableSuperKey;70 QConf* m_dconf_launcher;
70 bool m_superKeyPressed;71 bool m_superKeyPressed;
71 bool m_superKeyHeld;72 bool m_superKeyHeld;
72 QTimer m_superKeyHoldTimer;73 QTimer m_superKeyHoldTimer;
7374
=== modified file 'libunity-2d-private/src/unity2dapplication.cpp'
--- libunity-2d-private/src/unity2dapplication.cpp 2011-06-11 10:50:03 +0000
+++ libunity-2d-private/src/unity2dapplication.cpp 2011-07-22 16:53:25 +0000
@@ -21,6 +21,7 @@
2121
22// Self22// Self
23#include "unity2dapplication.h"23#include "unity2dapplication.h"
24#include "config.h"
2425
25// Qt26// Qt
2627
@@ -35,6 +36,13 @@
35Unity2dApplication::Unity2dApplication(int& argc, char** argv)36Unity2dApplication::Unity2dApplication(int& argc, char** argv)
36: QApplication(argc, argv)37: QApplication(argc, argv)
37{38{
39 /* Allow developers to run Unity 2D uninstalled by telling dconf-qt
40 where to look for Unity 2D's schemas.
41 It relies on the fact that the schema is compiled when running cmake.
42 */
43 if (!isRunningInstalled()) {
44 qputenv("GSETTINGS_SCHEMA_DIR", unity2dDirectory().toLocal8Bit() + "/data");
45 }
38}46}
3947
40Unity2dApplication::~Unity2dApplication()48Unity2dApplication::~Unity2dApplication()

Subscribers

People subscribed via source and target branches