~ubuntu-branches/ubuntu/saucy/unity-tweak-tool/saucy-proposed

« back to all changes in this revision

Viewing changes to UnityTweakTool/section/unity.py

  • Committer: Package Import Robot
  • Author(s): Barneedhar Vigneshwar
  • Date: 2013-02-15 20:33:41 UTC
  • Revision ID: package-import@ubuntu.com-20130215203341-yqrfr9df488k41am
Tags: 0.0.3
* New upstream release
* Closes needs-packaging bug (LP: #1126433)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python3
 
2
# -*- coding: utf-8 -*-
 
3
#
 
4
# Team:
 
5
#   J Phani Mahesh <phanimahesh@gmail.com> 
 
6
#   Barneedhar (jokerdino) <barneedhar@ubuntu.com> 
 
7
#   Amith KK <amithkumaran@gmail.com>
 
8
#   Georgi Karavasilev <motorslav@gmail.com>
 
9
#   Sam Tran <samvtran@gmail.com>
 
10
#   Sam Hewitt <hewittsamuel@gmail.com>
 
11
#   Angel Araya <al.arayaq@gmail.com>
 
12
#
 
13
# Description:
 
14
#   A One-stop configuration tool for Unity.
 
15
#
 
16
# Legal Stuff:
 
17
#
 
18
# This file is a part of Unity Tweak Tool
 
19
#
 
20
# Unity Tweak Tool is free software; you can redistribute it and/or modify it under
 
21
# the terms of the GNU General Public License as published by the Free Software
 
22
# Foundation; version 3.
 
23
#
 
24
# Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
 
25
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
26
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
27
# details.
 
28
#
 
29
# You should have received a copy of the GNU General Public License along with
 
30
# this program; if not, see <https://www.gnu.org/licenses/gpl-3.0.txt>
 
31
 
 
32
 
 
33
from UnityTweakTool.section.skeletonpage import Section,Tab
 
34
from UnityTweakTool.elements.switch import Switch
 
35
from UnityTweakTool.elements.cbox import ComboBox
 
36
 
 
37
from UnityTweakTool.section.sphagetti.unity import Unitysettings as SphagettiUnitySettings
 
38
from UnityTweakTool.elements.option import Option,HandlerObject
 
39
 
 
40
from collections import defaultdict
 
41
 
 
42
Unity=Section(ui='unity.ui',id='nb_unitysettings')
 
43
 
 
44
sw_launcher_hidemode= Switch({
 
45
    'id'        : 'sw_launcher_hidemode',
 
46
    'builder'   : Unity.builder,
 
47
    'schema'    : 'org.compiz.unityshell',
 
48
    'path'      : '/org/compiz/profiles/unity/plugins/unityshell/',
 
49
    'key'       : 'launcher-hide-mode',
 
50
    'type'      : 'int',
 
51
    'map'       : {1:True,0:False},
 
52
    'dependants': ['radio_reveal_left',
 
53
                   'radio_reveal_topleft',
 
54
                   'sc_reveal_sensitivity',
 
55
                   'l_launcher_reveal',
 
56
                   'l_launcher_reveal_sensitivity',
 
57
                   'l_autohide_animation',
 
58
                   'cbox_autohide_animation']
 
59
})
 
60
 
 
61
cbox_autohide_animation=ComboBox({
 
62
    'id'        : 'cbox_autohide_animation',
 
63
    'builder'   : Unity.builder,
 
64
    'schema'    : 'org.compiz.unityshell',
 
65
    'path'      : '/org/compiz/profiles/unity/plugins/unityshell/',
 
66
    'key'       : 'autohide-animation',
 
67
    'type'      : 'int',
 
68
    'map'       : {0:0,1:1,2:2,3:3}
 
69
})
 
70
 
 
71
LauncherIcons=Tab([sw_launcher_hidemode,
 
72
                    cbox_autohide_animation])
 
73
 
 
74
 
 
75
sw_dash_blur= Switch({
 
76
    'id'        : 'sw_dash_blur',
 
77
    'builder'   : Unity.builder,
 
78
    'schema'    : 'org.compiz.unityshell',
 
79
    'path'      : '/org/compiz/profiles/unity/plugins/unityshell/',
 
80
    'key'       : 'dash-blur-experimental',
 
81
    'type'      : 'int',
 
82
    'map'       : defaultdict(lambda:True,{2:True,0:False}),
 
83
    'dependants': ['radio_dash_blur_smart',
 
84
                   'radio_dash_blur_static',
 
85
                   'l_dash_blur_type']
 
86
})
 
87
DashIcons=Tab([sw_dash_blur])
 
88
 
 
89
sw_transparent_panel= Switch({
 
90
    'id'        : 'sw_transparent_panel',
 
91
    'builder'   : Unity.builder,
 
92
    'schema'    : 'org.compiz.unityshell',
 
93
    'path'      : '/org/compiz/profiles/unity/plugins/unityshell/',
 
94
    'key'       : 'panel-opacity',
 
95
    'type'      : 'double',
 
96
    'map'       : defaultdict(lambda:True,{0.33:True,1:False}),
 
97
    'dependants': ['sc_panel_transparency',
 
98
                   'l_transparent_panel',
 
99
                   'check_panel_opaque']
 
100
})
 
101
PanelIcons=Tab([sw_transparent_panel])
 
102
 
 
103
switch_unity_webapps= Switch({
 
104
    'id'        : 'switch_unity_webapps',
 
105
    'builder'   : Unity.builder,
 
106
    'schema'    : 'com.canonical.unity.webapps',
 
107
    'path'      : None,
 
108
    'key'       : 'integration-allowed',
 
109
    'type'      : 'boolean',
 
110
    'map'       : {True:True,False:False},
 
111
    'dependants': []
 
112
})
 
113
WebappsIcons=Tab([switch_unity_webapps])
 
114
 
 
115
 
 
116
# Each page must be added using add_page
 
117
Unity.add_page(LauncherIcons)
 
118
Unity.add_page(DashIcons)
 
119
#Unity.add_page(PanelIcons)
 
120
Unity.add_page(WebappsIcons)
 
121
 
 
122
# XXX : Sphagetti bridge
 
123
unitysettings=HandlerObject(SphagettiUnitySettings(Unity.builder))
 
124
Unity.add_page(unitysettings)
 
125
# After all pages are added, the section needs to be registered to start listening for events
 
126
Unity.register()