~jbicha/unity-2d/fix-launcher-quicklist-naming-lp949636

« back to all changes in this revision

Viewing changes to launcher/app/launcherview.cpp

  • Committer: Florian Boucault
  • Date: 2011-07-14 14:36:53 UTC
  • mto: (574.1.60 unity-2d)
  • mto: This revision was merged to the branch mainline in revision 604.
  • Revision ID: florian@boucault.net-20110714143653-ktnzxuo4ngss40t2
[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

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#include <X11/Xlib.h>
37
37
#include <X11/Xatom.h>
38
38
 
 
39
// libdconf-qt
 
40
#include "qconf.h"
 
41
 
39
42
#include <keyboardmodifiersmonitor.h>
40
43
#include <hotkey.h>
41
44
#include <hotkeymonitor.h>
55
58
static const char* SPREAD_DBUS_METHOD_IS_SHOWN = "IsShown";
56
59
static const char* APPLICATIONS_PLACE = "/usr/share/unity/places/applications.place";
57
60
static const char* COMMANDS_PLACE_ENTRY = "Runner";
 
61
static const char* LAUNCHER_DCONF_SCHEMA = "com.canonical.Unity2d.Launcher";
58
62
 
59
63
LauncherView::LauncherView(QWidget* parent) :
60
64
    Unity2DDeclarativeView(parent),
67
71
    connect(&m_superKeyHoldTimer, SIGNAL(timeout()), SLOT(updateSuperKeyHoldState()));
68
72
    connect(this, SIGNAL(superKeyTapped()), SLOT(toggleDash()));
69
73
 
70
 
    m_enableSuperKey.setKey("/desktop/unity-2d/launcher/super_key_enable");
71
 
    connect(&m_enableSuperKey, SIGNAL(valueChanged()), SLOT(updateSuperKeyMonitoring()));
 
74
    m_dconf_launcher = new QConf(LAUNCHER_DCONF_SCHEMA);
 
75
    connect(m_dconf_launcher, SIGNAL(superKeyEnableChanged(bool)), SLOT(updateSuperKeyMonitoring()));
72
76
    updateSuperKeyMonitoring();
73
77
 
74
78
    /* Alt+F1 gives the keyboard focus to the launcher. */
86
90
    }
87
91
}
88
92
 
 
93
LauncherView::~LauncherView()
 
94
{
 
95
    delete m_dconf_launcher;
 
96
}
 
97
 
89
98
void
90
99
LauncherView::activateWindow()
91
100
{
111
120
{
112
121
    KeyboardModifiersMonitor *modifiersMonitor = KeyboardModifiersMonitor::instance();
113
122
 
114
 
    QVariant value = m_enableSuperKey.getValue();
 
123
    QVariant value = m_dconf_launcher->property("superKeyEnable");
115
124
    if (!value.isValid() || value.toBool() == true) {
116
125
        QObject::connect(modifiersMonitor,
117
126
                         SIGNAL(keyboardModifiersChanged(Qt::KeyboardModifiers)),