Merge lp:~paulliu/unity/add_superkey_configuration_dialog into lp:unity

Proposed by Ying-Chun Liu
Status: Superseded
Proposed branch: lp:~paulliu/unity/add_superkey_configuration_dialog
Merge into: lp:unity
Diff against target: 95 lines (+51/-1)
3 files modified
tools/Makefile.am (+1/-1)
tools/superkey_conf_dialog.py (+35/-0)
unity-private/panel/panel-home-button.vala (+15/-0)
To merge this branch: bzr merge lp:~paulliu/unity/add_superkey_configuration_dialog
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Approve
Review via email: mp+37223@code.launchpad.net

This proposal has been superseded by a proposal from 2011-01-06.

Description of the change

Add a configuration dialog when super key is disabled by OEM.
The window will be shown each time when the dash button is pressed first time and the super key is disabled.

To post a comment you must log in.
Revision history for this message
Neil J. Patel (njpatel) wrote :

Obviously this won't apply to Unity trunk anymore, but I don't mind if you want to merge it into the 0.2 series if it will lessen the distropatch burden for OEM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tools/Makefile.am'
--- tools/Makefile.am 2010-09-09 16:05:44 +0000
+++ tools/Makefile.am 2010-10-04 13:13:12 +0000
@@ -1,3 +1,3 @@
1EXTRA_DIST = makebootchart.py unity-xephyr.py1EXTRA_DIST = makebootchart.py unity-xephyr.py
22
3dist_libexec_SCRIPTS = migrate_favorites.py3dist_libexec_SCRIPTS = migrate_favorites.py superkey_conf_dialog.py
44
=== added file 'tools/superkey_conf_dialog.py'
--- tools/superkey_conf_dialog.py 1970-01-01 00:00:00 +0000
+++ tools/superkey_conf_dialog.py 2010-10-04 13:13:12 +0000
@@ -0,0 +1,35 @@
1#!/usr/bin/python
2# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
3# Copyright(C) 2010 Canonical
4# Author: Ying-Chun Liu
5#
6# This program is free software: you can redistributeit and/or modify it
7# under the terms of the GNU General Public License version 3, as published
8# by the Free Software Foundation.
9
10import sys
11import os
12import gconf
13import gtk
14import gettext
15
16gettext.install('unity')
17
18if __name__ == '__main__':
19
20 gconfkey = '/desktop/unity/launcher/super_key_enable'
21 dialog = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_NONE, message_format=None)
22 dialog.set_resizable(True);
23 dialog.set_default_size(420,-1);
24 dialog.set_title(_('Microsoft Windows key Trademark Compliance'))
25 dialog.set_markup(_('Wound you like to use the Super/Windows key to activate Ubuntu functions?'))
26 dialog.add_button(_('No thanks'),gtk.RESPONSE_NO)
27 dialog.add_button(_('Yes please'),gtk.RESPONSE_YES)
28 dialog.set_default_response(gtk.RESPONSE_YES)
29 response_id = dialog.run()
30 gconf_client = gconf.client_get_default()
31 gconf_client.add_dir("/desktop/unity/launcher",gconf.CLIENT_PRELOAD_NONE)
32 if (response_id != gtk.RESPONSE_NO):
33 gconf_client.set_bool(gconfkey,True)
34 else:
35 gconf_client.set_bool(gconfkey,False)
036
=== modified file 'unity-private/panel/panel-home-button.vala'
--- unity-private/panel/panel-home-button.vala 2010-09-24 12:40:30 +0000
+++ unity-private/panel/panel-home-button.vala 2010-10-04 13:13:12 +0000
@@ -28,6 +28,8 @@
28 private Clutter.Texture bfb_bg_normal;28 private Clutter.Texture bfb_bg_normal;
29 private Clutter.Texture bfb_bg_prelight;29 private Clutter.Texture bfb_bg_prelight;
30 private Clutter.Texture bfb_bg_active;30 private Clutter.Texture bfb_bg_active;
31 private bool super_key_enable_asked=false;
32 private bool super_key_enable=false;
3133
32 public HomeButton (Shell shell)34 public HomeButton (Shell shell)
33 {35 {
@@ -97,6 +99,8 @@
97 set_background_for_state (Ctk.ActorState.STATE_NORMAL, bfb_bg_normal);99 set_background_for_state (Ctk.ActorState.STATE_NORMAL, bfb_bg_normal);
98 set_background_for_state (Ctk.ActorState.STATE_PRELIGHT, bfb_bg_prelight);100 set_background_for_state (Ctk.ActorState.STATE_PRELIGHT, bfb_bg_prelight);
99 set_background_for_state (Ctk.ActorState.STATE_ACTIVE, bfb_bg_active);101 set_background_for_state (Ctk.ActorState.STATE_ACTIVE, bfb_bg_active);
102 var gc = GConf.Client.get_default();
103 super_key_enable = gc.get_bool("/desktop/unity/launcher/super_key_enable");
100 }104 }
101105
102 private override void allocate (Clutter.ActorBox box,106 private override void allocate (Clutter.ActorBox box,
@@ -205,6 +209,11 @@
205209
206 private void on_clicked ()210 private void on_clicked ()
207 {211 {
212 if (!super_key_enable && !super_key_enable_asked) {
213 show_super_key_enable_dialog();
214 super_key_enable_asked = true;
215 return;
216 }
208 shell.show_unity ();217 shell.show_unity ();
209 MenuManager manager = MenuManager.get_default ();218 MenuManager manager = MenuManager.get_default ();
210 manager.popdown_current_menu ();219 manager.popdown_current_menu ();
@@ -212,6 +221,12 @@
212 on_mode_changed (shell.get_mode ());221 on_mode_changed (shell.get_mode ());
213 }222 }
214223
224 private void* show_super_key_enable_dialog()
225 {
226 Process.spawn_command_line_async("/usr/lib/unity/superkey_conf_dialog.py");
227 return null;
228 }
229
215 private bool on_motion_event (Clutter.Event event)230 private bool on_motion_event (Clutter.Event event)
216 {231 {
217 shell.about_to_show_places ();232 shell.about_to_show_places ();