Compare commits
2150 Commits
3.1.92
...
wip/media-
Author | SHA1 | Date | |
---|---|---|---|
60d87ef4ba | |||
d886dc17e1 | |||
9dd2a467ba | |||
e757b06987 | |||
6f2da1baf1 | |||
f30dcad8a7 | |||
7dc235511e | |||
644c210fe2 | |||
68e8f98671 | |||
1228db6ac1 | |||
86596749fa | |||
76229a3601 | |||
95abdeb919 | |||
df0151d338 | |||
ee2f12fe81 | |||
10c104529f | |||
cbc8ec6508 | |||
8e7758e280 | |||
9aefbd189c | |||
b9d50584d8 | |||
e5f7390c09 | |||
797b1ff8bb | |||
09b738045c | |||
4fd690333a | |||
5ef5e25a7f | |||
87e8770cbc | |||
cac9d120be | |||
1ae0fadbf4 | |||
65497e089a | |||
2d763bd033 | |||
4ebf396cf5 | |||
6faa50d496 | |||
6fcd6298c8 | |||
5c16be5dbb | |||
e3abb6f178 | |||
70736be4eb | |||
1c3e7330f3 | |||
6e4c89b310 | |||
73b4a0ef5f | |||
d88002c4ed | |||
025c63c045 | |||
b189cbd46e | |||
a21ddb5914 | |||
e04a4c3923 | |||
ae0821e07b | |||
a508bece36 | |||
2c9969a8f4 | |||
dd9fc91f6f | |||
39d9838cc1 | |||
1397c7c624 | |||
c09fcba94f | |||
c77b38fc4f | |||
aef9b733e5 | |||
348208617b | |||
2c34c8e20f | |||
d19fa731d6 | |||
59bb1cc387 | |||
56909d0646 | |||
04da29c939 | |||
307f7a3024 | |||
e80bfa39f5 | |||
29714922ea | |||
88192114ac | |||
9d78208b76 | |||
d817bf0395 | |||
4d51056226 | |||
a607174a25 | |||
37d6a624b7 | |||
0c807bddaf | |||
a0470bfc66 | |||
b9463d23e8 | |||
04debd1623 | |||
9d31576cf5 | |||
8daca28a90 | |||
9899604261 | |||
687e1eabed | |||
eb09f34114 | |||
fbeb446ed7 | |||
92033ce0f5 | |||
9171bab5e5 | |||
f9819eb7b0 | |||
85728f0d15 | |||
9396849d56 | |||
6f5e5672bb | |||
b936e60876 | |||
fa4bd91213 | |||
81eeef7d3c | |||
a7b5134820 | |||
92a01c67ba | |||
71c23613b5 | |||
4f876995de | |||
9cf4a76196 | |||
9efe5287e4 | |||
8c4b34de4e | |||
93e3559dc3 | |||
caa0f63e1f | |||
a4e29e1244 | |||
599f2f43e3 | |||
3a453c5f73 | |||
98b313c75f | |||
8b796d80a7 | |||
719a8908a6 | |||
fed007ecae | |||
990443465f | |||
1f183b8a4e | |||
96556eb959 | |||
3ffeeac577 | |||
d7929a2340 | |||
667019a8c1 | |||
d9b46b4782 | |||
e249218a9d | |||
a2b1946b01 | |||
96a80f7ba0 | |||
9955fbf4f8 | |||
14966b0cd0 | |||
6e1a8f16a8 | |||
d106191e6a | |||
418cf6281e | |||
bdeb7d86b6 | |||
a0e0cc1038 | |||
78f6dec73b | |||
f6458f215f | |||
c7e0d547c4 | |||
fa54cfa0c3 | |||
31ea3f737c | |||
2a8a8065a8 | |||
d3ba002313 | |||
f18fd8d959 | |||
d54f7b13fb | |||
9c8b75206c | |||
15273c7f22 | |||
0ea8217c55 | |||
1735f28f5a | |||
8de4070f7f | |||
45e64f453f | |||
62dc5f2ac6 | |||
86c85a752e | |||
3de0ebf7fd | |||
1496ba0bbd | |||
f5974f6793 | |||
928ea3bb01 | |||
b7acb1d488 | |||
360d94dd67 | |||
671a813135 | |||
c005417f9b | |||
b5ec68bda3 | |||
b4ed29094d | |||
284ab031b8 | |||
6ad5064c09 | |||
3a8e723a36 | |||
dd3484b93f | |||
205773b700 | |||
f2039070e6 | |||
cf58a7eafd | |||
487749c25b | |||
48fb16b570 | |||
f94369dd6e | |||
fc0bd3b9e8 | |||
19946f1d19 | |||
562f56130a | |||
99f97adfc6 | |||
5ad7db722d | |||
a7d344d287 | |||
0ac215f9de | |||
4342155748 | |||
b561694bf0 | |||
cae9a8d608 | |||
88fbdba018 | |||
046067565a | |||
11299d9913 | |||
42ab233b08 | |||
4a92d7d1b2 | |||
2502ca6ccc | |||
651030ba93 | |||
8dfea9566e | |||
8cc54ce2a2 | |||
3abfcda8b5 | |||
cf0ae8f182 | |||
d90bf5c6dc | |||
955b550e95 | |||
b3cd46a5c8 | |||
3fdc8bfa3d | |||
e8f96a6e16 | |||
dc15df1aa7 | |||
05f5fac35b | |||
5bfcc5392d | |||
d2e830cce3 | |||
1e942be639 | |||
576009bad0 | |||
f71108a214 | |||
7109bd52f2 | |||
0f6effa263 | |||
8b0301ed00 | |||
4f56fb125e | |||
6487cd8c6f | |||
06e5c25383 | |||
36e5ae4a25 | |||
245e43ea8c | |||
52871c781a | |||
f994ada576 | |||
147a6e49dc | |||
be24ee435c | |||
9fac285b69 | |||
3ed5f9cd15 | |||
17e70ff8ec | |||
6dab119650 | |||
f80eb89d57 | |||
f6c2902fe4 | |||
1e890a8a0a | |||
aa1a84e677 | |||
9395f310d6 | |||
b99bb3d4bb | |||
4f66f096ff | |||
7f5f2284f3 | |||
59f9f4fca1 | |||
55284e418c | |||
20d4ffde6e | |||
78e5d4df9d | |||
1118ec9653 | |||
7d6c85be42 | |||
0192a6cb12 | |||
0e01a81219 | |||
36edf20273 | |||
a1bf19dbdf | |||
0ad739e78b | |||
ff9509b901 | |||
7e496b1979 | |||
448517032e | |||
a171e92e6c | |||
06e9bf9b0a | |||
7d9ec8cea0 | |||
5b4553ff0c | |||
d4ce7aef59 | |||
8b6df2e23f | |||
e2ff5846df | |||
24efeff788 | |||
4f359e62df | |||
e6fd2bed4d | |||
9fb6510135 | |||
7206b61838 | |||
e8ab0b3e8f | |||
843788580e | |||
4ceb3d890d | |||
3f8995b25e | |||
37e0cefc79 | |||
f026741dbb | |||
044b121e01 | |||
d57c3b4f89 | |||
960f7d5f2e | |||
2f61381651 | |||
ba6e931e21 | |||
440aa0d369 | |||
f42d4b5fa2 | |||
5d9fa2c484 | |||
f5c86fa171 | |||
f9019ce62d | |||
ee485e1728 | |||
8f2a6f8387 | |||
908bf3b117 | |||
6a739afd25 | |||
506490e32d | |||
846771f2a1 | |||
759b7584e0 | |||
e5cb224598 | |||
e32df1b405 | |||
db9f91b687 | |||
0941357068 | |||
d8993c52d0 | |||
6424b2dd03 | |||
2a4eb3ed1a | |||
c9fa00cce1 | |||
18eedbc02d | |||
ef9f63fe59 | |||
f8ce788425 | |||
6c1bd95643 | |||
2ed7ee8f71 | |||
2e63709450 | |||
6611d639a8 | |||
fe124e6ab3 | |||
fee0a8527d | |||
2f6b00403f | |||
dbe2c117e3 | |||
c4b1ccb6d6 | |||
2c70ee7e43 | |||
f7826616b8 | |||
9f476a12dd | |||
6f3cf0ae50 | |||
cd024e21f0 | |||
c4c470c1f3 | |||
dc9ad8df80 | |||
74d6225993 | |||
e1e0c5035d | |||
adf6d0eb82 | |||
90df435345 | |||
83d57211db | |||
0a8eeb2827 | |||
0c324c42f4 | |||
3adf54a952 | |||
8076c66a4c | |||
f9c583a636 | |||
30d536b19c | |||
1957899146 | |||
b52c83d88a | |||
27ff388413 | |||
d4306f7768 | |||
5d0a57c97d | |||
a87ba467ae | |||
7df7cd01eb | |||
098d805a8b | |||
4a21034a00 | |||
7904e359f2 | |||
0c8a94beb8 | |||
c13a573792 | |||
f9b42e12ae | |||
5c2031b768 | |||
49643882d4 | |||
175ddaa3a1 | |||
cc1d6e97b8 | |||
79b96ab301 | |||
44d9316023 | |||
5b0c9a74fb | |||
3429fc3e4c | |||
d11d8d5353 | |||
1742bd6ded | |||
9f6e118ea0 | |||
717bbd3bb5 | |||
e8ebe4de14 | |||
0ff614ccd4 | |||
d0a77b7e0c | |||
2815889090 | |||
1317956663 | |||
a2303d8895 | |||
2161c793dc | |||
a2f943db8f | |||
23a31b9c00 | |||
2591d1b94b | |||
300f97f102 | |||
7e3f6c3066 | |||
601d232064 | |||
8854ac84ad | |||
0302c3fbd4 | |||
6b6fdc6cfe | |||
7126ce86ec | |||
760bf52f75 | |||
6d791d31de | |||
21adc98d70 | |||
6fd7a56568 | |||
fba427fcaf | |||
7753361ffb | |||
c1590d9ed7 | |||
23c1138a58 | |||
2acb097662 | |||
449d116af2 | |||
110240981d | |||
ac5c6de929 | |||
51bdc44352 | |||
bafe34696d | |||
114f6f577f | |||
1f30670c1d | |||
10884ef7f5 | |||
5e12e5f42a | |||
e7a2e1f268 | |||
cc6744055f | |||
e6ba7c6e40 | |||
ea4855e908 | |||
5c7da4b0e6 | |||
9659d934ac | |||
de93677271 | |||
6ef3c628e6 | |||
f2af0be9ac | |||
ef7b74a104 | |||
906368d916 | |||
809cbf58c6 | |||
a5d60050a2 | |||
2c130c8668 | |||
c0ff02d9c7 | |||
cb627db392 | |||
33bd6bc75b | |||
ea5bf109cb | |||
b150a2842e | |||
2a46c39019 | |||
5ca5f026c5 | |||
15f22add79 | |||
131fa6a359 | |||
2d184e1842 | |||
95a55a2c1c | |||
8eecbb5c17 | |||
abfdcaa1b5 | |||
8ee74e5661 | |||
ff31ccdd30 | |||
f6645a41d2 | |||
daceb8105f | |||
4beba796d7 | |||
70c34baafb | |||
e71c016477 | |||
633bbd8a9e | |||
4c82df56e9 | |||
0d62ec5b03 | |||
38f943ef81 | |||
e421953fcd | |||
f39098a4f2 | |||
b203a95a78 | |||
2bb1a6792a | |||
e30d45a2b0 | |||
afcd90ae27 | |||
94c1d5a18c | |||
4254fa3d38 | |||
3b293e91e3 | |||
3d6320295e | |||
7654f1ca3e | |||
e62c66b153 | |||
638507caff | |||
107f5de58e | |||
b1451523ca | |||
f7a95b5edc | |||
be290fafe7 | |||
b7ae74edb9 | |||
b3041ae9fc | |||
7499b04638 | |||
bf2d2071fc | |||
488820daec | |||
77c15b76b5 | |||
e71129aa68 | |||
6f5b700833 | |||
9627864ca8 | |||
2a8625ffae | |||
ed82c3763c | |||
22266899dc | |||
9dfd1bfa41 | |||
409af28cb7 | |||
4fe604bfe8 | |||
49df72ceda | |||
2db029bcdb | |||
7fd128eabc | |||
5e3d8dd3eb | |||
785be2f327 | |||
8cf9baa132 | |||
09e3aed770 | |||
452ac297ab | |||
7ebb5c6a10 | |||
00e0d24a6a | |||
8a269041fb | |||
9f48adcff9 | |||
48e7d732b9 | |||
30048b74d1 | |||
c866b0dbfd | |||
1c79f18b13 | |||
6d704be88b | |||
5af389c087 | |||
475dde4193 | |||
8c534163e1 | |||
657887b241 | |||
10da35cbef | |||
00f15c1075 | |||
19f92df8ab | |||
8639cf8060 | |||
2501d29e9d | |||
8109dd684e | |||
5a259dd6b0 | |||
2ed28211ed | |||
9d0eaa216f | |||
58477282fe | |||
6b016c2528 | |||
b98c5f94ee | |||
ad8bdb929a | |||
5030d59fcc | |||
ec52928736 | |||
7f479e18e6 | |||
7999e9020d | |||
43ba93a817 | |||
b37e02c90a | |||
be5df17a4a | |||
ffbc1fd190 | |||
457fb604dd | |||
09c81f79f6 | |||
0725a7d836 | |||
f957ae71c3 | |||
011c9d1beb | |||
aed589a98d | |||
3830e90642 | |||
3710b88ab9 | |||
5c990f103e | |||
2890fc9d7d | |||
0223507a2e | |||
59412a9405 | |||
110d58bbc3 | |||
eda17defb2 | |||
f563fb124e | |||
14d0a96999 | |||
f0474ffccc | |||
11ce6845f2 | |||
70d610b5e4 | |||
f5ca649977 | |||
8954d33019 | |||
2e6205bc05 | |||
e0dea63079 | |||
7c244b01c6 | |||
3f5edf7c3e | |||
92d8d65543 | |||
cebd8e14e9 | |||
16e92a7ca3 | |||
59e2710137 | |||
f1ca96bbf0 | |||
ec01f5d5ee | |||
2a800e4ce0 | |||
ca2e09fe8b | |||
7e343f11f2 | |||
db20a54861 | |||
ec4f6b7f91 | |||
08a69cdcbd | |||
aa9c095c8e | |||
b257029d3e | |||
cb9062f818 | |||
3a1f623ea3 | |||
47d46e367e | |||
e5534e86ab | |||
e0ca572572 | |||
ca4b86e7ca | |||
f177bd0b51 | |||
11086e8ef8 | |||
1237aef727 | |||
79bfea5970 | |||
50f8ae6fc7 | |||
73ec86797b | |||
703417a760 | |||
3013a87bd2 | |||
833cb2556b | |||
8f4f8fccdb | |||
38e4ab1cea | |||
366a3e2c35 | |||
fcb175ebb3 | |||
a76cc79f88 | |||
1a6d74fcb2 | |||
eb351b1882 | |||
43caace1b6 | |||
167ed7c35b | |||
69735940ec | |||
1a7fad129d | |||
6931e6cf0f | |||
87e021cd2e | |||
d3f5d94afe | |||
a3d8b5e526 | |||
5e46abfa03 | |||
f4740bac65 | |||
dc10e61a20 | |||
82c8aad157 | |||
4ba1f26e4d | |||
f8805e8311 | |||
c815979f2a | |||
54e5ffcac1 | |||
3fd0502cb9 | |||
8aed51180f | |||
e616877fd2 | |||
df15ee4074 | |||
4cf3acd0ec | |||
77ea16e18f | |||
85d993386a | |||
14a7da767b | |||
2f3df71cc1 | |||
dc13e72b89 | |||
2beff9896a | |||
43af6f4792 | |||
04d1a35cb5 | |||
f075b36d4f | |||
c21b1e5fe0 | |||
042c1fd54b | |||
ee6086373b | |||
382310fe51 | |||
d52cb510fc | |||
c1de2788b1 | |||
41dc9e0894 | |||
d3b0d23d8f | |||
f96dcaccbe | |||
2672f205fd | |||
1ba21ed367 | |||
79408d359c | |||
12c76e53cb | |||
ac44426557 | |||
684e5bec15 | |||
70d19530c4 | |||
e34ab6c5ae | |||
b3cb9d8459 | |||
df3fa973ad | |||
1f4895428d | |||
417941a1bf | |||
973a6b21a2 | |||
b50604d070 | |||
a1ecf459b3 | |||
6ea80eadd6 | |||
9dafaa2c0c | |||
50e5736c03 | |||
46fcfb7629 | |||
8a86540090 | |||
785ab8192b | |||
3c386e0c50 | |||
bec48492ab | |||
13a10f8afd | |||
00fe97a55a | |||
9e665e4903 | |||
efc128e681 | |||
6851c5443a | |||
baf08dd688 | |||
67115b3e9b | |||
4ca2697271 | |||
4696bfbb80 | |||
18c62a1987 | |||
d60a4e97d6 | |||
43883a6945 | |||
58ff5c6cc6 | |||
3902e8bff0 | |||
5d6f37017b | |||
ecbf2f1429 | |||
56dc2eb96e | |||
2154a22c90 | |||
3fafe0da07 | |||
983535224e | |||
88effdd9c3 | |||
e9a4843eb0 | |||
c50132b29f | |||
e92a6b3c6c | |||
66a36bf591 | |||
39559f0a09 | |||
712623946f | |||
47ce72e011 | |||
7f8c5c4f64 | |||
64fdff6ace | |||
fa2b413095 | |||
46b7a95ec8 | |||
55922c0568 | |||
1c927868d8 | |||
0a1f0e58d0 | |||
9024c5d7ac | |||
370de395f7 | |||
8ebd2ff9eb | |||
83a1c7283d | |||
695f84e14f | |||
54f3036f86 | |||
446583400e | |||
3776c50986 | |||
4ff0697ee7 | |||
cd43c4983b | |||
0f065ebce6 | |||
a2e0e0ad06 | |||
d721fc2c17 | |||
becaeafeac | |||
99c97707ac | |||
75ed427e04 | |||
d1e35d11d0 | |||
ee0102e86e | |||
776b71bad5 | |||
37da87d9e1 | |||
ea14d74141 | |||
4b60a8deb8 | |||
7cca0a9cd8 | |||
f347aba01b | |||
8c40ded498 | |||
c267a7a7f9 | |||
0959adcfe3 | |||
7d12f47bf8 | |||
dff673533d | |||
816a29d582 | |||
27fbe4cd83 | |||
2ee6f49a93 | |||
0ea2d98768 | |||
b5dc78a968 | |||
ebe7890a49 | |||
ef4231b9c0 | |||
7e2bab48c9 | |||
eebab34b62 | |||
05d613f3a3 | |||
5c6b1fd0cc | |||
f8eab659d9 | |||
4a214d8238 | |||
44b4741e35 | |||
95b9863a70 | |||
4dfe3d21e1 | |||
3568e6d42d | |||
c3ae4542b2 | |||
3031036cb0 | |||
11dc510ae4 | |||
79c25d1dc8 | |||
1fd17b5027 | |||
7a6b2abfeb | |||
fe8e62c6a8 | |||
e937fd07e5 | |||
c668d16a00 | |||
c33e2d1971 | |||
0711a70398 | |||
cb5095370e | |||
8f71920622 | |||
3da0e9e86a | |||
e8c8fecb35 | |||
8bb2c425c6 | |||
1f6d807882 | |||
8d1ed9f88a | |||
d766f865f3 | |||
c540cb5e16 | |||
b36029f6c4 | |||
a8e6bfcb3d | |||
9c7222daea | |||
ab5c0bcfcf | |||
1a2dcf213e | |||
6f8e7f07f3 | |||
0ac4787f1a | |||
16bbe9782b | |||
5594c119f5 | |||
a909017a2b | |||
9a7914eee9 | |||
98c461dcd8 | |||
5991c8dca3 | |||
b9226fbcbd | |||
b6375d3e40 | |||
8dc9ceb2bc | |||
6cb713b0e3 | |||
dafa27fccd | |||
190f2f82ac | |||
43767ab2b9 | |||
3042e647ff | |||
a004ad6088 | |||
addb247c33 | |||
8f129e1c9d | |||
341b6a1290 | |||
6a9b1996e4 | |||
a5f2d289bd | |||
e3a8228065 | |||
fd04c59e63 | |||
f8b1a84b81 | |||
b53d18fe1c | |||
d0a94768a6 | |||
80fde70995 | |||
cbb56b6128 | |||
cbd2188c04 | |||
2b30afa618 | |||
1a65374e21 | |||
3e94f6bc3c | |||
1dbbb4f91c | |||
b3b847fadd | |||
ff25a5e251 | |||
aaf61cbbbe | |||
ca7c4edd41 | |||
028e83181b | |||
31c3783c7c | |||
f63371dadb | |||
9f07a3dd4a | |||
06262a903e | |||
e01e79d9fb | |||
2c627cad10 | |||
b33e51be45 | |||
b17f5b678d | |||
c6a6ae594a | |||
9f02129af3 | |||
6037350380 | |||
5de38cd9f6 | |||
7950c4afdd | |||
e304854fa5 | |||
d7f54213f1 | |||
12a71be076 | |||
855f0dbcad | |||
03db0d630e | |||
5a35c57866 | |||
d11027e8c8 | |||
aa733b5e53 | |||
355ec9ceca | |||
aa30c6a323 | |||
ad5572f275 | |||
9082b4df48 | |||
c3179583c3 | |||
4db87839a6 | |||
b018d49dc3 | |||
83362226cf | |||
1e3796967e | |||
8d7fa54af4 | |||
59cd9b4220 | |||
59dfb5866d | |||
a29ceaa8ec | |||
782e11b96c | |||
fd3be5b7de | |||
0b9a5c3441 | |||
7431c4d611 | |||
ec78dd60fc | |||
b479eec758 | |||
413ace2eb1 | |||
d8390ef77f | |||
e7e56e175a | |||
e875b9cdca | |||
66197b18b6 | |||
ed991f79b1 | |||
48b70f358d | |||
56adbda2dc | |||
7dbc78c95f | |||
3ffa1e35e8 | |||
114fb4219b | |||
4d7d66bc1f | |||
e134d2e5a5 | |||
cca84761a5 | |||
c2a5d6f61b | |||
4449007bb4 | |||
30cd1e84bc | |||
dcf872b485 | |||
c9d51ca775 | |||
96c9f8058b | |||
a3f4bca14e | |||
e55f2dd3b9 | |||
247566ca1d | |||
aa120e0902 | |||
5c7992beef | |||
6a615f30dc | |||
bfea41b771 | |||
a2465e0670 | |||
57044ea9a0 | |||
1392be2952 | |||
9e503aa69c | |||
a004389f25 | |||
d474261912 | |||
144e959cab | |||
626488e659 | |||
5bae5574f0 | |||
ce14d6d9db | |||
519addf6ac | |||
fd87468e36 | |||
75e49610cb | |||
414fe75d02 | |||
26031eb761 | |||
be801dff5f | |||
5fd47ed742 | |||
f7f2f50435 | |||
e0bb15e572 | |||
0e4171a87c | |||
34cb92ff4c | |||
22eea750f3 | |||
c3afe1a83a | |||
904ceba6b2 | |||
a28d639c3b | |||
c0652bcd8f | |||
54dc0fd123 | |||
c22a00afee | |||
2c3ec7846f | |||
46db9edacc | |||
4e6fa56c87 | |||
8970e17911 | |||
ac6c808124 | |||
26d3b1929e | |||
a29507e452 | |||
2c073fb005 | |||
d9c3b83d1e | |||
f5e58c500f | |||
5e865f5bc4 | |||
01a1255967 | |||
dd80f39049 | |||
19e4c953ef | |||
ef218c95fc | |||
eec9dba855 | |||
f46a165886 | |||
ec47bd1604 | |||
bfd4016c1c | |||
63cdb1848e | |||
10a0762fe7 | |||
76472b86ed | |||
edb96cde70 | |||
e06ecb8f0c | |||
2791d948e9 | |||
360e6e790a | |||
d0807c8276 | |||
75d0362cd8 | |||
4f7c554d8d | |||
8b81f23caf | |||
0098c2b7f7 | |||
f0e03b5e82 | |||
be2f1001a5 | |||
cf08b4d56a | |||
04074f883f | |||
14d3235f1a | |||
e00c1cbd20 | |||
3df3f0d9dc | |||
985db40547 | |||
c9fa0fdff0 | |||
fe69ea305b | |||
ff9088e42b | |||
f556cdf0ca | |||
c671ff74c6 | |||
04570ac783 | |||
6ab25cd791 | |||
a04350f7ce | |||
b7018de7e0 | |||
d212d57466 | |||
c4e7d8ed8c | |||
464813ecbb | |||
9812771dcd | |||
6f605598de | |||
85bc8ccccc | |||
e756c2dbce | |||
e82fe14f00 | |||
de65739c01 | |||
e1ec89a133 | |||
bdb3410d9d | |||
168e0b5a42 | |||
f906cfe5f6 | |||
9faac81a37 | |||
b90e7eb95c | |||
1e286e43ad | |||
539993b4f4 | |||
1363d30f79 | |||
3a48daaa64 | |||
d2b4a65e65 | |||
1ead290c23 | |||
6658660355 | |||
85ab019987 | |||
460cda2aa1 | |||
2d913578e1 | |||
34831796f6 | |||
8754b2767c | |||
04fb688f7d | |||
58dbd285fc | |||
cf6f149888 | |||
8d017ceaf1 | |||
02428019fa | |||
b4464929cb | |||
3ea22f8b0e | |||
9745e97e14 | |||
6c6e182ecc | |||
7973dd45b7 | |||
a1837dde68 | |||
4448b65a18 | |||
2231c23c4d | |||
f17fc43d6e | |||
f9dbe56785 | |||
8845a2170c | |||
a4b1ebd8c3 | |||
66adeef9bd | |||
20769f68a7 | |||
e92719b98d | |||
59246babea | |||
23e86d7dd5 | |||
c99e8eb29d | |||
7949397958 | |||
1d1359b58f | |||
8915bb4892 | |||
6a117ac12f | |||
67689f1a6d | |||
48b83f1ffd | |||
7da0f398a5 | |||
7e277fdd4a | |||
5d10d8566b | |||
a10295f584 | |||
46cf9faa11 | |||
971341bb53 | |||
2b2a235a49 | |||
970b9deeaa | |||
fd256b624c | |||
698fb64be9 | |||
9561f77b17 | |||
c3d3d346d4 | |||
e43fe98263 | |||
04dbf15d9b | |||
de72065a4a | |||
a1bb0ec738 | |||
1a33cd9584 | |||
00279dbd04 | |||
eb759cf22f | |||
ae16da4e81 | |||
965287e724 | |||
3d5312e8d2 | |||
bc91b7dcae | |||
4d77eb94ff | |||
1b8d03f945 | |||
de2dcfeb99 | |||
c7196a519f | |||
0d82ce5210 | |||
3ce9ad05b3 | |||
ab75faac74 | |||
9e25e13218 | |||
69e1503c6d | |||
7eaf231e56 | |||
a347a72091 | |||
560daec913 | |||
d9e968d863 | |||
556d5d181e | |||
4e4092f9e8 | |||
fd62aba71c | |||
ef0aa65774 | |||
6b5f9a647a | |||
01c07fbea1 | |||
81929c2a92 | |||
d9ff8e3122 | |||
0c4692ae58 | |||
df56ff4f09 | |||
96cdc9c4eb | |||
3b4ad5cd7d | |||
317c6b77f3 | |||
e5f5a2adaa | |||
594c3174ab | |||
5b7e4bb4a7 | |||
f7c0f826d4 | |||
66af7de6d6 | |||
d1815a36d0 | |||
61de3de909 | |||
36888a34d6 | |||
646435ee3e | |||
cbb8d5b0dc | |||
ebee01b355 | |||
0e3795b2f3 | |||
de73128d47 | |||
281b0a3e63 | |||
c414f9ac9d | |||
77242cfec0 | |||
8ebbba6eb8 | |||
0804cefbee | |||
2404d2935d | |||
e6f5e21b5d | |||
c303c6b5c1 | |||
f58e8f2a35 | |||
ededba0c6d | |||
e112fa92fe | |||
7524210d1f | |||
201dc05416 | |||
2b34978993 | |||
447246da74 | |||
1cf2bb6646 | |||
de1eafb564 | |||
22f0099a5d | |||
300eb87016 | |||
aa38b16368 | |||
266bfdf739 | |||
19ef6b0421 | |||
75570b7995 | |||
3290bfae68 | |||
0805d7a35f | |||
11278a0814 | |||
86de6f5861 | |||
498b023989 | |||
5265884af9 | |||
cdbe0bbf38 | |||
feef35a8ca | |||
3ff51da529 | |||
496e9f7b16 | |||
0b30dc29a5 | |||
15b4d29e70 | |||
9eee4b7687 | |||
196f6c241a | |||
c9296191a8 | |||
c7b4022283 | |||
a7ecc4cdd6 | |||
df5298d59c | |||
b79d17332e | |||
675572a41a | |||
0078fe9349 | |||
dc004f6eb7 | |||
07f1a05ab4 | |||
54292a99af | |||
f5933c8cb8 | |||
6700f86145 | |||
b31d22488e | |||
6382eeb8fd | |||
b07345a55c | |||
06febdce22 | |||
c31d9d5e3d | |||
cda8a545f1 | |||
f850e92524 | |||
cc9d53e038 | |||
7b048fc092 | |||
4ba4a501fd | |||
2b2cce6896 | |||
c1f51a7bf3 | |||
465556f0d8 | |||
db7ac5208a | |||
cfcd1bc014 | |||
e63f7e8779 | |||
7911154bad | |||
ec0730f3e5 | |||
76005f5adf | |||
94493cde35 | |||
a1f68720e5 | |||
022376dd56 | |||
934e5aacab | |||
35b142f23f | |||
41c3795a7b | |||
95d7099133 | |||
33dc9abb9b | |||
5e4edac14d | |||
cb5ae92986 | |||
ebbd295ebe | |||
65d23fb9a3 | |||
ad6d986172 | |||
985641cc2e | |||
de0a714081 | |||
3f942302d1 | |||
96396163cf | |||
0c736c4561 | |||
33ad9d1035 | |||
d57658d059 | |||
031206cf1f | |||
12c7cc278d | |||
9d3750b9b8 | |||
ba4b9f229e | |||
850fe98cbb | |||
8a9e3e0df2 | |||
a277569d31 | |||
7ed9516884 | |||
ecff2fa2b7 | |||
e49b94658c | |||
e4f1572a3a | |||
b5b13322d8 | |||
c25e7f3c41 | |||
f6a2c92bfa | |||
ed17418101 | |||
5264f39209 | |||
de69c719fb | |||
ab3173487d | |||
a3fcb8c284 | |||
ba92cfa064 | |||
6bee51ed33 | |||
122bca49ea | |||
19318a1eeb | |||
a7a46bbe1c | |||
3d26224180 | |||
940ddb104c | |||
5617f91281 | |||
a9a863aab4 | |||
ca26347dea | |||
41a14e808e | |||
6452501275 | |||
b61ada72cc | |||
ace42d845c | |||
850b6f28e5 | |||
3c81e9f0e7 | |||
e20ea19f34 | |||
ce041a3190 | |||
3a01aaf7fb | |||
ec4a2aae95 | |||
de8a66d4ce | |||
dc3d3acb3b | |||
48d6eb168f | |||
6190d6c962 | |||
76616dc98c | |||
82c2f5221d | |||
a3bbb7be14 | |||
9e1a2cfeac | |||
c6fabe504a | |||
61a17d7fab | |||
865cfa5211 | |||
e2b857adae | |||
f3924ccd91 | |||
86e3e59530 | |||
02e4726ba6 | |||
66e470e073 | |||
afaa5c24d6 | |||
518282e169 | |||
d955adbbad | |||
83d3225e57 | |||
6fa45975bf | |||
e6087efb40 | |||
4ce2f80a2f | |||
0862d1c804 | |||
333e380340 | |||
58f77a19ed | |||
f2d883dab2 | |||
7ba8c7c2b5 | |||
0bf6c93faa | |||
b9f0158278 | |||
25ee41f344 | |||
5436634829 | |||
915524e1ab | |||
d579cd1605 | |||
cb5941ec55 | |||
a5ac183d86 | |||
a36de92bb9 | |||
01f9d551f1 | |||
399df66b18 | |||
723a1c843a | |||
e333263fd6 | |||
507df9eea1 | |||
a9a3687ea0 | |||
f05c649c61 | |||
a2dfba1842 | |||
c199da4dfa | |||
ee9033e12f | |||
54788d750e | |||
78e894c6f2 | |||
32107ba8b5 | |||
6122f65e7a | |||
43fd29f9bf | |||
54c624b356 | |||
8c33adfd29 | |||
2e8881b77c | |||
64aa729edd | |||
ccf95b738d | |||
b2847fedd3 | |||
8befcb9bba | |||
988fc52303 | |||
7293ddb22c | |||
f23c118e81 | |||
f68b3be35a | |||
3d95e7bb11 | |||
337c484f01 | |||
5d98e2bf04 | |||
6f300d0cc6 | |||
3422e1dca7 | |||
963c6ae567 | |||
6304169926 | |||
221afde55e | |||
0ae87270ad | |||
9d33baec70 | |||
0f37b22cdb | |||
47afd87e84 | |||
700c06023e | |||
4fea5b5ca3 | |||
521bddc1cc | |||
bdfff20ec2 | |||
bdd05aba3b | |||
89c2538ff1 | |||
7680819108 | |||
d79e8b84c9 | |||
731317230a | |||
5046938913 | |||
0e8fd45559 | |||
6099a5dbc3 | |||
2daa98a694 | |||
5d2c6496fa | |||
817dbbe73f | |||
29c89c82f8 | |||
0b714bd479 | |||
8c94a5afb9 | |||
aeb117c9d1 | |||
a2d4f133b7 | |||
b833aff3c8 | |||
6601e4ddba | |||
815da2d0ec | |||
ddd35b3653 | |||
8a32894c83 | |||
49d8e6da40 | |||
8089f24c81 | |||
b6aab53d10 | |||
55a4517cd1 | |||
b095319a16 | |||
5ea5806730 | |||
bfbf812148 | |||
168e9eeac1 | |||
dd79c1a79a | |||
fe3402589b | |||
74dcaff21c | |||
0a7968a2e5 | |||
00091a2acb | |||
c5aa834b6a | |||
b1bde46694 | |||
49e4fa494e | |||
4622c52b71 | |||
e9ac5dd5f4 | |||
7570c43d11 | |||
4332e7ec49 | |||
9f26f1e225 | |||
0c0319c415 | |||
c16dbd7607 | |||
7b1f10a5fe | |||
dce74749b7 | |||
1ba88b8c42 | |||
9c50b57d46 | |||
900bd3ee97 | |||
b4affe00a7 | |||
ca49c84bc1 | |||
2cddf60226 | |||
d9c3951f02 | |||
aa5997d975 | |||
c51acf7c2a | |||
348044bc8a | |||
7dbdf2aa07 | |||
c933731ead | |||
e7da715994 | |||
6d82aefad4 | |||
8a11ab7d96 | |||
f465086405 | |||
70313a8b79 | |||
71679c38be | |||
addd943074 | |||
0b8470421c | |||
bcf7c0f006 | |||
2b87bb015c | |||
07e10fa03e | |||
bf992989c7 | |||
00400e354d | |||
19a49d34ce | |||
e8badac282 | |||
282a60fcab | |||
e76a28ded5 | |||
b22543ab66 | |||
d5165cdc08 | |||
1c0549f468 | |||
a7316b0594 | |||
634eeaf74c | |||
1299e196be | |||
92c325230d | |||
827a466a5c | |||
89b38b1361 | |||
140de6dd60 | |||
e64ff5832e | |||
17b1543d44 | |||
043e79a570 | |||
5d036e3d54 | |||
9d2a638988 | |||
7943993fcb | |||
026ddc2d9b | |||
384c7e2c17 | |||
700f706428 | |||
0a4deb2a9b | |||
5b8abe6809 | |||
2c5005c1ea | |||
c2b3022163 | |||
644abb2dc9 | |||
48b53c30f7 | |||
bf3818eb22 | |||
b3358aeed7 | |||
a7d4c7d8de | |||
369c1b0a41 | |||
21636f3f29 | |||
bf428312d7 | |||
6218209dcb | |||
1b7ead3455 | |||
3a252a1b41 | |||
fc7e6470b5 | |||
3813a03117 | |||
e59c29993c | |||
92d2ebc3f9 | |||
67ef448471 | |||
207abe9a2c | |||
05863227a6 | |||
ac05cb323c | |||
066d44636a | |||
3dbf06420d | |||
1983097d3a | |||
1c60aa58ae | |||
1626d9f9a4 | |||
c7182589d2 | |||
ceb17dc713 | |||
46c0360b03 | |||
0ebddfcf50 | |||
36d20eb1b8 | |||
db4b266874 | |||
63cf470e07 | |||
1f87eb4157 | |||
9bb9999b46 | |||
60e6349963 | |||
581d1c5db1 | |||
cf0b6dda25 | |||
8a5faa3d2e | |||
09607787cc | |||
0aad74a670 | |||
985f28bbea | |||
22e1abbaff | |||
21e8097b9c | |||
14d267c246 | |||
9420174477 | |||
fb4878bb7c | |||
c856cbb523 | |||
2e42eb6bad | |||
4f87e86603 | |||
3c6737f738 | |||
b2bc73c3fe | |||
30ca25e978 | |||
ecdd0875df | |||
d05d748fe2 | |||
8db193a172 | |||
c064973c9d | |||
01c66eaf0c | |||
c2fdec188e | |||
d7e2b0a771 | |||
06354a8c9a | |||
7c25dead17 | |||
f4d3153e91 | |||
7030d59b2f | |||
6eae036ac3 | |||
b6b6ed0e2f | |||
51b5825665 | |||
1c2629595e | |||
e91f4e88b5 | |||
bdb7dbdd00 | |||
7092521253 | |||
47f7fcd4fe | |||
93a004b016 | |||
2fad9d73d4 | |||
252eb24522 | |||
b7964e9efb | |||
23e7a9e710 | |||
36804a60c9 | |||
73270345f5 | |||
e1ffe06709 | |||
3dd240bdbb | |||
b58425d7d7 | |||
a197ce6f53 | |||
9dcdaf05b5 | |||
c827cccdf3 | |||
6805f2d71e | |||
0ea690a2f2 | |||
d68ff69c7a | |||
f1f2bc28a2 | |||
5f0389c07c | |||
c2f304f3bc | |||
ce9c1a1f7a | |||
203382e007 | |||
d2ba9eb967 | |||
59ebec25f3 | |||
b864b03a65 | |||
c7a37660ce | |||
02aae631d8 | |||
d542f63d3f | |||
74694a6e23 | |||
a5baeac428 | |||
e23e04953c | |||
fa9f923697 | |||
797e201946 | |||
156a642d28 | |||
96379b7517 | |||
9b5bb62aa7 | |||
895745ac14 | |||
6cde2d8db4 | |||
a277f8e0e1 | |||
cf5c5d06e1 | |||
722f45fa58 | |||
c97390b9c6 | |||
124c461a56 | |||
4ac352637c | |||
00cf62acfb | |||
ee0c2a1152 | |||
f32ab20267 | |||
1316f93b21 | |||
52d72fe8a1 | |||
0406aaa591 | |||
8f56660cfc | |||
402cc6b90c | |||
b8c14ad64e | |||
1f9c83d88b | |||
319667a25c | |||
b047a37a80 | |||
31af220483 | |||
40d51ea59f | |||
284cf83935 | |||
5ba04a7478 | |||
2b87051022 | |||
a901f2dc5d | |||
bd6f1f2c6d | |||
ca612872a6 | |||
feb33a6a28 | |||
ff92d962f3 | |||
79ca0d579c | |||
c61ac862ba | |||
64ce622f83 | |||
772638c78e | |||
24badb46fe | |||
87d54b37e4 | |||
98aa61e2a4 | |||
bea5c6f4e6 | |||
7d29e691a4 | |||
b0d161faad | |||
4c74fa81d1 | |||
556a3e08db | |||
e3fb77c051 | |||
3ee07d0e82 | |||
72c486cb3e | |||
e37574510e | |||
f4b58f35ba | |||
01696f19e8 | |||
1f5a27d5c5 | |||
81476dedcb | |||
90b08acbf1 | |||
f967fd21f8 | |||
8d854d5f1a | |||
fde5932b45 | |||
eb84227f78 | |||
550d595034 | |||
24cc4b49d6 | |||
5f130d1925 | |||
4f05787338 | |||
a98db33c18 | |||
a5d78f2943 | |||
46ebe9ffc5 | |||
e2b80658ca | |||
0a586c5c92 | |||
aa5d352a06 | |||
760da64a4c | |||
714ffc5ef1 | |||
fd4d645687 | |||
24ad59ea37 | |||
15f881f967 | |||
d5285674ae | |||
bb862e20c0 | |||
be3eb308b9 | |||
e7f0b1dc59 | |||
336cec8b2a | |||
fad0b96f24 | |||
d2aab9d6a6 | |||
4005863e3d | |||
70cdb67f31 | |||
a9aec6956d | |||
d871eda6be | |||
49d620a414 | |||
2e2e3281da | |||
37cbfe29cf | |||
a1f88fc17f | |||
0065da61bd | |||
d2b0706c40 | |||
a95e585e39 | |||
7d39fa76dd | |||
ddf27c1a84 | |||
87e46f3ff1 | |||
33a6fda6c3 | |||
7cc1bdb35d | |||
60557f4e0f | |||
914441218a | |||
e322d98886 | |||
ba1e5f8f71 | |||
517075c605 | |||
540e970170 | |||
d0fd5641c1 | |||
caaa21dec0 | |||
22c606326f | |||
00ed2973b2 | |||
3837fc0a87 | |||
07b95d3436 | |||
1f5dd9c397 | |||
007736a234 | |||
c2a9f7fbb2 | |||
b18cc8de86 | |||
30e4f80894 | |||
dd8a53d5e0 | |||
0f01928402 | |||
a8b081661c | |||
c892610f27 | |||
72dad591fa | |||
ea19790828 | |||
cc2f5d19c8 | |||
64b2c5d1b4 | |||
a9f728d2a7 | |||
3736d81d8f | |||
fbcea03ab3 | |||
f19ee78fb2 | |||
b47fd6df31 | |||
786beccca5 | |||
916c62a702 | |||
11234c7cfc | |||
80eac7370e | |||
ac78a1e1c0 | |||
34c6ff9645 | |||
f6749fb204 | |||
89fe43f70c | |||
e2c66ce48a | |||
eb0d803617 | |||
53d9ea7a2c | |||
0fbdd0b67f | |||
f248aa69dc | |||
9f1ed13a38 | |||
9400d8f6db | |||
c7a4b307af | |||
0bac3a5dd7 | |||
14b92a4897 | |||
66bd8b553f | |||
e80462a2c3 | |||
b990ed2c23 | |||
097e56f4ab | |||
7a4b6138c1 | |||
bc918d0d18 | |||
8b08d8bf2d | |||
d92c97f755 | |||
6a367917f7 | |||
b67138b5ae | |||
0e5177c329 | |||
c6ed3cdb61 | |||
fd99d13f04 | |||
36c3ce9333 | |||
aee28616a9 | |||
70830560ae | |||
df6cd46bd6 | |||
dce797f4d9 | |||
f3232901d8 | |||
d3e4f44d37 | |||
d81958a074 | |||
92ee17493c | |||
f9e456bb47 | |||
740388c778 | |||
1c0c42e8e7 | |||
e2726f3e38 | |||
ed465a6ffe | |||
fd8f3df2cd | |||
0c2037875a | |||
fbf6e032d0 | |||
c8020e6559 | |||
68b7e8437b | |||
6528f8366f | |||
88eb246b60 | |||
bed50688d2 | |||
44686bac3e | |||
ca575ef0ae | |||
c20503028a | |||
4516e4cc3b | |||
b2ec340f9e | |||
570a029f27 | |||
ebe72e197d | |||
ce629b09b2 | |||
97c2db1cfd | |||
c5804c1929 | |||
92276c5e70 | |||
62c0088dd8 | |||
e8498adaf1 | |||
c7fa719cc3 | |||
41f0e133a9 | |||
7705a65beb | |||
604e8f4f8a | |||
de0116d8c8 | |||
8d968e5c9b | |||
758e573483 | |||
eab4f4c963 | |||
245c58842b | |||
e508635c6e | |||
138b8cf874 | |||
d446b657f3 | |||
019dd2e1b0 | |||
602da771f6 | |||
5de8a0a84b | |||
d2198925e1 | |||
44e02003ad | |||
e8bfd990e4 | |||
d1fc87577a | |||
8b4c1a80d0 | |||
6ca0d4a5ef | |||
d0cd6ba47d | |||
aa2a63bd84 | |||
daa380fb0e | |||
61e2e04f13 | |||
db7e4ddc04 | |||
c4aa277b19 | |||
ab29ce872a | |||
57beb0ade1 | |||
e3d0b6f90f | |||
e2aa954cb5 | |||
05c285a945 | |||
27b34992c6 | |||
4886238761 | |||
42d46aed90 | |||
a622aba7eb | |||
831099cca5 | |||
b8a54faf94 | |||
80ff6ff797 | |||
2f27b94757 | |||
b2f33e2895 | |||
d1d4142052 | |||
46caf6d673 | |||
2864c360bc | |||
e5dfc6323a | |||
5bc042ba6f | |||
c63fe5ee24 | |||
ee6bc33cea | |||
5c730dc53d | |||
5a3de8d663 | |||
fad88dd517 | |||
39dd24310d | |||
b13809d0c7 | |||
87559414a3 | |||
b5b5759829 | |||
d254e2e1f2 | |||
458b0b22fc | |||
cd30128af8 | |||
d61cdd8cea | |||
0d0e545979 | |||
6c5e96c33a | |||
bae2359b54 | |||
8cbbb456f0 | |||
dfd39461cf | |||
60d8683ae7 | |||
f2cc5cf152 | |||
d4a26fbf4b | |||
025784fd83 | |||
4e89a5edde | |||
b3936ecadf | |||
2c9e6bb589 | |||
73261a4a66 | |||
3d0dd38045 | |||
8bcbf3030f | |||
1bc7edc5d8 | |||
0673720db9 | |||
730a0d4c5a | |||
9147dee0de | |||
12746a1949 | |||
bdd65fe755 | |||
21e2280825 | |||
e9d2a429eb | |||
b67dfb9edf | |||
55308917f9 | |||
1b64b09532 | |||
74dd298891 | |||
5a85fc0e55 | |||
26991988cb | |||
15563444cf | |||
3bcdba6e1d | |||
ef56a78544 | |||
049a561466 | |||
b40b19997a | |||
46505a8314 | |||
78fb102002 | |||
c6e924f788 | |||
f6508b51a2 | |||
b0ae596de8 | |||
1d311e7916 | |||
0c19f71c96 | |||
8d6ab32b9a | |||
6c1a2d531f | |||
c6e9f9742b | |||
d23aaf3cea | |||
017fde91ad | |||
31ffc5a85d | |||
62b65a25d8 | |||
882fe48d80 | |||
90a691ed25 | |||
eadb41b3bb | |||
6829590c8f | |||
29da720e6a | |||
c5932c0f07 | |||
6195386a06 | |||
0080440118 | |||
b5be62cd1b | |||
1bac40fbe3 | |||
11637bae43 | |||
301bacec9f | |||
8943b3b0e9 | |||
f59018f2d7 | |||
235cb9c505 | |||
3f328463a8 | |||
e58c82fc04 | |||
91ca86ffe4 | |||
33d4518e50 | |||
b087191d2b | |||
64baea1693 | |||
b88b743428 | |||
c606cf076d | |||
d205d7e7c2 | |||
efdd3375d0 | |||
abcca3d3bc | |||
f4d13b9801 | |||
7da39031e1 | |||
6cdb1bd60c | |||
7c108e267c | |||
5cf06fe9a7 | |||
41f6956197 | |||
417cbea79c | |||
225c807550 | |||
ff78d2655b | |||
bde15f7c61 | |||
30300f1aeb | |||
d42c3a15d6 | |||
14a65559af | |||
ba1e7bd095 | |||
951705a4b2 | |||
36bf63a5de | |||
66c4881fd2 | |||
c6b169cb33 | |||
0e753ed5a6 | |||
785969feb5 | |||
56036476a4 | |||
936b1b5638 | |||
bf3b94d654 | |||
90b4a0856f | |||
686190ce80 | |||
45495c2474 | |||
9caa88fecb | |||
25948f214e | |||
bea4faacd4 | |||
a7bd9f811b | |||
2b9561fcbb | |||
7b9c9b2f7d | |||
b47b82ed42 | |||
c4c2c11dca | |||
ce38293a0f | |||
6c4e9d23f2 | |||
4aa1fe9ca2 | |||
951fff5aa0 | |||
5ad8080cb9 | |||
e53e3cbb09 | |||
8a029f333f | |||
4debedb275 | |||
8764253861 | |||
bbdce159fa | |||
087d8e602e | |||
50aa15dec9 | |||
26580f8f2c | |||
875b6d131b | |||
77afd6782f | |||
09ab13cf04 | |||
56f312dc03 | |||
f2cbddc196 | |||
c7846e172f | |||
54afb7b25e | |||
f3cb9d0443 | |||
fcee7f2f3a | |||
faff0738eb | |||
69e26c6dee | |||
1acec65c5e | |||
8a6a3968c3 | |||
58e4870cb8 | |||
102099cadd | |||
efe6d06ddd | |||
f0d0e025dd | |||
fc2d0215f5 | |||
02af8eb824 | |||
102f2a91f9 | |||
2c649d5da5 | |||
7fa7d04ed0 | |||
aad9179373 | |||
d5b4e30eb7 | |||
34ba6f2f71 | |||
d845f40b98 | |||
80c16aa8f7 | |||
0cbaeaefed | |||
ab6a7773ce | |||
85e243982b | |||
6eb168bc68 | |||
47b55e29d4 | |||
2c243b678f | |||
a634f25d30 | |||
26df6cf35c | |||
84dde8e9bb | |||
f2c79be11a | |||
10df80b96a | |||
bbb83656bf | |||
ef49670ae4 | |||
e4df00c77d | |||
3d70662716 | |||
8d0638a187 | |||
06143396b7 | |||
17c46c2452 | |||
0996174b3d | |||
d6b6f814d3 | |||
987099ea55 | |||
b356aa8e3b | |||
566bdb50c2 | |||
2b57603271 | |||
c3528f5b6b | |||
4c7cc94cdc | |||
5ff2285707 | |||
d714dfd82e | |||
b1064cbe50 | |||
8d3e5ea507 | |||
001b6afc7e | |||
55d6c5ea8f | |||
fa2ff8158f | |||
97e7ea0b5d | |||
65dec2b72a | |||
5fd3ca8d09 | |||
dc9a8d505d | |||
fc8d13f4bd | |||
d1aa7de5d0 | |||
e279ef1c7c | |||
b88657ab83 | |||
d20e646ed6 | |||
8678b87120 | |||
960571a589 | |||
d856338f86 | |||
2b6b2d93a9 | |||
363bd04166 | |||
9bc1a68fe4 | |||
2c2729f7be | |||
9011959356 | |||
c79b8bbe7e | |||
da59eebf8e | |||
7854024326 | |||
a9ab8784c4 | |||
de5b00fd52 | |||
6547f75b12 | |||
827bf506a7 | |||
adc187c32e | |||
5350302b09 | |||
167ca75388 | |||
46cea67258 | |||
463e0919d4 | |||
98906c1da3 | |||
b71e66c335 | |||
2b6c5bb416 | |||
628e59894b | |||
703d2ead33 | |||
43f53a708f | |||
07e7331e7b | |||
c516af3130 | |||
39727d1156 | |||
85cd189a69 | |||
a8e35422f2 | |||
3941961f8b | |||
d9c6485cbf | |||
c52ccc76a3 | |||
be1c4f26b5 | |||
a6ee6739e0 | |||
54a8ad8bc6 | |||
2541bfcdf2 | |||
d7d5da0301 | |||
d2bd9efc25 | |||
779b18bf48 | |||
618a53b34f | |||
f4eaadb948 | |||
ea061b0f46 | |||
3652e42699 | |||
398489f661 | |||
70fc13500d | |||
18541c447e | |||
3294a6e1a7 | |||
38563c38e8 | |||
a465c5f996 | |||
1760ba1279 | |||
3d3c9546a2 | |||
203c5db5eb | |||
cf44234323 | |||
cc94076ffb | |||
8d137eae5b | |||
51fa9ae513 | |||
9951c92459 | |||
ee77e5d582 | |||
d74721f229 | |||
1aa97b19f7 | |||
95de48e986 | |||
a147d0428d | |||
90b3f7b7f6 | |||
c80acfda08 | |||
8a39145e3c | |||
b62f5ef07d | |||
bd5c6c5cd6 | |||
f874a57439 | |||
6a4525e554 | |||
d553a5bdc0 | |||
80076965a7 | |||
84e8d38d4c | |||
33f3f9d997 | |||
be72b1d066 | |||
dc5d2b83ef | |||
3dabe645c2 | |||
e9ede362dc | |||
01357aca35 | |||
c944dd6768 | |||
ff01ed5e4b | |||
d23c374326 | |||
a69ebc8a68 | |||
f4d8a35b9d | |||
2b140f8fb7 | |||
ab603bdbbf | |||
44e2f7f555 | |||
fd1b3b4fee | |||
4ae2a0b2a5 | |||
0cb415b3bd | |||
c1fa9a82e6 | |||
dde124ab5a | |||
668920cec4 | |||
9b38c5b304 | |||
e63c2da433 | |||
38c768fdb3 | |||
0dd4584157 | |||
b7bf712b97 | |||
615723d8df | |||
de352a309d | |||
c573e7f9a1 | |||
d59fd1a75d | |||
18d69d7032 | |||
5d25716cee | |||
840e79c18c | |||
ddf562e306 | |||
20a6ce7003 | |||
8c43298af0 | |||
4bb48e56d2 | |||
338ba10ca2 | |||
36eb745ecc | |||
b07e45e214 | |||
bba5198e63 | |||
9e2bab008a | |||
5ea032bbf7 | |||
897fadfb40 | |||
b05f71eb9b | |||
4ce0e80956 | |||
577ccc4d56 | |||
39d12351ba | |||
e37bc6d7f0 | |||
9593ff3582 | |||
ad8dfd7b04 | |||
ca5ab20f67 | |||
0eab448221 | |||
a26a77f9db | |||
c3df6bb8bd | |||
ce3a26cf37 | |||
04482c23c4 | |||
ff20fe856e | |||
12e3921f81 | |||
928fbee15b | |||
a103c028f9 | |||
775347d865 | |||
6d0be86a4e | |||
a4b69db8af | |||
790b9d3371 | |||
adef2009a5 | |||
1721db6d8d | |||
6d95e8b988 | |||
b07f9932db | |||
9439da81c4 | |||
6257e64d03 | |||
ba110f2d2e | |||
6bdf621d05 | |||
1c4db98c95 | |||
dadac957e4 | |||
cf3976d496 | |||
82ed80c9c3 | |||
67222525ad | |||
fff0861773 | |||
13ffe41498 | |||
96e0528a7b | |||
3df30fbd57 | |||
b57d8b336b | |||
3169b2c440 | |||
6bc34e0f32 | |||
cecb1a41fb | |||
b9069df85c | |||
aee3c6f041 | |||
c427bba9f1 | |||
da83ad561b | |||
85520e34ab | |||
d0edd970e1 | |||
8529ca70af | |||
1a8d78212f | |||
4270a2806d | |||
4333bdc709 | |||
75b824d032 | |||
7bc2573d85 | |||
67b7b7a950 | |||
786cfbd397 | |||
9df8b583cf | |||
8e32290dc9 | |||
23478f3336 | |||
2e244ecb63 | |||
e307680206 | |||
6bb1a3e2c4 | |||
8a1ac6b13f | |||
61b8af2252 | |||
c99afed012 | |||
2947b92148 | |||
39c5d23a87 | |||
d839670f54 | |||
0d1b7e15d1 | |||
ac678f63ee | |||
d862c0879b | |||
23a4d4c69e | |||
472b20d933 | |||
492dd718fb | |||
0d5618fdd1 | |||
503508af41 | |||
4ec5e55122 | |||
8daca865ca | |||
f9b37a21e8 | |||
c398f319fc | |||
1e049f88b8 | |||
4831d9c3a3 | |||
f13f5bc1bb | |||
4e114107ed | |||
0ccb280008 | |||
28c3e0693e | |||
c321c8a02f | |||
2407ec7b47 | |||
70eeb75716 | |||
751d250471 | |||
c28217db80 | |||
0968e556fa | |||
130f2cf808 | |||
4eec7413c7 | |||
efc3246d26 | |||
9930dbc0ff | |||
754f87dac3 | |||
51139bd096 | |||
6e0119d620 | |||
a3528bf973 | |||
77c36af588 | |||
69c0a52a33 | |||
a7442cd0a5 | |||
d47a013931 | |||
745f9c0e6e | |||
414f49fd80 | |||
e49a595f54 | |||
77485c2a04 | |||
e9b28634e5 | |||
b43dcb8876 | |||
f0c1eeece8 | |||
1e6b824ede | |||
1e2d16273c | |||
32dc24c59b | |||
7a8a189c48 | |||
6aa411fecc | |||
9c76318df8 | |||
6510904711 | |||
a9817f4832 | |||
9067689839 | |||
4e9e91fdce | |||
73cc91ba60 | |||
0ab0d0860f | |||
337b399a75 | |||
46f21e81e3 | |||
c1300ddbbc | |||
8bd5b1e696 | |||
40c5db397d | |||
8b52919b4d | |||
2859f23038 | |||
00384ccb47 | |||
0191cc589a | |||
dae6db9b51 | |||
4d912c9feb | |||
07c4b46466 | |||
e9cdce49a3 | |||
84c3ce8778 | |||
d5a32a7fe4 | |||
cc4dfda21b | |||
703b37aa7b | |||
b433de9022 | |||
0c1a22ff95 | |||
4d526e40c3 | |||
4586c7b36b | |||
3d60b73b60 | |||
4ef5cd8ef6 | |||
6959bd19f1 | |||
17e4ce5ea8 | |||
33094b4988 | |||
a8fdcffd44 | |||
5adb5411fa | |||
ff0d11c89c | |||
5f6dce2b5c | |||
a7405e8b39 | |||
d87c520bad | |||
24959f8d34 | |||
6d1432e166 | |||
2c7ba2c125 | |||
a0ba664c64 | |||
131da5f523 | |||
7c6144450a | |||
4c7369db16 | |||
f4355de896 | |||
4a3db9f44d | |||
6c0a9ff9cc | |||
57b1695fcf | |||
045c6546cc | |||
ce5bd954bf | |||
6ef00a4a3b | |||
569d9718a0 | |||
00a3a8697f | |||
c93444e390 | |||
5e5788ab14 | |||
abf57e6362 | |||
74c2074d5a | |||
b74606312e | |||
0c849df4d5 | |||
38690d4a09 | |||
b64c237cb3 | |||
3fbee8e027 | |||
a68e6e3c63 | |||
db5a72774d | |||
966f90f24a | |||
eaa664c023 |
24
.gitignore
vendored
@ -16,23 +16,43 @@ config.log
|
|||||||
config.status
|
config.status
|
||||||
config
|
config
|
||||||
configure
|
configure
|
||||||
|
data/50-gnome-shell-*.xml
|
||||||
data/gnome-shell.desktop
|
data/gnome-shell.desktop
|
||||||
data/gnome-shell.desktop.in
|
data/gnome-shell.desktop.in
|
||||||
|
data/gnome-shell-extension-prefs.desktop
|
||||||
|
data/gnome-shell-extension-prefs.desktop.in
|
||||||
data/gschemas.compiled
|
data/gschemas.compiled
|
||||||
data/org.gnome.shell.gschema.xml
|
data/org.gnome.shell.gschema.xml
|
||||||
data/org.gnome.shell.gschema.valid
|
data/org.gnome.shell.gschema.valid
|
||||||
|
data/org.gnome.shell.evolution.calendar.gschema.xml
|
||||||
|
data/org.gnome.shell.evolution.calendar.gschema.valid
|
||||||
|
docs/reference/*/*.args
|
||||||
|
docs/reference/*/*.bak
|
||||||
|
docs/reference/*/*.hierarchy
|
||||||
|
docs/reference/*/*.interfaces
|
||||||
|
docs/reference/*/*.prerequisites
|
||||||
|
docs/reference/*/*.sgml
|
||||||
|
docs/reference/*/*.signals
|
||||||
|
docs/reference/*/*.stamp
|
||||||
|
docs/reference/*/*.txt
|
||||||
|
docs/reference/*/*.types
|
||||||
|
docs/reference/*/html/
|
||||||
|
docs/reference/*/xml/
|
||||||
|
gtk-doc.make
|
||||||
js/misc/config.js
|
js/misc/config.js
|
||||||
intltool-extract.in
|
intltool-extract.in
|
||||||
intltool-merge.in
|
intltool-merge.in
|
||||||
intltool-update.in
|
intltool-update.in
|
||||||
libtool
|
libtool
|
||||||
m4/
|
m4/
|
||||||
|
man/gnome-shell.1
|
||||||
omf.make
|
omf.make
|
||||||
po/*.gmo
|
po/*.gmo
|
||||||
po/gnome-shell.pot
|
po/gnome-shell.pot
|
||||||
po/*.header
|
po/*.header
|
||||||
po/*.sed
|
po/*.sed
|
||||||
po/*.sin
|
po/*.sin
|
||||||
|
po/.intltool-merge-cache
|
||||||
po/Makefile.in.in
|
po/Makefile.in.in
|
||||||
po/Makevars.template
|
po/Makevars.template
|
||||||
po/POTFILES
|
po/POTFILES
|
||||||
@ -45,13 +65,17 @@ src/*-enum-types.[ch]
|
|||||||
src/*-marshal.[ch]
|
src/*-marshal.[ch]
|
||||||
src/Makefile
|
src/Makefile
|
||||||
src/Makefile.in
|
src/Makefile.in
|
||||||
|
src/calendar-server/evolution-calendar.desktop
|
||||||
|
src/calendar-server/evolution-calendar.desktop.in
|
||||||
src/calendar-server/org.gnome.Shell.CalendarServer.service
|
src/calendar-server/org.gnome.Shell.CalendarServer.service
|
||||||
src/gnome-shell
|
src/gnome-shell
|
||||||
src/gnome-shell-calendar-server
|
src/gnome-shell-calendar-server
|
||||||
src/gnome-shell-extension-tool
|
src/gnome-shell-extension-tool
|
||||||
|
src/gnome-shell-extension-prefs
|
||||||
src/gnome-shell-hotplug-sniffer
|
src/gnome-shell-hotplug-sniffer
|
||||||
src/gnome-shell-jhbuild
|
src/gnome-shell-jhbuild
|
||||||
src/gnome-shell-perf-helper
|
src/gnome-shell-perf-helper
|
||||||
|
src/gnome-shell-perf-tool
|
||||||
src/gnome-shell-real
|
src/gnome-shell-real
|
||||||
src/hotplug-sniffer/org.gnome.Shell.HotplugSniffer.service
|
src/hotplug-sniffer/org.gnome.Shell.HotplugSniffer.service
|
||||||
src/run-js-test
|
src/run-js-test
|
||||||
|
331
HACKING
Normal file
@ -0,0 +1,331 @@
|
|||||||
|
Coding guide
|
||||||
|
============
|
||||||
|
|
||||||
|
Our goal is to have all JavaScript code in GNOME follow a consistent style. In
|
||||||
|
a dynamic language like JavaScript, it is essential to be rigorous about style
|
||||||
|
(and unit tests), or you rapidly end up with a spaghetti-code mess.
|
||||||
|
|
||||||
|
A quick note
|
||||||
|
------------
|
||||||
|
|
||||||
|
Life isn't fun if you can't break the rules. If a rule seems unnecessarily
|
||||||
|
restrictive while you're coding, ignore it, and let the patch reviewer decide
|
||||||
|
what to do.
|
||||||
|
|
||||||
|
Indentation and whitespace
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
Use four-space indents. Braces are on the same line as their associated
|
||||||
|
statements. You should only omit braces if *both* sides of the statement are
|
||||||
|
on one line.
|
||||||
|
|
||||||
|
* One space after the `function` keyword. No space between the function name
|
||||||
|
* in a declaration or a call. One space before the parens in the `if`
|
||||||
|
* statements, or `while`, or `for` loops.
|
||||||
|
|
||||||
|
function foo(a, b) {
|
||||||
|
let bar;
|
||||||
|
|
||||||
|
if (a > b)
|
||||||
|
bar = do_thing(a);
|
||||||
|
else
|
||||||
|
bar = do_thing(b);
|
||||||
|
|
||||||
|
if (var == 5) {
|
||||||
|
for (let i = 0; i < 10; i++) {
|
||||||
|
print(i);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print(20);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Semicolons
|
||||||
|
----------
|
||||||
|
|
||||||
|
JavaScript allows omitting semicolons at the end of lines, but don't. Always
|
||||||
|
end statements with a semicolon.
|
||||||
|
|
||||||
|
js2-mode
|
||||||
|
--------
|
||||||
|
|
||||||
|
If using Emacs, do not use js2-mode. It is outdated and hasn't worked for a
|
||||||
|
while. emacs now has a built-in JavaScript mode, js-mode, based on
|
||||||
|
espresso-mode. It is the de facto emacs mode for JavaScript.
|
||||||
|
|
||||||
|
File naming and creation
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
For JavaScript files, use lowerCamelCase-style names, with a `.js` extension.
|
||||||
|
|
||||||
|
We only use C where gjs/gobject-introspection is not available for the task, or
|
||||||
|
where C would be cleaner. To work around limitations in
|
||||||
|
gjs/gobject-introspection itself, add a new method in `shell-util.[ch]`.
|
||||||
|
|
||||||
|
Like many other GNOME projects, we prefix our C source filenames with the
|
||||||
|
library name followed by a dash, e.g. `shell-app-system.c`. Create a
|
||||||
|
`-private.h` header when you want to share code internally in the
|
||||||
|
library. These headers are not installed, distributed or introspected.
|
||||||
|
|
||||||
|
Imports
|
||||||
|
-------
|
||||||
|
|
||||||
|
Use UpperCamelCase when importing modules to distinguish them from ordinary
|
||||||
|
variables, e.g.
|
||||||
|
|
||||||
|
const GLib = imports.gi.GLib;
|
||||||
|
|
||||||
|
Imports should be categorized into one of two places. The top-most import block
|
||||||
|
should contain only "environment imports". These are either modules from
|
||||||
|
gobject-introspection or modules added by gjs itself.
|
||||||
|
|
||||||
|
The second block of imports should contain only "application imports". These
|
||||||
|
are the JS code that is in the gnome-shell codebase,
|
||||||
|
e.g. `imports.ui.popupMenu`.
|
||||||
|
|
||||||
|
Each import block should be sorted alphabetically. Don't import modules you
|
||||||
|
don't use.
|
||||||
|
|
||||||
|
const GLib = imports.gi.GLib;
|
||||||
|
const Gio = imports.gi.Gio;
|
||||||
|
const Lang = imports.lang;
|
||||||
|
const St = imports.gi.St;
|
||||||
|
|
||||||
|
const Main = imports.ui.main;
|
||||||
|
const Params = imports.misc.params;
|
||||||
|
const Tweener = imports.ui.tweener;
|
||||||
|
const Util = imports.misc.util;
|
||||||
|
|
||||||
|
The alphabetical ordering should be done independently of the location of the
|
||||||
|
location. Never reference `imports` in actual code.
|
||||||
|
|
||||||
|
Constants
|
||||||
|
---------
|
||||||
|
|
||||||
|
We use CONSTANTS_CASE to define constants. All constants should be directly
|
||||||
|
under the imports:
|
||||||
|
|
||||||
|
const MY_DBUS_INTERFACE = 'org.my.Interface';
|
||||||
|
|
||||||
|
Variable declaration
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
Always use either `const` or `let` when defining a variable.
|
||||||
|
|
||||||
|
// Iterating over an array
|
||||||
|
for (let i = 0; i < arr.length; ++i) {
|
||||||
|
let item = arr[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Iterating over an object's properties
|
||||||
|
for (let prop in someobj) {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
If you use "var" then the variable is added to function scope, not block scope.
|
||||||
|
See [What's new in JavaScript 1.7](https://developer.mozilla.org/en/JavaScript/New_in_JavaScript/1.7#Block_scope_with_let_%28Merge_into_let_Statement%29)
|
||||||
|
|
||||||
|
Classes
|
||||||
|
-------
|
||||||
|
|
||||||
|
There are many approaches to classes in JavaScript. We use our own class framework
|
||||||
|
(sigh), which is built in gjs. The advantage is that it supports inheriting from
|
||||||
|
GObjects, although this feature isn't used very often in the Shell itself.
|
||||||
|
|
||||||
|
const IconLabelMenuItem = new Lang.Class({
|
||||||
|
Name: 'IconLabelMenuItem',
|
||||||
|
Extends: PopupMenu.PopupMenuBaseItem,
|
||||||
|
|
||||||
|
_init: function(icon, label) {
|
||||||
|
this.parent({ reactive: false });
|
||||||
|
this.addActor(icon);
|
||||||
|
this.addActor(label);
|
||||||
|
},
|
||||||
|
|
||||||
|
open: function() {
|
||||||
|
log("menu opened!");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
* 'Name' is required. 'Extends' is optional. If you leave it out, you will
|
||||||
|
automatically inherit from Object.
|
||||||
|
|
||||||
|
* Leave a blank line between the "class header" (Name, Extends, and other
|
||||||
|
things) and the "class body" (methods). Leave a blank line between each
|
||||||
|
method.
|
||||||
|
|
||||||
|
* No space before the colon, one space after.
|
||||||
|
|
||||||
|
* No trailing comma after the last item.
|
||||||
|
|
||||||
|
* Make sure to use a semicolon after the closing paren to the class. It's
|
||||||
|
still a giant function call, even though it may resemble a more
|
||||||
|
conventional syntax.
|
||||||
|
|
||||||
|
GObject Introspection
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
GObject Introspection is a powerful feature that allows us to have native
|
||||||
|
bindings for almost any library built around GObject. If a library requires
|
||||||
|
you to inherit from a type to use it, you can do so:
|
||||||
|
|
||||||
|
const MyClutterActor = new Lang.Class({
|
||||||
|
Name: 'MyClutterActor',
|
||||||
|
Extends: Clutter.Actor,
|
||||||
|
|
||||||
|
vfunc_get_preferred_width: function(actor, forHeight) {
|
||||||
|
return [100, 100];
|
||||||
|
},
|
||||||
|
|
||||||
|
vfunc_get_preferred_height: function(actor, forWidth) {
|
||||||
|
return [100, 100];
|
||||||
|
},
|
||||||
|
|
||||||
|
vfunc_paint: function(actor) {
|
||||||
|
let alloc = this.get_allocation_box();
|
||||||
|
Cogl.set_source_color4ub(255, 0, 0, 255);
|
||||||
|
Cogl.rectangle(alloc.x1, alloc.y1,
|
||||||
|
alloc.x2, alloc.y2);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Translatable strings, `environment.js`
|
||||||
|
--------------------------------------
|
||||||
|
|
||||||
|
We use gettext to translate the GNOME Shell into all the languages that GNOME
|
||||||
|
supports. The `gettext` function is aliased globally as `_`, you do not need to
|
||||||
|
explicitly import it. This is done through some magic in the
|
||||||
|
[environment.js](http://git.gnome.org/browse/gnome-shell/tree/js/ui/environment.js)
|
||||||
|
file. If you can't find a method that's used, it's probably either in gjs itself
|
||||||
|
or installed on the global object from the Environment.
|
||||||
|
|
||||||
|
Use 'single quotes' for programming strings that should not be translated
|
||||||
|
and "double quotes" for strings that the user may see. This allows us to
|
||||||
|
quickly find untranslated or mistranslated strings by grepping through the
|
||||||
|
sources for double quotes without a gettext call around them.
|
||||||
|
|
||||||
|
`actor` and `_delegate`
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
gjs allows us to set so-called "expando properties" on introspected objects,
|
||||||
|
allowing us to treat them like any other. Because the Shell was built before
|
||||||
|
you could inherit from GTypes natively in JS, we usually have a wrapper class
|
||||||
|
that has a property called `actor`. We call this wrapper class the "delegate".
|
||||||
|
|
||||||
|
We sometimes use expando properties to set a property called `_delegate` on
|
||||||
|
the actor itself:
|
||||||
|
|
||||||
|
const MyClass = new Lang.Class({
|
||||||
|
Name: 'MyClass',
|
||||||
|
|
||||||
|
_init: function() {
|
||||||
|
this.actor = new St.Button({ text: "This is a button" });
|
||||||
|
this.actor._delegate = this;
|
||||||
|
|
||||||
|
this.actor.connect('clicked', Lang.bind(this, this._onClicked));
|
||||||
|
},
|
||||||
|
|
||||||
|
_onClicked: function(actor) {
|
||||||
|
actor.set_label("You clicked the button!");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
The 'delegate' property is important for anything which trying to get the
|
||||||
|
delegate object from an associated actor. For instance, the drag and drop
|
||||||
|
system calls the `handleDragOver` function on the delegate of a "drop target"
|
||||||
|
when the user drags an item over it. If you do not set the `_delegate`
|
||||||
|
property, your actor will not be able to be dropped onto.
|
||||||
|
|
||||||
|
Functional style
|
||||||
|
----------------
|
||||||
|
|
||||||
|
JavaScript Array objects offer a lot of common functional programming
|
||||||
|
capabilities such as forEach, map, filter and so on. You can use these when
|
||||||
|
they make sense, but please don't have a spaghetti mess of function programming
|
||||||
|
messed in a procedural style. Use your best judgment.
|
||||||
|
|
||||||
|
Closures
|
||||||
|
--------
|
||||||
|
|
||||||
|
`this` will not be captured in a closure, it is relative to how the closure is
|
||||||
|
invoked, not to the value of this where the closure is created, because "this"
|
||||||
|
is a keyword with a value passed in at function invocation time, it is not a
|
||||||
|
variable that can be captured in closures.
|
||||||
|
|
||||||
|
All closures should be wrapped with a Lang.bind.
|
||||||
|
|
||||||
|
const Lang = imports.lang;
|
||||||
|
|
||||||
|
let closure = Lang.bind(this, function() { this._fnorbate(); });
|
||||||
|
|
||||||
|
A more realistic example would be connecting to a signal on a method of a
|
||||||
|
prototype:
|
||||||
|
|
||||||
|
const Lang = imports.lang;
|
||||||
|
const FnorbLib = imports.fborbLib;
|
||||||
|
|
||||||
|
const MyClass = new Lang.Class({
|
||||||
|
_init: function() {
|
||||||
|
let fnorb = new FnorbLib.Fnorb();
|
||||||
|
fnorb.connect('frobate', Lang.bind(this, this._onFnorbFrobate));
|
||||||
|
},
|
||||||
|
|
||||||
|
_onFnorbFrobate: function(fnorb) {
|
||||||
|
this._updateFnorb();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Object literal syntax
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
In JavaScript, these are equivalent:
|
||||||
|
|
||||||
|
foo = { 'bar': 42 };
|
||||||
|
foo = { bar: 42 };
|
||||||
|
|
||||||
|
and so are these:
|
||||||
|
|
||||||
|
var b = foo['bar'];
|
||||||
|
var b = foo.bar;
|
||||||
|
|
||||||
|
If your usage of an object is like an object, then you're defining "member
|
||||||
|
variables." For member variables, use the no-quotes no-brackets syntax: `{ bar:
|
||||||
|
42 }` `foo.bar`.
|
||||||
|
|
||||||
|
If your usage of an object is like a hash table (and thus conceptually the keys
|
||||||
|
can have special chars in them), don't use quotes, but use brackets: `{ bar: 42
|
||||||
|
}`, `foo['bar']`.
|
||||||
|
|
||||||
|
Getters, setters, and Tweener
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
Getters and setters should be used when you are dealing with an API that is
|
||||||
|
designed around setting properties, like Tweener. If you want to animate an
|
||||||
|
arbitrary property, create a getter and setter, and use Tweener to animate the
|
||||||
|
property.
|
||||||
|
|
||||||
|
const ANIMATION_TIME = 2000;
|
||||||
|
|
||||||
|
const MyClass = new Lang.Class({
|
||||||
|
Name: 'MyClass',
|
||||||
|
|
||||||
|
_init: function() {
|
||||||
|
this.actor = new St.BoxLayout();
|
||||||
|
this._position = 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
get position() {
|
||||||
|
return this._position;
|
||||||
|
},
|
||||||
|
|
||||||
|
set position(value) {
|
||||||
|
this._position = value;
|
||||||
|
this.actor.set_position(value, value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let myThing = new MyClass();
|
||||||
|
Tweener.addTween(myThing,
|
||||||
|
{ position: 100,
|
||||||
|
time: ANIMATION_TIME,
|
||||||
|
transition: 'easeOutQuad' });
|
@ -1,7 +1,11 @@
|
|||||||
# Point to our macro directory and pick up user flags from the environment
|
# Point to our macro directory and pick up user flags from the environment
|
||||||
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
||||||
|
|
||||||
SUBDIRS = data js src browser-plugin tests po man
|
SUBDIRS = data js src browser-plugin tests po docs
|
||||||
|
|
||||||
|
if ENABLE_MAN
|
||||||
|
SUBDIRS += man
|
||||||
|
endif
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
.project \
|
.project \
|
||||||
@ -13,9 +17,12 @@ EXTRA_DIST = \
|
|||||||
DIST_EXCLUDE = \
|
DIST_EXCLUDE = \
|
||||||
.gitignore \
|
.gitignore \
|
||||||
gnome-shell.doap \
|
gnome-shell.doap \
|
||||||
|
HACKING \
|
||||||
MAINTAINERS \
|
MAINTAINERS \
|
||||||
tools/build/*
|
tools/build/*
|
||||||
|
|
||||||
distcheck-hook:
|
distcheck-hook:
|
||||||
@echo "Checking disted files against files in git"
|
@echo "Checking disted files against files in git"
|
||||||
@$(srcdir)/tools/check-for-missing.py $(srcdir) $(distdir) $(DIST_EXCLUDE)
|
@$(srcdir)/tools/check-for-missing.py $(srcdir) $(distdir) $(DIST_EXCLUDE)
|
||||||
|
|
||||||
|
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man
|
||||||
|
971
NEWS
@ -1,3 +1,974 @@
|
|||||||
|
3.7.1
|
||||||
|
=====
|
||||||
|
* Add shortcut to open application view directly [Jeremy; #685738]
|
||||||
|
* Expose '<Super>F10' shortcut in System Settings [Florian; #672909]
|
||||||
|
* Clean up timestamp format in chat notifications [Carlos; #680989]
|
||||||
|
* loginScreen: Add support for 'disable-restart-buttons' [Florian; #686247]
|
||||||
|
* Update textures automatically on file changes [Florian; #679268]
|
||||||
|
* Implement org.gnome.ScreenSaver.GetActiveTime [Giovanni; #686064]
|
||||||
|
* Add missing translations for GSetting schema [Giovanni; #686413]
|
||||||
|
* Hide workspace switcher completely when it's not necessary [Seif; #686483]
|
||||||
|
* Explicitly load gnome-screensaver when not running GDM [Tim; #683060]
|
||||||
|
* Port to GnomeIdleMonitor [Jasper; #682224]
|
||||||
|
* Set Empathy as preferred handler when delegating channels [Xavier; #686296]
|
||||||
|
* Allow testing GDM login dialog from the session [Giovanni; #683725]
|
||||||
|
* Use all available space for windows in window picker [Jasper, Pierre-Eric;
|
||||||
|
#582650]
|
||||||
|
* Use logind for suspend if available [Florian; #686482]
|
||||||
|
* Misc. fixes and cleanups [Jasper, Florian, Adel, Rui; #677426, #680426,
|
||||||
|
#686233, #686241, #686318, #686240, #686484, #686002, #684650, #686487]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Jeremy Bicha, Giovanni Campagna, Xavier Claessens, Adel Gadllah, Seif Lotfy,
|
||||||
|
Tim Lunn, Rui Matos, Florian Müllner, Pierre-Eric Pelloux-Prayer,
|
||||||
|
Carlos Soriano, Jasper St. Pierre
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
Andika Triwidada [id], Matej Urbančič [sl], Ihar Hrachyshka [be],
|
||||||
|
Daniel Mustieles [es], Fran Diéguez [gl], Takayuki KUSANO [ja],
|
||||||
|
Мирослав Николић [sr, sr@latin], Dušan Kazik [sk], Tom Tryfonidis [el]
|
||||||
|
|
||||||
|
3.6.1
|
||||||
|
=====
|
||||||
|
* dash: Make padding even on the top/bottom of the dash [Jasper; #684619]
|
||||||
|
* Fix a crash when dragging search results [Jasper; #684888]
|
||||||
|
* workspaceThumbnail: Fix dragging with static workspaces [Jasper; #684641]
|
||||||
|
* Really hide 'Show Keyboard Layout' on the lock screen [Matthias]
|
||||||
|
* Misc. improvements to jhbuild setup [Owen; #685352, #685353, #685354, #685355]
|
||||||
|
* Show message tray in Ctrl+Alt+Tab outside of the overview [Jasper, Florian;
|
||||||
|
#684633, #685914]
|
||||||
|
* Disable hotplug sniffer on remote filesystems [Jasper; #684093]
|
||||||
|
* userMenu: Remove 'Switch Session' item [Florian; #685062]
|
||||||
|
* unlockDialog: Make prompt entry insensitive while logging in [Jasper; #685444]
|
||||||
|
* messageTray: Don't animate desktop clone for failed grabs [Jasper; #685342]
|
||||||
|
* Fix crash on dragging windows between workspaces [Ryan; #681399]
|
||||||
|
* userMenu: Ignore 'lock-enabled' setting for user switching [Florian; #685536]
|
||||||
|
* gdm: Fix key-focus on first user [Adel; #684650]
|
||||||
|
* Make grid button insensitive when dragging non-favorites [Jasper; #685313]
|
||||||
|
* Calendar: hide all actions when on the login screen [Matthias; #685142]
|
||||||
|
* Adapt unlock dialog layout for the login screen [Florian; #685201]
|
||||||
|
* Make focus-follows-mouse work better with Shell UI [Florian; #678169]
|
||||||
|
* Improve look of screen shield [Jasper; #685919]
|
||||||
|
* Fix keynav in the login screen [Florian; #684730]
|
||||||
|
* dateMenu: Hide "Open Calendar" item if calendar unavailable [Florian; #686050]
|
||||||
|
* unlockDialog: Reset UI on verification failure [Giovanni; #685441]
|
||||||
|
* Show unlock dialog on primary monitor when using keynav [Giovanni; #685855]
|
||||||
|
* Fix height changes of entries when entering text [Florian; #685534]
|
||||||
|
* Fix show-apps label after successful drags [Florian; #684627]
|
||||||
|
* Misc. bugfixes and cleanups [Jasper, Olivier, Florian, Owen, Adel, Tanner, Tim, Matthias; #685434, #685511, #685466, #685341, #685156, #681159, #673189, #686016, 684869, #686079, #686063
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Jasper St. Pierre
|
||||||
|
Matthias Clasen
|
||||||
|
Owen Taylor
|
||||||
|
Olivier Blin
|
||||||
|
Florian Müllner
|
||||||
|
Ryan Lortie
|
||||||
|
Adel Gadllah
|
||||||
|
Tanner Doshier
|
||||||
|
Tim Lunn
|
||||||
|
Giovanni Campagna
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
Tobias Endrigkeit [de], Rudolfs Mazurs [lv], Ask H. Larsen [da],
|
||||||
|
Shankar Prasad [kn], Changwoo Ryu [ko], Chris Leonard [en_GB],
|
||||||
|
Arash Mousavi [fa], Theppitak Karoonboonyanan [th], Seán de Búrca [ga],
|
||||||
|
Yaron Shahrabani [he], Alexander Shopov [bg], Žygimantas Beručka [lt],
|
||||||
|
Milo Casagrande [it], Kjartan Maraas [nb], Kris Thomsen [da],
|
||||||
|
Aurimas Černius [lt], Yuri Myasoedov [ru], Мирослав Николић [sr],
|
||||||
|
Marek Černocký [cs], Gabor Kelemen [hu], Ihar Hrachyshka [be],
|
||||||
|
Chao-Hsiung Liao [zh_HK, zh_TW], Eleanor Chen [zh_CN],
|
||||||
|
Carles Ferrando [ca@valencia], Vicent Cubells [ca], Daniel Korostil [uk],
|
||||||
|
Alexandre Franke [fr], Piotr Drąg [pl]
|
||||||
|
|
||||||
|
3.6.0
|
||||||
|
=====
|
||||||
|
* keyboard: Make input source items accessible [Florian; #684462]
|
||||||
|
* Don't show network dialogs in the lock screen [Giovanni; #684384]
|
||||||
|
* popupMenu: Fix initial visibility of settings items [Florian; #684473]
|
||||||
|
* userMenu: Close menu immediately on user/session switch [Florian; #684459]
|
||||||
|
* Fix alignment of search section headers in RTL locales [Florian; #684379]
|
||||||
|
* screenShield: Fix unlock animation [Florian; #684591]
|
||||||
|
* Don't open the tray from a dwell while in a modal grab [Jasper; #684458]
|
||||||
|
* userMenu: Fix texture updates on icon changes [Florian; #679268]
|
||||||
|
* Fix a11y support in the login screen [Florian, Ray; #684727, #684728, #684748]
|
||||||
|
* Make On-Screen-Keyboard usable with new message tray [Giovanni, Florian;
|
||||||
|
#683546]
|
||||||
|
* Fix initial visibility of input volume in lock-screen [Florian; #684611]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Giovanni Campagna, Florian Müllner, Jasper St. Pierre, Ray Strode
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
Matej Urbančič [sl], Dr.T.Vasudevan [ta], Piotr Drąg [pl], A S Alam [pa],
|
||||||
|
Alexander Shopov [bg], Nilamdyuti Goswami [as], Chandan Kumar [hi],
|
||||||
|
Khaled Hosny [ar], Ibrahim Saed [ar], Sandeep Sheshrao Shedmake [mr],
|
||||||
|
Tom Tryfonidis [el], Theppitak Karoonboonyanan [th], Alexandre Franke [fr],
|
||||||
|
Fran Diéguez [gl], Gabor Kelemen [hu], Ani Peter [ml], Daniel Mustieles [es],
|
||||||
|
Мирослав Николић [sr, sr@latin], Duarte Loreto [pt], ManojKumar Giri [or],
|
||||||
|
Ihar Hrachyshka [be], Aurimas Černius [lt], Djavan Fagundes [pt_BR],
|
||||||
|
Changwoo Ryu [ko], Bruce Cowan [en_GB], Kris Thomsen [da], Gil Forcada [ca],
|
||||||
|
Yaron Shahrabani [he], Milo Casagrande [it], Ville-Pekka Vainio [fi],
|
||||||
|
YunQiang Su [zh_CN], Carles Ferrando [ca@valencia], Mario Blättermann [de],
|
||||||
|
Rajesh Ranjan [hi], Yuri Myasoedov [ru], Rūdolfs Mazurs [lv],
|
||||||
|
Jiro Matsuzawa [ja], Mattias Põldaru [et], Timur Zhamakeev [ky],
|
||||||
|
Petr Kovar [cs], Chao-Hsiung Liao [zh_HK,zh_TW], Andika Triwidada [id]
|
||||||
|
|
||||||
|
3.5.92
|
||||||
|
======
|
||||||
|
* Login/UnlockDialog: Don't reset immediately if auth fails [Giovanni; #682544]
|
||||||
|
* Allow changing session mode at runtime [Jasper, Giovanni; #683156]
|
||||||
|
* Add zoom out animation on login [Jasper; #683170]
|
||||||
|
* Bluetooth: don't restrict the length of non numeric PINs [Giovanni; #683356]
|
||||||
|
* Force chat notification to stay open when focusing entry [Debarshi; #682236]
|
||||||
|
* Make sure the screen is fully locked before suspending [Giovanni; #683448]
|
||||||
|
* st-texture-cache: Fix a case of distorted textures [Florian; #683483]
|
||||||
|
* popupSubMenu: Fix padding for non-scrolled submenus [Florian; #683009]
|
||||||
|
* popupMenu: Fix width changes on submenu open/close [Florian; #683485]
|
||||||
|
* boxpointer: Avoid malformed boxpointer arrow [Debarshi; #680077]
|
||||||
|
* Change stage background color to grey [Adel; #683514]
|
||||||
|
* messageTray: Update style of summary counters [Debarshi; #682891]
|
||||||
|
* Don't fail if a legacy tray icon has no WM_CLASS [Giovanni; #683724]
|
||||||
|
* PolkitAgent: Fix a crash if there is no avatar [Giovanni; #683707]
|
||||||
|
* Hide the a11y menu in the lock screen, but show it in the login screen
|
||||||
|
[Giovanni; #682542]
|
||||||
|
* Fix show-apps button dropping off the dash [Florian; #683340]
|
||||||
|
* Fix committing strings to shell entries from input method [Florian; #658325]
|
||||||
|
* Make IBus display strings consistent with control-center [Rui; #683124]
|
||||||
|
* Fix missing short codes for some input sources [Rui; #683613]
|
||||||
|
* Remove support for long-press from entry context menus [Jasper; #683509]
|
||||||
|
* screenShield: Add box-shadow to the shield [Florian]
|
||||||
|
* Don't show a right-click menu for the hotplug source [Jasper; #683438]
|
||||||
|
* Fix extension styling [Giovanni; #682128]
|
||||||
|
* Fix on-screen keyboard not working with system-modal dialogs
|
||||||
|
[Giovanni; #664309]
|
||||||
|
* Fix insensitive styling for popup menu items [Giovanni; #683988]
|
||||||
|
* Disable the message tray dwell when the user is interacting [Owen; #683811]
|
||||||
|
* Animate going from the unlock dialog to the lock screen [Giovanni; #681143]
|
||||||
|
* Autostart fprintd when necessary [Ray; #683131]
|
||||||
|
* UnlockDialog: Allow typing before the first PAM question [Giovanni; #681576]
|
||||||
|
* Make Return key dismiss screenshield [Ray; #683889]
|
||||||
|
* Fix keyboard navigation in the message tray [Florian; #682243]
|
||||||
|
* Remove the places & devices search provider [Giovanni; #683506]
|
||||||
|
* Enable hot corner while the message tray is up [Florian; #682255]
|
||||||
|
* Port screen recorder to new GStreamer vp8enc API [Adel; #684206]
|
||||||
|
* Fix fish flickering [Giovanni; #684154]
|
||||||
|
* Fix extension ordering with !important [Jasper; #684163]
|
||||||
|
* Allow the shell to run without the screenshield [Giovanni; #683060]
|
||||||
|
* Add menu items for IBus Anthy's InputMode, TypingMode [Rui; #682314]
|
||||||
|
* Improve transition to the login dialog [Jasper; #682428]
|
||||||
|
* Keep unlock dialog around until shield animation ends [Florian; #684342]
|
||||||
|
* Expose shell keybindings in System Settings [Florian; #671010]
|
||||||
|
* Misc. bugfixes and cleanups [Debarshi, Florian, Giovanni, Jasper, Rico, Rui;
|
||||||
|
#672790, #677434, #683305, #683357, #683369, #683377, #683378, #683400,
|
||||||
|
#683449, #683472, #683482, #683487, #683488, #683526, #683529, #683546,
|
||||||
|
#683583, #683628, #683705, #683982, #683989, #684035, #684036, #684040,
|
||||||
|
#684162, #684214, #684343]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Giovanni Campagna, Adel Gadllah, Rui Matos, Florian Müllner, Debarshi Ray,
|
||||||
|
Jasper St. Pierre, Ray Strode, Owen Taylor, Rico Tzschichholz
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
Gabor Kelemen [hu], Piotr Drąg [pl], Khaled Hosny [ar],
|
||||||
|
Мирослав Николић [sr, sr@latin], Chao-Hsiung Liao [zh_HK, zh_TW],
|
||||||
|
Bruce Cowan [en_GB], Dirgita [id], Tom Tryfonidis [el], Timo Jyrinki [fi],
|
||||||
|
Adorilson Bezerra [pt_BR], Arash Mousavi [fa], Matej Urbančič [sl],
|
||||||
|
Christian Kirbach [de], Yaron Shahrabani [he], Ihar Hrachyshka [be],
|
||||||
|
Changwoo Ryu [ko], Duarte Loreto [pt], Theppitak Karoonboonyanan [th],
|
||||||
|
Nilamdyuti Goswami [as], Sandeep Sheshrao Shedmake [mr],
|
||||||
|
Alexandre Franke [fr], Ivaylo Valkov [bg], tuhaihe [zh_CN],
|
||||||
|
Yuri Myasoedov [ru], Aurimas Černius [lt], Andika Triwidada [id],
|
||||||
|
Rajesh Ranjan [hi], Sweta Kothari [gu], Daniel Mustieles [es],
|
||||||
|
Fran Diéguez [gl], Praveen Illa [te]
|
||||||
|
|
||||||
|
3.5.91
|
||||||
|
======
|
||||||
|
* Improve modal dialog styling of network secret prompts [Jasper; #682412]
|
||||||
|
* Fix visibility of non-active workspaces during overview transition
|
||||||
|
[Florian; #682002]
|
||||||
|
* Improve scrollbar theming [Cosimo; #682476]
|
||||||
|
* Make sure the app menu remains hidden in locked state [Florian; #682475]
|
||||||
|
* Add tooltip to show-applications icon [Jasper; #682445]
|
||||||
|
* Do not add duplicate remote search providers [Florian; #682470]
|
||||||
|
* Handle 'popup-menu' signal on summary items [Florian; #682486]
|
||||||
|
* Fix dwelling during mouse-down [Owen; #682385]
|
||||||
|
* Set label actor for endSessionDialog.ListItem [Alejandro; #677503]
|
||||||
|
* Don't match on comments when searching applications [Florian; #682529]
|
||||||
|
* Make workspace selector more similar to the mockup [Stefano; #662087]
|
||||||
|
* Fix extension installation and reloading [Jasper; #682578]
|
||||||
|
* Hide removable devices in the lock screen [Giovanni; #681143]
|
||||||
|
* Reset cancellable after hitting Escape on login screen [Alban; #681537]
|
||||||
|
* Fix suspend from the user menu [Giovanni; #682746]
|
||||||
|
* Set label actor for summary items in message tray [Alejandro; #677229]
|
||||||
|
* Set label for the "Show applications" dash button [Alejandro; #682366]
|
||||||
|
* Load extensions as late as possible [Jasper; #682822]
|
||||||
|
* Improve mount operation dialogs [Jon; #682645]
|
||||||
|
* Remove "Connect to ..." item from places search [Florian; #682817]
|
||||||
|
* Don't auto-expand notifications with actions [Giovanni; #682738]
|
||||||
|
* Add a new lock screen menu to combine volume network and power
|
||||||
|
[Giovanni; #682540]
|
||||||
|
* Add support for pre-edit to StIMText [Daiki; #664041]
|
||||||
|
* Remove StIconType [Jasper, Florian, Rui, Giovanni, Debarshi; #682540]
|
||||||
|
* Use monitor geometry for dwelling [Florian; #683044]
|
||||||
|
* Add support for surrounding-text to StIMText [Daiki; #683015]
|
||||||
|
* Improve the placement and style of the "No results" text [Jasper; #683135]
|
||||||
|
* Remove broken network device activation policy [Giovanni; #683136]
|
||||||
|
* Hide power status icon when no battery is present [Tim; #683080]
|
||||||
|
* Ensure summary items are square and have spacing [Debarshi; #682248]
|
||||||
|
* Fix close buttons overlapping screen edge [Debarshi; #682343]
|
||||||
|
* Escape the tray when a legacy icon is clicked [Giovanni; #682244]
|
||||||
|
* Update arrow in the screen shield to match latest mockups [Giovanni; #682285]
|
||||||
|
* Allow lifting the screen shield with the mouse wheel [Giovanni; #683164]
|
||||||
|
* Make sure to show the app menu after unlocking the screen [Jasper; #683154]
|
||||||
|
* Misc bug fixes and cleanups [Debarshi, Florian, Giovanni, Jasper, Rui;
|
||||||
|
#582650, #667439, #682238, #682268, #682429, #682455, #682544, #682546,
|
||||||
|
#682683, #682710, #682998, #683073, #683137, #683156]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Alban Browaeys, Giovanni Campagna, Cosimo Cecchi, Stefano Facchini,
|
||||||
|
Adel Gadllah, Tim Lunn, Rui Matos, William Jon McCann, Florian Müllner,
|
||||||
|
Alejandro Piñeiro, Debarshi Ray, Jasper St. Pierre, Owen Taylor, Daiki Ueno
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
Piotr Drąg [pl], Takayuki KUSANO [ja], Kjartan Maraas [nb],
|
||||||
|
Aurimas Černius [lt], Daniel Mustieles [es], Yuri Myasoedov [ru],
|
||||||
|
Khaled Hosny [ar], Yaron Shahrabani [he], Tom Tryfonidis [el],
|
||||||
|
Nilamdyuti Goswami [as], Fran Diéguez [gl], Nguyễn Thái Ngọc Duy [vi],
|
||||||
|
A S Alam [pa], Dr.T.Vasudevan [ta], Luca Ferretti [it]
|
||||||
|
|
||||||
|
3.5.90
|
||||||
|
======
|
||||||
|
* Use symbolic icons for workspace switch OSD [Jon; #680738]
|
||||||
|
* Lock screen improvements:
|
||||||
|
- Hide user menu and a11y menu in the screen lock [Giovanni; #681143]
|
||||||
|
- Bump the lock screen slightly when pressing a key [Giovanni; #681143]
|
||||||
|
- Constrain vertical movement of the screen shield [Giovanni; #681143]
|
||||||
|
- Return to lock screen on idle [Giovanni; #682041]
|
||||||
|
- Unlock screen automatically after fast-user switching [Giovanni; #682096]
|
||||||
|
- Fix "other user" label [Ray; #681750]
|
||||||
|
* Constrain content of system modals to primary monitor [#681743]
|
||||||
|
* Respect automatic lock setting on suspend/user-switch [Giovanni; #680231]
|
||||||
|
* Improve styling of keyring prompt [Jasper; #681821]
|
||||||
|
* Do not hard-code <super> as overlay-key [Florian; #665547]
|
||||||
|
* Update style of attached modal dialogs [Florian; #681601]
|
||||||
|
* a11y: allow navigation on non reactive items [Alejandro; #667439, #667439]
|
||||||
|
* Implement mode-less overview design [Joost, Florian; #682109]
|
||||||
|
* Implement message-tray redesign:
|
||||||
|
- Restyle the message tray [Ana, Allan, Florian; #677213, #682342]
|
||||||
|
- Move the desktop upwards when showing the tray [Debarshi; #681392]
|
||||||
|
- Add a close button to notifications [Ana, Jasper; #682253]
|
||||||
|
- Add a keybinding to toggle the tray [Debarshi; #681392]
|
||||||
|
- Make the tray keyboard navigable [Debarshi; #681519]
|
||||||
|
- Add dwelling at the bottom of the screen to open the tray [Owen; #682310]
|
||||||
|
- Don't time out banners when the user is inactive [Marina, Jasper]
|
||||||
|
- Misc fixes and cleanups [Jasper, Marina]
|
||||||
|
* Fix showing "Next Week" on Sundays [Sebastian; #682198]
|
||||||
|
* Delay restoring IM presence until the network comes up [Florian; #677982]
|
||||||
|
* Display enterprise login hint [Ray; #681975]
|
||||||
|
* Ignore unrecognized/irrelevant network devices/connections [Dan; #682364]
|
||||||
|
* Misc bug fixes and cleanups: [Dan, Florian, Jasper, Jiro, Piotr, Rico;
|
||||||
|
#643687, #682045, #682189]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Giovanni Campagna, Allan Day, Piotr Drąg, William Jon McCann,
|
||||||
|
Sebastian Keller, Jiro Matsuzawa, Florian Müllner, Alejandro Piñeiro,
|
||||||
|
Debarshi Ray, Ana Risteska, Jasper St. Pierre, Ray Strode, Owen Taylor,
|
||||||
|
Rico Tzschichholz, Joost Verdoorn, Dan Winship, Marina Zhurakhinskaya
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
Nilamdyuti Goswami [as], Daniel Mustieles [es], Yaron Shahrabani [he],
|
||||||
|
Chao-Hsiung Liao [zh_HK, zh_TW], Tobias Endrigkeit [de], A S Alam [pa],
|
||||||
|
Sandeep Sheshrao Shedmake [mr], Fran Diéguez [gl],
|
||||||
|
Мирослав Николић [sr, sr@latin]
|
||||||
|
|
||||||
|
3.5.5
|
||||||
|
=====
|
||||||
|
* Update style to match mockups [Allan]
|
||||||
|
- improve calendar layout and legibility
|
||||||
|
- update notifications and menus
|
||||||
|
- use a common style for entries
|
||||||
|
- update scrollbars to match GTK+
|
||||||
|
- improve clock/unlock button in lock screen
|
||||||
|
- update polkit dialogs [Jasper]
|
||||||
|
* Fix login dialog growing when selecting different users [Florian; #675076]
|
||||||
|
* Implement screen lock in the shell [Giovanni]
|
||||||
|
- restructure login code to be shared with session unlock [#619955]
|
||||||
|
- add initial screen shield / unlock dialog implementation [#619955]
|
||||||
|
- implement (optional) notification list on lock shield [#619955]
|
||||||
|
- update login dialog style to match lock screen [#619955]
|
||||||
|
- filter notifications to only show new ones on the screen lock [#681143]
|
||||||
|
- make notifications scrollable if necessary [#681143]
|
||||||
|
- use correct application names in notifications [#681143]
|
||||||
|
- allow to return to the shield by pressing Escape [#681143]
|
||||||
|
* Minor login dialog improvements [Florian]
|
||||||
|
- update style to match the overall visuals [#660913]
|
||||||
|
- indicate whether users are logged in [#658185]
|
||||||
|
* Add support for background-repeat CSS property [Jasper; #680801]
|
||||||
|
* Add :active pseudo class on scroll handles [Florian]
|
||||||
|
* Remove markup from translated strings [Matthias; #681270]
|
||||||
|
* Misc bug fixes and cleanups: [Alban, Florian, Giovanni, Jasper, Jeremy,
|
||||||
|
Matthias, Piotr; #677893, #679944, #680064, #680170, #680216, #680426,
|
||||||
|
#681101, #681382]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Jeremy Bicha, Alban Browaeys, Giovanni Campagna, Matthias Clasen, Allan Day,
|
||||||
|
Piotr Drąg , Florian Müllner, Jasper St. Pierre
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
Matej Urbančič [sl], Tom Tryfonidis [el], Yaron Shahrabani [he],
|
||||||
|
Kjartan Maraas [nb], Baurzhan Muftakhidinov [kk], Praveen Illa [te],
|
||||||
|
Khaled Hosny [ar], Daniel Mustieles [es], Gabor Kelemen [hu],
|
||||||
|
Fran Diéguez [gl], Sweta Kothari [gu], Aleksej Kabanov [ru],
|
||||||
|
Nilamdyuti Goswami [as], Arash Mousavi [fa], Мирослав Николић [sr, sr@latin]
|
||||||
|
|
||||||
|
3.5.4
|
||||||
|
=====
|
||||||
|
* Fix wrong result handling of remote calls [Florian; #678852]
|
||||||
|
* dateMenu: Fix regression that caused no date to be displayed [Colin]
|
||||||
|
* WindowTracker: Fix refcounting bug in get_app_for_window() [Giovanni; #678992]
|
||||||
|
* Show the workspace switcher for move-to-workspace keybinding
|
||||||
|
[Giovanni, Jasper; #674104, #660839, #679005]
|
||||||
|
* userMenu: Move "Power off" item to the bottom [Florian; #678887]
|
||||||
|
* Remove contacts search provider [Florian, Rui; #677442]
|
||||||
|
* network: don't ask for always-ask secrets when interaction isn't allowed
|
||||||
|
[Dan; #679091]
|
||||||
|
* PolkitAgent: Look for the right password prompt [Matthias; #675300]
|
||||||
|
* Implement extension updates [Jasper; #679099]
|
||||||
|
* userMenu: Don't disconnect account signals when disabled [Guillaume; #669112]
|
||||||
|
* Fix startup notification when opening calendar [Florian; #677907]
|
||||||
|
* networkAgent: use absolute path if configured [Clemens; #679212]
|
||||||
|
* recorder: Port to GStreamer-1.0 API [Florian; #679445]
|
||||||
|
* telepathyClient: don't add log messages on presence changes [Ana; #669508]
|
||||||
|
* lookingGlass: Don't use a signal callback on 'paint' to draw the border
|
||||||
|
[Jasper; #679464]
|
||||||
|
* Add support for inhibiting automount [Hans; #678597]
|
||||||
|
* Implemented banner support for the login screen [Matthias, Marius; #665346]
|
||||||
|
* boxpointer: Flip side if we would end outside the monitor [Rui; #678164]
|
||||||
|
* boxpointer: Change 'animate' parameter on show/hide to a bitmask
|
||||||
|
[Rui; #678337]
|
||||||
|
* Add a grayscale effect [Matthias, Jasper, Florian: #676782, #674499]
|
||||||
|
* UserMenu: show "Install Updates & Restart" when appropriate
|
||||||
|
[Giovanni; #677394, #680080]
|
||||||
|
* messageTray: don't show the message tray when a new notification is shown
|
||||||
|
[Ana; #677210]
|
||||||
|
* panel: don't break when indicator has no menu [Jean-Philippe; #678694]
|
||||||
|
* appMenu: Disable app menu during startup animations [Florian; #672322]
|
||||||
|
* autorun: Add a notification when unmounting drives [Cosimo; #676125]
|
||||||
|
* st-icon: Fix potential crash involving shadows [Jasper; #679776]
|
||||||
|
* Remove manual garbage collection on tweeners end [Cosimo; #679832]
|
||||||
|
* dash: hide tooltips when overview begins hiding [Stefano; #674241]
|
||||||
|
* Update modal dialog animation for new centered position [Florian; #674499]
|
||||||
|
* calendar: Fix grid lines in RTL locales [Florian; #679879]
|
||||||
|
* Integrate IBus with keyboard indicator [Rui; #641531]
|
||||||
|
* Move ibus status icon under keyboard [Matthias]
|
||||||
|
* gdm: port from libgdmgreeter to libgdm [Ray; #676401]
|
||||||
|
* Misc bug fixes and cleanups [Antoine, Cosimo, Giovanni, Jasper, Rico;
|
||||||
|
#678978, #672790, #679847, #679944]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Jean-Philippe Braun, Clemens Buchacher, Giovanni Campagna, Cosimo Cecchi,
|
||||||
|
Matthias Clasen, Hans de Goede, Guillaume Desmottes, Stefano Facchini,
|
||||||
|
Antoine Jacoutot, Rui Matos, Florian Müllner, Marius Rieder, Ana Risteska,
|
||||||
|
Jasper St. Pierre, Rico Tzschichholz, Colin Walters, Dan Williams
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
Matej Urbančič [sl], Khaled Hosny [ar], Nguyễn Thái Ngọc Duy [vi],
|
||||||
|
Nilamdyuti Goswami [as], Alexander Shopov [bg], Ivaylo Valkov [bg],
|
||||||
|
Daniel Mustieles [es], Kjartan Maraas [nb,nn], Yaron Shahrabani [he],
|
||||||
|
Nilamdyuti Goswami [as], Chao-Hsiung Liao [zh_HK, zh_TW], Ihar Hrachyshka [be],
|
||||||
|
Praveen Illa [te]
|
||||||
|
|
||||||
|
3.5.3
|
||||||
|
=====
|
||||||
|
* calendar: Adapt to Evolution-Data-Server API changes [Matthew; #677402]
|
||||||
|
* messageTray: Don't show non urgent notifications while in fullscreen
|
||||||
|
[Adel; #677590]
|
||||||
|
* modalDialog: show dialogs on monitor with the mouse pointer [Tim; #642591]
|
||||||
|
* extensionSystem: Prepare for extension updating system [Jasper; #677586]
|
||||||
|
* appDisplay: Don't show apps in NoDisplay categories in the All view
|
||||||
|
[Jasper; #658176]
|
||||||
|
* st: Trigger theme updates on resolution changes [Florian; #677975]
|
||||||
|
* Always enable a11y [Bastien; #678095]
|
||||||
|
* telepathyClient: ignore invalidated channels [Guillaume; #677457]
|
||||||
|
* shell-app: Update app menu if necessary [Florian; #676238]
|
||||||
|
* Enable the Screen Reader menu item [Matthias; #663256]
|
||||||
|
* Disable unredirection when a modal operation is active [Giovanni]
|
||||||
|
* Make folks optional [Colin]
|
||||||
|
* Improve mount-operation support [Cosimo]
|
||||||
|
- Fix exception when showing password entry [#678428]
|
||||||
|
- Close the password entry on operation abort [#673787]
|
||||||
|
- autorun: Don't allow autorun for things we mount on startup [#660595]
|
||||||
|
- Turn passphrase prompt into a dialog [#674962]
|
||||||
|
- Implement org.Gtk.MountOperationHandler [#678516]
|
||||||
|
* Network menu improvements
|
||||||
|
- Sort Wifi networks by strength [Giovanni; #658946]
|
||||||
|
- Prefer wifi/3g over VPN in the panel [Cosimo; #672591]
|
||||||
|
* clock: Switch to using GnomeWallClock [Colin; #657074]
|
||||||
|
* remoteSearch: Allow to reference .desktop file for Title/Icon
|
||||||
|
[Florian; #678816]
|
||||||
|
* Fix memory leaks [Jasper, Pavel; #678079, #678406, #678737]
|
||||||
|
* Misc fixes [Florian, Giovanni, Guillaume, Jasper, Kjartan, Piotr, Rui;
|
||||||
|
#658955, #677497, #678396, #678502]
|
||||||
|
* Misc cleanups [Bastien, Florian, Jasper; #677426, #677515, #678096, #678416]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Matthew Barnes, Giovanni Campagna, Cosimo Cecchi, Matthias Clasen,
|
||||||
|
Guillaume Desmottes, Piotr Drąg, Adel Gadllah, Tim L, Kjartan Maraas,
|
||||||
|
Rui Matos, Florian Müllner, Bastien Nocera, Jasper St. Pierre, Colin Walters
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
Matej Urbančič [sl], Yuri Kozlov [ru], Tom Tryfonidis [el],
|
||||||
|
Kjartan Maraas [nb], Žygimantas Beručka [lt], Luca Ferretti [it],
|
||||||
|
Khaled Hosny [ar], Daniel Mustieles [es], Fran Diéguez [gl], A S Alam [pa]
|
||||||
|
|
||||||
|
3.5.2
|
||||||
|
=====
|
||||||
|
* main: Move 'toggle-recording' binding into the shell [Florian; #674377]
|
||||||
|
* popupMenu: make sure to break the grab when the slider is not visible
|
||||||
|
[Stefano; #672713]
|
||||||
|
* st-theme-node-drawing: Don't use GL types [Neil; #672711]
|
||||||
|
* Mirror Evolution calendar settings into our own schema [Owen; #674424]
|
||||||
|
* shell-network-agent: don't crash if a request isn't found [Dan; #674961]
|
||||||
|
* notificationDaemon: Match app based on WM_CLASS [Jasper; #673761]
|
||||||
|
* NetworkMenu: use network-offline while loading [Giovanni; #674426]
|
||||||
|
* lookingGlass: Remove the Errors tab [Jasper; #675104]
|
||||||
|
* searchDisplay: Reset keyboard focus after displaying async results
|
||||||
|
[Rui; #675078]
|
||||||
|
* gdm: don't fail if fprintd is unavailable [Ray; #675006]
|
||||||
|
* messageTray: Fix scrolling up [Jasper; #661615]
|
||||||
|
* main: Close the recorder instead of pausing it [Rui; #675128]
|
||||||
|
* Accessibility [Alejandro]
|
||||||
|
- Use the proper label_actor for date menu on top panel [#675307]
|
||||||
|
- Set the proper role/label_actor for SearchResult.content [#672242]
|
||||||
|
- do not expose a label text if 'hidden' style class is used [#675341]
|
||||||
|
* Magnifier: Add brightness and contrast functionality [Joseph; #639851]
|
||||||
|
* theme: use a smaller border-radius for top bar [Jakub; #672430]
|
||||||
|
* placeDisplay: use new bookmark file location [Matthias; #675443]
|
||||||
|
* port all synchronous search providers to the async API [Jasper, Rui; #675328]
|
||||||
|
* NetworkAgent: disallow multiple requests for the same connection/setting
|
||||||
|
[Giovanni; #674961]
|
||||||
|
* userMenu: Update to latest mockups [Florian; #675802]
|
||||||
|
* util: Don't double-fork when spawning from Alt-F2 [Colin; #675789]
|
||||||
|
* messageTray: Make Source usable without subclassing [Jasper; #661236]
|
||||||
|
* panel: Check for appMenu button's reactivity before opening [Florian; #676316]
|
||||||
|
* Fix formatting of bluetooth passkey [Florian; #651251]
|
||||||
|
* notificationDaemon: Filter out file-transfer notifications [Jasper; #676175]
|
||||||
|
* Don't use global.log() [Jasper; #675790]
|
||||||
|
* Fix broken extension loading in some distributions [Owen, Alexandre; #670477]
|
||||||
|
* shell-app: Raise windows in reverse order to preserve the stacking
|
||||||
|
[Rui; #676371]
|
||||||
|
* Generalize gdm-mode [Florian; #676156]
|
||||||
|
* Switch string formatting to the one inside gjs [Jasper; #675479]
|
||||||
|
* extensionUtils: Support subdirectories in getCurrentExtension
|
||||||
|
[Jasper; #677001]
|
||||||
|
* panel: Refuse to add (legacy) status icons not part of the session mode
|
||||||
|
[Florian; #677058]
|
||||||
|
* Add an initial-setup mode [Matthias; #676697]
|
||||||
|
* status/keyboard: Port to the new input sources settings [Rui; #641531]
|
||||||
|
* NetworkMenu: show notifications for failed VPN connections [Giovanni; #676330]
|
||||||
|
* userMenu: Indicate progress on status changes [Florian; #659067]
|
||||||
|
* recorder: Honor "disable-save-to-disk" lockdown key [Rūdolfs; #673630]
|
||||||
|
* searchDisplay: Use the rowLimit we pass to the IconGrid [Christian; #675527]
|
||||||
|
* endSessionDialog: Factor out _updateDescription from _updateContent
|
||||||
|
[Alejandro; #674210]
|
||||||
|
* Fix empathy's appMenu freezing the shell [Alban; #676447]
|
||||||
|
* Code cleanups [Florian, Giovanni, Jasper; #672807, #672413, #676837, #676850,
|
||||||
|
#672272]
|
||||||
|
* Misc bug fixes [Alban, Florian, Giovanni, Guillaume, Jasper, Piotr, Rico,
|
||||||
|
Ron, Rui, Stefano; #659968, #672192, #673177, #673198, #674323, #675301,
|
||||||
|
#675370, #676347, #676806, #677097]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Alban Browaeys, Giovanni Campagna, Matthias Clasen, Guillaume Desmottes,
|
||||||
|
Piotr Drąg, Stefano Facchini, Rui Matos, Rūdolfs Mazurs, Florian Müllner,
|
||||||
|
Alejandro Piñeiro, Neil Roberts, Alexandre Rostovtsev, Joseph Scheuhammer,
|
||||||
|
Jakub Steiner, Jasper St. Pierre, Ray Strode, Owen Taylor, Rico Tzschichholz,
|
||||||
|
Colin Walters, Dan Winship, Ron Yorston
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
OKANO Takayoshi [ja], Daniel Mustieles [es], Changwoo Ryu [ko],
|
||||||
|
Yaron Shahrabani [he], Fran Diéguez [gl], Jonh Wendell [pt_BR],
|
||||||
|
Kjartan Maraas [nb], Luca Ferretti [it], Tom Tryfonidis [el],
|
||||||
|
Sandeep Sheshrao Shedmake [mr], Takanori MATSUURA [ja], Dirgita [id],
|
||||||
|
Mantas Kriaučiūnas [lt], Matej Urbančič [sl], Jiro Matsuzawa [ja]
|
||||||
|
|
||||||
|
3.4.1
|
||||||
|
=====
|
||||||
|
* Fix crash that occurred when an icon theme change caused unexpected
|
||||||
|
reentrancy in the icon loading code [Jasper; #673512]
|
||||||
|
* Don't show system and other disabled users in the GDM user list
|
||||||
|
[Adel; #673784]
|
||||||
|
* Make gnome-shell-calendar-server initialize GTK+ so it can display
|
||||||
|
password prompts if needed [#673608; Owen, Rico]
|
||||||
|
* Adapt to Mutter API change for keybinding addition [Florian; #673014]
|
||||||
|
* Fix crash when an extension was installed as both a user extension
|
||||||
|
and a system extension [#673613; Jasper]
|
||||||
|
* Fix bug where chat entry could end up partially offscreen [Joost, 661944]
|
||||||
|
* Fix problem where icons weren't updating when theme was changed
|
||||||
|
[#672941; Florian]
|
||||||
|
* Look for Evolution calendar settings in GSettings, not GConf [#673610; Owen]
|
||||||
|
* Add <super>F10 for the application menu [#672909; Florian]
|
||||||
|
* Fix %Id format characters to work in translations [#673106; Cosimo]
|
||||||
|
(were already used in fa translation)
|
||||||
|
* Fix error when NetworkManager restarts [#673043; Giovanni]
|
||||||
|
* Improve efficiency of overview redraws by working around Clutter issue
|
||||||
|
[Stefano; #670636]
|
||||||
|
* Misc bug fixes [Florian, Giovanni, Jasper, Rui, Stefano;
|
||||||
|
#672592, #672641, #672719, #673187, #673233, #673656]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Giovanni Campagna, Cosimo Cecchi, Stefano Facchini, Adel Gadllah, Rui Matos,
|
||||||
|
Florian Müllner, Jasper St. Pierre, Owen Taylor, Rico Tzschichholz,
|
||||||
|
Joost Verdoorn
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
Khaled Hosny [ar], Ihar Hrachyshka [be], Alexander Shopov [bg], Gil Forcada,
|
||||||
|
Jordi Serratosa [ca], Petr Kovar [cs], Bruce Cowan [en_GB],
|
||||||
|
Carles Ferrando [ca@valencia], Wolfgang Stöggl [de], Daniel Mustieles [es],
|
||||||
|
Arash Mousavi [fa], Bruno Brouard [fr], Fran Diéguez [gl],
|
||||||
|
Sweta Kothari [gu], Yaron Shahrabani [he], Gabor Kelemen [hu],
|
||||||
|
Shankar Prasad [kn], Žygimantas Beručka [lt], Rudolfs Mazurs [lv],
|
||||||
|
Sandeep Sheshrao Shedmake [mr], Kjartan Maraas [nb], Piotr Drąg [pl],
|
||||||
|
Yuri Myasoedov [ru], Daniel Nylander [se], Matej Urbančič [sl],
|
||||||
|
Miroslav Nikolić [sr], Sasi Bhushan, Praveen Illa [te], Yinghua Wang [zh_CN]
|
||||||
|
|
||||||
|
3.4.0
|
||||||
|
=====
|
||||||
|
* Don't crash when taking screenshots [Jasper; #672775]
|
||||||
|
* Fix dialog-resizing problem [Florian; #672543]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Florian Müllner, Jasper St. Pierre
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
Khaled Hosny, Abderrahim Kitouni [ar], Ihar Hrachyshka [be],
|
||||||
|
Alexander Shopov [bg], Marek Černocký [cs], Jiri Grönroos, Timo Jyrinki [fi],
|
||||||
|
Bruno Brouard [fr], Fran Diéguez [gl], Yaron Shahrabani [he],
|
||||||
|
Gabor Kelemen [hu], Jiro Matsuzawa [ja], Kenneth Nielsen [dk],
|
||||||
|
Mattias Põldaru [et], Changwoo Ryu [ko], Rudolfs Mazurs [lv],
|
||||||
|
Jonh Wendell [pt_BR], Yuri Myasoedov[ru], Daniel Korostil [uk],
|
||||||
|
Nguyễn Thái Ngọc Duy [vi], Chao-Hsiung Liao [zh_HK, zh_TW]
|
||||||
|
|
||||||
|
3.3.92
|
||||||
|
======
|
||||||
|
* Add shell-dialogs for GNOME Keyring prompts [Stef; #652459, #652460, #671034]
|
||||||
|
* When the user returns from idle, bring up the message tray if there were
|
||||||
|
messages while they were away [Marina; #643014]
|
||||||
|
* https://live.gnome.org/EveryDetailMatters
|
||||||
|
- Make the workspace thumbnails clickable all the way to the edge of the
|
||||||
|
screen [Stefano; #643319]
|
||||||
|
- Don't slide out the workspace thumbnails if the mouse is over them when
|
||||||
|
entering the overview [Joost, #651092]
|
||||||
|
- Fix placeholder jumps while dragging a dash item [Joost; #651842]
|
||||||
|
- Don't favorite apps if they are dropped back at the same position
|
||||||
|
[Jean-Philippe; #656333]
|
||||||
|
- To avoid confusion, don't allow removing running apps from favorites
|
||||||
|
[Florian; #644853]
|
||||||
|
- Fix creation of new workspaces by dragging application launchers
|
||||||
|
[Stefano; #664202]
|
||||||
|
- Make it easier to drag dash items without triggering the menu
|
||||||
|
[Florian; #637103]
|
||||||
|
* Accessibility [Alejandro]
|
||||||
|
- Add StWidget API for easily adding accessible states and setting roles,
|
||||||
|
names [#668366, #667432, #671378]
|
||||||
|
- Set accessibility information on UI elements
|
||||||
|
[#644255, #667432, #668361, #672047, #670308, #670312, #670719, #671404]
|
||||||
|
* Improve key-navigation in the overview [Rui, Florian; #663901]
|
||||||
|
* Key navigation bug fixes [Rui, Florian; #662493, #663437, #665215, #671998]
|
||||||
|
* Honor a 'org.gnome.shell.overrides.dynamic-workspaces' setting that
|
||||||
|
determines whether the workspace count is dynamic and unsaved in GSettings
|
||||||
|
or static and saved. [Florian; #671568]
|
||||||
|
* Avoid saving user presence to GSettings when not necessary
|
||||||
|
[Florian; #665701, #668214]
|
||||||
|
* Save screencasts in the users Videos/ directory [Adel; #670749]
|
||||||
|
Use a "human readable" filename [Florian, Adel, Ray; #670753]
|
||||||
|
* Allow dragging from the empty part of the top panel to unmaximize a window
|
||||||
|
[Florian; #666359]
|
||||||
|
* Fix hangs that could occur when switching away to a VT [Ray; #653833]
|
||||||
|
* Fix problems with installing from extensions.gnome.org [Giovanni; #671134]
|
||||||
|
* Fix locking the screen when suspending via menu [David, Gert; #670820]
|
||||||
|
* Fix browser plugin with Konqueror and Opera [Jasper]
|
||||||
|
* Fix shell restart not to bring up failure screen [Giovanni; #648384]
|
||||||
|
* Reorganize and clean up CSS theming [Allan; #668209]
|
||||||
|
* Improve appearance of modal dialogs [Allan, Florian; #670227, #668209]
|
||||||
|
* Update the calendar code to use ECalClient [Giovanni; #671177]
|
||||||
|
* Update jhbuild script to use the main moduleset [Owen, Will; #668440]
|
||||||
|
* StTextureCache: code cleanup, evict unused icons, merge together
|
||||||
|
simulataneous requests for the same icon [Jasper; #670771, #671656, #672273]
|
||||||
|
* Clean up St for recent Clutter changes and fix bugs. StContainer and
|
||||||
|
StGroup are removed [Jasper, Florian; #670034, #670640, #670904]
|
||||||
|
* Code cleanup [Adel, Jasper, Rui; #613194, #671086, #671103]
|
||||||
|
* Misc bug fixes
|
||||||
|
[Adel, Colin G, Cosimo, Florian, Giovanni, Jasper, Marius, Rui, Stefano;
|
||||||
|
#651130, #658946, #667552, #670076, #671001, #670979, #671410, #671411,
|
||||||
|
#671556, #671656, #671657, #672011, #672024, #672240, #672265, #672270,
|
||||||
|
#672321, #672326, #672413, #672471]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Jean-Philippe Braun, Giovanni Campagna, Cosimo Cecchi, Allan Day,
|
||||||
|
Stefano Facchini, David Foerster, Adel Gadllah, Marius Gedminas,
|
||||||
|
Colin Guthrie, Gert Michael Kulyk, William Lachance, Rui Matos,
|
||||||
|
Florian Müllner, Alejandro Piñeiro, Jan Alexander Steffens,
|
||||||
|
Jasper St. Pierre, Ray Strode, Owen Taylor, Joost Verdoorn, Stef Walter,
|
||||||
|
Marina Zhurakhinskaya
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
Nilamdyuti Goswami [as], Ihar Hrachyshka, Kasia Bondarava [be],
|
||||||
|
Alexander Shopov, Ivaylo Valkov [bg], Gil Forcada [ca], Marek Černocký [cs],
|
||||||
|
Mario Blättermann [de], Kris Thomsen [dk], Bruce Cowan [en_GB],
|
||||||
|
Kristjan Schmidt [eo], Daniel Mustieles [es], Mattias Põldaru [et],
|
||||||
|
Inaki Larranaga Murgoitio [eu], Arash Mousavi [fa], Timo Jyrinki [fi],
|
||||||
|
Bruno Brouard [fr], Fran Diéguez [gl], Sweta Kothari [gu],
|
||||||
|
Yaron Shahrabani [he], Gabor Kelemen [hu], Jiro Matsuzawa [ja],
|
||||||
|
Baurzhan Muftakhidinov [kk], Seong-ho Cho [ko], Žygimantas Beručka [lt],
|
||||||
|
Anita Reitere [lv], Anish A, Praveen Arimbrathodiyil, Mohammed Sadiq [ml],
|
||||||
|
fKjartan Maraas [nb], Wouter Bolsterlee [nl], A S Alam [pa], Piotr Drąg [pl],
|
||||||
|
Duarte Loreto [pt], Jonh Wendell [pt_BR], Yuri Myasoedov [ru],
|
||||||
|
Matej Urbančič [sl], Miroslav Nikolić [sr], Tirumurti Vasudevan [ta],
|
||||||
|
Sasi Bhushan, Krishnababu Krothapalli [te], Daniel Korostil [uk],
|
||||||
|
Nguyễn Thái Ngọc Duy [vi], YunQiang Su, Yinghua Wang [zh_CN],
|
||||||
|
Chao-Hsiung Liao [zh_HK, zh_TW]
|
||||||
|
|
||||||
|
3.3.90
|
||||||
|
======
|
||||||
|
|
||||||
|
* Allow other applications to implement search providers via D-Bus
|
||||||
|
[Florian; #663125, #670148]
|
||||||
|
* Remove "Recent Items" search, as replaced by Documents search
|
||||||
|
[Florian; #663125]
|
||||||
|
* Allow NetworkManager VPN plugins to use a shell-themed dialog
|
||||||
|
[Giovanni; #658484]
|
||||||
|
* Port away from deprecated Clutter API [Jasper, Florian, Adel; #670034]
|
||||||
|
- StTooltip is removed
|
||||||
|
- StWidget is now a concrete class and can be instantiated
|
||||||
|
- st_container_destroy_children(), st_box_layout_insert_actor(),
|
||||||
|
and other functions removed in favor of new replacements in Clutter.
|
||||||
|
* Use systemd for console/session handling when available [Lennart]
|
||||||
|
* Visual improvements to contact search, padding, top panel, checkboxes
|
||||||
|
[Allan, Florian, Jakub; #669489, #669811, #669993]
|
||||||
|
* Add a include_cursor parameter to Screenshot and ScreenshotWindow
|
||||||
|
D-Bus methods [Adel; #670086]
|
||||||
|
* Add a "FlashArea" D-Bus method to do the screenshot flash without a
|
||||||
|
screenshot [Adel; #669660]
|
||||||
|
* Build fixes [Adel, Giovanni, Jasper; #658484, #669637]
|
||||||
|
* Misc bug fixes [Adel, Florian, Giovanni, Guillaume, Jasper, Jeff,
|
||||||
|
Marc-Antoine, Stef, Stefano, Will; #642135, #658484, #658908, #667694,
|
||||||
|
#669098, #669921, #669662, #669694, #669776, #669887, #669921, #670005,
|
||||||
|
#670006, #670319, #670418, #670489]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Giovanni Campagna, Cosimo Cecchi, Allan Day, Guillaume Desmottes, Jeff Epler,
|
||||||
|
Stefano Facchini, Adel Gadllah, Florian Müllner, Marc-Antoine Perennou,
|
||||||
|
Jasper St. Pierre, Lennart Poettering, Jakub Steiner, Jasper St. Pierre,
|
||||||
|
Will Thompson, Stef Walter
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
Ihar Hrachyshka [be], Marek Černocký, Adam Matoušek [cs],
|
||||||
|
Kenneth Nielsen [dk], Daniel Mustieles [es], Mattias Põldaru [et],
|
||||||
|
Fran Diéguez [gl], Yaron Shahrabani [he], Luca Ferretti [it],
|
||||||
|
Baurzhan Muftakhidinov [kk], Aurimas Černius [lt], Kjartan Maraas [nb],
|
||||||
|
A S Alam [pa], Matej Urbančič [sl], Miroslav Nikolić [sr],
|
||||||
|
Praveen Illa [te], Chao-Hsiung Liao [zh_HK, zh_TW]
|
||||||
|
|
||||||
|
3.3.5
|
||||||
|
=====
|
||||||
|
|
||||||
|
* Extension system: [Jasper; #668429]
|
||||||
|
http://blog.mecheye.net/2012/02/more-extension-api-breaks/
|
||||||
|
- Add a 'gnome-shell-extension-prefs' application for displaying extension
|
||||||
|
preferences as provided by the extension in a prefs.js file.
|
||||||
|
- Allow launching gnome-shell-extension-prefs from extensions.gnome.org
|
||||||
|
throuhg the browser plugin.
|
||||||
|
- Add ExtensionUtils.getCurrentExtension() for an extension to get a
|
||||||
|
handle to an extension object, to get local imports or paths.
|
||||||
|
- Add an onshellrestart callback to the browser plugin [Jasper; #668517]
|
||||||
|
* Screenshots:
|
||||||
|
- Move the screenshot "flash" to the shell [Cosimo; #668618]
|
||||||
|
- Move saving screenshots to a thread [Adel; #652952]
|
||||||
|
- Correctly screenshot rounded decorations [Jasper; #662486]
|
||||||
|
* Screen recorder:
|
||||||
|
- Change the default pipeline to favor speed over quality [Owen; #669066]
|
||||||
|
- Drop frames to keep from running the user out of memory [Owen; #669066]
|
||||||
|
* Work around a slow implementation of glReadPixels() in the Intel drivers,
|
||||||
|
improving performance for screenshots and the screen recorder.
|
||||||
|
[Owen; #669065]
|
||||||
|
* Use Keywords: field in desktop files when search for applications
|
||||||
|
[Florian; #609702]
|
||||||
|
* Strip debian- when matching desktop file names [Jasper; #665647]
|
||||||
|
* Fix up various problems from CSS background size-addition
|
||||||
|
[Florian, Jasper; #668430, #633462]
|
||||||
|
* UI tweaks and behavior fixes
|
||||||
|
[Florian, Giovanni, Stefano; #643867, #666197, #664622]
|
||||||
|
* Some improvements to exported accessibility information [Alejando; #667376]
|
||||||
|
* Don't show contacts without IM information as offline [Florian; #662685]
|
||||||
|
* Don't change status from hidden to extended_away when going idle
|
||||||
|
[Florian; #642408]
|
||||||
|
* Cleanups [Emmanuele, Jasper; #662152, #669239]
|
||||||
|
* Misc bug fixes [Cosimo, Dan, Florian, Jasper, Rui, Stefano;
|
||||||
|
#633462, #643867, #662213, #662386, #662747, #665000, #665017, #665322,
|
||||||
|
#667371, #667860, #668020, #668517, #668541, #669236]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Emmanuele Bassi, Giovanni Campagna, Cosimo Cecchi, Stefano Facchini,
|
||||||
|
Adel Gadllah, Rui Matos, Florian Müllner, Alejandro Piñeiro,
|
||||||
|
Jasper St. Pierre, Owen Taylor, Dan Winship
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
Daniel Mustieles [es], Timo Jyrinki [fi], Seán de Búrca [ga],
|
||||||
|
Fran Diéguez [gl], Kjartan Maraas [nb], Wouter Bolsterlee [nl],
|
||||||
|
Danishka Navin [si], Yaron Shahrabani [he], Matej Urbančič [sl],
|
||||||
|
Chao-Hsiung Liao [zh_HK, zh_TW]
|
||||||
|
|
||||||
|
3.3.4
|
||||||
|
=====
|
||||||
|
* https://live.gnome.org/EveryDetailMatters
|
||||||
|
- Add "browse" for labels for dash items - once a tooltip is
|
||||||
|
showing, switch to other items without a delay [Seif; #666170]
|
||||||
|
- Always scale down windows in the overview at least to 70% [Vit; #646704]
|
||||||
|
- Fix the new-workspace drop indicator sometimes getting stuck
|
||||||
|
[Stefano; #664201]
|
||||||
|
- Delay rearranging windows in the overview as long as the pointer
|
||||||
|
is over a window [Vit; #645325]
|
||||||
|
* Add a GConf => DConf migration file for overriden Mutter settings
|
||||||
|
[Florian; #667636]
|
||||||
|
* When a VPN connection is active, show that as the network icon
|
||||||
|
[Giovanni; #665115]
|
||||||
|
* Handle the "ExtendedAway" IM status as away, not offline [Guillaume; #667813]
|
||||||
|
* Improve the appearance of the labels in "Applications" [Alex; #642392]
|
||||||
|
* Adjust for GTK+ and Mutter API changes for application menu [Ryan; #668118]
|
||||||
|
* Add section label support to the application menu [Giovanni; #666681]
|
||||||
|
* Fix screenshot methods to work again [Cosimo; #667662]
|
||||||
|
* Fix several crashers related to updating workspace thumbnails [Owen; #667652]
|
||||||
|
* Fix memory management error causing gnome-shell-hotplug-sniffer to crash
|
||||||
|
[Owen; #667378]
|
||||||
|
* Build fixes [Emmanuele, Rico; #667864]
|
||||||
|
* Code cleanups [Adel; #668087]
|
||||||
|
* Misc bug fixes [Colin, Florian, Giovanni, Owen, Xavier; #633028, #658817,
|
||||||
|
#664138, #667881, #668048, #668050]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Emmanuele Bassi, Giovanni Campagna, Cosimo Cecchi, Xavier Claessens,
|
||||||
|
Guillaume Desmottes, Stefano Facchini, Adel Gadllah, Alex Hultman,
|
||||||
|
Ryan Lortie, Seif Lotfy, Florian Müllner, Vit Stanislav, Owen Taylor,
|
||||||
|
Rico Tzschichholz, Colin Walters
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
Ihar Hrachyshka [be], Alexander Shopov [bg], Arash Mousavi [fa],
|
||||||
|
Jiri Grönroos, Timo Jyrinki [fi], Fran Diéguez [gl], Kjartan Maraas [nb],
|
||||||
|
Yuri Myasoedov [ru], Matej Urbančič [sl], Nguyễn Thái Ngọc Duy [vi]
|
||||||
|
|
||||||
|
3.3.3
|
||||||
|
=====
|
||||||
|
* https://live.gnome.org/EveryDetailMatters
|
||||||
|
- Stop flashing the window labels on actions in overview [Zan; #644861]
|
||||||
|
- Improve the look of window captions in the overview [Marc; #664487]
|
||||||
|
- Move dash tooltips beside the icon [Seif, Stefano; #666166]
|
||||||
|
* Support application menus exported from applications via new GLib API
|
||||||
|
and D-Bus protocol. [Giovanni, Colin, Matthias, Cosimo]
|
||||||
|
* For removable device prompts, show "Open with Rhythmbox], rather
|
||||||
|
than "Open with Rhythmbox Music Player' [Florian; #664561]
|
||||||
|
* Switch to activating the message tray only with a hot corner rather
|
||||||
|
than a full row of pixels, allowing mouse events to apps [Rui; #663366]
|
||||||
|
* Fully handle the case where the workspaces-only-on-primary
|
||||||
|
GSetting is set to false [Florian; #652580]
|
||||||
|
* Add support for background-size CSS property to St [Quentin; #633462]
|
||||||
|
* Port to new GJS Lang.Class framework [Giovanni; #664436]
|
||||||
|
* Finish port to GDBus [Giovanni; #664436]
|
||||||
|
* Stop using the deprecated Clutter default stage [Florian, Jasper; #664052]
|
||||||
|
* Fix bugs that kept browser plugin from working in WebKit-based browser
|
||||||
|
[Jasper; #666444]
|
||||||
|
* Fix typo that made uninstalling extensions not work [Jasper]
|
||||||
|
* Fix crash in browser plugin if shell is not run [Jürg]
|
||||||
|
* Reintroduce piscine paschal ovum [Giovanni; #666606]
|
||||||
|
* Network menu bug fixes
|
||||||
|
Giovanni; #664124, #665194, #665680, #666429, #666614]
|
||||||
|
* Misc bug fixes [Florian, Jasper, Jonny, Marina, Ron; #647587, #659272,
|
||||||
|
#664138, #665261, #666020, #666243]
|
||||||
|
* Build fixes [Owen]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Jürg Billeter, Giovanni Campagna, Stefano Candori, Cosimo Cecchi,
|
||||||
|
Matthias Clasen, Zan Dobersek, Quentin Glidic, Jonny Lamb, Ryan Lortie,
|
||||||
|
Seif Lotfy, Rui Matos, Florian Müllner, Bastien Nocera, Jasper St. Pierre,
|
||||||
|
Marc Plano-Lesay, Owen Taylor, Colin Walters, Ron Yorsten,
|
||||||
|
Marina Zhurakhinskaya
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
Petr Kovar [cs], Kris Thomsen [dk], Daniel Mustieles [es],
|
||||||
|
Ville-Pekka Vainio [fi], Yaron Shahrabani [he], Luca Ferretti [it],
|
||||||
|
Hideki Yamane [ja], Žygimantas Beručka [lt], Jovan Naumovski [mk],
|
||||||
|
Kjartan Maraas [nb], "Andreas N" [nn], Lucian Adrian Grijincu [ro],
|
||||||
|
Matej Urbančič [sl], Praveen Illa [te], Muhammet Kara [tr],
|
||||||
|
Daniel Korostil [uk], Aron Xu [zh_CN]
|
||||||
|
|
||||||
|
3.3.2
|
||||||
|
=====
|
||||||
|
* Port D-Bus usage in the shell to GDBus [Giovanni, Marc-Antoine, Florian,
|
||||||
|
Jasper, Matthias; #648651, #658078, #663902, #663941]
|
||||||
|
* Message tray
|
||||||
|
- Add right-click option to chats to mute the conversation [Ana; #659962]
|
||||||
|
- Don't steal the focus when popping up under the pointer [Rui; #661358]
|
||||||
|
* Looking Glass
|
||||||
|
- Add alt-Tab completion [Jason; #661054]
|
||||||
|
- Show errors from extensions in the extensions tab [Jasper; #660546]
|
||||||
|
- Allow switching tabs with <Control>PageUp/PageDown
|
||||||
|
- Theme consistently with the rest of the shell [Jason; 650900]
|
||||||
|
* Extension system
|
||||||
|
- Don't try to load disabled extensions at all [Jasper; #661815, #662704]
|
||||||
|
- Enable and disable plugins in a consistent order [Jasper; #661815, #662704]
|
||||||
|
- Add options to enable/disable extensions to gnome-shell-extension-tool
|
||||||
|
[Jasper; #661815]
|
||||||
|
* Adapt to Mutter change to GSettings [Florian, Matthias; #663429]
|
||||||
|
* Allow creating a new workspace by dragging a window or launcher in the
|
||||||
|
middle of two existing ones [Jasper; #646409]
|
||||||
|
* Allow using Alt-Tab while during drag-and-drop and other operations
|
||||||
|
that grab the pointer [Adel; #660457]
|
||||||
|
* Do a better job of finding the right user to authenticate
|
||||||
|
as when showing a PolKit dialog [Matthias; #651547]
|
||||||
|
* Control the D-Bus Eval() method by the developer-tools GSetting which
|
||||||
|
is used for looking glass and screen recorder. [Jasper; #662891]
|
||||||
|
* Fix browser plugin to work under WebKit-based browser [Jasper; #663823]
|
||||||
|
* Fix certain stacking issues with alt-Tab [Jasper; #660650]
|
||||||
|
* Fixes for GLib deprecations [Jasper; #662011]p
|
||||||
|
* Fixes for GTK+ deprecations [Florian, Rico; #662245]p
|
||||||
|
* Fixes for Clutter deprecations [Jasper; #662627]
|
||||||
|
* Visual improvements and UI tweaks [Florian, Jakub, Jasper;
|
||||||
|
#662800, #658096, #662226]
|
||||||
|
* Hard-code "Home" as the name for the home dir, rather than looking
|
||||||
|
it up via GSettings; avoids schema dependency [Cosimo; #559895]
|
||||||
|
* Don't show "Switch User" on single user machines [Florian; #657011]
|
||||||
|
* Generate documentation for St toolkit [Florian]
|
||||||
|
* Improve marking of strings for translation [Matthias, Piotr; #658664]
|
||||||
|
* Networking menu bug fixes [Giovanni; #650007, #651378, #659277, #663278]
|
||||||
|
* Code cleanups and leak fixes to StTextureCache
|
||||||
|
[Jasper, Florian; #660968, #662998]
|
||||||
|
* Code cleanups [Adel, Florian, Jasper; #662238, #663584]
|
||||||
|
* Build fixes [Adel, Colin, Florian, Ming Han]
|
||||||
|
* Misc bug fixes [Adel, Florian, "Fry", Jasper, Giovanni, Ray, Rui, Stefan;
|
||||||
|
#660520, #661029, #661231, #661623, #661921, #662235, #662236, #662502,
|
||||||
|
#662394, #662799, #662969, #663175, #663277, #663815, #663891, #662967]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Giovanni Campagna, Cosimo Cecchi, Matthias Clasen, Piotr Drąg, Adel Gadllah,
|
||||||
|
Rui Matos, Florian Müllner, Marc-Antoine Perennou, Ana Risteska,
|
||||||
|
Jason Siefken, Jakub Steiner, Ray Strode, Jasper St. Pierre, Ming Han Teh,
|
||||||
|
Rico Tzschichholz, Colin Walters, Stefan Zwanenburg
|
||||||
|
|
||||||
|
Translation:
|
||||||
|
Alexander Shopov [bg], Marek Černocký [cs], Mario Blättermann [de],
|
||||||
|
Kostas Papadimas [el], Bruce Cowan [en_GB], Kristjan Schmidt [eo],
|
||||||
|
Jorge González, Daniel Mustieles, Benjamín Valero Espinosa [es],
|
||||||
|
Mattias Põldaru [et], Arash Mousavi [fa], Ville-Pekka Vainio [fi],
|
||||||
|
Fran Diéguez [gl], Yaron Shahrabani [he], Hideki Yamane [ja],
|
||||||
|
Algimantas Margevičius [lt], Kjartan Maraas [nb], Daniel Nylander [se],
|
||||||
|
Matej Urbančič [sl], Praveen Illa [te], Muhammet Kara [tr],
|
||||||
|
Nguyễn Thái Ngọc Duy [vi], Cheng-Chia Tseng [zh_HK, zh_TW]
|
||||||
|
|
||||||
|
3.2.1
|
||||||
|
=====
|
||||||
|
* Restore the IM state on startup - if you were available in when you logged
|
||||||
|
out, then you'll be set available again when you log in.
|
||||||
|
[Florian; #65902, #661485]
|
||||||
|
* Improve searching for contacts in the overview: search more fields,
|
||||||
|
show a more meaningful name, require that all search terms match.
|
||||||
|
[Florian, Matthias; #660580]
|
||||||
|
* Improve search for applications in the overview: take frequency into
|
||||||
|
account and tweak match algorithm [Florian; #623372]
|
||||||
|
* Remove the "Show Password" switch from network password prompts, and
|
||||||
|
move the functionality to a right-click menu [Florian; #658948]
|
||||||
|
* Add context menus with Cut/Paste options to most entries [Florian; #659275]
|
||||||
|
* On screen keyboard:
|
||||||
|
- Show the keyboard immediately when it's turned enabled [Dan; #659743]
|
||||||
|
- Fix problem where keyboard would hide when starting to type
|
||||||
|
in the search entry [Nohemi; #661340]
|
||||||
|
- Fix problem with keyboard hiding when selected accented characters
|
||||||
|
[Nohemi; 661707]
|
||||||
|
* Login mode:
|
||||||
|
- Allow hitting Enter to select the first user [Ray; #657996]
|
||||||
|
- Fix flicker of a fingerprint prompt that could show up [Ray; #660492]
|
||||||
|
- Fix password bullets vanishing during login [Ray; #657894]
|
||||||
|
- Misc bug fixes and visual tweaks [Ray; #659763, #660919, #661479]
|
||||||
|
* Display a caps-lock warning in password entries [Florian; #660806]
|
||||||
|
* Show the state of installed extensions in Looking Glass [Jasper; #660494]
|
||||||
|
* Load user extensions after system ones [Jasper; #661815]
|
||||||
|
* Fix problem with many applications showing extra-large icons in
|
||||||
|
notifications [Marina; #659158]
|
||||||
|
* Fix a problem where alt-Tab had trouble tracking the current
|
||||||
|
application with certain applications such as Emacs. [Dan; #645026]
|
||||||
|
* Fix confusion between different users avatar images [Florian; #660585]
|
||||||
|
* Remove behavior where you could switch workspaces by bumping
|
||||||
|
a dragged window in the overview against a screen edge; it was
|
||||||
|
leftover and just confusing. [Florian; #660838]
|
||||||
|
* Fix long-standing bug where the Dash in the overview could end up mis-sized
|
||||||
|
and run off the screen [Florian; #649248]
|
||||||
|
* Fix automatic launching of applications when media is inserted
|
||||||
|
[Cosimo; #660821]
|
||||||
|
* Fix handling of vertically stacked monitors with NVIDIA drivers
|
||||||
|
[Florian; #661387]
|
||||||
|
* Translation marking fixes [Jasper, Wouter; #660600]
|
||||||
|
* Code cleanups and warning fixes [Adel, Dan, Florian, Jasper;
|
||||||
|
#659822, #659940, #660122, #660358, #660968, #661231]
|
||||||
|
* Small memory leak fixes [Florian, Jasper; #661231]
|
||||||
|
* Misc bug fixes [Adel, Florian, Jasper; #659274, #659861, #660166, #660310,
|
||||||
|
#660397, #660608, #660606, #660674, #660774. #660848, #661151, #661617]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Wouter Bolsterlee, Cosimo Cecchi, Matthias Clasen, Nohemi Fernandez,
|
||||||
|
Adel Gadllah, Florian Müllner, Jasper St. Pierre, Ray Strode, Dan Winship,
|
||||||
|
Marina Zhurakhinskaya
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
Tiffany Antopolski [eo], Xandru Armesto [ast], Alexander Shopov,
|
||||||
|
Ivaylo Valkov [bg], Gil Forcada [ca], Carles Ferrando [ca@valencia],
|
||||||
|
Mario Blättermann, Paul Seyfert [de], Bruce Cowan [en_GB],
|
||||||
|
Jorge González, Daniel Mustieles [es], Arash Mousavi [fa], Bruno Brouard [fr],
|
||||||
|
Seán de Búrca [ga], Fran Diéguez [gl], Gabor Kelemen [hu], Luca Ferretti [it],
|
||||||
|
Takayuki Kusano [ja], Changwoo Ryu [ko], Erdal Ronahi [ku],
|
||||||
|
Algimantas Margevičius [lt], Rudolfs Mazurs [lv], Wouter Bolsterlee [nl],
|
||||||
|
Piotr Drąg [pl], Adorilson Bezerra [pt_BR], Yuri Myasoedov [ru],
|
||||||
|
Matej Urbančič [sl], Daniel Nylander [sv], Miroslav Nikolić [sr, sr@latin],
|
||||||
|
Tirumurti Vasudevan [ta], Krishnababu Krothapalli [te], Daniel Korostil [uk],
|
||||||
|
Nguyễn Thái Ngọc Duy [vi], YunQiang Su [zh_CN]
|
||||||
|
|
||||||
|
3.2.0
|
||||||
|
=====
|
||||||
|
* Prevent the fallback on-screen keyboard from showing up while
|
||||||
|
GNOME Shell is running [Dan, #659865]
|
||||||
|
* Disable code to reposition windows around the on-screen keyboard;
|
||||||
|
it wasn't finished or working properly. [Dan; #659643]
|
||||||
|
* Fix interaction between on-screen keyboard and notifications
|
||||||
|
[Dan; #658603]
|
||||||
|
* Fix menu-sizing problems in right-to-left locales. [Florian; #659827]
|
||||||
|
* Update chat icons in the message tray when an avatar image changes
|
||||||
|
[Marina; #659768]
|
||||||
|
* Fix problem with empty notification bubbles being left [Marina; #659862]
|
||||||
|
* Fix problem with chat notifications bouncing when new messages come in.
|
||||||
|
[Marina; #659768]
|
||||||
|
* Fix bug that was causing SIP calls to automatically be accepted in some
|
||||||
|
circumstances [Guillaume; #660084]
|
||||||
|
* Fix string that should have been marked translatable [Frédéric]
|
||||||
|
* Fix a crash that could happen during CSS transitions [Florian; #659676]
|
||||||
|
* Build fixes [Colin, Florian]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Guillaume Desmottes, Florian Müllner, Frédéric Péters, Colin Walters,
|
||||||
|
Dan Winship, Marina Zhurakhinskaya
|
||||||
|
|
||||||
|
Translations:
|
||||||
|
Friedel Wolff [af], Nilamdyuti Goswami [as], Ihar Hrachyshka [be],
|
||||||
|
Ivaylo Valkov [bg], Gil Forcada [ca], Carles Ferrando [ca@valencia],
|
||||||
|
Petr Kovar [cs], Mario Blättermann [de], Kris Thomsen [dk],
|
||||||
|
Tiffany Antopolski, Kristjan Schmidt [eo], Daniel Mustieles [es],
|
||||||
|
Inaki Larranaga Murgoitio [eu], Tommi Vainikainen [fi], Bruno Brouard [fr],
|
||||||
|
Fran Dieguez [gl], Yaron Shahrabani [he], Gabor Kelemen [hu],
|
||||||
|
Andika Triwidada [id], Jiro Matsuzawa [ja], Changwoo Ryu [ko],
|
||||||
|
Rudolfs Mazurs [lv], Aurimas Černius [lt], Kjartan Maraas [nb],
|
||||||
|
A S Alam [pa], Piotr Drąg [pl], Duarte Loreto [pt], Djavan Fagundes,
|
||||||
|
Rodolfo Ribeiro Gomes, Gabriel F. Vilar [pt_BR], Yuri Myasoedov [ru],
|
||||||
|
Daniel Nylander [se], Martin Srebotnjak [sl], Michal Štrba [sv],
|
||||||
|
Krishnababu Krothapalli, Praveen Illa [te], Cheng-Chia Tseng [zh_KH, zh_TW]
|
||||||
|
|
||||||
3.1.92
|
3.1.92
|
||||||
======
|
======
|
||||||
|
|
||||||
|
@ -41,14 +41,12 @@
|
|||||||
"It can be used only by extensions.gnome.org"
|
"It can be used only by extensions.gnome.org"
|
||||||
#define PLUGIN_MIME_STRING "application/x-gnome-shell-integration::Gnome Shell Integration Dummy Content-Type";
|
#define PLUGIN_MIME_STRING "application/x-gnome-shell-integration::Gnome Shell Integration Dummy Content-Type";
|
||||||
|
|
||||||
#define PLUGIN_API_VERSION 1
|
#define PLUGIN_API_VERSION 5
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
GDBusProxy *proxy;
|
GDBusProxy *proxy;
|
||||||
} PluginData;
|
} PluginData;
|
||||||
|
|
||||||
/* =============== public entry points =================== */
|
|
||||||
|
|
||||||
static NPNetscapeFuncs funcs;
|
static NPNetscapeFuncs funcs;
|
||||||
|
|
||||||
static inline gchar *
|
static inline gchar *
|
||||||
@ -71,10 +69,7 @@ get_string_property (NPP instance,
|
|||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
result_str = NPVARIANT_TO_STRING (result);
|
result_str = NPVARIANT_TO_STRING (result);
|
||||||
if (strlen (result_str.UTF8Characters) != result_str.UTF8Length)
|
result_copy = g_strndup (result_str.UTF8Characters, result_str.UTF8Length);
|
||||||
goto out;
|
|
||||||
|
|
||||||
result_copy = g_strdup (result_str.UTF8Characters);
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
funcs.releasevariantvalue (&result);
|
funcs.releasevariantvalue (&result);
|
||||||
@ -109,7 +104,7 @@ check_origin_and_protocol (NPP instance)
|
|||||||
&location))
|
&location))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (!NPVARIANT_IS_OBJECT (document))
|
if (!NPVARIANT_IS_OBJECT (location))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
hostname = get_string_property (instance,
|
hostname = get_string_property (instance,
|
||||||
@ -150,6 +145,8 @@ check_origin_and_protocol (NPP instance)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* =============== public entry points =================== */
|
||||||
|
|
||||||
NPError
|
NPError
|
||||||
NP_Initialize(NPNetscapeFuncs *pfuncs, NPPluginFuncs *plugin)
|
NP_Initialize(NPNetscapeFuncs *pfuncs, NPPluginFuncs *plugin)
|
||||||
{
|
{
|
||||||
@ -164,6 +161,7 @@ NP_Initialize(NPNetscapeFuncs *pfuncs, NPPluginFuncs *plugin)
|
|||||||
plugin->newp = NPP_New;
|
plugin->newp = NPP_New;
|
||||||
plugin->destroy = NPP_Destroy;
|
plugin->destroy = NPP_Destroy;
|
||||||
plugin->getvalue = NPP_GetValue;
|
plugin->getvalue = NPP_GetValue;
|
||||||
|
plugin->setwindow = NPP_SetWindow;
|
||||||
|
|
||||||
return NPERR_NO_ERROR;
|
return NPERR_NO_ERROR;
|
||||||
}
|
}
|
||||||
@ -225,7 +223,7 @@ NPP_New(NPMIMEType mimetype,
|
|||||||
NULL, /* interface info */
|
NULL, /* interface info */
|
||||||
"org.gnome.Shell",
|
"org.gnome.Shell",
|
||||||
"/org/gnome/Shell",
|
"/org/gnome/Shell",
|
||||||
"org.gnome.Shell",
|
"org.gnome.Shell.Extensions",
|
||||||
NULL, /* GCancellable */
|
NULL, /* GCancellable */
|
||||||
&error);
|
&error);
|
||||||
if (!data->proxy)
|
if (!data->proxy)
|
||||||
@ -265,11 +263,14 @@ NPP_Destroy(NPP instance,
|
|||||||
/* =================== scripting interface =================== */
|
/* =================== scripting interface =================== */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NPObject parent;
|
NPObject parent;
|
||||||
NPP instance;
|
NPP instance;
|
||||||
GDBusProxy *proxy;
|
GDBusProxy *proxy;
|
||||||
NPObject *listener;
|
GSettings *settings;
|
||||||
gint signal_id;
|
NPObject *listener;
|
||||||
|
NPObject *restart_listener;
|
||||||
|
gint signal_id;
|
||||||
|
guint watch_name_id;
|
||||||
} PluginObject;
|
} PluginObject;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -287,7 +288,7 @@ on_shell_signal (GDBusProxy *proxy,
|
|||||||
gint32 status;
|
gint32 status;
|
||||||
gchar *error;
|
gchar *error;
|
||||||
NPVariant args[3];
|
NPVariant args[3];
|
||||||
NPVariant result;
|
NPVariant result = { NPVariantType_Void };
|
||||||
|
|
||||||
g_variant_get (parameters, "(sis)", &uuid, &status, &error);
|
g_variant_get (parameters, "(sis)", &uuid, &status, &error);
|
||||||
STRINGZ_TO_NPVARIANT (uuid, args[0]);
|
STRINGZ_TO_NPVARIANT (uuid, args[0]);
|
||||||
@ -303,6 +304,28 @@ on_shell_signal (GDBusProxy *proxy,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
on_shell_appeared (GDBusConnection *connection,
|
||||||
|
const gchar *name,
|
||||||
|
const gchar *name_owner,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
PluginObject *obj = (PluginObject*) user_data;
|
||||||
|
|
||||||
|
if (obj->restart_listener)
|
||||||
|
{
|
||||||
|
NPVariant result = { NPVariantType_Void };
|
||||||
|
|
||||||
|
funcs.invokeDefault (obj->instance, obj->restart_listener,
|
||||||
|
NULL, 0, &result);
|
||||||
|
|
||||||
|
funcs.releasevariantvalue (&result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#define SHELL_SCHEMA "org.gnome.shell"
|
||||||
|
#define ENABLED_EXTENSIONS_KEY "enabled-extensions"
|
||||||
|
|
||||||
static NPObject *
|
static NPObject *
|
||||||
plugin_object_allocate (NPP instance,
|
plugin_object_allocate (NPP instance,
|
||||||
NPClass *klass)
|
NPClass *klass)
|
||||||
@ -312,9 +335,18 @@ plugin_object_allocate (NPP instance,
|
|||||||
|
|
||||||
obj->instance = instance;
|
obj->instance = instance;
|
||||||
obj->proxy = g_object_ref (data->proxy);
|
obj->proxy = g_object_ref (data->proxy);
|
||||||
|
obj->settings = g_settings_new (SHELL_SCHEMA);
|
||||||
obj->signal_id = g_signal_connect (obj->proxy, "g-signal",
|
obj->signal_id = g_signal_connect (obj->proxy, "g-signal",
|
||||||
G_CALLBACK (on_shell_signal), obj);
|
G_CALLBACK (on_shell_signal), obj);
|
||||||
|
|
||||||
|
obj->watch_name_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
|
||||||
|
"org.gnome.Shell",
|
||||||
|
G_BUS_NAME_WATCHER_FLAGS_NONE,
|
||||||
|
on_shell_appeared,
|
||||||
|
NULL,
|
||||||
|
obj,
|
||||||
|
NULL);
|
||||||
|
|
||||||
g_debug ("plugin object created");
|
g_debug ("plugin object created");
|
||||||
|
|
||||||
return (NPObject*)obj;
|
return (NPObject*)obj;
|
||||||
@ -331,41 +363,22 @@ plugin_object_deallocate (NPObject *npobj)
|
|||||||
if (obj->listener)
|
if (obj->listener)
|
||||||
funcs.releaseobject (obj->listener);
|
funcs.releaseobject (obj->listener);
|
||||||
|
|
||||||
|
if (obj->watch_name_id)
|
||||||
|
g_bus_unwatch_name (obj->watch_name_id);
|
||||||
|
|
||||||
g_debug ("plugin object destroyed");
|
g_debug ("plugin object destroyed");
|
||||||
|
|
||||||
g_slice_free (PluginObject, obj);
|
g_slice_free (PluginObject, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
static NPIdentifier api_version_id;
|
|
||||||
static NPIdentifier shell_version_id;
|
|
||||||
static NPIdentifier get_info_id;
|
|
||||||
static NPIdentifier list_extensions_id;
|
|
||||||
static NPIdentifier enable_extension_id;
|
|
||||||
static NPIdentifier install_extension_id;
|
|
||||||
static NPIdentifier uninstall_extension_id;
|
|
||||||
static NPIdentifier onextension_changed_id;
|
|
||||||
static NPIdentifier get_errors_id;
|
|
||||||
|
|
||||||
static bool
|
|
||||||
plugin_object_has_method (NPObject *npobj,
|
|
||||||
NPIdentifier name)
|
|
||||||
{
|
|
||||||
return (name == get_info_id ||
|
|
||||||
name == list_extensions_id ||
|
|
||||||
name == enable_extension_id ||
|
|
||||||
name == install_extension_id ||
|
|
||||||
name == uninstall_extension_id ||
|
|
||||||
name == get_errors_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline gboolean
|
static inline gboolean
|
||||||
uuid_is_valid (const gchar *uuid)
|
uuid_is_valid (NPString string)
|
||||||
{
|
{
|
||||||
gsize i;
|
gsize i;
|
||||||
|
|
||||||
for (i = 0; uuid[i]; i ++)
|
for (i = 0; i < string.UTF8Length; i++)
|
||||||
{
|
{
|
||||||
gchar c = uuid[i];
|
gchar c = string.UTF8Characters[i];
|
||||||
if (c < 32 || c >= 127)
|
if (c < 32 || c >= 127)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@ -429,8 +442,73 @@ jsonify_variant (GVariant *variant,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
plugin_list_extensions (PluginObject *obj,
|
parse_args (const gchar *format_str,
|
||||||
NPVariant *result)
|
uint32_t argc,
|
||||||
|
const NPVariant *argv,
|
||||||
|
...)
|
||||||
|
{
|
||||||
|
va_list args;
|
||||||
|
gsize i;
|
||||||
|
gboolean ret = FALSE;
|
||||||
|
|
||||||
|
if (strlen (format_str) != argc)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
va_start (args, argv);
|
||||||
|
|
||||||
|
for (i = 0; format_str[i]; i++)
|
||||||
|
{
|
||||||
|
gpointer arg_location;
|
||||||
|
const NPVariant arg = argv[i];
|
||||||
|
|
||||||
|
arg_location = va_arg (args, gpointer);
|
||||||
|
|
||||||
|
switch (format_str[i])
|
||||||
|
{
|
||||||
|
case 'u':
|
||||||
|
{
|
||||||
|
NPString string;
|
||||||
|
|
||||||
|
if (!NPVARIANT_IS_STRING (arg))
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
string = NPVARIANT_TO_STRING (arg);
|
||||||
|
|
||||||
|
if (!uuid_is_valid (string))
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
*(gchar **) arg_location = g_strndup (string.UTF8Characters, string.UTF8Length);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'b':
|
||||||
|
if (!NPVARIANT_IS_BOOLEAN (arg))
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
*(gboolean *) arg_location = NPVARIANT_TO_BOOLEAN (arg);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'o':
|
||||||
|
if (!NPVARIANT_IS_OBJECT (arg))
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
*(NPObject **) arg_location = NPVARIANT_TO_OBJECT (arg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = TRUE;
|
||||||
|
|
||||||
|
out:
|
||||||
|
va_end (args);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
plugin_list_extensions (PluginObject *obj,
|
||||||
|
uint32_t argc,
|
||||||
|
const NPVariant *args,
|
||||||
|
NPVariant *result)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
GVariant *res;
|
GVariant *res;
|
||||||
@ -454,71 +532,160 @@ plugin_list_extensions (PluginObject *obj,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
plugin_enable_extension (PluginObject *obj,
|
plugin_enable_extension (PluginObject *obj,
|
||||||
NPString uuid,
|
uint32_t argc,
|
||||||
gboolean enabled)
|
const NPVariant *argv,
|
||||||
|
NPVariant *result)
|
||||||
{
|
{
|
||||||
const gchar *uuid_str = uuid.UTF8Characters;
|
gboolean ret;
|
||||||
if (!uuid_is_valid (uuid_str))
|
gchar *uuid;
|
||||||
|
gboolean enabled;
|
||||||
|
gsize length;
|
||||||
|
gchar **uuids;
|
||||||
|
const gchar **new_uuids;
|
||||||
|
|
||||||
|
if (!parse_args ("ub", argc, argv, &uuid, &enabled))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
g_dbus_proxy_call (obj->proxy,
|
uuids = g_settings_get_strv (obj->settings, ENABLED_EXTENSIONS_KEY);
|
||||||
(enabled ? "EnableExtension" : "DisableExtension"),
|
length = g_strv_length (uuids);
|
||||||
g_variant_new ("(s)", uuid_str),
|
|
||||||
G_DBUS_CALL_FLAGS_NONE,
|
|
||||||
-1, /* timeout */
|
|
||||||
NULL, /* cancellable */
|
|
||||||
NULL, /* callback */
|
|
||||||
NULL /* user_data */);
|
|
||||||
|
|
||||||
return TRUE;
|
if (enabled)
|
||||||
|
{
|
||||||
|
new_uuids = g_new (const gchar *, length + 2); /* New key, NULL */
|
||||||
|
memcpy (new_uuids, uuids, length * sizeof (*new_uuids));
|
||||||
|
new_uuids[length] = uuid;
|
||||||
|
new_uuids[length + 1] = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gsize i = 0, j = 0;
|
||||||
|
new_uuids = g_new (const gchar *, length);
|
||||||
|
for (i = 0; i < length; i ++)
|
||||||
|
{
|
||||||
|
if (g_str_equal (uuids[i], uuid))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
new_uuids[j] = uuids[i];
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
|
||||||
|
new_uuids[j] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = g_settings_set_strv (obj->settings,
|
||||||
|
ENABLED_EXTENSIONS_KEY,
|
||||||
|
new_uuids);
|
||||||
|
|
||||||
|
g_strfreev (uuids);
|
||||||
|
g_free (new_uuids);
|
||||||
|
g_free (uuid);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef struct _AsyncClosure AsyncClosure;
|
||||||
|
|
||||||
|
struct _AsyncClosure {
|
||||||
|
PluginObject *obj;
|
||||||
|
NPObject *callback;
|
||||||
|
NPObject *errback;
|
||||||
|
};
|
||||||
|
|
||||||
|
static void
|
||||||
|
install_extension_cb (GObject *proxy,
|
||||||
|
GAsyncResult *async_res,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
AsyncClosure *async_closure = (AsyncClosure *) user_data;
|
||||||
|
GError *error = NULL;
|
||||||
|
GVariant *res;
|
||||||
|
NPVariant args[1];
|
||||||
|
NPVariant result = { NPVariantType_Void };
|
||||||
|
NPObject *callback;
|
||||||
|
|
||||||
|
res = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), async_res, &error);
|
||||||
|
|
||||||
|
if (res == NULL)
|
||||||
|
{
|
||||||
|
if (g_dbus_error_is_remote_error (error))
|
||||||
|
g_dbus_error_strip_remote_error (error);
|
||||||
|
STRINGZ_TO_NPVARIANT (error->message, args[0]);
|
||||||
|
callback = async_closure->errback;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
char *string_result;
|
||||||
|
g_variant_get (res, "(&s)", &string_result);
|
||||||
|
STRINGZ_TO_NPVARIANT (string_result, args[0]);
|
||||||
|
callback = async_closure->callback;
|
||||||
|
}
|
||||||
|
|
||||||
|
funcs.invokeDefault (async_closure->obj->instance,
|
||||||
|
callback, args, 1, &result);
|
||||||
|
|
||||||
|
funcs.releasevariantvalue (&result);
|
||||||
|
|
||||||
|
funcs.releaseobject (async_closure->callback);
|
||||||
|
funcs.releaseobject (async_closure->errback);
|
||||||
|
g_slice_free (AsyncClosure, async_closure);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
plugin_install_extension (PluginObject *obj,
|
plugin_install_extension (PluginObject *obj,
|
||||||
NPString uuid,
|
uint32_t argc,
|
||||||
NPString version_tag)
|
const NPVariant *argv,
|
||||||
|
NPVariant *result)
|
||||||
{
|
{
|
||||||
const gchar *uuid_str = uuid.UTF8Characters;
|
gchar *uuid;
|
||||||
if (!uuid_is_valid (uuid_str))
|
NPObject *callback, *errback;
|
||||||
|
AsyncClosure *async_closure;
|
||||||
|
|
||||||
|
if (!parse_args ("uoo", argc, argv, &uuid, &callback, &errback))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
async_closure = g_slice_new (AsyncClosure);
|
||||||
|
async_closure->obj = obj;
|
||||||
|
async_closure->callback = funcs.retainobject (callback);
|
||||||
|
async_closure->errback = funcs.retainobject (errback);
|
||||||
|
|
||||||
g_dbus_proxy_call (obj->proxy,
|
g_dbus_proxy_call (obj->proxy,
|
||||||
"InstallRemoteExtension",
|
"InstallRemoteExtension",
|
||||||
g_variant_new ("(ss)",
|
g_variant_new ("(s)", uuid),
|
||||||
uuid_str,
|
|
||||||
version_tag.UTF8Characters),
|
|
||||||
G_DBUS_CALL_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1, /* timeout */
|
-1, /* timeout */
|
||||||
NULL, /* cancellable */
|
NULL, /* cancellable */
|
||||||
NULL, /* callback */
|
install_extension_cb,
|
||||||
NULL /* user_data */);
|
async_closure);
|
||||||
|
|
||||||
|
g_free (uuid);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
plugin_uninstall_extension (PluginObject *obj,
|
plugin_uninstall_extension (PluginObject *obj,
|
||||||
NPString uuid,
|
uint32_t argc,
|
||||||
NPVariant *result)
|
const NPVariant *argv,
|
||||||
|
NPVariant *result)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
GVariant *res;
|
GVariant *res;
|
||||||
const gchar *uuid_str;
|
gchar *uuid;
|
||||||
|
|
||||||
uuid_str = uuid.UTF8Characters;
|
if (!parse_args ("u", argc, argv, &uuid))
|
||||||
if (!uuid_is_valid (uuid_str))
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
res = g_dbus_proxy_call_sync (obj->proxy,
|
res = g_dbus_proxy_call_sync (obj->proxy,
|
||||||
"UninstallExtension",
|
"UninstallExtension",
|
||||||
g_variant_new ("(s)",
|
g_variant_new ("(s)", uuid),
|
||||||
uuid_str),
|
|
||||||
G_DBUS_CALL_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1, /* timeout */
|
-1, /* timeout */
|
||||||
NULL, /* cancellable */
|
NULL, /* cancellable */
|
||||||
&error);
|
&error);
|
||||||
|
|
||||||
|
g_free (uuid);
|
||||||
|
|
||||||
if (!res)
|
if (!res)
|
||||||
{
|
{
|
||||||
g_warning ("Failed to uninstall extension: %s", error->message);
|
g_warning ("Failed to uninstall extension: %s", error->message);
|
||||||
@ -530,26 +697,28 @@ plugin_uninstall_extension (PluginObject *obj,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
plugin_get_info (PluginObject *obj,
|
plugin_get_info (PluginObject *obj,
|
||||||
NPString uuid,
|
uint32_t argc,
|
||||||
NPVariant *result)
|
const NPVariant *argv,
|
||||||
|
NPVariant *result)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
GVariant *res;
|
GVariant *res;
|
||||||
const gchar *uuid_str;
|
gchar *uuid;
|
||||||
|
|
||||||
uuid_str = uuid.UTF8Characters;
|
if (!parse_args ("u", argc, argv, &uuid))
|
||||||
if (!uuid_is_valid (uuid_str))
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
res = g_dbus_proxy_call_sync (obj->proxy,
|
res = g_dbus_proxy_call_sync (obj->proxy,
|
||||||
"GetExtensionInfo",
|
"GetExtensionInfo",
|
||||||
g_variant_new ("(s)", uuid_str),
|
g_variant_new ("(s)", uuid),
|
||||||
G_DBUS_CALL_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1, /* timeout */
|
-1, /* timeout */
|
||||||
NULL, /* cancellable */
|
NULL, /* cancellable */
|
||||||
&error);
|
&error);
|
||||||
|
|
||||||
|
g_free (uuid);
|
||||||
|
|
||||||
if (!res)
|
if (!res)
|
||||||
{
|
{
|
||||||
g_warning ("Failed to retrieve extension metadata: %s", error->message);
|
g_warning ("Failed to retrieve extension metadata: %s", error->message);
|
||||||
@ -561,21 +730,21 @@ plugin_get_info (PluginObject *obj,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
plugin_get_errors (PluginObject *obj,
|
plugin_get_errors (PluginObject *obj,
|
||||||
NPString uuid,
|
uint32_t argc,
|
||||||
NPVariant *result)
|
const NPVariant *argv,
|
||||||
|
NPVariant *result)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
GVariant *res;
|
GVariant *res;
|
||||||
const gchar *uuid_str;
|
gchar *uuid;
|
||||||
|
|
||||||
uuid_str = uuid.UTF8Characters;
|
if (!parse_args ("u", argc, argv, &uuid))
|
||||||
if (!uuid_is_valid (uuid_str))
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
res = g_dbus_proxy_call_sync (obj->proxy,
|
res = g_dbus_proxy_call_sync (obj->proxy,
|
||||||
"GetExtensionErrors",
|
"GetExtensionErrors",
|
||||||
g_variant_new ("(s)", uuid_str),
|
g_variant_new ("(s)", uuid),
|
||||||
G_DBUS_CALL_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1, /* timeout */
|
-1, /* timeout */
|
||||||
NULL, /* cancellable */
|
NULL, /* cancellable */
|
||||||
@ -591,6 +760,29 @@ plugin_get_errors (PluginObject *obj,
|
|||||||
return jsonify_variant (res, result);
|
return jsonify_variant (res, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
plugin_launch_extension_prefs (PluginObject *obj,
|
||||||
|
uint32_t argc,
|
||||||
|
const NPVariant *argv,
|
||||||
|
NPVariant *result)
|
||||||
|
{
|
||||||
|
gchar *uuid;
|
||||||
|
|
||||||
|
if (!parse_args ("u", argc, argv, &uuid))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
g_dbus_proxy_call (obj->proxy,
|
||||||
|
"LaunchExtensionPrefs",
|
||||||
|
g_variant_new ("(s)", uuid),
|
||||||
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
|
-1, /* timeout */
|
||||||
|
NULL, /* cancellable */
|
||||||
|
NULL, /* callback */
|
||||||
|
NULL /* user_data */);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
plugin_get_api_version (PluginObject *obj,
|
plugin_get_api_version (PluginObject *obj,
|
||||||
NPVariant *result)
|
NPVariant *result)
|
||||||
@ -636,14 +828,45 @@ plugin_get_shell_version (PluginObject *obj,
|
|||||||
STRINGN_TO_NPVARIANT (buffer, length, *result);
|
STRINGN_TO_NPVARIANT (buffer, length, *result);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
g_variant_unref (res);
|
if (res)
|
||||||
|
g_variant_unref (res);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define METHODS \
|
||||||
|
METHOD (list_extensions) \
|
||||||
|
METHOD (get_info) \
|
||||||
|
METHOD (enable_extension) \
|
||||||
|
METHOD (install_extension) \
|
||||||
|
METHOD (uninstall_extension) \
|
||||||
|
METHOD (get_errors) \
|
||||||
|
METHOD (launch_extension_prefs) \
|
||||||
|
/* */
|
||||||
|
|
||||||
|
#define METHOD(x) \
|
||||||
|
static NPIdentifier x##_id;
|
||||||
|
METHODS
|
||||||
|
#undef METHOD
|
||||||
|
|
||||||
|
static NPIdentifier api_version_id;
|
||||||
|
static NPIdentifier shell_version_id;
|
||||||
|
static NPIdentifier onextension_changed_id;
|
||||||
|
static NPIdentifier onrestart_id;
|
||||||
|
|
||||||
|
static bool
|
||||||
|
plugin_object_has_method (NPObject *npobj,
|
||||||
|
NPIdentifier name)
|
||||||
|
{
|
||||||
|
#define METHOD(x) (name == (x##_id)) ||
|
||||||
|
/* expands to (name == list_extensions_id) || FALSE; */
|
||||||
|
return METHODS FALSE;
|
||||||
|
#undef METHOD
|
||||||
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
plugin_object_invoke (NPObject *npobj,
|
plugin_object_invoke (NPObject *npobj,
|
||||||
NPIdentifier name,
|
NPIdentifier name,
|
||||||
const NPVariant *args,
|
const NPVariant *argv,
|
||||||
uint32_t argc,
|
uint32_t argc,
|
||||||
NPVariant *result)
|
NPVariant *result)
|
||||||
{
|
{
|
||||||
@ -655,53 +878,13 @@ plugin_object_invoke (NPObject *npobj,
|
|||||||
|
|
||||||
VOID_TO_NPVARIANT (*result);
|
VOID_TO_NPVARIANT (*result);
|
||||||
|
|
||||||
if (!plugin_object_has_method (npobj, name))
|
#define METHOD(x) \
|
||||||
return FALSE;
|
if (name == x##_id) \
|
||||||
|
return plugin_##x (obj, argc, argv, result);
|
||||||
|
METHODS
|
||||||
|
#undef METHOD
|
||||||
|
|
||||||
if (name == list_extensions_id)
|
return FALSE;
|
||||||
return plugin_list_extensions (obj, result);
|
|
||||||
else if (name == get_info_id)
|
|
||||||
{
|
|
||||||
if (!NPVARIANT_IS_STRING(args[0])) return FALSE;
|
|
||||||
|
|
||||||
return plugin_get_info (obj, NPVARIANT_TO_STRING(args[0]), result);
|
|
||||||
}
|
|
||||||
else if (name == enable_extension_id)
|
|
||||||
{
|
|
||||||
if (!NPVARIANT_IS_STRING(args[0])) return FALSE;
|
|
||||||
if (!NPVARIANT_IS_BOOLEAN(args[1])) return FALSE;
|
|
||||||
|
|
||||||
return plugin_enable_extension (obj,
|
|
||||||
NPVARIANT_TO_STRING(args[0]),
|
|
||||||
NPVARIANT_TO_BOOLEAN(args[1]));
|
|
||||||
}
|
|
||||||
else if (name == install_extension_id)
|
|
||||||
{
|
|
||||||
if (!NPVARIANT_IS_STRING(args[0])) return FALSE;
|
|
||||||
if (!NPVARIANT_IS_STRING(args[1])) return FALSE;
|
|
||||||
|
|
||||||
return plugin_install_extension (obj,
|
|
||||||
NPVARIANT_TO_STRING(args[0]),
|
|
||||||
NPVARIANT_TO_STRING(args[1]));
|
|
||||||
}
|
|
||||||
else if (name == uninstall_extension_id)
|
|
||||||
{
|
|
||||||
if (!NPVARIANT_IS_STRING(args[0])) return FALSE;
|
|
||||||
|
|
||||||
return plugin_uninstall_extension (obj,
|
|
||||||
NPVARIANT_TO_STRING(args[0]),
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
else if (name == get_errors_id)
|
|
||||||
{
|
|
||||||
if (!NPVARIANT_IS_STRING(args[0])) return FALSE;
|
|
||||||
|
|
||||||
return plugin_get_errors (obj,
|
|
||||||
NPVARIANT_TO_STRING(args[0]),
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
@ -709,6 +892,7 @@ plugin_object_has_property (NPObject *npobj,
|
|||||||
NPIdentifier name)
|
NPIdentifier name)
|
||||||
{
|
{
|
||||||
return (name == onextension_changed_id ||
|
return (name == onextension_changed_id ||
|
||||||
|
name == onrestart_id ||
|
||||||
name == api_version_id ||
|
name == api_version_id ||
|
||||||
name == shell_version_id);
|
name == shell_version_id);
|
||||||
}
|
}
|
||||||
@ -735,6 +919,33 @@ plugin_object_get_property (NPObject *npobj,
|
|||||||
else
|
else
|
||||||
NULL_TO_NPVARIANT (*result);
|
NULL_TO_NPVARIANT (*result);
|
||||||
}
|
}
|
||||||
|
else if (name == onrestart_id)
|
||||||
|
{
|
||||||
|
if (obj->restart_listener)
|
||||||
|
OBJECT_TO_NPVARIANT (obj->restart_listener, *result);
|
||||||
|
else
|
||||||
|
NULL_TO_NPVARIANT (*result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool
|
||||||
|
plugin_object_set_callback (NPObject **listener,
|
||||||
|
const NPVariant *value)
|
||||||
|
{
|
||||||
|
if (!NPVARIANT_IS_OBJECT (*value) && !NPVARIANT_IS_NULL (*value))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (*listener)
|
||||||
|
funcs.releaseobject (*listener);
|
||||||
|
*listener = NULL;
|
||||||
|
|
||||||
|
if (NPVARIANT_IS_OBJECT (*value))
|
||||||
|
{
|
||||||
|
*listener = NPVARIANT_TO_OBJECT (*value);
|
||||||
|
funcs.retainobject (*listener);
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -746,25 +957,13 @@ plugin_object_set_property (NPObject *npobj,
|
|||||||
{
|
{
|
||||||
PluginObject *obj;
|
PluginObject *obj;
|
||||||
|
|
||||||
if (!plugin_object_has_property (npobj, name))
|
obj = (PluginObject *)npobj;
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (name == onextension_changed_id)
|
if (name == onextension_changed_id)
|
||||||
{
|
return plugin_object_set_callback (&obj->listener, value);
|
||||||
obj = (PluginObject*) npobj;
|
|
||||||
if (obj->listener)
|
|
||||||
funcs.releaseobject (obj->listener);
|
|
||||||
|
|
||||||
obj->listener = NULL;
|
if (name == onrestart_id)
|
||||||
if (NPVARIANT_IS_OBJECT (*value))
|
return plugin_object_set_callback (&obj->restart_listener, value);
|
||||||
{
|
|
||||||
obj->listener = NPVARIANT_TO_OBJECT (*value);
|
|
||||||
funcs.retainobject (obj->listener);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
else if (NPVARIANT_IS_NULL (*value))
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -798,7 +997,9 @@ init_methods_and_properties (void)
|
|||||||
install_extension_id = funcs.getstringidentifier ("installExtension");
|
install_extension_id = funcs.getstringidentifier ("installExtension");
|
||||||
uninstall_extension_id = funcs.getstringidentifier ("uninstallExtension");
|
uninstall_extension_id = funcs.getstringidentifier ("uninstallExtension");
|
||||||
get_errors_id = funcs.getstringidentifier ("getExtensionErrors");
|
get_errors_id = funcs.getstringidentifier ("getExtensionErrors");
|
||||||
|
launch_extension_prefs_id = funcs.getstringidentifier ("launchExtensionPrefs");
|
||||||
|
|
||||||
|
onrestart_id = funcs.getstringidentifier ("onshellrestart");
|
||||||
onextension_changed_id = funcs.getstringidentifier ("onchange");
|
onextension_changed_id = funcs.getstringidentifier ("onchange");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -816,9 +1017,23 @@ NPP_GetValue(NPP instance,
|
|||||||
|
|
||||||
*(NPObject**)value = funcs.createobject (instance, &plugin_class);
|
*(NPObject**)value = funcs.createobject (instance, &plugin_class);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case NPPVpluginNeedsXEmbed:
|
||||||
|
*(bool *)value = TRUE;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NPERR_NO_ERROR;
|
return NPERR_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Opera tries to call NPP_SetWindow without checking the
|
||||||
|
* NULL pointer beforehand. */
|
||||||
|
NPError
|
||||||
|
NPP_SetWindow(NPP instance,
|
||||||
|
NPWindow *window)
|
||||||
|
{
|
||||||
|
return NPERR_NO_ERROR;
|
||||||
|
}
|
||||||
|
145
configure.ac
@ -1,5 +1,5 @@
|
|||||||
AC_PREREQ(2.63)
|
AC_PREREQ(2.63)
|
||||||
AC_INIT([gnome-shell],[3.1.92],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell],[gnome-shell])
|
AC_INIT([gnome-shell],[3.7.1],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell],[gnome-shell])
|
||||||
|
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
AC_CONFIG_SRCDIR([src/shell-global.c])
|
AC_CONFIG_SRCDIR([src/shell-global.c])
|
||||||
@ -9,7 +9,7 @@ AC_CONFIG_AUX_DIR([config])
|
|||||||
AC_SUBST([PACKAGE_NAME], ["$PACKAGE_NAME"])
|
AC_SUBST([PACKAGE_NAME], ["$PACKAGE_NAME"])
|
||||||
AC_SUBST([PACKAGE_VERSION], ["$PACKAGE_VERSION"])
|
AC_SUBST([PACKAGE_VERSION], ["$PACKAGE_VERSION"])
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE([1.10 dist-xz no-dist-gzip foreign])
|
AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz tar-ustar foreign])
|
||||||
AM_MAINTAINER_MODE([enable])
|
AM_MAINTAINER_MODE([enable])
|
||||||
|
|
||||||
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
||||||
@ -36,9 +36,7 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
|
|||||||
|
|
||||||
PKG_PROG_PKG_CONFIG([0.22])
|
PKG_PROG_PKG_CONFIG([0.22])
|
||||||
|
|
||||||
# GConf stuff
|
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
||||||
AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
|
|
||||||
AM_GCONF_SOURCE_2
|
|
||||||
|
|
||||||
GLIB_GSETTINGS
|
GLIB_GSETTINGS
|
||||||
|
|
||||||
@ -48,46 +46,50 @@ AC_SUBST(PYTHON)
|
|||||||
|
|
||||||
# We need at least this, since gst_plugin_register_static() was added
|
# We need at least this, since gst_plugin_register_static() was added
|
||||||
# in 0.10.16, but nothing older than 0.10.21 has been tested.
|
# in 0.10.16, but nothing older than 0.10.21 has been tested.
|
||||||
GSTREAMER_MIN_VERSION=0.10.16
|
GSTREAMER_MIN_VERSION=0.11.92
|
||||||
|
|
||||||
recorder_modules=
|
recorder_modules=
|
||||||
build_recorder=false
|
build_recorder=false
|
||||||
AC_MSG_CHECKING([for GStreamer (needed for recording functionality)])
|
AC_MSG_CHECKING([for GStreamer (needed for recording functionality)])
|
||||||
if $PKG_CONFIG --exists gstreamer-0.10 '>=' $GSTREAMER_MIN_VERSION ; then
|
if $PKG_CONFIG --exists gstreamer-1.0 '>=' $GSTREAMER_MIN_VERSION ; then
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
build_recorder=true
|
build_recorder=true
|
||||||
recorder_modules="gstreamer-0.10 gstreamer-base-0.10 x11"
|
recorder_modules="gstreamer-1.0 gstreamer-base-1.0 x11 gtk+-3.0"
|
||||||
PKG_CHECK_MODULES(TEST_SHELL_RECORDER, $recorder_modules clutter-1.0 xfixes)
|
PKG_CHECK_MODULES(TEST_SHELL_RECORDER, $recorder_modules clutter-1.0 xfixes gl)
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AM_CONDITIONAL(BUILD_RECORDER, $build_recorder)
|
AM_CONDITIONAL(BUILD_RECORDER, $build_recorder)
|
||||||
|
|
||||||
CLUTTER_MIN_VERSION=1.7.5
|
CLUTTER_MIN_VERSION=1.11.11
|
||||||
GOBJECT_INTROSPECTION_MIN_VERSION=0.10.1
|
GOBJECT_INTROSPECTION_MIN_VERSION=0.10.1
|
||||||
GJS_MIN_VERSION=1.29.15
|
GJS_MIN_VERSION=1.33.2
|
||||||
MUTTER_MIN_VERSION=3.0.0
|
MUTTER_MIN_VERSION=3.7.1
|
||||||
FOLKS_MIN_VERSION=0.5.2
|
GTK_MIN_VERSION=3.3.9
|
||||||
GTK_MIN_VERSION=3.0.0
|
GIO_MIN_VERSION=2.35.0
|
||||||
GIO_MIN_VERSION=2.29.10
|
LIBECAL_MIN_VERSION=3.5.3
|
||||||
LIBECAL_MIN_VERSION=2.32.0
|
LIBEDATASERVER_MIN_VERSION=3.5.3
|
||||||
LIBEDATASERVER_MIN_VERSION=1.2.0
|
LIBEDATASERVERUI_MIN_VERSION=3.5.3
|
||||||
LIBEDATASERVERUI_MIN_VERSION=2.91.6
|
TELEPATHY_GLIB_MIN_VERSION=0.17.5
|
||||||
TELEPATHY_GLIB_MIN_VERSION=0.15.5
|
|
||||||
TELEPATHY_LOGGER_MIN_VERSION=0.2.4
|
TELEPATHY_LOGGER_MIN_VERSION=0.2.4
|
||||||
POLKIT_MIN_VERSION=0.100
|
POLKIT_MIN_VERSION=0.100
|
||||||
STARTUP_NOTIFICATION_MIN_VERSION=0.11
|
STARTUP_NOTIFICATION_MIN_VERSION=0.11
|
||||||
|
GCR_MIN_VERSION=3.3.90
|
||||||
|
GNOME_DESKTOP_REQUIRED_VERSION=3.7.1
|
||||||
|
GNOME_MENUS_REQUIRED_VERSION=3.5.3
|
||||||
|
|
||||||
# Collect more than 20 libraries for a prize!
|
# Collect more than 20 libraries for a prize!
|
||||||
PKG_CHECK_MODULES(GNOME_SHELL, gio-2.0 >= $GIO_MIN_VERSION
|
PKG_CHECK_MODULES(GNOME_SHELL, gio-unix-2.0 >= $GIO_MIN_VERSION
|
||||||
gio-unix-2.0 dbus-glib-1 libxml-2.0
|
libxml-2.0
|
||||||
gtk+-3.0 >= $GTK_MIN_VERSION
|
gtk+-3.0 >= $GTK_MIN_VERSION
|
||||||
folks >= $FOLKS_MIN_VERSION
|
atk-bridge-2.0
|
||||||
libmutter >= $MUTTER_MIN_VERSION
|
libmutter >= $MUTTER_MIN_VERSION
|
||||||
gjs-internals-1.0 >= $GJS_MIN_VERSION
|
gjs-internals-1.0 >= $GJS_MIN_VERSION
|
||||||
libgnome-menu-3.0 $recorder_modules gconf-2.0
|
libgnome-menu-3.0 >= $GNOME_MENUS_REQUIRED_VERSION
|
||||||
|
$recorder_modules
|
||||||
gdk-x11-3.0 libsoup-2.4
|
gdk-x11-3.0 libsoup-2.4
|
||||||
|
gl
|
||||||
clutter-x11-1.0 >= $CLUTTER_MIN_VERSION
|
clutter-x11-1.0 >= $CLUTTER_MIN_VERSION
|
||||||
clutter-glx-1.0 >= $CLUTTER_MIN_VERSION
|
clutter-glx-1.0 >= $CLUTTER_MIN_VERSION
|
||||||
libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_MIN_VERSION
|
libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_MIN_VERSION
|
||||||
@ -96,7 +98,8 @@ PKG_CHECK_MODULES(GNOME_SHELL, gio-2.0 >= $GIO_MIN_VERSION
|
|||||||
telepathy-glib >= $TELEPATHY_GLIB_MIN_VERSION
|
telepathy-glib >= $TELEPATHY_GLIB_MIN_VERSION
|
||||||
telepathy-logger-0.2 >= $TELEPATHY_LOGGER_MIN_VERSION
|
telepathy-logger-0.2 >= $TELEPATHY_LOGGER_MIN_VERSION
|
||||||
polkit-agent-1 >= $POLKIT_MIN_VERSION xfixes
|
polkit-agent-1 >= $POLKIT_MIN_VERSION xfixes
|
||||||
libnm-glib libnm-util gnome-keyring-1)
|
libnm-glib libnm-util gnome-keyring-1
|
||||||
|
gcr-3 >= $GCR_MIN_VERSION)
|
||||||
|
|
||||||
PKG_CHECK_MODULES(SHELL_PERF_HELPER, gtk+-3.0 gio-2.0)
|
PKG_CHECK_MODULES(SHELL_PERF_HELPER, gtk+-3.0 gio-2.0)
|
||||||
|
|
||||||
@ -104,13 +107,10 @@ PKG_CHECK_MODULES(SHELL_HOTPLUG_SNIFFER, gio-2.0 gdk-pixbuf-2.0)
|
|||||||
|
|
||||||
PKG_CHECK_MODULES(BROWSER_PLUGIN, gio-2.0 >= $GIO_MIN_VERSION json-glib-1.0 >= 0.13.2)
|
PKG_CHECK_MODULES(BROWSER_PLUGIN, gio-2.0 >= $GIO_MIN_VERSION json-glib-1.0 >= 0.13.2)
|
||||||
|
|
||||||
GJS_VERSION=`$PKG_CONFIG --modversion gjs-internals-1.0`
|
GNOME_KEYBINDINGS_KEYSDIR=`$PKG_CONFIG --variable keysdir gnome-keybindings`
|
||||||
AC_DEFINE_UNQUOTED([GJS_VERSION], ["$GJS_VERSION"], [The version of GJS we're linking to])
|
AC_SUBST([GNOME_KEYBINDINGS_KEYSDIR])
|
||||||
AC_SUBST([GJS_VERSION], ["$GJS_VERSION"])
|
|
||||||
|
|
||||||
GOBJECT_INTROSPECTION_CHECK([$GOBJECT_INTROSPECTION_MIN_VERSION])
|
GOBJECT_INTROSPECTION_CHECK([$GOBJECT_INTROSPECTION_MIN_VERSION])
|
||||||
JHBUILD_TYPELIBDIR="$INTROSPECTION_TYPELIBDIR"
|
|
||||||
AC_SUBST(JHBUILD_TYPELIBDIR)
|
|
||||||
|
|
||||||
saved_CFLAGS=$CFLAGS
|
saved_CFLAGS=$CFLAGS
|
||||||
saved_LIBS=$LIBS
|
saved_LIBS=$LIBS
|
||||||
@ -120,17 +120,18 @@ AC_CHECK_FUNCS(JS_NewGlobalObject XFixesCreatePointerBarrier)
|
|||||||
CFLAGS=$saved_CFLAGS
|
CFLAGS=$saved_CFLAGS
|
||||||
LIBS=$saved_LIBS
|
LIBS=$saved_LIBS
|
||||||
|
|
||||||
PKG_CHECK_MODULES(ST, clutter-1.0 gtk+-3.0 libcroco-0.6 >= 0.6.2 gnome-desktop-3.0 >= 2.90.0 x11)
|
PKG_CHECK_MODULES(GNOME_SHELL_JS, gio-2.0 gjs-internals-1.0 >= $GJS_MIN_VERSION)
|
||||||
PKG_CHECK_MODULES(GDMUSER, dbus-glib-1 gtk+-3.0)
|
PKG_CHECK_MODULES(ST, clutter-1.0 gtk+-3.0 libcroco-0.6 >= 0.6.8 x11)
|
||||||
PKG_CHECK_MODULES(TRAY, gtk+-3.0)
|
PKG_CHECK_MODULES(TRAY, gtk+-3.0)
|
||||||
PKG_CHECK_MODULES(GVC, libpulse libpulse-mainloop-glib gobject-2.0)
|
PKG_CHECK_MODULES(GVC, libpulse libpulse-mainloop-glib gobject-2.0)
|
||||||
PKG_CHECK_MODULES(DESKTOP_SCHEMAS, gsettings-desktop-schemas >= 0.1.7)
|
PKG_CHECK_MODULES(DESKTOP_SCHEMAS, gsettings-desktop-schemas >= 3.5.4)
|
||||||
|
|
||||||
AC_MSG_CHECKING([for bluetooth support])
|
AC_MSG_CHECKING([for bluetooth support])
|
||||||
PKG_CHECK_EXISTS([gnome-bluetooth-1.0 >= 3.1.0],
|
PKG_CHECK_EXISTS([gnome-bluetooth-1.0 >= 3.1.0],
|
||||||
[BLUETOOTH_DIR=`$PKG_CONFIG --variable=applet_libdir gnome-bluetooth-1.0`
|
[BLUETOOTH_DIR=`$PKG_CONFIG --variable=applet_libdir gnome-bluetooth-1.0`
|
||||||
BLUETOOTH_LIBS=`$PKG_CONFIG --variable=applet_libs gnome-bluetooth-1.0`
|
BLUETOOTH_LIBS=`$PKG_CONFIG --variable=applet_libs gnome-bluetooth-1.0`
|
||||||
AC_SUBST([BLUETOOTH_LIBS],["$BLUETOOTH_LIBS"])
|
AC_SUBST([BLUETOOTH_LIBS],["$BLUETOOTH_LIBS"])
|
||||||
|
AC_SUBST([BLUETOOTH_DIR],["$BLUETOOTH_DIR"])
|
||||||
AC_DEFINE_UNQUOTED([BLUETOOTH_DIR],["$BLUETOOTH_DIR"],[Path to installed GnomeBluetooth typelib and library])
|
AC_DEFINE_UNQUOTED([BLUETOOTH_DIR],["$BLUETOOTH_DIR"],[Path to installed GnomeBluetooth typelib and library])
|
||||||
AC_DEFINE([HAVE_BLUETOOTH],[1],[Define if you have libgnome-bluetooth-applet])
|
AC_DEFINE([HAVE_BLUETOOTH],[1],[Define if you have libgnome-bluetooth-applet])
|
||||||
AC_SUBST([HAVE_BLUETOOTH],[1])
|
AC_SUBST([HAVE_BLUETOOTH],[1])
|
||||||
@ -139,10 +140,37 @@ PKG_CHECK_EXISTS([gnome-bluetooth-1.0 >= 3.1.0],
|
|||||||
AC_SUBST([HAVE_BLUETOOTH],[0])
|
AC_SUBST([HAVE_BLUETOOTH],[0])
|
||||||
AC_MSG_RESULT([no])])
|
AC_MSG_RESULT([no])])
|
||||||
|
|
||||||
PKG_CHECK_MODULES(CALENDAR_SERVER, libecal-1.2 >= $LIBECAL_MIN_VERSION libedataserver-1.2 >= $LIBEDATASERVER_MIN_VERSION libedataserverui-3.0 >= $LIBEDATASERVERUI_MIN_VERSION gio-2.0)
|
PKG_CHECK_MODULES(CALENDAR_SERVER, libecal-1.2 >= $LIBECAL_MIN_VERSION libedataserver-1.2 >= $LIBEDATASERVER_MIN_VERSION gio-2.0)
|
||||||
AC_SUBST(CALENDAR_SERVER_CFLAGS)
|
AC_SUBST(CALENDAR_SERVER_CFLAGS)
|
||||||
AC_SUBST(CALENDAR_SERVER_LIBS)
|
AC_SUBST(CALENDAR_SERVER_LIBS)
|
||||||
|
|
||||||
|
AC_ARG_WITH(systemd,
|
||||||
|
AS_HELP_STRING([--with-systemd],
|
||||||
|
[Add systemd support]),
|
||||||
|
[with_systemd=$withval], [with_systemd=auto])
|
||||||
|
|
||||||
|
PKG_CHECK_MODULES(SYSTEMD,
|
||||||
|
[libsystemd-login libsystemd-daemon],
|
||||||
|
[have_systemd=yes], [have_systemd=no])
|
||||||
|
|
||||||
|
if test "x$with_systemd" = "xauto" ; then
|
||||||
|
if test x$have_systemd = xno ; then
|
||||||
|
use_systemd=no
|
||||||
|
else
|
||||||
|
use_systemd=yes
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
use_systemd=$with_systemd
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "x$use_systemd" = "xyes"; then
|
||||||
|
if test "x$have_systemd" = "xno"; then
|
||||||
|
AC_MSG_ERROR([Systemd support explicitly required, but systemd not found])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_DEFINE(WITH_SYSTEMD, 1, [systemd support])
|
||||||
|
fi
|
||||||
|
|
||||||
MUTTER_GIR_DIR=`$PKG_CONFIG --variable=girdir libmutter`
|
MUTTER_GIR_DIR=`$PKG_CONFIG --variable=girdir libmutter`
|
||||||
MUTTER_TYPELIB_DIR=`$PKG_CONFIG --variable=typelibdir libmutter`
|
MUTTER_TYPELIB_DIR=`$PKG_CONFIG --variable=typelibdir libmutter`
|
||||||
AC_SUBST(MUTTER_GIR_DIR)
|
AC_SUBST(MUTTER_GIR_DIR)
|
||||||
@ -179,6 +207,20 @@ AC_SUBST(GIRDIR)
|
|||||||
TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
|
TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
|
||||||
AC_SUBST(TYPELIBDIR)
|
AC_SUBST(TYPELIBDIR)
|
||||||
|
|
||||||
|
GTK_DOC_CHECK([1.15], [--flavour no-tmpl])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(man,
|
||||||
|
[AS_HELP_STRING([--enable-man],
|
||||||
|
[generate man pages [default=yes]])],,
|
||||||
|
enable_man=yes)
|
||||||
|
if test "$enable_man" != no; then
|
||||||
|
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
||||||
|
if test -z "$XSLTPROC"; then
|
||||||
|
AC_MSG_ERROR([xsltproc is required for --enable-man])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" != no)
|
||||||
|
|
||||||
# Stay command-line compatible with the gnome-common configure option. Here
|
# Stay command-line compatible with the gnome-common configure option. Here
|
||||||
# minimum/yes/maximum are the same, however.
|
# minimum/yes/maximum are the same, however.
|
||||||
AC_ARG_ENABLE(compile_warnings,
|
AC_ARG_ENABLE(compile_warnings,
|
||||||
@ -199,7 +241,7 @@ if test "$enable_compile_warnings" != no ; then
|
|||||||
if test "$enable_compile_warnings" = error ; then
|
if test "$enable_compile_warnings" = error ; then
|
||||||
case " $CFLAGS " in
|
case " $CFLAGS " in
|
||||||
*[\ \ ]-Werror[\ \ ]*) ;;
|
*[\ \ ]-Werror[\ \ ]*) ;;
|
||||||
*) CFLAGS="$CFLAGS -Werror" ;;
|
*) CFLAGS="$CFLAGS -Werror -Wno-error=deprecated-declarations" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -207,42 +249,23 @@ fi
|
|||||||
changequote([,])dnl
|
changequote([,])dnl
|
||||||
|
|
||||||
AC_ARG_ENABLE(jhbuild-wrapper-script,
|
AC_ARG_ENABLE(jhbuild-wrapper-script,
|
||||||
AS_HELP_STRING([--jhbuild-wrapper-script=yes],[Make "gnome-shell" script work for jhbuild]),,enable_jhbuild_wrapper_script=no)
|
AS_HELP_STRING([--enable-jhbuild-wrapper-script],[Make "gnome-shell" script work for jhbuild]),,enable_jhbuild_wrapper_script=no)
|
||||||
AM_CONDITIONAL(USE_JHBUILD_WRAPPER_SCRIPT, test "x$enable_jhbuild_wrapper_script" = xyes)
|
AM_CONDITIONAL(USE_JHBUILD_WRAPPER_SCRIPT, test "x$enable_jhbuild_wrapper_script" = xyes)
|
||||||
|
|
||||||
AC_MSG_CHECKING([location of system Certificate Authority list])
|
|
||||||
AC_ARG_WITH(ca-certificates,
|
|
||||||
[AC_HELP_STRING([--with-ca-certificates=@<:@path@:>@],
|
|
||||||
[path to system Certificate Authority list])])
|
|
||||||
|
|
||||||
if test "$with_ca_certificates" = "no"; then
|
|
||||||
AC_MSG_RESULT([disabled])
|
|
||||||
else
|
|
||||||
if test -z "$with_ca_certificates"; then
|
|
||||||
for f in /etc/pki/tls/certs/ca-bundle.crt \
|
|
||||||
/etc/ssl/certs/ca-certificates.crt; do
|
|
||||||
if test -f "$f"; then
|
|
||||||
with_ca_certificates="$f"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if test -z "$with_ca_certificates"; then
|
|
||||||
AC_MSG_ERROR([could not find. Use --with-ca-certificates=path to set, or --without-ca-certificates to disable])
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_MSG_RESULT($with_ca_certificates)
|
|
||||||
AC_DEFINE_UNQUOTED(SHELL_SYSTEM_CA_FILE, ["$with_ca_certificates"], [The system TLS CA list])
|
|
||||||
fi
|
|
||||||
AC_SUBST(SHELL_SYSTEM_CA_FILE,["$with_ca_certificates"])
|
|
||||||
|
|
||||||
BROWSER_PLUGIN_DIR="${BROWSER_PLUGIN_DIR:-"\${libdir}/mozilla/plugins"}"
|
BROWSER_PLUGIN_DIR="${BROWSER_PLUGIN_DIR:-"\${libdir}/mozilla/plugins"}"
|
||||||
AC_ARG_VAR([BROWSER_PLUGIN_DIR],[Where to install the plugin to])
|
AC_ARG_VAR([BROWSER_PLUGIN_DIR],[Where to install the plugin to])
|
||||||
|
|
||||||
AC_CONFIG_FILES([
|
AC_CONFIG_FILES([
|
||||||
Makefile
|
Makefile
|
||||||
data/Makefile
|
data/Makefile
|
||||||
|
docs/Makefile
|
||||||
|
docs/reference/Makefile
|
||||||
|
docs/reference/shell/Makefile
|
||||||
|
docs/reference/shell/shell-docs.sgml
|
||||||
|
docs/reference/st/Makefile
|
||||||
|
docs/reference/st/st-docs.sgml
|
||||||
js/Makefile
|
js/Makefile
|
||||||
js/misc/config.js
|
src/calendar-server/evolution-calendar.desktop.in
|
||||||
src/Makefile
|
src/Makefile
|
||||||
browser-plugin/Makefile
|
browser-plugin/Makefile
|
||||||
tests/Makefile
|
tests/Makefile
|
||||||
|
12
data/50-gnome-shell-screenshot.xml.in
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<KeyListEntries schema="org.gnome.shell.keybindings"
|
||||||
|
group="system"
|
||||||
|
_name="Screenshots"
|
||||||
|
wm_name="GNOME Shell"
|
||||||
|
package="gnome-shell">
|
||||||
|
|
||||||
|
<KeyListEntry name="toggle-recording"
|
||||||
|
_description="Record a screencast"/>
|
||||||
|
|
||||||
|
</KeyListEntries>
|
||||||
|
|
21
data/50-gnome-shell-system.xml.in
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<KeyListEntries schema="org.gnome.shell.keybindings"
|
||||||
|
group="system"
|
||||||
|
_name="System"
|
||||||
|
wm_name="GNOME Shell"
|
||||||
|
package="gnome-shell">
|
||||||
|
|
||||||
|
<KeyListEntry name="toggle-message-tray"
|
||||||
|
_description="Show the message tray"/>
|
||||||
|
|
||||||
|
<KeyListEntry name="focus-active-notification"
|
||||||
|
_description="Focus the active notification"/>
|
||||||
|
|
||||||
|
<KeyListEntry name="toggle-application-view"
|
||||||
|
_description="Show all applications"/>
|
||||||
|
|
||||||
|
<KeyListEntry name="open-application-menu"
|
||||||
|
_description="Open the application menu"/>
|
||||||
|
|
||||||
|
</KeyListEntries>
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
desktopdir=$(datadir)/applications
|
desktopdir=$(datadir)/applications
|
||||||
desktop_DATA = gnome-shell.desktop
|
desktop_DATA = gnome-shell.desktop gnome-shell-extension-prefs.desktop
|
||||||
|
|
||||||
# We substitute in bindir so it works as an autostart
|
# We substitute in bindir so it works as an autostart
|
||||||
# file when built in a non-system prefix
|
# file when built in a non-system prefix
|
||||||
@ -8,20 +8,20 @@ desktop_DATA = gnome-shell.desktop
|
|||||||
-e "s|@VERSION[@]|$(VERSION)|" \
|
-e "s|@VERSION[@]|$(VERSION)|" \
|
||||||
$< > $@ || rm $@
|
$< > $@ || rm $@
|
||||||
|
|
||||||
# Placeholder until we add intltool
|
@INTLTOOL_DESKTOP_RULE@
|
||||||
%.desktop:%.desktop.in
|
|
||||||
$(AM_V_GEN) sed s/^_// < $< > $@ || rm $@
|
|
||||||
|
|
||||||
searchprovidersdir = $(pkgdatadir)/search_providers
|
introspectiondir = $(datadir)/dbus-1/interfaces
|
||||||
dist_searchproviders_DATA = \
|
introspection_DATA = org.gnome.ShellSearchProvider.xml
|
||||||
search_providers/google.xml \
|
|
||||||
search_providers/wikipedia.xml
|
|
||||||
|
|
||||||
themedir = $(pkgdatadir)/theme
|
themedir = $(pkgdatadir)/theme
|
||||||
dist_theme_DATA = \
|
dist_theme_DATA = \
|
||||||
theme/calendar-arrow-left.svg \
|
theme/calendar-arrow-left.svg \
|
||||||
theme/calendar-arrow-right.svg \
|
theme/calendar-arrow-right.svg \
|
||||||
theme/calendar-today.svg \
|
theme/calendar-today.svg \
|
||||||
|
theme/checkbox-focused.svg \
|
||||||
|
theme/checkbox-off-focused.svg \
|
||||||
|
theme/checkbox-off.svg \
|
||||||
|
theme/checkbox.svg \
|
||||||
theme/close-window.svg \
|
theme/close-window.svg \
|
||||||
theme/close.svg \
|
theme/close.svg \
|
||||||
theme/corner-ripple-ltr.png \
|
theme/corner-ripple-ltr.png \
|
||||||
@ -29,27 +29,39 @@ dist_theme_DATA = \
|
|||||||
theme/dash-placeholder.svg \
|
theme/dash-placeholder.svg \
|
||||||
theme/filter-selected-ltr.svg \
|
theme/filter-selected-ltr.svg \
|
||||||
theme/filter-selected-rtl.svg \
|
theme/filter-selected-rtl.svg \
|
||||||
theme/gdm.css \
|
|
||||||
theme/gnome-shell.css \
|
theme/gnome-shell.css \
|
||||||
theme/panel-border.svg \
|
theme/logged-in-indicator.svg \
|
||||||
|
theme/message-tray-background.png \
|
||||||
|
theme/noise-texture.png \
|
||||||
theme/panel-button-border.svg \
|
theme/panel-button-border.svg \
|
||||||
theme/panel-button-highlight-narrow.svg \
|
theme/panel-button-highlight-narrow.svg \
|
||||||
theme/panel-button-highlight-wide.svg \
|
theme/panel-button-highlight-wide.svg \
|
||||||
theme/process-working.svg \
|
theme/process-working.svg \
|
||||||
theme/running-indicator.svg \
|
theme/running-indicator.svg \
|
||||||
theme/scroll-hhandle.svg \
|
|
||||||
theme/scroll-vhandle.svg \
|
|
||||||
theme/source-button-border.svg \
|
theme/source-button-border.svg \
|
||||||
|
theme/summary-counter.svg \
|
||||||
theme/toggle-off-us.svg \
|
theme/toggle-off-us.svg \
|
||||||
theme/toggle-off-intl.svg \
|
theme/toggle-off-intl.svg \
|
||||||
theme/toggle-on-us.svg \
|
theme/toggle-on-us.svg \
|
||||||
theme/toggle-on-intl.svg \
|
theme/toggle-on-intl.svg \
|
||||||
theme/ws-switch-arrow-up.svg \
|
theme/ws-switch-arrow-up.png \
|
||||||
theme/ws-switch-arrow-down.svg
|
theme/ws-switch-arrow-down.png
|
||||||
|
|
||||||
|
keysdir = @GNOME_KEYBINDINGS_KEYSDIR@
|
||||||
|
keys_in_files = \
|
||||||
|
50-gnome-shell-screenshot.xml.in \
|
||||||
|
50-gnome-shell-system.xml.in \
|
||||||
|
$(NULL)
|
||||||
|
keys_DATA = $(keys_in_files:.xml.in=.xml)
|
||||||
|
|
||||||
gsettings_SCHEMAS = org.gnome.shell.gschema.xml
|
gsettings_SCHEMAS = org.gnome.shell.gschema.xml
|
||||||
|
|
||||||
@INTLTOOL_XML_NOMERGE_RULE@
|
@INTLTOOL_XML_NOMERGE_RULE@
|
||||||
|
|
||||||
|
%.gschema.xml.in: %.gschema.xml.in.in Makefile
|
||||||
|
$(AM_V_GEN) sed -e 's|@GETTEXT_PACKAGE[@]|$(GETTEXT_PACKAGE)|g' \
|
||||||
|
$< > $@ || rm $@
|
||||||
|
|
||||||
@GSETTINGS_RULES@
|
@GSETTINGS_RULES@
|
||||||
|
|
||||||
# We need to compile schemas at make time
|
# We need to compile schemas at make time
|
||||||
@ -59,30 +71,24 @@ gschemas.compiled: $(gsettings_SCHEMAS:.xml=.valid)
|
|||||||
|
|
||||||
all-local: gschemas.compiled
|
all-local: gschemas.compiled
|
||||||
|
|
||||||
|
convertdir = $(datadir)/GConf/gsettings
|
||||||
# GConf schemas: provide defaults for keys from Metacity we are overriding
|
convert_DATA = gnome-shell-overrides.convert
|
||||||
gconfschemadir = @GCONF_SCHEMA_FILE_DIR@
|
|
||||||
gconfschema_DATA = gnome-shell.schemas
|
|
||||||
|
|
||||||
shadersdir = $(pkgdatadir)/shaders
|
|
||||||
shaders_DATA = \
|
|
||||||
shaders/dim-window.glsl
|
|
||||||
|
|
||||||
install-data-local:
|
|
||||||
GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$(gconfschema_DATA)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
gnome-shell.desktop.in.in \
|
gnome-shell.desktop.in.in \
|
||||||
|
gnome-shell-extension-prefs.desktop.in.in \
|
||||||
|
$(introspection_DATA) \
|
||||||
$(menu_DATA) \
|
$(menu_DATA) \
|
||||||
$(gconfschema_DATA) \
|
$(convert_DATA) \
|
||||||
$(shaders_DATA) \
|
$(keys_in_files) \
|
||||||
org.gnome.shell.gschema.xml.in
|
org.gnome.shell.gschema.xml.in.in
|
||||||
|
|
||||||
CLEANFILES = \
|
CLEANFILES = \
|
||||||
gnome-shell.desktop.in \
|
gnome-shell.desktop.in \
|
||||||
|
gnome-shell-extension-prefs.in \
|
||||||
$(desktop_DATA) \
|
$(desktop_DATA) \
|
||||||
|
$(keys_DATA) \
|
||||||
$(gsettings_SCHEMAS) \
|
$(gsettings_SCHEMAS) \
|
||||||
gschemas.compiled
|
gschemas.compiled \
|
||||||
|
org.gnome.shell.gschema.valid \
|
||||||
|
org.gnome.shell.gschema.xml.in
|
||||||
|
12
data/gnome-shell-extension-prefs.desktop.in.in
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Type=Application
|
||||||
|
_Name=GNOME Shell Extension Preferences
|
||||||
|
_Comment=Configure GNOME Shell Extensions
|
||||||
|
Exec=@bindir@/gnome-shell-extension-prefs %u
|
||||||
|
X-GNOME-Bugzilla-Bugzilla=GNOME
|
||||||
|
X-GNOME-Bugzilla-Product=gnome-shell
|
||||||
|
X-GNOME-Bugzilla-Component=extensions
|
||||||
|
X-GNOME-Bugzilla-Version=@VERSION@
|
||||||
|
Categories=GNOME;GTK;
|
||||||
|
OnlyShowIn=GNOME;
|
||||||
|
NoDisplay=true
|
5
data/gnome-shell-overrides.convert
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[org.gnome.shell.overrides]
|
||||||
|
attach-modal-dialogs = /desktop/gnome/shell/windows/attach_modal_dialogs
|
||||||
|
button-layout = /desktop/gnome/shell/windows/button_layout
|
||||||
|
edge-tiling = /desktop/gnome/shell/windows/edge_tiling
|
||||||
|
workspaces-only-on-primary = /desktop/gnome/shell/windows/workspaces_only_on_primary
|
@ -13,4 +13,4 @@ NoDisplay=true
|
|||||||
X-GNOME-Autostart-Phase=WindowManager
|
X-GNOME-Autostart-Phase=WindowManager
|
||||||
X-GNOME-Provides=panel;windowmanager;
|
X-GNOME-Provides=panel;windowmanager;
|
||||||
X-GNOME-Autostart-Notify=true
|
X-GNOME-Autostart-Notify=true
|
||||||
X-GNOME-AutoRestart=true
|
X-GNOME-AutoRestart=false
|
||||||
|
@ -1,100 +0,0 @@
|
|||||||
<gconfschemafile>
|
|
||||||
<schemalist>
|
|
||||||
|
|
||||||
<!-- Metacity overrides -->
|
|
||||||
<schema>
|
|
||||||
<key>/schemas/desktop/gnome/shell/windows/attach_modal_dialogs</key>
|
|
||||||
<applyto>/desktop/gnome/shell/windows/attach_modal_dialogs</applyto>
|
|
||||||
<owner>gnome-shell</owner>
|
|
||||||
<type>bool</type>
|
|
||||||
<default>true</default>
|
|
||||||
<locale name="C">
|
|
||||||
<short>Attach modal dialog to the parent window</short>
|
|
||||||
<long>
|
|
||||||
This key overrides /apps/mutter/general/attach_modal_dialogs when
|
|
||||||
running GNOME Shell.
|
|
||||||
</long>
|
|
||||||
</locale>
|
|
||||||
</schema>
|
|
||||||
|
|
||||||
<schema>
|
|
||||||
<key>/schemas/desktop/gnome/shell/windows/button_layout</key>
|
|
||||||
<applyto>/desktop/gnome/shell/windows/button_layout</applyto>
|
|
||||||
<owner>gnome-shell</owner>
|
|
||||||
<type>string</type>
|
|
||||||
<default>:close</default>
|
|
||||||
<locale name="C">
|
|
||||||
<short>Arrangement of buttons on the titlebar</short>
|
|
||||||
<long>
|
|
||||||
Arrangement of buttons on the titlebar. The
|
|
||||||
value should be a string, such as
|
|
||||||
"menu:minimize,maximize,spacer,close"; the colon separates the
|
|
||||||
left corner of the window from the right corner, and
|
|
||||||
the button names are comma-separated. Duplicate buttons
|
|
||||||
are not allowed. Unknown button names are silently ignored
|
|
||||||
so that buttons can be added in future gnome-shell versions
|
|
||||||
without breaking older versions.
|
|
||||||
A special spacer tag can be used to insert some space between
|
|
||||||
two adjacent buttons.
|
|
||||||
|
|
||||||
This key overrides /apps/metacity/general/button_layout when
|
|
||||||
running GNOME Shell.
|
|
||||||
</long>
|
|
||||||
</locale>
|
|
||||||
</schema>
|
|
||||||
|
|
||||||
<schema>
|
|
||||||
<key>/schemas/desktop/gnome/shell/windows/edge_tiling</key>
|
|
||||||
<applyto>/desktop/gnome/shell/windows/edge_tiling</applyto>
|
|
||||||
<owner>gnome-shell</owner>
|
|
||||||
<type>bool</type>
|
|
||||||
<default>true</default>
|
|
||||||
<locale name="C">
|
|
||||||
<short>enable edge tiling when dropping windows on screen edges</short>
|
|
||||||
<long>
|
|
||||||
If enabled, dropping windows on vertical screen edges maximizes them
|
|
||||||
vertically and resizes them horizontally to cover half of the
|
|
||||||
available area. Dropping windows on the top screen edge maximizes them
|
|
||||||
completely.
|
|
||||||
|
|
||||||
This key overrides /apps/metacity/general/edge_tiling when
|
|
||||||
running GNOME Shell.
|
|
||||||
</long>
|
|
||||||
</locale>
|
|
||||||
</schema>
|
|
||||||
|
|
||||||
<schema>
|
|
||||||
<key>/schemas/desktop/gnome/shell/windows/theme</key>
|
|
||||||
<applyto>/desktop/gnome/shell/windows/theme</applyto>
|
|
||||||
<owner>gnome-shell</owner>
|
|
||||||
<type>string</type>
|
|
||||||
<default>Adwaita</default>
|
|
||||||
<locale name="C">
|
|
||||||
<short>Current theme</short>
|
|
||||||
<long>
|
|
||||||
The theme determines the appearance of window borders,
|
|
||||||
titlebar, and so forth.
|
|
||||||
|
|
||||||
This key overrides /apps/metacity/general/theme when
|
|
||||||
running GNOME Shell.
|
|
||||||
</long>
|
|
||||||
</locale>
|
|
||||||
</schema>
|
|
||||||
|
|
||||||
<schema>
|
|
||||||
<key>/schemas/desktop/gnome/shell/windows/workspaces_only_on_primary</key>
|
|
||||||
<applyto>/desktop/gnome/shell/windows/workspaces_only_on_primary</applyto>
|
|
||||||
<owner>gnome-shell</owner>
|
|
||||||
<type>bool</type>
|
|
||||||
<default>true</default>
|
|
||||||
<locale name="C">
|
|
||||||
<short>Workspaces only on primary monitor</short>
|
|
||||||
<long>
|
|
||||||
This key overrides /apps/mutter/general/workspaces_only_on_primary when
|
|
||||||
running GNOME Shell.
|
|
||||||
</long>
|
|
||||||
</locale>
|
|
||||||
</schema>
|
|
||||||
|
|
||||||
</schemalist>
|
|
||||||
</gconfschemafile>
|
|
147
data/org.gnome.ShellSearchProvider.xml
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
<!DOCTYPE node PUBLIC
|
||||||
|
'-//freedesktop//DTD D-BUS Object Introspection 1.0//EN'
|
||||||
|
'http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd'>
|
||||||
|
<node>
|
||||||
|
<interface name="org.gnome.Shell.SearchProvider">
|
||||||
|
<doc:doc>
|
||||||
|
<doc:description>
|
||||||
|
<doc:para>
|
||||||
|
The interface used for integrating into GNOME Shell's search
|
||||||
|
interface.
|
||||||
|
</doc:para>
|
||||||
|
</doc:description>
|
||||||
|
</doc:doc>
|
||||||
|
|
||||||
|
<method name="GetInitialResultSet">
|
||||||
|
<doc:doc>
|
||||||
|
<doc:description>
|
||||||
|
<doc:para>
|
||||||
|
Called when the user first begins a search.
|
||||||
|
</doc:para>
|
||||||
|
</doc:description>
|
||||||
|
</doc:doc>
|
||||||
|
<arg type="as" direction="in">
|
||||||
|
<doc:doc>
|
||||||
|
<doc:summary>
|
||||||
|
<doc:para>
|
||||||
|
Array of search terms, which the provider should treat as
|
||||||
|
logical AND.
|
||||||
|
</doc:para>
|
||||||
|
</doc:summary>
|
||||||
|
</doc:doc>
|
||||||
|
</arg>
|
||||||
|
<arg type="as" direction="out">
|
||||||
|
<doc:doc>
|
||||||
|
<doc:summary>
|
||||||
|
<doc:para>
|
||||||
|
An array of result identifier strings representing items which
|
||||||
|
match the given search terms. Identifiers must be unique within
|
||||||
|
the provider's domain, but other than that may be chosen freely
|
||||||
|
by the provider.
|
||||||
|
</doc:para>
|
||||||
|
</doc:summary>
|
||||||
|
</doc:doc>
|
||||||
|
</arg>
|
||||||
|
</method>
|
||||||
|
|
||||||
|
<method name="GetSubsearchResultSet">
|
||||||
|
<doc:doc>
|
||||||
|
<doc:description>
|
||||||
|
<doc:para>
|
||||||
|
Called when a search is performed which is a "subsearch" of
|
||||||
|
the previous search, e.g. the method may return less results, but
|
||||||
|
not more or different results.
|
||||||
|
|
||||||
|
This allows search providers to only search through the previous
|
||||||
|
result set, rather than possibly performing a full re-query.
|
||||||
|
</doc:para>
|
||||||
|
</doc:description>
|
||||||
|
</doc:doc>
|
||||||
|
<arg type="as" direction="in">
|
||||||
|
<doc:doc>
|
||||||
|
<doc:summary>
|
||||||
|
<doc:para>
|
||||||
|
Array of item identifiers
|
||||||
|
</doc:para>
|
||||||
|
</doc:summary>
|
||||||
|
</doc:doc>
|
||||||
|
</arg>
|
||||||
|
<arg type="as" direction="in">
|
||||||
|
<doc:doc>
|
||||||
|
<doc:summary>
|
||||||
|
<doc:para>
|
||||||
|
Array of updated search terms, which the provider should treat as
|
||||||
|
logical AND.
|
||||||
|
</doc:para>
|
||||||
|
</doc:summary>
|
||||||
|
</doc:doc>
|
||||||
|
</arg>
|
||||||
|
<arg type="as" direction="out">
|
||||||
|
<doc:doc>
|
||||||
|
<doc:summary>
|
||||||
|
<doc:para>
|
||||||
|
An array of result identifier strings representing items which
|
||||||
|
match the given search terms. Identifiers must be unique within
|
||||||
|
the provider's domain, but other than that may be chosen freely
|
||||||
|
by the provider.
|
||||||
|
</doc:para>
|
||||||
|
</doc:summary>
|
||||||
|
</doc:doc>
|
||||||
|
</arg>
|
||||||
|
</method>
|
||||||
|
|
||||||
|
<method name="GetResultMetas">
|
||||||
|
<doc:doc>
|
||||||
|
<doc:description>
|
||||||
|
<doc:para>
|
||||||
|
Return an array of meta data used to display each given result
|
||||||
|
</doc:para>
|
||||||
|
</doc:description>
|
||||||
|
</doc:doc>
|
||||||
|
<arg type="as" direction="in">
|
||||||
|
<doc:doc>
|
||||||
|
<doc:summary>
|
||||||
|
<doc:para>
|
||||||
|
An array of result identifiers as returned by
|
||||||
|
GetInitialResultSet() or GetSubsearchResultSet()
|
||||||
|
</doc:para>
|
||||||
|
</doc:summary>
|
||||||
|
</doc:doc>
|
||||||
|
</arg>
|
||||||
|
<arg type="aa{sv}" direction="out">
|
||||||
|
<doc:doc>
|
||||||
|
<doc:summary>
|
||||||
|
<doc:para>
|
||||||
|
A dictionary describing the given search result, containing
|
||||||
|
'id', 'name' (both strings) and either 'icon' (a serialized
|
||||||
|
GIcon) or 'icon-data' (raw image data as (iiibiiay) - width,
|
||||||
|
height, rowstride, has-alpha, bits per sample, channels, data)
|
||||||
|
</doc:para>
|
||||||
|
</doc:summary>
|
||||||
|
</doc:doc>
|
||||||
|
</arg>
|
||||||
|
</method>
|
||||||
|
|
||||||
|
<method name="ActivateResult">
|
||||||
|
<doc:doc>
|
||||||
|
<doc:description>
|
||||||
|
<doc:para>
|
||||||
|
Called when the users chooses a given result. The result should
|
||||||
|
be displayed in the application associated with the corresponding
|
||||||
|
provider.
|
||||||
|
</doc:para>
|
||||||
|
</doc:description>
|
||||||
|
</doc:doc>
|
||||||
|
<arg type="s" direction="in">
|
||||||
|
<doc:doc>
|
||||||
|
<doc:summary>
|
||||||
|
<doc:para>
|
||||||
|
A result identifier as returned by GetInitialResultSet() or
|
||||||
|
GetSubsearchResultSet()
|
||||||
|
</doc:para>
|
||||||
|
</doc:summary>
|
||||||
|
</doc:doc>
|
||||||
|
</arg>
|
||||||
|
</method>
|
||||||
|
</interface>
|
||||||
|
</node>
|
@ -16,8 +16,9 @@
|
|||||||
<_summary>Uuids of extensions to enable</_summary>
|
<_summary>Uuids of extensions to enable</_summary>
|
||||||
<_description>
|
<_description>
|
||||||
GNOME Shell extensions have a uuid property; this key lists extensions
|
GNOME Shell extensions have a uuid property; this key lists extensions
|
||||||
which should be loaded. disabled-extensions overrides this setting for
|
which should be loaded. Any extension that wants to be loaded needs
|
||||||
extensions that appear in both lists.
|
to be in this list. You can also manipulate this list with the
|
||||||
|
EnableExtension and DisableExtension DBus methods on org.gnome.Shell.
|
||||||
</_description>
|
</_description>
|
||||||
</key>
|
</key>
|
||||||
<key name="enable-app-monitoring" type="b">
|
<key name="enable-app-monitoring" type="b">
|
||||||
@ -38,10 +39,6 @@
|
|||||||
will be displayed in the favorites area.
|
will be displayed in the favorites area.
|
||||||
</_description>
|
</_description>
|
||||||
</key>
|
</key>
|
||||||
<key name="disabled-open-search-providers" type="as">
|
|
||||||
<default>[]</default>
|
|
||||||
<_summary>disabled OpenSearch providers</_summary>
|
|
||||||
</key>
|
|
||||||
<key name="command-history" type="as">
|
<key name="command-history" type="as">
|
||||||
<default>[]</default>
|
<default>[]</default>
|
||||||
<_summary>History for command (Alt-F2) dialog</_summary>
|
<_summary>History for command (Alt-F2) dialog</_summary>
|
||||||
@ -50,9 +47,27 @@
|
|||||||
<default>[]</default>
|
<default>[]</default>
|
||||||
<_summary>History for the looking glass dialog</_summary>
|
<_summary>History for the looking glass dialog</_summary>
|
||||||
</key>
|
</key>
|
||||||
<child name="clock" schema="org.gnome.shell.clock"/>
|
<key name="saved-im-presence" type="i">
|
||||||
|
<default>1</default>
|
||||||
|
<_summary>Internally used to store the last IM presence explicitly set by the user. The
|
||||||
|
value here is from the TpConnectionPresenceType enumeration.</_summary>
|
||||||
|
</key>
|
||||||
|
<key name="saved-session-presence" type="i">
|
||||||
|
<default>0</default>
|
||||||
|
<_summary>Internally used to store the last session presence status for the user. The
|
||||||
|
value here is from the GsmPresenceStatus enumeration.</_summary>
|
||||||
|
</key>
|
||||||
|
<key name="always-show-log-out" type="b">
|
||||||
|
<default>false</default>
|
||||||
|
<_summary>Always show the 'Log out' menuitem in the user menu.</_summary>
|
||||||
|
<_description>
|
||||||
|
This key overrides the automatic hiding of the 'Log out'
|
||||||
|
menuitem in single-user, single-session situations.
|
||||||
|
</_description>
|
||||||
|
</key>
|
||||||
<child name="calendar" schema="org.gnome.shell.calendar"/>
|
<child name="calendar" schema="org.gnome.shell.calendar"/>
|
||||||
<child name="recorder" schema="org.gnome.shell.recorder"/>
|
<child name="recorder" schema="org.gnome.shell.recorder"/>
|
||||||
|
<child name="keybindings" schema="org.gnome.shell.keybindings"/>
|
||||||
<child name="keyboard" schema="org.gnome.shell.keyboard"/>
|
<child name="keyboard" schema="org.gnome.shell.keyboard"/>
|
||||||
</schema>
|
</schema>
|
||||||
|
|
||||||
@ -67,6 +82,46 @@
|
|||||||
</key>
|
</key>
|
||||||
</schema>
|
</schema>
|
||||||
|
|
||||||
|
<schema id="org.gnome.shell.keybindings" path="/org/gnome/shell/keybindings/"
|
||||||
|
gettext-domain="@GETTEXT_PACKAGE@">
|
||||||
|
<key name="open-application-menu" type="as">
|
||||||
|
<default>["<Super>F10"]</default>
|
||||||
|
<_summary>Keybinding to open the application menu</_summary>
|
||||||
|
<_description>
|
||||||
|
Keybinding to open the application menu.
|
||||||
|
</_description>
|
||||||
|
</key>
|
||||||
|
<key name="toggle-application-view" type="as">
|
||||||
|
<default>["<Super>a"]</default>
|
||||||
|
<_summary>Keybinding to open the "Show Applications" view</_summary>
|
||||||
|
<_description>
|
||||||
|
Keybinding to open the "Show Applications" view of the Activities
|
||||||
|
Overview.
|
||||||
|
</_description>
|
||||||
|
</key>
|
||||||
|
<key name="toggle-message-tray" type="as">
|
||||||
|
<default>["<Super>m"]</default>
|
||||||
|
<_summary>Keybinding to toggle the visibility of the message tray</_summary>
|
||||||
|
<_description>
|
||||||
|
Keybinding to toggle the visibility of the message tray.
|
||||||
|
</_description>
|
||||||
|
</key>
|
||||||
|
<key name="focus-active-notification" type="as">
|
||||||
|
<default>["<Super>n"]</default>
|
||||||
|
<_summary>Keybinding to focus the active notification</_summary>
|
||||||
|
<_description>
|
||||||
|
Keybinding to focus the active notification.
|
||||||
|
</_description>
|
||||||
|
</key>
|
||||||
|
<key name="toggle-recording" type="as">
|
||||||
|
<default><![CDATA[['<Control><Shift><Alt>r']]]></default>
|
||||||
|
<_summary>Keybinding to toggle the screen recorder</_summary>
|
||||||
|
<_description>
|
||||||
|
Keybinding to start/stop the builtin screen recorder.
|
||||||
|
</_description>
|
||||||
|
</key>
|
||||||
|
</schema>
|
||||||
|
|
||||||
<schema id="org.gnome.shell.keyboard" path="/org/gnome/shell/keyboard/"
|
<schema id="org.gnome.shell.keyboard" path="/org/gnome/shell/keyboard/"
|
||||||
gettext-domain="@GETTEXT_PACKAGE@">
|
gettext-domain="@GETTEXT_PACKAGE@">
|
||||||
<key name="keyboard-type" type="s">
|
<key name="keyboard-type" type="s">
|
||||||
@ -78,28 +133,10 @@
|
|||||||
</key>
|
</key>
|
||||||
</schema>
|
</schema>
|
||||||
|
|
||||||
<schema id="org.gnome.shell.clock" path="/org/gnome/shell/clock/"
|
|
||||||
gettext-domain="@GETTEXT_PACKAGE@">
|
|
||||||
<key name="show-seconds" type="b">
|
|
||||||
<default>false</default>
|
|
||||||
<_summary>Show time with seconds</_summary>
|
|
||||||
<_description>
|
|
||||||
If true, display seconds in time.
|
|
||||||
</_description>
|
|
||||||
</key>
|
|
||||||
<key name="show-date" type="b">
|
|
||||||
<default>false</default>
|
|
||||||
<_summary>Show date in clock</_summary>
|
|
||||||
<_description>
|
|
||||||
If true, display date in the clock, in addition to time.
|
|
||||||
</_description>
|
|
||||||
</key>
|
|
||||||
</schema>
|
|
||||||
|
|
||||||
<schema id="org.gnome.shell.recorder" path="/org/gnome/shell/recorder/"
|
<schema id="org.gnome.shell.recorder" path="/org/gnome/shell/recorder/"
|
||||||
gettext-domain="@GETTEXT_PACKAGE@">
|
gettext-domain="@GETTEXT_PACKAGE@">
|
||||||
<key name="framerate" type="i">
|
<key name="framerate" type="i">
|
||||||
<default>15</default>
|
<default>30</default>
|
||||||
<_summary>Framerate used for recording screencasts.</_summary>
|
<_summary>Framerate used for recording screencasts.</_summary>
|
||||||
<_description>
|
<_description>
|
||||||
The framerate of the resulting screencast recordered
|
The framerate of the resulting screencast recordered
|
||||||
@ -118,7 +155,7 @@
|
|||||||
take care of its own output - this might be used to send the output
|
take care of its own output - this might be used to send the output
|
||||||
to an icecast server via shout2send or similar. When unset or set
|
to an icecast server via shout2send or similar. When unset or set
|
||||||
to an empty value, the default pipeline will be used. This is currently
|
to an empty value, the default pipeline will be used. This is currently
|
||||||
'videorate ! vp8enc quality=10 speed=2 threads=%T ! queue ! webmmux'
|
'vp8enc min_quantizer=13 max_quantizer=13 cpu-used=5 deadline=1000000 threads=%T ! queue ! webmmux'
|
||||||
and records to WEBM using the VP8 codec. %T is used as a placeholder
|
and records to WEBM using the VP8 codec. %T is used as a placeholder
|
||||||
for a guess at the optimal thread count on the system.
|
for a guess at the optimal thread count on the system.
|
||||||
</_description>
|
</_description>
|
||||||
@ -133,4 +170,57 @@
|
|||||||
</_description>
|
</_description>
|
||||||
</key>
|
</key>
|
||||||
</schema>
|
</schema>
|
||||||
|
|
||||||
|
<schema id="org.gnome.shell.overrides" path="/org/gnome/shell/overrides/"
|
||||||
|
gettext-domain="@GETTEXT_PACKAGE@">
|
||||||
|
<key name="attach-modal-dialogs" type="b">
|
||||||
|
<default>true</default>
|
||||||
|
<_summary>Attach modal dialog to the parent window</_summary>
|
||||||
|
<_description>
|
||||||
|
This key overrides the key in org.gnome.mutter when running
|
||||||
|
GNOME Shell.
|
||||||
|
</_description>
|
||||||
|
</key>
|
||||||
|
|
||||||
|
<key name="button-layout" type="s">
|
||||||
|
<default>":close"</default>
|
||||||
|
<_summary>Arrangement of buttons on the titlebar</_summary>
|
||||||
|
<_description>
|
||||||
|
This key overrides the key in org.gnome.desktop.wm.preferences when
|
||||||
|
running GNOME Shell.
|
||||||
|
</_description>
|
||||||
|
</key>
|
||||||
|
|
||||||
|
<key name="edge-tiling" type="b">
|
||||||
|
<default>true</default>
|
||||||
|
<_summary>Enable edge tiling when dropping windows on screen edges</_summary>
|
||||||
|
<_description>
|
||||||
|
This key overrides the key in org.gnome.mutter when running GNOME Shell.
|
||||||
|
</_description>
|
||||||
|
</key>
|
||||||
|
|
||||||
|
<key name="dynamic-workspaces" type="b">
|
||||||
|
<default>true</default>
|
||||||
|
<_summary>Workspaces are managed dynamically</_summary>
|
||||||
|
<_description>
|
||||||
|
This key overrides the key in org.gnome.mutter when running GNOME Shell.
|
||||||
|
</_description>
|
||||||
|
</key>
|
||||||
|
|
||||||
|
<key name="workspaces-only-on-primary" type="b">
|
||||||
|
<default>true</default>
|
||||||
|
<_summary>Workspaces only on primary monitor</_summary>
|
||||||
|
<_description>
|
||||||
|
This key overrides the key in org.gnome.mutter when running GNOME Shell.
|
||||||
|
</_description>
|
||||||
|
</key>
|
||||||
|
|
||||||
|
<key name="focus-change-on-pointer-rest" type="b">
|
||||||
|
<default>true</default>
|
||||||
|
<summary>Delay focus changes in mouse mode until the pointer stops moving</summary>
|
||||||
|
<description>
|
||||||
|
This key overrides the key in org.gnome.mutter when running GNOME Shell.
|
||||||
|
</description>
|
||||||
|
</key>
|
||||||
|
</schema>
|
||||||
</schemalist>
|
</schemalist>
|
@ -1,7 +0,0 @@
|
|||||||
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
|
|
||||||
<ShortName>Google</ShortName>
|
|
||||||
<Description>Google Search</Description>
|
|
||||||
<InputEncoding>UTF-8</InputEncoding>
|
|
||||||
<Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image>
|
|
||||||
<Url type="text/html" method="GET" template="http://www.google.com/search?q={searchTerms}"/>
|
|
||||||
</OpenSearchDescription>
|
|
@ -1,44 +0,0 @@
|
|||||||
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
|
|
||||||
<ShortName>Wikipedia</ShortName>
|
|
||||||
<Description>Wikipedia, the free encyclopedia</Description>
|
|
||||||
<InputEncoding>UTF-8</InputEncoding>
|
|
||||||
<Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAEAgQAhIOEAMjHyABIR0gA6ejpAGlqaQCpqKkAKCgoAPz9%2FAAZGBkAmJiYANjZ2ABXWFcAent6ALm6uQA8OjwAiIiIiIiIiIiIiI4oiL6IiIiIgzuIV4iIiIhndo53KIiIiB%2FWvXoYiIiIfEZfWBSIiIEGi%2FfoqoiIgzuL84i9iIjpGIoMiEHoiMkos3FojmiLlUipYliEWIF%2BiDe0GoRa7D6GPbjcu1yIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</Image>
|
|
||||||
<Url type="text/html" method="GET" template="http://{language}.wikipedia.org/wiki/Special:Search?search={searchTerms}"/>
|
|
||||||
<!-- The criterion for being below is being listed with more than 100,000
|
|
||||||
articles on http://meta.wikimedia.org/wiki/List_of_Wikipedias -->
|
|
||||||
<Language>ar</Language>
|
|
||||||
<Language>bg</Language>
|
|
||||||
<Language>ca</Language>
|
|
||||||
<Language>cs</Language>
|
|
||||||
<Language>da</Language>
|
|
||||||
<Language>de</Language>
|
|
||||||
<Language>en</Language>
|
|
||||||
<Language>eo</Language>
|
|
||||||
<Language>es</Language>
|
|
||||||
<Language>fa</Language>
|
|
||||||
<Language>fi</Language>
|
|
||||||
<Language>fr</Language>
|
|
||||||
<Language>he</Language>
|
|
||||||
<Language>hu</Language>
|
|
||||||
<Language>id</Language>
|
|
||||||
<Language>it</Language>
|
|
||||||
<Language>ja</Language>
|
|
||||||
<Language>ko</Language>
|
|
||||||
<Language>lt</Language>
|
|
||||||
<Language>nl</Language>
|
|
||||||
<Language>no</Language>
|
|
||||||
<Language>pl</Language>
|
|
||||||
<Language>pt</Language>
|
|
||||||
<Language>ro</Language>
|
|
||||||
<Language>ru</Language>
|
|
||||||
<Language>sk</Language>
|
|
||||||
<Language>sl</Language>
|
|
||||||
<Language>sr</Language>
|
|
||||||
<Language>sv</Language>
|
|
||||||
<Language>tr</Language>
|
|
||||||
<Language>uk</Language>
|
|
||||||
<Language>vi</Language>
|
|
||||||
<Language>vo</Language>
|
|
||||||
<Language>war</Language>
|
|
||||||
<Language>zh</Language>
|
|
||||||
</OpenSearchDescription>
|
|
@ -1,27 +0,0 @@
|
|||||||
#version 110
|
|
||||||
uniform sampler2D tex;
|
|
||||||
uniform float fraction;
|
|
||||||
uniform float height;
|
|
||||||
const float c = -0.2;
|
|
||||||
const float border_max_height = 60.0;
|
|
||||||
|
|
||||||
mat4 contrast = mat4 (1.0 + c, 0.0, 0.0, 0.0,
|
|
||||||
0.0, 1.0 + c, 0.0, 0.0,
|
|
||||||
0.0, 0.0, 1.0 + c, 0.0,
|
|
||||||
0.0, 0.0, 0.0, 1.0);
|
|
||||||
vec4 off = vec4(0.633, 0.633, 0.633, 0);
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
vec4 color = texture2D(tex, cogl_tex_coord_in[0].xy);
|
|
||||||
float y = height * cogl_tex_coord_in[0].y;
|
|
||||||
|
|
||||||
// To reduce contrast, blend with a mid gray
|
|
||||||
cogl_color_out = color * contrast - off * c * color.a;
|
|
||||||
|
|
||||||
// We only fully dim at a distance of BORDER_MAX_HEIGHT from the top and
|
|
||||||
// when the fraction is 1.0. For other locations and fractions we linearly
|
|
||||||
// interpolate back to the original undimmed color, so the top of the window
|
|
||||||
// is at full color.
|
|
||||||
cogl_color_out = color + (cogl_color_out - color) * max(min(y / border_max_height, 1.0), 0.0);
|
|
||||||
cogl_color_out = color + (cogl_color_out - color) * fraction;
|
|
||||||
}
|
|
@ -10,11 +10,11 @@
|
|||||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
width="28"
|
width="29"
|
||||||
height="25"
|
height="29"
|
||||||
id="svg10621"
|
id="svg10621"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
inkscape:version="0.48.1 r9760"
|
inkscape:version="0.48.2 r9819"
|
||||||
sodipodi:docname="calendar-today.svg">
|
sodipodi:docname="calendar-today.svg">
|
||||||
<defs
|
<defs
|
||||||
id="defs10623">
|
id="defs10623">
|
||||||
@ -118,6 +118,17 @@
|
|||||||
fx="51"
|
fx="51"
|
||||||
fy="30"
|
fy="30"
|
||||||
r="42" />
|
r="42" />
|
||||||
|
<radialGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient34508-1-3"
|
||||||
|
id="radialGradient3113"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="matrix(0.72146227,0,0,0.27484277,14.205424,21.754717)"
|
||||||
|
cx="51"
|
||||||
|
cy="30"
|
||||||
|
fx="51"
|
||||||
|
fy="30"
|
||||||
|
r="42" />
|
||||||
</defs>
|
</defs>
|
||||||
<sodipodi:namedview
|
<sodipodi:namedview
|
||||||
id="base"
|
id="base"
|
||||||
@ -127,20 +138,29 @@
|
|||||||
inkscape:pageopacity="0"
|
inkscape:pageopacity="0"
|
||||||
inkscape:pageshadow="2"
|
inkscape:pageshadow="2"
|
||||||
inkscape:zoom="15.839192"
|
inkscape:zoom="15.839192"
|
||||||
inkscape:cx="8.3750933"
|
inkscape:cx="20.652108"
|
||||||
inkscape:cy="8.0837211"
|
inkscape:cy="11.839084"
|
||||||
inkscape:document-units="px"
|
inkscape:document-units="px"
|
||||||
inkscape:current-layer="layer1"
|
inkscape:current-layer="layer1"
|
||||||
showgrid="false"
|
showgrid="true"
|
||||||
fit-margin-top="0"
|
fit-margin-top="0"
|
||||||
fit-margin-left="0"
|
fit-margin-left="0"
|
||||||
fit-margin-right="0"
|
fit-margin-right="0"
|
||||||
fit-margin-bottom="0"
|
fit-margin-bottom="0"
|
||||||
inkscape:window-width="1440"
|
inkscape:window-width="1280"
|
||||||
inkscape:window-height="843"
|
inkscape:window-height="741"
|
||||||
inkscape:window-x="0"
|
inkscape:window-x="0"
|
||||||
inkscape:window-y="26"
|
inkscape:window-y="27"
|
||||||
inkscape:window-maximized="1" />
|
inkscape:window-maximized="1"
|
||||||
|
borderlayer="true">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid3109"
|
||||||
|
empspacing="5"
|
||||||
|
visible="true"
|
||||||
|
enabled="true"
|
||||||
|
snapvisiblegridlinesonly="true" />
|
||||||
|
</sodipodi:namedview>
|
||||||
<metadata
|
<metadata
|
||||||
id="metadata10626">
|
id="metadata10626">
|
||||||
<rdf:RDF>
|
<rdf:RDF>
|
||||||
@ -157,31 +177,28 @@
|
|||||||
inkscape:label="Layer 1"
|
inkscape:label="Layer 1"
|
||||||
inkscape:groupmode="layer"
|
inkscape:groupmode="layer"
|
||||||
id="layer1"
|
id="layer1"
|
||||||
transform="translate(-469.08263,-536.99307)">
|
transform="translate(-469.08263,-532.99307)">
|
||||||
<g
|
<path
|
||||||
id="g3003">
|
sodipodi:type="arc"
|
||||||
<path
|
style="opacity:0.4625;color:#000000;fill:url(#radialGradient3113);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
||||||
inkscape:export-ydpi="90"
|
id="path34506-3"
|
||||||
inkscape:export-xdpi="90"
|
sodipodi:cx="51"
|
||||||
inkscape:export-filename="/home/jimmac/src/cvs/gnome/gnome-shell-design/mockups/motion/textures/panel.png"
|
sodipodi:cy="30"
|
||||||
transform="matrix(0.43692393,0,0,1.3783114,460.60467,517.48289)"
|
sodipodi:rx="42"
|
||||||
sodipodi:end="6.2831853"
|
sodipodi:ry="16"
|
||||||
sodipodi:start="3.1415927"
|
d="M 9,29.999999 A 42,16 0 0 1 93,30 l -42,0 z"
|
||||||
d="M 9,29.999999 C 9.0000011,21.163443 27.804042,14 51.000002,14 74.195961,14 93,21.163444 93,30 l -42,0 z"
|
sodipodi:start="3.1415927"
|
||||||
sodipodi:ry="16"
|
sodipodi:end="6.2831853"
|
||||||
sodipodi:rx="42"
|
transform="matrix(0.43692393,0,0,1.3783114,461.29951,517.6437)"
|
||||||
sodipodi:cy="30"
|
inkscape:export-filename="/home/jimmac/src/cvs/gnome/gnome-shell-design/mockups/motion/textures/panel.png"
|
||||||
sodipodi:cx="51"
|
inkscape:export-xdpi="90"
|
||||||
id="path34506-3"
|
inkscape:export-ydpi="90" />
|
||||||
style="opacity:0.4625;color:#000000;fill:url(#radialGradient2997);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
<rect
|
||||||
sodipodi:type="arc" />
|
style="fill:#ffffff;fill-opacity:0.50196078;stroke-width:0.43599999;stroke-miterlimit:4;stroke-dasharray:none"
|
||||||
<rect
|
id="rect2996"
|
||||||
y="558.85046"
|
width="31"
|
||||||
x="468.96878"
|
height="3"
|
||||||
height="3.1425927"
|
x="468.08264"
|
||||||
width="28.149134"
|
y="558.99304" />
|
||||||
id="rect2996"
|
|
||||||
style="fill:#ffffff;fill-opacity:0.50196078;stroke-width:0.43599999;stroke-miterlimit:4;stroke-dasharray:none" />
|
|
||||||
</g>
|
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 6.1 KiB |
289
data/theme/checkbox-focused.svg
Normal file
@ -0,0 +1,289 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="24"
|
||||||
|
height="22"
|
||||||
|
id="svg3199"
|
||||||
|
version="1.1"
|
||||||
|
inkscape:version="0.48.1 r9760"
|
||||||
|
sodipodi:docname="checkbox.svg">
|
||||||
|
<defs
|
||||||
|
id="defs3201">
|
||||||
|
<linearGradient
|
||||||
|
id="linearGradient15404"
|
||||||
|
inkscape:collect="always">
|
||||||
|
<stop
|
||||||
|
id="stop15406"
|
||||||
|
offset="0"
|
||||||
|
style="stop-color:#515151;stop-opacity:1" />
|
||||||
|
<stop
|
||||||
|
id="stop15408"
|
||||||
|
offset="1"
|
||||||
|
style="stop-color:#292929;stop-opacity:1" />
|
||||||
|
</linearGradient>
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 526.18109 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="744.09448 : 526.18109 : 1"
|
||||||
|
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
|
||||||
|
id="perspective3207" />
|
||||||
|
<inkscape:perspective
|
||||||
|
id="perspective3187"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
sodipodi:type="inkscape:persp3d" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient5872-5-1"
|
||||||
|
id="linearGradient5891-0-4"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x1="205.84143"
|
||||||
|
y1="246.7094"
|
||||||
|
x2="206.74803"
|
||||||
|
y2="231.24142" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient5872-5-1">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#0b2e52;stop-opacity:1"
|
||||||
|
offset="0"
|
||||||
|
id="stop5874-4-4" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#1862af;stop-opacity:1"
|
||||||
|
offset="1"
|
||||||
|
id="stop5876-0-5" />
|
||||||
|
</linearGradient>
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="spiro"
|
||||||
|
id="path-effect5837-4-6"
|
||||||
|
is_visible="true" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="spiro"
|
||||||
|
id="path-effect14768"
|
||||||
|
is_visible="true" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="spiro"
|
||||||
|
id="path-effect5884-4-7"
|
||||||
|
is_visible="true" />
|
||||||
|
<linearGradient
|
||||||
|
y2="-388.72955"
|
||||||
|
x2="-93.031357"
|
||||||
|
y1="-396.34738"
|
||||||
|
x1="-93.031357"
|
||||||
|
gradientTransform="matrix(1.5918367,0,0,0.85714285,-256.56122,59.685418)"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
id="linearGradient14219"
|
||||||
|
xlink:href="#linearGradient15404"
|
||||||
|
inkscape:collect="always" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient10013-4-63-6">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#333333;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop10015-2-76-1" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#292929;stop-opacity:1"
|
||||||
|
offset="1"
|
||||||
|
id="stop10017-46-15-8" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient10597-5">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#16191a;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop10599-2" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#2b3133;stop-opacity:1"
|
||||||
|
offset="1"
|
||||||
|
id="stop10601-5" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
y2="-322.16354"
|
||||||
|
x2="921.22498"
|
||||||
|
y1="-330.05121"
|
||||||
|
x1="921.32812"
|
||||||
|
gradientTransform="matrix(1.5918367,0,0,0.85714285,-1456.5464,275.45191)"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
id="linearGradient15374"
|
||||||
|
xlink:href="#linearGradient10013-4-63-6"
|
||||||
|
inkscape:collect="always" />
|
||||||
|
<linearGradient
|
||||||
|
gradientTransform="translate(-1199.9852,216.38048)"
|
||||||
|
y2="-227.07961"
|
||||||
|
x2="1203.9177"
|
||||||
|
y1="-217.56708"
|
||||||
|
x1="1203.9177"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
id="linearGradient15376"
|
||||||
|
xlink:href="#linearGradient10597-5"
|
||||||
|
inkscape:collect="always" />
|
||||||
|
<linearGradient
|
||||||
|
y2="-388.72955"
|
||||||
|
x2="-93.031357"
|
||||||
|
y1="-396.34738"
|
||||||
|
x1="-93.031357"
|
||||||
|
gradientTransform="matrix(1.5918367,0,0,0.85714285,-256.56122,59.685418)"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
id="linearGradient14219-6"
|
||||||
|
xlink:href="#linearGradient15404-9"
|
||||||
|
inkscape:collect="always" />
|
||||||
|
<linearGradient
|
||||||
|
id="linearGradient15404-9"
|
||||||
|
inkscape:collect="always">
|
||||||
|
<stop
|
||||||
|
id="stop15406-6"
|
||||||
|
offset="0"
|
||||||
|
style="stop-color:#515151;stop-opacity:1" />
|
||||||
|
<stop
|
||||||
|
id="stop15408-7"
|
||||||
|
offset="1"
|
||||||
|
style="stop-color:#292929;stop-opacity:1" />
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#000000"
|
||||||
|
bordercolor="#2d2d2d"
|
||||||
|
borderopacity="1"
|
||||||
|
inkscape:pageopacity="1"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="1"
|
||||||
|
inkscape:cx="71.516955"
|
||||||
|
inkscape:cy="5.8710559"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:window-width="1412"
|
||||||
|
inkscape:window-height="1067"
|
||||||
|
inkscape:window-x="2635"
|
||||||
|
inkscape:window-y="226"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
borderlayer="true"
|
||||||
|
inkscape:showpageshadow="false"
|
||||||
|
inkscape:snap-nodes="false"
|
||||||
|
inkscape:snap-bbox="true"
|
||||||
|
showborder="false">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid14843"
|
||||||
|
empspacing="5"
|
||||||
|
visible="true"
|
||||||
|
enabled="true"
|
||||||
|
snapvisiblegridlinesonly="true" />
|
||||||
|
</sodipodi:namedview>
|
||||||
|
<metadata
|
||||||
|
id="metadata3204">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(-342.5,-521.36218)">
|
||||||
|
<g
|
||||||
|
transform="matrix(0.80230061,0,0,0.80230061,-87.624044,-453.10297)"
|
||||||
|
id="g14586-0"
|
||||||
|
style="stroke-width:2.3714385;stroke-miterlimit:4;stroke-dasharray:none">
|
||||||
|
<g
|
||||||
|
inkscape:export-ydpi="90"
|
||||||
|
inkscape:export-xdpi="90"
|
||||||
|
inkscape:export-filename="/home/jimmac/SparkleShare/gnome-mockups/boxes/interactive/img/checkbox-on.png"
|
||||||
|
transform="matrix(1.9969286,0,0,1.9969286,-397.05491,877.00482)"
|
||||||
|
id="g15291-9-6"
|
||||||
|
style="stroke-width:1.18754292;stroke-miterlimit:4;stroke-dasharray:none;display:inline;enable-background:new">
|
||||||
|
<g
|
||||||
|
transform="translate(877.50354,-102.83507)"
|
||||||
|
id="g16853-4-9"
|
||||||
|
style="stroke-width:1.18754292;stroke-miterlimit:4;stroke-dasharray:none;enable-background:new">
|
||||||
|
<rect
|
||||||
|
transform="scale(1,-1)"
|
||||||
|
style="color:#000000;fill:url(#linearGradient14219-6);fill-opacity:1;fill-rule:nonzero;stroke:#3465a4;stroke-width:1.24833274;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
|
||||||
|
id="rect6506-6"
|
||||||
|
width="11.281681"
|
||||||
|
height="11.26221"
|
||||||
|
x="-409.59354"
|
||||||
|
y="-284.40115"
|
||||||
|
rx="1.0052766"
|
||||||
|
ry="1.0052764" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
inkscape:export-ydpi="90"
|
||||||
|
inkscape:export-xdpi="90"
|
||||||
|
inkscape:export-filename="/home/jimmac/SparkleShare/gnome-mockups/boxes/interactive/img/checkbox-on.png"
|
||||||
|
transform="translate(343.99999,987.99997)"
|
||||||
|
id="g5886-5"
|
||||||
|
style="stroke-width:2.3714385;stroke-miterlimit:4;stroke-dasharray:none;display:inline;enable-background:new" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
transform="matrix(0.84337,0,0,0.84337,-110.16632,-503.56182)"
|
||||||
|
id="g14586">
|
||||||
|
<g
|
||||||
|
inkscape:export-ydpi="90"
|
||||||
|
inkscape:export-xdpi="90"
|
||||||
|
inkscape:export-filename="/home/jimmac/SparkleShare/gnome-mockups/boxes/interactive/img/checkbox-on.png"
|
||||||
|
transform="matrix(1.9969286,0,0,1.9969286,-397.05491,877.00482)"
|
||||||
|
id="g15291-9"
|
||||||
|
style="display:inline;enable-background:new">
|
||||||
|
<g
|
||||||
|
transform="translate(877.50354,-102.83507)"
|
||||||
|
id="g16853-4"
|
||||||
|
style="enable-background:new" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
inkscape:export-ydpi="90"
|
||||||
|
inkscape:export-xdpi="90"
|
||||||
|
inkscape:export-filename="/home/jimmac/SparkleShare/gnome-mockups/boxes/interactive/img/checkbox-on.png"
|
||||||
|
transform="translate(343.99999,987.99997)"
|
||||||
|
id="g5886"
|
||||||
|
style="display:inline;enable-background:new">
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:url(#linearGradient5891-0-4);stroke-width:7.11431503;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||||
|
d="m 198.5,240 5.25,5.25 13.98616,-14.43081"
|
||||||
|
id="path5835"
|
||||||
|
inkscape:path-effect="#path-effect5837-4-6"
|
||||||
|
inkscape:original-d="m 198.5,240 5.25,5.25 13.98616,-14.43081"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="ccc" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
inkscape:original-d="m 198.5,240 5.25,5.25 13.91205,-14.31964"
|
||||||
|
inkscape:path-effect="#path-effect5837-4-6"
|
||||||
|
id="path5880"
|
||||||
|
d="m 198.5,240 5.25,5.25 13.91205,-14.31964"
|
||||||
|
style="fill:none;stroke:#4787c8;stroke-width:3.55715752;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||||
|
sodipodi:nodetypes="ccc" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#7ea7d3;stroke-width:1.18571913px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
d="m 197.45937,240.47455 c -0.17828,-0.29362 -0.20087,-0.67548 -0.0603,-0.98892 0.14055,-0.31344 0.43739,-0.54812 0.77144,-0.62817 0.33405,-0.08 0.69314,-0.01 0.99635,0.15175 0.30321,0.16144 0.55146,0.40727 0.79165,0.65284 l 3.66429,3.74643 12.87946,-12.98973 c 0.20796,-0.20974 0.42306,-0.41969 0.68548,-0.55522 0.26242,-0.13553 0.57293,-0.19052 0.85827,-0.11426 0.14267,0.0381 0.27708,0.10787 0.38874,0.20452 0.11167,0.0966 0.20021,0.22004 0.25479,0.35726 0.0546,0.13722 0.075,0.28793 0.0585,0.43468 -0.0165,0.14674 -0.07,0.28919 -0.15422,0.41052"
|
||||||
|
id="path5882"
|
||||||
|
inkscape:path-effect="#path-effect5884-4-7"
|
||||||
|
inkscape:original-d="m 197.45937,240.47455 c 0.65604,-0.56057 2.02485,-1.34847 2.49911,-0.8125 l 3.66429,3.74643 12.87946,-12.98973 c 0.6875,-0.6875 2.09152,0.7375 2.09152,0.7375"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="csccc" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 11 KiB |
198
data/theme/checkbox-off-focused.svg
Normal file
@ -0,0 +1,198 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="24"
|
||||||
|
height="22"
|
||||||
|
id="svg3199"
|
||||||
|
version="1.1"
|
||||||
|
inkscape:version="0.48.1 r9760"
|
||||||
|
sodipodi:docname="checkbox-off.svg">
|
||||||
|
<defs
|
||||||
|
id="defs3201">
|
||||||
|
<linearGradient
|
||||||
|
id="linearGradient15404"
|
||||||
|
inkscape:collect="always">
|
||||||
|
<stop
|
||||||
|
id="stop15406"
|
||||||
|
offset="0"
|
||||||
|
style="stop-color:#515151;stop-opacity:1" />
|
||||||
|
<stop
|
||||||
|
id="stop15408"
|
||||||
|
offset="1"
|
||||||
|
style="stop-color:#292929;stop-opacity:1" />
|
||||||
|
</linearGradient>
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 526.18109 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="744.09448 : 526.18109 : 1"
|
||||||
|
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
|
||||||
|
id="perspective3207" />
|
||||||
|
<inkscape:perspective
|
||||||
|
id="perspective3187"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
sodipodi:type="inkscape:persp3d" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="spiro"
|
||||||
|
id="path-effect5837-4-6"
|
||||||
|
is_visible="true" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="spiro"
|
||||||
|
id="path-effect14768"
|
||||||
|
is_visible="true" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="spiro"
|
||||||
|
id="path-effect5884-4-7"
|
||||||
|
is_visible="true" />
|
||||||
|
<linearGradient
|
||||||
|
y2="-388.72955"
|
||||||
|
x2="-93.031357"
|
||||||
|
y1="-396.34738"
|
||||||
|
x1="-93.031357"
|
||||||
|
gradientTransform="matrix(1.5918367,0,0,0.85714285,-256.56122,59.685418)"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
id="linearGradient14219"
|
||||||
|
xlink:href="#linearGradient15404"
|
||||||
|
inkscape:collect="always" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient10013-4-63-6">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#333333;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop10015-2-76-1" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#292929;stop-opacity:1"
|
||||||
|
offset="1"
|
||||||
|
id="stop10017-46-15-8" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient10597-5">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#16191a;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop10599-2" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#2b3133;stop-opacity:1"
|
||||||
|
offset="1"
|
||||||
|
id="stop10601-5" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
y2="-322.16354"
|
||||||
|
x2="921.22498"
|
||||||
|
y1="-330.05121"
|
||||||
|
x1="921.32812"
|
||||||
|
gradientTransform="matrix(1.5918367,0,0,0.85714285,-1456.5464,275.45191)"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
id="linearGradient15374"
|
||||||
|
xlink:href="#linearGradient10013-4-63-6"
|
||||||
|
inkscape:collect="always" />
|
||||||
|
<linearGradient
|
||||||
|
gradientTransform="translate(-1199.9852,216.38048)"
|
||||||
|
y2="-227.07961"
|
||||||
|
x2="1203.9177"
|
||||||
|
y1="-217.56708"
|
||||||
|
x1="1203.9177"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
id="linearGradient15376"
|
||||||
|
xlink:href="#linearGradient10597-5"
|
||||||
|
inkscape:collect="always" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#000000"
|
||||||
|
bordercolor="#2d2d2d"
|
||||||
|
borderopacity="1"
|
||||||
|
inkscape:pageopacity="1"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="1"
|
||||||
|
inkscape:cx="6.1225392"
|
||||||
|
inkscape:cy="3.6003241"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:window-width="1412"
|
||||||
|
inkscape:window-height="1067"
|
||||||
|
inkscape:window-x="2116"
|
||||||
|
inkscape:window-y="261"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
borderlayer="true"
|
||||||
|
inkscape:showpageshadow="false"
|
||||||
|
inkscape:snap-nodes="false"
|
||||||
|
inkscape:snap-bbox="true"
|
||||||
|
showborder="false">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid14843"
|
||||||
|
empspacing="5"
|
||||||
|
visible="true"
|
||||||
|
enabled="true"
|
||||||
|
snapvisiblegridlinesonly="true" />
|
||||||
|
</sodipodi:namedview>
|
||||||
|
<metadata
|
||||||
|
id="metadata3204">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(-342.5,-521.36218)">
|
||||||
|
<g
|
||||||
|
transform="matrix(0.80230061,0,0,0.80230061,-87.624044,-453.10297)"
|
||||||
|
id="g14586"
|
||||||
|
style="stroke-width:2.3714385;stroke-miterlimit:4;stroke-dasharray:none">
|
||||||
|
<g
|
||||||
|
inkscape:export-ydpi="90"
|
||||||
|
inkscape:export-xdpi="90"
|
||||||
|
inkscape:export-filename="/home/jimmac/SparkleShare/gnome-mockups/boxes/interactive/img/checkbox-on.png"
|
||||||
|
transform="matrix(1.9969286,0,0,1.9969286,-397.05491,877.00482)"
|
||||||
|
id="g15291-9"
|
||||||
|
style="stroke-width:1.18754292;stroke-miterlimit:4;stroke-dasharray:none;display:inline;enable-background:new">
|
||||||
|
<g
|
||||||
|
transform="translate(877.50354,-102.83507)"
|
||||||
|
id="g16853-4"
|
||||||
|
style="stroke-width:1.18754292;stroke-miterlimit:4;stroke-dasharray:none;enable-background:new">
|
||||||
|
<rect
|
||||||
|
transform="scale(1,-1)"
|
||||||
|
style="color:#000000;fill:url(#linearGradient14219);fill-opacity:1;fill-rule:nonzero;stroke:#3465a4;stroke-width:1.24833274;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
|
||||||
|
id="rect6506-6"
|
||||||
|
width="11.281681"
|
||||||
|
height="11.26221"
|
||||||
|
x="-409.59354"
|
||||||
|
y="-284.40115"
|
||||||
|
rx="1.0052766"
|
||||||
|
ry="1.0052764" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
inkscape:export-ydpi="90"
|
||||||
|
inkscape:export-xdpi="90"
|
||||||
|
inkscape:export-filename="/home/jimmac/SparkleShare/gnome-mockups/boxes/interactive/img/checkbox-on.png"
|
||||||
|
transform="translate(343.99999,987.99997)"
|
||||||
|
id="g5886"
|
||||||
|
style="stroke-width:2.3714385;stroke-miterlimit:4;stroke-dasharray:none;display:inline;enable-background:new" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 6.5 KiB |
218
data/theme/checkbox-off.svg
Normal file
@ -0,0 +1,218 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="24"
|
||||||
|
height="22"
|
||||||
|
id="svg3199"
|
||||||
|
version="1.1"
|
||||||
|
inkscape:version="0.48.1 r9760"
|
||||||
|
sodipodi:docname="checkbox.svg">
|
||||||
|
<defs
|
||||||
|
id="defs3201">
|
||||||
|
<linearGradient
|
||||||
|
id="linearGradient15404"
|
||||||
|
inkscape:collect="always">
|
||||||
|
<stop
|
||||||
|
id="stop15406"
|
||||||
|
offset="0"
|
||||||
|
style="stop-color:#515151;stop-opacity:1" />
|
||||||
|
<stop
|
||||||
|
id="stop15408"
|
||||||
|
offset="1"
|
||||||
|
style="stop-color:#292929;stop-opacity:1" />
|
||||||
|
</linearGradient>
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 526.18109 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="744.09448 : 526.18109 : 1"
|
||||||
|
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
|
||||||
|
id="perspective3207" />
|
||||||
|
<inkscape:perspective
|
||||||
|
id="perspective3187"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
sodipodi:type="inkscape:persp3d" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient5872-5-1"
|
||||||
|
id="linearGradient5891-0-4"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x1="205.84143"
|
||||||
|
y1="246.7094"
|
||||||
|
x2="206.74803"
|
||||||
|
y2="231.24142" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient5872-5-1">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#0b2e52;stop-opacity:1"
|
||||||
|
offset="0"
|
||||||
|
id="stop5874-4-4" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#1862af;stop-opacity:1"
|
||||||
|
offset="1"
|
||||||
|
id="stop5876-0-5" />
|
||||||
|
</linearGradient>
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="spiro"
|
||||||
|
id="path-effect5837-4-6"
|
||||||
|
is_visible="true" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="spiro"
|
||||||
|
id="path-effect14768"
|
||||||
|
is_visible="true" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="spiro"
|
||||||
|
id="path-effect5884-4-7"
|
||||||
|
is_visible="true" />
|
||||||
|
<linearGradient
|
||||||
|
y2="-388.72955"
|
||||||
|
x2="-93.031357"
|
||||||
|
y1="-396.34738"
|
||||||
|
x1="-93.031357"
|
||||||
|
gradientTransform="matrix(1.5918367,0,0,0.85714285,-256.56122,59.685418)"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
id="linearGradient14219"
|
||||||
|
xlink:href="#linearGradient15404"
|
||||||
|
inkscape:collect="always" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient10013-4-63-6">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#333333;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop10015-2-76-1" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#292929;stop-opacity:1"
|
||||||
|
offset="1"
|
||||||
|
id="stop10017-46-15-8" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient10597-5">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#16191a;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop10599-2" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#2b3133;stop-opacity:1"
|
||||||
|
offset="1"
|
||||||
|
id="stop10601-5" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
y2="-322.16354"
|
||||||
|
x2="921.22498"
|
||||||
|
y1="-330.05121"
|
||||||
|
x1="921.32812"
|
||||||
|
gradientTransform="matrix(1.5918367,0,0,0.85714285,-1456.5464,275.45191)"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
id="linearGradient15374"
|
||||||
|
xlink:href="#linearGradient10013-4-63-6"
|
||||||
|
inkscape:collect="always" />
|
||||||
|
<linearGradient
|
||||||
|
gradientTransform="translate(-1199.9852,216.38048)"
|
||||||
|
y2="-227.07961"
|
||||||
|
x2="1203.9177"
|
||||||
|
y1="-217.56708"
|
||||||
|
x1="1203.9177"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
id="linearGradient15376"
|
||||||
|
xlink:href="#linearGradient10597-5"
|
||||||
|
inkscape:collect="always" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#000000"
|
||||||
|
bordercolor="#2d2d2d"
|
||||||
|
borderopacity="1"
|
||||||
|
inkscape:pageopacity="1"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="4"
|
||||||
|
inkscape:cx="71.247925"
|
||||||
|
inkscape:cy="33.339093"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:window-width="1412"
|
||||||
|
inkscape:window-height="1067"
|
||||||
|
inkscape:window-x="2116"
|
||||||
|
inkscape:window-y="261"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
borderlayer="true"
|
||||||
|
inkscape:showpageshadow="false"
|
||||||
|
inkscape:snap-nodes="false"
|
||||||
|
inkscape:snap-bbox="true"
|
||||||
|
showborder="false">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid14843"
|
||||||
|
empspacing="5"
|
||||||
|
visible="true"
|
||||||
|
enabled="true"
|
||||||
|
snapvisiblegridlinesonly="true" />
|
||||||
|
</sodipodi:namedview>
|
||||||
|
<metadata
|
||||||
|
id="metadata3204">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(-342.5,-521.36218)">
|
||||||
|
<g
|
||||||
|
transform="matrix(0.84337,0,0,0.84337,-110.16632,-503.56182)"
|
||||||
|
id="g14586">
|
||||||
|
<g
|
||||||
|
inkscape:export-ydpi="90"
|
||||||
|
inkscape:export-xdpi="90"
|
||||||
|
inkscape:export-filename="/home/jimmac/SparkleShare/gnome-mockups/boxes/interactive/img/checkbox-on.png"
|
||||||
|
transform="matrix(1.9969286,0,0,1.9969286,-397.05491,877.00482)"
|
||||||
|
id="g15291-9"
|
||||||
|
style="display:inline;enable-background:new">
|
||||||
|
<g
|
||||||
|
transform="translate(877.50354,-102.83507)"
|
||||||
|
id="g16853-4"
|
||||||
|
style="enable-background:new">
|
||||||
|
<rect
|
||||||
|
transform="scale(1,-1)"
|
||||||
|
style="color:#000000;fill:url(#linearGradient14219);fill-opacity:1;fill-rule:nonzero;stroke:#868686;stroke-width:0.59377144999999998;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
|
||||||
|
id="rect6506-6"
|
||||||
|
width="11.281681"
|
||||||
|
height="11.26221"
|
||||||
|
x="-409.59354"
|
||||||
|
y="-284.40115"
|
||||||
|
rx="0.95632279"
|
||||||
|
ry="0.95632273" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
inkscape:export-ydpi="90"
|
||||||
|
inkscape:export-xdpi="90"
|
||||||
|
inkscape:export-filename="/home/jimmac/SparkleShare/gnome-mockups/boxes/interactive/img/checkbox-on.png"
|
||||||
|
transform="translate(343.99999,987.99997)"
|
||||||
|
id="g5886"
|
||||||
|
style="display:inline;enable-background:new" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 6.8 KiB |
243
data/theme/checkbox.svg
Normal file
@ -0,0 +1,243 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="24"
|
||||||
|
height="22"
|
||||||
|
id="svg3199"
|
||||||
|
version="1.1"
|
||||||
|
inkscape:version="0.48.1 r9760"
|
||||||
|
sodipodi:docname="checkbox-focused.svg">
|
||||||
|
<defs
|
||||||
|
id="defs3201">
|
||||||
|
<linearGradient
|
||||||
|
id="linearGradient15404"
|
||||||
|
inkscape:collect="always">
|
||||||
|
<stop
|
||||||
|
id="stop15406"
|
||||||
|
offset="0"
|
||||||
|
style="stop-color:#515151;stop-opacity:1" />
|
||||||
|
<stop
|
||||||
|
id="stop15408"
|
||||||
|
offset="1"
|
||||||
|
style="stop-color:#292929;stop-opacity:1" />
|
||||||
|
</linearGradient>
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 526.18109 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="744.09448 : 526.18109 : 1"
|
||||||
|
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
|
||||||
|
id="perspective3207" />
|
||||||
|
<inkscape:perspective
|
||||||
|
id="perspective3187"
|
||||||
|
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||||
|
inkscape:vp_z="1 : 0.5 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_x="0 : 0.5 : 1"
|
||||||
|
sodipodi:type="inkscape:persp3d" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient5872-5-1"
|
||||||
|
id="linearGradient5891-0-4"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x1="205.84143"
|
||||||
|
y1="246.7094"
|
||||||
|
x2="206.74803"
|
||||||
|
y2="231.24142" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient5872-5-1">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#0b2e52;stop-opacity:1"
|
||||||
|
offset="0"
|
||||||
|
id="stop5874-4-4" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#1862af;stop-opacity:1"
|
||||||
|
offset="1"
|
||||||
|
id="stop5876-0-5" />
|
||||||
|
</linearGradient>
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="spiro"
|
||||||
|
id="path-effect5837-4-6"
|
||||||
|
is_visible="true" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="spiro"
|
||||||
|
id="path-effect14768"
|
||||||
|
is_visible="true" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="spiro"
|
||||||
|
id="path-effect5884-4-7"
|
||||||
|
is_visible="true" />
|
||||||
|
<linearGradient
|
||||||
|
y2="-388.72955"
|
||||||
|
x2="-93.031357"
|
||||||
|
y1="-396.34738"
|
||||||
|
x1="-93.031357"
|
||||||
|
gradientTransform="matrix(1.5918367,0,0,0.85714285,-256.56122,59.685418)"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
id="linearGradient14219"
|
||||||
|
xlink:href="#linearGradient15404"
|
||||||
|
inkscape:collect="always" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient10013-4-63-6">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#333333;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop10015-2-76-1" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#292929;stop-opacity:1"
|
||||||
|
offset="1"
|
||||||
|
id="stop10017-46-15-8" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient10597-5">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#16191a;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop10599-2" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#2b3133;stop-opacity:1"
|
||||||
|
offset="1"
|
||||||
|
id="stop10601-5" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
y2="-322.16354"
|
||||||
|
x2="921.22498"
|
||||||
|
y1="-330.05121"
|
||||||
|
x1="921.32812"
|
||||||
|
gradientTransform="matrix(1.5918367,0,0,0.85714285,-1456.5464,275.45191)"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
id="linearGradient15374"
|
||||||
|
xlink:href="#linearGradient10013-4-63-6"
|
||||||
|
inkscape:collect="always" />
|
||||||
|
<linearGradient
|
||||||
|
gradientTransform="translate(-1199.9852,216.38048)"
|
||||||
|
y2="-227.07961"
|
||||||
|
x2="1203.9177"
|
||||||
|
y1="-217.56708"
|
||||||
|
x1="1203.9177"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
id="linearGradient15376"
|
||||||
|
xlink:href="#linearGradient10597-5"
|
||||||
|
inkscape:collect="always" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#000000"
|
||||||
|
bordercolor="#2d2d2d"
|
||||||
|
borderopacity="1"
|
||||||
|
inkscape:pageopacity="1"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="1"
|
||||||
|
inkscape:cx="64.516955"
|
||||||
|
inkscape:cy="13.871056"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:window-width="1412"
|
||||||
|
inkscape:window-height="1067"
|
||||||
|
inkscape:window-x="2635"
|
||||||
|
inkscape:window-y="226"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
borderlayer="true"
|
||||||
|
inkscape:showpageshadow="false"
|
||||||
|
inkscape:snap-nodes="false"
|
||||||
|
inkscape:snap-bbox="true"
|
||||||
|
showborder="false">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid14843"
|
||||||
|
empspacing="5"
|
||||||
|
visible="true"
|
||||||
|
enabled="true"
|
||||||
|
snapvisiblegridlinesonly="true" />
|
||||||
|
</sodipodi:namedview>
|
||||||
|
<metadata
|
||||||
|
id="metadata3204">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(-342.5,-521.36218)">
|
||||||
|
<g
|
||||||
|
transform="matrix(0.84337,0,0,0.84337,-110.16632,-503.56182)"
|
||||||
|
id="g14586">
|
||||||
|
<g
|
||||||
|
inkscape:export-ydpi="90"
|
||||||
|
inkscape:export-xdpi="90"
|
||||||
|
inkscape:export-filename="/home/jimmac/SparkleShare/gnome-mockups/boxes/interactive/img/checkbox-on.png"
|
||||||
|
transform="matrix(1.9969286,0,0,1.9969286,-397.05491,877.00482)"
|
||||||
|
id="g15291-9"
|
||||||
|
style="display:inline;enable-background:new">
|
||||||
|
<g
|
||||||
|
transform="translate(877.50354,-102.83507)"
|
||||||
|
id="g16853-4"
|
||||||
|
style="enable-background:new">
|
||||||
|
<rect
|
||||||
|
transform="scale(1,-1)"
|
||||||
|
style="color:#000000;fill:url(#linearGradient14219);fill-opacity:1;fill-rule:nonzero;stroke:#868686;stroke-width:0.59377144999999998;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
|
||||||
|
id="rect6506-6"
|
||||||
|
width="11.281681"
|
||||||
|
height="11.26221"
|
||||||
|
x="-409.59354"
|
||||||
|
y="-284.40115"
|
||||||
|
rx="0.95632279"
|
||||||
|
ry="0.95632273" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
inkscape:export-ydpi="90"
|
||||||
|
inkscape:export-xdpi="90"
|
||||||
|
inkscape:export-filename="/home/jimmac/SparkleShare/gnome-mockups/boxes/interactive/img/checkbox-on.png"
|
||||||
|
transform="translate(343.99999,987.99997)"
|
||||||
|
id="g5886"
|
||||||
|
style="display:inline;enable-background:new">
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:url(#linearGradient5891-0-4);stroke-width:7.11431503;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||||
|
d="m 198.5,240 5.25,5.25 13.98616,-14.43081"
|
||||||
|
id="path5835"
|
||||||
|
inkscape:path-effect="#path-effect5837-4-6"
|
||||||
|
inkscape:original-d="m 198.5,240 5.25,5.25 13.98616,-14.43081"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="ccc" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
inkscape:original-d="m 198.5,240 5.25,5.25 13.91205,-14.31964"
|
||||||
|
inkscape:path-effect="#path-effect5837-4-6"
|
||||||
|
id="path5880"
|
||||||
|
d="m 198.5,240 5.25,5.25 13.91205,-14.31964"
|
||||||
|
style="fill:none;stroke:#4787c8;stroke-width:3.55715752;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||||
|
sodipodi:nodetypes="ccc" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#7ea7d3;stroke-width:1.18571913px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
d="m 197.45937,240.47455 c -0.17828,-0.29362 -0.20087,-0.67548 -0.0603,-0.98892 0.14055,-0.31344 0.43739,-0.54812 0.77144,-0.62817 0.33405,-0.08 0.69314,-0.01 0.99635,0.15175 0.30321,0.16144 0.55146,0.40727 0.79165,0.65284 l 3.66429,3.74643 12.87946,-12.98973 c 0.20796,-0.20974 0.42306,-0.41969 0.68548,-0.55522 0.26242,-0.13553 0.57293,-0.19052 0.85827,-0.11426 0.14267,0.0381 0.27708,0.10787 0.38874,0.20452 0.11167,0.0966 0.20021,0.22004 0.25479,0.35726 0.0546,0.13722 0.075,0.28793 0.0585,0.43468 -0.0165,0.14674 -0.07,0.28919 -0.15422,0.41052"
|
||||||
|
id="path5882"
|
||||||
|
inkscape:path-effect="#path-effect5884-4-7"
|
||||||
|
inkscape:original-d="m 197.45937,240.47455 c 0.65604,-0.56057 2.02485,-1.34847 2.49911,-0.8125 l 3.66429,3.74643 12.87946,-12.98973 c 0.6875,-0.6875 2.09152,0.7375 2.09152,0.7375"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="csccc" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 8.8 KiB |
@ -1,166 +0,0 @@
|
|||||||
/* Copyright 2011, Red Hat, Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms and conditions of the GNU Lesser General Public License,
|
|
||||||
* version 2.1, as published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope it will be useful, but WITHOUT ANY
|
|
||||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with this program; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Login Dialog */
|
|
||||||
|
|
||||||
.login-dialog-title {
|
|
||||||
font-size: 14pt;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #666666;
|
|
||||||
padding-bottom: 2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog {
|
|
||||||
border-radius: 16px;
|
|
||||||
min-height: 150px;
|
|
||||||
max-height: 700px;
|
|
||||||
min-width: 350px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-prompt-fingerprint-message {
|
|
||||||
font-size: 10.5pt;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-user-list-view {
|
|
||||||
-st-vfade-offset: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-user-list {
|
|
||||||
spacing: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-user-list-item {
|
|
||||||
color: #666666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-user-list-item:ltr {
|
|
||||||
padding-right: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-user-list-item:rtl {
|
|
||||||
padding-left: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-user-list-item .login-dialog-user-list-item-name {
|
|
||||||
font-size: 20pt;
|
|
||||||
padding-left: 1em;
|
|
||||||
color: #666666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-user-list-item:hover .login-dialog-user-list-item-name {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-user-list-item:focus .login-dialog-user-list-item-name {
|
|
||||||
color: white;
|
|
||||||
text-shadow: black 0px 2px 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-user-list-item-vertical-layout {
|
|
||||||
spacing: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-user-list-item .login-dialog-user-list-item-focus-bin {
|
|
||||||
background-color: rgba(0,0,0,0.0);
|
|
||||||
height: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-user-list-item:focus .login-dialog-user-list-item-focus-bin {
|
|
||||||
background-color: #666666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-user-list-item-icon {
|
|
||||||
border: 2px solid #8b8b8b;
|
|
||||||
border-radius: 8px;
|
|
||||||
width: 64px;
|
|
||||||
height: 64px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-not-listed-button {
|
|
||||||
padding-top: 2em;
|
|
||||||
}
|
|
||||||
.login-dialog-not-listed-label {
|
|
||||||
font-size: 14pt;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #666666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-prompt-layout {
|
|
||||||
padding-bottom: 64px;
|
|
||||||
}
|
|
||||||
.login-dialog-prompt-label {
|
|
||||||
color: white;
|
|
||||||
font-size: 20pt;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-prompt-entry {
|
|
||||||
padding: 4px;
|
|
||||||
border-radius: 4px;
|
|
||||||
border: 2px solid #5656cc;
|
|
||||||
color: black;
|
|
||||||
background-color: white;
|
|
||||||
caret-color: black;
|
|
||||||
caret-size: 1px;
|
|
||||||
width: 15em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-session-list {
|
|
||||||
color: #ffffff;
|
|
||||||
font-size: 10.5pt;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-session-list-button {
|
|
||||||
padding: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-session-list-button:focus {
|
|
||||||
background-color: #4c4c4c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-session-list-button:active {
|
|
||||||
background-color: #4c4c4c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-session-list-button:hover {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-session-list-scroll-view {
|
|
||||||
background-gradient-start: rgba(80,80,80,0.3);
|
|
||||||
background-gradient-end: rgba(80,80,80,0.7);
|
|
||||||
background-gradient-direction: vertical;
|
|
||||||
box-shadow: inset 0px 2px 4px rgba(0,0,0,0.9);
|
|
||||||
border-radius: 8px;
|
|
||||||
border: 1px solid rgba(80,80,80,1.0);
|
|
||||||
padding: .5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-session-list-item:focus {
|
|
||||||
background-color: #666666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-session-list-triangle {
|
|
||||||
padding-right: .5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-session-list-item-box {
|
|
||||||
spacing: .25em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-dialog-session-list-item-dot {
|
|
||||||
width: .75em;
|
|
||||||
height: .75em;
|
|
||||||
}
|
|
130
data/theme/logged-in-indicator.svg
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="300"
|
||||||
|
height="80"
|
||||||
|
id="svg7355"
|
||||||
|
version="1.1"
|
||||||
|
inkscape:version="0.48.2 r9819"
|
||||||
|
sodipodi:docname="logged-in-indicator.svg">
|
||||||
|
<metadata
|
||||||
|
id="metadata4175">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<sodipodi:namedview
|
||||||
|
pagecolor="#2c1cff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="1"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1440"
|
||||||
|
inkscape:window-height="843"
|
||||||
|
id="namedview4173"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="2.8760889"
|
||||||
|
inkscape:cx="106.00403"
|
||||||
|
inkscape:cy="80.68078"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="27"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="g30864" />
|
||||||
|
<defs
|
||||||
|
id="defs7357">
|
||||||
|
<radialGradient
|
||||||
|
xlink:href="#linearGradient36429"
|
||||||
|
id="radialGradient7461"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="matrix(2.5919312,0,0,0.57582113,-20.687059,48.400487)"
|
||||||
|
cx="47.428951"
|
||||||
|
cy="167.16817"
|
||||||
|
fx="47.428951"
|
||||||
|
fy="167.16817"
|
||||||
|
r="37" />
|
||||||
|
<linearGradient
|
||||||
|
id="linearGradient36429">
|
||||||
|
<stop
|
||||||
|
id="stop36431"
|
||||||
|
offset="0"
|
||||||
|
style="stop-color:#ffffff;stop-opacity:1;" />
|
||||||
|
<stop
|
||||||
|
id="stop36433"
|
||||||
|
offset="1"
|
||||||
|
style="stop-color:#ffffff;stop-opacity:0;" />
|
||||||
|
</linearGradient>
|
||||||
|
<radialGradient
|
||||||
|
xlink:href="#linearGradient36471"
|
||||||
|
id="radialGradient7463"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="matrix(1.1891549,0,0,0.55513246,-9.281289,36.12653)"
|
||||||
|
cx="49.067139"
|
||||||
|
cy="242.50381"
|
||||||
|
fx="49.067139"
|
||||||
|
fy="242.50381"
|
||||||
|
r="37.00671" />
|
||||||
|
<linearGradient
|
||||||
|
id="linearGradient36471">
|
||||||
|
<stop
|
||||||
|
id="stop36473"
|
||||||
|
offset="0"
|
||||||
|
style="stop-color:#ffffff;stop-opacity:1;" />
|
||||||
|
<stop
|
||||||
|
id="stop36475"
|
||||||
|
offset="1"
|
||||||
|
style="stop-color:#ffffff;stop-opacity:0;" />
|
||||||
|
</linearGradient>
|
||||||
|
<radialGradient
|
||||||
|
r="37.00671"
|
||||||
|
fy="242.50381"
|
||||||
|
fx="49.067139"
|
||||||
|
cy="242.50381"
|
||||||
|
cx="49.067139"
|
||||||
|
gradientTransform="matrix(3.4218418,0,0,0.03365337,-61.309005,138.5071)"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
id="radialGradient7488"
|
||||||
|
xlink:href="#linearGradient36471" />
|
||||||
|
</defs>
|
||||||
|
<g
|
||||||
|
id="layer1"
|
||||||
|
transform="matrix(1.6213276,0,0,1.6213276,-431.6347,-272.5745)">
|
||||||
|
<g
|
||||||
|
style="display:inline"
|
||||||
|
id="g30864"
|
||||||
|
transform="translate(255.223,70.118091)">
|
||||||
|
<rect
|
||||||
|
ry="3.4593496"
|
||||||
|
rx="8.8641119"
|
||||||
|
y="76.159348"
|
||||||
|
x="12.596948"
|
||||||
|
height="71.116341"
|
||||||
|
width="182.22595"
|
||||||
|
id="rect14000"
|
||||||
|
style="opacity:0.371875;fill:url(#radialGradient7461);fill-opacity:1;stroke:none" />
|
||||||
|
<path
|
||||||
|
id="rect34520"
|
||||||
|
d="m 194.80022,146.83551 -182.559919,0"
|
||||||
|
style="opacity:0.35;fill:none;stroke:url(#radialGradient7488);stroke-width:0.61184424;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||||
|
connector-curvature="0"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 3.8 KiB |
BIN
data/theme/message-tray-background.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
data/theme/noise-texture.png
Normal file
After Width: | Height: | Size: 78 KiB |
@ -1,33 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="3"
|
|
||||||
height="10"
|
|
||||||
id="svg2"
|
|
||||||
version="1.1">
|
|
||||||
<defs
|
|
||||||
id="defs4" />
|
|
||||||
<metadata
|
|
||||||
id="metadata7">
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
id="layer1">
|
|
||||||
<rect
|
|
||||||
style="fill:#000000;fill-opacity:1;stroke-width:0.43599999000000000;stroke-miterlimit:4;stroke-dasharray:none"
|
|
||||||
id="rect3779"
|
|
||||||
width="3"
|
|
||||||
height="10"
|
|
||||||
x="0"
|
|
||||||
y="0" />
|
|
||||||
<rect
|
|
||||||
style="fill:#536272;fill-opacity:1;stroke-width:0.43599999;stroke-miterlimit:4;stroke-dasharray:none"
|
|
||||||
id="rect3796"
|
|
||||||
width="3"
|
|
||||||
height="1"
|
|
||||||
x="0"
|
|
||||||
y="9" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 787 B |
@ -9,7 +9,7 @@
|
|||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
width="21"
|
width="17"
|
||||||
height="10"
|
height="10"
|
||||||
id="svg2"
|
id="svg2"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
@ -66,9 +66,9 @@
|
|||||||
<rect
|
<rect
|
||||||
style="opacity:0.8;fill:#ffffff;fill-opacity:1;stroke-width:0.43599999;stroke-miterlimit:4;stroke-dasharray:none"
|
style="opacity:0.8;fill:#ffffff;fill-opacity:1;stroke-width:0.43599999;stroke-miterlimit:4;stroke-dasharray:none"
|
||||||
id="rect3796"
|
id="rect3796"
|
||||||
width="3"
|
width="7"
|
||||||
height="2"
|
height="2"
|
||||||
x="9"
|
x="5"
|
||||||
y="8" />
|
y="8" />
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
@ -1,64 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="10"
|
|
||||||
height="4"
|
|
||||||
id="svg2"
|
|
||||||
version="1.1"
|
|
||||||
inkscape:version="0.47 r22583"
|
|
||||||
sodipodi:docname="scroll-hhandle.svg">
|
|
||||||
<defs
|
|
||||||
id="defs4">
|
|
||||||
</defs>
|
|
||||||
<metadata
|
|
||||||
id="metadata7">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title />
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
inkscape:label="Layer 1"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer1">
|
|
||||||
<rect
|
|
||||||
style="fill:#323232;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
|
||||||
id="rect3592"
|
|
||||||
width="2"
|
|
||||||
height="4"
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
rx="0"
|
|
||||||
ry="0" />
|
|
||||||
<use
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
xlink:href="#rect3592"
|
|
||||||
id="use2825"
|
|
||||||
transform="translate(8,0)"
|
|
||||||
width="10"
|
|
||||||
height="4" />
|
|
||||||
<use
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
xlink:href="#use2825"
|
|
||||||
id="use2827"
|
|
||||||
transform="translate(-4,0)"
|
|
||||||
width="10"
|
|
||||||
height="4" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 1.6 KiB |
@ -1,62 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="4"
|
|
||||||
height="10"
|
|
||||||
id="svg2"
|
|
||||||
version="1.1"
|
|
||||||
inkscape:version="0.47 r22583"
|
|
||||||
sodipodi:docname="scroll-hhandle.svg">
|
|
||||||
<metadata
|
|
||||||
id="metadata7">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title></dc:title>
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
inkscape:label="Layer 1"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer1">
|
|
||||||
<rect
|
|
||||||
style="fill:#323232;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
|
||||||
id="rect3592"
|
|
||||||
width="2"
|
|
||||||
height="4"
|
|
||||||
x="0"
|
|
||||||
y="-4"
|
|
||||||
rx="0"
|
|
||||||
ry="0"
|
|
||||||
transform="matrix(0,1,-1,0,0,0)" />
|
|
||||||
<use
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
xlink:href="#rect3592"
|
|
||||||
id="use3705"
|
|
||||||
transform="translate(0,4)"
|
|
||||||
width="4"
|
|
||||||
height="10" />
|
|
||||||
<use
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
xlink:href="#use3705"
|
|
||||||
id="use3707"
|
|
||||||
transform="translate(0,4)"
|
|
||||||
width="4"
|
|
||||||
height="10" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 1.6 KiB |
120
data/theme/summary-counter.svg
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 13.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
version="1.0"
|
||||||
|
id="Foreground"
|
||||||
|
x="0px"
|
||||||
|
y="0px"
|
||||||
|
width="32"
|
||||||
|
height="32"
|
||||||
|
viewBox="0 0 23.272727 23.272727"
|
||||||
|
enable-background="new 0 0 16 16"
|
||||||
|
xml:space="preserve"
|
||||||
|
sodipodi:version="0.32"
|
||||||
|
inkscape:version="0.48.2 r9819"
|
||||||
|
sodipodi:docname="summary-counter.svg"
|
||||||
|
inkscape:output_extension="org.inkscape.output.svg.inkscape"><metadata
|
||||||
|
id="metadata2399"><rdf:RDF><cc:Work
|
||||||
|
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
|
||||||
|
id="defs2397"><linearGradient
|
||||||
|
id="linearGradient3173"><stop
|
||||||
|
style="stop-color:#c4c4c4;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop3175" /><stop
|
||||||
|
style="stop-color:#ffffff;stop-opacity:1;"
|
||||||
|
offset="1"
|
||||||
|
id="stop3177" /></linearGradient><inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 8 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="16 : 8 : 1"
|
||||||
|
inkscape:persp3d-origin="8 : 5.3333333 : 1"
|
||||||
|
id="perspective2401" /><filter
|
||||||
|
color-interpolation-filters="sRGB"
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="filter16494-4"
|
||||||
|
x="-0.20989846"
|
||||||
|
width="1.4197969"
|
||||||
|
y="-0.20903821"
|
||||||
|
height="1.4180764"><feGaussianBlur
|
||||||
|
inkscape:collect="always"
|
||||||
|
stdDeviation="1.3282637"
|
||||||
|
id="feGaussianBlur16496-8" /></filter><radialGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient16498-6"
|
||||||
|
id="radialGradient16504-1"
|
||||||
|
cx="7.6582627"
|
||||||
|
cy="5.8191104"
|
||||||
|
fx="7.6582627"
|
||||||
|
fy="5.8191104"
|
||||||
|
r="8.6928644"
|
||||||
|
gradientTransform="matrix(1.0474339,0,0,1.0517402,-0.3632615,-0.42032492)"
|
||||||
|
gradientUnits="userSpaceOnUse" /><linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient16498-6"><stop
|
||||||
|
style="stop-color:#9FD0FF;stop-opacity:1"
|
||||||
|
offset="0"
|
||||||
|
id="stop16500-8" /><stop
|
||||||
|
style="stop-color:#3465A4;stop-opacity:1"
|
||||||
|
offset="1"
|
||||||
|
id="stop16502-0" /></linearGradient></defs><sodipodi:namedview
|
||||||
|
inkscape:window-height="709"
|
||||||
|
inkscape:window-width="1366"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
guidetolerance="10.0"
|
||||||
|
gridtolerance="10.0"
|
||||||
|
objecttolerance="10.0"
|
||||||
|
borderopacity="1.0"
|
||||||
|
bordercolor="#666666"
|
||||||
|
pagecolor="#000000"
|
||||||
|
id="base"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="11.313708"
|
||||||
|
inkscape:cx="15.386407"
|
||||||
|
inkscape:cy="13.739577"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="1179"
|
||||||
|
inkscape:current-layer="g16402-8"
|
||||||
|
showguides="true"
|
||||||
|
inkscape:guide-bbox="true"
|
||||||
|
borderlayer="true"
|
||||||
|
inkscape:showpageshadow="false"
|
||||||
|
inkscape:window-maximized="1"><inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid11246"
|
||||||
|
empspacing="5"
|
||||||
|
visible="true"
|
||||||
|
enabled="true"
|
||||||
|
snapvisiblegridlinesonly="true" /></sodipodi:namedview><g
|
||||||
|
style="display:inline"
|
||||||
|
id="g16402-8"
|
||||||
|
transform="translate(4.7533483,2.8238929)"><g
|
||||||
|
id="g3175-4"
|
||||||
|
transform="translate(-0.89995416,0.94028614)"><path
|
||||||
|
sodipodi:type="inkscape:offset"
|
||||||
|
inkscape:radius="0"
|
||||||
|
inkscape:original="M 7.65625 0.125 C 3.2589349 0.125 -0.3125 3.7070002 -0.3125 8.125 C -0.3125 12.543001 3.2589349 16.125 7.65625 16.125 C 12.053566 16.125 15.625 12.543001 15.625 8.125 C 15.625 3.7070002 12.053566 0.125 7.65625 0.125 z "
|
||||||
|
xlink:href="#path2394-32"
|
||||||
|
style="opacity:0.52994014;color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.18181825;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter16494-4);enable-background:accumulate"
|
||||||
|
id="path16480-5"
|
||||||
|
inkscape:href="#path2394-32"
|
||||||
|
d="m 7.65625,0.125 c -4.3973151,0 -7.96875,3.5820002 -7.96875,8 0,4.418001 3.5714349,8 7.96875,8 4.397316,0 7.96875,-3.581999 7.96875,-8 0,-4.4179998 -3.571434,-8 -7.96875,-8 z"
|
||||||
|
transform="translate(0,1.028519)" /><path
|
||||||
|
clip-rule="evenodd"
|
||||||
|
d="m -0.30428257,8.1237596 c 0,-4.4179998 3.56522987,-7.9999996 7.96254497,-7.9999996 4.3973156,0 7.9625456,3.5819998 7.9625456,7.9999996 0,4.4180014 -3.56523,8.0000004 -7.9625456,8.0000004 -4.3973151,0 -7.96254497,-3.581999 -7.96254497,-8.0000004 z"
|
||||||
|
id="path2394-32"
|
||||||
|
style="color:#000000;fill:url(#radialGradient16504-1);fill-opacity:1;fill-rule:nonzero;stroke:#eeeeec;stroke-width:1.4545455;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
||||||
|
sodipodi:nodetypes="csssc"
|
||||||
|
inkscape:connector-curvature="0" /><g
|
||||||
|
id="g3172-6" /></g></g></svg>
|
After Width: | Height: | Size: 5.4 KiB |
@ -9,7 +9,7 @@
|
|||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
width="64"
|
width="65"
|
||||||
height="22"
|
height="22"
|
||||||
id="svg3273"
|
id="svg3273"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
@ -9,7 +9,7 @@
|
|||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
width="64"
|
width="65"
|
||||||
height="22"
|
height="22"
|
||||||
id="svg3012"
|
id="svg3012"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
BIN
data/theme/ws-switch-arrow-down.png
Normal file
After Width: | Height: | Size: 850 B |
@ -1,376 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
version="1.1"
|
|
||||||
width="96"
|
|
||||||
height="96"
|
|
||||||
id="svg25070"
|
|
||||||
inkscape:version="0.48.0 r9654"
|
|
||||||
sodipodi:docname="ws-switch-arrow-down.svg">
|
|
||||||
<metadata
|
|
||||||
id="metadata3353">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<sodipodi:namedview
|
|
||||||
pagecolor="#ffffff"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1"
|
|
||||||
objecttolerance="10"
|
|
||||||
gridtolerance="10"
|
|
||||||
guidetolerance="10"
|
|
||||||
inkscape:pageopacity="0"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:window-width="718"
|
|
||||||
inkscape:window-height="480"
|
|
||||||
id="namedview3351"
|
|
||||||
showgrid="false"
|
|
||||||
inkscape:zoom="2.6979167"
|
|
||||||
inkscape:cx="48"
|
|
||||||
inkscape:cy="48"
|
|
||||||
inkscape:window-x="0"
|
|
||||||
inkscape:window-y="26"
|
|
||||||
inkscape:window-maximized="0"
|
|
||||||
inkscape:current-layer="svg25070" />
|
|
||||||
<defs
|
|
||||||
id="defs25072">
|
|
||||||
<linearGradient
|
|
||||||
x1="-86.552246"
|
|
||||||
y1="185.439"
|
|
||||||
x2="-83.37072"
|
|
||||||
y2="197.31261"
|
|
||||||
id="linearGradient24957"
|
|
||||||
xlink:href="#linearGradient4034-0-4"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
gradientTransform="translate(6,0)" />
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4034-0-4">
|
|
||||||
<stop
|
|
||||||
id="stop4036-5-7"
|
|
||||||
style="stop-color:#eeeeec;stop-opacity:1"
|
|
||||||
offset="0" />
|
|
||||||
<stop
|
|
||||||
id="stop4038-9-6"
|
|
||||||
style="stop-color:#babdb6;stop-opacity:1"
|
|
||||||
offset="1" />
|
|
||||||
</linearGradient>
|
|
||||||
<filter
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="1"
|
|
||||||
height="1"
|
|
||||||
color-interpolation-filters="sRGB"
|
|
||||||
id="filter24765">
|
|
||||||
<feColorMatrix
|
|
||||||
result="fbSourceGraphic"
|
|
||||||
values="1"
|
|
||||||
type="saturate"
|
|
||||||
id="feColorMatrix24767" />
|
|
||||||
<feColorMatrix
|
|
||||||
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
|
|
||||||
in="fbSourceGraphic"
|
|
||||||
id="feColorMatrix24769" />
|
|
||||||
</filter>
|
|
||||||
<linearGradient
|
|
||||||
x1="-74.520325"
|
|
||||||
y1="169.06032"
|
|
||||||
x2="-74.520325"
|
|
||||||
y2="205.94189"
|
|
||||||
id="linearGradient24955"
|
|
||||||
xlink:href="#linearGradient4632-1-3-9-3-2"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
gradientTransform="translate(-5,0)" />
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4632-1-3-9-3-2">
|
|
||||||
<stop
|
|
||||||
id="stop4634-1-8-3-9-0"
|
|
||||||
style="stop-color:#eeeeec;stop-opacity:1"
|
|
||||||
offset="0" />
|
|
||||||
<stop
|
|
||||||
id="stop4636-1-9-9-8-8"
|
|
||||||
style="stop-color:#ffffff;stop-opacity:1"
|
|
||||||
offset="0.0274937" />
|
|
||||||
<stop
|
|
||||||
id="stop4638-8-3-9-6-6"
|
|
||||||
style="stop-color:#f2f2f2;stop-opacity:1"
|
|
||||||
offset="0.274937" />
|
|
||||||
<stop
|
|
||||||
id="stop4640-8-5-7-8-9"
|
|
||||||
style="stop-color:#eeeeec;stop-opacity:1"
|
|
||||||
offset="0.38707438" />
|
|
||||||
<stop
|
|
||||||
id="stop4642-5-41-9-6-9"
|
|
||||||
style="stop-color:#d9dad8;stop-opacity:1"
|
|
||||||
offset="0.66528589" />
|
|
||||||
<stop
|
|
||||||
id="stop4644-5-2-7-9-2"
|
|
||||||
style="stop-color:#dfe0dd;stop-opacity:1"
|
|
||||||
offset="0.76745707" />
|
|
||||||
<stop
|
|
||||||
id="stop4646-3-2-3-7-3"
|
|
||||||
style="stop-color:#f0f0f0;stop-opacity:1"
|
|
||||||
offset="1" />
|
|
||||||
</linearGradient>
|
|
||||||
<radialGradient
|
|
||||||
cx="-33.412369"
|
|
||||||
cy="185.74171"
|
|
||||||
r="2.3554697"
|
|
||||||
fx="-33.412369"
|
|
||||||
fy="185.74171"
|
|
||||||
id="radialGradient24959"
|
|
||||||
xlink:href="#linearGradient4869-4-1"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
gradientTransform="matrix(1.0075,0,0,1.0075,-5.4544,-1.25141)" />
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4869-4-1">
|
|
||||||
<stop
|
|
||||||
id="stop4871-6-2"
|
|
||||||
style="stop-color:#ffffff;stop-opacity:1"
|
|
||||||
offset="0" />
|
|
||||||
<stop
|
|
||||||
id="stop4879-7-4"
|
|
||||||
style="stop-color:#eeeeec;stop-opacity:1"
|
|
||||||
offset="0.31807542" />
|
|
||||||
<stop
|
|
||||||
id="stop4877-6-1"
|
|
||||||
style="stop-color:#c8c9c6;stop-opacity:1"
|
|
||||||
offset="0.74691135" />
|
|
||||||
<stop
|
|
||||||
id="stop4873-1-0"
|
|
||||||
style="stop-color:#d3d7cf;stop-opacity:1"
|
|
||||||
offset="1" />
|
|
||||||
</linearGradient>
|
|
||||||
<filter
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="1"
|
|
||||||
height="1"
|
|
||||||
color-interpolation-filters="sRGB"
|
|
||||||
id="filter25011">
|
|
||||||
<feColorMatrix
|
|
||||||
result="fbSourceGraphic"
|
|
||||||
values="1"
|
|
||||||
type="saturate"
|
|
||||||
id="feColorMatrix25013" />
|
|
||||||
<feColorMatrix
|
|
||||||
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
|
|
||||||
in="fbSourceGraphic"
|
|
||||||
id="feColorMatrix25015" />
|
|
||||||
</filter>
|
|
||||||
<radialGradient
|
|
||||||
cx="-33.412369"
|
|
||||||
cy="185.74171"
|
|
||||||
r="2.3554697"
|
|
||||||
fx="-33.412369"
|
|
||||||
fy="185.74171"
|
|
||||||
id="radialGradient24961"
|
|
||||||
xlink:href="#linearGradient4869-4-0"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
gradientTransform="matrix(1.0075,0,0,1.0075,-5.4544,-1.25141)" />
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4869-4-0">
|
|
||||||
<stop
|
|
||||||
id="stop4871-6-8"
|
|
||||||
style="stop-color:#ffffff;stop-opacity:1"
|
|
||||||
offset="0" />
|
|
||||||
<stop
|
|
||||||
id="stop4879-7-5"
|
|
||||||
style="stop-color:#eeeeec;stop-opacity:1"
|
|
||||||
offset="0.31807542" />
|
|
||||||
<stop
|
|
||||||
id="stop4877-6-5"
|
|
||||||
style="stop-color:#c8c9c6;stop-opacity:1"
|
|
||||||
offset="0.74691135" />
|
|
||||||
<stop
|
|
||||||
id="stop4873-1-4"
|
|
||||||
style="stop-color:#d3d7cf;stop-opacity:1"
|
|
||||||
offset="1" />
|
|
||||||
</linearGradient>
|
|
||||||
<filter
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="1"
|
|
||||||
height="1"
|
|
||||||
color-interpolation-filters="sRGB"
|
|
||||||
id="filter25023">
|
|
||||||
<feColorMatrix
|
|
||||||
result="fbSourceGraphic"
|
|
||||||
values="1"
|
|
||||||
type="saturate"
|
|
||||||
id="feColorMatrix25025" />
|
|
||||||
<feColorMatrix
|
|
||||||
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
|
|
||||||
in="fbSourceGraphic"
|
|
||||||
id="feColorMatrix25027" />
|
|
||||||
</filter>
|
|
||||||
<linearGradient
|
|
||||||
x1="-39.858727"
|
|
||||||
y1="184.61784"
|
|
||||||
x2="-38.244785"
|
|
||||||
y2="188.84898"
|
|
||||||
id="linearGradient24963"
|
|
||||||
xlink:href="#linearGradient4941"
|
|
||||||
gradientUnits="userSpaceOnUse" />
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4941">
|
|
||||||
<stop
|
|
||||||
id="stop4943"
|
|
||||||
style="stop-color:#ffffff;stop-opacity:1"
|
|
||||||
offset="0" />
|
|
||||||
<stop
|
|
||||||
id="stop4945"
|
|
||||||
style="stop-color:#ffffff;stop-opacity:0"
|
|
||||||
offset="1" />
|
|
||||||
</linearGradient>
|
|
||||||
<filter
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="1"
|
|
||||||
height="1"
|
|
||||||
color-interpolation-filters="sRGB"
|
|
||||||
id="filter25033">
|
|
||||||
<feColorMatrix
|
|
||||||
result="fbSourceGraphic"
|
|
||||||
values="1"
|
|
||||||
type="saturate"
|
|
||||||
id="feColorMatrix25035" />
|
|
||||||
<feColorMatrix
|
|
||||||
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
|
|
||||||
in="fbSourceGraphic"
|
|
||||||
id="feColorMatrix25037" />
|
|
||||||
</filter>
|
|
||||||
<linearGradient
|
|
||||||
x1="-39.858727"
|
|
||||||
y1="184.61784"
|
|
||||||
x2="-38.244785"
|
|
||||||
y2="188.84898"
|
|
||||||
id="linearGradient24965"
|
|
||||||
xlink:href="#linearGradient4941-7"
|
|
||||||
gradientUnits="userSpaceOnUse" />
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4941-7">
|
|
||||||
<stop
|
|
||||||
id="stop4943-2"
|
|
||||||
style="stop-color:#ffffff;stop-opacity:1"
|
|
||||||
offset="0" />
|
|
||||||
<stop
|
|
||||||
id="stop4945-5"
|
|
||||||
style="stop-color:#ffffff;stop-opacity:0"
|
|
||||||
offset="1" />
|
|
||||||
</linearGradient>
|
|
||||||
<filter
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="1"
|
|
||||||
height="1"
|
|
||||||
color-interpolation-filters="sRGB"
|
|
||||||
id="filter25043">
|
|
||||||
<feColorMatrix
|
|
||||||
result="fbSourceGraphic"
|
|
||||||
values="1"
|
|
||||||
type="saturate"
|
|
||||||
id="feColorMatrix25045" />
|
|
||||||
<feColorMatrix
|
|
||||||
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
|
|
||||||
in="fbSourceGraphic"
|
|
||||||
id="feColorMatrix25047" />
|
|
||||||
</filter>
|
|
||||||
<filter
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="1"
|
|
||||||
height="1"
|
|
||||||
color-interpolation-filters="sRGB"
|
|
||||||
id="filter25049">
|
|
||||||
<feColorMatrix
|
|
||||||
result="fbSourceGraphic"
|
|
||||||
values="1"
|
|
||||||
type="saturate"
|
|
||||||
id="feColorMatrix25051" />
|
|
||||||
<feColorMatrix
|
|
||||||
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
|
|
||||||
in="fbSourceGraphic"
|
|
||||||
id="feColorMatrix25053" />
|
|
||||||
</filter>
|
|
||||||
<filter
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="1"
|
|
||||||
height="1"
|
|
||||||
color-interpolation-filters="sRGB"
|
|
||||||
id="filter25055">
|
|
||||||
<feColorMatrix
|
|
||||||
result="fbSourceGraphic"
|
|
||||||
values="1"
|
|
||||||
type="saturate"
|
|
||||||
id="feColorMatrix25057" />
|
|
||||||
<feColorMatrix
|
|
||||||
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
|
|
||||||
in="fbSourceGraphic"
|
|
||||||
id="feColorMatrix25059" />
|
|
||||||
</filter>
|
|
||||||
</defs>
|
|
||||||
<g
|
|
||||||
transform="matrix(0,1,-1,0,48.0003,4.1307112e-7)"
|
|
||||||
id="layer1">
|
|
||||||
<g
|
|
||||||
transform="matrix(-2,0,0,2,-97.2497,-374.967)"
|
|
||||||
id="g4030-1-8"
|
|
||||||
style="stroke:#000000;stroke-opacity:1;display:inline">
|
|
||||||
<path
|
|
||||||
d="m -72.5,173.5 -14,14 14,14"
|
|
||||||
id="path3165-7-3"
|
|
||||||
style="color:#000000;fill:none;stroke:#000000;stroke-width:7;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
</g>
|
|
||||||
<path
|
|
||||||
d="m -36.5,186.40625 a 2.09375,2.09375 0 1 1 -4.1875,0 2.09375,2.09375 0 1 1 4.1875,0 z"
|
|
||||||
transform="matrix(-3.34328,0,0,3.34328,-89.2797,-623.176)"
|
|
||||||
id="path4050-2-7-9-4"
|
|
||||||
style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.52343899;marker:none;visibility:visible;display:inline;overflow:visible"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
<path
|
|
||||||
d="m -36.5,186.40625 a 2.09375,2.09375 0 1 1 -4.1875,0 2.09375,2.09375 0 1 1 4.1875,0 z"
|
|
||||||
transform="matrix(-3.34328,0,0,3.34328,-111.2797,-623.176)"
|
|
||||||
id="path4050-2-7-9-4-8"
|
|
||||||
style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.52343899;marker:none;visibility:visible;display:inline;overflow:visible"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
<path
|
|
||||||
d="m -36.5,186.40625 a 2.09375,2.09375 0 1 1 -4.1875,0 2.09375,2.09375 0 1 1 4.1875,0 z"
|
|
||||||
transform="matrix(-2.86565,0,0,2.86565,-70.8457,-534.143)"
|
|
||||||
id="path4050-2-7-9-4-0"
|
|
||||||
style="color:#000000;fill:none;stroke:#000000;stroke-width:0.69792098;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
<path
|
|
||||||
d="m -36.5,186.40625 a 2.09375,2.09375 0 1 1 -4.1875,0 2.09375,2.09375 0 1 1 4.1875,0 z"
|
|
||||||
transform="matrix(-2.86565,0,0,2.86565,-92.8457,-534.143)"
|
|
||||||
id="path4050-2-7-9-4-0-9"
|
|
||||||
style="color:#000000;fill:none;stroke:#000000;stroke-width:0.69792098;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
<path
|
|
||||||
d="m 47.87528,-34.0295 c 1.53896,0.0448 3.0511,0.70928 4.125,1.8125 l 32.25,32.25 -32.25,32.25 c -2.2253,2.2253 -6.2747,2.2253 -8.5,0 -2.2253,-2.22528 -2.2253,-6.2747 0,-8.5 l 23.75,-23.75 -23.75,-23.75 c -1.73168,-1.6731 -2.295,-4.44228 -1.3546,-6.65894 0.94042,-2.21668 3.32312,-3.73604 5.7296,-3.65356 z"
|
|
||||||
id="path3165-7-3-1"
|
|
||||||
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0pt;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;text-anchor:start;opacity:0.35;color:#000000;fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;font-family:Bitstream Vera Sans"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
<path
|
|
||||||
d="m 41.8316,28.09418 c -0.014,-1.58898 0.54158,-3.18406 1.66868,-4.31118 l 23.75,-23.75 m -25.1046,-30.40894 c 0.94042,-2.21668 3.32312,-3.73604 5.7296,-3.65356 1.53896,0.0448 3.0511,0.70928 4.125,1.8125 l 32.25,32.25"
|
|
||||||
id="path3165-7-3-1-9"
|
|
||||||
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0pt;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;text-anchor:start;color:#000000;fill:none;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;font-family:Bitstream Vera Sans"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 13 KiB |
BIN
data/theme/ws-switch-arrow-up.png
Normal file
After Width: | Height: | Size: 841 B |
@ -1,447 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="96"
|
|
||||||
height="96"
|
|
||||||
id="svg25070"
|
|
||||||
version="1.1"
|
|
||||||
inkscape:version="0.48.0 r9654"
|
|
||||||
sodipodi:docname="ws-switch-arrow-up.svg">
|
|
||||||
<defs
|
|
||||||
id="defs25072">
|
|
||||||
<inkscape:perspective
|
|
||||||
sodipodi:type="inkscape:persp3d"
|
|
||||||
inkscape:vp_x="0 : 24 : 1"
|
|
||||||
inkscape:vp_y="0 : 1000 : 0"
|
|
||||||
inkscape:vp_z="48 : 24 : 1"
|
|
||||||
inkscape:persp3d-origin="24 : 16 : 1"
|
|
||||||
id="perspective25078" />
|
|
||||||
<inkscape:perspective
|
|
||||||
id="perspective24985"
|
|
||||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
|
||||||
inkscape:vp_z="1 : 0.5 : 1"
|
|
||||||
inkscape:vp_y="0 : 1000 : 0"
|
|
||||||
inkscape:vp_x="0 : 0.5 : 1"
|
|
||||||
sodipodi:type="inkscape:persp3d" />
|
|
||||||
<linearGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
xlink:href="#linearGradient4034-0-4"
|
|
||||||
id="linearGradient24957"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
gradientTransform="translate(6)"
|
|
||||||
x1="-86.552246"
|
|
||||||
y1="185.439"
|
|
||||||
x2="-83.37072"
|
|
||||||
y2="197.31261" />
|
|
||||||
<linearGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
id="linearGradient4034-0-4">
|
|
||||||
<stop
|
|
||||||
style="stop-color: rgb(238, 238, 236); stop-opacity: 1;"
|
|
||||||
offset="0"
|
|
||||||
id="stop4036-5-7" />
|
|
||||||
<stop
|
|
||||||
style="stop-color: rgb(186, 189, 182); stop-opacity: 1;"
|
|
||||||
offset="1"
|
|
||||||
id="stop4038-9-6" />
|
|
||||||
</linearGradient>
|
|
||||||
<filter
|
|
||||||
id="filter24765"
|
|
||||||
inkscape:label="Invert"
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="1"
|
|
||||||
height="1"
|
|
||||||
inkscape:menu="Color"
|
|
||||||
inkscape:menu-tooltip="Invert colors"
|
|
||||||
color-interpolation-filters="sRGB">
|
|
||||||
<feColorMatrix
|
|
||||||
id="feColorMatrix24767"
|
|
||||||
type="saturate"
|
|
||||||
values="1"
|
|
||||||
result="fbSourceGraphic" />
|
|
||||||
<feColorMatrix
|
|
||||||
id="feColorMatrix24769"
|
|
||||||
in="fbSourceGraphic"
|
|
||||||
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" />
|
|
||||||
</filter>
|
|
||||||
<linearGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
xlink:href="#linearGradient4632-1-3-9-3-2"
|
|
||||||
id="linearGradient24955"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
gradientTransform="translate(-5)"
|
|
||||||
x1="-74.520325"
|
|
||||||
y1="169.06032"
|
|
||||||
x2="-74.520325"
|
|
||||||
y2="205.94189" />
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4632-1-3-9-3-2">
|
|
||||||
<stop
|
|
||||||
style="stop-color: rgb(238, 238, 236); stop-opacity: 1;"
|
|
||||||
offset="0"
|
|
||||||
id="stop4634-1-8-3-9-0" />
|
|
||||||
<stop
|
|
||||||
id="stop4636-1-9-9-8-8"
|
|
||||||
offset="0.0274937"
|
|
||||||
style="stop-color: rgb(255, 255, 255); stop-opacity: 1;" />
|
|
||||||
<stop
|
|
||||||
id="stop4638-8-3-9-6-6"
|
|
||||||
offset="0.274937"
|
|
||||||
style="stop-color: rgb(242, 242, 242); stop-opacity: 1;" />
|
|
||||||
<stop
|
|
||||||
id="stop4640-8-5-7-8-9"
|
|
||||||
offset="0.38707438"
|
|
||||||
style="stop-color: rgb(238, 238, 236); stop-opacity: 1;" />
|
|
||||||
<stop
|
|
||||||
id="stop4642-5-41-9-6-9"
|
|
||||||
offset="0.66528589"
|
|
||||||
style="stop-color: rgb(217, 218, 216); stop-opacity: 1;" />
|
|
||||||
<stop
|
|
||||||
id="stop4644-5-2-7-9-2"
|
|
||||||
offset="0.76745707"
|
|
||||||
style="stop-color: rgb(223, 224, 221); stop-opacity: 1;" />
|
|
||||||
<stop
|
|
||||||
style="stop-color: rgb(240, 240, 240); stop-opacity: 1;"
|
|
||||||
offset="1"
|
|
||||||
id="stop4646-3-2-3-7-3" />
|
|
||||||
</linearGradient>
|
|
||||||
<radialGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
xlink:href="#linearGradient4869-4-1"
|
|
||||||
id="radialGradient24959"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
gradientTransform="matrix(1.0075, 0, 0, 1.0075, -5.4544, -1.25141)"
|
|
||||||
cx="-33.412369"
|
|
||||||
cy="185.74171"
|
|
||||||
fx="-33.412369"
|
|
||||||
fy="185.74171"
|
|
||||||
r="2.3554697" />
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4869-4-1">
|
|
||||||
<stop
|
|
||||||
style="stop-color: rgb(255, 255, 255); stop-opacity: 1;"
|
|
||||||
offset="0"
|
|
||||||
id="stop4871-6-2" />
|
|
||||||
<stop
|
|
||||||
id="stop4879-7-4"
|
|
||||||
offset="0.31807542"
|
|
||||||
style="stop-color: rgb(238, 238, 236); stop-opacity: 1;" />
|
|
||||||
<stop
|
|
||||||
id="stop4877-6-1"
|
|
||||||
offset="0.74691135"
|
|
||||||
style="stop-color: rgb(200, 201, 198); stop-opacity: 1;" />
|
|
||||||
<stop
|
|
||||||
style="stop-color: rgb(211, 215, 207); stop-opacity: 1;"
|
|
||||||
offset="1"
|
|
||||||
id="stop4873-1-0" />
|
|
||||||
</linearGradient>
|
|
||||||
<filter
|
|
||||||
id="filter25011"
|
|
||||||
inkscape:label="Invert"
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="1"
|
|
||||||
height="1"
|
|
||||||
inkscape:menu="Color"
|
|
||||||
inkscape:menu-tooltip="Invert colors"
|
|
||||||
color-interpolation-filters="sRGB">
|
|
||||||
<feColorMatrix
|
|
||||||
id="feColorMatrix25013"
|
|
||||||
type="saturate"
|
|
||||||
values="1"
|
|
||||||
result="fbSourceGraphic" />
|
|
||||||
<feColorMatrix
|
|
||||||
id="feColorMatrix25015"
|
|
||||||
in="fbSourceGraphic"
|
|
||||||
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" />
|
|
||||||
</filter>
|
|
||||||
<radialGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
xlink:href="#linearGradient4869-4-0"
|
|
||||||
id="radialGradient24961"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
gradientTransform="matrix(1.0075, 0, 0, 1.0075, -5.4544, -1.25141)"
|
|
||||||
cx="-33.412369"
|
|
||||||
cy="185.74171"
|
|
||||||
fx="-33.412369"
|
|
||||||
fy="185.74171"
|
|
||||||
r="2.3554697" />
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient4869-4-0">
|
|
||||||
<stop
|
|
||||||
style="stop-color: rgb(255, 255, 255); stop-opacity: 1;"
|
|
||||||
offset="0"
|
|
||||||
id="stop4871-6-8" />
|
|
||||||
<stop
|
|
||||||
id="stop4879-7-5"
|
|
||||||
offset="0.31807542"
|
|
||||||
style="stop-color: rgb(238, 238, 236); stop-opacity: 1;" />
|
|
||||||
<stop
|
|
||||||
id="stop4877-6-5"
|
|
||||||
offset="0.74691135"
|
|
||||||
style="stop-color: rgb(200, 201, 198); stop-opacity: 1;" />
|
|
||||||
<stop
|
|
||||||
style="stop-color: rgb(211, 215, 207); stop-opacity: 1;"
|
|
||||||
offset="1"
|
|
||||||
id="stop4873-1-4" />
|
|
||||||
</linearGradient>
|
|
||||||
<filter
|
|
||||||
id="filter25023"
|
|
||||||
inkscape:label="Invert"
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="1"
|
|
||||||
height="1"
|
|
||||||
inkscape:menu="Color"
|
|
||||||
inkscape:menu-tooltip="Invert colors"
|
|
||||||
color-interpolation-filters="sRGB">
|
|
||||||
<feColorMatrix
|
|
||||||
id="feColorMatrix25025"
|
|
||||||
type="saturate"
|
|
||||||
values="1"
|
|
||||||
result="fbSourceGraphic" />
|
|
||||||
<feColorMatrix
|
|
||||||
id="feColorMatrix25027"
|
|
||||||
in="fbSourceGraphic"
|
|
||||||
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" />
|
|
||||||
</filter>
|
|
||||||
<linearGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
xlink:href="#linearGradient4941"
|
|
||||||
id="linearGradient24963"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
x1="-39.858727"
|
|
||||||
y1="184.61784"
|
|
||||||
x2="-38.244785"
|
|
||||||
y2="188.84898" />
|
|
||||||
<linearGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
id="linearGradient4941">
|
|
||||||
<stop
|
|
||||||
style="stop-color: rgb(255, 255, 255); stop-opacity: 1;"
|
|
||||||
offset="0"
|
|
||||||
id="stop4943" />
|
|
||||||
<stop
|
|
||||||
style="stop-color: rgb(255, 255, 255); stop-opacity: 0;"
|
|
||||||
offset="1"
|
|
||||||
id="stop4945" />
|
|
||||||
</linearGradient>
|
|
||||||
<filter
|
|
||||||
id="filter25033"
|
|
||||||
inkscape:label="Invert"
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="1"
|
|
||||||
height="1"
|
|
||||||
inkscape:menu="Color"
|
|
||||||
inkscape:menu-tooltip="Invert colors"
|
|
||||||
color-interpolation-filters="sRGB">
|
|
||||||
<feColorMatrix
|
|
||||||
id="feColorMatrix25035"
|
|
||||||
type="saturate"
|
|
||||||
values="1"
|
|
||||||
result="fbSourceGraphic" />
|
|
||||||
<feColorMatrix
|
|
||||||
id="feColorMatrix25037"
|
|
||||||
in="fbSourceGraphic"
|
|
||||||
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" />
|
|
||||||
</filter>
|
|
||||||
<linearGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
xlink:href="#linearGradient4941-7"
|
|
||||||
id="linearGradient24965"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
x1="-39.858727"
|
|
||||||
y1="184.61784"
|
|
||||||
x2="-38.244785"
|
|
||||||
y2="188.84898" />
|
|
||||||
<linearGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
id="linearGradient4941-7">
|
|
||||||
<stop
|
|
||||||
style="stop-color: rgb(255, 255, 255); stop-opacity: 1;"
|
|
||||||
offset="0"
|
|
||||||
id="stop4943-2" />
|
|
||||||
<stop
|
|
||||||
style="stop-color: rgb(255, 255, 255); stop-opacity: 0;"
|
|
||||||
offset="1"
|
|
||||||
id="stop4945-5" />
|
|
||||||
</linearGradient>
|
|
||||||
<filter
|
|
||||||
id="filter25043"
|
|
||||||
inkscape:label="Invert"
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="1"
|
|
||||||
height="1"
|
|
||||||
inkscape:menu="Color"
|
|
||||||
inkscape:menu-tooltip="Invert colors"
|
|
||||||
color-interpolation-filters="sRGB">
|
|
||||||
<feColorMatrix
|
|
||||||
id="feColorMatrix25045"
|
|
||||||
type="saturate"
|
|
||||||
values="1"
|
|
||||||
result="fbSourceGraphic" />
|
|
||||||
<feColorMatrix
|
|
||||||
id="feColorMatrix25047"
|
|
||||||
in="fbSourceGraphic"
|
|
||||||
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" />
|
|
||||||
</filter>
|
|
||||||
<filter
|
|
||||||
id="filter25049"
|
|
||||||
inkscape:label="Invert"
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="1"
|
|
||||||
height="1"
|
|
||||||
inkscape:menu="Color"
|
|
||||||
inkscape:menu-tooltip="Invert colors"
|
|
||||||
color-interpolation-filters="sRGB">
|
|
||||||
<feColorMatrix
|
|
||||||
id="feColorMatrix25051"
|
|
||||||
type="saturate"
|
|
||||||
values="1"
|
|
||||||
result="fbSourceGraphic" />
|
|
||||||
<feColorMatrix
|
|
||||||
id="feColorMatrix25053"
|
|
||||||
in="fbSourceGraphic"
|
|
||||||
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" />
|
|
||||||
</filter>
|
|
||||||
<filter
|
|
||||||
id="filter25055"
|
|
||||||
inkscape:label="Invert"
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="1"
|
|
||||||
height="1"
|
|
||||||
inkscape:menu="Color"
|
|
||||||
inkscape:menu-tooltip="Invert colors"
|
|
||||||
color-interpolation-filters="sRGB">
|
|
||||||
<feColorMatrix
|
|
||||||
id="feColorMatrix25057"
|
|
||||||
type="saturate"
|
|
||||||
values="1"
|
|
||||||
result="fbSourceGraphic" />
|
|
||||||
<feColorMatrix
|
|
||||||
id="feColorMatrix25059"
|
|
||||||
in="fbSourceGraphic"
|
|
||||||
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" />
|
|
||||||
</filter>
|
|
||||||
</defs>
|
|
||||||
<sodipodi:namedview
|
|
||||||
id="base"
|
|
||||||
pagecolor="#ffffff"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1.0"
|
|
||||||
inkscape:pageopacity="0.0"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:zoom="2.8284271"
|
|
||||||
inkscape:cx="-12.356322"
|
|
||||||
inkscape:cy="57.536221"
|
|
||||||
inkscape:current-layer="layer1"
|
|
||||||
showgrid="true"
|
|
||||||
inkscape:grid-bbox="true"
|
|
||||||
inkscape:document-units="px"
|
|
||||||
inkscape:window-width="1200"
|
|
||||||
inkscape:window-height="840"
|
|
||||||
inkscape:window-x="0"
|
|
||||||
inkscape:window-y="26"
|
|
||||||
inkscape:window-maximized="0" />
|
|
||||||
<metadata
|
|
||||||
id="metadata25075">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title />
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
id="layer1"
|
|
||||||
inkscape:label="Layer 1"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
transform="translate(0, 48)">
|
|
||||||
<g
|
|
||||||
id="g3181"
|
|
||||||
transform="matrix(0,1,-1,0,48.0003,-48)">
|
|
||||||
<g
|
|
||||||
style="stroke:#000000;stroke-opacity:1;display:inline"
|
|
||||||
transform="matrix(2,0,0,2,193.25,-374.967)"
|
|
||||||
id="g4030-1-8">
|
|
||||||
<path
|
|
||||||
style="color:#000000;fill:none;stroke:#000000;stroke-width:7;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
|
|
||||||
d="m -72.5,173.5 -14,14 14,14"
|
|
||||||
id="path3165-7-3"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
</g>
|
|
||||||
<path
|
|
||||||
transform="matrix(3.34328,0,0,3.34328,185.28,-623.176)"
|
|
||||||
d="m -36.5,186.40625 c 0,1.15635 -0.937404,2.09375 -2.09375,2.09375 -1.156346,0 -2.09375,-0.9374 -2.09375,-2.09375 0,-1.15635 0.937404,-2.09375 2.09375,-2.09375 1.156346,0 2.09375,0.9374 2.09375,2.09375 z"
|
|
||||||
sodipodi:ry="2.09375"
|
|
||||||
sodipodi:rx="2.09375"
|
|
||||||
sodipodi:cy="186.40625"
|
|
||||||
sodipodi:cx="-38.59375"
|
|
||||||
id="path4050-2-7-9-4"
|
|
||||||
style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.52343899;marker:none;visibility:visible;display:inline;overflow:visible"
|
|
||||||
sodipodi:type="arc" />
|
|
||||||
<path
|
|
||||||
transform="matrix(3.34328,0,0,3.34328,207.28,-623.176)"
|
|
||||||
d="m -36.5,186.40625 c 0,1.15635 -0.937404,2.09375 -2.09375,2.09375 -1.156346,0 -2.09375,-0.9374 -2.09375,-2.09375 0,-1.15635 0.937404,-2.09375 2.09375,-2.09375 1.156346,0 2.09375,0.9374 2.09375,2.09375 z"
|
|
||||||
sodipodi:ry="2.09375"
|
|
||||||
sodipodi:rx="2.09375"
|
|
||||||
sodipodi:cy="186.40625"
|
|
||||||
sodipodi:cx="-38.59375"
|
|
||||||
id="path4050-2-7-9-4-8"
|
|
||||||
style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.52343899;marker:none;visibility:visible;display:inline;overflow:visible"
|
|
||||||
sodipodi:type="arc" />
|
|
||||||
<path
|
|
||||||
transform="matrix(2.86565,0,0,2.86565,166.846,-534.143)"
|
|
||||||
d="m -36.5,186.40625 c 0,1.15635 -0.937404,2.09375 -2.09375,2.09375 -1.156346,0 -2.09375,-0.9374 -2.09375,-2.09375 0,-1.15635 0.937404,-2.09375 2.09375,-2.09375 1.156346,0 2.09375,0.9374 2.09375,2.09375 z"
|
|
||||||
sodipodi:ry="2.09375"
|
|
||||||
sodipodi:rx="2.09375"
|
|
||||||
sodipodi:cy="186.40625"
|
|
||||||
sodipodi:cx="-38.59375"
|
|
||||||
id="path4050-2-7-9-4-0"
|
|
||||||
style="color:#000000;fill:none;stroke:#000000;stroke-width:0.69792098;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
|
|
||||||
sodipodi:type="arc" />
|
|
||||||
<path
|
|
||||||
transform="matrix(2.86565,0,0,2.86565,188.846,-534.143)"
|
|
||||||
d="m -36.5,186.40625 c 0,1.15635 -0.937404,2.09375 -2.09375,2.09375 -1.156346,0 -2.09375,-0.9374 -2.09375,-2.09375 0,-1.15635 0.937404,-2.09375 2.09375,-2.09375 1.156346,0 2.09375,0.9374 2.09375,2.09375 z"
|
|
||||||
sodipodi:ry="2.09375"
|
|
||||||
sodipodi:rx="2.09375"
|
|
||||||
sodipodi:cy="186.40625"
|
|
||||||
sodipodi:cx="-38.59375"
|
|
||||||
id="path4050-2-7-9-4-0-9"
|
|
||||||
style="color:#000000;fill:none;stroke:#000000;stroke-width:0.69792098;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
|
|
||||||
sodipodi:type="arc" />
|
|
||||||
<path
|
|
||||||
transform="matrix(2,0,0,2,-586,-765.967)"
|
|
||||||
sodipodi:nodetypes="ccccscccsc"
|
|
||||||
id="path3165-7-3-1"
|
|
||||||
d="m 317.06251,365.96875 c -0.76948,0.0224 -1.52555,0.35464 -2.0625,0.90625 l -16.125,16.125 16.125,16.125 c 1.11265,1.11265 3.13735,1.11265 4.25,0 1.11265,-1.11264 1.11265,-3.13735 0,-4.25 l -11.875,-11.875 11.875,-11.875 c 0.86584,-0.83655 1.1475,-2.22114 0.6773,-3.32947 -0.47021,-1.10834 -1.66156,-1.86802 -2.8648,-1.82678 z"
|
|
||||||
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0pt;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;text-anchor:start;opacity:0.35;color:#000000;fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;font-family:Bitstream Vera Sans"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
<path
|
|
||||||
transform="matrix(2,0,0,2,-586,-765.967)"
|
|
||||||
sodipodi:nodetypes="ccccccc"
|
|
||||||
id="path3165-7-3-1-9"
|
|
||||||
d="m 320.08435,397.03059 c 0.007,-0.79449 -0.27079,-1.59203 -0.83434,-2.15559 L 307.37501,383 m 12.5523,-15.20447 c -0.47021,-1.10834 -1.66156,-1.86802 -2.8648,-1.82678 -0.76948,0.0224 -1.52555,0.35464 -2.0625,0.90625 L 298.87501,383"
|
|
||||||
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0pt;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;text-anchor:start;color:#000000;fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;font-family:Bitstream Vera Sans"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 16 KiB |
1
docs/Makefile.am
Normal file
@ -0,0 +1 @@
|
|||||||
|
SUBDIRS = reference
|
1
docs/reference/Makefile.am
Normal file
@ -0,0 +1 @@
|
|||||||
|
SUBDIRS = shell st
|
117
docs/reference/shell/Makefile.am
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
|
# We require automake 1.6 at least.
|
||||||
|
AUTOMAKE_OPTIONS = 1.6
|
||||||
|
|
||||||
|
# This is a blank Makefile.am for using gtk-doc.
|
||||||
|
# Copy this to your project's API docs directory and modify the variables to
|
||||||
|
# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
|
||||||
|
# of using the various options.
|
||||||
|
|
||||||
|
# The name of the module, e.g. 'glib'.
|
||||||
|
DOC_MODULE=shell
|
||||||
|
|
||||||
|
# Uncomment for versioned docs and specify the version of the module, e.g. '2'.
|
||||||
|
#DOC_MODULE_VERSION=2
|
||||||
|
|
||||||
|
|
||||||
|
# The top-level SGML file. You can change this if you want to.
|
||||||
|
DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
|
||||||
|
|
||||||
|
# Directories containing the source code
|
||||||
|
# gtk-doc will search all .c and .h files beneath these paths
|
||||||
|
# for inline comments documenting functions and macros.
|
||||||
|
DOC_SOURCE_DIR=$(top_srcdir)/src
|
||||||
|
|
||||||
|
# Extra options to pass to gtkdoc-scangobj. Not normally needed.
|
||||||
|
SCANGOBJ_OPTIONS=
|
||||||
|
|
||||||
|
# Extra options to supply to gtkdoc-scan.
|
||||||
|
# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
|
||||||
|
SCAN_OPTIONS=--rebuild-types
|
||||||
|
|
||||||
|
# Extra options to supply to gtkdoc-mkdb.
|
||||||
|
# e.g. MKDB_OPTIONS=--xml-mode --output-format=xml
|
||||||
|
MKDB_OPTIONS=--xml-mode --output-format=xml
|
||||||
|
|
||||||
|
# Extra options to supply to gtkdoc-mktmpl
|
||||||
|
# e.g. MKTMPL_OPTIONS=--only-section-tmpl
|
||||||
|
MKTMPL_OPTIONS=
|
||||||
|
|
||||||
|
# Extra options to supply to gtkdoc-mkhtml
|
||||||
|
MKHTML_OPTIONS=
|
||||||
|
|
||||||
|
# Extra options to supply to gtkdoc-fixref. Not normally needed.
|
||||||
|
# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
|
||||||
|
FIXXREF_OPTIONS=
|
||||||
|
|
||||||
|
# Used for dependencies. The docs will be rebuilt if any of these change.
|
||||||
|
# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
|
||||||
|
# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
|
||||||
|
HFILE_GLOB=$(top_srcdir)/src/*.h
|
||||||
|
CFILE_GLOB=$(top_srcdir)/src/*.c
|
||||||
|
|
||||||
|
# Extra header to include when scanning, which are not under DOC_SOURCE_DIR
|
||||||
|
# e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h
|
||||||
|
EXTRA_HFILES=
|
||||||
|
|
||||||
|
# Header files or dirs to ignore when scanning. Use base file/dir names
|
||||||
|
# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code
|
||||||
|
IGNORE_HFILES= \
|
||||||
|
calendar-server \
|
||||||
|
gvc \
|
||||||
|
hotplug-sniffer \
|
||||||
|
st \
|
||||||
|
tray \
|
||||||
|
gactionmuxer.h \
|
||||||
|
gactionobservable.h \
|
||||||
|
gactionobserver.h \
|
||||||
|
shell-recorder-src.h
|
||||||
|
|
||||||
|
if !BUILD_RECORDER
|
||||||
|
IGNORE_HFILES += shell-recorder.h
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Images to copy into HTML directory.
|
||||||
|
# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
|
||||||
|
HTML_IMAGES=
|
||||||
|
|
||||||
|
# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
|
||||||
|
# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
|
||||||
|
content_files=
|
||||||
|
|
||||||
|
# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
|
||||||
|
# These files must be listed here *and* in content_files
|
||||||
|
# e.g. expand_content_files=running.sgml
|
||||||
|
expand_content_files=
|
||||||
|
|
||||||
|
# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
|
||||||
|
# Only needed if you are using gtkdoc-scangobj to dynamically query widget
|
||||||
|
# signals and properties.
|
||||||
|
# e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
|
||||||
|
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
|
||||||
|
GTKDOC_CFLAGS=$(GNOME_SHELL_CFLAGS)
|
||||||
|
GTKDOC_LIBS=$(GNOME_SHELL_LIBS) $(BLUETOOTH_LIBS) $(top_builddir)/src/libgnome-shell.la
|
||||||
|
|
||||||
|
# This includes the standard gtk-doc make rules, copied by gtkdocize.
|
||||||
|
include $(top_srcdir)/gtk-doc.make
|
||||||
|
|
||||||
|
# Other files to distribute
|
||||||
|
# e.g. EXTRA_DIST += version.xml.in
|
||||||
|
EXTRA_DIST +=
|
||||||
|
|
||||||
|
# Files not to distribute
|
||||||
|
# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types
|
||||||
|
# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt
|
||||||
|
DISTCLEANFILES = $(DOC_MODULES).types
|
||||||
|
|
||||||
|
# Comment this out if you want 'make check' to test you doc status
|
||||||
|
# and run some sanity checks
|
||||||
|
if ENABLE_GTK_DOC
|
||||||
|
TESTS_ENVIRONMENT = cd $(srcdir) && \
|
||||||
|
DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \
|
||||||
|
SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir)
|
||||||
|
#TESTS = $(GTKDOC_CHECK)
|
||||||
|
endif
|
||||||
|
|
||||||
|
-include $(top_srcdir)/git.mk
|
70
docs/reference/shell/shell-docs.sgml.in
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||||
|
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
|
||||||
|
[
|
||||||
|
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
|
||||||
|
]>
|
||||||
|
<book id="index">
|
||||||
|
<bookinfo>
|
||||||
|
<title>Shell Reference Manual</title>
|
||||||
|
<releaseinfo>
|
||||||
|
for Shell @VERSION@.
|
||||||
|
<!--The latest version of this documentation can be found on-line at
|
||||||
|
<ulink role="online-location" url="http://[SERVER]/shell/index.html">http://[SERVER]/shell/</ulink>.-->
|
||||||
|
</releaseinfo>
|
||||||
|
</bookinfo>
|
||||||
|
|
||||||
|
<chapter>
|
||||||
|
<title>Actors</title>
|
||||||
|
<xi:include href="xml/shell-generic-container.xml"/>
|
||||||
|
<xi:include href="xml/shell-slicer.xml"/>
|
||||||
|
<xi:include href="xml/shell-stack.xml"/>
|
||||||
|
</chapter>
|
||||||
|
<chapter>
|
||||||
|
<title>Application tracking</title>
|
||||||
|
<xi:include href="xml/shell-app.xml"/>
|
||||||
|
<xi:include href="xml/shell-app-usage.xml"/>
|
||||||
|
<xi:include href="xml/shell-window-tracker.xml"/>
|
||||||
|
</chapter>
|
||||||
|
<chapter>
|
||||||
|
<title>Search</title>
|
||||||
|
<xi:include href="xml/shell-app-system.xml"/>
|
||||||
|
</chapter>
|
||||||
|
<chapter>
|
||||||
|
<title>Tray Icons</title>
|
||||||
|
<xi:include href="xml/shell-embedded-window.xml"/>
|
||||||
|
<xi:include href="xml/shell-gtk-embed.xml"/>
|
||||||
|
<xi:include href="xml/shell-tray-icon.xml"/>
|
||||||
|
<xi:include href="xml/shell-tray-manager.xml"/>
|
||||||
|
</chapter>
|
||||||
|
<chapter>
|
||||||
|
<title>Recorder</title>
|
||||||
|
<xi:include href="xml/shell-recorder.xml"/>
|
||||||
|
</chapter>
|
||||||
|
<chapter>
|
||||||
|
<title>Integration helpers and utilities</title>
|
||||||
|
<xi:include href="xml/shell-global.xml"/>
|
||||||
|
<xi:include href="xml/shell-wm.xml"/>
|
||||||
|
<xi:include href="xml/shell-xfixes-cursor.xml"/>
|
||||||
|
<xi:include href="xml/shell-util.xml"/>
|
||||||
|
<xi:include href="xml/shell-mount-operation.xml"/>
|
||||||
|
<xi:include href="xml/shell-mobile-providers.xml"/>
|
||||||
|
<xi:include href="xml/shell-network-agent.xml"/>
|
||||||
|
<xi:include href="xml/shell-polkit-authentication-agent.xml"/>
|
||||||
|
<xi:include href="xml/shell-tp-client.xml"/>
|
||||||
|
</chapter>
|
||||||
|
<chapter id="object-tree">
|
||||||
|
<title>Object Hierarchy</title>
|
||||||
|
<xi:include href="xml/tree_index.sgml"/>
|
||||||
|
</chapter>
|
||||||
|
<index id="api-index-full">
|
||||||
|
<title>API Index</title>
|
||||||
|
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
|
||||||
|
</index>
|
||||||
|
<index id="deprecated-api-index" role="deprecated">
|
||||||
|
<title>Index of deprecated API</title>
|
||||||
|
<xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
|
||||||
|
</index>
|
||||||
|
|
||||||
|
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
|
||||||
|
</book>
|
104
docs/reference/st/Makefile.am
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
|
# We require automake 1.6 at least.
|
||||||
|
AUTOMAKE_OPTIONS = 1.6
|
||||||
|
|
||||||
|
# This is a blank Makefile.am for using gtk-doc.
|
||||||
|
# Copy this to your project's API docs directory and modify the variables to
|
||||||
|
# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
|
||||||
|
# of using the various options.
|
||||||
|
|
||||||
|
# The name of the module, e.g. 'glib'.
|
||||||
|
DOC_MODULE=st
|
||||||
|
|
||||||
|
# Uncomment for versioned docs and specify the version of the module, e.g. '2'.
|
||||||
|
#DOC_MODULE_VERSION=2
|
||||||
|
|
||||||
|
|
||||||
|
# The top-level SGML file. You can change this if you want to.
|
||||||
|
DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
|
||||||
|
|
||||||
|
# Directories containing the source code
|
||||||
|
# gtk-doc will search all .c and .h files beneath these paths
|
||||||
|
# for inline comments documenting functions and macros.
|
||||||
|
DOC_SOURCE_DIR=$(top_srcdir)/src/st
|
||||||
|
|
||||||
|
# Extra options to pass to gtkdoc-scangobj. Not normally needed.
|
||||||
|
SCANGOBJ_OPTIONS=
|
||||||
|
|
||||||
|
# Extra options to supply to gtkdoc-scan.
|
||||||
|
# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
|
||||||
|
SCAN_OPTIONS=--rebuild-types --rebuild-sections
|
||||||
|
|
||||||
|
# Extra options to supply to gtkdoc-mkdb.
|
||||||
|
# e.g. MKDB_OPTIONS=--xml-mode --output-format=xml
|
||||||
|
MKDB_OPTIONS=--xml-mode --output-format=xml
|
||||||
|
|
||||||
|
# Extra options to supply to gtkdoc-mktmpl
|
||||||
|
# e.g. MKTMPL_OPTIONS=--only-section-tmpl
|
||||||
|
MKTMPL_OPTIONS=
|
||||||
|
|
||||||
|
# Extra options to supply to gtkdoc-mkhtml
|
||||||
|
MKHTML_OPTIONS=
|
||||||
|
|
||||||
|
# Extra options to supply to gtkdoc-fixref. Not normally needed.
|
||||||
|
# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
|
||||||
|
FIXXREF_OPTIONS=
|
||||||
|
|
||||||
|
# Used for dependencies. The docs will be rebuilt if any of these change.
|
||||||
|
# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
|
||||||
|
# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
|
||||||
|
HFILE_GLOB=$(top_srcdir)/src/st/*.h
|
||||||
|
CFILE_GLOB=$(top_srcdir)/src/st/*.c
|
||||||
|
|
||||||
|
# Extra header to include when scanning, which are not under DOC_SOURCE_DIR
|
||||||
|
# e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h
|
||||||
|
EXTRA_HFILES=
|
||||||
|
|
||||||
|
# Header files or dirs to ignore when scanning. Use base file/dir names
|
||||||
|
# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code
|
||||||
|
IGNORE_HFILES=st-private.h st-theme-node-private.h
|
||||||
|
|
||||||
|
# Images to copy into HTML directory.
|
||||||
|
# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
|
||||||
|
HTML_IMAGES=
|
||||||
|
|
||||||
|
# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
|
||||||
|
# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
|
||||||
|
content_files=
|
||||||
|
|
||||||
|
# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
|
||||||
|
# These files must be listed here *and* in content_files
|
||||||
|
# e.g. expand_content_files=running.sgml
|
||||||
|
expand_content_files=
|
||||||
|
|
||||||
|
# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
|
||||||
|
# Only needed if you are using gtkdoc-scangobj to dynamically query widget
|
||||||
|
# signals and properties.
|
||||||
|
# e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
|
||||||
|
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
|
||||||
|
GTKDOC_CFLAGS=
|
||||||
|
GTKDOC_LIBS=$(top_builddir)/src/libst-1.0.la
|
||||||
|
|
||||||
|
# This includes the standard gtk-doc make rules, copied by gtkdocize.
|
||||||
|
include $(top_srcdir)/gtk-doc.make
|
||||||
|
|
||||||
|
# Other files to distribute
|
||||||
|
# e.g. EXTRA_DIST += version.xml.in
|
||||||
|
EXTRA_DIST +=
|
||||||
|
|
||||||
|
# Files not to distribute
|
||||||
|
# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types
|
||||||
|
# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt
|
||||||
|
DISTCLEANFILES = $(DOC_MODULE).types $(DOC_MODULE)-sections.txt
|
||||||
|
|
||||||
|
# Comment this out if you want 'make check' to test you doc status
|
||||||
|
# and run some sanity checks
|
||||||
|
if ENABLE_GTK_DOC
|
||||||
|
TESTS_ENVIRONMENT = cd $(srcdir) && \
|
||||||
|
DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \
|
||||||
|
SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir)
|
||||||
|
#TESTS = $(GTKDOC_CHECK)
|
||||||
|
endif
|
||||||
|
|
||||||
|
-include $(top_srcdir)/git.mk
|
64
docs/reference/st/st-docs.sgml.in
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||||
|
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
|
||||||
|
[
|
||||||
|
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
|
||||||
|
]>
|
||||||
|
<book id="index">
|
||||||
|
<bookinfo>
|
||||||
|
<title>St Reference Manual</title>
|
||||||
|
<releaseinfo>
|
||||||
|
for St @VERSION@.
|
||||||
|
<!--The latest version of this documentation can be found on-line at
|
||||||
|
<ulink role="online-location" url="http://[SERVER]/st/index.html">http://[SERVER]/st/</ulink>.-->
|
||||||
|
</releaseinfo>
|
||||||
|
</bookinfo>
|
||||||
|
|
||||||
|
<part>
|
||||||
|
<title>API reference</title>
|
||||||
|
<chapter id="base">
|
||||||
|
<title>Abstract classes and Interfaces</title>
|
||||||
|
<xi:include href="xml/st-widget.xml"/>
|
||||||
|
<xi:include href="xml/st-widget-accessible.xml"/>
|
||||||
|
<xi:include href="xml/st-scrollable.xml"/>
|
||||||
|
</chapter>
|
||||||
|
<chapter id="widgets">
|
||||||
|
<title>Widgets</title>
|
||||||
|
<xi:include href="xml/st-button.xml"/>
|
||||||
|
<xi:include href="xml/st-drawing-area.xml"/>
|
||||||
|
<xi:include href="xml/st-entry.xml"/>
|
||||||
|
<xi:include href="xml/st-icon.xml"/>
|
||||||
|
<xi:include href="xml/st-label.xml"/>
|
||||||
|
</chapter>
|
||||||
|
<chapter id="containers">
|
||||||
|
<title>Containers</title>
|
||||||
|
<xi:include href="xml/st-bin.xml"/>
|
||||||
|
<xi:include href="xml/st-box-layout.xml"/>
|
||||||
|
<xi:include href="xml/st-scroll-view.xml"/>
|
||||||
|
<xi:include href="xml/st-table.xml"/>
|
||||||
|
</chapter>
|
||||||
|
|
||||||
|
<chapter id="styling">
|
||||||
|
<title>Styling</title>
|
||||||
|
<xi:include href="xml/st-theme.xml"/>
|
||||||
|
<xi:include href="xml/st-theme-context.xml"/>
|
||||||
|
<xi:include href="xml/st-theme-node.xml"/>
|
||||||
|
<xi:include href="xml/st-theme-node-transition.xml"/>
|
||||||
|
<xi:include href="xml/st-texture-cache.xml"/>
|
||||||
|
</chapter>
|
||||||
|
</part>
|
||||||
|
<chapter id="object-tree">
|
||||||
|
<title>Object Hierarchy</title>
|
||||||
|
<xi:include href="xml/tree_index.sgml"/>
|
||||||
|
</chapter>
|
||||||
|
<index id="api-index-full">
|
||||||
|
<title>API Index</title>
|
||||||
|
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
|
||||||
|
</index>
|
||||||
|
<index id="deprecated-api-index" role="deprecated">
|
||||||
|
<title>Index of deprecated API</title>
|
||||||
|
<xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
|
||||||
|
</index>
|
||||||
|
|
||||||
|
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
|
||||||
|
</book>
|
@ -66,4 +66,11 @@ its dependencies to build from tarballs.</description>
|
|||||||
<gnome:userid>marinaz</gnome:userid>
|
<gnome:userid>marinaz</gnome:userid>
|
||||||
</foaf:Person>
|
</foaf:Person>
|
||||||
</maintainer>
|
</maintainer>
|
||||||
|
<maintainer>
|
||||||
|
<foaf:Person>
|
||||||
|
<foaf:name>Florian Müllner</foaf:name>
|
||||||
|
<foaf:mbox rdf:resource="mailto:fmuellner@gnome.org" />
|
||||||
|
<gnome:userid>fmuellner</gnome:userid>
|
||||||
|
</foaf:Person>
|
||||||
|
</maintainer>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,79 +1,109 @@
|
|||||||
|
NULL =
|
||||||
|
|
||||||
|
EXTRA_DIST = misc/config.js.in
|
||||||
|
CLEANFILES = misc/config.js
|
||||||
|
|
||||||
|
misc/config.js: misc/config.js.in Makefile
|
||||||
|
[ -d $(@D) ] || $(mkdir_p) $(@D) ; \
|
||||||
|
sed -e "s|[@]PACKAGE_NAME@|$(PACKAGE_NAME)|g" \
|
||||||
|
-e "s|[@]PACKAGE_VERSION@|$(PACKAGE_VERSION)|g" \
|
||||||
|
-e "s|[@]HAVE_BLUETOOTH@|$(HAVE_BLUETOOTH)|g" \
|
||||||
|
-e "s|[@]GETTEXT_PACKAGE@|$(GETTEXT_PACKAGE)|g" \
|
||||||
|
-e "s|[@]datadir@|$(datadir)|g" \
|
||||||
|
-e "s|[@]libexecdir@|$(libexecdir)|g" \
|
||||||
|
-e "s|[@]sysconfdir@|$(sysconfdir)|g" \
|
||||||
|
$< > $@
|
||||||
|
|
||||||
jsdir = $(pkgdatadir)/js
|
jsdir = $(pkgdatadir)/js
|
||||||
|
|
||||||
nobase_dist_js_DATA = \
|
nobase_dist_js_DATA = \
|
||||||
gdm/batch.js \
|
gdm/batch.js \
|
||||||
gdm/consoleKit.js \
|
|
||||||
gdm/fingerprint.js \
|
gdm/fingerprint.js \
|
||||||
gdm/loginDialog.js \
|
gdm/loginDialog.js \
|
||||||
gdm/powerMenu.js \
|
gdm/powerMenu.js \
|
||||||
|
gdm/realmd.js \
|
||||||
|
gdm/util.js \
|
||||||
|
extensionPrefs/main.js \
|
||||||
misc/config.js \
|
misc/config.js \
|
||||||
misc/docInfo.js \
|
misc/extensionUtils.js \
|
||||||
misc/fileUtils.js \
|
misc/fileUtils.js \
|
||||||
misc/format.js \
|
|
||||||
misc/gnomeSession.js \
|
misc/gnomeSession.js \
|
||||||
misc/history.js \
|
misc/history.js \
|
||||||
|
misc/jsParse.js \
|
||||||
|
misc/loginManager.js \
|
||||||
misc/modemManager.js \
|
misc/modemManager.js \
|
||||||
misc/params.js \
|
misc/params.js \
|
||||||
misc/screenSaver.js \
|
|
||||||
misc/util.js \
|
misc/util.js \
|
||||||
perf/core.js \
|
perf/core.js \
|
||||||
ui/altTab.js \
|
ui/altTab.js \
|
||||||
ui/appDisplay.js \
|
ui/appDisplay.js \
|
||||||
ui/appFavorites.js \
|
ui/appFavorites.js \
|
||||||
ui/automountManager.js \
|
|
||||||
ui/autorunManager.js \
|
|
||||||
ui/boxpointer.js \
|
ui/boxpointer.js \
|
||||||
ui/calendar.js \
|
ui/calendar.js \
|
||||||
ui/contactDisplay.js \
|
ui/checkBox.js \
|
||||||
ui/ctrlAltTab.js \
|
ui/ctrlAltTab.js \
|
||||||
ui/dash.js \
|
ui/dash.js \
|
||||||
ui/dateMenu.js \
|
ui/dateMenu.js \
|
||||||
ui/dnd.js \
|
ui/dnd.js \
|
||||||
ui/docDisplay.js \
|
|
||||||
ui/endSessionDialog.js \
|
ui/endSessionDialog.js \
|
||||||
ui/environment.js \
|
|
||||||
ui/extensionSystem.js \
|
ui/extensionSystem.js \
|
||||||
|
ui/extensionDownloader.js \
|
||||||
|
ui/environment.js \
|
||||||
|
ui/flashspot.js \
|
||||||
|
ui/ibusCandidatePopup.js\
|
||||||
|
ui/grabHelper.js \
|
||||||
ui/iconGrid.js \
|
ui/iconGrid.js \
|
||||||
ui/keyboard.js \
|
ui/keyboard.js \
|
||||||
ui/layout.js \
|
ui/layout.js \
|
||||||
ui/lightbox.js \
|
ui/lightbox.js \
|
||||||
ui/link.js \
|
|
||||||
ui/lookingGlass.js \
|
ui/lookingGlass.js \
|
||||||
ui/magnifier.js \
|
ui/magnifier.js \
|
||||||
ui/magnifierDBus.js \
|
ui/magnifierDBus.js \
|
||||||
ui/main.js \
|
ui/main.js \
|
||||||
ui/messageTray.js \
|
ui/messageTray.js \
|
||||||
ui/modalDialog.js \
|
ui/modalDialog.js \
|
||||||
ui/networkAgent.js \
|
ui/sessionMode.js \
|
||||||
|
ui/shellEntry.js \
|
||||||
ui/shellMountOperation.js \
|
ui/shellMountOperation.js \
|
||||||
ui/notificationDaemon.js \
|
ui/notificationDaemon.js \
|
||||||
ui/overview.js \
|
ui/overview.js \
|
||||||
ui/panel.js \
|
ui/panel.js \
|
||||||
ui/panelMenu.js \
|
ui/panelMenu.js \
|
||||||
ui/placeDisplay.js \
|
ui/pointerWatcher.js \
|
||||||
ui/polkitAuthenticationAgent.js \
|
|
||||||
ui/popupMenu.js \
|
ui/popupMenu.js \
|
||||||
|
ui/remoteSearch.js \
|
||||||
ui/runDialog.js \
|
ui/runDialog.js \
|
||||||
|
ui/screenShield.js \
|
||||||
ui/scripting.js \
|
ui/scripting.js \
|
||||||
ui/search.js \
|
ui/search.js \
|
||||||
ui/searchDisplay.js \
|
ui/searchDisplay.js \
|
||||||
ui/shellDBus.js \
|
ui/shellDBus.js \
|
||||||
ui/statusIconDispatcher.js \
|
|
||||||
ui/status/accessibility.js \
|
ui/status/accessibility.js \
|
||||||
ui/status/keyboard.js \
|
ui/status/keyboard.js \
|
||||||
|
ui/status/lockScreenMenu.js \
|
||||||
ui/status/network.js \
|
ui/status/network.js \
|
||||||
ui/status/power.js \
|
ui/status/power.js \
|
||||||
ui/status/volume.js \
|
ui/status/volume.js \
|
||||||
ui/status/bluetooth.js \
|
ui/status/bluetooth.js \
|
||||||
ui/telepathyClient.js \
|
|
||||||
ui/tweener.js \
|
ui/tweener.js \
|
||||||
|
ui/unlockDialog.js \
|
||||||
ui/userMenu.js \
|
ui/userMenu.js \
|
||||||
ui/viewSelector.js \
|
ui/viewSelector.js \
|
||||||
|
ui/wanda.js \
|
||||||
ui/windowAttentionHandler.js \
|
ui/windowAttentionHandler.js \
|
||||||
ui/windowManager.js \
|
ui/windowManager.js \
|
||||||
ui/workspace.js \
|
ui/workspace.js \
|
||||||
ui/workspaceThumbnail.js \
|
ui/workspaceThumbnail.js \
|
||||||
ui/workspacesView.js \
|
ui/workspacesView.js \
|
||||||
ui/workspaceSwitcherPopup.js \
|
ui/workspaceSwitcherPopup.js \
|
||||||
ui/xdndHandler.js
|
ui/xdndHandler.js \
|
||||||
|
ui/components/__init__.js \
|
||||||
|
ui/components/autorunManager.js \
|
||||||
|
ui/components/automountManager.js \
|
||||||
|
ui/components/mediaKeysManager.js \
|
||||||
|
ui/components/networkAgent.js \
|
||||||
|
ui/components/polkitAgent.js \
|
||||||
|
ui/components/recorder.js \
|
||||||
|
ui/components/telepathyClient.js \
|
||||||
|
ui/components/keyring.js \
|
||||||
|
$(NULL)
|
||||||
|
270
js/extensionPrefs/main.js
Normal file
@ -0,0 +1,270 @@
|
|||||||
|
|
||||||
|
const Lang = imports.lang;
|
||||||
|
const Gettext = imports.gettext;
|
||||||
|
const GLib = imports.gi.GLib;
|
||||||
|
const GObject = imports.gi.GObject;
|
||||||
|
const Gio = imports.gi.Gio;
|
||||||
|
const Gtk = imports.gi.Gtk;
|
||||||
|
const Pango = imports.gi.Pango;
|
||||||
|
const Format = imports.format;
|
||||||
|
|
||||||
|
const _ = Gettext.gettext;
|
||||||
|
|
||||||
|
const Config = imports.misc.config;
|
||||||
|
const ExtensionUtils = imports.misc.extensionUtils;
|
||||||
|
|
||||||
|
const GnomeShellIface = <interface name="org.gnome.Shell.Extensions">
|
||||||
|
<signal name="ExtensionStatusChanged">
|
||||||
|
<arg type="s" name="uuid"/>
|
||||||
|
<arg type="i" name="state"/>
|
||||||
|
<arg type="s" name="error"/>
|
||||||
|
</signal>
|
||||||
|
</interface>;
|
||||||
|
|
||||||
|
const GnomeShellProxy = Gio.DBusProxy.makeProxyWrapper(GnomeShellIface);
|
||||||
|
|
||||||
|
function stripPrefix(string, prefix) {
|
||||||
|
if (string.slice(0, prefix.length) == prefix)
|
||||||
|
return string.slice(prefix.length);
|
||||||
|
return string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Application = new Lang.Class({
|
||||||
|
Name: 'Application',
|
||||||
|
_init: function() {
|
||||||
|
GLib.set_prgname('gnome-shell-extension-prefs');
|
||||||
|
this.application = new Gtk.Application({
|
||||||
|
application_id: 'org.gnome.shell.ExtensionPrefs',
|
||||||
|
flags: Gio.ApplicationFlags.HANDLES_COMMAND_LINE
|
||||||
|
});
|
||||||
|
|
||||||
|
this.application.connect('activate', Lang.bind(this, this._onActivate));
|
||||||
|
this.application.connect('command-line', Lang.bind(this, this._onCommandLine));
|
||||||
|
this.application.connect('startup', Lang.bind(this, this._onStartup));
|
||||||
|
|
||||||
|
this._extensionPrefsModules = {};
|
||||||
|
|
||||||
|
this._extensionIters = {};
|
||||||
|
},
|
||||||
|
|
||||||
|
_buildModel: function() {
|
||||||
|
this._model = new Gtk.ListStore();
|
||||||
|
this._model.set_column_types([GObject.TYPE_STRING, GObject.TYPE_STRING]);
|
||||||
|
},
|
||||||
|
|
||||||
|
_extensionAvailable: function(uuid) {
|
||||||
|
let extension = ExtensionUtils.extensions[uuid];
|
||||||
|
|
||||||
|
if (!extension)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (ExtensionUtils.isOutOfDate(extension))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!extension.dir.get_child('prefs.js').query_exists(null))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
_setExtensionInsensitive: function(layout, cell, model, iter, data) {
|
||||||
|
let uuid = model.get_value(iter, 0);
|
||||||
|
cell.set_sensitive(this._extensionAvailable(uuid));
|
||||||
|
},
|
||||||
|
|
||||||
|
_getExtensionPrefsModule: function(extension) {
|
||||||
|
let uuid = extension.metadata.uuid;
|
||||||
|
|
||||||
|
if (this._extensionPrefsModules.hasOwnProperty(uuid))
|
||||||
|
return this._extensionPrefsModules[uuid];
|
||||||
|
|
||||||
|
ExtensionUtils.installImporter(extension);
|
||||||
|
|
||||||
|
let prefsModule = extension.imports.prefs;
|
||||||
|
prefsModule.init(extension.metadata);
|
||||||
|
|
||||||
|
this._extensionPrefsModules[uuid] = prefsModule;
|
||||||
|
return prefsModule;
|
||||||
|
},
|
||||||
|
|
||||||
|
_selectExtension: function(uuid) {
|
||||||
|
if (!this._extensionAvailable(uuid))
|
||||||
|
return;
|
||||||
|
|
||||||
|
let extension = ExtensionUtils.extensions[uuid];
|
||||||
|
let widget;
|
||||||
|
|
||||||
|
try {
|
||||||
|
let prefsModule = this._getExtensionPrefsModule(extension);
|
||||||
|
widget = prefsModule.buildPrefsWidget();
|
||||||
|
} catch (e) {
|
||||||
|
widget = this._buildErrorUI(extension, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Destroy the current prefs widget, if it exists
|
||||||
|
if (this._extensionPrefsBin.get_child())
|
||||||
|
this._extensionPrefsBin.get_child().destroy();
|
||||||
|
|
||||||
|
this._extensionPrefsBin.add(widget);
|
||||||
|
this._extensionSelector.set_active_iter(this._extensionIters[uuid]);
|
||||||
|
},
|
||||||
|
|
||||||
|
_extensionSelected: function() {
|
||||||
|
let [success, iter] = this._extensionSelector.get_active_iter();
|
||||||
|
if (!success)
|
||||||
|
return;
|
||||||
|
|
||||||
|
let uuid = this._model.get_value(iter, 0);
|
||||||
|
this._selectExtension(uuid);
|
||||||
|
},
|
||||||
|
|
||||||
|
_buildErrorUI: function(extension, exc) {
|
||||||
|
let box = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL });
|
||||||
|
let label = new Gtk.Label({
|
||||||
|
label: _("There was an error loading the preferences dialog for %s:").format(extension.metadata.name)
|
||||||
|
});
|
||||||
|
box.add(label);
|
||||||
|
|
||||||
|
let errortext = '';
|
||||||
|
errortext += exc;
|
||||||
|
errortext += '\n\n';
|
||||||
|
errortext += 'Stack trace:\n';
|
||||||
|
|
||||||
|
// Indent stack trace.
|
||||||
|
errortext += exc.stack.split('\n').map(function(line) {
|
||||||
|
return ' ' + line;
|
||||||
|
}).join('\n');
|
||||||
|
|
||||||
|
let scroll = new Gtk.ScrolledWindow({ vexpand: true });
|
||||||
|
let buffer = new Gtk.TextBuffer({ text: errortext });
|
||||||
|
let textview = new Gtk.TextView({ buffer: buffer });
|
||||||
|
textview.override_font(Pango.font_description_from_string('monospace'));
|
||||||
|
scroll.add(textview);
|
||||||
|
box.add(scroll);
|
||||||
|
|
||||||
|
box.show_all();
|
||||||
|
return box;
|
||||||
|
},
|
||||||
|
|
||||||
|
_buildUI: function(app) {
|
||||||
|
this._window = new Gtk.ApplicationWindow({ application: app,
|
||||||
|
window_position: Gtk.WindowPosition.CENTER,
|
||||||
|
title: _("GNOME Shell Extension Preferences") });
|
||||||
|
|
||||||
|
this._window.set_size_request(600, 400);
|
||||||
|
|
||||||
|
let vbox = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL });
|
||||||
|
this._window.add(vbox);
|
||||||
|
|
||||||
|
let toolbar = new Gtk.Toolbar();
|
||||||
|
toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR);
|
||||||
|
vbox.add(toolbar);
|
||||||
|
let toolitem;
|
||||||
|
|
||||||
|
let label = new Gtk.Label({ label: '<b>' + _("Extension") + '</b>',
|
||||||
|
use_markup: true });
|
||||||
|
toolitem = new Gtk.ToolItem({ child: label });
|
||||||
|
toolbar.add(toolitem);
|
||||||
|
|
||||||
|
this._extensionSelector = new Gtk.ComboBox({ model: this._model,
|
||||||
|
margin_left: 8,
|
||||||
|
hexpand: true });
|
||||||
|
this._extensionSelector.get_style_context().add_class(Gtk.STYLE_CLASS_RAISED);
|
||||||
|
|
||||||
|
let renderer = new Gtk.CellRendererText();
|
||||||
|
this._extensionSelector.pack_start(renderer, true);
|
||||||
|
this._extensionSelector.add_attribute(renderer, 'text', 1);
|
||||||
|
this._extensionSelector.set_cell_data_func(renderer, Lang.bind(this, this._setExtensionInsensitive));
|
||||||
|
this._extensionSelector.connect('changed', Lang.bind(this, this._extensionSelected));
|
||||||
|
|
||||||
|
toolitem = new Gtk.ToolItem({ child: this._extensionSelector });
|
||||||
|
toolitem.set_expand(true);
|
||||||
|
toolbar.add(toolitem);
|
||||||
|
|
||||||
|
this._extensionPrefsBin = new Gtk.Frame();
|
||||||
|
vbox.add(this._extensionPrefsBin);
|
||||||
|
|
||||||
|
let label = new Gtk.Label({
|
||||||
|
label: _("Select an extension to configure using the combobox above."),
|
||||||
|
vexpand: true
|
||||||
|
});
|
||||||
|
|
||||||
|
this._extensionPrefsBin.add(label);
|
||||||
|
|
||||||
|
this._shellProxy = new GnomeShellProxy(Gio.DBus.session, 'org.gnome.Shell', '/org/gnome/Shell');
|
||||||
|
this._shellProxy.connectSignal('ExtensionStatusChanged', Lang.bind(this, function(proxy, senderName, [uuid, state, error]) {
|
||||||
|
if (ExtensionUtils.extensions[uuid] !== undefined)
|
||||||
|
this._scanExtensions();
|
||||||
|
}));
|
||||||
|
|
||||||
|
this._window.show_all();
|
||||||
|
},
|
||||||
|
|
||||||
|
_scanExtensions: function() {
|
||||||
|
let finder = new ExtensionUtils.ExtensionFinder();
|
||||||
|
finder.connect('extension-found', Lang.bind(this, this._extensionFound));
|
||||||
|
finder.scanExtensions();
|
||||||
|
},
|
||||||
|
|
||||||
|
_extensionFound: function(signals, extension) {
|
||||||
|
let iter = this._model.append();
|
||||||
|
this._model.set(iter, [0, 1], [extension.uuid, extension.metadata.name]);
|
||||||
|
this._extensionIters[extension.uuid] = iter;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
_onActivate: function() {
|
||||||
|
this._window.present();
|
||||||
|
},
|
||||||
|
|
||||||
|
_onStartup: function(app) {
|
||||||
|
this._buildModel();
|
||||||
|
this._buildUI(app);
|
||||||
|
this._scanExtensions();
|
||||||
|
},
|
||||||
|
|
||||||
|
_onCommandLine: function(app, commandLine) {
|
||||||
|
app.activate();
|
||||||
|
let args = commandLine.get_arguments();
|
||||||
|
if (args.length) {
|
||||||
|
let uuid = args[0];
|
||||||
|
|
||||||
|
// Strip off "extension:///" prefix which fakes a URI, if it exists
|
||||||
|
uuid = stripPrefix(uuid, "extension:///");
|
||||||
|
|
||||||
|
if (!this._extensionAvailable(uuid))
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
this._selectExtension(uuid);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function initEnvironment() {
|
||||||
|
// Monkey-patch in a "global" object that fakes some Shell utilities
|
||||||
|
// that ExtensionUtils depends on.
|
||||||
|
window.global = {
|
||||||
|
log: function() {
|
||||||
|
print([].join.call(arguments, ', '));
|
||||||
|
},
|
||||||
|
|
||||||
|
logError: function(s) {
|
||||||
|
log('ERROR: ' + s);
|
||||||
|
},
|
||||||
|
|
||||||
|
userdatadir: GLib.build_filenamev([GLib.get_user_data_dir(), 'gnome-shell'])
|
||||||
|
};
|
||||||
|
|
||||||
|
String.prototype.format = Format.format;
|
||||||
|
}
|
||||||
|
|
||||||
|
function main(argv) {
|
||||||
|
initEnvironment();
|
||||||
|
|
||||||
|
Gettext.bindtextdomain(Config.GETTEXT_PACKAGE, Config.LOCALEDIR);
|
||||||
|
Gettext.textdomain(Config.GETTEXT_PACKAGE);
|
||||||
|
|
||||||
|
let app = new Application();
|
||||||
|
app.application.run(argv);
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
*
|
/*
|
||||||
* Copyright 2011 Red Hat, Inc
|
* Copyright 2011 Red Hat, Inc
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -21,11 +21,9 @@
|
|||||||
const Lang = imports.lang;
|
const Lang = imports.lang;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
function Task() {
|
const Task = new Lang.Class({
|
||||||
this._init.apply(this, arguments);
|
Name: 'Task',
|
||||||
}
|
|
||||||
|
|
||||||
Task.prototype = {
|
|
||||||
_init: function(scope, handler) {
|
_init: function(scope, handler) {
|
||||||
if (scope)
|
if (scope)
|
||||||
this.scope = scope;
|
this.scope = scope;
|
||||||
@ -41,22 +39,17 @@ Task.prototype = {
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
};
|
});
|
||||||
Signals.addSignalMethods(Task.prototype);
|
Signals.addSignalMethods(Task.prototype);
|
||||||
|
|
||||||
function Hold() {
|
const Hold = new Lang.Class({
|
||||||
this._init.apply(this, arguments);
|
Name: 'Hold',
|
||||||
}
|
Extends: Task,
|
||||||
|
|
||||||
Hold.prototype = {
|
|
||||||
__proto__: Task.prototype,
|
|
||||||
|
|
||||||
_init: function() {
|
_init: function() {
|
||||||
Task.prototype._init.call(this,
|
this.parent(this, function () {
|
||||||
this,
|
return this;
|
||||||
function () {
|
});
|
||||||
return this;
|
|
||||||
});
|
|
||||||
|
|
||||||
this._acquisitions = 1;
|
this._acquisitions = 1;
|
||||||
},
|
},
|
||||||
@ -88,18 +81,15 @@ Hold.prototype = {
|
|||||||
isAcquired: function() {
|
isAcquired: function() {
|
||||||
return this._acquisitions > 0;
|
return this._acquisitions > 0;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
Signals.addSignalMethods(Hold.prototype);
|
Signals.addSignalMethods(Hold.prototype);
|
||||||
|
|
||||||
function Batch() {
|
const Batch = new Lang.Class({
|
||||||
this._init.apply(this, arguments);
|
Name: 'Batch',
|
||||||
}
|
Extends: Task,
|
||||||
|
|
||||||
Batch.prototype = {
|
|
||||||
__proto__: Task.prototype,
|
|
||||||
|
|
||||||
_init: function(scope, tasks) {
|
_init: function(scope, tasks) {
|
||||||
Task.prototype._init.call(this);
|
this.parent();
|
||||||
|
|
||||||
this.tasks = [];
|
this.tasks = [];
|
||||||
|
|
||||||
@ -166,20 +156,12 @@ Batch.prototype = {
|
|||||||
cancel: function() {
|
cancel: function() {
|
||||||
this.tasks = this.tasks.splice(0, this._currentTaskIndex + 1);
|
this.tasks = this.tasks.splice(0, this._currentTaskIndex + 1);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
};
|
|
||||||
Signals.addSignalMethods(Batch.prototype);
|
Signals.addSignalMethods(Batch.prototype);
|
||||||
|
|
||||||
function ConcurrentBatch() {
|
const ConcurrentBatch = new Lang.Class({
|
||||||
this._init.apply(this, arguments);
|
Name: 'ConcurrentBatch',
|
||||||
}
|
Extends: Batch,
|
||||||
|
|
||||||
ConcurrentBatch.prototype = {
|
|
||||||
__proto__: Batch.prototype,
|
|
||||||
|
|
||||||
_init: function(scope, tasks) {
|
|
||||||
Batch.prototype._init.call(this, scope, tasks);
|
|
||||||
},
|
|
||||||
|
|
||||||
process: function() {
|
process: function() {
|
||||||
let hold = this.runTask();
|
let hold = this.runTask();
|
||||||
@ -193,19 +175,12 @@ ConcurrentBatch.prototype = {
|
|||||||
// concurrently.
|
// concurrently.
|
||||||
this.nextTask();
|
this.nextTask();
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
Signals.addSignalMethods(ConcurrentBatch.prototype);
|
Signals.addSignalMethods(ConcurrentBatch.prototype);
|
||||||
|
|
||||||
function ConsecutiveBatch() {
|
const ConsecutiveBatch = new Lang.Class({
|
||||||
this._init.apply(this, arguments);
|
Name: 'ConsecutiveBatch',
|
||||||
}
|
Extends: Batch,
|
||||||
|
|
||||||
ConsecutiveBatch.prototype = {
|
|
||||||
__proto__: Batch.prototype,
|
|
||||||
|
|
||||||
_init: function(scope, tasks) {
|
|
||||||
Batch.prototype._init.call(this, scope, tasks);
|
|
||||||
},
|
|
||||||
|
|
||||||
process: function() {
|
process: function() {
|
||||||
let hold = this.runTask();
|
let hold = this.runTask();
|
||||||
@ -224,5 +199,5 @@ ConsecutiveBatch.prototype = {
|
|||||||
this.nextTask();
|
this.nextTask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
Signals.addSignalMethods(ConsecutiveBatch.prototype);
|
Signals.addSignalMethods(ConsecutiveBatch.prototype);
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
// -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*-
|
|
||||||
|
|
||||||
const DBus = imports.dbus;
|
|
||||||
|
|
||||||
const ConsoleKitManagerIface = {
|
|
||||||
name: 'org.freedesktop.ConsoleKit.Manager',
|
|
||||||
methods: [{ name: 'CanRestart',
|
|
||||||
inSignature: '',
|
|
||||||
outSignature: 'b' },
|
|
||||||
{ name: 'CanStop',
|
|
||||||
inSignature: '',
|
|
||||||
outSignature: 'b' },
|
|
||||||
{ name: 'Restart',
|
|
||||||
inSignature: '',
|
|
||||||
outSignature: '' },
|
|
||||||
{ name: 'Stop',
|
|
||||||
inSignature: '',
|
|
||||||
outSignature: '' }]
|
|
||||||
};
|
|
||||||
|
|
||||||
function ConsoleKitManager() {
|
|
||||||
this._init();
|
|
||||||
};
|
|
||||||
|
|
||||||
ConsoleKitManager.prototype = {
|
|
||||||
_init: function() {
|
|
||||||
DBus.system.proxifyObject(this,
|
|
||||||
'org.freedesktop.ConsoleKit',
|
|
||||||
'/org/freedesktop/ConsoleKit/Manager');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
DBus.proxifyPrototype(ConsoleKitManager.prototype, ConsoleKitManagerIface);
|
|
@ -1,26 +1,26 @@
|
|||||||
// -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const DBus = imports.dbus;
|
const Gio = imports.gi.Gio;
|
||||||
const Lang = imports.lang;
|
const Lang = imports.lang;
|
||||||
const Shell = imports.gi.Shell;
|
const Shell = imports.gi.Shell;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const FprintManagerIface = {
|
const FprintManagerIface = <interface name='net.reactivated.Fprint.Manager'>
|
||||||
name: 'net.reactivated.Fprint.Manager',
|
<method name='GetDefaultDevice'>
|
||||||
methods: [{ name: 'GetDefaultDevice',
|
<arg type='o' direction='out' />
|
||||||
inSignature: '',
|
</method>
|
||||||
outSignature: 'o' }]
|
</interface>;
|
||||||
};
|
|
||||||
|
const FprintManagerInfo = Gio.DBusInterfaceInfo.new_for_xml(FprintManagerIface);
|
||||||
|
|
||||||
function FprintManager() {
|
function FprintManager() {
|
||||||
this._init();
|
var self = new Gio.DBusProxy({ g_connection: Gio.DBus.system,
|
||||||
};
|
g_interface_name: FprintManagerInfo.name,
|
||||||
|
g_interface_info: FprintManagerInfo,
|
||||||
|
g_name: 'net.reactivated.Fprint',
|
||||||
|
g_object_path: '/net/reactivated/Fprint/Manager',
|
||||||
|
g_flags: (Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES) });
|
||||||
|
|
||||||
FprintManager.prototype = {
|
self.init(null);
|
||||||
_init: function() {
|
return self;
|
||||||
DBus.system.proxifyObject(this,
|
}
|
||||||
'net.reactivated.Fprint',
|
|
||||||
'/net/reactivated/Fprint/Manager');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
DBus.proxifyPrototype(FprintManager.prototype, FprintManagerIface);
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
*
|
/*
|
||||||
* Copyright 2011 Red Hat, Inc
|
* Copyright 2011 Red Hat, Inc
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -18,31 +18,31 @@
|
|||||||
* 02111-1307, USA.
|
* 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const Gio = imports.gi.Gio;
|
||||||
const Lang = imports.lang;
|
const Lang = imports.lang;
|
||||||
const UPowerGlib = imports.gi.UPowerGlib;
|
|
||||||
|
|
||||||
const ConsoleKit = imports.gdm.consoleKit;
|
const LoginManager = imports.misc.loginManager;
|
||||||
|
|
||||||
|
const GdmUtil = imports.gdm.util;
|
||||||
const PanelMenu = imports.ui.panelMenu;
|
const PanelMenu = imports.ui.panelMenu;
|
||||||
const PopupMenu = imports.ui.popupMenu;
|
const PopupMenu = imports.ui.popupMenu;
|
||||||
|
|
||||||
function PowerMenuButton() {
|
const PowerMenuButton = new Lang.Class({
|
||||||
this._init();
|
Name: 'PowerMenuButton',
|
||||||
}
|
Extends: PanelMenu.SystemStatusButton,
|
||||||
|
|
||||||
PowerMenuButton.prototype = {
|
|
||||||
__proto__: PanelMenu.SystemStatusButton.prototype,
|
|
||||||
|
|
||||||
_init: function() {
|
_init: function() {
|
||||||
PanelMenu.SystemStatusButton.prototype._init.call(this, 'system-shutdown', null);
|
/* Translators: accessible name of the power menu in the login screen */
|
||||||
this._consoleKitManager = new ConsoleKit.ConsoleKitManager();
|
this.parent('system-shutdown-symbolic', _("Power"));
|
||||||
this._upClient = new UPowerGlib.Client();
|
|
||||||
|
this._loginManager = LoginManager.getLoginManager();
|
||||||
|
|
||||||
|
this._settings = new Gio.Settings({ schema: GdmUtil.LOGIN_SCREEN_SCHEMA });
|
||||||
|
this._settings.connect('changed::disable-restart-buttons',
|
||||||
|
Lang.bind(this, this._updateVisibility));
|
||||||
|
|
||||||
this._createSubMenu();
|
this._createSubMenu();
|
||||||
|
|
||||||
this._upClient.connect('notify::can-suspend',
|
|
||||||
Lang.bind(this, this._updateHaveSuspend));
|
|
||||||
this._updateHaveSuspend();
|
|
||||||
|
|
||||||
// ConsoleKit doesn't send notifications when shutdown/reboot
|
// ConsoleKit doesn't send notifications when shutdown/reboot
|
||||||
// are disabled, so we update the menu item each time the menu opens
|
// are disabled, so we update the menu item each time the menu opens
|
||||||
this.menu.connect('open-state-changed', Lang.bind(this,
|
this.menu.connect('open-state-changed', Lang.bind(this,
|
||||||
@ -50,64 +50,41 @@ PowerMenuButton.prototype = {
|
|||||||
if (open) {
|
if (open) {
|
||||||
this._updateHaveShutdown();
|
this._updateHaveShutdown();
|
||||||
this._updateHaveRestart();
|
this._updateHaveRestart();
|
||||||
|
this._updateHaveSuspend();
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
this._updateHaveShutdown();
|
this._updateHaveShutdown();
|
||||||
this._updateHaveRestart();
|
this._updateHaveRestart();
|
||||||
|
this._updateHaveSuspend();
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateVisibility: function() {
|
_updateVisibility: function() {
|
||||||
if (!this._haveSuspend && !this._haveShutdown && !this._haveRestart)
|
let shouldBeVisible = (this._haveSuspend || this._haveShutdown || this._haveRestart);
|
||||||
this.actor.hide();
|
this.actor.visible = shouldBeVisible && !this._settings.get_boolean('disable-restart-buttons');
|
||||||
else
|
|
||||||
this.actor.show();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateHaveShutdown: function() {
|
_updateHaveShutdown: function() {
|
||||||
this._consoleKitManager.CanStopRemote(Lang.bind(this,
|
this._loginManager.canPowerOff(Lang.bind(this, function(result) {
|
||||||
function(result, error) {
|
this._haveShutdown = result;
|
||||||
if (!error)
|
this._powerOffItem.actor.visible = this._haveShutdown;
|
||||||
this._haveShutdown = result;
|
this._updateVisibility();
|
||||||
else
|
}));
|
||||||
this._haveShutdown = false;
|
|
||||||
|
|
||||||
if (this._haveShutdown) {
|
|
||||||
this._powerOffItem.actor.show();
|
|
||||||
} else {
|
|
||||||
this._powerOffItem.actor.hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
this._updateVisibility();
|
|
||||||
}));
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateHaveRestart: function() {
|
_updateHaveRestart: function() {
|
||||||
this._consoleKitManager.CanRestartRemote(Lang.bind(this,
|
this._loginManager.canReboot(Lang.bind(this, function(result) {
|
||||||
function(result, error) {
|
this._haveRestart = result;
|
||||||
if (!error)
|
this._restartItem.actor.visible = this._haveRestart;
|
||||||
this._haveRestart = result;
|
this._updateVisibility();
|
||||||
else
|
}));
|
||||||
this._haveRestart = false;
|
|
||||||
|
|
||||||
if (this._haveRestart) {
|
|
||||||
this._restartItem.actor.show();
|
|
||||||
} else {
|
|
||||||
this._restartItem.actor.hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
this._updateVisibility();
|
|
||||||
}));
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateHaveSuspend: function() {
|
_updateHaveSuspend: function() {
|
||||||
this._haveSuspend = this._upClient.get_can_suspend();
|
this._loginManager.canSuspend(Lang.bind(this, function(result) {
|
||||||
|
this._haveSuspend = result;
|
||||||
if (this._haveSuspend)
|
this._suspendItem.actor.visible = this._haveSuspend;
|
||||||
this._suspendItem.actor.show();
|
this._updateVisibility();
|
||||||
else
|
}));
|
||||||
this._suspendItem.actor.hide();
|
|
||||||
|
|
||||||
this._updateVisibility();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_createSubMenu: function() {
|
_createSubMenu: function() {
|
||||||
@ -130,17 +107,23 @@ PowerMenuButton.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_onActivateSuspend: function() {
|
_onActivateSuspend: function() {
|
||||||
if (this._haveSuspend)
|
if (!this._haveSuspend)
|
||||||
this._upClient.suspend_sync(null);
|
return;
|
||||||
|
|
||||||
|
this._loginManager.suspend();
|
||||||
},
|
},
|
||||||
|
|
||||||
_onActivateRestart: function() {
|
_onActivateRestart: function() {
|
||||||
if (this._haveRestart)
|
if (!this._haveRestart)
|
||||||
this._consoleKitManager.RestartRemote();
|
return;
|
||||||
|
|
||||||
|
this._loginManager.reboot();
|
||||||
},
|
},
|
||||||
|
|
||||||
_onActivatePowerOff: function() {
|
_onActivatePowerOff: function() {
|
||||||
if (this._haveShutdown)
|
if (!this._haveShutdown)
|
||||||
this._consoleKitManager.StopRemote();
|
return;
|
||||||
|
|
||||||
|
this._loginManager.powerOff();
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
139
js/gdm/realmd.js
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
|
const Gio = imports.gi.Gio;
|
||||||
|
const Lang = imports.lang;
|
||||||
|
const Shell = imports.gi.Shell;
|
||||||
|
const Signals = imports.signals;
|
||||||
|
|
||||||
|
const ProviderIface = <interface name='org.freedesktop.realmd.Provider'>
|
||||||
|
<property name="Name" type="s" access="read"/>
|
||||||
|
<property name="Version" type="s" access="read"/>
|
||||||
|
<property name="Realms" type="ao" access="read"/>
|
||||||
|
<method name="Discover">
|
||||||
|
<arg name="string" type="s" direction="in"/>
|
||||||
|
<arg name="options" type="a{sv}" direction="in"/>
|
||||||
|
<arg name="relevance" type="i" direction="out"/>
|
||||||
|
<arg name="realm" type="ao" direction="out"/>
|
||||||
|
</method>
|
||||||
|
</interface>;
|
||||||
|
const Provider = Gio.DBusProxy.makeProxyWrapper(ProviderIface);
|
||||||
|
|
||||||
|
const ServiceIface = <interface name="org.freedesktop.realmd.Service">
|
||||||
|
<method name="Cancel">
|
||||||
|
<arg name="operation" type="s" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="Release" />
|
||||||
|
<method name="SetLocale">
|
||||||
|
<arg name="locale" type="s" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<signal name="Diagnostics">
|
||||||
|
<arg name="data" type="s"/>
|
||||||
|
<arg name="operation" type="s"/>
|
||||||
|
</signal>
|
||||||
|
</interface>;
|
||||||
|
const Service = Gio.DBusProxy.makeProxyWrapper(ServiceIface);
|
||||||
|
|
||||||
|
const RealmIface = <interface name="org.freedesktop.realmd.Realm">
|
||||||
|
<property name="Name" type="s" access="read"/>
|
||||||
|
<property name="Configured" type="s" access="read"/>
|
||||||
|
<property name="Details" type="a(ss)" access="read"/>
|
||||||
|
<property name="LoginFormats" type="as" access="read"/>
|
||||||
|
<property name="LoginPolicy" type="s" access="read"/>
|
||||||
|
<property name="PermittedLogins" type="as" access="read"/>
|
||||||
|
<property name="SupportedInterfaces" type="as" access="read"/>
|
||||||
|
<method name="ChangeLoginPolicy">
|
||||||
|
<arg name="login_policy" type="s" direction="in"/>
|
||||||
|
<arg name="permitted_add" type="as" direction="in"/>
|
||||||
|
<arg name="permitted_remove" type="as" direction="in"/>
|
||||||
|
<arg name="options" type="a{sv}" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="Deconfigure">
|
||||||
|
<arg name="options" type="a{sv}" direction="in"/>
|
||||||
|
</method>
|
||||||
|
</interface>;
|
||||||
|
const Realm = Gio.DBusProxy.makeProxyWrapper(RealmIface);
|
||||||
|
|
||||||
|
const Manager = new Lang.Class({
|
||||||
|
Name: 'Manager',
|
||||||
|
|
||||||
|
_init: function(parentActor) {
|
||||||
|
this._aggregateProvider = Provider(Gio.DBus.system,
|
||||||
|
'org.freedesktop.realmd',
|
||||||
|
'/org/freedesktop/realmd',
|
||||||
|
Lang.bind(this, this._reloadRealms))
|
||||||
|
this._realms = {};
|
||||||
|
|
||||||
|
this._aggregateProvider.connect('g-properties-changed',
|
||||||
|
Lang.bind(this, function(proxy, properties) {
|
||||||
|
if ('Realms' in properties.deep_unpack())
|
||||||
|
this._reloadRealms();
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
|
||||||
|
_reloadRealms: function() {
|
||||||
|
let realmPaths = this._aggregateProvider.Realms;
|
||||||
|
|
||||||
|
if (!realmPaths)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (let i = 0; i < realmPaths.length; i++) {
|
||||||
|
let realm = Realm(Gio.DBus.system,
|
||||||
|
'org.freedesktop.realmd',
|
||||||
|
realmPaths[i],
|
||||||
|
Lang.bind(this, this._onRealmLoaded));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_reloadRealm: function(realm) {
|
||||||
|
if (!realm.Configured) {
|
||||||
|
if (this._realms[realm.get_object_path()])
|
||||||
|
delete this._realms[realm.get_object_path()];
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._realms[realm.get_object_path()] = realm;
|
||||||
|
|
||||||
|
this._updateLoginFormat();
|
||||||
|
},
|
||||||
|
|
||||||
|
_onRealmLoaded: function(realm, error) {
|
||||||
|
if (error)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this._reloadRealm(realm);
|
||||||
|
|
||||||
|
realm.connect('g-properties-changed',
|
||||||
|
Lang.bind(this, function(proxy, properties) {
|
||||||
|
if ('Configured' in properties.deep_unpack())
|
||||||
|
this._reloadRealm();
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
|
||||||
|
_updateLoginFormat: function() {
|
||||||
|
let newLoginFormat;
|
||||||
|
|
||||||
|
for (let realmPath in this._realms) {
|
||||||
|
let realm = this._realms[realmPath];
|
||||||
|
if (realm.LoginFormats && realm.LoginFormats.length > 0) {
|
||||||
|
newLoginFormat = realm.LoginFormats[0];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._loginFormat != newLoginFormat) {
|
||||||
|
this._loginFormat = newLoginFormat;
|
||||||
|
this.emit('login-format-changed', newLoginFormat);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
get loginFormat() {
|
||||||
|
if (this._loginFormat !== undefined)
|
||||||
|
return this._loginFormat;
|
||||||
|
|
||||||
|
this._updateLoginFormat();
|
||||||
|
|
||||||
|
return this._loginFormat;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Signals.addSignalMethods(Manager.prototype)
|
372
js/gdm/util.js
Normal file
@ -0,0 +1,372 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
|
const Gio = imports.gi.Gio;
|
||||||
|
const Lang = imports.lang;
|
||||||
|
const Mainloop = imports.mainloop;
|
||||||
|
const Signals = imports.signals;
|
||||||
|
|
||||||
|
const Batch = imports.gdm.batch;
|
||||||
|
const Fprint = imports.gdm.fingerprint;
|
||||||
|
const Realmd = imports.gdm.realmd;
|
||||||
|
const Main = imports.ui.main;
|
||||||
|
const Params = imports.misc.params;
|
||||||
|
const Tweener = imports.ui.tweener;
|
||||||
|
|
||||||
|
const PASSWORD_SERVICE_NAME = 'gdm-password';
|
||||||
|
const FINGERPRINT_SERVICE_NAME = 'gdm-fingerprint';
|
||||||
|
const FADE_ANIMATION_TIME = 0.16;
|
||||||
|
|
||||||
|
const LOGIN_SCREEN_SCHEMA = 'org.gnome.login-screen';
|
||||||
|
const FINGERPRINT_AUTHENTICATION_KEY = 'enable-fingerprint-authentication';
|
||||||
|
const BANNER_MESSAGE_KEY = 'banner-message-enable';
|
||||||
|
const BANNER_MESSAGE_TEXT_KEY = 'banner-message-text';
|
||||||
|
const ALLOWED_FAILURES_KEY = 'allowed-failures';
|
||||||
|
|
||||||
|
const LOGO_KEY = 'logo';
|
||||||
|
const DISABLE_USER_LIST_KEY = 'disable-user-list';
|
||||||
|
|
||||||
|
function fadeInActor(actor) {
|
||||||
|
if (actor.opacity == 255 && actor.visible)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
let hold = new Batch.Hold();
|
||||||
|
actor.show();
|
||||||
|
let [minHeight, naturalHeight] = actor.get_preferred_height(-1);
|
||||||
|
|
||||||
|
actor.opacity = 0;
|
||||||
|
actor.set_height(0);
|
||||||
|
Tweener.addTween(actor,
|
||||||
|
{ opacity: 255,
|
||||||
|
height: naturalHeight,
|
||||||
|
time: FADE_ANIMATION_TIME,
|
||||||
|
transition: 'easeOutQuad',
|
||||||
|
onComplete: function() {
|
||||||
|
this.set_height(-1);
|
||||||
|
hold.release();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return hold;
|
||||||
|
}
|
||||||
|
|
||||||
|
function fadeOutActor(actor) {
|
||||||
|
if (!actor.visible || actor.opacity == 0) {
|
||||||
|
actor.opacity = 0;
|
||||||
|
actor.hide();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
let hold = new Batch.Hold();
|
||||||
|
Tweener.addTween(actor,
|
||||||
|
{ opacity: 0,
|
||||||
|
height: 0,
|
||||||
|
time: FADE_ANIMATION_TIME,
|
||||||
|
transition: 'easeOutQuad',
|
||||||
|
onComplete: function() {
|
||||||
|
this.hide();
|
||||||
|
this.set_height(-1);
|
||||||
|
hold.release();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return hold;
|
||||||
|
}
|
||||||
|
|
||||||
|
const ShellUserVerifier = new Lang.Class({
|
||||||
|
Name: 'ShellUserVerifier',
|
||||||
|
|
||||||
|
_init: function(client, params) {
|
||||||
|
params = Params.parse(params, { reauthenticationOnly: false });
|
||||||
|
this._reauthOnly = params.reauthenticationOnly;
|
||||||
|
|
||||||
|
this._client = client;
|
||||||
|
|
||||||
|
this._settings = new Gio.Settings({ schema: LOGIN_SCREEN_SCHEMA });
|
||||||
|
|
||||||
|
this._fprintManager = new Fprint.FprintManager();
|
||||||
|
this._realmManager = new Realmd.Manager();
|
||||||
|
|
||||||
|
this._failCounter = 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
begin: function(userName, hold) {
|
||||||
|
this._cancellable = new Gio.Cancellable();
|
||||||
|
this._hold = hold;
|
||||||
|
this._userName = userName;
|
||||||
|
|
||||||
|
this._checkForFingerprintReader();
|
||||||
|
|
||||||
|
if (userName) {
|
||||||
|
// If possible, reauthenticate an already running session,
|
||||||
|
// so any session specific credentials get updated appropriately
|
||||||
|
this._client.open_reauthentication_channel(userName, this._cancellable,
|
||||||
|
Lang.bind(this, this._reauthenticationChannelOpened));
|
||||||
|
} else {
|
||||||
|
this._client.get_user_verifier(this._cancellable, Lang.bind(this, this._userVerifierGot));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
cancel: function() {
|
||||||
|
if (this._cancellable)
|
||||||
|
this._cancellable.cancel();
|
||||||
|
|
||||||
|
if (this._userVerifier)
|
||||||
|
this._userVerifier.call_cancel_sync(null);
|
||||||
|
},
|
||||||
|
|
||||||
|
clear: function() {
|
||||||
|
if (this._cancellable) {
|
||||||
|
this._cancellable.cancel();
|
||||||
|
this._cancellable = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._userVerifier) {
|
||||||
|
this._userVerifier.run_dispose();
|
||||||
|
this._userVerifier = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
answerQuery: function(serviceName, answer) {
|
||||||
|
// Clear any previous message
|
||||||
|
this.emit('show-message', null, null);
|
||||||
|
|
||||||
|
this._userVerifier.call_answer_query(serviceName, answer, this._cancellable, null);
|
||||||
|
},
|
||||||
|
|
||||||
|
_checkForFingerprintReader: function() {
|
||||||
|
this._haveFingerprintReader = false;
|
||||||
|
|
||||||
|
if (!this._settings.get_boolean(FINGERPRINT_AUTHENTICATION_KEY))
|
||||||
|
return;
|
||||||
|
|
||||||
|
this._fprintManager.GetDefaultDeviceRemote(Gio.DBusCallFlags.NONE, this._cancellable, Lang.bind(this,
|
||||||
|
function(device, error) {
|
||||||
|
if (!error && device)
|
||||||
|
this._haveFingerprintReader = true;
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
|
||||||
|
_reportInitError: function(where, error) {
|
||||||
|
logError(error, where);
|
||||||
|
this._hold.release();
|
||||||
|
|
||||||
|
this.emit('show-message', _("Authentication error"), 'login-dialog-message-warning');
|
||||||
|
this._verificationFailed(false);
|
||||||
|
},
|
||||||
|
|
||||||
|
_reauthenticationChannelOpened: function(client, result) {
|
||||||
|
try {
|
||||||
|
this._userVerifier = client.open_reauthentication_channel_finish(result);
|
||||||
|
} catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
|
||||||
|
return;
|
||||||
|
} catch(e if e.matches(Gio.DBusError, Gio.DBusError.ACCESS_DENIED) &&
|
||||||
|
!this._reauthOnly) {
|
||||||
|
// Gdm emits org.freedesktop.DBus.Error.AccessDenied when there is
|
||||||
|
// no session to reauthenticate. Fall back to performing verification
|
||||||
|
// from this login session
|
||||||
|
client.get_user_verifier(this._cancellable, Lang.bind(this, this._userVerifierGot));
|
||||||
|
return;
|
||||||
|
} catch(e) {
|
||||||
|
this._reportInitError('Failed to open reauthentication channel', e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._connectSignals();
|
||||||
|
this._beginVerification();
|
||||||
|
this._hold.release();
|
||||||
|
},
|
||||||
|
|
||||||
|
_userVerifierGot: function(client, result) {
|
||||||
|
try {
|
||||||
|
this._userVerifier = client.get_user_verifier_finish(result);
|
||||||
|
} catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
|
||||||
|
return;
|
||||||
|
} catch(e) {
|
||||||
|
this._reportInitError('Failed to obtain user verifier', e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._connectSignals();
|
||||||
|
this._beginVerification();
|
||||||
|
this._hold.release();
|
||||||
|
},
|
||||||
|
|
||||||
|
_connectSignals: function() {
|
||||||
|
this._userVerifier.connect('info', Lang.bind(this, this._onInfo));
|
||||||
|
this._userVerifier.connect('problem', Lang.bind(this, this._onProblem));
|
||||||
|
this._userVerifier.connect('info-query', Lang.bind(this, this._onInfoQuery));
|
||||||
|
this._userVerifier.connect('secret-info-query', Lang.bind(this, this._onSecretInfoQuery));
|
||||||
|
this._userVerifier.connect('conversation-stopped', Lang.bind(this, this._onConversationStopped));
|
||||||
|
this._userVerifier.connect('reset', Lang.bind(this, this._onReset));
|
||||||
|
this._userVerifier.connect('verification-complete', Lang.bind(this, this._onVerificationComplete));
|
||||||
|
},
|
||||||
|
|
||||||
|
_beginVerification: function() {
|
||||||
|
this._hold.acquire();
|
||||||
|
|
||||||
|
if (this._userName) {
|
||||||
|
this._userVerifier.call_begin_verification_for_user(PASSWORD_SERVICE_NAME,
|
||||||
|
this._userName,
|
||||||
|
this._cancellable,
|
||||||
|
Lang.bind(this, function(obj, result) {
|
||||||
|
try {
|
||||||
|
obj.call_begin_verification_for_user_finish(result);
|
||||||
|
} catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
|
||||||
|
return;
|
||||||
|
} catch(e) {
|
||||||
|
this._reportInitError('Failed to start verification for user', e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._hold.release();
|
||||||
|
}));
|
||||||
|
|
||||||
|
if (this._haveFingerprintReader) {
|
||||||
|
this._hold.acquire();
|
||||||
|
|
||||||
|
this._userVerifier.call_begin_verification_for_user(FINGERPRINT_SERVICE_NAME,
|
||||||
|
this._userName,
|
||||||
|
this._cancellable,
|
||||||
|
Lang.bind(this, function(obj, result) {
|
||||||
|
try {
|
||||||
|
obj.call_begin_verification_for_user_finish(result);
|
||||||
|
} catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
|
||||||
|
return;
|
||||||
|
} catch(e) {
|
||||||
|
this._reportInitError('Failed to start fingerprint verification for user', e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._hold.release();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this._userVerifier.call_begin_verification(PASSWORD_SERVICE_NAME,
|
||||||
|
this._cancellable,
|
||||||
|
Lang.bind(this, function(obj, result) {
|
||||||
|
try {
|
||||||
|
obj.call_begin_verification_finish(result);
|
||||||
|
} catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
|
||||||
|
return;
|
||||||
|
} catch(e) {
|
||||||
|
this._reportInitError('Failed to start verification', e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._hold.release();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_onInfo: function(client, serviceName, info) {
|
||||||
|
// We don't display fingerprint messages, because they
|
||||||
|
// have words like UPEK in them. Instead we use the messages
|
||||||
|
// as a cue to display our own message.
|
||||||
|
if (serviceName == FINGERPRINT_SERVICE_NAME &&
|
||||||
|
this._haveFingerprintReader) {
|
||||||
|
|
||||||
|
// Translators: this message is shown below the password entry field
|
||||||
|
// to indicate the user can swipe their finger instead
|
||||||
|
this.emit('show-login-hint', _("(or swipe finger)"));
|
||||||
|
} else if (serviceName == PASSWORD_SERVICE_NAME) {
|
||||||
|
this.emit('show-message', info, 'login-dialog-message-info');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_onProblem: function(client, serviceName, problem) {
|
||||||
|
// we don't want to show auth failed messages to
|
||||||
|
// users who haven't enrolled their fingerprint.
|
||||||
|
if (serviceName != PASSWORD_SERVICE_NAME)
|
||||||
|
return;
|
||||||
|
this.emit('show-message', problem, 'login-dialog-message-warning');
|
||||||
|
},
|
||||||
|
|
||||||
|
_showRealmLoginHint: function() {
|
||||||
|
if (this._realmManager.loginFormat) {
|
||||||
|
let hint = this._realmManager.loginFormat;
|
||||||
|
|
||||||
|
hint = hint.replace(/%U/g, 'user');
|
||||||
|
hint = hint.replace(/%D/g, 'DOMAIN');
|
||||||
|
hint = hint.replace(/%[^UD]/g, '');
|
||||||
|
|
||||||
|
// Translators: this message is shown below the username entry field
|
||||||
|
// to clue the user in on how to login to the local network realm
|
||||||
|
this.emit('show-login-hint',
|
||||||
|
_("(e.g., user or %s)").format(hint));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_onInfoQuery: function(client, serviceName, question) {
|
||||||
|
// We only expect questions to come from the main auth service
|
||||||
|
if (serviceName != PASSWORD_SERVICE_NAME)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this._showRealmLoginHint();
|
||||||
|
this._realmLoginHintSignalId = this._realmManager.connect('login-format-changed',
|
||||||
|
Lang.bind(this, this._showRealmLoginHint));
|
||||||
|
|
||||||
|
this.emit('ask-question', serviceName, question, '');
|
||||||
|
},
|
||||||
|
|
||||||
|
_onSecretInfoQuery: function(client, serviceName, secretQuestion) {
|
||||||
|
// We only expect secret requests to come from the main auth service
|
||||||
|
if (serviceName != PASSWORD_SERVICE_NAME)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.emit('ask-question', serviceName, secretQuestion, '\u25cf');
|
||||||
|
},
|
||||||
|
|
||||||
|
_onReset: function() {
|
||||||
|
this.clear();
|
||||||
|
|
||||||
|
// Clear previous attempts to authenticate
|
||||||
|
this._failCounter = 0;
|
||||||
|
|
||||||
|
this.emit('reset');
|
||||||
|
},
|
||||||
|
|
||||||
|
_onVerificationComplete: function() {
|
||||||
|
this.emit('verification-complete');
|
||||||
|
},
|
||||||
|
|
||||||
|
_verificationFailed: function(retry) {
|
||||||
|
// For Not Listed / enterprise logins, immediately reset
|
||||||
|
// the dialog
|
||||||
|
// Otherwise, we allow ALLOWED_FAILURES attempts. After that, we
|
||||||
|
// go back to the welcome screen.
|
||||||
|
|
||||||
|
this._failCounter++;
|
||||||
|
let canRetry = retry && this._userName &&
|
||||||
|
this._failCounter < this._settings.get_int(ALLOWED_FAILURES_KEY);
|
||||||
|
|
||||||
|
if (canRetry) {
|
||||||
|
this.clear();
|
||||||
|
this.begin(this._userName, new Batch.Hold());
|
||||||
|
} else {
|
||||||
|
// Allow some time to see the message, then reset everything
|
||||||
|
Mainloop.timeout_add(3000, Lang.bind(this, function() {
|
||||||
|
this.cancel();
|
||||||
|
|
||||||
|
this._onReset();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.emit('verification-failed');
|
||||||
|
},
|
||||||
|
|
||||||
|
_onConversationStopped: function(client, serviceName) {
|
||||||
|
// if the password service fails, then cancel everything.
|
||||||
|
// But if, e.g., fingerprint fails, still give
|
||||||
|
// password authentication a chance to succeed
|
||||||
|
if (serviceName == PASSWORD_SERVICE_NAME) {
|
||||||
|
this._verificationFailed(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.emit('hide-login-hint');
|
||||||
|
|
||||||
|
if (this._realmLoginHintSignalId) {
|
||||||
|
this._realmManager.disconnect(this._realmLoginHintSignalId);
|
||||||
|
this._realmLoginHintSignalId = 0;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
Signals.addSignalMethods(ShellUserVerifier.prototype);
|
@ -1,11 +1,15 @@
|
|||||||
/* mode: js2; indent-tabs-mode: nil; tab-size: 4 */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
/* The name of this package (not localized) */
|
/* The name of this package (not localized) */
|
||||||
const PACKAGE_NAME = '@PACKAGE_NAME@';
|
const PACKAGE_NAME = '@PACKAGE_NAME@';
|
||||||
/* The version of this package */
|
/* The version of this package */
|
||||||
const PACKAGE_VERSION = '@PACKAGE_VERSION@';
|
const PACKAGE_VERSION = '@PACKAGE_VERSION@';
|
||||||
/* The version of GJS we're linking to */
|
|
||||||
const GJS_VERSION = '@GJS_VERSION@';
|
|
||||||
/* 1 if gnome-bluetooth is available, 0 otherwise */
|
/* 1 if gnome-bluetooth is available, 0 otherwise */
|
||||||
const HAVE_BLUETOOTH = @HAVE_BLUETOOTH@;
|
const HAVE_BLUETOOTH = @HAVE_BLUETOOTH@;
|
||||||
/* The system TLS CA list */
|
/* gettext package */
|
||||||
const SHELL_SYSTEM_CA_FILE = '@SHELL_SYSTEM_CA_FILE@';
|
const GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@';
|
||||||
|
/* locale dir */
|
||||||
|
const LOCALEDIR = '@datadir@/locale';
|
||||||
|
/* other standard directories */
|
||||||
|
const LIBEXECDIR = '@libexecdir@';
|
||||||
|
const SYSCONFDIR = '@sysconfdir@';
|
||||||
|
@ -1,140 +0,0 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
|
||||||
|
|
||||||
const St = imports.gi.St;
|
|
||||||
const Shell = imports.gi.Shell;
|
|
||||||
const Lang = imports.lang;
|
|
||||||
const Signals = imports.signals;
|
|
||||||
const Search = imports.ui.search;
|
|
||||||
|
|
||||||
const THUMBNAIL_ICON_MARGIN = 2;
|
|
||||||
|
|
||||||
function DocInfo(recentInfo) {
|
|
||||||
this._init(recentInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
DocInfo.prototype = {
|
|
||||||
_init : function(recentInfo) {
|
|
||||||
this.recentInfo = recentInfo;
|
|
||||||
// We actually used get_modified() instead of get_visited()
|
|
||||||
// here, as GtkRecentInfo doesn't updated get_visited()
|
|
||||||
// correctly. See http://bugzilla.gnome.org/show_bug.cgi?id=567094
|
|
||||||
this.timestamp = recentInfo.get_modified();
|
|
||||||
this.name = recentInfo.get_display_name();
|
|
||||||
this._lowerName = this.name.toLowerCase();
|
|
||||||
this.uri = recentInfo.get_uri();
|
|
||||||
this.mimeType = recentInfo.get_mime_type();
|
|
||||||
},
|
|
||||||
|
|
||||||
createIcon : function(size) {
|
|
||||||
return St.TextureCache.get_default().load_recent_thumbnail(size, this.recentInfo);
|
|
||||||
},
|
|
||||||
|
|
||||||
launch : function(workspaceIndex) {
|
|
||||||
Shell.DocSystem.get_default().open(this.recentInfo, workspaceIndex);
|
|
||||||
},
|
|
||||||
|
|
||||||
matchTerms: function(terms) {
|
|
||||||
let mtype = Search.MatchType.NONE;
|
|
||||||
for (let i = 0; i < terms.length; i++) {
|
|
||||||
let term = terms[i];
|
|
||||||
let idx = this._lowerName.indexOf(term);
|
|
||||||
if (idx == 0) {
|
|
||||||
mtype = Search.MatchType.PREFIX;
|
|
||||||
} else if (idx > 0) {
|
|
||||||
if (mtype == Search.MatchType.NONE)
|
|
||||||
mtype = Search.MatchType.SUBSTRING;
|
|
||||||
} else {
|
|
||||||
return Search.MatchType.NONE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mtype;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var docManagerInstance = null;
|
|
||||||
|
|
||||||
function getDocManager() {
|
|
||||||
if (docManagerInstance == null)
|
|
||||||
docManagerInstance = new DocManager();
|
|
||||||
return docManagerInstance;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DocManager wraps the DocSystem, primarily to expose DocInfo objects.
|
|
||||||
*/
|
|
||||||
function DocManager() {
|
|
||||||
this._init();
|
|
||||||
}
|
|
||||||
|
|
||||||
DocManager.prototype = {
|
|
||||||
_init: function() {
|
|
||||||
this._docSystem = Shell.DocSystem.get_default();
|
|
||||||
this._infosByTimestamp = [];
|
|
||||||
this._infosByUri = {};
|
|
||||||
this._docSystem.connect('changed', Lang.bind(this, this._reload));
|
|
||||||
this._reload();
|
|
||||||
},
|
|
||||||
|
|
||||||
_reload: function() {
|
|
||||||
let docs = this._docSystem.get_all();
|
|
||||||
this._infosByTimestamp = [];
|
|
||||||
this._infosByUri = {};
|
|
||||||
for (let i = 0; i < docs.length; i++) {
|
|
||||||
let recentInfo = docs[i];
|
|
||||||
|
|
||||||
let docInfo = new DocInfo(recentInfo);
|
|
||||||
this._infosByTimestamp.push(docInfo);
|
|
||||||
this._infosByUri[docInfo.uri] = docInfo;
|
|
||||||
}
|
|
||||||
this.emit('changed');
|
|
||||||
},
|
|
||||||
|
|
||||||
getTimestampOrderedInfos: function() {
|
|
||||||
return this._infosByTimestamp;
|
|
||||||
},
|
|
||||||
|
|
||||||
getInfosByUri: function() {
|
|
||||||
return this._infosByUri;
|
|
||||||
},
|
|
||||||
|
|
||||||
lookupByUri: function(uri) {
|
|
||||||
return this._infosByUri[uri];
|
|
||||||
},
|
|
||||||
|
|
||||||
queueExistenceCheck: function(count) {
|
|
||||||
return this._docSystem.queue_existence_check(count);
|
|
||||||
},
|
|
||||||
|
|
||||||
_searchDocs: function(items, terms) {
|
|
||||||
let multiplePrefixMatches = [];
|
|
||||||
let prefixMatches = [];
|
|
||||||
let multipleSubtringMatches = [];
|
|
||||||
let substringMatches = [];
|
|
||||||
for (let i = 0; i < items.length; i++) {
|
|
||||||
let item = items[i];
|
|
||||||
let mtype = item.matchTerms(terms);
|
|
||||||
if (mtype == Search.MatchType.MULTIPLE_PREFIX)
|
|
||||||
multiplePrefixMatches.push(item.uri);
|
|
||||||
else if (mtype == Search.MatchType.PREFIX)
|
|
||||||
prefixMatches.push(item.uri);
|
|
||||||
else if (mtype == Search.MatchType.MULTIPLE_SUBSTRING)
|
|
||||||
multipleSubtringMatches.push(item.uri);
|
|
||||||
else if (mtype == Search.MatchType.SUBSTRING)
|
|
||||||
substringMatches.push(item.uri);
|
|
||||||
}
|
|
||||||
return multiplePrefixMatches.concat(prefixMatches.concat(multipleSubtringMatches.concat(substringMatches)));
|
|
||||||
},
|
|
||||||
|
|
||||||
initialSearch: function(terms) {
|
|
||||||
return this._searchDocs(this._infosByTimestamp, terms);
|
|
||||||
},
|
|
||||||
|
|
||||||
subsearch: function(previousResults, terms) {
|
|
||||||
return this._searchDocs(previousResults.map(Lang.bind(this,
|
|
||||||
function(url) {
|
|
||||||
return this._infosByUri[url];
|
|
||||||
})), terms);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Signals.addSignalMethods(DocManager.prototype);
|
|
202
js/misc/extensionUtils.js
Normal file
@ -0,0 +1,202 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
|
// Common utils for the extension system and the extension
|
||||||
|
// preferences tool
|
||||||
|
|
||||||
|
const Lang = imports.lang;
|
||||||
|
const Signals = imports.signals;
|
||||||
|
|
||||||
|
const GLib = imports.gi.GLib;
|
||||||
|
const Gio = imports.gi.Gio;
|
||||||
|
const ShellJS = imports.gi.ShellJS;
|
||||||
|
|
||||||
|
const Config = imports.misc.config;
|
||||||
|
|
||||||
|
const ExtensionType = {
|
||||||
|
SYSTEM: 1,
|
||||||
|
PER_USER: 2
|
||||||
|
};
|
||||||
|
|
||||||
|
// Maps uuid -> metadata object
|
||||||
|
const extensions = {};
|
||||||
|
|
||||||
|
function getCurrentExtension() {
|
||||||
|
let stack = (new Error()).stack;
|
||||||
|
|
||||||
|
// Assuming we're importing this directly from an extension (and we shouldn't
|
||||||
|
// ever not be), its UUID should be directly in the path here.
|
||||||
|
let extensionStackLine = stack.split('\n')[1];
|
||||||
|
if (!extensionStackLine)
|
||||||
|
throw new Error('Could not find current extension');
|
||||||
|
|
||||||
|
// The stack line is like:
|
||||||
|
// init([object Object])@/home/user/data/gnome-shell/extensions/u@u.id/prefs.js:8
|
||||||
|
//
|
||||||
|
// In the case that we're importing from
|
||||||
|
// module scope, the first field is blank:
|
||||||
|
// @/home/user/data/gnome-shell/extensions/u@u.id/prefs.js:8
|
||||||
|
let match = new RegExp('@(.+):\\d+').exec(extensionStackLine);
|
||||||
|
if (!match)
|
||||||
|
throw new Error('Could not find current extension');
|
||||||
|
|
||||||
|
let path = match[1];
|
||||||
|
let file = Gio.File.new_for_path(path);
|
||||||
|
|
||||||
|
// Walk up the directory tree, looking for an extesion with
|
||||||
|
// the same UUID as a directory name.
|
||||||
|
while (file != null) {
|
||||||
|
let extension = extensions[file.get_basename()];
|
||||||
|
if (extension !== undefined)
|
||||||
|
return extension;
|
||||||
|
file = file.get_parent();
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error('Could not find current extension');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* versionCheck:
|
||||||
|
* @required: an array of versions we're compatible with
|
||||||
|
* @current: the version we have
|
||||||
|
*
|
||||||
|
* Check if a component is compatible for an extension.
|
||||||
|
* @required is an array, and at least one version must match.
|
||||||
|
* @current must be in the format <major>.<minor>.<point>.<micro>
|
||||||
|
* <micro> is always ignored
|
||||||
|
* <point> is ignored if <minor> is even (so you can target the
|
||||||
|
* whole stable release)
|
||||||
|
* <minor> and <major> must match
|
||||||
|
* Each target version must be at least <major> and <minor>
|
||||||
|
*/
|
||||||
|
function versionCheck(required, current) {
|
||||||
|
let currentArray = current.split('.');
|
||||||
|
let major = currentArray[0];
|
||||||
|
let minor = currentArray[1];
|
||||||
|
let point = currentArray[2];
|
||||||
|
for (let i = 0; i < required.length; i++) {
|
||||||
|
let requiredArray = required[i].split('.');
|
||||||
|
if (requiredArray[0] == major &&
|
||||||
|
requiredArray[1] == minor &&
|
||||||
|
(requiredArray[2] == point ||
|
||||||
|
(requiredArray[2] == undefined && parseInt(minor) % 2 == 0)))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isOutOfDate(extension) {
|
||||||
|
if (!versionCheck(extension.metadata['shell-version'], Config.PACKAGE_VERSION))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createExtensionObject(uuid, dir, type) {
|
||||||
|
let info;
|
||||||
|
|
||||||
|
let metadataFile = dir.get_child('metadata.json');
|
||||||
|
if (!metadataFile.query_exists(null)) {
|
||||||
|
throw new Error('Missing metadata.json');
|
||||||
|
}
|
||||||
|
|
||||||
|
let metadataContents, success, tag;
|
||||||
|
try {
|
||||||
|
[success, metadataContents, tag] = metadataFile.load_contents(null);
|
||||||
|
} catch (e) {
|
||||||
|
throw new Error('Failed to load metadata.json: ' + e);
|
||||||
|
}
|
||||||
|
let meta;
|
||||||
|
try {
|
||||||
|
meta = JSON.parse(metadataContents);
|
||||||
|
} catch (e) {
|
||||||
|
throw new Error('Failed to parse metadata.json: ' + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
let requiredProperties = ['uuid', 'name', 'description', 'shell-version'];
|
||||||
|
for (let i = 0; i < requiredProperties.length; i++) {
|
||||||
|
let prop = requiredProperties[i];
|
||||||
|
if (!meta[prop]) {
|
||||||
|
throw new Error('missing "' + prop + '" property in metadata.json');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (uuid != meta.uuid) {
|
||||||
|
throw new Error('uuid "' + meta.uuid + '" from metadata.json does not match directory name "' + uuid + '"');
|
||||||
|
}
|
||||||
|
|
||||||
|
let extension = {};
|
||||||
|
|
||||||
|
extension.metadata = meta;
|
||||||
|
extension.uuid = meta.uuid;
|
||||||
|
extension.type = type;
|
||||||
|
extension.dir = dir;
|
||||||
|
extension.path = dir.get_path();
|
||||||
|
extension.error = '';
|
||||||
|
extension.hasPrefs = dir.get_child('prefs.js').query_exists(null);
|
||||||
|
|
||||||
|
extensions[uuid] = extension;
|
||||||
|
|
||||||
|
return extension;
|
||||||
|
}
|
||||||
|
|
||||||
|
var _extension = null;
|
||||||
|
|
||||||
|
function installImporter(extension) {
|
||||||
|
_extension = extension;
|
||||||
|
ShellJS.add_extension_importer('imports.misc.extensionUtils._extension', 'imports', extension.path);
|
||||||
|
_extension = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const ExtensionFinder = new Lang.Class({
|
||||||
|
Name: 'ExtensionFinder',
|
||||||
|
|
||||||
|
_scanExtensionsInDirectory: function(dir, type) {
|
||||||
|
let fileEnum;
|
||||||
|
let file, info;
|
||||||
|
try {
|
||||||
|
fileEnum = dir.enumerate_children('standard::*', Gio.FileQueryInfoFlags.NONE, null);
|
||||||
|
} catch(e) {
|
||||||
|
if (e.domain != Gio.io_error_quark() || e.code != Gio.IOErrorEnum.NOT_FOUND)
|
||||||
|
logError(e, 'Could not enumerate extensions directory');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
while ((info = fileEnum.next_file(null)) != null) {
|
||||||
|
let fileType = info.get_file_type();
|
||||||
|
if (fileType != Gio.FileType.DIRECTORY)
|
||||||
|
continue;
|
||||||
|
let uuid = info.get_name();
|
||||||
|
let extensionDir = dir.get_child(uuid);
|
||||||
|
|
||||||
|
let existing = extensions[uuid];
|
||||||
|
if (existing) {
|
||||||
|
log('Extension %s already installed in %s. %s will not be loaded'.format(uuid, existing.path, extensionDir.get_path()));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
let extension;
|
||||||
|
try {
|
||||||
|
extension = createExtensionObject(uuid, extensionDir, type);
|
||||||
|
} catch(e) {
|
||||||
|
logError(e, 'Could not load extension %s'.format(uuid));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
this.emit('extension-found', extension);
|
||||||
|
}
|
||||||
|
fileEnum.close(null);
|
||||||
|
},
|
||||||
|
|
||||||
|
scanExtensions: function() {
|
||||||
|
let userExtensionsDir = Gio.File.new_for_path(GLib.build_filenamev([global.userdatadir, 'extensions']));
|
||||||
|
this._scanExtensionsInDirectory(userExtensionsDir, ExtensionType.PER_USER);
|
||||||
|
|
||||||
|
let systemDataDirs = GLib.get_system_data_dirs();
|
||||||
|
for (let i = 0; i < systemDataDirs.length; i++) {
|
||||||
|
let dirPath = GLib.build_filenamev([systemDataDirs[i], 'gnome-shell', 'extensions']);
|
||||||
|
let dir = Gio.file_new_for_path(dirPath);
|
||||||
|
if (dir.query_exists(null))
|
||||||
|
this._scanExtensionsInDirectory(dir, ExtensionType.SYSTEM);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Signals.addSignalMethods(ExtensionFinder.prototype);
|
@ -1,3 +1,5 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const Gio = imports.gi.Gio;
|
const Gio = imports.gi.Gio;
|
||||||
const GLib = imports.gi.GLib;
|
const GLib = imports.gi.GLib;
|
||||||
|
|
||||||
@ -26,7 +28,7 @@ function deleteGFile(file) {
|
|||||||
return file['delete'](null);
|
return file['delete'](null);
|
||||||
}
|
}
|
||||||
|
|
||||||
function recursivelyDeleteDir(dir) {
|
function recursivelyDeleteDir(dir, deleteParent) {
|
||||||
let children = dir.enumerate_children('standard::name,standard::type',
|
let children = dir.enumerate_children('standard::name,standard::type',
|
||||||
Gio.FileQueryInfoFlags.NONE, null);
|
Gio.FileQueryInfoFlags.NONE, null);
|
||||||
|
|
||||||
@ -36,9 +38,30 @@ function recursivelyDeleteDir(dir) {
|
|||||||
let child = dir.get_child(info.get_name());
|
let child = dir.get_child(info.get_name());
|
||||||
if (type == Gio.FileType.REGULAR)
|
if (type == Gio.FileType.REGULAR)
|
||||||
deleteGFile(child);
|
deleteGFile(child);
|
||||||
else if (type == Gio.TypeType.DIRECTORY)
|
else if (type == Gio.FileType.DIRECTORY)
|
||||||
recursivelyDeleteDir(child);
|
recursivelyDeleteDir(child, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteGFile(dir);
|
if (deleteParent)
|
||||||
|
deleteGFile(dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
function recursivelyMoveDir(srcDir, destDir) {
|
||||||
|
let children = srcDir.enumerate_children('standard::name,standard::type',
|
||||||
|
Gio.FileQueryInfoFlags.NONE, null);
|
||||||
|
|
||||||
|
if (!destDir.query_exists(null))
|
||||||
|
destDir.make_directory_with_parents(null);
|
||||||
|
|
||||||
|
let info, child;
|
||||||
|
while ((info = children.next_file(null)) != null) {
|
||||||
|
let type = info.get_file_type();
|
||||||
|
let srcChild = srcDir.get_child(info.get_name());
|
||||||
|
let destChild = destDir.get_child(info.get_name());
|
||||||
|
log([srcChild.get_path(), destChild.get_path()]);
|
||||||
|
if (type == Gio.FileType.REGULAR)
|
||||||
|
srcChild.move(destChild, Gio.FileCopyFlags.NONE, null, null);
|
||||||
|
else if (type == Gio.FileType.DIRECTORY)
|
||||||
|
recursivelyMoveDir(srcChild, destChild);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,60 +0,0 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This function is intended to extend the String object and provide
|
|
||||||
* an String.format API for string formatting.
|
|
||||||
* It has to be set up using String.prototype.format = Format.format;
|
|
||||||
* Usage:
|
|
||||||
* "somestring %s %d".format('hello', 5);
|
|
||||||
* It supports %s, %d, %x and %f, for %f it also support precisions like
|
|
||||||
* "%.2f".format(1.526). All specifiers can be prefixed with a minimum
|
|
||||||
* field width, e.g. "%5s".format("foo"). Unless the width is prefixed
|
|
||||||
* with '0', the formatted string will be padded with spaces.
|
|
||||||
*/
|
|
||||||
|
|
||||||
function format() {
|
|
||||||
let str = this;
|
|
||||||
let i = 0;
|
|
||||||
let args = arguments;
|
|
||||||
|
|
||||||
return str.replace(/%([0-9]+)?(?:\.([0-9]+))?(.)/g, function (str, widthGroup, precisionGroup, genericGroup) {
|
|
||||||
|
|
||||||
if (precisionGroup != '' && genericGroup != 'f')
|
|
||||||
throw new Error("Precision can only be specified for 'f'");
|
|
||||||
|
|
||||||
let fillChar = (widthGroup[0] == '0') ? '0' : ' ';
|
|
||||||
let width = parseInt(widthGroup, 10) || 0;
|
|
||||||
|
|
||||||
function fillWidth(s, c, w) {
|
|
||||||
let fill = '';
|
|
||||||
for (let i = 0; i < w; i++)
|
|
||||||
fill += c;
|
|
||||||
return fill.substr(s.length) + s;
|
|
||||||
}
|
|
||||||
|
|
||||||
let s = '';
|
|
||||||
switch (genericGroup) {
|
|
||||||
case '%':
|
|
||||||
return '%';
|
|
||||||
break;
|
|
||||||
case 's':
|
|
||||||
s = args[i++].toString();
|
|
||||||
break;
|
|
||||||
case 'd':
|
|
||||||
s = parseInt(args[i++]).toString();
|
|
||||||
break;
|
|
||||||
case 'x':
|
|
||||||
s = parseInt(args[i++]).toString(16);
|
|
||||||
break;
|
|
||||||
case 'f':
|
|
||||||
if (precisionGroup == '')
|
|
||||||
s = parseFloat(args[i++]).toString();
|
|
||||||
else
|
|
||||||
s = parseFloat(args[i++]).toFixed(parseInt(precisionGroup));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new Error('Unsupported conversion character %' + genericGroup);
|
|
||||||
}
|
|
||||||
return fillWidth(s, fillChar, width);
|
|
||||||
});
|
|
||||||
}
|
|
@ -1,20 +1,18 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const DBus = imports.dbus;
|
const Gio = imports.gi.Gio;
|
||||||
const Lang = imports.lang;
|
const Lang = imports.lang;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const PresenceIface = {
|
const PresenceIface = <interface name="org.gnome.SessionManager.Presence">
|
||||||
name: 'org.gnome.SessionManager.Presence',
|
<method name="SetStatus">
|
||||||
methods: [{ name: 'SetStatus',
|
<arg type="u" direction="in"/>
|
||||||
inSignature: 'u',
|
</method>
|
||||||
outSignature: '' }],
|
<property name="status" type="u" access="readwrite"/>
|
||||||
properties: [{ name: 'status',
|
<signal name="StatusChanged">
|
||||||
signature: 'u',
|
<arg type="u" direction="out"/>
|
||||||
access: 'readwrite' }],
|
</signal>
|
||||||
signals: [{ name: 'StatusChanged',
|
</interface>;
|
||||||
inSignature: 'u' }]
|
|
||||||
};
|
|
||||||
|
|
||||||
const PresenceStatus = {
|
const PresenceStatus = {
|
||||||
AVAILABLE: 0,
|
AVAILABLE: 0,
|
||||||
@ -23,104 +21,52 @@ const PresenceStatus = {
|
|||||||
IDLE: 3
|
IDLE: 3
|
||||||
};
|
};
|
||||||
|
|
||||||
function Presence() {
|
var PresenceProxy = Gio.DBusProxy.makeProxyWrapper(PresenceIface);
|
||||||
this._init();
|
function Presence(initCallback, cancellable) {
|
||||||
|
return new PresenceProxy(Gio.DBus.session, 'org.gnome.SessionManager',
|
||||||
|
'/org/gnome/SessionManager/Presence', initCallback, cancellable);
|
||||||
}
|
}
|
||||||
|
|
||||||
Presence.prototype = {
|
|
||||||
_init: function() {
|
|
||||||
DBus.session.proxifyObject(this, 'org.gnome.SessionManager', '/org/gnome/SessionManager/Presence', this);
|
|
||||||
},
|
|
||||||
|
|
||||||
getStatus: function(callback) {
|
|
||||||
this.GetRemote('status', Lang.bind(this,
|
|
||||||
function(status, ex) {
|
|
||||||
if (!ex)
|
|
||||||
callback(this, status);
|
|
||||||
}));
|
|
||||||
},
|
|
||||||
|
|
||||||
setStatus: function(status) {
|
|
||||||
this.SetStatusRemote(status);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
DBus.proxifyPrototype(Presence.prototype, PresenceIface);
|
|
||||||
|
|
||||||
// Note inhibitors are immutable objects, so they don't
|
// Note inhibitors are immutable objects, so they don't
|
||||||
// change at runtime (changes always come in the form
|
// change at runtime (changes always come in the form
|
||||||
// of new inhibitors)
|
// of new inhibitors)
|
||||||
const InhibitorIface = {
|
const InhibitorIface = <interface name="org.gnome.SessionManager.Inhibitor">
|
||||||
name: 'org.gnome.SessionManager.Inhibitor',
|
<method name="GetAppId">
|
||||||
properties: [{ name: 'app_id',
|
<arg type="s" direction="out" />
|
||||||
signature: 's',
|
</method>
|
||||||
access: 'readonly' },
|
<method name="GetReason">
|
||||||
{ name: 'client_id',
|
<arg type="s" direction="out" />
|
||||||
signature: 's',
|
</method>
|
||||||
access: 'readonly' },
|
</interface>;
|
||||||
{ name: 'reason',
|
|
||||||
signature: 's',
|
|
||||||
access: 'readonly' },
|
|
||||||
{ name: 'flags',
|
|
||||||
signature: 'u',
|
|
||||||
access: 'readonly' },
|
|
||||||
{ name: 'toplevel_xid',
|
|
||||||
signature: 'u',
|
|
||||||
access: 'readonly' },
|
|
||||||
{ name: 'cookie',
|
|
||||||
signature: 'u',
|
|
||||||
access: 'readonly' }],
|
|
||||||
};
|
|
||||||
|
|
||||||
function Inhibitor(objectPath) {
|
var InhibitorProxy = Gio.DBusProxy.makeProxyWrapper(InhibitorIface);
|
||||||
this._init(objectPath);
|
function Inhibitor(objectPath, initCallback, cancellable) {
|
||||||
|
return new InhibitorProxy(Gio.DBus.session, 'org.gnome.SessionManager', objectPath, initCallback, cancellable);
|
||||||
}
|
}
|
||||||
|
|
||||||
Inhibitor.prototype = {
|
|
||||||
_init: function(objectPath) {
|
|
||||||
DBus.session.proxifyObject(this,
|
|
||||||
"org.gnome.SessionManager",
|
|
||||||
objectPath);
|
|
||||||
this.isLoaded = false;
|
|
||||||
this._loadingPropertiesCount = InhibitorIface.properties.length;
|
|
||||||
for (let i = 0; i < InhibitorIface.properties.length; i++) {
|
|
||||||
let propertyName = InhibitorIface.properties[i].name;
|
|
||||||
this.GetRemote(propertyName, Lang.bind(this,
|
|
||||||
function(value, exception) {
|
|
||||||
if (exception)
|
|
||||||
return;
|
|
||||||
|
|
||||||
this[propertyName] = value;
|
|
||||||
this._loadingPropertiesCount--;
|
|
||||||
|
|
||||||
if (this._loadingPropertiesCount == 0) {
|
|
||||||
this.isLoaded = true;
|
|
||||||
this.emit("is-loaded");
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
DBus.proxifyPrototype(Inhibitor.prototype, InhibitorIface);
|
|
||||||
Signals.addSignalMethods(Inhibitor.prototype);
|
|
||||||
|
|
||||||
|
|
||||||
// Not the full interface, only the methods we use
|
// Not the full interface, only the methods we use
|
||||||
const SessionManagerIface = {
|
const SessionManagerIface = <interface name="org.gnome.SessionManager">
|
||||||
name: 'org.gnome.SessionManager',
|
<method name="Logout">
|
||||||
methods: [
|
<arg type="u" direction="in" />
|
||||||
{ name: 'Logout', inSignature: 'u', outSignature: '' },
|
</method>
|
||||||
{ name: 'Shutdown', inSignature: '', outSignature: '' },
|
<method name="Shutdown" />
|
||||||
{ name: 'CanShutdown', inSignature: '', outSignature: 'b' }
|
<method name="Reboot" />
|
||||||
]
|
<method name="CanShutdown">
|
||||||
};
|
<arg type="b" direction="out" />
|
||||||
|
</method>
|
||||||
|
<method name="IsInhibited">
|
||||||
|
<arg type="u" direction="in" />
|
||||||
|
<arg type="b" direction="out" />
|
||||||
|
</method>
|
||||||
|
<signal name="InhibitorAdded">
|
||||||
|
<arg type="o" direction="out"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="InhibitorRemoved">
|
||||||
|
<arg type="o" direction="out"/>
|
||||||
|
</signal>
|
||||||
|
</interface>;
|
||||||
|
|
||||||
function SessionManager() {
|
var SessionManagerProxy = Gio.DBusProxy.makeProxyWrapper(SessionManagerIface);
|
||||||
this._init();
|
function SessionManager(initCallback, cancellable) {
|
||||||
|
return new SessionManagerProxy(Gio.DBus.session, 'org.gnome.SessionManager', '/org/gnome/SessionManager', initCallback, cancellable);
|
||||||
}
|
}
|
||||||
|
|
||||||
SessionManager.prototype = {
|
|
||||||
_init: function() {
|
|
||||||
DBus.session.proxifyObject(this, 'org.gnome.SessionManager', '/org/gnome/SessionManager');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
DBus.proxifyPrototype(SessionManager.prototype, SessionManagerIface);
|
|
@ -1,4 +1,4 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const Lang = imports.lang;
|
const Lang = imports.lang;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
@ -7,11 +7,9 @@ const Params = imports.misc.params;
|
|||||||
|
|
||||||
const DEFAULT_LIMIT = 512;
|
const DEFAULT_LIMIT = 512;
|
||||||
|
|
||||||
function HistoryManager(params) {
|
const HistoryManager = new Lang.Class({
|
||||||
this._init(params);
|
Name: 'HistoryManager',
|
||||||
}
|
|
||||||
|
|
||||||
HistoryManager.prototype = {
|
|
||||||
_init: function(params) {
|
_init: function(params) {
|
||||||
params = Params.parse(params, { gsettingsKey: null,
|
params = Params.parse(params, { gsettingsKey: null,
|
||||||
limit: DEFAULT_LIMIT,
|
limit: DEFAULT_LIMIT,
|
||||||
@ -43,24 +41,26 @@ HistoryManager.prototype = {
|
|||||||
this._historyIndex = this._history.length;
|
this._historyIndex = this._history.length;
|
||||||
},
|
},
|
||||||
|
|
||||||
prevItem: function(text) {
|
_setPrevItem: function(text) {
|
||||||
if (this._historyIndex <= 0)
|
if (this._historyIndex <= 0)
|
||||||
return text;
|
return false;
|
||||||
|
|
||||||
if (text)
|
if (text)
|
||||||
this._history[this._historyIndex] = text;
|
this._history[this._historyIndex] = text;
|
||||||
this._historyIndex--;
|
this._historyIndex--;
|
||||||
return this._indexChanged();
|
this._indexChanged();
|
||||||
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
nextItem: function(text) {
|
_setNextItem: function(text) {
|
||||||
if (this._historyIndex >= this._history.length)
|
if (this._historyIndex >= this._history.length)
|
||||||
return text;
|
return false;
|
||||||
|
|
||||||
if (text)
|
if (text)
|
||||||
this._history[this._historyIndex] = text;
|
this._history[this._historyIndex] = text;
|
||||||
this._historyIndex++;
|
this._historyIndex++;
|
||||||
return this._indexChanged();
|
this._indexChanged();
|
||||||
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
lastItem: function() {
|
lastItem: function() {
|
||||||
@ -85,11 +85,9 @@ HistoryManager.prototype = {
|
|||||||
_onEntryKeyPress: function(entry, event) {
|
_onEntryKeyPress: function(entry, event) {
|
||||||
let symbol = event.get_key_symbol();
|
let symbol = event.get_key_symbol();
|
||||||
if (symbol == Clutter.KEY_Up) {
|
if (symbol == Clutter.KEY_Up) {
|
||||||
this.prevItem(entry.get_text());
|
return this._setPrevItem(entry.get_text());
|
||||||
return true;
|
|
||||||
} else if (symbol == Clutter.KEY_Down) {
|
} else if (symbol == Clutter.KEY_Down) {
|
||||||
this.nextItem(entry.get_text());
|
return this._setNextItem(entry.get_text());
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
@ -100,8 +98,6 @@ HistoryManager.prototype = {
|
|||||||
|
|
||||||
if (this._entry)
|
if (this._entry)
|
||||||
this._entry.set_text(current);
|
this._entry.set_text(current);
|
||||||
|
|
||||||
return current;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_save: function() {
|
_save: function() {
|
||||||
@ -111,5 +107,5 @@ HistoryManager.prototype = {
|
|||||||
if (this._key)
|
if (this._key)
|
||||||
global.settings.set_strv(this._key, this._history);
|
global.settings.set_strv(this._key, this._history);
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
Signals.addSignalMethods(HistoryManager.prototype);
|
Signals.addSignalMethods(HistoryManager.prototype);
|
||||||
|
246
js/misc/jsParse.js
Normal file
@ -0,0 +1,246 @@
|
|||||||
|
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||||
|
|
||||||
|
// Returns a list of potential completions for text. Completions either
|
||||||
|
// follow a dot (e.g. foo.ba -> bar) or they are picked from globalCompletionList (e.g. fo -> foo)
|
||||||
|
// commandHeader is prefixed on any expression before it is eval'ed. It will most likely
|
||||||
|
// consist of global constants that might not carry over from the calling environment.
|
||||||
|
//
|
||||||
|
// This function is likely the one you want to call from external modules
|
||||||
|
function getCompletions(text, commandHeader, globalCompletionList) {
|
||||||
|
let methods = [];
|
||||||
|
let expr, base;
|
||||||
|
let attrHead = '';
|
||||||
|
if (globalCompletionList == null) {
|
||||||
|
globalCompletionList = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
let offset = getExpressionOffset(text, text.length - 1);
|
||||||
|
if (offset >= 0) {
|
||||||
|
text = text.slice(offset);
|
||||||
|
|
||||||
|
// Look for expressions like "Main.panel.foo" and match Main.panel and foo
|
||||||
|
let matches = text.match(/(.*)\.(.*)/);
|
||||||
|
if (matches) {
|
||||||
|
[expr, base, attrHead] = matches;
|
||||||
|
|
||||||
|
methods = getPropertyNamesFromExpression(base, commandHeader).filter(function(attr) {
|
||||||
|
return attr.slice(0, attrHead.length) == attrHead;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Look for the empty expression or partially entered words
|
||||||
|
// not proceeded by a dot and match them against global constants
|
||||||
|
matches = text.match(/^(\w*)$/);
|
||||||
|
if (text == '' || matches) {
|
||||||
|
[expr, attrHead] = matches;
|
||||||
|
methods = globalCompletionList.filter(function(attr) {
|
||||||
|
return attr.slice(0, attrHead.length) == attrHead;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return [methods, attrHead];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// A few functions for parsing strings of javascript code.
|
||||||
|
//
|
||||||
|
|
||||||
|
// Identify characters that delimit an expression. That is,
|
||||||
|
// if we encounter anything that isn't a letter, '.', ')', or ']',
|
||||||
|
// we should stop parsing.
|
||||||
|
function isStopChar(c) {
|
||||||
|
return !c.match(/[\w\.\)\]]/);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Given the ending position of a quoted string, find where it starts
|
||||||
|
function findMatchingQuote(expr, offset) {
|
||||||
|
let quoteChar = expr.charAt(offset);
|
||||||
|
for (let i = offset - 1; i >= 0; --i) {
|
||||||
|
if (expr.charAt(i) == quoteChar && expr.charAt(i-1) != '\\'){
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Given the ending position of a regex, find where it starts
|
||||||
|
function findMatchingSlash(expr, offset) {
|
||||||
|
for (let i = offset - 1; i >= 0; --i) {
|
||||||
|
if (expr.charAt(i) == '/' && expr.charAt(i-1) != '\\'){
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If expr.charAt(offset) is ')' or ']',
|
||||||
|
// return the position of the corresponding '(' or '[' bracket.
|
||||||
|
// This function does not check for syntactic correctness. e.g.,
|
||||||
|
// findMatchingBrace("[(])", 3) returns 1.
|
||||||
|
function findMatchingBrace(expr, offset) {
|
||||||
|
let closeBrace = expr.charAt(offset);
|
||||||
|
let openBrace = ({')': '(', ']': '['})[closeBrace];
|
||||||
|
|
||||||
|
function findTheBrace(expr, offset) {
|
||||||
|
if (offset < 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (expr.charAt(offset) == openBrace) {
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
if (expr.charAt(offset).match(/['"]/)) {
|
||||||
|
return findTheBrace(expr, findMatchingQuote(expr, offset) - 1);
|
||||||
|
}
|
||||||
|
if (expr.charAt(offset) == '/') {
|
||||||
|
return findTheBrace(expr, findMatchingSlash(expr, offset) - 1);
|
||||||
|
}
|
||||||
|
if (expr.charAt(offset) == closeBrace) {
|
||||||
|
return findTheBrace(expr, findTheBrace(expr, offset - 1) - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return findTheBrace(expr, offset - 1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return findTheBrace(expr, offset - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Walk expr backwards from offset looking for the beginning of an
|
||||||
|
// expression suitable for passing to eval.
|
||||||
|
// There is no guarantee of correct javascript syntax between the return
|
||||||
|
// value and offset. This function is meant to take a string like
|
||||||
|
// "foo(Obj.We.Are.Completing" and allow you to extract "Obj.We.Are.Completing"
|
||||||
|
function getExpressionOffset(expr, offset) {
|
||||||
|
while (offset >= 0) {
|
||||||
|
let currChar = expr.charAt(offset);
|
||||||
|
|
||||||
|
if (isStopChar(currChar)){
|
||||||
|
return offset + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currChar.match(/[\)\]]/)) {
|
||||||
|
offset = findMatchingBrace(expr, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
--offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
return offset + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Things with non-word characters or that start with a number
|
||||||
|
// are not accessible via .foo notation and so aren't returned
|
||||||
|
function isValidPropertyName(w) {
|
||||||
|
return !(w.match(/\W/) || w.match(/^\d/));
|
||||||
|
}
|
||||||
|
|
||||||
|
// To get all properties (enumerable and not), we need to walk
|
||||||
|
// the prototype chain ourselves
|
||||||
|
function getAllProps(obj) {
|
||||||
|
if (obj === null || obj === undefined) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return Object.getOwnPropertyNames(obj).concat( getAllProps(Object.getPrototypeOf(obj)) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Given a string _expr_, returns all methods
|
||||||
|
// that can be accessed via '.' notation.
|
||||||
|
// e.g., expr="({ foo: null, bar: null, 4: null })" will
|
||||||
|
// return ["foo", "bar", ...] but the list will not include "4",
|
||||||
|
// since methods accessed with '.' notation must star with a letter or _.
|
||||||
|
function getPropertyNamesFromExpression(expr, commandHeader) {
|
||||||
|
if (commandHeader == null) {
|
||||||
|
commandHeader = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
let obj = {};
|
||||||
|
if (!isUnsafeExpression(expr)) {
|
||||||
|
try {
|
||||||
|
obj = eval(commandHeader + expr);
|
||||||
|
} catch (e) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
let propsUnique = {};
|
||||||
|
if (typeof obj === 'object'){
|
||||||
|
let allProps = getAllProps(obj);
|
||||||
|
// Get only things we are allowed to complete following a '.'
|
||||||
|
allProps = allProps.filter( isValidPropertyName );
|
||||||
|
|
||||||
|
// Make sure propsUnique contains one key for every
|
||||||
|
// property so we end up with a unique list of properties
|
||||||
|
allProps.map(function(p){ propsUnique[p] = null; });
|
||||||
|
}
|
||||||
|
return Object.keys(propsUnique).sort();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Given a list of words, returns the longest prefix they all have in common
|
||||||
|
function getCommonPrefix(words) {
|
||||||
|
let word = words[0];
|
||||||
|
for (let i = 0; i < word.length; i++) {
|
||||||
|
for (let w = 1; w < words.length; w++) {
|
||||||
|
if (words[w].charAt(i) != word.charAt(i))
|
||||||
|
return word.slice(0, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return word;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns true if there is reason to think that eval(str)
|
||||||
|
// will modify the global scope
|
||||||
|
function isUnsafeExpression(str) {
|
||||||
|
// Remove any blocks that are quoted or are in a regex
|
||||||
|
function removeLiterals(str) {
|
||||||
|
if (str.length == 0) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
let currChar = str.charAt(str.length - 1);
|
||||||
|
if (currChar == '"' || currChar == '\'') {
|
||||||
|
return removeLiterals(str.slice(0, findMatchingQuote(str, str.length - 1)));
|
||||||
|
} else if (currChar == '/') {
|
||||||
|
return removeLiterals(str.slice(0, findMatchingSlash(str, str.length - 1)));
|
||||||
|
}
|
||||||
|
|
||||||
|
return removeLiterals(str.slice(0, str.length - 1)) + currChar;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for any sort of assignment
|
||||||
|
// The strategy used is dumb: remove any quotes
|
||||||
|
// or regexs and comparison operators and see if there is an '=' character.
|
||||||
|
// If there is, it might be an unsafe assignment.
|
||||||
|
|
||||||
|
let prunedStr = removeLiterals(str);
|
||||||
|
prunedStr = prunedStr.replace(/[=!]==/g, ''); //replace === and !== with nothing
|
||||||
|
prunedStr = prunedStr.replace(/[=<>!]=/g, ''); //replace ==, <=, >=, != with nothing
|
||||||
|
|
||||||
|
if (prunedStr.match(/=/)) {
|
||||||
|
return true;
|
||||||
|
} else if (prunedStr.match(/;/)) {
|
||||||
|
// If we contain a semicolon not inside of a quote/regex, assume we're unsafe as well
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns a list of global keywords derived from str
|
||||||
|
function getDeclaredConstants(str) {
|
||||||
|
let ret = [];
|
||||||
|
str.split(';').forEach(function(s) {
|
||||||
|
let base, keyword;
|
||||||
|
let match = s.match(/const\s+(\w+)\s*=/);
|
||||||
|
if (match) {
|
||||||
|
[base, keyword] = match;
|
||||||
|
ret.push(keyword);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
259
js/misc/loginManager.js
Normal file
@ -0,0 +1,259 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
|
const GLib = imports.gi.GLib;
|
||||||
|
const Gio = imports.gi.Gio;
|
||||||
|
const Lang = imports.lang;
|
||||||
|
const Mainloop = imports.mainloop;
|
||||||
|
const Shell = imports.gi.Shell;
|
||||||
|
const UPowerGlib = imports.gi.UPowerGlib;
|
||||||
|
|
||||||
|
const SystemdLoginManagerIface = <interface name='org.freedesktop.login1.Manager'>
|
||||||
|
<method name='PowerOff'>
|
||||||
|
<arg type='b' direction='in'/>
|
||||||
|
</method>
|
||||||
|
<method name='Reboot'>
|
||||||
|
<arg type='b' direction='in'/>
|
||||||
|
</method>
|
||||||
|
<method name='Suspend'>
|
||||||
|
<arg type='b' direction='in'/>
|
||||||
|
</method>
|
||||||
|
<method name='Hibernate'>
|
||||||
|
<arg type='b' direction='in'/>
|
||||||
|
</method>
|
||||||
|
<method name='CanPowerOff'>
|
||||||
|
<arg type='s' direction='out'/>
|
||||||
|
</method>
|
||||||
|
<method name='CanReboot'>
|
||||||
|
<arg type='s' direction='out'/>
|
||||||
|
</method>
|
||||||
|
<method name='CanSuspend'>
|
||||||
|
<arg type='s' direction='out'/>
|
||||||
|
</method>
|
||||||
|
<method name='CanHibernate'>
|
||||||
|
<arg type='s' direction='out'/>
|
||||||
|
</method>
|
||||||
|
</interface>;
|
||||||
|
|
||||||
|
const SystemdLoginSessionIface = <interface name='org.freedesktop.login1.Session'>
|
||||||
|
<signal name='Lock' />
|
||||||
|
<signal name='Unlock' />
|
||||||
|
</interface>;
|
||||||
|
|
||||||
|
const SystemdLoginManager = Gio.DBusProxy.makeProxyWrapper(SystemdLoginManagerIface);
|
||||||
|
const SystemdLoginSession = Gio.DBusProxy.makeProxyWrapper(SystemdLoginSessionIface);
|
||||||
|
|
||||||
|
const ConsoleKitManagerIface = <interface name='org.freedesktop.ConsoleKit.Manager'>
|
||||||
|
<method name='CanRestart'>
|
||||||
|
<arg type='b' direction='out'/>
|
||||||
|
</method>
|
||||||
|
<method name='CanStop'>
|
||||||
|
<arg type='b' direction='out'/>
|
||||||
|
</method>
|
||||||
|
<method name='Restart' />
|
||||||
|
<method name='Stop' />
|
||||||
|
<method name='GetCurrentSession'>
|
||||||
|
<arg type='o' direction='out' />
|
||||||
|
</method>
|
||||||
|
</interface>;
|
||||||
|
|
||||||
|
const ConsoleKitSessionIface = <interface name='org.freedesktop.ConsoleKit.Session'>
|
||||||
|
<method name='IsActive'>
|
||||||
|
<arg type='b' direction='out' />
|
||||||
|
</method>
|
||||||
|
<signal name='ActiveChanged'>
|
||||||
|
<arg type='b' direction='out' />
|
||||||
|
</signal>
|
||||||
|
<signal name='Lock' />
|
||||||
|
<signal name='Unlock' />
|
||||||
|
</interface>;
|
||||||
|
|
||||||
|
const ConsoleKitSession = Gio.DBusProxy.makeProxyWrapper(ConsoleKitSessionIface);
|
||||||
|
const ConsoleKitManager = Gio.DBusProxy.makeProxyWrapper(ConsoleKitManagerIface);
|
||||||
|
|
||||||
|
function haveSystemd() {
|
||||||
|
return GLib.access("/sys/fs/cgroup/systemd", 0) >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
let _loginManager = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LoginManager:
|
||||||
|
* An abstraction over systemd/logind and ConsoleKit.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
function getLoginManager() {
|
||||||
|
if (_loginManager == null) {
|
||||||
|
if (haveSystemd())
|
||||||
|
_loginManager = new LoginManagerSystemd();
|
||||||
|
else
|
||||||
|
_loginManager = new LoginManagerConsoleKit();
|
||||||
|
}
|
||||||
|
|
||||||
|
return _loginManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
const LoginManagerSystemd = new Lang.Class({
|
||||||
|
Name: 'LoginManagerSystemd',
|
||||||
|
|
||||||
|
_init: function() {
|
||||||
|
this._proxy = new SystemdLoginManager(Gio.DBus.system,
|
||||||
|
'org.freedesktop.login1',
|
||||||
|
'/org/freedesktop/login1');
|
||||||
|
},
|
||||||
|
|
||||||
|
// Having this function is a bit of a hack since the Systemd and ConsoleKit
|
||||||
|
// session objects have different interfaces - but in both cases there are
|
||||||
|
// Lock/Unlock signals, and that's all we count upon at the moment.
|
||||||
|
getCurrentSessionProxy: function() {
|
||||||
|
if (!this._currentSession) {
|
||||||
|
this._currentSession = new SystemdLoginSession(Gio.DBus.system,
|
||||||
|
'org.freedesktop.login1',
|
||||||
|
'/org/freedesktop/login1/session/' +
|
||||||
|
GLib.getenv('XDG_SESSION_ID'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return this._currentSession;
|
||||||
|
},
|
||||||
|
|
||||||
|
get sessionActive() {
|
||||||
|
return Shell.session_is_active_for_systemd();
|
||||||
|
},
|
||||||
|
|
||||||
|
canPowerOff: function(asyncCallback) {
|
||||||
|
this._proxy.CanPowerOffRemote(function(result, error) {
|
||||||
|
if (error)
|
||||||
|
asyncCallback(false);
|
||||||
|
else
|
||||||
|
asyncCallback(result[0] != 'no');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
canReboot: function(asyncCallback) {
|
||||||
|
this._proxy.CanRebootRemote(function(result, error) {
|
||||||
|
if (error)
|
||||||
|
asyncCallback(false);
|
||||||
|
else
|
||||||
|
asyncCallback(result[0] != 'no');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
canSuspend: function(asyncCallback) {
|
||||||
|
this._proxy.CanSuspendRemote(function(result, error) {
|
||||||
|
if (error)
|
||||||
|
asyncCallback(false);
|
||||||
|
else
|
||||||
|
asyncCallback(result[0] != 'no');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
canHibernate: function(asyncCallback) {
|
||||||
|
this._proxy.CanSuspendRemote(function(result, error) {
|
||||||
|
if (error)
|
||||||
|
asyncCallback(false);
|
||||||
|
else
|
||||||
|
asyncCallback(result[0] != 'no');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
powerOff: function() {
|
||||||
|
this._proxy.PowerOffRemote(true);
|
||||||
|
},
|
||||||
|
|
||||||
|
reboot: function() {
|
||||||
|
this._proxy.RebootRemote(true);
|
||||||
|
},
|
||||||
|
|
||||||
|
suspend: function() {
|
||||||
|
this._proxy.SuspendRemote(true);
|
||||||
|
},
|
||||||
|
|
||||||
|
hibernate: function() {
|
||||||
|
this._proxy.HibernateRemote(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const LoginManagerConsoleKit = new Lang.Class({
|
||||||
|
Name: 'LoginManagerConsoleKit',
|
||||||
|
|
||||||
|
_init: function() {
|
||||||
|
this._proxy = new ConsoleKitManager(Gio.DBus.system,
|
||||||
|
'org.freedesktop.ConsoleKit',
|
||||||
|
'/org/freedesktop/ConsoleKit/Manager');
|
||||||
|
this._upClient = new UPowerGlib.Client();
|
||||||
|
},
|
||||||
|
|
||||||
|
// Having this function is a bit of a hack since the Systemd and ConsoleKit
|
||||||
|
// session objects have different interfaces - but in both cases there are
|
||||||
|
// Lock/Unlock signals, and that's all we count upon at the moment.
|
||||||
|
getCurrentSessionProxy: function() {
|
||||||
|
if (!this._currentSession) {
|
||||||
|
let [currentSessionId] = this._proxy.GetCurrentSessionSync();
|
||||||
|
this._currentSession = new ConsoleKitSession(Gio.DBus.system,
|
||||||
|
'org.freedesktop.ConsoleKit',
|
||||||
|
currentSessionId);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this._currentSession;
|
||||||
|
},
|
||||||
|
|
||||||
|
get sessionActive() {
|
||||||
|
if (this._sessionActive !== undefined)
|
||||||
|
return this._sessionActive;
|
||||||
|
|
||||||
|
let session = this.getCurrentSessionProxy();
|
||||||
|
session.connectSignal('ActiveChanged', Lang.bind(this, function(object, senderName, [isActive]) {
|
||||||
|
this._sessionActive = isActive;
|
||||||
|
}));
|
||||||
|
[this._sessionActive] = session.IsActiveSync();
|
||||||
|
|
||||||
|
return this._sessionActive;
|
||||||
|
},
|
||||||
|
|
||||||
|
canPowerOff: function(asyncCallback) {
|
||||||
|
this._proxy.CanStopRemote(function(result, error) {
|
||||||
|
if (error)
|
||||||
|
asyncCallback(false);
|
||||||
|
else
|
||||||
|
asyncCallback(result[0]);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
canReboot: function(asyncCallback) {
|
||||||
|
this._proxy.CanRestartRemote(function(result, error) {
|
||||||
|
if (error)
|
||||||
|
asyncCallback(false);
|
||||||
|
else
|
||||||
|
asyncCallback(result[0]);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
canSuspend: function(asyncCallback) {
|
||||||
|
Mainloop.idle_add(Lang.bind(this, function() {
|
||||||
|
asyncCallback(this._upClient.get_can_suspend());
|
||||||
|
return false;
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
|
||||||
|
canHibernate: function(asyncCallback) {
|
||||||
|
Mainloop.idle_add(Lang.bind(this, function() {
|
||||||
|
asyncCallback(this._upClient.get_can_hibernate());
|
||||||
|
return false;
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
|
||||||
|
powerOff: function() {
|
||||||
|
this._proxy.StopRemote();
|
||||||
|
},
|
||||||
|
|
||||||
|
reboot: function() {
|
||||||
|
this._proxy.RestartRemote();
|
||||||
|
},
|
||||||
|
|
||||||
|
suspend: function() {
|
||||||
|
this._upClient.suspend_sync(null);
|
||||||
|
},
|
||||||
|
|
||||||
|
hibernate: function() {
|
||||||
|
this._upClient.hibernate_sync(null);
|
||||||
|
}
|
||||||
|
});
|
@ -1,6 +1,6 @@
|
|||||||
// -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const DBus = imports.dbus;
|
const Gio = imports.gi.Gio;
|
||||||
const Lang = imports.lang;
|
const Lang = imports.lang;
|
||||||
const Shell = imports.gi.Shell;
|
const Shell = imports.gi.Shell;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
@ -8,63 +8,129 @@ const Signals = imports.signals;
|
|||||||
// The following are not the complete interfaces, just the methods we need
|
// The following are not the complete interfaces, just the methods we need
|
||||||
// (or may need in the future)
|
// (or may need in the future)
|
||||||
|
|
||||||
const ModemGsmNetworkInterface = {
|
const ModemGsmNetworkInterface = <interface name="org.freedesktop.ModemManager.Modem.Gsm.Network">
|
||||||
name: 'org.freedesktop.ModemManager.Modem.Gsm.Network',
|
<method name="GetRegistrationInfo">
|
||||||
methods: [
|
<arg type="(uss)" direction="out" />
|
||||||
{ name: 'GetRegistrationInfo', inSignature: '', outSignature: 'uss' },
|
</method>
|
||||||
{ name: 'GetSignalQuality', inSignature: '', outSignature: 'u' }
|
<method name="GetSignalQuality">
|
||||||
],
|
<arg type="u" direction="out" />
|
||||||
properties: [
|
</method>
|
||||||
{ name: 'AccessTechnology', signature: 'u', access: 'read' }
|
<property name="AccessTechnology" type="u" access="read" />
|
||||||
],
|
<signal name="SignalQuality">
|
||||||
signals: [
|
<arg type="u" direction="out" />
|
||||||
{ name: 'SignalQuality', inSignature: 'u' },
|
</signal>
|
||||||
{ name: 'RegistrationInfo', inSignature: 'uss' }
|
<signal name="RegistrationInfo">
|
||||||
]
|
<arg type="u" direction="out" />
|
||||||
};
|
<arg type="s" direction="out" />
|
||||||
const ModemGsmNetworkProxy = DBus.makeProxyClass(ModemGsmNetworkInterface);
|
<arg type="s" direction="out" />
|
||||||
|
</signal>
|
||||||
|
</interface>;
|
||||||
|
|
||||||
const ModemCdmaInterface = {
|
const ModemGsmNetworkProxy = Gio.DBusProxy.makeProxyWrapper(ModemGsmNetworkInterface);
|
||||||
name: 'org.freedesktop.ModemManager.Modem.Cdma',
|
|
||||||
methods: [
|
const ModemCdmaInterface = <interface name="org.freedesktop.ModemManager.Modem.Cdma">
|
||||||
{ name: 'GetSignalQuality', inSignature: '', outSignature: 'u' },
|
<method name="GetSignalQuality">
|
||||||
{ name: 'GetServingSystem', inSignature: '', outSignature: 'usu' }
|
<arg type="u" direction="out" />
|
||||||
],
|
</method>
|
||||||
signals: [
|
<method name="GetServingSystem">
|
||||||
{ name: 'SignalQuality', inSignature: 'u' }
|
<arg type="(usu)" direction="out" />
|
||||||
]
|
</method>
|
||||||
};
|
<signal name="SignalQuality">
|
||||||
const ModemCdmaProxy = DBus.makeProxyClass(ModemCdmaInterface);
|
<arg type="u" direction="out" />
|
||||||
|
</signal>
|
||||||
|
</interface>;
|
||||||
|
|
||||||
|
const ModemCdmaProxy = Gio.DBusProxy.makeProxyWrapper(ModemCdmaInterface);
|
||||||
|
|
||||||
let _providersTable;
|
let _providersTable;
|
||||||
function _getProvidersTable() {
|
function _getProvidersTable() {
|
||||||
if (_providersTable)
|
if (_providersTable)
|
||||||
return _providersTable;
|
return _providersTable;
|
||||||
let [providers, countryCodes] = Shell.mobile_providers_parse();
|
return _providersTable = Shell.mobile_providers_parse(null,null);
|
||||||
return _providersTable = providers;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ModemGsm() {
|
function findProviderForMCCMNC(table, needle) {
|
||||||
this._init.apply(this, arguments);
|
let needlemcc = needle.substring(0, 3);
|
||||||
|
let needlemnc = needle.substring(3, needle.length);
|
||||||
|
|
||||||
|
let name2, name3;
|
||||||
|
for (let iter in table) {
|
||||||
|
let country = table[iter];
|
||||||
|
let providers = country.get_providers();
|
||||||
|
|
||||||
|
// Search through each country's providers
|
||||||
|
for (let i = 0; i < providers.length; i++) {
|
||||||
|
let provider = providers[i];
|
||||||
|
|
||||||
|
// Search through MCC/MNC list
|
||||||
|
let list = provider.get_gsm_mcc_mnc();
|
||||||
|
for (let j = 0; j < list.length; j++) {
|
||||||
|
let mccmnc = list[j];
|
||||||
|
|
||||||
|
// Match both 2-digit and 3-digit MNC; prefer a
|
||||||
|
// 3-digit match if found, otherwise a 2-digit one.
|
||||||
|
if (mccmnc.mcc != needlemcc)
|
||||||
|
continue; // MCC was wrong
|
||||||
|
|
||||||
|
if (!name3 && needle.length == 6 && needlemnc == mccmnc.mnc)
|
||||||
|
name3 = provider.name;
|
||||||
|
|
||||||
|
if (!name2 && needlemnc.substring(0, 2) == mccmnc.mnc.substring(0, 2))
|
||||||
|
name2 = provider.name;
|
||||||
|
|
||||||
|
if (name2 && name3)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return name3 || name2 || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModemGsm.prototype = {
|
function findProviderForSid(table, sid) {
|
||||||
|
if (sid == 0)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
// Search through each country
|
||||||
|
for (let iter in table) {
|
||||||
|
let country = table[iter];
|
||||||
|
let providers = country.get_providers();
|
||||||
|
|
||||||
|
// Search through each country's providers
|
||||||
|
for (let i = 0; i < providers.length; i++) {
|
||||||
|
let provider = providers[i];
|
||||||
|
let cdma_sid = provider.get_cdma_sid();
|
||||||
|
|
||||||
|
// Search through CDMA SID list
|
||||||
|
for (let j = 0; j < cdma_sid.length; j++) {
|
||||||
|
if (cdma_sid[j] == sid)
|
||||||
|
return provider.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const ModemGsm = new Lang.Class({
|
||||||
|
Name: 'ModemGsm',
|
||||||
|
|
||||||
_init: function(path) {
|
_init: function(path) {
|
||||||
this._proxy = new ModemGsmNetworkProxy(DBus.system, 'org.freedesktop.ModemManager', path);
|
this._proxy = new ModemGsmNetworkProxy(Gio.DBus.system, 'org.freedesktop.ModemManager', path);
|
||||||
|
|
||||||
this.signal_quality = 0;
|
this.signal_quality = 0;
|
||||||
this.operator_name = null;
|
this.operator_name = null;
|
||||||
|
|
||||||
// Code is duplicated because the function have different signatures
|
// Code is duplicated because the function have different signatures
|
||||||
this._proxy.connect('SignalQuality', Lang.bind(this, function(proxy, quality) {
|
this._proxy.connectSignal('SignalQuality', Lang.bind(this, function(proxy, sender, [quality]) {
|
||||||
this.signal_quality = quality;
|
this.signal_quality = quality;
|
||||||
this.emit('notify::signal-quality');
|
this.emit('notify::signal-quality');
|
||||||
}));
|
}));
|
||||||
this._proxy.connect('RegistrationInfo', Lang.bind(this, function(proxy, status, code, name) {
|
this._proxy.connectSignal('RegistrationInfo', Lang.bind(this, function(proxy, sender, [status, code, name]) {
|
||||||
this.operator_name = this._findOperatorName(name, code);
|
this.operator_name = this._findOperatorName(name, code);
|
||||||
this.emit('notify::operator-name');
|
this.emit('notify::operator-name');
|
||||||
}));
|
}));
|
||||||
this._proxy.GetRegistrationInfoRemote(Lang.bind(this, function(result, err) {
|
this._proxy.GetRegistrationInfoRemote(Lang.bind(this, function([result], err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
log(err);
|
log(err);
|
||||||
return;
|
return;
|
||||||
@ -87,80 +153,43 @@ ModemGsm.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_findOperatorName: function(name, opCode) {
|
_findOperatorName: function(name, opCode) {
|
||||||
if (name.length != 0 && (name.length > 6 || name.length < 5)) {
|
if (name) {
|
||||||
// this looks like a valid name, i.e. not an MCCMNC (that some
|
if (name && name.length != 0 && (name.length > 6 || name.length < 5)) {
|
||||||
// devices return when not yet connected
|
// this looks like a valid name, i.e. not an MCCMNC (that some
|
||||||
return name;
|
// devices return when not yet connected
|
||||||
}
|
return name;
|
||||||
if (isNaN(parseInt(name))) {
|
}
|
||||||
// name is definitely not a MCCMNC, so it may be a name
|
if (isNaN(parseInt(name))) {
|
||||||
// after all; return that
|
// name is definitely not a MCCMNC, so it may be a name
|
||||||
return name;
|
// after all; return that
|
||||||
|
return name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let needle;
|
let needle;
|
||||||
if (name.length == 0 && opCode)
|
if ((name == null || name.length == 0) && opCode)
|
||||||
needle = opCode;
|
needle = opCode;
|
||||||
else if (name.length == 6 || name.length == 5)
|
else if (name.length == 6 || name.length == 5)
|
||||||
needle = name;
|
needle = name;
|
||||||
else // nothing to search
|
else // nothing to search
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return this._findProviderForMCCMNC(needle);
|
|
||||||
},
|
|
||||||
|
|
||||||
_findProviderForMCCMNC: function(needle) {
|
|
||||||
let table = _getProvidersTable();
|
let table = _getProvidersTable();
|
||||||
let needlemcc = needle.substring(0, 3);
|
return findProviderForMCCMNC(table, needle);
|
||||||
let needlemnc = needle.substring(3, needle.length);
|
|
||||||
|
|
||||||
let name2, name3;
|
|
||||||
for (let iter in table) {
|
|
||||||
let providers = table[iter];
|
|
||||||
|
|
||||||
// Search through each country's providers
|
|
||||||
for (let i = 0; i < providers.length; i++) {
|
|
||||||
let provider = providers[i];
|
|
||||||
|
|
||||||
// Search through MCC/MNC list
|
|
||||||
let list = provider.get_gsm_mcc_mnc();
|
|
||||||
for (let j = 0; j < list.length; j++) {
|
|
||||||
let mccmnc = list[j];
|
|
||||||
|
|
||||||
// Match both 2-digit and 3-digit MNC; prefer a
|
|
||||||
// 3-digit match if found, otherwise a 2-digit one.
|
|
||||||
if (mccmnc.mcc != needlemcc)
|
|
||||||
continue; // MCC was wrong
|
|
||||||
|
|
||||||
if (!name3 && needle.length == 6 && needlemnc == mccmnc.mnc)
|
|
||||||
name3 = provider.name;
|
|
||||||
|
|
||||||
if (!name2 && needlemnc.substring(0, 2) == mccmnc.mnc.substring(0, 2))
|
|
||||||
name2 = provider.name;
|
|
||||||
|
|
||||||
if (name2 && name3)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return name3 || name2 || null;
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
Signals.addSignalMethods(ModemGsm.prototype);
|
Signals.addSignalMethods(ModemGsm.prototype);
|
||||||
|
|
||||||
function ModemCdma() {
|
const ModemCdma = new Lang.Class({
|
||||||
this._init.apply(this, arguments);
|
Name: 'ModemCdma',
|
||||||
}
|
|
||||||
|
|
||||||
ModemCdma.prototype = {
|
|
||||||
_init: function(path) {
|
_init: function(path) {
|
||||||
this._proxy = new ModemCdmaProxy(DBus.system, 'org.freedesktop.ModemManager', path);
|
this._proxy = new ModemCdmaProxy(Gio.DBus.system, 'org.freedesktop.ModemManager', path);
|
||||||
|
|
||||||
this.signal_quality = 0;
|
this.signal_quality = 0;
|
||||||
this.operator_name = null;
|
this.operator_name = null;
|
||||||
this._proxy.connect('SignalQuality', Lang.bind(this, function(proxy, quality) {
|
this._proxy.connectSignal('SignalQuality', Lang.bind(this, function(proxy, sender, params) {
|
||||||
this.signal_quality = quality;
|
this.signal_quality = params[0];
|
||||||
this.emit('notify::signal-quality');
|
this.emit('notify::signal-quality');
|
||||||
|
|
||||||
// receiving this signal means the device got activated
|
// receiving this signal means the device got activated
|
||||||
@ -181,45 +210,20 @@ ModemCdma.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_refreshServingSystem: function() {
|
_refreshServingSystem: function() {
|
||||||
this._proxy.GetServingSystemRemote(Lang.bind(this, function(result, err) {
|
this._proxy.GetServingSystemRemote(Lang.bind(this, function([result], err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
// it will return an error if the device is not connected
|
// it will return an error if the device is not connected
|
||||||
this.operator_name = null;
|
this.operator_name = null;
|
||||||
} else {
|
} else {
|
||||||
let [bandClass, band, id] = result;
|
let [bandClass, band, id] = result;
|
||||||
if (name.length > 0)
|
if (name.length > 0) {
|
||||||
this.operator_name = this._findProviderForSid(id);
|
let table = _getProvidersTable();
|
||||||
else
|
this.operator_name = findProviderForSid(table, id);
|
||||||
|
} else
|
||||||
this.operator_name = null;
|
this.operator_name = null;
|
||||||
}
|
}
|
||||||
this.emit('notify::operator-name');
|
this.emit('notify::operator-name');
|
||||||
}));
|
}));
|
||||||
},
|
|
||||||
|
|
||||||
_findProviderForSid: function(sid) {
|
|
||||||
if (sid == 0)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
let table = _getProvidersTable();
|
|
||||||
|
|
||||||
// Search through each country
|
|
||||||
for (let iter in table) {
|
|
||||||
let providers = table[iter];
|
|
||||||
|
|
||||||
// Search through each country's providers
|
|
||||||
for (let i = 0; i < providers.length; i++) {
|
|
||||||
let provider = providers[i];
|
|
||||||
let cdma_sid = provider.get_cdma_sid();
|
|
||||||
|
|
||||||
// Search through CDMA SID list
|
|
||||||
for (let j = 0; j < cdma_sid.length; j++) {
|
|
||||||
if (cdma_sid[j] == sid)
|
|
||||||
return provider.name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
Signals.addSignalMethods(ModemCdma.prototype);
|
Signals.addSignalMethods(ModemCdma.prototype);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
// parse:
|
// parse:
|
||||||
// @params: caller-provided parameter object, or %null
|
// @params: caller-provided parameter object, or %null
|
||||||
|
@ -1,53 +0,0 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
|
||||||
|
|
||||||
const DBus = imports.dbus;
|
|
||||||
const Lang = imports.lang;
|
|
||||||
|
|
||||||
const ScreenSaverIface = {
|
|
||||||
name: 'org.gnome.ScreenSaver',
|
|
||||||
methods: [{ name: 'GetActive',
|
|
||||||
inSignature: '',
|
|
||||||
outSignature: 'b' },
|
|
||||||
{ name: 'Lock',
|
|
||||||
inSignature: '' },
|
|
||||||
{ name: 'SetActive',
|
|
||||||
inSignature: 'b' }],
|
|
||||||
signals: [{ name: 'ActiveChanged',
|
|
||||||
inSignature: 'b' }]
|
|
||||||
};
|
|
||||||
|
|
||||||
function ScreenSaverProxy() {
|
|
||||||
this._init();
|
|
||||||
}
|
|
||||||
|
|
||||||
ScreenSaverProxy.prototype = {
|
|
||||||
_init: function() {
|
|
||||||
DBus.session.proxifyObject(this,
|
|
||||||
'org.gnome.ScreenSaver',
|
|
||||||
'/org/gnome/ScreenSaver');
|
|
||||||
|
|
||||||
DBus.session.watch_name('org.gnome.ScreenSaver',
|
|
||||||
false, // do not launch a name-owner if none exists
|
|
||||||
Lang.bind(this, this._onSSAppeared),
|
|
||||||
Lang.bind(this, this._onSSVanished));
|
|
||||||
|
|
||||||
this.screenSaverActive = false;
|
|
||||||
this.connect('ActiveChanged',
|
|
||||||
Lang.bind(this, this._onActiveChanged));
|
|
||||||
},
|
|
||||||
|
|
||||||
_onSSAppeared: function(owner) {
|
|
||||||
this.GetActiveRemote(Lang.bind(this, function(isActive) {
|
|
||||||
this.screenSaverActive = isActive;
|
|
||||||
}))
|
|
||||||
},
|
|
||||||
|
|
||||||
_onSSVanished: function(oldOwner) {
|
|
||||||
this.screenSaverActive = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
_onActiveChanged: function(object, isActive) {
|
|
||||||
this.screenSaverActive = isActive;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
DBus.proxifyPrototype(ScreenSaverProxy.prototype, ScreenSaverIface);
|
|
112
js/misc/util.js
@ -1,9 +1,6 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const Gdk = imports.gi.Gdk;
|
|
||||||
const Gio = imports.gi.Gio;
|
|
||||||
const GLib = imports.gi.GLib;
|
const GLib = imports.gi.GLib;
|
||||||
const Shell = imports.gi.Shell;
|
|
||||||
|
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
|
|
||||||
@ -83,24 +80,33 @@ function spawnCommandLine(command_line) {
|
|||||||
// this will throw an error.
|
// this will throw an error.
|
||||||
function trySpawn(argv)
|
function trySpawn(argv)
|
||||||
{
|
{
|
||||||
|
var success, pid;
|
||||||
try {
|
try {
|
||||||
GLib.spawn_async(null, argv, null,
|
[success, pid] = GLib.spawn_async(null, argv, null,
|
||||||
GLib.SpawnFlags.SEARCH_PATH,
|
GLib.SpawnFlags.SEARCH_PATH | GLib.SpawnFlags.DO_NOT_REAP_CHILD,
|
||||||
null, null);
|
null);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.code == GLib.SpawnError.G_SPAWN_ERROR_NOENT) {
|
/* Rewrite the error in case of ENOENT */
|
||||||
err.message = _("Command not found");
|
if (err.matches(GLib.SpawnError, GLib.SpawnError.NOENT)) {
|
||||||
} else {
|
throw new GLib.SpawnError({ code: GLib.SpawnError.NOENT,
|
||||||
|
message: _("Command not found") });
|
||||||
|
} else if (err instanceof GLib.Error) {
|
||||||
// The exception from gjs contains an error string like:
|
// The exception from gjs contains an error string like:
|
||||||
// Error invoking GLib.spawn_command_line_async: Failed to
|
// Error invoking GLib.spawn_command_line_async: Failed to
|
||||||
// execute child process "foo" (No such file or directory)
|
// execute child process "foo" (No such file or directory)
|
||||||
// We are only interested in the part in the parentheses. (And
|
// We are only interested in the part in the parentheses. (And
|
||||||
// we can't pattern match the text, since it gets localized.)
|
// we can't pattern match the text, since it gets localized.)
|
||||||
err.message = err.message.replace(/.*\((.+)\)/, '$1');
|
let message = err.message.replace(/.*\((.+)\)/, '$1');
|
||||||
|
throw new (err.constructor)({ code: err.code,
|
||||||
|
message: message });
|
||||||
|
} else {
|
||||||
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw err;
|
|
||||||
}
|
}
|
||||||
|
// Dummy child watch; we don't want to double-fork internally
|
||||||
|
// because then we lose the parent-child relationship, which
|
||||||
|
// can break polkit. See https://bugzilla.redhat.com//show_bug.cgi?id=819275
|
||||||
|
GLib.child_watch_add(GLib.PRIORITY_DEFAULT, pid, function () {}, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// trySpawnCommandLine:
|
// trySpawnCommandLine:
|
||||||
@ -144,7 +150,7 @@ function killall(processName) {
|
|||||||
// whatever...
|
// whatever...
|
||||||
|
|
||||||
let argv = ['pkill', '-f', '^([^ ]*/)?' + processName + '($| )'];
|
let argv = ['pkill', '-f', '^([^ ]*/)?' + processName + '($| )'];
|
||||||
GLib.spawn_sync(null, argv, null, GLib.SpawnFlags.SEARCH_PATH, null, null);
|
GLib.spawn_sync(null, argv, null, GLib.SpawnFlags.SEARCH_PATH, null);
|
||||||
// It might be useful to return success/failure, but we'd need
|
// It might be useful to return success/failure, but we'd need
|
||||||
// a wrapper around WIFEXITED and WEXITSTATUS. Since none of
|
// a wrapper around WIFEXITED and WEXITSTATUS. Since none of
|
||||||
// the current callers care, we don't bother.
|
// the current callers care, we don't bother.
|
||||||
@ -232,3 +238,81 @@ function fixupPCIDescription(desc) {
|
|||||||
|
|
||||||
return out.join(' ');
|
return out.join(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// lowerBound:
|
||||||
|
// @array: an array or array-like object, already sorted
|
||||||
|
// according to @cmp
|
||||||
|
// @val: the value to add
|
||||||
|
// @cmp: a comparator (or undefined to compare as numbers)
|
||||||
|
//
|
||||||
|
// Returns the position of the first element that is not
|
||||||
|
// lower than @val, according to @cmp.
|
||||||
|
// That is, returns the first position at which it
|
||||||
|
// is possible to insert @val without violating the
|
||||||
|
// order.
|
||||||
|
// This is quite like an ordinary binary search, except
|
||||||
|
// that it doesn't stop at first element comparing equal.
|
||||||
|
|
||||||
|
function lowerBound(array, val, cmp) {
|
||||||
|
let min, max, mid, v;
|
||||||
|
cmp = cmp || function(a, b) { return a - b; };
|
||||||
|
|
||||||
|
if (array.length == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
min = 0; max = array.length;
|
||||||
|
while (min < (max - 1)) {
|
||||||
|
mid = Math.floor((min + max) / 2);
|
||||||
|
v = cmp(array[mid], val);
|
||||||
|
|
||||||
|
if (v < 0)
|
||||||
|
min = mid + 1;
|
||||||
|
else
|
||||||
|
max = mid;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (min == max || cmp(array[min], val) < 0) ? max : min;
|
||||||
|
}
|
||||||
|
|
||||||
|
// insertSorted:
|
||||||
|
// @array: an array sorted according to @cmp
|
||||||
|
// @val: a value to insert
|
||||||
|
// @cmp: the sorting function
|
||||||
|
//
|
||||||
|
// Inserts @val into @array, preserving the
|
||||||
|
// sorting invariants.
|
||||||
|
// Returns the position at which it was inserted
|
||||||
|
function insertSorted(array, val, cmp) {
|
||||||
|
let pos = lowerBound(array, val, cmp);
|
||||||
|
array.splice(pos, 0, val);
|
||||||
|
|
||||||
|
return pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wrapKeybinding:
|
||||||
|
*
|
||||||
|
* Wrap a keybinding handler so that
|
||||||
|
* it ignores an invocation if the shell is modal, but
|
||||||
|
* not when the overview is active, or when global
|
||||||
|
* keybindings are allowed by session mode.
|
||||||
|
* This function is only useful for keybindings installed
|
||||||
|
* with Meta.KeybindingFlags.HANDLE_WHEN_GRABBED
|
||||||
|
*/
|
||||||
|
function wrapKeybinding(handler, onlyInOverview) {
|
||||||
|
return function() {
|
||||||
|
let handle;
|
||||||
|
|
||||||
|
if (onlyInOverview) {
|
||||||
|
handle = Main.sessionMode.allowKeybindingsWhenModal ||
|
||||||
|
Main.modalCount == (Main.overview.visible ? 1 : 0);
|
||||||
|
} else {
|
||||||
|
handle = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (handle)
|
||||||
|
return handler.apply(this, arguments);
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
|
const System = imports.system;
|
||||||
|
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
const Scripting = imports.ui.scripting;
|
const Scripting = imports.ui.scripting;
|
||||||
@ -99,7 +101,7 @@ function run() {
|
|||||||
Main.overview.hide();
|
Main.overview.hide();
|
||||||
yield Scripting.waitLeisure();
|
yield Scripting.waitLeisure();
|
||||||
|
|
||||||
global.gc();
|
System.gc();
|
||||||
yield Scripting.sleep(1000);
|
yield Scripting.sleep(1000);
|
||||||
Scripting.collectStatistics();
|
Scripting.collectStatistics();
|
||||||
Scripting.scriptEvent('afterShowHide');
|
Scripting.scriptEvent('afterShowHide');
|
||||||
@ -113,10 +115,10 @@ function run() {
|
|||||||
|
|
||||||
for (let i = 0; i < 2; i++) {
|
for (let i = 0; i < 2; i++) {
|
||||||
Scripting.scriptEvent('applicationsShowStart');
|
Scripting.scriptEvent('applicationsShowStart');
|
||||||
Main.overview._viewSelector.switchTab('applications');
|
Main.overview._dash.showAppsButton.checked = true;
|
||||||
yield Scripting.waitLeisure();
|
yield Scripting.waitLeisure();
|
||||||
Scripting.scriptEvent('applicationsShowDone');
|
Scripting.scriptEvent('applicationsShowDone');
|
||||||
Main.overview._viewSelector.switchTab('windows');
|
Main.overview._dash.showAppsButton.checked = false;
|
||||||
yield Scripting.waitLeisure();
|
yield Scripting.waitLeisure();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
279
js/ui/altTab.js
@ -1,13 +1,15 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const Clutter = imports.gi.Clutter;
|
const Clutter = imports.gi.Clutter;
|
||||||
const Gdk = imports.gi.Gdk;
|
const Gdk = imports.gi.Gdk;
|
||||||
|
const Gtk = imports.gi.Gtk;
|
||||||
const Lang = imports.lang;
|
const Lang = imports.lang;
|
||||||
const Mainloop = imports.mainloop;
|
const Mainloop = imports.mainloop;
|
||||||
const Meta = imports.gi.Meta;
|
const Meta = imports.gi.Meta;
|
||||||
const Shell = imports.gi.Shell;
|
const Shell = imports.gi.Shell;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
const St = imports.gi.St;
|
const St = imports.gi.St;
|
||||||
|
const Atk = imports.gi.Atk;
|
||||||
|
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
const Tweener = imports.ui.tweener;
|
const Tweener = imports.ui.tweener;
|
||||||
@ -43,11 +45,9 @@ function primaryModifier(mask) {
|
|||||||
return primary;
|
return primary;
|
||||||
}
|
}
|
||||||
|
|
||||||
function AltTabPopup() {
|
const AltTabPopup = new Lang.Class({
|
||||||
this._init();
|
Name: 'AltTabPopup',
|
||||||
}
|
|
||||||
|
|
||||||
AltTabPopup.prototype = {
|
|
||||||
_init : function() {
|
_init : function() {
|
||||||
this.actor = new Shell.GenericContainer({ name: 'altTabPopup',
|
this.actor = new Shell.GenericContainer({ name: 'altTabPopup',
|
||||||
reactive: true,
|
reactive: true,
|
||||||
@ -127,22 +127,55 @@ AltTabPopup.prototype = {
|
|||||||
if (childBox.x2 > primary.x + primary.width - rightPadding)
|
if (childBox.x2 > primary.x + primary.width - rightPadding)
|
||||||
childBox.x2 = primary.x + primary.width - rightPadding;
|
childBox.x2 = primary.x + primary.width - rightPadding;
|
||||||
childBox.y1 = this._appSwitcher.actor.allocation.y2 + spacing;
|
childBox.y1 = this._appSwitcher.actor.allocation.y2 + spacing;
|
||||||
this._thumbnails.addClones(primary.height - bottomPadding - childBox.y1);
|
this._thumbnails.addClones(primary.y + primary.height - bottomPadding - childBox.y1);
|
||||||
let [childMinHeight, childNaturalHeight] = this._thumbnails.actor.get_preferred_height(-1);
|
let [childMinHeight, childNaturalHeight] = this._thumbnails.actor.get_preferred_height(-1);
|
||||||
childBox.y2 = childBox.y1 + childNaturalHeight;
|
childBox.y2 = childBox.y1 + childNaturalHeight;
|
||||||
this._thumbnails.actor.allocate(childBox, flags);
|
this._thumbnails.actor.allocate(childBox, flags);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
show : function(backward, binding, mask) {
|
_getAppLists: function() {
|
||||||
|
let tracker = Shell.WindowTracker.get_default();
|
||||||
let appSys = Shell.AppSystem.get_default();
|
let appSys = Shell.AppSystem.get_default();
|
||||||
let apps = appSys.get_running ();
|
let allApps = appSys.get_running ();
|
||||||
|
|
||||||
if (!apps.length)
|
let screen = global.screen;
|
||||||
|
let display = screen.get_display();
|
||||||
|
let windows = display.get_tab_list(Meta.TabList.NORMAL_ALL, screen,
|
||||||
|
screen.get_active_workspace());
|
||||||
|
|
||||||
|
// windows is only the windows on the current workspace. For
|
||||||
|
// each one, if it corresponds to an app we know, move that
|
||||||
|
// app from allApps to apps.
|
||||||
|
let apps = [];
|
||||||
|
for (let i = 0; i < windows.length && allApps.length != 0; i++) {
|
||||||
|
let app = tracker.get_window_app(windows[i]);
|
||||||
|
let index = allApps.indexOf(app);
|
||||||
|
if (index != -1) {
|
||||||
|
apps.push(app);
|
||||||
|
allApps.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now @apps is a list of apps on the current workspace, in
|
||||||
|
// standard Alt+Tab order (MRU except for minimized windows),
|
||||||
|
// and allApps is a list of apps that only appear on other
|
||||||
|
// workspaces, sorted by user_time, which is good enough.
|
||||||
|
return [apps, allApps];
|
||||||
|
},
|
||||||
|
|
||||||
|
show : function(backward, binding, mask) {
|
||||||
|
let [localApps, otherApps] = this._getAppLists();
|
||||||
|
|
||||||
|
if (localApps.length == 0 && otherApps.length == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!Main.pushModal(this.actor))
|
if (!Main.pushModal(this.actor)) {
|
||||||
return false;
|
// Probably someone else has a pointer grab, try again with keyboard only
|
||||||
|
if (!Main.pushModal(this.actor, global.get_current_time(), Meta.ModalOptions.POINTER_ALREADY_GRABBED)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
this._haveModal = true;
|
this._haveModal = true;
|
||||||
this._modifierMask = primaryModifier(mask);
|
this._modifierMask = primaryModifier(mask);
|
||||||
|
|
||||||
@ -152,7 +185,7 @@ AltTabPopup.prototype = {
|
|||||||
this.actor.connect('button-press-event', Lang.bind(this, this._clickedOutside));
|
this.actor.connect('button-press-event', Lang.bind(this, this._clickedOutside));
|
||||||
this.actor.connect('scroll-event', Lang.bind(this, this._onScroll));
|
this.actor.connect('scroll-event', Lang.bind(this, this._onScroll));
|
||||||
|
|
||||||
this._appSwitcher = new AppSwitcher(apps, this);
|
this._appSwitcher = new AppSwitcher(localApps, otherApps, this);
|
||||||
this.actor.add_actor(this._appSwitcher.actor);
|
this.actor.add_actor(this._appSwitcher.actor);
|
||||||
this._appSwitcher.connect('item-activated', Lang.bind(this, this._appActivated));
|
this._appSwitcher.connect('item-activated', Lang.bind(this, this._appActivated));
|
||||||
this._appSwitcher.connect('item-entered', Lang.bind(this, this._appEntered));
|
this._appSwitcher.connect('item-entered', Lang.bind(this, this._appEntered));
|
||||||
@ -166,7 +199,7 @@ AltTabPopup.prototype = {
|
|||||||
this.actor.get_allocation_box();
|
this.actor.get_allocation_box();
|
||||||
|
|
||||||
// Make the initial selection
|
// Make the initial selection
|
||||||
if (binding == 'switch_group') {
|
if (binding == 'internal-keybinding-switch-group') {
|
||||||
if (backward) {
|
if (backward) {
|
||||||
this._select(0, this._appIcons[0].cachedWindows.length - 1);
|
this._select(0, this._appIcons[0].cachedWindows.length - 1);
|
||||||
} else {
|
} else {
|
||||||
@ -175,9 +208,9 @@ AltTabPopup.prototype = {
|
|||||||
else
|
else
|
||||||
this._select(0, 0);
|
this._select(0, 0);
|
||||||
}
|
}
|
||||||
} else if (binding == 'switch_group_backward') {
|
} else if (binding == 'internal-keybinding-switch-group-backward') {
|
||||||
this._select(0, this._appIcons[0].cachedWindows.length - 1);
|
this._select(0, this._appIcons[0].cachedWindows.length - 1);
|
||||||
} else if (binding == 'switch_windows_backward') {
|
} else if (binding == 'internal-keybinding-switch-windows-backward') {
|
||||||
this._select(this._appIcons.length - 1);
|
this._select(this._appIcons.length - 1);
|
||||||
} else if (this._appIcons.length == 1) {
|
} else if (this._appIcons.length == 1) {
|
||||||
this._select(0);
|
this._select(0);
|
||||||
@ -233,7 +266,7 @@ AltTabPopup.prototype = {
|
|||||||
|
|
||||||
_keyPressEvent : function(actor, event) {
|
_keyPressEvent : function(actor, event) {
|
||||||
let keysym = event.get_key_symbol();
|
let keysym = event.get_key_symbol();
|
||||||
let event_state = Shell.get_event_state(event);
|
let event_state = event.get_state();
|
||||||
let backwards = event_state & Clutter.ModifierType.SHIFT_MASK;
|
let backwards = event_state & Clutter.ModifierType.SHIFT_MASK;
|
||||||
let action = global.display.get_keybinding_action(event.get_key_code(), event_state);
|
let action = global.display.get_keybinding_action(event.get_key_code(), event_state);
|
||||||
|
|
||||||
@ -486,6 +519,7 @@ AltTabPopup.prototype = {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
this._thumbnails = null;
|
this._thumbnails = null;
|
||||||
|
this._appSwitcher._items[this._currentApp].remove_accessible_state (Atk.StateType.EXPANDED);
|
||||||
},
|
},
|
||||||
|
|
||||||
_createThumbnails : function() {
|
_createThumbnails : function() {
|
||||||
@ -506,14 +540,14 @@ AltTabPopup.prototype = {
|
|||||||
transition: 'easeOutQuad',
|
transition: 'easeOutQuad',
|
||||||
onComplete: Lang.bind(this, function () { this.thumbnailsVisible = true; })
|
onComplete: Lang.bind(this, function () { this.thumbnailsVisible = true; })
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this._appSwitcher._items[this._currentApp].add_accessible_state (Atk.StateType.EXPANDED);
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
function SwitcherList(squareItems) {
|
const SwitcherList = new Lang.Class({
|
||||||
this._init(squareItems);
|
Name: 'SwitcherList',
|
||||||
}
|
|
||||||
|
|
||||||
SwitcherList.prototype = {
|
|
||||||
_init : function(squareItems) {
|
_init : function(squareItems) {
|
||||||
this.actor = new Shell.GenericContainer({ style_class: 'switcher-list' });
|
this.actor = new Shell.GenericContainer({ style_class: 'switcher-list' });
|
||||||
this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
|
this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
|
||||||
@ -532,14 +566,14 @@ SwitcherList.prototype = {
|
|||||||
this._list.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
|
this._list.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
|
||||||
this._list.connect('allocate', Lang.bind(this, this._allocate));
|
this._list.connect('allocate', Lang.bind(this, this._allocate));
|
||||||
|
|
||||||
this._clipBin = new St.Bin({style_class: 'cbin'});
|
this._scrollView = new St.ScrollView({ style_class: 'hfade',
|
||||||
this._clipBin.child = this._list;
|
enable_mouse_scrolling: false });
|
||||||
this.actor.add_actor(this._clipBin);
|
this._scrollView.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER);
|
||||||
|
|
||||||
this._leftGradient = new St.BoxLayout({style_class: 'thumbnail-scroll-gradient-left', vertical: true});
|
let scrollBox = new St.BoxLayout();
|
||||||
this._rightGradient = new St.BoxLayout({style_class: 'thumbnail-scroll-gradient-right', vertical: true});
|
scrollBox.add_actor(this._list);
|
||||||
this.actor.add_actor(this._leftGradient);
|
this._scrollView.add_actor(scrollBox);
|
||||||
this.actor.add_actor(this._rightGradient);
|
this.actor.add_actor(this._scrollView);
|
||||||
|
|
||||||
// Those arrows indicate whether scrolling in one direction is possible
|
// Those arrows indicate whether scrolling in one direction is possible
|
||||||
this._leftArrow = new St.DrawingArea({ style_class: 'switcher-arrow',
|
this._leftArrow = new St.DrawingArea({ style_class: 'switcher-arrow',
|
||||||
@ -570,21 +604,9 @@ SwitcherList.prototype = {
|
|||||||
let childBox = new Clutter.ActorBox();
|
let childBox = new Clutter.ActorBox();
|
||||||
let scrollable = this._minSize > box.x2 - box.x1;
|
let scrollable = this._minSize > box.x2 - box.x1;
|
||||||
|
|
||||||
this._clipBin.allocate(box, flags);
|
box.y1 -= this.actor.get_theme_node().get_padding(St.Side.TOP);
|
||||||
|
box.y2 += this.actor.get_theme_node().get_padding(St.Side.BOTTOM);
|
||||||
childBox.x1 = 0;
|
this._scrollView.allocate(box, flags);
|
||||||
childBox.y1 = 0;
|
|
||||||
childBox.x2 = this._leftGradient.width;
|
|
||||||
childBox.y2 = this.actor.height;
|
|
||||||
this._leftGradient.allocate(childBox, flags);
|
|
||||||
this._leftGradient.opacity = (this._scrollableLeft && scrollable) ? 255 : 0;
|
|
||||||
|
|
||||||
childBox.x1 = (this.actor.allocation.x2 - this.actor.allocation.x1) - this._rightGradient.width;
|
|
||||||
childBox.y1 = 0;
|
|
||||||
childBox.x2 = childBox.x1 + this._rightGradient.width;
|
|
||||||
childBox.y2 = this.actor.height;
|
|
||||||
this._rightGradient.allocate(childBox, flags);
|
|
||||||
this._rightGradient.opacity = (this._scrollableRight && scrollable) ? 255 : 0;
|
|
||||||
|
|
||||||
let arrowWidth = Math.floor(leftPadding / 3);
|
let arrowWidth = Math.floor(leftPadding / 3);
|
||||||
let arrowHeight = arrowWidth * 2;
|
let arrowHeight = arrowWidth * 2;
|
||||||
@ -593,7 +615,7 @@ SwitcherList.prototype = {
|
|||||||
childBox.x2 = childBox.x1 + arrowWidth;
|
childBox.x2 = childBox.x1 + arrowWidth;
|
||||||
childBox.y2 = childBox.y1 + arrowHeight;
|
childBox.y2 = childBox.y1 + arrowHeight;
|
||||||
this._leftArrow.allocate(childBox, flags);
|
this._leftArrow.allocate(childBox, flags);
|
||||||
this._leftArrow.opacity = this._leftGradient.opacity;
|
this._leftArrow.opacity = (this._scrollableLeft && scrollable) ? 255 : 0;
|
||||||
|
|
||||||
arrowWidth = Math.floor(rightPadding / 3);
|
arrowWidth = Math.floor(rightPadding / 3);
|
||||||
arrowHeight = arrowWidth * 2;
|
arrowHeight = arrowWidth * 2;
|
||||||
@ -602,7 +624,7 @@ SwitcherList.prototype = {
|
|||||||
childBox.x2 = childBox.x1 + arrowWidth;
|
childBox.x2 = childBox.x1 + arrowWidth;
|
||||||
childBox.y2 = childBox.y1 + arrowHeight;
|
childBox.y2 = childBox.y1 + arrowHeight;
|
||||||
this._rightArrow.allocate(childBox, flags);
|
this._rightArrow.allocate(childBox, flags);
|
||||||
this._rightArrow.opacity = this._rightGradient.opacity;
|
this._rightArrow.opacity = (this._scrollableRight && scrollable) ? 255 : 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
addItem : function(item, label) {
|
addItem : function(item, label) {
|
||||||
@ -619,6 +641,8 @@ SwitcherList.prototype = {
|
|||||||
bbox.label_actor = label;
|
bbox.label_actor = label;
|
||||||
|
|
||||||
this._items.push(bbox);
|
this._items.push(bbox);
|
||||||
|
|
||||||
|
return bbox;
|
||||||
},
|
},
|
||||||
|
|
||||||
_onItemClicked: function (index) {
|
_onItemClicked: function (index) {
|
||||||
@ -650,47 +674,66 @@ SwitcherList.prototype = {
|
|||||||
this._items[this._highlighted].add_style_pseudo_class('selected');
|
this._items[this._highlighted].add_style_pseudo_class('selected');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let adjustment = this._scrollView.hscroll.adjustment;
|
||||||
|
let [value, lower, upper, stepIncrement, pageIncrement, pageSize] = adjustment.get_values();
|
||||||
let [absItemX, absItemY] = this._items[index].get_transformed_position();
|
let [absItemX, absItemY] = this._items[index].get_transformed_position();
|
||||||
let [result, posX, posY] = this.actor.transform_stage_point(absItemX, 0);
|
let [result, posX, posY] = this.actor.transform_stage_point(absItemX, 0);
|
||||||
let [containerWidth, containerHeight] = this.actor.get_transformed_size();
|
let [containerWidth, containerHeight] = this.actor.get_transformed_size();
|
||||||
if (posX + this._items[index].get_width() > containerWidth)
|
if (posX + this._items[index].get_width() > containerWidth)
|
||||||
this._scrollToRight();
|
this._scrollToRight();
|
||||||
else if (posX < 0)
|
else if (this._items[index].allocation.x1 - value < 0)
|
||||||
this._scrollToLeft();
|
this._scrollToLeft();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_scrollToLeft : function() {
|
_scrollToLeft : function() {
|
||||||
let x = this._items[this._highlighted].allocation.x1;
|
let adjustment = this._scrollView.hscroll.adjustment;
|
||||||
|
let [value, lower, upper, stepIncrement, pageIncrement, pageSize] = adjustment.get_values();
|
||||||
|
|
||||||
|
let item = this._items[this._highlighted];
|
||||||
|
|
||||||
|
if (item.allocation.x1 < value)
|
||||||
|
value = Math.min(0, item.allocation.x1);
|
||||||
|
else if (item.allocation.x2 > value + pageSize)
|
||||||
|
value = Math.max(upper, item.allocation.x2 - pageSize);
|
||||||
|
|
||||||
this._scrollableRight = true;
|
this._scrollableRight = true;
|
||||||
Tweener.addTween(this._list, { anchor_x: x,
|
Tweener.addTween(adjustment,
|
||||||
time: POPUP_SCROLL_TIME,
|
{ value: value,
|
||||||
transition: 'easeOutQuad',
|
time: POPUP_SCROLL_TIME,
|
||||||
onComplete: Lang.bind(this, function () {
|
transition: 'easeOutQuad',
|
||||||
if (this._highlighted == 0) {
|
onComplete: Lang.bind(this, function () {
|
||||||
this._scrollableLeft = false;
|
if (this._highlighted == 0) {
|
||||||
this.actor.queue_relayout();
|
this._scrollableLeft = false;
|
||||||
}
|
this.actor.queue_relayout();
|
||||||
})
|
}
|
||||||
});
|
})
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
_scrollToRight : function() {
|
_scrollToRight : function() {
|
||||||
|
let adjustment = this._scrollView.hscroll.adjustment;
|
||||||
|
let [value, lower, upper, stepIncrement, pageIncrement, pageSize] = adjustment.get_values();
|
||||||
|
|
||||||
|
let item = this._items[this._highlighted];
|
||||||
|
|
||||||
|
if (item.allocation.x1 < value)
|
||||||
|
value = Math.max(0, item.allocation.x1);
|
||||||
|
else if (item.allocation.x2 > value + pageSize)
|
||||||
|
value = Math.min(upper, item.allocation.x2 - pageSize);
|
||||||
|
|
||||||
this._scrollableLeft = true;
|
this._scrollableLeft = true;
|
||||||
let monitor = Main.layoutManager.primaryMonitor;
|
Tweener.addTween(adjustment,
|
||||||
let padding = this.actor.get_theme_node().get_horizontal_padding();
|
{ value: value,
|
||||||
let parentPadding = this.actor.get_parent().get_theme_node().get_horizontal_padding();
|
time: POPUP_SCROLL_TIME,
|
||||||
let x = this._items[this._highlighted].allocation.x2 - monitor.width + padding + parentPadding;
|
transition: 'easeOutQuad',
|
||||||
Tweener.addTween(this._list, { anchor_x: x,
|
onComplete: Lang.bind(this, function () {
|
||||||
time: POPUP_SCROLL_TIME,
|
if (this._highlighted == this._items.length - 1) {
|
||||||
transition: 'easeOutQuad',
|
this._scrollableRight = false;
|
||||||
onComplete: Lang.bind(this, function () {
|
this.actor.queue_relayout();
|
||||||
if (this._highlighted == this._items.length - 1) {
|
}
|
||||||
this._scrollableRight = false;
|
})
|
||||||
this.actor.queue_relayout();
|
});
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_itemActivated: function(n) {
|
_itemActivated: function(n) {
|
||||||
@ -776,14 +819,6 @@ SwitcherList.prototype = {
|
|||||||
|
|
||||||
let primary = Main.layoutManager.primaryMonitor;
|
let primary = Main.layoutManager.primaryMonitor;
|
||||||
let parentRightPadding = this.actor.get_parent().get_theme_node().get_padding(St.Side.RIGHT);
|
let parentRightPadding = this.actor.get_parent().get_theme_node().get_padding(St.Side.RIGHT);
|
||||||
if (this.actor.allocation.x2 == primary.x + primary.width - parentRightPadding) {
|
|
||||||
if (this._squareItems)
|
|
||||||
childWidth = childHeight;
|
|
||||||
else {
|
|
||||||
let [childMin, childNat] = children[0].get_preferred_width(childHeight);
|
|
||||||
childWidth = childMin;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i = 0; i < children.length; i++) {
|
for (let i = 0; i < children.length; i++) {
|
||||||
if (this._items.indexOf(children[i]) != -1) {
|
if (this._items.indexOf(children[i]) != -1) {
|
||||||
@ -809,24 +844,14 @@ SwitcherList.prototype = {
|
|||||||
// we don't allocate it.
|
// we don't allocate it.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let leftPadding = this.actor.get_theme_node().get_padding(St.Side.LEFT);
|
|
||||||
let rightPadding = this.actor.get_theme_node().get_padding(St.Side.RIGHT);
|
|
||||||
let topPadding = this.actor.get_theme_node().get_padding(St.Side.TOP);
|
|
||||||
let bottomPadding = this.actor.get_theme_node().get_padding(St.Side.BOTTOM);
|
|
||||||
|
|
||||||
// Clip the area for scrolling
|
|
||||||
this._clipBin.set_clip(0, -topPadding, (this.actor.allocation.x2 - this.actor.allocation.x1) - leftPadding - rightPadding, this.actor.height + bottomPadding);
|
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
Signals.addSignalMethods(SwitcherList.prototype);
|
Signals.addSignalMethods(SwitcherList.prototype);
|
||||||
|
|
||||||
function AppIcon(app) {
|
const AppIcon = new Lang.Class({
|
||||||
this._init(app);
|
Name: 'AppIcon',
|
||||||
}
|
|
||||||
|
|
||||||
AppIcon.prototype = {
|
|
||||||
_init: function(app) {
|
_init: function(app) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.actor = new St.BoxLayout({ style_class: 'alt-tab-app',
|
this.actor = new St.BoxLayout({ style_class: 'alt-tab-app',
|
||||||
@ -844,35 +869,31 @@ AppIcon.prototype = {
|
|||||||
this._iconBin.set_size(size, size);
|
this._iconBin.set_size(size, size);
|
||||||
this._iconBin.child = this.icon;
|
this._iconBin.child = this.icon;
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
function AppSwitcher(apps, altTabPopup) {
|
const AppSwitcher = new Lang.Class({
|
||||||
this._init(apps, altTabPopup);
|
Name: 'AppSwitcher',
|
||||||
}
|
Extends: SwitcherList,
|
||||||
|
|
||||||
AppSwitcher.prototype = {
|
_init : function(localApps, otherApps, altTabPopup) {
|
||||||
__proto__ : SwitcherList.prototype,
|
this.parent(true);
|
||||||
|
|
||||||
_init : function(apps, altTabPopup) {
|
// Construct the AppIcons, add to the popup
|
||||||
SwitcherList.prototype._init.call(this, true);
|
|
||||||
|
|
||||||
// Construct the AppIcons, sort by time, add to the popup
|
|
||||||
let activeWorkspace = global.screen.get_active_workspace();
|
let activeWorkspace = global.screen.get_active_workspace();
|
||||||
let workspaceIcons = [];
|
let workspaceIcons = [];
|
||||||
let otherIcons = [];
|
let otherIcons = [];
|
||||||
for (let i = 0; i < apps.length; i++) {
|
for (let i = 0; i < localApps.length; i++) {
|
||||||
let appIcon = new AppIcon(apps[i]);
|
let appIcon = new AppIcon(localApps[i]);
|
||||||
// Cache the window list now; we don't handle dynamic changes here,
|
// Cache the window list now; we don't handle dynamic changes here,
|
||||||
// and we don't want to be continually retrieving it
|
// and we don't want to be continually retrieving it
|
||||||
appIcon.cachedWindows = appIcon.app.get_windows();
|
appIcon.cachedWindows = appIcon.app.get_windows();
|
||||||
if (this._hasWindowsOnWorkspace(appIcon, activeWorkspace))
|
workspaceIcons.push(appIcon);
|
||||||
workspaceIcons.push(appIcon);
|
}
|
||||||
else
|
for (let i = 0; i < otherApps.length; i++) {
|
||||||
otherIcons.push(appIcon);
|
let appIcon = new AppIcon(otherApps[i]);
|
||||||
|
appIcon.cachedWindows = appIcon.app.get_windows();
|
||||||
|
otherIcons.push(appIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
workspaceIcons.sort(Lang.bind(this, this._sortAppIcon));
|
|
||||||
otherIcons.sort(Lang.bind(this, this._sortAppIcon));
|
|
||||||
|
|
||||||
this.icons = [];
|
this.icons = [];
|
||||||
this._arrows = [];
|
this._arrows = [];
|
||||||
@ -934,7 +955,7 @@ AppSwitcher.prototype = {
|
|||||||
|
|
||||||
_allocate: function (actor, box, flags) {
|
_allocate: function (actor, box, flags) {
|
||||||
// Allocate the main list items
|
// Allocate the main list items
|
||||||
SwitcherList.prototype._allocate.call(this, actor, box, flags);
|
this.parent(actor, box, flags);
|
||||||
|
|
||||||
let arrowHeight = Math.floor(this.actor.get_theme_node().get_padding(St.Side.BOTTOM) / 3);
|
let arrowHeight = Math.floor(this.actor.get_theme_node().get_padding(St.Side.BOTTOM) / 3);
|
||||||
let arrowWidth = arrowHeight * 2;
|
let arrowWidth = arrowHeight * 2;
|
||||||
@ -989,7 +1010,7 @@ AppSwitcher.prototype = {
|
|||||||
this._arrows[this._curApp].remove_style_pseudo_class('highlighted');
|
this._arrows[this._curApp].remove_style_pseudo_class('highlighted');
|
||||||
}
|
}
|
||||||
|
|
||||||
SwitcherList.prototype.highlight.call(this, n, justOutline);
|
this.parent(n, justOutline);
|
||||||
this._curApp = n;
|
this._curApp = n;
|
||||||
|
|
||||||
if (this._curApp != -1) {
|
if (this._curApp != -1) {
|
||||||
@ -1002,7 +1023,7 @@ AppSwitcher.prototype = {
|
|||||||
|
|
||||||
_addIcon : function(appIcon) {
|
_addIcon : function(appIcon) {
|
||||||
this.icons.push(appIcon);
|
this.icons.push(appIcon);
|
||||||
this.addItem(appIcon.actor, appIcon.label);
|
let item = this.addItem(appIcon.actor, appIcon.label);
|
||||||
|
|
||||||
let n = this._arrows.length;
|
let n = this._arrows.length;
|
||||||
let arrow = new St.DrawingArea({ style_class: 'switcher-arrow' });
|
let arrow = new St.DrawingArea({ style_class: 'switcher-arrow' });
|
||||||
@ -1012,31 +1033,17 @@ AppSwitcher.prototype = {
|
|||||||
|
|
||||||
if (appIcon.cachedWindows.length == 1)
|
if (appIcon.cachedWindows.length == 1)
|
||||||
arrow.hide();
|
arrow.hide();
|
||||||
},
|
else
|
||||||
|
item.add_accessible_state (Atk.StateType.EXPANDABLE);
|
||||||
_hasWindowsOnWorkspace: function(appIcon, workspace) {
|
|
||||||
let windows = appIcon.cachedWindows;
|
|
||||||
for (let i = 0; i < windows.length; i++) {
|
|
||||||
if (windows[i].get_workspace() == workspace)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
_sortAppIcon : function(appIcon1, appIcon2) {
|
|
||||||
return appIcon1.app.compare(appIcon2.app);
|
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
function ThumbnailList(windows) {
|
const ThumbnailList = new Lang.Class({
|
||||||
this._init(windows);
|
Name: 'ThumbnailList',
|
||||||
}
|
Extends: SwitcherList,
|
||||||
|
|
||||||
ThumbnailList.prototype = {
|
|
||||||
__proto__ : SwitcherList.prototype,
|
|
||||||
|
|
||||||
_init : function(windows) {
|
_init : function(windows) {
|
||||||
SwitcherList.prototype._init.call(this);
|
this.parent(false);
|
||||||
|
|
||||||
let activeWorkspace = global.screen.get_active_workspace();
|
let activeWorkspace = global.screen.get_active_workspace();
|
||||||
|
|
||||||
@ -1114,7 +1121,7 @@ ThumbnailList.prototype = {
|
|||||||
// Make sure we only do this once
|
// Make sure we only do this once
|
||||||
this._thumbnailBins = new Array();
|
this._thumbnailBins = new Array();
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
function _drawArrow(area, side) {
|
function _drawArrow(area, side) {
|
||||||
let themeNode = area.get_theme_node();
|
let themeNode = area.get_theme_node();
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const Clutter = imports.gi.Clutter;
|
const Clutter = imports.gi.Clutter;
|
||||||
const GLib = imports.gi.GLib;
|
const GLib = imports.gi.GLib;
|
||||||
@ -10,6 +10,7 @@ const Signals = imports.signals;
|
|||||||
const Meta = imports.gi.Meta;
|
const Meta = imports.gi.Meta;
|
||||||
const St = imports.gi.St;
|
const St = imports.gi.St;
|
||||||
const Mainloop = imports.mainloop;
|
const Mainloop = imports.mainloop;
|
||||||
|
const Atk = imports.gi.Atk;
|
||||||
|
|
||||||
const AppFavorites = imports.ui.appFavorites;
|
const AppFavorites = imports.ui.appFavorites;
|
||||||
const DND = imports.ui.dnd;
|
const DND = imports.ui.dnd;
|
||||||
@ -21,22 +22,22 @@ const Search = imports.ui.search;
|
|||||||
const Tweener = imports.ui.tweener;
|
const Tweener = imports.ui.tweener;
|
||||||
const Workspace = imports.ui.workspace;
|
const Workspace = imports.ui.workspace;
|
||||||
const Params = imports.misc.params;
|
const Params = imports.misc.params;
|
||||||
|
const Util = imports.misc.util;
|
||||||
|
|
||||||
const MAX_APPLICATION_WORK_MILLIS = 75;
|
const MAX_APPLICATION_WORK_MILLIS = 75;
|
||||||
const MENU_POPUP_TIMEOUT = 600;
|
const MENU_POPUP_TIMEOUT = 600;
|
||||||
const SCROLL_TIME = 0.1;
|
const SCROLL_TIME = 0.1;
|
||||||
|
|
||||||
function AlphabeticalView() {
|
const AlphabeticalView = new Lang.Class({
|
||||||
this._init();
|
Name: 'AlphabeticalView',
|
||||||
}
|
|
||||||
|
|
||||||
AlphabeticalView.prototype = {
|
|
||||||
_init: function() {
|
_init: function() {
|
||||||
this._grid = new IconGrid.IconGrid({ xAlign: St.Align.START });
|
this._grid = new IconGrid.IconGrid({ xAlign: St.Align.START });
|
||||||
this._appSystem = Shell.AppSystem.get_default();
|
this._appSystem = Shell.AppSystem.get_default();
|
||||||
|
|
||||||
this._pendingAppLaterId = 0;
|
this._pendingAppLaterId = 0;
|
||||||
this._appIcons = {}; // desktop file id
|
this._appIcons = {}; // desktop file id
|
||||||
|
this._allApps = [];
|
||||||
|
|
||||||
let box = new St.BoxLayout({ vertical: true });
|
let box = new St.BoxLayout({ vertical: true });
|
||||||
box.add(this._grid.actor, { y_align: St.Align.START, expand: true });
|
box.add(this._grid.actor, { y_align: St.Align.START, expand: true });
|
||||||
@ -61,16 +62,22 @@ AlphabeticalView.prototype = {
|
|||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
_removeAll: function() {
|
removeAll: function() {
|
||||||
this._grid.removeAll();
|
this._grid.removeAll();
|
||||||
this._appIcons = {};
|
this._appIcons = {};
|
||||||
|
this._allApps = [];
|
||||||
},
|
},
|
||||||
|
|
||||||
_addApp: function(app) {
|
addApp: function(app) {
|
||||||
var id = app.get_id();
|
var id = app.get_id();
|
||||||
let appIcon = new AppWellIcon(app);
|
if (this._appIcons[id] !== undefined)
|
||||||
|
return;
|
||||||
|
|
||||||
this._grid.addItem(appIcon.actor);
|
let appIcon = new AppWellIcon(app);
|
||||||
|
let pos = Util.insertSorted(this._allApps, app, function(a, b) {
|
||||||
|
return a.compare_by_name(b);
|
||||||
|
});
|
||||||
|
this._grid.addItem(appIcon.actor, pos);
|
||||||
appIcon.actor.connect('key-focus-in', Lang.bind(this, this._ensureIconVisible));
|
appIcon.actor.connect('key-focus-in', Lang.bind(this, this._ensureIconVisible));
|
||||||
|
|
||||||
this._appIcons[id] = appIcon;
|
this._appIcons[id] = appIcon;
|
||||||
@ -121,22 +128,12 @@ AlphabeticalView.prototype = {
|
|||||||
icon.actor.visible = true;
|
icon.actor.visible = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
setAppList: function(apps) {
|
|
||||||
this._removeAll();
|
|
||||||
for (var i = 0; i < apps.length; i++) {
|
|
||||||
var app = apps[i];
|
|
||||||
this._addApp(app);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
function ViewByCategories() {
|
const ViewByCategories = new Lang.Class({
|
||||||
this._init();
|
Name: 'ViewByCategories',
|
||||||
}
|
|
||||||
|
|
||||||
ViewByCategories.prototype = {
|
|
||||||
_init: function() {
|
_init: function() {
|
||||||
this._appSystem = Shell.AppSystem.get_default();
|
this._appSystem = Shell.AppSystem.get_default();
|
||||||
this.actor = new St.BoxLayout({ style_class: 'all-app' });
|
this.actor = new St.BoxLayout({ style_class: 'all-app' });
|
||||||
@ -150,9 +147,10 @@ ViewByCategories.prototype = {
|
|||||||
// (used only before the actor is mapped the first time)
|
// (used only before the actor is mapped the first time)
|
||||||
this._currentCategory = -2;
|
this._currentCategory = -2;
|
||||||
this._categories = [];
|
this._categories = [];
|
||||||
this._apps = null;
|
|
||||||
|
|
||||||
this._categoryBox = new St.BoxLayout({ vertical: true, reactive: true });
|
this._categoryBox = new St.BoxLayout({ vertical: true,
|
||||||
|
reactive: true,
|
||||||
|
accessible_role: Atk.Role.LIST });
|
||||||
this._categoryScroll = new St.ScrollView({ x_fill: false,
|
this._categoryScroll = new St.ScrollView({ x_fill: false,
|
||||||
y_fill: false,
|
y_fill: false,
|
||||||
style_class: 'vfade' });
|
style_class: 'vfade' });
|
||||||
@ -205,27 +203,30 @@ ViewByCategories.prototype = {
|
|||||||
if (nextType == GMenu.TreeItemType.ENTRY) {
|
if (nextType == GMenu.TreeItemType.ENTRY) {
|
||||||
var entry = iter.get_entry();
|
var entry = iter.get_entry();
|
||||||
var app = this._appSystem.lookup_app_by_tree_entry(entry);
|
var app = this._appSystem.lookup_app_by_tree_entry(entry);
|
||||||
if (!entry.get_app_info().get_nodisplay())
|
if (!entry.get_app_info().get_nodisplay()) {
|
||||||
|
this._view.addApp(app);
|
||||||
appList.push(app);
|
appList.push(app);
|
||||||
|
}
|
||||||
} else if (nextType == GMenu.TreeItemType.DIRECTORY) {
|
} else if (nextType == GMenu.TreeItemType.DIRECTORY) {
|
||||||
if (!dir.get_is_nodisplay())
|
var itemDir = iter.get_directory();
|
||||||
this._loadCategory(iter.get_directory(), appList);
|
if (!itemDir.get_is_nodisplay())
|
||||||
|
this._loadCategory(itemDir, appList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_addCategory: function(name, index, dir, allApps) {
|
_addCategory: function(name, index, dir) {
|
||||||
let button = new St.Button({ label: GLib.markup_escape_text (name, -1),
|
let button = new St.Button({ label: GLib.markup_escape_text (name, -1),
|
||||||
style_class: 'app-filter',
|
style_class: 'app-filter',
|
||||||
x_align: St.Align.START,
|
x_align: St.Align.START,
|
||||||
can_focus: true });
|
can_focus: true ,
|
||||||
|
accessible_role: Atk.Role.LIST_ITEM });
|
||||||
button.connect('clicked', Lang.bind(this, function() {
|
button.connect('clicked', Lang.bind(this, function() {
|
||||||
this._selectCategory(index);
|
this._selectCategory(index);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
var apps;
|
var apps;
|
||||||
if (dir == null) {
|
if (dir == null) {
|
||||||
apps = allApps;
|
|
||||||
this._allCategoryButton = button;
|
this._allCategoryButton = button;
|
||||||
} else {
|
} else {
|
||||||
apps = [];
|
apps = [];
|
||||||
@ -239,20 +240,16 @@ ViewByCategories.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_removeAll: function() {
|
_removeAll: function() {
|
||||||
|
this._view.removeAll();
|
||||||
this._categories = [];
|
this._categories = [];
|
||||||
this._categoryBox.destroy_children();
|
this._categoryBox.destroy_all_children();
|
||||||
},
|
},
|
||||||
|
|
||||||
refresh: function() {
|
refresh: function() {
|
||||||
this._removeAll();
|
this._removeAll();
|
||||||
|
|
||||||
var allApps = Shell.AppSystem.get_default().get_all();
|
|
||||||
allApps.sort(function(a, b) {
|
|
||||||
return a.compare_by_name(b);
|
|
||||||
});
|
|
||||||
|
|
||||||
/* Translators: Filter to display all applications */
|
/* Translators: Filter to display all applications */
|
||||||
this._addCategory(_("All"), -1, null, allApps);
|
this._addCategory(_("All"), -1, null);
|
||||||
|
|
||||||
var tree = this._appSystem.get_tree();
|
var tree = this._appSystem.get_tree();
|
||||||
var root = tree.get_root_directory();
|
var root = tree.get_root_directory();
|
||||||
@ -270,7 +267,6 @@ ViewByCategories.prototype = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this._view.setAppList(allApps);
|
|
||||||
this._selectCategory(-1);
|
this._selectCategory(-1);
|
||||||
|
|
||||||
if (this._focusDummy) {
|
if (this._focusDummy) {
|
||||||
@ -281,16 +277,14 @@ ViewByCategories.prototype = {
|
|||||||
this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
|
this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
/* This class represents a display containing a collection of application items.
|
/* This class represents a display containing a collection of application items.
|
||||||
* The applications are sorted based on their name.
|
* The applications are sorted based on their name.
|
||||||
*/
|
*/
|
||||||
function AllAppDisplay() {
|
const AllAppDisplay = new Lang.Class({
|
||||||
this._init();
|
Name: 'AllAppDisplay',
|
||||||
}
|
|
||||||
|
|
||||||
AllAppDisplay.prototype = {
|
|
||||||
_init: function() {
|
_init: function() {
|
||||||
this._appSystem = Shell.AppSystem.get_default();
|
this._appSystem = Shell.AppSystem.get_default();
|
||||||
this._appSystem.connect('installed-changed', Lang.bind(this, function() {
|
this._appSystem.connect('installed-changed', Lang.bind(this, function() {
|
||||||
@ -306,35 +300,37 @@ AllAppDisplay.prototype = {
|
|||||||
_redisplay: function() {
|
_redisplay: function() {
|
||||||
this._appView.refresh();
|
this._appView.refresh();
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
function AppSearchProvider() {
|
const AppSearchProvider = new Lang.Class({
|
||||||
this._init();
|
Name: 'AppSearchProvider',
|
||||||
}
|
Extends: Search.SearchProvider,
|
||||||
|
|
||||||
AppSearchProvider.prototype = {
|
|
||||||
__proto__: Search.SearchProvider.prototype,
|
|
||||||
|
|
||||||
_init: function() {
|
_init: function() {
|
||||||
Search.SearchProvider.prototype._init.call(this, _("APPLICATIONS"));
|
this.parent(_("APPLICATIONS"));
|
||||||
this._appSys = Shell.AppSystem.get_default();
|
this._appSys = Shell.AppSystem.get_default();
|
||||||
},
|
},
|
||||||
|
|
||||||
getResultMeta: function(app) {
|
getResultMetas: function(apps, callback) {
|
||||||
return { 'id': app,
|
let metas = [];
|
||||||
'name': app.get_name(),
|
for (let i = 0; i < apps.length; i++) {
|
||||||
'createIcon': function(size) {
|
let app = apps[i];
|
||||||
return app.create_icon_texture(size);
|
metas.push({ 'id': app,
|
||||||
}
|
'name': app.get_name(),
|
||||||
};
|
'createIcon': function(size) {
|
||||||
|
return app.create_icon_texture(size);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
callback(metas);
|
||||||
},
|
},
|
||||||
|
|
||||||
getInitialResultSet: function(terms) {
|
getInitialResultSet: function(terms) {
|
||||||
return this._appSys.initial_search(terms);
|
this.searchSystem.pushResults(this, this._appSys.initial_search(terms));
|
||||||
},
|
},
|
||||||
|
|
||||||
getSubsearchResultSet: function(previousResults, terms) {
|
getSubsearchResultSet: function(previousResults, terms) {
|
||||||
return this._appSys.subsearch(previousResults, terms);
|
this.searchSystem.pushResults(this, this._appSys.subsearch(previousResults, terms));
|
||||||
},
|
},
|
||||||
|
|
||||||
activateResult: function(app, params) {
|
activateResult: function(app, params) {
|
||||||
@ -342,7 +338,7 @@ AppSearchProvider.prototype = {
|
|||||||
timestamp: 0 });
|
timestamp: 0 });
|
||||||
|
|
||||||
let event = Clutter.get_current_event();
|
let event = Clutter.get_current_event();
|
||||||
let modifiers = event ? Shell.get_event_state(event) : 0;
|
let modifiers = event ? event.get_state() : 0;
|
||||||
let openNewWindow = modifiers & Clutter.ModifierType.CONTROL_MASK;
|
let openNewWindow = modifiers & Clutter.ModifierType.CONTROL_MASK;
|
||||||
|
|
||||||
if (openNewWindow)
|
if (openNewWindow)
|
||||||
@ -364,36 +360,39 @@ AppSearchProvider.prototype = {
|
|||||||
let icon = new AppWellIcon(app);
|
let icon = new AppWellIcon(app);
|
||||||
return icon.actor;
|
return icon.actor;
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
function SettingsSearchProvider() {
|
const SettingsSearchProvider = new Lang.Class({
|
||||||
this._init();
|
Name: 'SettingsSearchProvider',
|
||||||
}
|
Extends: Search.SearchProvider,
|
||||||
|
|
||||||
SettingsSearchProvider.prototype = {
|
|
||||||
__proto__: Search.SearchProvider.prototype,
|
|
||||||
|
|
||||||
_init: function() {
|
_init: function() {
|
||||||
Search.SearchProvider.prototype._init.call(this, _("SETTINGS"));
|
this.parent(_("SETTINGS"));
|
||||||
|
|
||||||
this._appSys = Shell.AppSystem.get_default();
|
this._appSys = Shell.AppSystem.get_default();
|
||||||
this._gnomecc = this._appSys.lookup_app('gnome-control-center.desktop');
|
this._gnomecc = this._appSys.lookup_app('gnome-control-center.desktop');
|
||||||
},
|
},
|
||||||
|
|
||||||
getResultMeta: function(pref) {
|
getResultMetas: function(prefs, callback) {
|
||||||
return { 'id': pref,
|
let metas = [];
|
||||||
'name': pref.get_name(),
|
for (let i = 0; i < prefs.length; i++) {
|
||||||
'createIcon': function(size) {
|
let pref = prefs[i];
|
||||||
return pref.create_icon_texture(size);
|
metas.push({ 'id': pref,
|
||||||
}
|
'name': pref.get_name(),
|
||||||
};
|
'createIcon': function(size) {
|
||||||
|
return pref.create_icon_texture(size);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
callback(metas);
|
||||||
},
|
},
|
||||||
|
|
||||||
getInitialResultSet: function(terms) {
|
getInitialResultSet: function(terms) {
|
||||||
return this._appSys.search_settings(terms);
|
this.searchSystem.pushResults(this, this._appSys.search_settings(terms));
|
||||||
},
|
},
|
||||||
|
|
||||||
getSubsearchResultSet: function(previousResults, terms) {
|
getSubsearchResultSet: function(previousResults, terms) {
|
||||||
return this._appSys.search_settings(terms);
|
this.searchSystem.pushResults(this, this._appSys.search_settings(terms));
|
||||||
},
|
},
|
||||||
|
|
||||||
activateResult: function(pref, params) {
|
activateResult: function(pref, params) {
|
||||||
@ -412,35 +411,28 @@ SettingsSearchProvider.prototype = {
|
|||||||
let icon = new AppWellIcon(app);
|
let icon = new AppWellIcon(app);
|
||||||
return icon.actor;
|
return icon.actor;
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
function AppIcon(app, params) {
|
const AppIcon = new Lang.Class({
|
||||||
this._init(app, params);
|
Name: 'AppIcon',
|
||||||
}
|
Extends: IconGrid.BaseIcon,
|
||||||
|
|
||||||
AppIcon.prototype = {
|
|
||||||
__proto__: IconGrid.BaseIcon.prototype,
|
|
||||||
|
|
||||||
_init : function(app, params) {
|
_init : function(app, params) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
|
|
||||||
let label = this.app.get_name();
|
let label = this.app.get_name();
|
||||||
|
|
||||||
IconGrid.BaseIcon.prototype._init.call(this,
|
this.parent(label, params);
|
||||||
label,
|
|
||||||
params);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
createIcon: function(iconSize) {
|
createIcon: function(iconSize) {
|
||||||
return this.app.create_icon_texture(iconSize);
|
return this.app.create_icon_texture(iconSize);
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
function AppWellIcon(app, iconParams, onActivateOverride) {
|
const AppWellIcon = new Lang.Class({
|
||||||
this._init(app, iconParams, onActivateOverride);
|
Name: 'AppWellIcon',
|
||||||
}
|
|
||||||
|
|
||||||
AppWellIcon.prototype = {
|
|
||||||
_init : function(app, iconParams, onActivateOverride) {
|
_init : function(app, iconParams, onActivateOverride) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.actor = new St.Button({ style_class: 'app-well-app',
|
this.actor = new St.Button({ style_class: 'app-well-app',
|
||||||
@ -568,8 +560,9 @@ AppWellIcon.prototype = {
|
|||||||
this._menuManager.addMenu(this._menu);
|
this._menuManager.addMenu(this._menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.emit('menu-state-changed', true);
|
||||||
|
|
||||||
this.actor.set_hover(true);
|
this.actor.set_hover(true);
|
||||||
this.actor.show_tooltip();
|
|
||||||
this._menu.popup();
|
this._menu.popup();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -585,11 +578,12 @@ AppWellIcon.prototype = {
|
|||||||
|
|
||||||
_onMenuPoppedDown: function() {
|
_onMenuPoppedDown: function() {
|
||||||
this.actor.sync_hover();
|
this.actor.sync_hover();
|
||||||
|
this.emit('menu-state-changed', false);
|
||||||
},
|
},
|
||||||
|
|
||||||
_onActivate: function (event) {
|
_onActivate: function (event) {
|
||||||
this.emit('launching');
|
this.emit('launching');
|
||||||
let modifiers = Shell.get_event_state(event);
|
let modifiers = event.get_state();
|
||||||
|
|
||||||
if (this._onActivateOverride) {
|
if (this._onActivateOverride) {
|
||||||
this._onActivateOverride(event);
|
this._onActivateOverride(event);
|
||||||
@ -620,22 +614,19 @@ AppWellIcon.prototype = {
|
|||||||
getDragActorSource: function() {
|
getDragActorSource: function() {
|
||||||
return this.icon.icon;
|
return this.icon.icon;
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
Signals.addSignalMethods(AppWellIcon.prototype);
|
Signals.addSignalMethods(AppWellIcon.prototype);
|
||||||
|
|
||||||
function AppIconMenu(source) {
|
const AppIconMenu = new Lang.Class({
|
||||||
this._init(source);
|
Name: 'AppIconMenu',
|
||||||
}
|
Extends: PopupMenu.PopupMenu,
|
||||||
|
|
||||||
AppIconMenu.prototype = {
|
|
||||||
__proto__: PopupMenu.PopupMenu.prototype,
|
|
||||||
|
|
||||||
_init: function(source) {
|
_init: function(source) {
|
||||||
let side = St.Side.LEFT;
|
let side = St.Side.LEFT;
|
||||||
if (St.Widget.get_default_direction() == St.TextDirection.RTL)
|
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)
|
||||||
side = St.Side.RIGHT;
|
side = St.Side.RIGHT;
|
||||||
|
|
||||||
PopupMenu.PopupMenu.prototype._init.call(this, source.actor, 0.5, side);
|
this.parent(source.actor, 0.5, side);
|
||||||
|
|
||||||
// We want to keep the item hovered while the menu is up
|
// We want to keep the item hovered while the menu is up
|
||||||
this.blockSourceEvents = true;
|
this.blockSourceEvents = true;
|
||||||
@ -723,5 +714,5 @@ AppIconMenu.prototype = {
|
|||||||
}
|
}
|
||||||
this.close();
|
this.close();
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
Signals.addSignalMethods(AppIconMenu.prototype);
|
Signals.addSignalMethods(AppIconMenu.prototype);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const Shell = imports.gi.Shell;
|
const Shell = imports.gi.Shell;
|
||||||
const Lang = imports.lang;
|
const Lang = imports.lang;
|
||||||
@ -6,11 +6,9 @@ const Signals = imports.signals;
|
|||||||
|
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
|
|
||||||
function AppFavorites() {
|
const AppFavorites = new Lang.Class({
|
||||||
this._init();
|
Name: 'AppFavorites',
|
||||||
}
|
|
||||||
|
|
||||||
AppFavorites.prototype = {
|
|
||||||
FAVORITE_APPS_KEY: 'favorite-apps',
|
FAVORITE_APPS_KEY: 'favorite-apps',
|
||||||
|
|
||||||
_init: function() {
|
_init: function() {
|
||||||
@ -86,9 +84,12 @@ AppFavorites.prototype = {
|
|||||||
|
|
||||||
let app = Shell.AppSystem.get_default().lookup_app(appId);
|
let app = Shell.AppSystem.get_default().lookup_app(appId);
|
||||||
|
|
||||||
Main.overview.setMessage(_("%s has been added to your favorites.").format(app.get_name()), Lang.bind(this, function () {
|
Main.overview.setMessage(_("%s has been added to your favorites.").format(app.get_name()),
|
||||||
this._removeFavorite(appId);
|
{ forFeedback: true,
|
||||||
}));
|
undoCallback: Lang.bind(this, function () {
|
||||||
|
this._removeFavorite(appId);
|
||||||
|
})
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
addFavorite: function(appId) {
|
addFavorite: function(appId) {
|
||||||
@ -118,11 +119,13 @@ AppFavorites.prototype = {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Main.overview.setMessage(_("%s has been removed from your favorites.").format(app.get_name()),
|
Main.overview.setMessage(_("%s has been removed from your favorites.").format(app.get_name()),
|
||||||
Lang.bind(this, function () {
|
{ forFeedback: true,
|
||||||
this._addFavorite(appId, pos);
|
undoCallback: Lang.bind(this, function () {
|
||||||
}));
|
this._addFavorite(appId, pos);
|
||||||
|
})
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
Signals.addSignalMethods(AppFavorites.prototype);
|
Signals.addSignalMethods(AppFavorites.prototype);
|
||||||
|
|
||||||
var appFavoritesInstance = null;
|
var appFavoritesInstance = null;
|
||||||
|
@ -1,278 +0,0 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
|
||||||
|
|
||||||
const Lang = imports.lang;
|
|
||||||
const DBus = imports.dbus;
|
|
||||||
const Mainloop = imports.mainloop;
|
|
||||||
const Gio = imports.gi.Gio;
|
|
||||||
const Params = imports.misc.params;
|
|
||||||
|
|
||||||
const Main = imports.ui.main;
|
|
||||||
const ShellMountOperation = imports.ui.shellMountOperation;
|
|
||||||
const ScreenSaver = imports.misc.screenSaver;
|
|
||||||
|
|
||||||
// GSettings keys
|
|
||||||
const SETTINGS_SCHEMA = 'org.gnome.desktop.media-handling';
|
|
||||||
const SETTING_ENABLE_AUTOMOUNT = 'automount';
|
|
||||||
|
|
||||||
const AUTORUN_EXPIRE_TIMEOUT_SECS = 10;
|
|
||||||
|
|
||||||
const ConsoleKitSessionIface = {
|
|
||||||
name: 'org.freedesktop.ConsoleKit.Session',
|
|
||||||
methods: [{ name: 'IsActive',
|
|
||||||
inSignature: '',
|
|
||||||
outSignature: 'b' }],
|
|
||||||
signals: [{ name: 'ActiveChanged',
|
|
||||||
inSignature: 'b' }]
|
|
||||||
};
|
|
||||||
|
|
||||||
const ConsoleKitSessionProxy = DBus.makeProxyClass(ConsoleKitSessionIface);
|
|
||||||
|
|
||||||
const ConsoleKitManagerIface = {
|
|
||||||
name: 'org.freedesktop.ConsoleKit.Manager',
|
|
||||||
methods: [{ name: 'GetCurrentSession',
|
|
||||||
inSignature: '',
|
|
||||||
outSignature: 'o' }]
|
|
||||||
};
|
|
||||||
|
|
||||||
function ConsoleKitManager() {
|
|
||||||
this._init();
|
|
||||||
};
|
|
||||||
|
|
||||||
ConsoleKitManager.prototype = {
|
|
||||||
_init: function() {
|
|
||||||
this.sessionActive = true;
|
|
||||||
|
|
||||||
DBus.system.proxifyObject(this,
|
|
||||||
'org.freedesktop.ConsoleKit',
|
|
||||||
'/org/freedesktop/ConsoleKit/Manager');
|
|
||||||
|
|
||||||
DBus.system.watch_name('org.freedesktop.ConsoleKit',
|
|
||||||
false, // do not launch a name-owner if none exists
|
|
||||||
Lang.bind(this, this._onManagerAppeared),
|
|
||||||
Lang.bind(this, this._onManagerVanished));
|
|
||||||
},
|
|
||||||
|
|
||||||
_onManagerAppeared: function(owner) {
|
|
||||||
this.GetCurrentSessionRemote(Lang.bind(this, this._onCurrentSession));
|
|
||||||
},
|
|
||||||
|
|
||||||
_onManagerVanished: function(oldOwner) {
|
|
||||||
this.sessionActive = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
_onCurrentSession: function(session) {
|
|
||||||
this._ckSession = new ConsoleKitSessionProxy(DBus.system, 'org.freedesktop.ConsoleKit', session);
|
|
||||||
|
|
||||||
this._ckSession.connect
|
|
||||||
('ActiveChanged', Lang.bind(this, function(object, isActive) {
|
|
||||||
this.sessionActive = isActive;
|
|
||||||
}));
|
|
||||||
this._ckSession.IsActiveRemote(Lang.bind(this, function(isActive) {
|
|
||||||
this.sessionActive = isActive;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
DBus.proxifyPrototype(ConsoleKitManager.prototype, ConsoleKitManagerIface);
|
|
||||||
|
|
||||||
function AutomountManager() {
|
|
||||||
this._init();
|
|
||||||
}
|
|
||||||
|
|
||||||
AutomountManager.prototype = {
|
|
||||||
_init: function() {
|
|
||||||
this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA });
|
|
||||||
this._volumeQueue = [];
|
|
||||||
|
|
||||||
this.ckListener = new ConsoleKitManager();
|
|
||||||
|
|
||||||
this._ssProxy = new ScreenSaver.ScreenSaverProxy();
|
|
||||||
this._ssProxy.connect('ActiveChanged',
|
|
||||||
Lang.bind(this,
|
|
||||||
this._screenSaverActiveChanged));
|
|
||||||
|
|
||||||
this._volumeMonitor = Gio.VolumeMonitor.get();
|
|
||||||
|
|
||||||
this._volumeMonitor.connect('volume-added',
|
|
||||||
Lang.bind(this,
|
|
||||||
this._onVolumeAdded));
|
|
||||||
this._volumeMonitor.connect('volume-removed',
|
|
||||||
Lang.bind(this,
|
|
||||||
this._onVolumeRemoved));
|
|
||||||
this._volumeMonitor.connect('drive-connected',
|
|
||||||
Lang.bind(this,
|
|
||||||
this._onDriveConnected));
|
|
||||||
this._volumeMonitor.connect('drive-disconnected',
|
|
||||||
Lang.bind(this,
|
|
||||||
this._onDriveDisconnected));
|
|
||||||
this._volumeMonitor.connect('drive-eject-button',
|
|
||||||
Lang.bind(this,
|
|
||||||
this._onDriveEjectButton));
|
|
||||||
|
|
||||||
Mainloop.idle_add(Lang.bind(this, this._startupMountAll));
|
|
||||||
},
|
|
||||||
|
|
||||||
_screenSaverActiveChanged: function(object, isActive) {
|
|
||||||
if (!isActive) {
|
|
||||||
this._volumeQueue.forEach(Lang.bind(this, function(volume) {
|
|
||||||
this._checkAndMountVolume(volume);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
// clear the queue anyway
|
|
||||||
this._volumeQueue = [];
|
|
||||||
},
|
|
||||||
|
|
||||||
_startupMountAll: function() {
|
|
||||||
let volumes = this._volumeMonitor.get_volumes();
|
|
||||||
volumes.forEach(Lang.bind(this, function(volume) {
|
|
||||||
this._checkAndMountVolume(volume, { checkSession: false,
|
|
||||||
useMountOp: false });
|
|
||||||
}));
|
|
||||||
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
_onDriveConnected: function() {
|
|
||||||
// if we're not in the current ConsoleKit session,
|
|
||||||
// or screensaver is active, don't play sounds
|
|
||||||
if (!this.ckListener.sessionActive)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (this._ssProxy.screenSaverActive)
|
|
||||||
return;
|
|
||||||
|
|
||||||
global.play_theme_sound(0, 'device-added-media');
|
|
||||||
},
|
|
||||||
|
|
||||||
_onDriveDisconnected: function() {
|
|
||||||
// if we're not in the current ConsoleKit session,
|
|
||||||
// or screensaver is active, don't play sounds
|
|
||||||
if (!this.ckListener.sessionActive)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (this._ssProxy.screenSaverActive)
|
|
||||||
return;
|
|
||||||
|
|
||||||
global.play_theme_sound(0, 'device-removed-media');
|
|
||||||
},
|
|
||||||
|
|
||||||
_onDriveEjectButton: function(monitor, drive) {
|
|
||||||
// TODO: this code path is not tested, as the GVfs volume monitor
|
|
||||||
// doesn't emit this signal just yet.
|
|
||||||
if (!this.ckListener.sessionActive)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// we force stop/eject in this case, so we don't have to pass a
|
|
||||||
// mount operation object
|
|
||||||
if (drive.can_stop()) {
|
|
||||||
drive.stop
|
|
||||||
(Gio.MountUnmountFlags.FORCE, null, null,
|
|
||||||
Lang.bind(this, function(drive, res) {
|
|
||||||
try {
|
|
||||||
drive.stop_finish(res);
|
|
||||||
} catch (e) {
|
|
||||||
log("Unable to stop the drive after drive-eject-button " + e.toString());
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
} else if (drive.can_eject()) {
|
|
||||||
drive.eject_with_operation
|
|
||||||
(Gio.MountUnmountFlags.FORCE, null, null,
|
|
||||||
Lang.bind(this, function(drive, res) {
|
|
||||||
try {
|
|
||||||
drive.eject_with_operation_finish(res);
|
|
||||||
} catch (e) {
|
|
||||||
log("Unable to eject the drive after drive-eject-button " + e.toString());
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_onVolumeAdded: function(monitor, volume) {
|
|
||||||
this._checkAndMountVolume(volume);
|
|
||||||
},
|
|
||||||
|
|
||||||
_checkAndMountVolume: function(volume, params) {
|
|
||||||
params = Params.parse(params, { checkSession: true,
|
|
||||||
useMountOp: true });
|
|
||||||
|
|
||||||
if (params.checkSession) {
|
|
||||||
// if we're not in the current ConsoleKit session,
|
|
||||||
// don't attempt automount
|
|
||||||
if (!this.ckListener.sessionActive)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (this._ssProxy.screenSaverActive) {
|
|
||||||
if (this._volumeQueue.indexOf(volume) == -1)
|
|
||||||
this._volumeQueue.push(volume);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this._settings.get_boolean(SETTING_ENABLE_AUTOMOUNT) ||
|
|
||||||
!volume.should_automount() ||
|
|
||||||
!volume.can_mount()) {
|
|
||||||
// allow the autorun to run anyway; this can happen if the
|
|
||||||
// mount gets added programmatically later, even if
|
|
||||||
// should_automount() or can_mount() are false, like for
|
|
||||||
// blank optical media.
|
|
||||||
this._allowAutorun(volume);
|
|
||||||
this._allowAutorunExpire(volume);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (params.useMountOp) {
|
|
||||||
let operation = new ShellMountOperation.ShellMountOperation(volume);
|
|
||||||
this._mountVolume(volume, operation.mountOp);
|
|
||||||
} else {
|
|
||||||
this._mountVolume(volume, null);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_mountVolume: function(volume, operation) {
|
|
||||||
this._allowAutorun(volume);
|
|
||||||
volume.mount(0, operation, null,
|
|
||||||
Lang.bind(this, this._onVolumeMounted));
|
|
||||||
},
|
|
||||||
|
|
||||||
_onVolumeMounted: function(volume, res) {
|
|
||||||
this._allowAutorunExpire(volume);
|
|
||||||
|
|
||||||
try {
|
|
||||||
volume.mount_finish(res);
|
|
||||||
} catch (e) {
|
|
||||||
let string = e.toString();
|
|
||||||
|
|
||||||
// FIXME: needs proper error code handling instead of this
|
|
||||||
// See https://bugzilla.gnome.org/show_bug.cgi?id=591480
|
|
||||||
if (string.indexOf('No key available with this passphrase') != -1)
|
|
||||||
this._reaskPassword(volume);
|
|
||||||
else
|
|
||||||
log('Unable to mount volume ' + volume.get_name() + ': ' + string);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_onVolumeRemoved: function(monitor, volume) {
|
|
||||||
this._volumeQueue =
|
|
||||||
this._volumeQueue.filter(function(element) {
|
|
||||||
return (element != volume);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
_reaskPassword: function(volume) {
|
|
||||||
let operation = new ShellMountOperation.ShellMountOperation(volume, { reaskPassword: true });
|
|
||||||
this._mountVolume(volume, operation.mountOp);
|
|
||||||
},
|
|
||||||
|
|
||||||
_allowAutorun: function(volume) {
|
|
||||||
volume.allowAutorun = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
_allowAutorunExpire: function(volume) {
|
|
||||||
Mainloop.timeout_add_seconds(AUTORUN_EXPIRE_TIMEOUT_SECS, function() {
|
|
||||||
volume.allowAutorun = false;
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const Clutter = imports.gi.Clutter;
|
const Clutter = imports.gi.Clutter;
|
||||||
const Lang = imports.lang;
|
const Lang = imports.lang;
|
||||||
@ -9,6 +9,13 @@ const Shell = imports.gi.Shell;
|
|||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
const Tweener = imports.ui.tweener;
|
const Tweener = imports.ui.tweener;
|
||||||
|
|
||||||
|
const PopupAnimation = {
|
||||||
|
NONE: 0,
|
||||||
|
SLIDE: 1 << 0,
|
||||||
|
FADE: 1 << 1,
|
||||||
|
FULL: ~0,
|
||||||
|
};
|
||||||
|
|
||||||
const POPUP_ANIMATION_TIME = 0.15;
|
const POPUP_ANIMATION_TIME = 0.15;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -18,16 +25,18 @@ const POPUP_ANIMATION_TIME = 0.15;
|
|||||||
*
|
*
|
||||||
* An actor which displays a triangle "arrow" pointing to a given
|
* An actor which displays a triangle "arrow" pointing to a given
|
||||||
* side. The .bin property is a container in which content can be
|
* side. The .bin property is a container in which content can be
|
||||||
* placed. The arrow position may be controlled via setArrowOrigin().
|
* placed. The arrow position may be controlled via
|
||||||
|
* setArrowOrigin(). The arrow side might be temporarily flipped
|
||||||
|
* depending on the box size and source position to keep the box
|
||||||
|
* totally inside the monitor if possible.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function BoxPointer(side, binProperties) {
|
const BoxPointer = new Lang.Class({
|
||||||
this._init(side, binProperties);
|
Name: 'BoxPointer',
|
||||||
}
|
|
||||||
|
|
||||||
BoxPointer.prototype = {
|
|
||||||
_init: function(arrowSide, binProperties) {
|
_init: function(arrowSide, binProperties) {
|
||||||
this._arrowSide = arrowSide;
|
this._arrowSide = arrowSide;
|
||||||
|
this._userArrowSide = arrowSide;
|
||||||
this._arrowOrigin = 0;
|
this._arrowOrigin = 0;
|
||||||
this.actor = new St.Bin({ x_fill: true,
|
this.actor = new St.Bin({ x_fill: true,
|
||||||
y_fill: true });
|
y_fill: true });
|
||||||
@ -46,16 +55,37 @@ BoxPointer.prototype = {
|
|||||||
this._yOffset = 0;
|
this._yOffset = 0;
|
||||||
this._xPosition = 0;
|
this._xPosition = 0;
|
||||||
this._yPosition = 0;
|
this._yPosition = 0;
|
||||||
|
this._sourceAlignment = 0.5;
|
||||||
|
this._capturedEventId = 0;
|
||||||
|
this._muteInput();
|
||||||
|
},
|
||||||
|
|
||||||
|
_muteInput: function() {
|
||||||
|
if (this._capturedEventId == 0)
|
||||||
|
this._capturedEventId = this.actor.connect('captured-event',
|
||||||
|
function() { return true; });
|
||||||
|
},
|
||||||
|
|
||||||
|
_unmuteInput: function() {
|
||||||
|
if (this._capturedEventId != 0) {
|
||||||
|
this.actor.disconnect(this._capturedEventId);
|
||||||
|
this._capturedEventId = 0;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
show: function(animate, onComplete) {
|
show: function(animate, onComplete) {
|
||||||
let themeNode = this.actor.get_theme_node();
|
let themeNode = this.actor.get_theme_node();
|
||||||
let rise = themeNode.get_length('-arrow-rise');
|
let rise = themeNode.get_length('-arrow-rise');
|
||||||
|
let animationTime = (animate & PopupAnimation.FULL) ? POPUP_ANIMATION_TIME : 0;
|
||||||
|
|
||||||
|
if (animate & PopupAnimation.FADE)
|
||||||
|
this.opacity = 0;
|
||||||
|
else
|
||||||
|
this.opacity = 255;
|
||||||
|
|
||||||
this.opacity = 0;
|
|
||||||
this.actor.show();
|
this.actor.show();
|
||||||
|
|
||||||
if (animate) {
|
if (animate & PopupAnimation.SLIDE) {
|
||||||
switch (this._arrowSide) {
|
switch (this._arrowSide) {
|
||||||
case St.Side.TOP:
|
case St.Side.TOP:
|
||||||
this.yOffset = -rise;
|
this.yOffset = -rise;
|
||||||
@ -75,9 +105,13 @@ BoxPointer.prototype = {
|
|||||||
Tweener.addTween(this, { opacity: 255,
|
Tweener.addTween(this, { opacity: 255,
|
||||||
xOffset: 0,
|
xOffset: 0,
|
||||||
yOffset: 0,
|
yOffset: 0,
|
||||||
transition: "linear",
|
transition: 'linear',
|
||||||
onComplete: onComplete,
|
onComplete: Lang.bind(this, function() {
|
||||||
time: POPUP_ANIMATION_TIME });
|
this._unmuteInput();
|
||||||
|
if (onComplete)
|
||||||
|
onComplete();
|
||||||
|
}),
|
||||||
|
time: animationTime });
|
||||||
},
|
},
|
||||||
|
|
||||||
hide: function(animate, onComplete) {
|
hide: function(animate, onComplete) {
|
||||||
@ -85,8 +119,10 @@ BoxPointer.prototype = {
|
|||||||
let yOffset = 0;
|
let yOffset = 0;
|
||||||
let themeNode = this.actor.get_theme_node();
|
let themeNode = this.actor.get_theme_node();
|
||||||
let rise = themeNode.get_length('-arrow-rise');
|
let rise = themeNode.get_length('-arrow-rise');
|
||||||
|
let fade = (animate & PopupAnimation.FADE);
|
||||||
|
let animationTime = (animate & PopupAnimation.FULL) ? POPUP_ANIMATION_TIME : 0;
|
||||||
|
|
||||||
if (animate) {
|
if (animate & PopupAnimation.SLIDE) {
|
||||||
switch (this._arrowSide) {
|
switch (this._arrowSide) {
|
||||||
case St.Side.TOP:
|
case St.Side.TOP:
|
||||||
yOffset = rise;
|
yOffset = rise;
|
||||||
@ -103,13 +139,17 @@ BoxPointer.prototype = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Tweener.addTween(this, { opacity: 0,
|
this._muteInput();
|
||||||
|
|
||||||
|
Tweener.removeTweens(this);
|
||||||
|
Tweener.addTween(this, { opacity: fade ? 0 : 255,
|
||||||
xOffset: xOffset,
|
xOffset: xOffset,
|
||||||
yOffset: yOffset,
|
yOffset: yOffset,
|
||||||
transition: "linear",
|
transition: 'linear',
|
||||||
time: POPUP_ANIMATION_TIME,
|
time: animationTime,
|
||||||
onComplete: Lang.bind(this, function () {
|
onComplete: Lang.bind(this, function () {
|
||||||
this.actor.hide();
|
this.actor.hide();
|
||||||
|
this.opacity = 0;
|
||||||
this.xOffset = 0;
|
this.xOffset = 0;
|
||||||
this.yOffset = 0;
|
this.yOffset = 0;
|
||||||
if (onComplete)
|
if (onComplete)
|
||||||
@ -179,8 +219,27 @@ BoxPointer.prototype = {
|
|||||||
}
|
}
|
||||||
this.bin.allocate(childBox, flags);
|
this.bin.allocate(childBox, flags);
|
||||||
|
|
||||||
if (this._sourceActor && this._sourceActor.mapped)
|
if (this._sourceActor && this._sourceActor.mapped) {
|
||||||
this._reposition(this._sourceActor, this._alignment);
|
this._reposition(this._sourceActor, this._arrowAlignment);
|
||||||
|
|
||||||
|
if (this._shouldFlip()) {
|
||||||
|
switch (this._arrowSide) {
|
||||||
|
case St.Side.TOP:
|
||||||
|
this._arrowSide = St.Side.BOTTOM;
|
||||||
|
break;
|
||||||
|
case St.Side.BOTTOM:
|
||||||
|
this._arrowSide = St.Side.TOP;
|
||||||
|
break;
|
||||||
|
case St.Side.LEFT:
|
||||||
|
this._arrowSide = St.Side.RIGHT;
|
||||||
|
break;
|
||||||
|
case St.Side.RIGHT:
|
||||||
|
this._arrowSide = St.Side.LEFT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this._reposition(this._sourceActor, this._arrowAlignment);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_drawBorder: function(area) {
|
_drawBorder: function(area) {
|
||||||
@ -194,7 +253,6 @@ BoxPointer.prototype = {
|
|||||||
let halfBorder = borderWidth / 2;
|
let halfBorder = borderWidth / 2;
|
||||||
let halfBase = Math.floor(base/2);
|
let halfBase = Math.floor(base/2);
|
||||||
|
|
||||||
let borderColor = themeNode.get_color('-arrow-border-color');
|
|
||||||
let backgroundColor = themeNode.get_color('-arrow-background-color');
|
let backgroundColor = themeNode.get_color('-arrow-background-color');
|
||||||
|
|
||||||
let [width, height] = area.get_surface_size();
|
let [width, height] = area.get_surface_size();
|
||||||
@ -205,7 +263,6 @@ BoxPointer.prototype = {
|
|||||||
boxWidth -= rise;
|
boxWidth -= rise;
|
||||||
}
|
}
|
||||||
let cr = area.get_context();
|
let cr = area.get_context();
|
||||||
Clutter.cairo_set_source_color(cr, borderColor);
|
|
||||||
|
|
||||||
// Translate so that box goes from 0,0 to boxWidth,boxHeight,
|
// Translate so that box goes from 0,0 to boxWidth,boxHeight,
|
||||||
// with the arrow poking out of that
|
// with the arrow poking out of that
|
||||||
@ -218,14 +275,51 @@ BoxPointer.prototype = {
|
|||||||
let [x1, y1] = [halfBorder, halfBorder];
|
let [x1, y1] = [halfBorder, halfBorder];
|
||||||
let [x2, y2] = [boxWidth - halfBorder, boxHeight - halfBorder];
|
let [x2, y2] = [boxWidth - halfBorder, boxHeight - halfBorder];
|
||||||
|
|
||||||
|
let skipTopLeft = false;
|
||||||
|
let skipTopRight = false;
|
||||||
|
let skipBottomLeft = false;
|
||||||
|
let skipBottomRight = false;
|
||||||
|
|
||||||
|
switch (this._arrowSide) {
|
||||||
|
case St.Side.TOP:
|
||||||
|
if (this._arrowOrigin == x1)
|
||||||
|
skipTopLeft = true;
|
||||||
|
else if (this._arrowOrigin == x2)
|
||||||
|
skipTopRight = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case St.Side.RIGHT:
|
||||||
|
if (this._arrowOrigin == y1)
|
||||||
|
skipTopRight = true;
|
||||||
|
else if (this._arrowOrigin == y2)
|
||||||
|
skipBottomRight = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case St.Side.BOTTOM:
|
||||||
|
if (this._arrowOrigin == x1)
|
||||||
|
skipBottomLeft = true;
|
||||||
|
else if (this._arrowOrigin == x2)
|
||||||
|
skipBottomRight = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case St.Side.LEFT:
|
||||||
|
if (this._arrowOrigin == y1)
|
||||||
|
skipTopLeft = true;
|
||||||
|
else if (this._arrowOrigin == y2)
|
||||||
|
skipBottomLeft = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
cr.moveTo(x1 + borderRadius, y1);
|
cr.moveTo(x1 + borderRadius, y1);
|
||||||
if (this._arrowSide == St.Side.TOP) {
|
if (this._arrowSide == St.Side.TOP) {
|
||||||
if (this._arrowOrigin < (x1 + (borderRadius + halfBase))) {
|
if (skipTopLeft) {
|
||||||
cr.lineTo(this._arrowOrigin, y1 - rise);
|
cr.moveTo(x1, y2 - borderRadius);
|
||||||
cr.lineTo(Math.max(x1 + borderRadius, this._arrowOrigin) + halfBase, y1);
|
cr.lineTo(x1, y1 - rise);
|
||||||
} else if (this._arrowOrigin > (x2 - (borderRadius + halfBase))) {
|
cr.lineTo(x1 + halfBase, y1);
|
||||||
cr.lineTo(Math.min(x2 - borderRadius, this._arrowOrigin) - halfBase, y1);
|
} else if (skipTopRight) {
|
||||||
cr.lineTo(this._arrowOrigin, y1 - rise);
|
cr.lineTo(x2 - halfBase, y1);
|
||||||
|
cr.lineTo(x2, y1 - rise);
|
||||||
|
cr.lineTo(x2, y1 + borderRadius);
|
||||||
} else {
|
} else {
|
||||||
cr.lineTo(this._arrowOrigin - halfBase, y1);
|
cr.lineTo(this._arrowOrigin - halfBase, y1);
|
||||||
cr.lineTo(this._arrowOrigin, y1 - rise);
|
cr.lineTo(this._arrowOrigin, y1 - rise);
|
||||||
@ -233,19 +327,20 @@ BoxPointer.prototype = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cr.lineTo(x2 - borderRadius, y1);
|
if (!skipTopRight) {
|
||||||
|
cr.lineTo(x2 - borderRadius, y1);
|
||||||
// top-right corner
|
cr.arc(x2 - borderRadius, y1 + borderRadius, borderRadius,
|
||||||
cr.arc(x2 - borderRadius, y1 + borderRadius, borderRadius,
|
3*Math.PI/2, Math.PI*2);
|
||||||
3*Math.PI/2, Math.PI*2);
|
}
|
||||||
|
|
||||||
if (this._arrowSide == St.Side.RIGHT) {
|
if (this._arrowSide == St.Side.RIGHT) {
|
||||||
if (this._arrowOrigin < (y1 + (borderRadius + halfBase))) {
|
if (skipTopRight) {
|
||||||
cr.lineTo(x2 + rise, this._arrowOrigin);
|
cr.lineTo(x2 + rise, y1);
|
||||||
cr.lineTo(x2, Math.max(y1 + borderRadius, this._arrowOrigin) + halfBase);
|
cr.lineTo(x2 + rise, y1 + halfBase);
|
||||||
} else if (this._arrowOrigin > (y2 - (borderRadius + halfBase))) {
|
} else if (skipBottomRight) {
|
||||||
cr.lineTo(x2, Math.min(y2 - borderRadius, this._arrowOrigin) - halfBase);
|
cr.lineTo(x2, y2 - halfBase);
|
||||||
cr.lineTo(x2 + rise, this._arrowOrigin);
|
cr.lineTo(x2 + rise, y2);
|
||||||
|
cr.lineTo(x2 - borderRadius, y2);
|
||||||
} else {
|
} else {
|
||||||
cr.lineTo(x2, this._arrowOrigin - halfBase);
|
cr.lineTo(x2, this._arrowOrigin - halfBase);
|
||||||
cr.lineTo(x2 + rise, this._arrowOrigin);
|
cr.lineTo(x2 + rise, this._arrowOrigin);
|
||||||
@ -253,19 +348,20 @@ BoxPointer.prototype = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cr.lineTo(x2, y2 - borderRadius);
|
if (!skipBottomRight) {
|
||||||
|
cr.lineTo(x2, y2 - borderRadius);
|
||||||
// bottom-right corner
|
cr.arc(x2 - borderRadius, y2 - borderRadius, borderRadius,
|
||||||
cr.arc(x2 - borderRadius, y2 - borderRadius, borderRadius,
|
0, Math.PI/2);
|
||||||
0, Math.PI/2);
|
}
|
||||||
|
|
||||||
if (this._arrowSide == St.Side.BOTTOM) {
|
if (this._arrowSide == St.Side.BOTTOM) {
|
||||||
if (this._arrowOrigin < (x1 + (borderRadius + halfBase))) {
|
if (skipBottomLeft) {
|
||||||
cr.lineTo(Math.max(x1 + borderRadius, this._arrowOrigin) + halfBase, y2);
|
cr.lineTo(x1 + halfBase, y2);
|
||||||
cr.lineTo(this._arrowOrigin, y2 + rise);
|
cr.lineTo(x1, y2 + rise);
|
||||||
} else if (this._arrowOrigin > (x2 - (borderRadius + halfBase))) {
|
cr.lineTo(x1, y2 - borderRadius);
|
||||||
cr.lineTo(this._arrowOrigin, y2 + rise);
|
} else if (skipBottomRight) {
|
||||||
cr.lineTo(Math.min(x2 - borderRadius, this._arrowOrigin) - halfBase, y2);
|
cr.lineTo(x2, y2 + rise);
|
||||||
|
cr.lineTo(x2 - halfBase, y2);
|
||||||
} else {
|
} else {
|
||||||
cr.lineTo(this._arrowOrigin + halfBase, y2);
|
cr.lineTo(this._arrowOrigin + halfBase, y2);
|
||||||
cr.lineTo(this._arrowOrigin, y2 + rise);
|
cr.lineTo(this._arrowOrigin, y2 + rise);
|
||||||
@ -273,19 +369,20 @@ BoxPointer.prototype = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cr.lineTo(x1 + borderRadius, y2);
|
if (!skipBottomLeft) {
|
||||||
|
cr.lineTo(x1 + borderRadius, y2);
|
||||||
// bottom-left corner
|
cr.arc(x1 + borderRadius, y2 - borderRadius, borderRadius,
|
||||||
cr.arc(x1 + borderRadius, y2 - borderRadius, borderRadius,
|
Math.PI/2, Math.PI);
|
||||||
Math.PI/2, Math.PI);
|
}
|
||||||
|
|
||||||
if (this._arrowSide == St.Side.LEFT) {
|
if (this._arrowSide == St.Side.LEFT) {
|
||||||
if (this._arrowOrigin < (y1 + (borderRadius + halfBase))) {
|
if (skipTopLeft) {
|
||||||
cr.lineTo(x1, Math.max(y1 + borderRadius, this._arrowOrigin) + halfBase);
|
cr.lineTo(x1, y1 + halfBase);
|
||||||
cr.lineTo(x1 - rise, this._arrowOrigin);
|
cr.lineTo(x1 - rise, y1);
|
||||||
} else if (this._arrowOrigin > (y2 - (borderRadius + halfBase))) {
|
cr.lineTo(x1 + borderRadius, y1);
|
||||||
cr.lineTo(x1 - rise, this._arrowOrigin);
|
} else if (skipBottomLeft) {
|
||||||
cr.lineTo(x1, Math.min(y2 - borderRadius, this._arrowOrigin) - halfBase);
|
cr.lineTo(x1 - rise, y2)
|
||||||
|
cr.lineTo(x1 - rise, y2 - halfBase);
|
||||||
} else {
|
} else {
|
||||||
cr.lineTo(x1, this._arrowOrigin + halfBase);
|
cr.lineTo(x1, this._arrowOrigin + halfBase);
|
||||||
cr.lineTo(x1 - rise, this._arrowOrigin);
|
cr.lineTo(x1 - rise, this._arrowOrigin);
|
||||||
@ -293,52 +390,66 @@ BoxPointer.prototype = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cr.lineTo(x1, y1 + borderRadius);
|
if (!skipTopLeft) {
|
||||||
|
cr.lineTo(x1, y1 + borderRadius);
|
||||||
// top-left corner
|
cr.arc(x1 + borderRadius, y1 + borderRadius, borderRadius,
|
||||||
cr.arc(x1 + borderRadius, y1 + borderRadius, borderRadius,
|
Math.PI, 3*Math.PI/2);
|
||||||
Math.PI, 3*Math.PI/2);
|
}
|
||||||
|
|
||||||
Clutter.cairo_set_source_color(cr, backgroundColor);
|
Clutter.cairo_set_source_color(cr, backgroundColor);
|
||||||
cr.fillPreserve();
|
cr.fillPreserve();
|
||||||
Clutter.cairo_set_source_color(cr, borderColor);
|
|
||||||
cr.setLineWidth(borderWidth);
|
if (borderWidth > 0) {
|
||||||
cr.stroke();
|
let borderColor = themeNode.get_color('-arrow-border-color');
|
||||||
|
Clutter.cairo_set_source_color(cr, borderColor);
|
||||||
|
cr.setLineWidth(borderWidth);
|
||||||
|
cr.stroke();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
setPosition: function(sourceActor, alignment) {
|
setPosition: function(sourceActor, alignment) {
|
||||||
|
this._arrowSide = this._userArrowSide;
|
||||||
|
|
||||||
// We need to show it now to force an allocation,
|
// We need to show it now to force an allocation,
|
||||||
// so that we can query the correct size.
|
// so that we can query the correct size.
|
||||||
this.actor.show();
|
this.actor.show();
|
||||||
|
|
||||||
this._sourceActor = sourceActor;
|
this._sourceActor = sourceActor;
|
||||||
this._alignment = alignment;
|
this._arrowAlignment = alignment;
|
||||||
|
|
||||||
this._reposition(sourceActor, alignment);
|
this._reposition(sourceActor, alignment);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setSourceAlignment: function(alignment) {
|
||||||
|
this._sourceAlignment = alignment;
|
||||||
|
|
||||||
|
if (!this._sourceActor)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.setPosition(this._sourceActor, this._arrowAlignment);
|
||||||
|
},
|
||||||
|
|
||||||
_reposition: function(sourceActor, alignment) {
|
_reposition: function(sourceActor, alignment) {
|
||||||
// Position correctly relative to the sourceActor
|
// Position correctly relative to the sourceActor
|
||||||
let sourceNode = sourceActor.get_theme_node();
|
let sourceNode = sourceActor.get_theme_node();
|
||||||
let sourceContentBox = sourceNode.get_content_box(sourceActor.get_allocation_box());
|
let sourceContentBox = sourceNode.get_content_box(sourceActor.get_allocation_box());
|
||||||
let sourceAllocation = Shell.util_get_transformed_allocation(sourceActor);
|
let sourceAllocation = Shell.util_get_transformed_allocation(sourceActor);
|
||||||
let sourceCenterX = sourceAllocation.x1 + sourceContentBox.x1 + (sourceContentBox.x2 - sourceContentBox.x1) / 2;
|
let sourceCenterX = sourceAllocation.x1 + sourceContentBox.x1 + (sourceContentBox.x2 - sourceContentBox.x1) * this._sourceAlignment;
|
||||||
let sourceCenterY = sourceAllocation.y1 + sourceContentBox.y1 + (sourceContentBox.y2 - sourceContentBox.y1) / 2;
|
let sourceCenterY = sourceAllocation.y1 + sourceContentBox.y1 + (sourceContentBox.y2 - sourceContentBox.y1) * this._sourceAlignment;
|
||||||
let [minWidth, minHeight, natWidth, natHeight] = this.actor.get_preferred_size();
|
let [minWidth, minHeight, natWidth, natHeight] = this.actor.get_preferred_size();
|
||||||
|
|
||||||
// We also want to keep it onscreen, and separated from the
|
// We also want to keep it onscreen, and separated from the
|
||||||
// edge by the same distance as the main part of the box is
|
// edge by the same distance as the main part of the box is
|
||||||
// separated from its sourceActor
|
// separated from its sourceActor
|
||||||
let primary = Main.layoutManager.primaryMonitor;
|
let monitor = Main.layoutManager.findMonitorForActor(sourceActor);
|
||||||
let themeNode = this.actor.get_theme_node();
|
let themeNode = this.actor.get_theme_node();
|
||||||
let borderWidth = themeNode.get_length('-arrow-border-width');
|
let borderWidth = themeNode.get_length('-arrow-border-width');
|
||||||
let arrowBase = themeNode.get_length('-arrow-base');
|
let arrowBase = themeNode.get_length('-arrow-base');
|
||||||
let borderRadius = themeNode.get_length('-arrow-border-radius');
|
let borderRadius = themeNode.get_length('-arrow-border-radius');
|
||||||
let margin = (4 * borderRadius + borderWidth + arrowBase);
|
let margin = (4 * borderRadius + borderWidth + arrowBase);
|
||||||
let halfMargin = margin / 2;
|
|
||||||
|
|
||||||
let themeNode = this.actor.get_theme_node();
|
|
||||||
let gap = themeNode.get_length('-boxpointer-gap');
|
let gap = themeNode.get_length('-boxpointer-gap');
|
||||||
|
let padding = themeNode.get_length('-arrow-rise');
|
||||||
|
|
||||||
let resX, resY;
|
let resX, resY;
|
||||||
|
|
||||||
@ -357,29 +468,66 @@ BoxPointer.prototype = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now align and position the pointing axis, making sure
|
// Now align and position the pointing axis, making sure it fits on
|
||||||
// it fits on screen
|
// screen. If the arrowOrigin is so close to the edge that the arrow
|
||||||
|
// will not be isosceles, we try to compensate as follows:
|
||||||
|
// - We skip the rounded corner and settle for a right angled arrow
|
||||||
|
// as shown below. See _drawBorder for further details.
|
||||||
|
// |\_____
|
||||||
|
// |
|
||||||
|
// |
|
||||||
|
// - If the arrow was going to be acute angled, we move the position
|
||||||
|
// of the box to maintain the arrow's accuracy.
|
||||||
|
|
||||||
|
let arrowOrigin;
|
||||||
|
let halfBase = Math.floor(arrowBase/2);
|
||||||
|
let halfBorder = borderWidth / 2;
|
||||||
|
let halfMargin = margin / 2;
|
||||||
|
let [x1, y1] = [halfBorder, halfBorder];
|
||||||
|
let [x2, y2] = [natWidth - halfBorder, natHeight - halfBorder];
|
||||||
|
|
||||||
switch (this._arrowSide) {
|
switch (this._arrowSide) {
|
||||||
case St.Side.TOP:
|
case St.Side.TOP:
|
||||||
case St.Side.BOTTOM:
|
case St.Side.BOTTOM:
|
||||||
resX = sourceCenterX - (halfMargin + (natWidth - margin) * alignment);
|
resX = sourceCenterX - (halfMargin + (natWidth - margin) * alignment);
|
||||||
|
|
||||||
resX = Math.max(resX, primary.x + 10);
|
resX = Math.max(resX, monitor.x + padding);
|
||||||
resX = Math.min(resX, primary.x + primary.width - (10 + natWidth));
|
resX = Math.min(resX, monitor.x + monitor.width - (padding + natWidth));
|
||||||
this.setArrowOrigin(sourceCenterX - resX);
|
|
||||||
|
arrowOrigin = sourceCenterX - resX;
|
||||||
|
if (arrowOrigin <= (x1 + (borderRadius + halfBase))) {
|
||||||
|
if (arrowOrigin > x1)
|
||||||
|
resX += (arrowOrigin - x1);
|
||||||
|
arrowOrigin = x1;
|
||||||
|
} else if (arrowOrigin >= (x2 - (borderRadius + halfBase))) {
|
||||||
|
if (arrowOrigin < x2)
|
||||||
|
resX -= (x2 - arrowOrigin);
|
||||||
|
arrowOrigin = x2;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case St.Side.LEFT:
|
case St.Side.LEFT:
|
||||||
case St.Side.RIGHT:
|
case St.Side.RIGHT:
|
||||||
resY = sourceCenterY - (halfMargin + (natHeight - margin) * alignment);
|
resY = sourceCenterY - (halfMargin + (natHeight - margin) * alignment);
|
||||||
|
|
||||||
resY = Math.max(resY, primary.y + 10);
|
resY = Math.max(resY, monitor.y + padding);
|
||||||
resY = Math.min(resY, primary.y + primary.height - (10 + natHeight));
|
resY = Math.min(resY, monitor.y + monitor.height - (padding + natHeight));
|
||||||
|
|
||||||
this.setArrowOrigin(sourceCenterY - resY);
|
arrowOrigin = sourceCenterY - resY;
|
||||||
|
if (arrowOrigin <= (y1 + (borderRadius + halfBase))) {
|
||||||
|
if (arrowOrigin > y1)
|
||||||
|
resY += (arrowOrigin - y1);
|
||||||
|
arrowOrigin = y1;
|
||||||
|
} else if (arrowOrigin >= (y2 - (borderRadius + halfBase))) {
|
||||||
|
if (arrowOrigin < y2)
|
||||||
|
resX -= (y2 - arrowOrigin);
|
||||||
|
arrowOrigin = y2;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.setArrowOrigin(arrowOrigin);
|
||||||
|
|
||||||
let parent = this.actor.get_parent();
|
let parent = this.actor.get_parent();
|
||||||
let success, x, y;
|
let success, x, y;
|
||||||
while (!success) {
|
while (!success) {
|
||||||
@ -413,6 +561,39 @@ BoxPointer.prototype = {
|
|||||||
-(this._yPosition + this._yOffset));
|
-(this._yPosition + this._yOffset));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_shouldFlip: function() {
|
||||||
|
let sourceAllocation = Shell.util_get_transformed_allocation(this._sourceActor);
|
||||||
|
let boxAllocation = Shell.util_get_transformed_allocation(this.actor);
|
||||||
|
let boxWidth = boxAllocation.x2 - boxAllocation.x1;
|
||||||
|
let boxHeight = boxAllocation.y2 - boxAllocation.y1;
|
||||||
|
let monitor = Main.layoutManager.findMonitorForActor(this.actor);
|
||||||
|
|
||||||
|
switch (this._arrowSide) {
|
||||||
|
case St.Side.TOP:
|
||||||
|
if (boxAllocation.y2 > monitor.y + monitor.height &&
|
||||||
|
boxHeight < sourceAllocation.y1 - monitor.y)
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
case St.Side.BOTTOM:
|
||||||
|
if (boxAllocation.y1 < monitor.y &&
|
||||||
|
boxHeight < monitor.y + monitor.height - sourceAllocation.y2)
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
case St.Side.LEFT:
|
||||||
|
if (boxAllocation.x2 > monitor.x + monitor.width &&
|
||||||
|
boxWidth < sourceAllocation.x1 - monitor.x)
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
case St.Side.RIGHT:
|
||||||
|
if (boxAllocation.x1 < monitor.x &&
|
||||||
|
boxWidth < monitor.x + monitor.width - sourceAllocation.x2)
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
set xOffset(offset) {
|
set xOffset(offset) {
|
||||||
this._xOffset = offset;
|
this._xOffset = offset;
|
||||||
this._shiftActor();
|
this._shiftActor();
|
||||||
@ -438,4 +619,4 @@ BoxPointer.prototype = {
|
|||||||
get opacity() {
|
get opacity() {
|
||||||
return this.actor.opacity;
|
return this.actor.opacity;
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const DBus = imports.dbus;
|
|
||||||
const Clutter = imports.gi.Clutter;
|
const Clutter = imports.gi.Clutter;
|
||||||
const Gio = imports.gi.Gio;
|
const Gio = imports.gi.Gio;
|
||||||
const Lang = imports.lang;
|
const Lang = imports.lang;
|
||||||
@ -156,28 +155,24 @@ function _getEventDayAbbreviation(dayNumber) {
|
|||||||
|
|
||||||
// Abstraction for an appointment/event in a calendar
|
// Abstraction for an appointment/event in a calendar
|
||||||
|
|
||||||
function CalendarEvent(date, end, summary, allDay) {
|
const CalendarEvent = new Lang.Class({
|
||||||
this._init(date, end, summary, allDay);
|
Name: 'CalendarEvent',
|
||||||
}
|
|
||||||
|
|
||||||
CalendarEvent.prototype = {
|
|
||||||
_init: function(date, end, summary, allDay) {
|
_init: function(date, end, summary, allDay) {
|
||||||
this.date = date;
|
this.date = date;
|
||||||
this.end = end;
|
this.end = end;
|
||||||
this.summary = summary;
|
this.summary = summary;
|
||||||
this.allDay = allDay;
|
this.allDay = allDay;
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
// Interface for appointments/events - e.g. the contents of a calendar
|
// Interface for appointments/events - e.g. the contents of a calendar
|
||||||
//
|
//
|
||||||
|
|
||||||
// First, an implementation with no events
|
// First, an implementation with no events
|
||||||
function EmptyEventSource() {
|
const EmptyEventSource = new Lang.Class({
|
||||||
this._init();
|
Name: 'EmptyEventSource',
|
||||||
}
|
|
||||||
|
|
||||||
EmptyEventSource.prototype = {
|
|
||||||
_init: function() {
|
_init: function() {
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -192,33 +187,31 @@ EmptyEventSource.prototype = {
|
|||||||
hasEvents: function(day) {
|
hasEvents: function(day) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
Signals.addSignalMethods(EmptyEventSource.prototype);
|
Signals.addSignalMethods(EmptyEventSource.prototype);
|
||||||
|
|
||||||
const CalendarServerIface = {
|
const CalendarServerIface = <interface name="org.gnome.Shell.CalendarServer">
|
||||||
name: 'org.gnome.Shell.CalendarServer',
|
<method name="GetEvents">
|
||||||
methods: [{ name: 'GetEvents',
|
<arg type="x" direction="in" />
|
||||||
inSignature: 'xxb',
|
<arg type="x" direction="in" />
|
||||||
outSignature: 'a(sssbxxa{sv})' }],
|
<arg type="b" direction="in" />
|
||||||
signals: [{ name: 'Changed',
|
<arg type="a(sssbxxa{sv})" direction="out" />
|
||||||
inSignature: '' }]
|
</method>
|
||||||
};
|
<signal name="Changed" />
|
||||||
|
</interface>;
|
||||||
|
|
||||||
const CalendarServer = function () {
|
const CalendarServerInfo = Gio.DBusInterfaceInfo.new_for_xml(CalendarServerIface);
|
||||||
this._init();
|
|
||||||
};
|
|
||||||
|
|
||||||
CalendarServer.prototype = {
|
function CalendarServer() {
|
||||||
_init: function() {
|
var self = new Gio.DBusProxy({ g_connection: Gio.DBus.session,
|
||||||
DBus.session.proxifyObject(this, 'org.gnome.Shell.CalendarServer', '/org/gnome/Shell/CalendarServer');
|
g_interface_name: CalendarServerInfo.name,
|
||||||
}
|
g_interface_info: CalendarServerInfo,
|
||||||
};
|
g_name: 'org.gnome.Shell.CalendarServer',
|
||||||
|
g_object_path: '/org/gnome/Shell/CalendarServer',
|
||||||
|
g_flags: Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES });
|
||||||
|
|
||||||
DBus.proxifyPrototype(CalendarServer.prototype, CalendarServerIface);
|
self.init(null);
|
||||||
|
return self;
|
||||||
// an implementation that reads data from a session bus service
|
|
||||||
function DBusEventSource(owner) {
|
|
||||||
this._init(owner);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function _datesEqual(a, b) {
|
function _datesEqual(a, b) {
|
||||||
@ -239,18 +232,22 @@ function _dateIntervalsOverlap(a0, a1, b0, b1)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// an implementation that reads data from a session bus service
|
||||||
|
const DBusEventSource = new Lang.Class({
|
||||||
|
Name: 'DBusEventSource',
|
||||||
|
|
||||||
DBusEventSource.prototype = {
|
_init: function() {
|
||||||
_init: function(owner) {
|
|
||||||
this._resetCache();
|
this._resetCache();
|
||||||
|
|
||||||
this._dbusProxy = new CalendarServer(owner);
|
this._dbusProxy = new CalendarServer();
|
||||||
this._dbusProxy.connect('Changed', Lang.bind(this, this._onChanged));
|
this._dbusProxy.connectSignal('Changed', Lang.bind(this, this._onChanged));
|
||||||
|
|
||||||
DBus.session.watch_name('org.gnome.Shell.CalendarServer',
|
this._dbusProxy.connect('notify::g-name-owner', Lang.bind(this, function() {
|
||||||
false, // do not launch a name-owner if none exists
|
if (this._dbusProxy.g_name_owner)
|
||||||
Lang.bind(this, this._onNameAppeared),
|
this._onNameAppeared();
|
||||||
Lang.bind(this, this._onNameVanished));
|
else
|
||||||
|
this._onNameVanished();
|
||||||
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
_resetCache: function() {
|
_resetCache: function() {
|
||||||
@ -273,8 +270,9 @@ DBusEventSource.prototype = {
|
|||||||
this._loadEvents(false);
|
this._loadEvents(false);
|
||||||
},
|
},
|
||||||
|
|
||||||
_onEventsReceived: function(appointments) {
|
_onEventsReceived: function(results, error) {
|
||||||
let newEvents = [];
|
let newEvents = [];
|
||||||
|
let appointments = results ? results[0] : null;
|
||||||
if (appointments != null) {
|
if (appointments != null) {
|
||||||
for (let n = 0; n < appointments.length; n++) {
|
for (let n = 0; n < appointments.length; n++) {
|
||||||
let a = appointments[n];
|
let a = appointments[n];
|
||||||
@ -296,9 +294,9 @@ DBusEventSource.prototype = {
|
|||||||
|
|
||||||
_loadEvents: function(forceReload) {
|
_loadEvents: function(forceReload) {
|
||||||
if (this._curRequestBegin && this._curRequestEnd){
|
if (this._curRequestBegin && this._curRequestEnd){
|
||||||
let callFlags = 0;
|
let callFlags = Gio.DBusCallFlags.NO_AUTO_START;
|
||||||
if (forceReload)
|
if (forceReload)
|
||||||
callFlags |= DBus.CALL_FLAG_START;
|
callFlags = Gio.DBusCallFlags.NONE;
|
||||||
this._dbusProxy.GetEventsRemote(this._curRequestBegin.getTime() / 1000,
|
this._dbusProxy.GetEventsRemote(this._curRequestBegin.getTime() / 1000,
|
||||||
this._curRequestEnd.getTime() / 1000,
|
this._curRequestEnd.getTime() / 1000,
|
||||||
forceReload,
|
forceReload,
|
||||||
@ -339,27 +337,13 @@ DBusEventSource.prototype = {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
Signals.addSignalMethods(DBusEventSource.prototype);
|
Signals.addSignalMethods(DBusEventSource.prototype);
|
||||||
|
|
||||||
// Calendar:
|
const Calendar = new Lang.Class({
|
||||||
// @eventSource: is an object implementing the EventSource API, e.g. the
|
Name: 'Calendar',
|
||||||
// requestRange(), getEvents(), hasEvents() methods and the ::changed signal.
|
|
||||||
function Calendar(eventSource) {
|
|
||||||
this._init(eventSource);
|
|
||||||
}
|
|
||||||
|
|
||||||
Calendar.prototype = {
|
|
||||||
_init: function(eventSource) {
|
|
||||||
if (eventSource) {
|
|
||||||
this._eventSource = eventSource;
|
|
||||||
|
|
||||||
this._eventSource.connect('changed', Lang.bind(this,
|
|
||||||
function() {
|
|
||||||
this._update(false);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
_init: function() {
|
||||||
this._weekStart = Shell.util_get_week_start();
|
this._weekStart = Shell.util_get_week_start();
|
||||||
this._weekdate = NaN;
|
this._weekdate = NaN;
|
||||||
this._digitWidth = NaN;
|
this._digitWidth = NaN;
|
||||||
@ -396,6 +380,24 @@ Calendar.prototype = {
|
|||||||
this._buildHeader ();
|
this._buildHeader ();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// @eventSource: is an object implementing the EventSource API, e.g. the
|
||||||
|
// requestRange(), getEvents(), hasEvents() methods and the ::changed signal.
|
||||||
|
setEventSource: function(eventSource) {
|
||||||
|
if (this._eventSource) {
|
||||||
|
this._eventSource.disconnect(this._eventSourceChangedId);
|
||||||
|
this._eventSource = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._eventSource = eventSource;
|
||||||
|
|
||||||
|
if (this._eventSource) {
|
||||||
|
this._eventSourceChangedId = this._eventSource.connect('changed', Lang.bind(this, function() {
|
||||||
|
this._update(false);
|
||||||
|
}));
|
||||||
|
this._update(true);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// Sets the calendar to show a specific date
|
// Sets the calendar to show a specific date
|
||||||
setDate: function(date, forceReload) {
|
setDate: function(date, forceReload) {
|
||||||
if (!_sameDay(date, this._selectedDate)) {
|
if (!_sameDay(date, this._selectedDate)) {
|
||||||
@ -410,7 +412,7 @@ Calendar.prototype = {
|
|||||||
|
|
||||||
_buildHeader: function() {
|
_buildHeader: function() {
|
||||||
let offsetCols = this._useWeekdate ? 1 : 0;
|
let offsetCols = this._useWeekdate ? 1 : 0;
|
||||||
this.actor.destroy_children();
|
this.actor.destroy_all_children();
|
||||||
|
|
||||||
// Top line of the calendar '<| September 2009 |>'
|
// Top line of the calendar '<| September 2009 |>'
|
||||||
this._topBox = new St.BoxLayout();
|
this._topBox = new St.BoxLayout();
|
||||||
@ -452,7 +454,7 @@ Calendar.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// All the children after this are days, and get removed when we update the calendar
|
// All the children after this are days, and get removed when we update the calendar
|
||||||
this._firstDayIndex = this.actor.get_children().length;
|
this._firstDayIndex = this.actor.get_n_children();
|
||||||
},
|
},
|
||||||
|
|
||||||
_onStyleChange: function(actor, event) {
|
_onStyleChange: function(actor, event) {
|
||||||
@ -555,6 +557,7 @@ Calendar.prototype = {
|
|||||||
let row = 2;
|
let row = 2;
|
||||||
while (true) {
|
while (true) {
|
||||||
let button = new St.Button({ label: iter.getDate().toString() });
|
let button = new St.Button({ label: iter.getDate().toString() });
|
||||||
|
let rtl = button.get_text_direction() == Clutter.TextDirection.RTL;
|
||||||
|
|
||||||
if (!this._eventSource)
|
if (!this._eventSource)
|
||||||
button.reactive = false;
|
button.reactive = false;
|
||||||
@ -575,7 +578,10 @@ Calendar.prototype = {
|
|||||||
// Hack used in lieu of border-collapse - see gnome-shell.css
|
// Hack used in lieu of border-collapse - see gnome-shell.css
|
||||||
if (row == 2)
|
if (row == 2)
|
||||||
styleClass = 'calendar-day-top ' + styleClass;
|
styleClass = 'calendar-day-top ' + styleClass;
|
||||||
if (iter.getDay() == this._weekStart)
|
|
||||||
|
let leftMost = rtl ? iter.getDay() == (this._weekStart + 6) % 7
|
||||||
|
: iter.getDay() == this._weekStart;
|
||||||
|
if (leftMost)
|
||||||
styleClass = 'calendar-day-left ' + styleClass;
|
styleClass = 'calendar-day-left ' + styleClass;
|
||||||
|
|
||||||
if (_sameDay(now, iter))
|
if (_sameDay(now, iter))
|
||||||
@ -615,25 +621,32 @@ Calendar.prototype = {
|
|||||||
if (this._eventSource)
|
if (this._eventSource)
|
||||||
this._eventSource.requestRange(beginDate, iter, forceReload);
|
this._eventSource.requestRange(beginDate, iter, forceReload);
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
Signals.addSignalMethods(Calendar.prototype);
|
Signals.addSignalMethods(Calendar.prototype);
|
||||||
|
|
||||||
function EventsList(eventSource) {
|
const EventsList = new Lang.Class({
|
||||||
this._init(eventSource);
|
Name: 'EventsList',
|
||||||
}
|
|
||||||
|
|
||||||
EventsList.prototype = {
|
_init: function() {
|
||||||
_init: function(eventSource) {
|
|
||||||
this.actor = new St.BoxLayout({ vertical: true, style_class: 'events-header-vbox'});
|
this.actor = new St.BoxLayout({ vertical: true, style_class: 'events-header-vbox'});
|
||||||
this._date = new Date();
|
this._date = new Date();
|
||||||
this._eventSource = eventSource;
|
|
||||||
this._eventSource.connect('changed', Lang.bind(this, this._update));
|
|
||||||
this._desktopSettings = new Gio.Settings({ schema: 'org.gnome.desktop.interface' });
|
this._desktopSettings = new Gio.Settings({ schema: 'org.gnome.desktop.interface' });
|
||||||
this._desktopSettings.connect('changed', Lang.bind(this, this._update));
|
this._desktopSettings.connect('changed', Lang.bind(this, this._update));
|
||||||
this._weekStart = Shell.util_get_week_start();
|
this._weekStart = Shell.util_get_week_start();
|
||||||
|
},
|
||||||
|
|
||||||
this._update();
|
setEventSource: function(eventSource) {
|
||||||
|
if (this._eventSource) {
|
||||||
|
this._eventSource.disconnect(this._eventSourceChangedId);
|
||||||
|
this._eventSource = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._eventSource = eventSource;
|
||||||
|
|
||||||
|
if (this._eventSource) {
|
||||||
|
this._eventSourceChangedId = this._eventSource.connect('changed', Lang.bind(this, this._update));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_addEvent: function(dayNameBox, timeBox, eventTitleBox, includeDayName, day, time, desc) {
|
_addEvent: function(dayNameBox, timeBox, eventTitleBox, includeDayName, day, time, desc) {
|
||||||
@ -691,7 +704,7 @@ EventsList.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_showOtherDay: function(day) {
|
_showOtherDay: function(day) {
|
||||||
this.actor.destroy_children();
|
this.actor.destroy_all_children();
|
||||||
|
|
||||||
let dayBegin = _getBeginningOfDay(day);
|
let dayBegin = _getBeginningOfDay(day);
|
||||||
let dayEnd = _getEndOfDay(day);
|
let dayEnd = _getEndOfDay(day);
|
||||||
@ -708,7 +721,7 @@ EventsList.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_showToday: function() {
|
_showToday: function() {
|
||||||
this.actor.destroy_children();
|
this.actor.destroy_all_children();
|
||||||
|
|
||||||
let now = new Date();
|
let now = new Date();
|
||||||
let dayBegin = _getBeginningOfDay(now);
|
let dayBegin = _getBeginningOfDay(now);
|
||||||
@ -719,13 +732,15 @@ EventsList.prototype = {
|
|||||||
let tomorrowEnd = new Date(dayEnd.getTime() + 86400 * 1000);
|
let tomorrowEnd = new Date(dayEnd.getTime() + 86400 * 1000);
|
||||||
this._addPeriod(_("Tomorrow"), tomorrowBegin, tomorrowEnd, false, true);
|
this._addPeriod(_("Tomorrow"), tomorrowBegin, tomorrowEnd, false, true);
|
||||||
|
|
||||||
if (dayEnd.getDay() <= 4 + this._weekStart) {
|
let dayInWeek = (dayEnd.getDay() - this._weekStart + 7) % 7;
|
||||||
|
|
||||||
|
if (dayInWeek < 5) {
|
||||||
/* If now is within the first 5 days we show "This week" and
|
/* If now is within the first 5 days we show "This week" and
|
||||||
* include events up until and including Saturday/Sunday
|
* include events up until and including Saturday/Sunday
|
||||||
* (depending on whether a week starts on Sunday/Monday).
|
* (depending on whether a week starts on Sunday/Monday).
|
||||||
*/
|
*/
|
||||||
let thisWeekBegin = new Date(dayBegin.getTime() + 2 * 86400 * 1000);
|
let thisWeekBegin = new Date(dayBegin.getTime() + 2 * 86400 * 1000);
|
||||||
let thisWeekEnd = new Date(dayEnd.getTime() + (6 + this._weekStart - dayEnd.getDay()) * 86400 * 1000);
|
let thisWeekEnd = new Date(dayEnd.getTime() + (6 - dayInWeek) * 86400 * 1000);
|
||||||
this._addPeriod(_("This week"), thisWeekBegin, thisWeekEnd, true, false);
|
this._addPeriod(_("This week"), thisWeekBegin, thisWeekEnd, true, false);
|
||||||
} else {
|
} else {
|
||||||
/* otherwise it's one of the two last days of the week ... show
|
/* otherwise it's one of the two last days of the week ... show
|
||||||
@ -733,7 +748,7 @@ EventsList.prototype = {
|
|||||||
* Saturday/Sunday
|
* Saturday/Sunday
|
||||||
*/
|
*/
|
||||||
let nextWeekBegin = new Date(dayBegin.getTime() + 2 * 86400 * 1000);
|
let nextWeekBegin = new Date(dayBegin.getTime() + 2 * 86400 * 1000);
|
||||||
let nextWeekEnd = new Date(dayEnd.getTime() + (13 + this._weekStart - dayEnd.getDay()) * 86400 * 1000);
|
let nextWeekEnd = new Date(dayEnd.getTime() + (13 - dayInWeek) * 86400 * 1000);
|
||||||
this._addPeriod(_("Next week"), nextWeekBegin, nextWeekEnd, true, false);
|
this._addPeriod(_("Next week"), nextWeekBegin, nextWeekEnd, true, false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -754,4 +769,4 @@ EventsList.prototype = {
|
|||||||
this._showOtherDay(this._date);
|
this._showOtherDay(this._date);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
115
js/ui/checkBox.js
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
const Clutter = imports.gi.Clutter;
|
||||||
|
const Pango = imports.gi.Pango;
|
||||||
|
const Shell = imports.gi.Shell;
|
||||||
|
const St = imports.gi.St;
|
||||||
|
|
||||||
|
const Lang = imports.lang;
|
||||||
|
|
||||||
|
const CheckBoxContainer = new Lang.Class({
|
||||||
|
Name: 'CheckBoxContainer',
|
||||||
|
|
||||||
|
_init: function() {
|
||||||
|
this.actor = new Shell.GenericContainer();
|
||||||
|
this.actor.connect('get-preferred-width',
|
||||||
|
Lang.bind(this, this._getPreferredWidth));
|
||||||
|
this.actor.connect('get-preferred-height',
|
||||||
|
Lang.bind(this, this._getPreferredHeight));
|
||||||
|
this.actor.connect('allocate',
|
||||||
|
Lang.bind(this, this._allocate));
|
||||||
|
this.actor.connect('style-changed', Lang.bind(this,
|
||||||
|
function() {
|
||||||
|
let node = this.actor.get_theme_node();
|
||||||
|
this._spacing = node.get_length('spacing');
|
||||||
|
}));
|
||||||
|
this.actor.request_mode = Clutter.RequestMode.HEIGHT_FOR_WIDTH;
|
||||||
|
|
||||||
|
this._box = new St.Bin();
|
||||||
|
this.actor.add_actor(this._box);
|
||||||
|
|
||||||
|
this.label = new St.Label();
|
||||||
|
this.label.clutter_text.set_line_wrap(true);
|
||||||
|
this.label.clutter_text.set_ellipsize(Pango.EllipsizeMode.NONE);
|
||||||
|
this.actor.add_actor(this.label);
|
||||||
|
|
||||||
|
this._spacing = 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
_getPreferredWidth: function(actor, forHeight, alloc) {
|
||||||
|
let [minWidth, natWidth] = this._box.get_preferred_width(forHeight);
|
||||||
|
|
||||||
|
alloc.min_size = minWidth + this._spacing;
|
||||||
|
alloc.natural_size = natWidth + this._spacing;
|
||||||
|
},
|
||||||
|
|
||||||
|
_getPreferredHeight: function(actor, forWidth, alloc) {
|
||||||
|
/* FIXME: StBoxlayout currently does not handle
|
||||||
|
height-for-width children correctly, so hard-code
|
||||||
|
two lines for the label until that problem is fixed.
|
||||||
|
|
||||||
|
https://bugzilla.gnome.org/show_bug.cgi?id=672543 */
|
||||||
|
/*
|
||||||
|
let [minBoxHeight, natBoxHeight] =
|
||||||
|
this._box.get_preferred_height(forWidth);
|
||||||
|
let [minLabelHeight, natLabelHeight] =
|
||||||
|
this.label.get_preferred_height(forWidth);
|
||||||
|
|
||||||
|
alloc.min_size = Math.max(minBoxHeight, minLabelHeight);
|
||||||
|
alloc.natural_size = Math.max(natBoxHeight, natLabelHeight);
|
||||||
|
*/
|
||||||
|
let [minBoxHeight, natBoxHeight] =
|
||||||
|
this._box.get_preferred_height(-1);
|
||||||
|
let [minLabelHeight, natLabelHeight] =
|
||||||
|
this.label.get_preferred_height(-1);
|
||||||
|
|
||||||
|
alloc.min_size = Math.max(minBoxHeight, 2 * minLabelHeight);
|
||||||
|
alloc.natural_size = Math.max(natBoxHeight, 2 * natLabelHeight);
|
||||||
|
},
|
||||||
|
|
||||||
|
_allocate: function(actor, box, flags) {
|
||||||
|
let availWidth = box.x2 - box.x1;
|
||||||
|
let availHeight = box.y2 - box.y1;
|
||||||
|
|
||||||
|
let childBox = new Clutter.ActorBox();
|
||||||
|
let [minBoxWidth, natBoxWidth] =
|
||||||
|
this._box.get_preferred_width(-1);
|
||||||
|
let [minBoxHeight, natBoxHeight] =
|
||||||
|
this._box.get_preferred_height(-1);
|
||||||
|
childBox.x1 = box.x1;
|
||||||
|
childBox.x2 = box.x1 + natBoxWidth;
|
||||||
|
childBox.y1 = box.y1;
|
||||||
|
childBox.y2 = box.y1 + natBoxHeight;
|
||||||
|
this._box.allocate(childBox, flags);
|
||||||
|
|
||||||
|
childBox.x1 = box.x1 + natBoxWidth + this._spacing;
|
||||||
|
childBox.x2 = availWidth - childBox.x1;
|
||||||
|
childBox.y1 = box.y1;
|
||||||
|
childBox.y2 = box.y2;
|
||||||
|
this.label.allocate(childBox, flags);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const CheckBox = new Lang.Class({
|
||||||
|
Name: 'CheckBox',
|
||||||
|
|
||||||
|
_init: function(label) {
|
||||||
|
this.actor = new St.Button({ style_class: 'check-box',
|
||||||
|
button_mask: St.ButtonMask.ONE,
|
||||||
|
toggle_mode: true,
|
||||||
|
can_focus: true,
|
||||||
|
x_fill: true,
|
||||||
|
y_fill: true });
|
||||||
|
this._container = new CheckBoxContainer();
|
||||||
|
this.actor.set_child(this._container.actor);
|
||||||
|
|
||||||
|
if (label)
|
||||||
|
this.setLabel(label);
|
||||||
|
},
|
||||||
|
|
||||||
|
setLabel: function(label) {
|
||||||
|
this._container.label.set_text(label);
|
||||||
|
},
|
||||||
|
|
||||||
|
getLabelActor: function() {
|
||||||
|
return this._container.label;
|
||||||
|
}
|
||||||
|
});
|
65
js/ui/components/__init__.js
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
|
||||||
|
const Lang = imports.lang;
|
||||||
|
const Main = imports.ui.main;
|
||||||
|
|
||||||
|
const ComponentManager = new Lang.Class({
|
||||||
|
Name: 'ComponentManager',
|
||||||
|
|
||||||
|
_init: function() {
|
||||||
|
this._allComponents = {};
|
||||||
|
this._enabledComponents = [];
|
||||||
|
|
||||||
|
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
|
||||||
|
this._sessionUpdated();
|
||||||
|
},
|
||||||
|
|
||||||
|
_sessionUpdated: function() {
|
||||||
|
let newEnabledComponents = Main.sessionMode.components;
|
||||||
|
|
||||||
|
newEnabledComponents.filter(Lang.bind(this, function(name) {
|
||||||
|
return this._enabledComponents.indexOf(name) == -1;
|
||||||
|
})).forEach(Lang.bind(this, function(name) {
|
||||||
|
this._enableComponent(name);
|
||||||
|
}));
|
||||||
|
|
||||||
|
this._enabledComponents.filter(Lang.bind(this, function(name) {
|
||||||
|
return newEnabledComponents.indexOf(name) == -1;
|
||||||
|
})).forEach(Lang.bind(this, function(name) {
|
||||||
|
this._disableComponent(name);
|
||||||
|
}));
|
||||||
|
|
||||||
|
this._enabledComponents = newEnabledComponents;
|
||||||
|
},
|
||||||
|
|
||||||
|
_importComponent: function(name) {
|
||||||
|
let module = imports.ui.components[name];
|
||||||
|
return module.Component;
|
||||||
|
},
|
||||||
|
|
||||||
|
_ensureComponent: function(name) {
|
||||||
|
let component = this._allComponents[name];
|
||||||
|
if (component)
|
||||||
|
return component;
|
||||||
|
|
||||||
|
if (Main.sessionMode.isLocked)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
let constructor = this._importComponent(name);
|
||||||
|
component = new constructor();
|
||||||
|
this._allComponents[name] = component;
|
||||||
|
return component;
|
||||||
|
},
|
||||||
|
|
||||||
|
_enableComponent: function(name) {
|
||||||
|
let component = this._ensureComponent(name);
|
||||||
|
if (component)
|
||||||
|
component.enable();
|
||||||
|
},
|
||||||
|
|
||||||
|
_disableComponent: function(name) {
|
||||||
|
let component = this._allComponents[name];
|
||||||
|
if (component == null)
|
||||||
|
return;
|
||||||
|
component.disable();
|
||||||
|
}
|
||||||
|
});
|
241
js/ui/components/automountManager.js
Normal file
@ -0,0 +1,241 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
|
const Lang = imports.lang;
|
||||||
|
const Mainloop = imports.mainloop;
|
||||||
|
const GLib = imports.gi.GLib;
|
||||||
|
const Gio = imports.gi.Gio;
|
||||||
|
const Params = imports.misc.params;
|
||||||
|
const Shell = imports.gi.Shell;
|
||||||
|
|
||||||
|
const GnomeSession = imports.misc.gnomeSession;
|
||||||
|
const LoginManager = imports.misc.loginManager;
|
||||||
|
const Main = imports.ui.main;
|
||||||
|
const ShellMountOperation = imports.ui.shellMountOperation;
|
||||||
|
|
||||||
|
const GNOME_SESSION_AUTOMOUNT_INHIBIT = 16;
|
||||||
|
|
||||||
|
// GSettings keys
|
||||||
|
const SETTINGS_SCHEMA = 'org.gnome.desktop.media-handling';
|
||||||
|
const SETTING_ENABLE_AUTOMOUNT = 'automount';
|
||||||
|
|
||||||
|
const AUTORUN_EXPIRE_TIMEOUT_SECS = 10;
|
||||||
|
|
||||||
|
const AutomountManager = new Lang.Class({
|
||||||
|
Name: 'AutomountManager',
|
||||||
|
|
||||||
|
_init: function() {
|
||||||
|
this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA });
|
||||||
|
this._volumeQueue = [];
|
||||||
|
this._session = new GnomeSession.SessionManager();
|
||||||
|
this._session.connectSignal('InhibitorAdded',
|
||||||
|
Lang.bind(this, this._InhibitorsChanged));
|
||||||
|
this._session.connectSignal('InhibitorRemoved',
|
||||||
|
Lang.bind(this, this._InhibitorsChanged));
|
||||||
|
this._inhibited = false;
|
||||||
|
|
||||||
|
this._loginManager = LoginManager.getLoginManager();
|
||||||
|
this._volumeMonitor = Gio.VolumeMonitor.get();
|
||||||
|
},
|
||||||
|
|
||||||
|
enable: function() {
|
||||||
|
this._volumeAddedId = this._volumeMonitor.connect('volume-added', Lang.bind(this, this._onVolumeAdded));
|
||||||
|
this._volumeRemovedId = this._volumeMonitor.connect('volume-removed', Lang.bind(this, this._onVolumeRemoved));
|
||||||
|
this._driveConnectedId = this._volumeMonitor.connect('drive-connected', Lang.bind(this, this._onDriveConnected));
|
||||||
|
this._driveDisconnectedId = this._volumeMonitor.connect('drive-disconnected', Lang.bind(this, this._onDriveDisconnected));
|
||||||
|
this._driveEjectButtonId = this._volumeMonitor.connect('drive-eject-button', Lang.bind(this, this._onDriveEjectButton));
|
||||||
|
|
||||||
|
this._mountAllId = Mainloop.idle_add(Lang.bind(this, this._startupMountAll));
|
||||||
|
},
|
||||||
|
|
||||||
|
disable: function() {
|
||||||
|
this._volumeMonitor.disconnect(this._volumeAddedId);
|
||||||
|
this._volumeMonitor.disconnect(this._volumeRemovedId);
|
||||||
|
this._volumeMonitor.disconnect(this._driveConnectedId);
|
||||||
|
this._volumeMonitor.disconnect(this._driveDisconnectedId);
|
||||||
|
this._volumeMonitor.disconnect(this._driveEjectButtonId);
|
||||||
|
|
||||||
|
if (this._mountAllId > 0) {
|
||||||
|
Mainloop.source_remove(this._mountAllId);
|
||||||
|
this._mountAllId = 0;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_InhibitorsChanged: function(object, senderName, [inhibtor]) {
|
||||||
|
this._session.IsInhibitedRemote(GNOME_SESSION_AUTOMOUNT_INHIBIT,
|
||||||
|
Lang.bind(this,
|
||||||
|
function(result, error) {
|
||||||
|
if (!error) {
|
||||||
|
this._inhibited = result[0];
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
|
||||||
|
_startupMountAll: function() {
|
||||||
|
let volumes = this._volumeMonitor.get_volumes();
|
||||||
|
volumes.forEach(Lang.bind(this, function(volume) {
|
||||||
|
this._checkAndMountVolume(volume, { checkSession: false,
|
||||||
|
useMountOp: false,
|
||||||
|
allowAutorun: false });
|
||||||
|
}));
|
||||||
|
|
||||||
|
this._mountAllId = 0;
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
_onDriveConnected: function() {
|
||||||
|
// if we're not in the current ConsoleKit session,
|
||||||
|
// or screensaver is active, don't play sounds
|
||||||
|
if (!this._loginManager.sessionActive)
|
||||||
|
return;
|
||||||
|
|
||||||
|
global.play_theme_sound(0, 'device-added-media');
|
||||||
|
},
|
||||||
|
|
||||||
|
_onDriveDisconnected: function() {
|
||||||
|
// if we're not in the current ConsoleKit session,
|
||||||
|
// or screensaver is active, don't play sounds
|
||||||
|
if (!this._loginManager.sessionActive)
|
||||||
|
return;
|
||||||
|
|
||||||
|
global.play_theme_sound(0, 'device-removed-media');
|
||||||
|
},
|
||||||
|
|
||||||
|
_onDriveEjectButton: function(monitor, drive) {
|
||||||
|
// TODO: this code path is not tested, as the GVfs volume monitor
|
||||||
|
// doesn't emit this signal just yet.
|
||||||
|
if (!this._loginManager.sessionActive)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// we force stop/eject in this case, so we don't have to pass a
|
||||||
|
// mount operation object
|
||||||
|
if (drive.can_stop()) {
|
||||||
|
drive.stop
|
||||||
|
(Gio.MountUnmountFlags.FORCE, null, null,
|
||||||
|
Lang.bind(this, function(drive, res) {
|
||||||
|
try {
|
||||||
|
drive.stop_finish(res);
|
||||||
|
} catch (e) {
|
||||||
|
log("Unable to stop the drive after drive-eject-button " + e.toString());
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
} else if (drive.can_eject()) {
|
||||||
|
drive.eject_with_operation
|
||||||
|
(Gio.MountUnmountFlags.FORCE, null, null,
|
||||||
|
Lang.bind(this, function(drive, res) {
|
||||||
|
try {
|
||||||
|
drive.eject_with_operation_finish(res);
|
||||||
|
} catch (e) {
|
||||||
|
log("Unable to eject the drive after drive-eject-button " + e.toString());
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_onVolumeAdded: function(monitor, volume) {
|
||||||
|
this._checkAndMountVolume(volume);
|
||||||
|
},
|
||||||
|
|
||||||
|
_checkAndMountVolume: function(volume, params) {
|
||||||
|
params = Params.parse(params, { checkSession: true,
|
||||||
|
useMountOp: true,
|
||||||
|
allowAutorun: true });
|
||||||
|
|
||||||
|
if (params.checkSession) {
|
||||||
|
// if we're not in the current ConsoleKit session,
|
||||||
|
// don't attempt automount
|
||||||
|
if (!this._loginManager.sessionActive)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._inhibited)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Volume is already mounted, don't bother.
|
||||||
|
if (volume.get_mount())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!this._settings.get_boolean(SETTING_ENABLE_AUTOMOUNT) ||
|
||||||
|
!volume.should_automount() ||
|
||||||
|
!volume.can_mount()) {
|
||||||
|
// allow the autorun to run anyway; this can happen if the
|
||||||
|
// mount gets added programmatically later, even if
|
||||||
|
// should_automount() or can_mount() are false, like for
|
||||||
|
// blank optical media.
|
||||||
|
this._allowAutorun(volume);
|
||||||
|
this._allowAutorunExpire(volume);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.useMountOp) {
|
||||||
|
let operation = new ShellMountOperation.ShellMountOperation(volume);
|
||||||
|
this._mountVolume(volume, operation, params.allowAutorun);
|
||||||
|
} else {
|
||||||
|
this._mountVolume(volume, null, params.allowAutorun);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_mountVolume: function(volume, operation, allowAutorun) {
|
||||||
|
if (allowAutorun)
|
||||||
|
this._allowAutorun(volume);
|
||||||
|
|
||||||
|
let mountOp = operation ? operation.mountOp : null;
|
||||||
|
volume._operation = operation;
|
||||||
|
|
||||||
|
volume.mount(0, mountOp, null,
|
||||||
|
Lang.bind(this, this._onVolumeMounted));
|
||||||
|
},
|
||||||
|
|
||||||
|
_onVolumeMounted: function(volume, res) {
|
||||||
|
this._allowAutorunExpire(volume);
|
||||||
|
|
||||||
|
try {
|
||||||
|
volume.mount_finish(res);
|
||||||
|
this._closeOperation(volume);
|
||||||
|
} catch (e) {
|
||||||
|
// FIXME: we will always get G_IO_ERROR_FAILED from the gvfs udisks
|
||||||
|
// backend in this case, see
|
||||||
|
// https://bugs.freedesktop.org/show_bug.cgi?id=51271
|
||||||
|
if (e.message.indexOf('No key available with this passphrase') != -1) {
|
||||||
|
this._reaskPassword(volume);
|
||||||
|
} else {
|
||||||
|
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED_HANDLED))
|
||||||
|
log('Unable to mount volume ' + volume.get_name() + ': ' + e.toString());
|
||||||
|
|
||||||
|
this._closeOperation(volume);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_onVolumeRemoved: function(monitor, volume) {
|
||||||
|
this._volumeQueue =
|
||||||
|
this._volumeQueue.filter(function(element) {
|
||||||
|
return (element != volume);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
_reaskPassword: function(volume) {
|
||||||
|
let existingDialog = volume._operation ? volume._operation.borrowDialog() : null;
|
||||||
|
let operation =
|
||||||
|
new ShellMountOperation.ShellMountOperation(volume,
|
||||||
|
{ existingDialog: existingDialog });
|
||||||
|
this._mountVolume(volume, operation);
|
||||||
|
},
|
||||||
|
|
||||||
|
_closeOperation: function(volume) {
|
||||||
|
if (volume._operation)
|
||||||
|
volume._operation.close();
|
||||||
|
},
|
||||||
|
|
||||||
|
_allowAutorun: function(volume) {
|
||||||
|
volume.allowAutorun = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
_allowAutorunExpire: function(volume) {
|
||||||
|
Mainloop.timeout_add_seconds(AUTORUN_EXPIRE_TIMEOUT_SECS, function() {
|
||||||
|
volume.allowAutorun = false;
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const Component = AutomountManager;
|
@ -1,10 +1,10 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const Lang = imports.lang;
|
const Lang = imports.lang;
|
||||||
const DBus = imports.dbus;
|
|
||||||
const Gio = imports.gi.Gio;
|
const Gio = imports.gi.Gio;
|
||||||
const St = imports.gi.St;
|
const St = imports.gi.St;
|
||||||
|
|
||||||
|
const LoginManager = imports.misc.loginManager;
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
const MessageTray = imports.ui.messageTray;
|
const MessageTray = imports.ui.messageTray;
|
||||||
const ShellMountOperation = imports.ui.shellMountOperation;
|
const ShellMountOperation = imports.ui.shellMountOperation;
|
||||||
@ -24,12 +24,14 @@ const AutorunSetting = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// misc utils
|
// misc utils
|
||||||
function ignoreAutorunForMount(mount) {
|
function shouldAutorunMount(mount, forTransient) {
|
||||||
let root = mount.get_root();
|
let root = mount.get_root();
|
||||||
let volume = mount.get_volume();
|
let volume = mount.get_volume();
|
||||||
|
|
||||||
if ((root.is_native() && !isMountRootHidden(root)) ||
|
if (!volume || (!volume.allowAutorun && forTransient))
|
||||||
(volume && volume.allowAutorun && volume.should_automount()))
|
return false;
|
||||||
|
|
||||||
|
if (!root.is_native() || isMountRootHidden(root))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -42,6 +44,17 @@ function isMountRootHidden(root) {
|
|||||||
return (path.indexOf('/.') != -1);
|
return (path.indexOf('/.') != -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isMountNonLocal(mount) {
|
||||||
|
// If the mount doesn't have an associated volume, that means it's
|
||||||
|
// an uninteresting filesystem. Most devices that we care about will
|
||||||
|
// have a mount, like media players and USB sticks.
|
||||||
|
let volume = mount.get_volume();
|
||||||
|
if (volume == null)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return (volume.get_identifier("class") == "network");
|
||||||
|
}
|
||||||
|
|
||||||
function startAppForMount(app, mount) {
|
function startAppForMount(app, mount) {
|
||||||
let files = [];
|
let files = [];
|
||||||
let root = mount.get_root();
|
let root = mount.get_root();
|
||||||
@ -62,40 +75,40 @@ function startAppForMount(app, mount) {
|
|||||||
|
|
||||||
/******************************************/
|
/******************************************/
|
||||||
|
|
||||||
const HotplugSnifferIface = {
|
const HotplugSnifferIface = <interface name="org.gnome.Shell.HotplugSniffer">
|
||||||
name: 'org.gnome.Shell.HotplugSniffer',
|
<method name="SniffURI">
|
||||||
methods: [{ name: 'SniffURI',
|
<arg type="s" direction="in" />
|
||||||
inSignature: 's',
|
<arg type="as" direction="out" />
|
||||||
outSignature: 'as' }]
|
</method>
|
||||||
};
|
</interface>;
|
||||||
|
|
||||||
const HotplugSniffer = function() {
|
const HotplugSnifferProxy = Gio.DBusProxy.makeProxyWrapper(HotplugSnifferIface);
|
||||||
this._init();
|
function HotplugSniffer() {
|
||||||
};
|
return new HotplugSnifferProxy(Gio.DBus.session,
|
||||||
|
|
||||||
HotplugSniffer.prototype = {
|
|
||||||
_init: function() {
|
|
||||||
DBus.session.proxifyObject(this,
|
|
||||||
'org.gnome.Shell.HotplugSniffer',
|
'org.gnome.Shell.HotplugSniffer',
|
||||||
'/org/gnome/Shell/HotplugSniffer');
|
'/org/gnome/Shell/HotplugSniffer');
|
||||||
},
|
|
||||||
};
|
|
||||||
DBus.proxifyPrototype(HotplugSniffer.prototype, HotplugSnifferIface);
|
|
||||||
|
|
||||||
function ContentTypeDiscoverer(callback) {
|
|
||||||
this._init(callback);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ContentTypeDiscoverer.prototype = {
|
const ContentTypeDiscoverer = new Lang.Class({
|
||||||
|
Name: 'ContentTypeDiscoverer',
|
||||||
|
|
||||||
_init: function(callback) {
|
_init: function(callback) {
|
||||||
this._callback = callback;
|
this._callback = callback;
|
||||||
|
this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA });
|
||||||
},
|
},
|
||||||
|
|
||||||
guessContentTypes: function(mount) {
|
guessContentTypes: function(mount) {
|
||||||
// guess mount's content types using GIO
|
let autorunEnabled = !this._settings.get_boolean(SETTING_DISABLE_AUTORUN);
|
||||||
mount.guess_content_type(false, null,
|
let shouldScan = autorunEnabled && !isMountNonLocal(mount);
|
||||||
Lang.bind(this,
|
|
||||||
this._onContentTypeGuessed));
|
if (shouldScan) {
|
||||||
|
// guess mount's content types using GIO
|
||||||
|
mount.guess_content_type(false, null,
|
||||||
|
Lang.bind(this,
|
||||||
|
this._onContentTypeGuessed));
|
||||||
|
} else {
|
||||||
|
this._emitCallback(mount, []);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_onContentTypeGuessed: function(mount, res) {
|
_onContentTypeGuessed: function(mount, res) {
|
||||||
@ -114,9 +127,8 @@ ContentTypeDiscoverer.prototype = {
|
|||||||
let root = mount.get_root();
|
let root = mount.get_root();
|
||||||
|
|
||||||
let hotplugSniffer = new HotplugSniffer();
|
let hotplugSniffer = new HotplugSniffer();
|
||||||
hotplugSniffer.SniffURIRemote
|
hotplugSniffer.SniffURIRemote(root.get_uri(),
|
||||||
(root.get_uri(), DBus.CALL_FLAG_START,
|
Lang.bind(this, function([contentTypes]) {
|
||||||
Lang.bind(this, function(contentTypes) {
|
|
||||||
this._emitCallback(mount, contentTypes);
|
this._emitCallback(mount, contentTypes);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@ -144,63 +156,75 @@ ContentTypeDiscoverer.prototype = {
|
|||||||
|
|
||||||
this._callback(mount, apps, contentTypes);
|
this._callback(mount, apps, contentTypes);
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
function AutorunManager() {
|
const AutorunManager = new Lang.Class({
|
||||||
this._init();
|
Name: 'AutorunManager',
|
||||||
}
|
|
||||||
|
|
||||||
AutorunManager.prototype = {
|
|
||||||
_init: function() {
|
_init: function() {
|
||||||
|
this._loginManager = LoginManager.getLoginManager();
|
||||||
|
|
||||||
this._volumeMonitor = Gio.VolumeMonitor.get();
|
this._volumeMonitor = Gio.VolumeMonitor.get();
|
||||||
|
|
||||||
this._volumeMonitor.connect('mount-added',
|
this._transDispatcher = new AutorunTransientDispatcher(this);
|
||||||
Lang.bind(this,
|
},
|
||||||
this._onMountAdded));
|
|
||||||
this._volumeMonitor.connect('mount-removed',
|
|
||||||
Lang.bind(this,
|
|
||||||
this._onMountRemoved));
|
|
||||||
|
|
||||||
this._transDispatcher = new AutorunTransientDispatcher();
|
_ensureResidentSource: function() {
|
||||||
this._createResidentSource();
|
if (this._residentSource)
|
||||||
|
return;
|
||||||
|
|
||||||
let mounts = this._volumeMonitor.get_mounts();
|
this._residentSource = new AutorunResidentSource(this);
|
||||||
|
let destroyId = this._residentSource.connect('destroy', Lang.bind(this, function() {
|
||||||
mounts.forEach(Lang.bind(this, function (mount) {
|
this._residentSource.disconnect(destroyId);
|
||||||
let discoverer = new ContentTypeDiscoverer(Lang.bind (this,
|
this._residentSource = null;
|
||||||
function (mount, apps) {
|
|
||||||
this._residentSource.addMount(mount, apps);
|
|
||||||
}));
|
|
||||||
|
|
||||||
discoverer.guessContentTypes(mount);
|
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
_createResidentSource: function() {
|
enable: function() {
|
||||||
this._residentSource = new AutorunResidentSource();
|
this._scanMounts();
|
||||||
this._residentSource.connect('destroy',
|
|
||||||
Lang.bind(this,
|
this._mountAddedId = this._volumeMonitor.connect('mount-added', Lang.bind(this, this._onMountAdded));
|
||||||
this._createResidentSource));
|
this._mountRemovedId = this._volumeMonitor.connect('mount-removed', Lang.bind(this, this._onMountRemoved));
|
||||||
|
},
|
||||||
|
|
||||||
|
disable: function() {
|
||||||
|
if (this._residentSource)
|
||||||
|
this._residentSource.destroy();
|
||||||
|
this._volumeMonitor.disconnect(this._mountAddedId);
|
||||||
|
this._volumeMonitor.disconnect(this._mountRemovedId);
|
||||||
|
},
|
||||||
|
|
||||||
|
_processMount: function(mount, hotplug) {
|
||||||
|
let discoverer = new ContentTypeDiscoverer(Lang.bind(this, function(mount, apps, contentTypes) {
|
||||||
|
this._ensureResidentSource();
|
||||||
|
this._residentSource.addMount(mount, apps);
|
||||||
|
|
||||||
|
if (hotplug)
|
||||||
|
this._transDispatcher.addMount(mount, apps, contentTypes);
|
||||||
|
}));
|
||||||
|
discoverer.guessContentTypes(mount);
|
||||||
|
},
|
||||||
|
|
||||||
|
_scanMounts: function() {
|
||||||
|
let mounts = this._volumeMonitor.get_mounts();
|
||||||
|
mounts.forEach(Lang.bind(this, function(mount) {
|
||||||
|
this._processMount(mount, false);
|
||||||
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
_onMountAdded: function(monitor, mount) {
|
_onMountAdded: function(monitor, mount) {
|
||||||
// don't do anything if our session is not the currently
|
// don't do anything if our session is not the currently
|
||||||
// active one
|
// active one
|
||||||
if (!Main.automountManager.ckListener.sessionActive)
|
if (!this._loginManager.sessionActive)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let discoverer = new ContentTypeDiscoverer(Lang.bind (this,
|
this._processMount(mount, true);
|
||||||
function (mount, apps, contentTypes) {
|
|
||||||
this._transDispatcher.addMount(mount, apps, contentTypes);
|
|
||||||
this._residentSource.addMount(mount, apps);
|
|
||||||
}));
|
|
||||||
|
|
||||||
discoverer.guessContentTypes(mount);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_onMountRemoved: function(monitor, mount) {
|
_onMountRemoved: function(monitor, mount) {
|
||||||
this._transDispatcher.removeMount(mount);
|
this._transDispatcher.removeMount(mount);
|
||||||
this._residentSource.removeMount(mount);
|
if (this._residentSource)
|
||||||
|
this._residentSource.removeMount(mount);
|
||||||
},
|
},
|
||||||
|
|
||||||
ejectMount: function(mount) {
|
ejectMount: function(mount) {
|
||||||
@ -236,11 +260,9 @@ AutorunManager.prototype = {
|
|||||||
try {
|
try {
|
||||||
mount.unmount_with_operation_finish(res);
|
mount.unmount_with_operation_finish(res);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// FIXME: we need to ignore G_IO_ERROR_FAILED_HANDLED errors here
|
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED_HANDLED))
|
||||||
// but we can't access the error code from JS.
|
log('Unable to eject the mount ' + mount.get_name()
|
||||||
// See https://bugzilla.gnome.org/show_bug.cgi?id=591480
|
+ ': ' + e.toString());
|
||||||
log('Unable to eject the mount ' + mount.get_name()
|
|
||||||
+ ': ' + e.toString());
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -248,11 +270,9 @@ AutorunManager.prototype = {
|
|||||||
try {
|
try {
|
||||||
source.eject_with_operation_finish(res);
|
source.eject_with_operation_finish(res);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// FIXME: we need to ignore G_IO_ERROR_FAILED_HANDLED errors here
|
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED_HANDLED))
|
||||||
// but we can't access the error code from JS.
|
log('Unable to eject the drive ' + source.get_name()
|
||||||
// See https://bugzilla.gnome.org/show_bug.cgi?id=591480
|
+ ': ' + e.toString());
|
||||||
log('Unable to eject the drive ' + source.get_name()
|
|
||||||
+ ': ' + e.toString());
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -260,33 +280,33 @@ AutorunManager.prototype = {
|
|||||||
try {
|
try {
|
||||||
drive.stop_finish(res);
|
drive.stop_finish(res);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// FIXME: we need to ignore G_IO_ERROR_FAILED_HANDLED errors here
|
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED_HANDLED))
|
||||||
// but we can't access the error code from JS.
|
log('Unable to stop the drive ' + drive.get_name()
|
||||||
// See https://bugzilla.gnome.org/show_bug.cgi?id=591480
|
+ ': ' + e.toString());
|
||||||
log('Unable to stop the drive ' + drive.get_name()
|
|
||||||
+ ': ' + e.toString());
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
});
|
||||||
|
|
||||||
function AutorunResidentSource() {
|
const AutorunResidentSource = new Lang.Class({
|
||||||
this._init();
|
Name: 'AutorunResidentSource',
|
||||||
}
|
Extends: MessageTray.Source,
|
||||||
|
|
||||||
AutorunResidentSource.prototype = {
|
_init: function(manager) {
|
||||||
__proto__: MessageTray.Source.prototype,
|
this.parent(_("Removable Devices"), 'media-removable');
|
||||||
|
this.showInLockScreen = false;
|
||||||
_init: function() {
|
|
||||||
MessageTray.Source.prototype._init.call(this, _('Removable Devices'));
|
|
||||||
|
|
||||||
this._mounts = [];
|
this._mounts = [];
|
||||||
|
|
||||||
this._notification = new AutorunResidentNotification(this);
|
this._manager = manager;
|
||||||
this._setSummaryIcon(this.createNotificationIcon());
|
this._notification = new AutorunResidentNotification(this._manager, this);
|
||||||
|
},
|
||||||
|
|
||||||
|
buildRightClickMenu: function() {
|
||||||
|
return null;
|
||||||
},
|
},
|
||||||
|
|
||||||
addMount: function(mount, apps) {
|
addMount: function(mount, apps) {
|
||||||
if (ignoreAutorunForMount(mount))
|
if (!shouldAutorunMount(mount, false))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let filtered = this._mounts.filter(function (element) {
|
let filtered = this._mounts.filter(function (element) {
|
||||||
@ -325,32 +345,22 @@ AutorunResidentSource.prototype = {
|
|||||||
Main.messageTray.add(this);
|
Main.messageTray.add(this);
|
||||||
this.pushNotification(this._notification);
|
this.pushNotification(this._notification);
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
createNotificationIcon: function() {
|
|
||||||
return new St.Icon ({ icon_name: 'media-removable',
|
|
||||||
icon_type: St.IconType.FULLCOLOR,
|
|
||||||
icon_size: this.ICON_SIZE });
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
function AutorunResidentNotification(source) {
|
const AutorunResidentNotification = new Lang.Class({
|
||||||
this._init(source);
|
Name: 'AutorunResidentNotification',
|
||||||
}
|
Extends: MessageTray.Notification,
|
||||||
|
|
||||||
AutorunResidentNotification.prototype = {
|
_init: function(manager, source) {
|
||||||
__proto__: MessageTray.Notification.prototype,
|
this.parent(source, source.title, null, { customContent: true });
|
||||||
|
|
||||||
_init: function(source) {
|
|
||||||
MessageTray.Notification.prototype._init.call(this, source,
|
|
||||||
source.title, null,
|
|
||||||
{ customContent: true });
|
|
||||||
|
|
||||||
// set the notification as resident
|
// set the notification as resident
|
||||||
this.setResident(true);
|
this.setResident(true);
|
||||||
|
|
||||||
this._layout = new St.BoxLayout ({ style_class: 'hotplug-resident-box',
|
this._layout = new St.BoxLayout ({ style_class: 'hotplug-resident-box',
|
||||||
vertical: true });
|
vertical: true });
|
||||||
|
this._manager = manager;
|
||||||
|
|
||||||
this.addActor(this._layout,
|
this.addActor(this._layout,
|
||||||
{ x_expand: true,
|
{ x_expand: true,
|
||||||
@ -359,7 +369,7 @@ AutorunResidentNotification.prototype = {
|
|||||||
|
|
||||||
updateForMounts: function(mounts) {
|
updateForMounts: function(mounts) {
|
||||||
// remove all the layout content
|
// remove all the layout content
|
||||||
this._layout.destroy_children();
|
this._layout.destroy_all_children();
|
||||||
|
|
||||||
for (let idx = 0; idx < mounts.length; idx++) {
|
for (let idx = 0; idx < mounts.length; idx++) {
|
||||||
let element = mounts[idx];
|
let element = mounts[idx];
|
||||||
@ -398,7 +408,7 @@ AutorunResidentNotification.prototype = {
|
|||||||
expand: true });
|
expand: true });
|
||||||
|
|
||||||
let ejectIcon =
|
let ejectIcon =
|
||||||
new St.Icon({ icon_name: 'media-eject',
|
new St.Icon({ icon_name: 'media-eject-symbolic',
|
||||||
style_class: 'hotplug-resident-eject-icon' });
|
style_class: 'hotplug-resident-eject-icon' });
|
||||||
|
|
||||||
let ejectButton =
|
let ejectButton =
|
||||||
@ -413,19 +423,18 @@ AutorunResidentNotification.prototype = {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
ejectButton.connect('clicked', Lang.bind(this, function() {
|
ejectButton.connect('clicked', Lang.bind(this, function() {
|
||||||
Main.autorunManager.ejectMount(mount);
|
this._manager.ejectMount(mount);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
},
|
},
|
||||||
}
|
});
|
||||||
|
|
||||||
function AutorunTransientDispatcher() {
|
const AutorunTransientDispatcher = new Lang.Class({
|
||||||
this._init();
|
Name: 'AutorunTransientDispatcher',
|
||||||
}
|
|
||||||
|
|
||||||
AutorunTransientDispatcher.prototype = {
|
_init: function(manager) {
|
||||||
_init: function() {
|
this._manager = manager;
|
||||||
this._sources = [];
|
this._sources = [];
|
||||||
this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA });
|
this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA });
|
||||||
},
|
},
|
||||||
@ -468,7 +477,7 @@ AutorunTransientDispatcher.prototype = {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// add a new source
|
// add a new source
|
||||||
this._sources.push(new AutorunTransientSource(mount, apps));
|
this._sources.push(new AutorunTransientSource(this._manager, mount, apps));
|
||||||
},
|
},
|
||||||
|
|
||||||
addMount: function(mount, apps, contentTypes) {
|
addMount: function(mount, apps, contentTypes) {
|
||||||
@ -477,7 +486,7 @@ AutorunTransientDispatcher.prototype = {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// if the mount doesn't want to be autorun, return
|
// if the mount doesn't want to be autorun, return
|
||||||
if (ignoreAutorunForMount(mount))
|
if (!shouldAutorunMount(mount, true))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let setting = this._getAutorunSettingForType(contentTypes[0]);
|
let setting = this._getAutorunSettingForType(contentTypes[0]);
|
||||||
@ -491,7 +500,7 @@ AutorunTransientDispatcher.prototype = {
|
|||||||
let app = null;
|
let app = null;
|
||||||
|
|
||||||
if (setting == AutorunSetting.RUN) {
|
if (setting == AutorunSetting.RUN) {
|
||||||
app = Gio.app_info_get_default_for_type(type, false);
|
app = Gio.app_info_get_default_for_type(contentTypes[0], false);
|
||||||
} else if (setting == AutorunSetting.FILES) {
|
} else if (setting == AutorunSetting.FILES) {
|
||||||
app = Gio.app_info_get_default_for_type('inode/directory', false);
|
app = Gio.app_info_get_default_for_type('inode/directory', false);
|
||||||
}
|
}
|
||||||
@ -515,47 +524,39 @@ AutorunTransientDispatcher.prototype = {
|
|||||||
// destroy the notification source
|
// destroy the notification source
|
||||||
source.destroy();
|
source.destroy();
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
function AutorunTransientSource(mount, apps) {
|
const AutorunTransientSource = new Lang.Class({
|
||||||
this._init(mount, apps);
|
Name: 'AutorunTransientSource',
|
||||||
}
|
Extends: MessageTray.Source,
|
||||||
|
|
||||||
AutorunTransientSource.prototype = {
|
|
||||||
__proto__: MessageTray.Source.prototype,
|
|
||||||
|
|
||||||
_init: function(mount, apps) {
|
|
||||||
MessageTray.Source.prototype._init.call(this, mount.get_name());
|
|
||||||
|
|
||||||
|
_init: function(manager, mount, apps) {
|
||||||
|
this._manager = manager;
|
||||||
this.mount = mount;
|
this.mount = mount;
|
||||||
this.apps = apps;
|
this.apps = apps;
|
||||||
|
|
||||||
this._notification = new AutorunTransientNotification(this);
|
this.parent(mount.get_name());
|
||||||
this._setSummaryIcon(this.createNotificationIcon());
|
|
||||||
|
this._notification = new AutorunTransientNotification(this._manager, this);
|
||||||
|
|
||||||
// add ourselves as a source, and popup the notification
|
// add ourselves as a source, and popup the notification
|
||||||
Main.messageTray.add(this);
|
Main.messageTray.add(this);
|
||||||
this.notify(this._notification);
|
this.notify(this._notification);
|
||||||
},
|
},
|
||||||
|
|
||||||
createNotificationIcon: function() {
|
getIcon: function() {
|
||||||
return new St.Icon({ gicon: this.mount.get_icon(),
|
return this.mount.get_icon();
|
||||||
icon_size: this.ICON_SIZE });
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
function AutorunTransientNotification(source) {
|
const AutorunTransientNotification = new Lang.Class({
|
||||||
this._init(source);
|
Name: 'AutorunTransientNotification',
|
||||||
}
|
Extends: MessageTray.Notification,
|
||||||
|
|
||||||
AutorunTransientNotification.prototype = {
|
_init: function(manager, source) {
|
||||||
__proto__: MessageTray.Notification.prototype,
|
this.parent(source, source.title, null, { customContent: true });
|
||||||
|
|
||||||
_init: function(source) {
|
|
||||||
MessageTray.Notification.prototype._init.call(this, source,
|
|
||||||
source.title, null,
|
|
||||||
{ customContent: true });
|
|
||||||
|
|
||||||
|
this._manager = manager;
|
||||||
this._box = new St.BoxLayout({ style_class: 'hotplug-transient-box',
|
this._box = new St.BoxLayout({ style_class: 'hotplug-transient-box',
|
||||||
vertical: true });
|
vertical: true });
|
||||||
this.addActor(this._box);
|
this.addActor(this._box);
|
||||||
@ -587,7 +588,7 @@ AutorunTransientNotification.prototype = {
|
|||||||
|
|
||||||
let label = new St.Bin({ y_align: St.Align.MIDDLE,
|
let label = new St.Bin({ y_align: St.Align.MIDDLE,
|
||||||
child: new St.Label
|
child: new St.Label
|
||||||
({ text: _("Open with %s").format(app.get_display_name()) })
|
({ text: _("Open with %s").format(app.get_name()) })
|
||||||
});
|
});
|
||||||
box.add(label);
|
box.add(label);
|
||||||
|
|
||||||
@ -607,7 +608,7 @@ AutorunTransientNotification.prototype = {
|
|||||||
|
|
||||||
_buttonForEject: function() {
|
_buttonForEject: function() {
|
||||||
let box = new St.BoxLayout();
|
let box = new St.BoxLayout();
|
||||||
let icon = new St.Icon({ icon_name: 'media-eject',
|
let icon = new St.Icon({ icon_name: 'media-eject-symbolic',
|
||||||
style_class: 'hotplug-notification-item-icon' });
|
style_class: 'hotplug-notification-item-icon' });
|
||||||
box.add(icon);
|
box.add(icon);
|
||||||
|
|
||||||
@ -624,10 +625,11 @@ AutorunTransientNotification.prototype = {
|
|||||||
style_class: 'hotplug-notification-item' });
|
style_class: 'hotplug-notification-item' });
|
||||||
|
|
||||||
button.connect('clicked', Lang.bind(this, function() {
|
button.connect('clicked', Lang.bind(this, function() {
|
||||||
Main.autorunManager.ejectMount(this._mount);
|
this._manager.ejectMount(this._mount);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
|
const Component = AutorunManager;
|
227
js/ui/components/keyring.js
Normal file
@ -0,0 +1,227 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
|
const Lang = imports.lang;
|
||||||
|
const Shell = imports.gi.Shell;
|
||||||
|
const Clutter = imports.gi.Clutter;
|
||||||
|
const St = imports.gi.St;
|
||||||
|
const Pango = imports.gi.Pango;
|
||||||
|
const Gio = imports.gi.Gio;
|
||||||
|
const GObject = imports.gi.GObject;
|
||||||
|
const Gcr = imports.gi.Gcr;
|
||||||
|
|
||||||
|
const ModalDialog = imports.ui.modalDialog;
|
||||||
|
const ShellEntry = imports.ui.shellEntry;
|
||||||
|
const CheckBox = imports.ui.checkBox;
|
||||||
|
|
||||||
|
let prompter = null;
|
||||||
|
|
||||||
|
const KeyringDialog = new Lang.Class({
|
||||||
|
Name: 'KeyringDialog',
|
||||||
|
Extends: ModalDialog.ModalDialog,
|
||||||
|
|
||||||
|
_init: function() {
|
||||||
|
this.parent({ styleClass: 'prompt-dialog' });
|
||||||
|
|
||||||
|
this.prompt = new Shell.KeyringPrompt();
|
||||||
|
this.prompt.connect('show-password', Lang.bind(this, this._onShowPassword));
|
||||||
|
this.prompt.connect('show-confirm', Lang.bind(this, this._onShowConfirm));
|
||||||
|
this.prompt.connect('hide-prompt', Lang.bind(this, this._onHidePrompt));
|
||||||
|
|
||||||
|
let mainContentBox = new St.BoxLayout({ style_class: 'prompt-dialog-main-layout',
|
||||||
|
vertical: false });
|
||||||
|
this.contentLayout.add(mainContentBox);
|
||||||
|
|
||||||
|
let icon = new St.Icon({ icon_name: 'dialog-password-symbolic' });
|
||||||
|
mainContentBox.add(icon,
|
||||||
|
{ x_fill: true,
|
||||||
|
y_fill: false,
|
||||||
|
x_align: St.Align.END,
|
||||||
|
y_align: St.Align.START });
|
||||||
|
|
||||||
|
this._messageBox = new St.BoxLayout({ style_class: 'prompt-dialog-message-layout',
|
||||||
|
vertical: true });
|
||||||
|
mainContentBox.add(this._messageBox,
|
||||||
|
{ y_align: St.Align.START, expand: true, x_fill: true, y_fill: true });
|
||||||
|
|
||||||
|
let subject = new St.Label({ style_class: 'prompt-dialog-headline' });
|
||||||
|
this.prompt.bind_property('message', subject, 'text', GObject.BindingFlags.SYNC_CREATE);
|
||||||
|
|
||||||
|
this._messageBox.add(subject,
|
||||||
|
{ y_fill: false,
|
||||||
|
y_align: St.Align.START });
|
||||||
|
|
||||||
|
let description = new St.Label({ style_class: 'prompt-dialog-description' });
|
||||||
|
description.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
|
description.clutter_text.line_wrap = true;
|
||||||
|
this.prompt.bind_property('description', description, 'text', GObject.BindingFlags.SYNC_CREATE);
|
||||||
|
this._messageBox.add(description,
|
||||||
|
{ y_fill: true,
|
||||||
|
y_align: St.Align.START });
|
||||||
|
|
||||||
|
this._controlTable = null;
|
||||||
|
|
||||||
|
let buttons = [{ label: '',
|
||||||
|
action: Lang.bind(this, this._onCancelButton),
|
||||||
|
key: Clutter.Escape
|
||||||
|
},
|
||||||
|
{ label: '',
|
||||||
|
action: Lang.bind(this, this._onContinueButton),
|
||||||
|
default: true
|
||||||
|
}]
|
||||||
|
|
||||||
|
this.setButtons(buttons);
|
||||||
|
this._cancelButton = buttons[0].button;
|
||||||
|
this._continueButton = buttons[1].button;
|
||||||
|
|
||||||
|
this.prompt.bind_property('cancel-label', this._cancelButton, 'label', GObject.BindingFlags.SYNC_CREATE);
|
||||||
|
this.prompt.bind_property('continue-label', this._continueButton, 'label', GObject.BindingFlags.SYNC_CREATE);
|
||||||
|
},
|
||||||
|
|
||||||
|
_buildControlTable: function() {
|
||||||
|
let table = new St.Table({ style_class: 'keyring-dialog-control-table' });
|
||||||
|
let row = 0;
|
||||||
|
|
||||||
|
if (this.prompt.password_visible) {
|
||||||
|
let label = new St.Label(({ style_class: 'prompt-dialog-password-label' }));
|
||||||
|
label.set_text(_("Password:"));
|
||||||
|
table.add(label, { row: row, col: 0,
|
||||||
|
x_expand: false, x_fill: true,
|
||||||
|
x_align: St.Align.START,
|
||||||
|
y_fill: false, y_align: St.Align.MIDDLE });
|
||||||
|
this._passwordEntry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
|
||||||
|
text: '',
|
||||||
|
can_focus: true});
|
||||||
|
this._passwordEntry.clutter_text.set_password_char('\u25cf'); // ● U+25CF BLACK CIRCLE
|
||||||
|
ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
|
||||||
|
this._passwordEntry.clutter_text.connect('activate', Lang.bind(this, this._onPasswordActivate));
|
||||||
|
table.add(this._passwordEntry, { row: row, col: 1, x_expand: true, x_fill: true, x_align: St.Align.START });
|
||||||
|
row++;
|
||||||
|
} else {
|
||||||
|
this._passwordEntry = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.prompt.confirm_visible) {
|
||||||
|
var label = new St.Label(({ style_class: 'prompt-dialog-password-label' }));
|
||||||
|
label.set_text(_("Type again:"));
|
||||||
|
table.add(label, { row: row, col: 0,
|
||||||
|
x_expand: false, x_fill: true,
|
||||||
|
x_align: St.Align.START,
|
||||||
|
y_fill: false, y_align: St.Align.MIDDLE });
|
||||||
|
this._confirmEntry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
|
||||||
|
text: '',
|
||||||
|
can_focus: true});
|
||||||
|
this._confirmEntry.clutter_text.set_password_char('\u25cf'); // ● U+25CF BLACK CIRCLE
|
||||||
|
ShellEntry.addContextMenu(this._confirmEntry, { isPassword: true });
|
||||||
|
this._confirmEntry.clutter_text.connect('activate', Lang.bind(this, this._onConfirmActivate));
|
||||||
|
table.add(this._confirmEntry, { row: row, col: 1, x_expand: true, x_fill: true, x_align: St.Align.START });
|
||||||
|
row++;
|
||||||
|
} else {
|
||||||
|
this._confirmEntry = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.prompt.set_password_actor(this._passwordEntry ? this._passwordEntry.clutter_text : null);
|
||||||
|
this.prompt.set_confirm_actor(this._confirmEntry ? this._confirmEntry.clutter_text : null);
|
||||||
|
|
||||||
|
if (this.prompt.choice_visible) {
|
||||||
|
let choice = new CheckBox.CheckBox();
|
||||||
|
this.prompt.bind_property('choice-label', choice.getLabelActor(), 'text', GObject.BindingFlags.SYNC_CREATE);
|
||||||
|
this.prompt.bind_property('choice-chosen', choice.actor, 'checked', GObject.BindingFlags.SYNC_CREATE | GObject.BindingFlags.BIDIRECTIONAL);
|
||||||
|
table.add(choice.actor, { row: row, col: 1, x_expand: false, x_fill: true, x_align: St.Align.START });
|
||||||
|
row++;
|
||||||
|
}
|
||||||
|
|
||||||
|
let warning = new St.Label({ style_class: 'prompt-dialog-error-label' });
|
||||||
|
warning.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
|
warning.clutter_text.line_wrap = true;
|
||||||
|
table.add(warning, { row: row, col: 1, x_expand: false, x_fill: false, x_align: St.Align.START });
|
||||||
|
this.prompt.bind_property('warning-visible', warning, 'visible', GObject.BindingFlags.SYNC_CREATE);
|
||||||
|
this.prompt.bind_property('warning', warning, 'text', GObject.BindingFlags.SYNC_CREATE);
|
||||||
|
|
||||||
|
if (this._controlTable) {
|
||||||
|
this._controlTable.destroy_all_children();
|
||||||
|
this._controlTable.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
this._controlTable = table;
|
||||||
|
this._messageBox.add(table, { x_fill: true, y_fill: true });
|
||||||
|
},
|
||||||
|
|
||||||
|
_ensureOpen: function() {
|
||||||
|
// NOTE: ModalDialog.open() is safe to call if the dialog is
|
||||||
|
// already open - it just returns true without side-effects
|
||||||
|
if (this.open())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// The above fail if e.g. unable to get input grab
|
||||||
|
//
|
||||||
|
// In an ideal world this wouldn't happen (because the
|
||||||
|
// Shell is in complete control of the session) but that's
|
||||||
|
// just not how things work right now.
|
||||||
|
|
||||||
|
log('keyringPrompt: Failed to show modal dialog.' +
|
||||||
|
' Dismissing prompt request');
|
||||||
|
this.prompt.cancel()
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
_onShowPassword: function(prompt) {
|
||||||
|
this._buildControlTable();
|
||||||
|
this._ensureOpen();
|
||||||
|
this._passwordEntry.grab_key_focus();
|
||||||
|
},
|
||||||
|
|
||||||
|
_onShowConfirm: function(prompt) {
|
||||||
|
this._buildControlTable();
|
||||||
|
this._ensureOpen();
|
||||||
|
this._continueButton.grab_key_focus();
|
||||||
|
},
|
||||||
|
|
||||||
|
_onHidePrompt: function(prompt) {
|
||||||
|
this.close();
|
||||||
|
},
|
||||||
|
|
||||||
|
_onPasswordActivate: function() {
|
||||||
|
if (this.prompt.confirm_visible)
|
||||||
|
this._confirmEntry.grab_key_focus();
|
||||||
|
else
|
||||||
|
this._onContinueButton();
|
||||||
|
},
|
||||||
|
|
||||||
|
_onConfirmActivate: function() {
|
||||||
|
this._onContinueButton();
|
||||||
|
},
|
||||||
|
|
||||||
|
_onContinueButton: function() {
|
||||||
|
this.prompt.complete();
|
||||||
|
},
|
||||||
|
|
||||||
|
_onCancelButton: function() {
|
||||||
|
this.prompt.cancel();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const KeyringPrompter = new Lang.Class({
|
||||||
|
Name: 'KeyringPrompter',
|
||||||
|
|
||||||
|
_init: function() {
|
||||||
|
this._prompter = new Gcr.SystemPrompter();
|
||||||
|
this._prompter.connect('new-prompt', function(prompter) {
|
||||||
|
let dialog = new KeyringDialog();
|
||||||
|
return dialog.prompt;
|
||||||
|
});
|
||||||
|
this._dbusId = null;
|
||||||
|
},
|
||||||
|
|
||||||
|
enable: function() {
|
||||||
|
this._prompter.register(Gio.DBus.session);
|
||||||
|
this._dbusId = Gio.DBus.session.own_name('org.gnome.keyring.SystemPrompter',
|
||||||
|
Gio.BusNameOwnerFlags.REPLACE, null, null);
|
||||||
|
},
|
||||||
|
|
||||||
|
disable: function() {
|
||||||
|
this._prompter.unregister(false);
|
||||||
|
Gio.DBus.session.unown_name(this._dbusId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const Component = KeyringPrompter;
|
647
js/ui/components/mediaKeysManager.js
Normal file
@ -0,0 +1,647 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
|
const Clutter = imports.gi.Clutter;
|
||||||
|
const Gdk = imports.gi.Gdk;
|
||||||
|
const GLib = imports.gi.GLib;
|
||||||
|
const Gio = imports.gi.Gio;
|
||||||
|
const Lang = imports.lang;
|
||||||
|
const Meta = imports.gi.Meta;
|
||||||
|
const Shell = imports.gi.Shell;
|
||||||
|
const St = imports.gi.St;
|
||||||
|
|
||||||
|
const Main = imports.ui.main;
|
||||||
|
const MessageTray = imports.ui.messageTray;
|
||||||
|
const ShellMountOperation = imports.ui.shellMountOperation;
|
||||||
|
const Tweener = imports.ui.tweener;
|
||||||
|
const Util = imports.misc.util;
|
||||||
|
|
||||||
|
const INTERFACE_SETTINGS = 'org.gnome.desktop.interface';
|
||||||
|
const POWER_SETTINGS = 'org.gnome.settings-daemon.plugins.power';
|
||||||
|
const XSETTINGS_SETTINGS = 'org.gnome.settings-daemon.plugins.xsettings';
|
||||||
|
const TOUCHPAD_SETTINGS = 'org.gnome.settings-daemon.peripherals.touchpad';
|
||||||
|
const KEYBINDING_SETTINGS = 'org.gnome.settings-daemon.plugins.media-keys';
|
||||||
|
const CUSTOM_KEYBINDING_SETTINGS = 'org.gnome.settings-daemon.plugins.media-keys.custom-keybinding';
|
||||||
|
const A11Y_SETTINGS = 'org.gnome.desktop.a11y.applications';
|
||||||
|
const MAGNIFIER_SETTINGS = 'org.gnome.desktop.a11y.magnifier';
|
||||||
|
const INPUT_SOURCE_SETTINGS = 'org.gnome.desktop.input-sources';
|
||||||
|
|
||||||
|
const MediaKeysInterface = <interface name='org.gnome.SettingsDaemon.MediaKeys'>
|
||||||
|
<method name='GrabMediaPlayerKeys'>
|
||||||
|
<arg name='application' direction='in' type='s'/>
|
||||||
|
<arg name='time' direction='in' type='u'/>
|
||||||
|
</method>
|
||||||
|
<method name='ReleaseMediaPlayerKeys'>
|
||||||
|
<arg name='application' direction='in' type='s'/>
|
||||||
|
</method>
|
||||||
|
<signal name='MediaPlayerKeyPressed'>
|
||||||
|
<arg name='application' type='s'/>
|
||||||
|
<arg name='key' type='s'/>
|
||||||
|
</signal>
|
||||||
|
</interface>;
|
||||||
|
|
||||||
|
/* [ actionName, setting, hardcodedKeysym, overviewOnly, args ] */
|
||||||
|
/* (overviewOnly means that the keybinding is handled when the shell is not
|
||||||
|
modal, or when the overview is active, but not when other modal operations
|
||||||
|
are active; otherwise the keybinding is always handled) */
|
||||||
|
const DEFAULT_KEYBINDINGS = [
|
||||||
|
[ 'doTouchpadToggle', null, 'XF86TouchpadToggle', false ],
|
||||||
|
[ 'doTouchpadSet', null, 'XF86TouchpadOn', false, [ true ] ],
|
||||||
|
[ 'doTouchpadSet', null, 'XF86TouchpadOff', false, [ false ] ],
|
||||||
|
[ 'doMute', 'volume-mute', null, false, [ false ] ],
|
||||||
|
[ 'doVolumeAdjust', 'volume-down', null, false, [ Clutter.ScrollDirection.DOWN, false ] ],
|
||||||
|
[ 'doVolumeAdjust', 'volume-up', null, false, [ Clutter.ScrollDirection.UP, false ] ],
|
||||||
|
[ 'doMute', null, '<Alt>XF86AudioMute', false, [ true ] ],
|
||||||
|
[ 'doVolumeAdjust', null, '<Alt>XF86AudioLowerVolume', false, [ Clutter.ScrollDirection.DOWN, true ] ],
|
||||||
|
[ 'doVolumeAdjust', null, '<Alt>XF86AudioRaiseVolume', false, [ Clutter.ScrollDirection.UP, true ] ],
|
||||||
|
[ 'doLogout', 'logout', null, true ],
|
||||||
|
[ 'doEject', 'eject', null, false ],
|
||||||
|
[ 'doHome', 'home', null, true ],
|
||||||
|
[ 'doLaunchMimeHandler', 'media', null, true, [ 'application/x-vorbis+ogg' ] ],
|
||||||
|
[ 'doLaunchApp', 'calculator', null, true, [ 'gcalcltool.desktop' ] ],
|
||||||
|
[ 'doLaunchApp', 'search', null, true, [ 'tracker-needle.desktop' ] ],
|
||||||
|
[ 'doLaunchMimeHandler', 'email', null, true, [ 'x-scheme-handler/mailto' ] ],
|
||||||
|
[ 'doScreensaver', 'screensaver', null, true ],
|
||||||
|
[ 'doScreensaver', null, 'XF86ScreenSaver', true ],
|
||||||
|
[ 'doLaunchApp', 'help', null, true, [ 'yelp.desktop' ] ],
|
||||||
|
[ 'doSpawn', 'screenshot', null, true, [ ['gnome-screenshot'] ] ],
|
||||||
|
[ 'doSpawn', 'window-screenshot', null, true, [ ['gnome-screenshot', '--window'] ] ],
|
||||||
|
[ 'doSpawn', 'area-screenshot', null, true, [ ['gnome-screenshot', '--area'] ] ],
|
||||||
|
[ 'doSpawn', 'screenshot-clip', null, true, [ ['gnome-screenshot', '--clipboard'] ] ],
|
||||||
|
[ 'doSpawn', 'window-screenshot-clip', null, true, [ ['gnome-screenshot', '--window', '--clipboard'] ] ],
|
||||||
|
[ 'doSpawn', 'area-screenshot-clip', null, true, [ ['gnome-screenshot', '--area', '--clipboard'] ] ],
|
||||||
|
[ 'doLaunchMimeHandler', 'www', null, true, [ 'x-scheme-handler/http' ] ],
|
||||||
|
[ 'doMediaKey', 'play', null, true, [ 'Play' ] ],
|
||||||
|
[ 'doMediaKey', 'pause', null, true, [ 'Pause' ] ],
|
||||||
|
[ 'doMediaKey', 'stop', null, true, [ 'Stop' ] ],
|
||||||
|
[ 'doMediaKey', 'previous', null, true, [ 'Previous' ] ],
|
||||||
|
[ 'doMediaKey', 'next', null, true, [ 'Next' ] ],
|
||||||
|
[ 'doMediaKey', null, 'XF86AudioRewind', true, [ 'Rewind' ] ],
|
||||||
|
[ 'doMediaKey', null, 'XF86AudioForward', true, [ 'FastForward' ] ],
|
||||||
|
[ 'doMediaKey', null, 'XF86AudioRepeat', true, [ 'Repeat' ] ],
|
||||||
|
[ 'doMediaKey', null, 'XF86AudioRandomPlay', true, [ 'Shuffle' ] ],
|
||||||
|
[ 'doXRandRAction', null, '<Super>p', false, [ 'VideoModeSwitch' ] ],
|
||||||
|
/* Key code of the XF86Display key (Fn-F7 on Thinkpads, Fn-F4 on HP machines, etc.) */
|
||||||
|
[ 'doXRandRAction', null, 'XF86Display', false, [ 'VideoModeSwitch' ] ],
|
||||||
|
/* Key code of the XF86RotateWindows key (present on some tablets) */
|
||||||
|
[ 'doXRandRAction', null, 'XF86RotateWindows', false, [ 'Rotate' ] ],
|
||||||
|
[ 'doA11yAction', 'magnifier', null, true, [ 'screen-magnifier-enabled' ] ],
|
||||||
|
[ 'doA11yAction', 'screenreader', null, true, [ 'screen-reader-enabled' ] ],
|
||||||
|
[ 'doA11yAction', 'on-screen-keyboard', null, true, [ 'screen-keyboard-enabled' ] ],
|
||||||
|
[ 'doTextSize', 'increase-text-size', null, true, [ 1 ] ],
|
||||||
|
[ 'doTextSize', 'decrease-text-size', null, true, [ -1 ] ],
|
||||||
|
[ 'doToggleContrast', 'toggle-contrast', null, true ],
|
||||||
|
[ 'doMagnifierZoom', 'magnifier-zoom-in', null, true, [ 1 ] ],
|
||||||
|
[ 'doMagnifierZoom', 'magnifier-zoom-out', null, true, [ -1 ] ],
|
||||||
|
[ 'doPowerAction', null, 'XF86PowerOff', true, [ 'button-power' ] ],
|
||||||
|
/* the kernel / Xorg names really are like this... */
|
||||||
|
[ 'doPowerAction', null, 'XF86Suspend', false, [ 'button-sleep' ] ],
|
||||||
|
[ 'doPowerAction', null, 'XF86Sleep', false, [ 'button-suspend' ] ],
|
||||||
|
[ 'doPowerAction', null, 'XF86Hibernate', false, [ 'button-hibernate' ] ],
|
||||||
|
[ 'doBrightness', null, 'XF86MonBrightnessUp', false, [ 'Screen', 'StepUp' ] ],
|
||||||
|
[ 'doBrightness', null, 'XF86MonBrightnessDown', false, [ 'Screen', 'StepDown' ] ],
|
||||||
|
[ 'doBrightness', null, 'XF86KbdBrightnessUp', false, [ 'Keyboard', 'StepUp' ] ],
|
||||||
|
[ 'doBrightness', null, 'XF86KbdBrightnessDown', false, [ 'Keyboard', 'StepDown' ] ],
|
||||||
|
[ 'doBrightnessToggle', null, 'XF86KbdLightOnOff', false, ],
|
||||||
|
[ 'doInputSource', 'switch-input-source', null, false, [ +1 ] ],
|
||||||
|
[ 'doInputSource', 'switch-input-source-backward', null, false, [ -1 ] ],
|
||||||
|
[ 'doLaunchApp', null, 'XF86Battery', true, [ 'gnome-power-statistics.desktop' ] ]
|
||||||
|
];
|
||||||
|
|
||||||
|
var osdWin;
|
||||||
|
const OSDWindow = new Lang.Class({
|
||||||
|
Name: 'OSDWindow',
|
||||||
|
|
||||||
|
FADE_TIMEOUT: 1500,
|
||||||
|
FADE_DURATION: 100,
|
||||||
|
|
||||||
|
_init: function(iconName, value) {
|
||||||
|
/* assume 130x130 on a 640x480 display and scale from there */
|
||||||
|
let monitor = Main.layoutManager.primaryMonitor;
|
||||||
|
let scalew = monitor.width / 640.0;
|
||||||
|
let scaleh = monitor.height / 480.0;
|
||||||
|
let scale = Math.min(scalew, scaleh);
|
||||||
|
let size = 130 * Math.max(1, scale);
|
||||||
|
|
||||||
|
this.actor = new St.BoxLayout({ style_class: 'osd-window',
|
||||||
|
vertical: true,
|
||||||
|
reactive: false,
|
||||||
|
visible: false,
|
||||||
|
width: size,
|
||||||
|
height: size,
|
||||||
|
});
|
||||||
|
|
||||||
|
this._icon = new St.Icon({ icon_name: iconName,
|
||||||
|
icon_size: size / 2,
|
||||||
|
});
|
||||||
|
this.actor.add(this._icon, { expand: true,
|
||||||
|
x_align: St.Align.MIDDLE,
|
||||||
|
y_align: St.Align.MIDDLE });
|
||||||
|
|
||||||
|
this._value = value;
|
||||||
|
this._progressBar = new St.DrawingArea({ style_class: 'osd-progress-bar' });
|
||||||
|
this._progressBar.connect('repaint', Lang.bind(this, this._drawProgress));
|
||||||
|
this.actor.add(this._progressBar, { expand: true, x_fill: true, y_fill: false });
|
||||||
|
this._progressBar.visible = value !== undefined;
|
||||||
|
|
||||||
|
Main.layoutManager.addChrome(this.actor);
|
||||||
|
|
||||||
|
/* Position in the middle of primary monitor */
|
||||||
|
let [width, height] = this.actor.get_size();
|
||||||
|
this.actor.x = ((monitor.width - width) / 2) + monitor.x;
|
||||||
|
this.actor.y = monitor.y + (monitor.height / 2) + (monitor.height / 2 - height) / 2;
|
||||||
|
},
|
||||||
|
|
||||||
|
show: function() {
|
||||||
|
this.actor.show();
|
||||||
|
Tweener.addTween(this.actor,
|
||||||
|
{ opacity: 255,
|
||||||
|
time: this.FADE_DURATION / 1000,
|
||||||
|
transition: 'easeInQuad' });
|
||||||
|
|
||||||
|
if (this._timeoutId)
|
||||||
|
GLib.source_remove(this._timeoutId);
|
||||||
|
|
||||||
|
this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, this.FADE_TIMEOUT, Lang.bind(this, this.hide));
|
||||||
|
},
|
||||||
|
|
||||||
|
hide: function() {
|
||||||
|
Tweener.addTween(this.actor,
|
||||||
|
{ opacity: 0,
|
||||||
|
time: this.FADE_DURATION / 1000,
|
||||||
|
transition: 'easeOutQuad',
|
||||||
|
onComplete: function() {
|
||||||
|
this.actor.destroy();
|
||||||
|
this.actor = null;
|
||||||
|
osdWin = null;
|
||||||
|
},
|
||||||
|
onCompleteScope: this });
|
||||||
|
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
setIcon: function(name) {
|
||||||
|
this._icon.icon_name = name;
|
||||||
|
},
|
||||||
|
|
||||||
|
setValue: function(value) {
|
||||||
|
if (value == this._value)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this._value = value;
|
||||||
|
this._progressBar.visible = value !== undefined;
|
||||||
|
this._progressBar.queue_repaint();
|
||||||
|
},
|
||||||
|
|
||||||
|
_drawProgress: function(area) {
|
||||||
|
let cr = area.get_context();
|
||||||
|
|
||||||
|
let themeNode = this.actor.get_theme_node();
|
||||||
|
let color = themeNode.get_foreground_color();
|
||||||
|
Clutter.cairo_set_source_color(cr, color);
|
||||||
|
|
||||||
|
let [width, height] = area.get_surface_size();
|
||||||
|
width = width * this._value;
|
||||||
|
|
||||||
|
cr.moveTo(0,0);
|
||||||
|
cr.lineTo(width, 0);
|
||||||
|
cr.lineTo(width, height);
|
||||||
|
cr.lineTo(0, height);
|
||||||
|
cr.fill();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function showOSD(icon, value) {
|
||||||
|
if (osdWin) {
|
||||||
|
osdWin.setIcon(icon);
|
||||||
|
osdWin.setValue(value);
|
||||||
|
} else {
|
||||||
|
osdWin = new OSDWindow(icon, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
osdWin.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
const MediaKeysGrabber = new Lang.Class({
|
||||||
|
Name: 'MediaKeysGrabber',
|
||||||
|
|
||||||
|
_init: function() {
|
||||||
|
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(MediaKeysInterface, this);
|
||||||
|
this._apps = [];
|
||||||
|
},
|
||||||
|
|
||||||
|
enable: function() {
|
||||||
|
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/SettingsDaemon/MediaKeys');
|
||||||
|
},
|
||||||
|
|
||||||
|
disable: function() {
|
||||||
|
this._dbusImpl.unexport();
|
||||||
|
},
|
||||||
|
|
||||||
|
GrabMediaPlayerKeysAsync: function(parameters, invocation) {
|
||||||
|
let [appName, time] = parameters;
|
||||||
|
|
||||||
|
/* I'm not sure of this code, but it is in gnome-settings-daemon
|
||||||
|
(letting alone that the introspection is wrong in glib...)
|
||||||
|
*/
|
||||||
|
if (time == Gdk.CURRENT_TIME) {
|
||||||
|
let tv = new GLib.TimeVal;
|
||||||
|
GLib.get_current_time(tv);
|
||||||
|
time = tv.tv_sec * 1000 + tv.tv_usec / 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
let pos = -1;
|
||||||
|
for (let i = 0; i < this._apps.length; i++) {
|
||||||
|
if (this._apps[i].appName == appName) {
|
||||||
|
pos = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pos != -1)
|
||||||
|
this._freeMediaPlayer(pos);
|
||||||
|
|
||||||
|
let app = {
|
||||||
|
appName: appName,
|
||||||
|
name: invocation.get_sender(),
|
||||||
|
time: time,
|
||||||
|
watchId: Gio.DBus.session.watch_name(invocation.get_sender(),
|
||||||
|
Gio.BusNameWatcherFlags.NONE,
|
||||||
|
null,
|
||||||
|
Lang.bind(this, this._onNameVanished)),
|
||||||
|
};
|
||||||
|
Util.insertSorted(this._apps, app, function(a, b) {
|
||||||
|
return b.time-a.time;
|
||||||
|
});
|
||||||
|
|
||||||
|
invocation.return_value(GLib.Variant.new('()', []));
|
||||||
|
},
|
||||||
|
|
||||||
|
ReleaseMediaPlayerAsync: function(parameters, invocation) {
|
||||||
|
let name = invocation.get_sender();
|
||||||
|
let [appName] = parameters;
|
||||||
|
|
||||||
|
let pos = -1;
|
||||||
|
for (let i = 0; i < this._apps.length; i++) {
|
||||||
|
if (this._apps[i].appName == appName) {
|
||||||
|
pos = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pos == -1) {
|
||||||
|
for (let i = 0; i < this._apps.length; i++) {
|
||||||
|
if (this._apps[i].name == name) {
|
||||||
|
pos = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pos != -1)
|
||||||
|
this._freeMediaPlayer(pos);
|
||||||
|
|
||||||
|
invocation.return_value(GLib.Variant.new('()', []));
|
||||||
|
},
|
||||||
|
|
||||||
|
_freeMediaPlayer: function(pos) {
|
||||||
|
let app = this._apps[pos];
|
||||||
|
Gio.bus_unwatch_name(app.watchId)
|
||||||
|
|
||||||
|
this._apps.splice(pos, 1);
|
||||||
|
},
|
||||||
|
|
||||||
|
mediaKeyPressed: function(key) {
|
||||||
|
if (this._apps.length == 0) {
|
||||||
|
showOSD('action-unavailable-symbolic');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let app = this._apps[0];
|
||||||
|
Gio.DBus.session.emit_signal(app.name,
|
||||||
|
'/org/gnome/SettingsDaemon/MediaKeys',
|
||||||
|
'org.gnome.SettingsDaemon.MediaKeys',
|
||||||
|
'MediaPlayerKeyPressed',
|
||||||
|
GLib.Variant.new('(ss)', [app.appName || '',
|
||||||
|
key]));
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const MediaKeysManager = new Lang.Class({
|
||||||
|
Name: 'MediaKeysManager',
|
||||||
|
|
||||||
|
_init: function() {
|
||||||
|
this._a11yControl = Main.panel.statusArea.a11y;
|
||||||
|
this._volumeControl = Main.panel.statusArea.volume;
|
||||||
|
this._userMenu = Main.panel.statusArea.userMenu;
|
||||||
|
this._mediaPlayerKeys = new MediaKeysGrabber();
|
||||||
|
|
||||||
|
this._keybindingSettings = new Gio.Settings({ schema: KEYBINDING_SETTINGS });
|
||||||
|
},
|
||||||
|
|
||||||
|
enable: function() {
|
||||||
|
for (let i = 0; i < DEFAULT_KEYBINDINGS.length; i++) {
|
||||||
|
let [action, setting, keyval, overviewOnly, args] = DEFAULT_KEYBINDINGS[i];
|
||||||
|
let func = this[action];
|
||||||
|
if (!func) {
|
||||||
|
log('Keybinding action %s is missing'.format(action));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
let name = setting ? setting : 'media-keys-keybindings-%d'.format(i);
|
||||||
|
let ok;
|
||||||
|
func = Util.wrapKeybinding(Lang.bind.apply(null, [this, func].concat(args)), overviewOnly);
|
||||||
|
if (setting)
|
||||||
|
ok = global.display.add_keybinding(setting, this._keybindingSettings,
|
||||||
|
Meta.KeyBindingFlags.BUILTIN |
|
||||||
|
Meta.KeyBindingFlags.IS_SINGLE |
|
||||||
|
Meta.KeyBindingFlags.HANDLE_WHEN_GRABBED, func);
|
||||||
|
else
|
||||||
|
ok = global.display.add_grabbed_key(name, keyval,
|
||||||
|
Meta.KeyBindingFlags.HANDLE_WHEN_GRABBED, func);
|
||||||
|
|
||||||
|
if (!ok)
|
||||||
|
log('Installing keybinding %s failed'.format(name));
|
||||||
|
}
|
||||||
|
|
||||||
|
this._customKeybindings = [];
|
||||||
|
this._changedId = this._keybindingSettings.connect('changed::custom-keybindings',
|
||||||
|
Lang.bind(this, this._reloadCustomKeybindings));
|
||||||
|
this._reloadCustomKeybindings();
|
||||||
|
|
||||||
|
this._mediaPlayerKeys.enable();
|
||||||
|
},
|
||||||
|
|
||||||
|
disable: function() {
|
||||||
|
for (let i = 0; i < DEFAULT_KEYBINDINGS.length; i++) {
|
||||||
|
let [action, setting, keyval, overviewOnly, args] = DEFAULT_KEYBINDINGS[i];
|
||||||
|
|
||||||
|
let name = setting ? setting : 'media-keys-keybindings-%d'.format(i);
|
||||||
|
if (setting)
|
||||||
|
global.display.remove_keybinding(setting, this._keybindingSettings);
|
||||||
|
else
|
||||||
|
global.display.remove_grabbed_key(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
this._clearCustomKeybindings();
|
||||||
|
this._keybindingSettings.disconnect(this._changedId);
|
||||||
|
|
||||||
|
this._mediaPlayerKeys.disable();
|
||||||
|
},
|
||||||
|
|
||||||
|
_clearCustomKeybindings: function() {
|
||||||
|
for (let i = 0; i < this._customKeybindings.length; i++)
|
||||||
|
global.display.remove_keybinding('binding', this._customKeybindings[i]);
|
||||||
|
|
||||||
|
this._customKeybindings = [];
|
||||||
|
},
|
||||||
|
|
||||||
|
_reloadCustomKeybindings: function() {
|
||||||
|
this._clearCustomKeybindings();
|
||||||
|
|
||||||
|
let paths = this._keybindingSettings.get_strv('custom-keybindings');
|
||||||
|
for (let i = 0; i < paths.length; i++) {
|
||||||
|
let setting = new Gio.Settings({ schema: CUSTOM_KEYBINDING_SETTINGS,
|
||||||
|
path: paths[i] });
|
||||||
|
let func = Util.wrapKeybinding(Lang.bind(this, this.doCustom, setting), true);
|
||||||
|
|
||||||
|
global.display.add_keybinding('binding', setting,
|
||||||
|
Meta.KeyBindingFlags.IS_SINGLE |
|
||||||
|
Meta.KeyBindingFlags.HANDLE_WHEN_GRABBED, func);
|
||||||
|
this._customKeybindings.push(setting);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
doCustom: function(display, screen, window, binding, settings) {
|
||||||
|
let command = settings.get_string('command');
|
||||||
|
Util.spawnCommandLine(command);
|
||||||
|
},
|
||||||
|
|
||||||
|
doTouchpadToggle: function(display, screen, window, binding) {
|
||||||
|
let settings = new Gio.Settings({ schema: TOUCHPAD_SETTINGS });
|
||||||
|
let enabled = settings.get_boolean('touchpad-enabled');
|
||||||
|
|
||||||
|
this.doTouchpadSet(display, screen, window, binding, !enabled);
|
||||||
|
settings.set_boolean(!enabled);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
doTouchpadSet: function(display, screen, window, binding, enabled) {
|
||||||
|
showOSD(enabled ? 'input-touchpad-symbolic' : 'touchpad-disabled-symbolic');
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
doMute: function(display, screen, window, binding, quiet) {
|
||||||
|
let [icon, value] = this._volumeControl.volumeMenu.toggleMute(quiet);
|
||||||
|
showOSD(icon, value);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
doVolumeAdjust: function(display, screen, window, binding, direction, quiet) {
|
||||||
|
let [icon, value] = this._volumeControl.volumeMenu.scroll(direction, quiet);
|
||||||
|
showOSD(icon, value);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
doLogout: function(display, screen, window, binding) {
|
||||||
|
this._userMenu.logOut();
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
doEject: function(display, screen, window, binding) {
|
||||||
|
let volumeMonitor = Gio.VolumeMonitor.get();
|
||||||
|
|
||||||
|
let drives = volumeMonitor.get_connected_drives();
|
||||||
|
let score = 0, drive;
|
||||||
|
for (let i = 0; i < drives.length; i++) {
|
||||||
|
if (!drives[i].can_eject())
|
||||||
|
continue;
|
||||||
|
if (!drives[i].is_media_removable())
|
||||||
|
continue;
|
||||||
|
if (score < 1) {
|
||||||
|
drive = drives[i];
|
||||||
|
score = 1;
|
||||||
|
}
|
||||||
|
if (!drives[i].has_media())
|
||||||
|
continue;
|
||||||
|
if (score < 2) {
|
||||||
|
drive = drives[i];
|
||||||
|
score = 2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
showOSD('media-eject-custom-symbolic');
|
||||||
|
|
||||||
|
if (!drive)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
let mountOp = new ShellMountOperation.ShellMountOperation(drive);
|
||||||
|
drive.eject_with_operation(Gio.MountUnmountFlags.FORCE,
|
||||||
|
mountOp.mountOp, null, null);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
doHome: function() {
|
||||||
|
let homeFile = Gio.file_new_for_path (GLib.get_home_dir());
|
||||||
|
let homeUri = homeFile.get_uri();
|
||||||
|
Gio.app_info_launch_default_for_uri(homeUri, null);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
doLaunchMimeHandler: function(display, screen, window, binding, mimeType) {
|
||||||
|
let gioApp = Gio.AppInfo.get_default_for_type(mimeType, false);
|
||||||
|
if (gioApp != null) {
|
||||||
|
let app = Shell.AppSystem.get_default().lookup_app(gioApp.get_id());
|
||||||
|
app.open_new_window(-1);
|
||||||
|
} else {
|
||||||
|
log('Could not find default application for \'%s\' mime-type'.format(mimeType));
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
doLaunchApp: function(display, screen, window, binding, appId) {
|
||||||
|
let app = Shell.AppSystem.get_default().lookup_app(appId);
|
||||||
|
app.open_new_window(-1);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
doScreensaver: function() {
|
||||||
|
// FIXME: handled in house, to the screenshield!
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
doSpawn: function(display, screen, window, binding, argv) {
|
||||||
|
Util.spawn(argv);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
doMediaKey: function(display, screen, window, binding, key) {
|
||||||
|
this._mediaPlayerKeys.mediaKeyPressed(key);
|
||||||
|
},
|
||||||
|
|
||||||
|
_onXRandRFinished: function(connection, result) {
|
||||||
|
connection.call_finish(result);
|
||||||
|
this._XRandRCancellable = null;
|
||||||
|
},
|
||||||
|
|
||||||
|
doXRandRAction: function(display, screen, window, binding, action) {
|
||||||
|
if (this._XRandRCancellable)
|
||||||
|
this._XRandRCancellable.cancel();
|
||||||
|
|
||||||
|
this._XRandRCancellable = new Gio.Cancellable();
|
||||||
|
Gio.DBus.session.call('org.gnome.SettingsDaemon',
|
||||||
|
'/org/gnome/SettingsDaemon/XRANDR',
|
||||||
|
'org.gnome.SettingsDaemon.XRANDR_2',
|
||||||
|
action,
|
||||||
|
GLib.Variant.new('(x)', [global.get_current_time()]),
|
||||||
|
null, /* reply type */
|
||||||
|
Gio.DBusCallFlags.NONE,
|
||||||
|
-1,
|
||||||
|
this._XRandRCancellable,
|
||||||
|
Lang.bind(this, this._onXRandRFinished));
|
||||||
|
},
|
||||||
|
|
||||||
|
doA11yAction: function(display, screen, window, binding, key) {
|
||||||
|
let settings = new Gio.Settings({ schema: A11Y_SETTINGS });
|
||||||
|
let enabled = settings.get_boolean(key);
|
||||||
|
settings.set_boolean(key, !enabled);
|
||||||
|
},
|
||||||
|
|
||||||
|
doTextSize: function(display, screen, window, binding, multiplier) {
|
||||||
|
// Same values used in the Seeing tab of the Universal Access panel
|
||||||
|
const FACTORS = [ 0.75, 1.0, 1.25, 1.5 ];
|
||||||
|
|
||||||
|
// Figure out the current DPI scaling factor
|
||||||
|
let settings = new Gio.Settings({ schema: INTERFACE_SETTINGS });
|
||||||
|
let factor = settings.get_double('text-scaling-factor');
|
||||||
|
factor += multiplier * 0.25;
|
||||||
|
|
||||||
|
/* Try to find a matching value */
|
||||||
|
let distance = 1e6;
|
||||||
|
let best = 1.0;
|
||||||
|
for (let i = 0; i < FACTORS.length; i++) {
|
||||||
|
let d = Math.abs(factor - FACTORS[i]);
|
||||||
|
if (d < distance) {
|
||||||
|
best = factors[i];
|
||||||
|
distance = d;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (best == 1.0)
|
||||||
|
settings.reset('text-scaling-factor');
|
||||||
|
else
|
||||||
|
settings.set_double('text-scaling-factor', best);
|
||||||
|
},
|
||||||
|
|
||||||
|
doToggleContrast: function(display, screen, window, binding) {
|
||||||
|
this._a11yControl.toggleHighContrast();
|
||||||
|
},
|
||||||
|
|
||||||
|
doMagnifierZoom: function(display, screen, window, binding, offset) {
|
||||||
|
let settings = new Gio.Settings({ schema: MAGNIFIER_SETTINGS });
|
||||||
|
|
||||||
|
let value = settings.get_value('mag-factor');
|
||||||
|
value = Math.round(value + offset);
|
||||||
|
settings.set_value('mag-factor', value);
|
||||||
|
},
|
||||||
|
|
||||||
|
doPowerAction: function(display, screen, window, binding, action) {
|
||||||
|
let settings = new Gio.Settings({ schema: POWER_SETTINGS });
|
||||||
|
switch (settings.get_string(action)) {
|
||||||
|
case 'suspend':
|
||||||
|
this._userMenu.suspend();
|
||||||
|
break;
|
||||||
|
case 'interactive':
|
||||||
|
case 'shutdown':
|
||||||
|
this._userMenu.shutdown();
|
||||||
|
break;
|
||||||
|
case 'hibernate':
|
||||||
|
this._userMenu.hibernate();
|
||||||
|
break;
|
||||||
|
case 'blank':
|
||||||
|
case 'default':
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_onBrightnessFinished: function(connection, result, kind) {
|
||||||
|
let [percentage] = connection.call_finish(result).deep_unpack();
|
||||||
|
|
||||||
|
let icon = kind == 'Keyboard' ? 'keyboard-brightness-symbolic' : 'display-brightness-symbolic';
|
||||||
|
showOSD(icon, percentage / 100);
|
||||||
|
},
|
||||||
|
|
||||||
|
doBrightness: function(display, screen, window, binding, kind, action) {
|
||||||
|
let iface = 'org.gnome.SettingsDaemon.Power.' + kind;
|
||||||
|
let objectPath = '/org/gnome/SettingsDaemon/Power';
|
||||||
|
|
||||||
|
Gio.DBus.session.call('org.gnome.SettingsDaemon',
|
||||||
|
objectPath, iface, action,
|
||||||
|
null, null, /* parameters, reply type */
|
||||||
|
Gio.DBusCallFlags.NONE, -1, null,
|
||||||
|
Lang.bind(this, this._onBrightnessFinished, kind));
|
||||||
|
},
|
||||||
|
|
||||||
|
doInputSource: function(display, screen, window, binding, offset) {
|
||||||
|
let settings = new Gio.Settings({ schema: INPUT_SOURCE_SETTINGS });
|
||||||
|
|
||||||
|
let current = settings.get_uint('current');
|
||||||
|
let max = settings.get_strv('sources').length - 1;
|
||||||
|
|
||||||
|
current += offset;
|
||||||
|
if (current < 0)
|
||||||
|
current = 0;
|
||||||
|
else if (current > max)
|
||||||
|
current = max;
|
||||||
|
|
||||||
|
settings.set_uint('current', current);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const Component = MediaKeysManager;
|
707
js/ui/components/networkAgent.js
Normal file
@ -0,0 +1,707 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
|
const Clutter = imports.gi.Clutter;
|
||||||
|
const Gio = imports.gi.Gio;
|
||||||
|
const GLib = imports.gi.GLib;
|
||||||
|
const GObject = imports.gi.GObject;
|
||||||
|
const Lang = imports.lang;
|
||||||
|
const NetworkManager = imports.gi.NetworkManager;
|
||||||
|
const NMClient = imports.gi.NMClient;
|
||||||
|
const Pango = imports.gi.Pango;
|
||||||
|
const Shell = imports.gi.Shell;
|
||||||
|
const St = imports.gi.St;
|
||||||
|
|
||||||
|
const Config = imports.misc.config;
|
||||||
|
const ModalDialog = imports.ui.modalDialog;
|
||||||
|
const PopupMenu = imports.ui.popupMenu;
|
||||||
|
const ShellEntry = imports.ui.shellEntry;
|
||||||
|
|
||||||
|
const VPN_UI_GROUP = 'VPN Plugin UI';
|
||||||
|
|
||||||
|
const NetworkSecretDialog = new Lang.Class({
|
||||||
|
Name: 'NetworkSecretDialog',
|
||||||
|
Extends: ModalDialog.ModalDialog,
|
||||||
|
|
||||||
|
_init: function(agent, requestId, connection, settingName, hints, contentOverride) {
|
||||||
|
this.parent({ styleClass: 'prompt-dialog' });
|
||||||
|
|
||||||
|
this._agent = agent;
|
||||||
|
this._requestId = requestId;
|
||||||
|
this._connection = connection;
|
||||||
|
this._settingName = settingName;
|
||||||
|
this._hints = hints;
|
||||||
|
|
||||||
|
if (contentOverride)
|
||||||
|
this._content = contentOverride;
|
||||||
|
else
|
||||||
|
this._content = this._getContent();
|
||||||
|
|
||||||
|
let mainContentBox = new St.BoxLayout({ style_class: 'prompt-dialog-main-layout',
|
||||||
|
vertical: false });
|
||||||
|
this.contentLayout.add(mainContentBox,
|
||||||
|
{ x_fill: true,
|
||||||
|
y_fill: true });
|
||||||
|
|
||||||
|
let icon = new St.Icon({ icon_name: 'dialog-password-symbolic' });
|
||||||
|
mainContentBox.add(icon,
|
||||||
|
{ x_fill: true,
|
||||||
|
y_fill: false,
|
||||||
|
x_align: St.Align.END,
|
||||||
|
y_align: St.Align.START });
|
||||||
|
|
||||||
|
let messageBox = new St.BoxLayout({ style_class: 'prompt-dialog-message-layout',
|
||||||
|
vertical: true });
|
||||||
|
mainContentBox.add(messageBox,
|
||||||
|
{ y_align: St.Align.START });
|
||||||
|
|
||||||
|
let subjectLabel = new St.Label({ style_class: 'prompt-dialog-headline',
|
||||||
|
text: this._content.title });
|
||||||
|
messageBox.add(subjectLabel,
|
||||||
|
{ y_fill: false,
|
||||||
|
y_align: St.Align.START });
|
||||||
|
|
||||||
|
if (this._content.message != null) {
|
||||||
|
let descriptionLabel = new St.Label({ style_class: 'prompt-dialog-description',
|
||||||
|
text: this._content.message,
|
||||||
|
// HACK: for reasons unknown to me, the label
|
||||||
|
// is not asked the correct height for width,
|
||||||
|
// and thus is underallocated
|
||||||
|
// place a fixed height to avoid overflowing
|
||||||
|
style: 'height: 3em'
|
||||||
|
});
|
||||||
|
descriptionLabel.clutter_text.line_wrap = true;
|
||||||
|
|
||||||
|
messageBox.add(descriptionLabel,
|
||||||
|
{ y_fill: true,
|
||||||
|
y_align: St.Align.START,
|
||||||
|
expand: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
let secretTable = new St.Table({ style_class: 'network-dialog-secret-table' });
|
||||||
|
let initialFocusSet = false;
|
||||||
|
let pos = 0;
|
||||||
|
for (let i = 0; i < this._content.secrets.length; i++) {
|
||||||
|
let secret = this._content.secrets[i];
|
||||||
|
let label = new St.Label({ style_class: 'prompt-dialog-password-label',
|
||||||
|
text: secret.label });
|
||||||
|
|
||||||
|
let reactive = secret.key != null;
|
||||||
|
|
||||||
|
secret.entry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
|
||||||
|
text: secret.value, can_focus: reactive,
|
||||||
|
reactive: reactive });
|
||||||
|
ShellEntry.addContextMenu(secret.entry,
|
||||||
|
{ isPassword: secret.password });
|
||||||
|
|
||||||
|
if (secret.validate)
|
||||||
|
secret.valid = secret.validate(secret);
|
||||||
|
else // no special validation, just ensure it's not empty
|
||||||
|
secret.valid = secret.value.length > 0;
|
||||||
|
|
||||||
|
if (reactive) {
|
||||||
|
if (!initialFocusSet) {
|
||||||
|
this.setInitialKeyFocus(secret.entry);
|
||||||
|
initialFocusSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
secret.entry.clutter_text.connect('activate', Lang.bind(this, this._onOk));
|
||||||
|
secret.entry.clutter_text.connect('text-changed', Lang.bind(this, function() {
|
||||||
|
secret.value = secret.entry.get_text();
|
||||||
|
if (secret.validate)
|
||||||
|
secret.valid = secret.validate(secret);
|
||||||
|
else
|
||||||
|
secret.valid = secret.value.length > 0;
|
||||||
|
this._updateOkButton();
|
||||||
|
}));
|
||||||
|
} else
|
||||||
|
secret.valid = true;
|
||||||
|
|
||||||
|
secretTable.add(label, { row: pos, col: 0,
|
||||||
|
x_expand: false, x_fill: true,
|
||||||
|
x_align: St.Align.START,
|
||||||
|
y_fill: false, y_align: St.Align.MIDDLE });
|
||||||
|
secretTable.add(secret.entry, { row: pos, col: 1, x_expand: true, x_fill: true, y_align: St.Align.END });
|
||||||
|
pos++;
|
||||||
|
|
||||||
|
if (secret.password)
|
||||||
|
secret.entry.clutter_text.set_password_char('\u25cf');
|
||||||
|
}
|
||||||
|
|
||||||
|
messageBox.add(secretTable);
|
||||||
|
|
||||||
|
this._okButton = { label: _("Connect"),
|
||||||
|
action: Lang.bind(this, this._onOk),
|
||||||
|
default: true
|
||||||
|
};
|
||||||
|
|
||||||
|
this.setButtons([{ label: _("Cancel"),
|
||||||
|
action: Lang.bind(this, this.cancel),
|
||||||
|
key: Clutter.KEY_Escape,
|
||||||
|
},
|
||||||
|
this._okButton]);
|
||||||
|
},
|
||||||
|
|
||||||
|
_updateOkButton: function() {
|
||||||
|
let valid = true;
|
||||||
|
for (let i = 0; i < this._content.secrets.length; i++) {
|
||||||
|
let secret = this._content.secrets[i];
|
||||||
|
valid = valid && secret.valid;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._okButton.button.reactive = valid;
|
||||||
|
this._okButton.button.can_focus = valid;
|
||||||
|
},
|
||||||
|
|
||||||
|
_onOk: function() {
|
||||||
|
let valid = true;
|
||||||
|
for (let i = 0; i < this._content.secrets.length; i++) {
|
||||||
|
let secret = this._content.secrets[i];
|
||||||
|
valid = valid && secret.valid;
|
||||||
|
if (secret.key != null)
|
||||||
|
this._agent.set_password(this._requestId, secret.key, secret.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (valid) {
|
||||||
|
this._agent.respond(this._requestId, Shell.NetworkAgentResponse.CONFIRMED);
|
||||||
|
this.close(global.get_current_time());
|
||||||
|
}
|
||||||
|
// do nothing if not valid
|
||||||
|
},
|
||||||
|
|
||||||
|
cancel: function() {
|
||||||
|
this._agent.respond(this._requestId, Shell.NetworkAgentResponse.USER_CANCELED);
|
||||||
|
this.close(global.get_current_time());
|
||||||
|
},
|
||||||
|
|
||||||
|
_validateWpaPsk: function(secret) {
|
||||||
|
let value = secret.value;
|
||||||
|
if (value.length == 64) {
|
||||||
|
// must be composed of hexadecimal digits only
|
||||||
|
for (let i = 0; i < 64; i++) {
|
||||||
|
if (!((value[i] >= 'a' && value[i] <= 'f')
|
||||||
|
|| (value[i] >= 'A' && value[i] <= 'F')
|
||||||
|
|| (value[i] >= '0' && value[i] <= '9')))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (value.length >= 8 && value.length <= 63);
|
||||||
|
},
|
||||||
|
|
||||||
|
_validateStaticWep: function(secret) {
|
||||||
|
let value = secret.value;
|
||||||
|
if (secret.wep_key_type == NetworkManager.WepKeyType.KEY) {
|
||||||
|
if (value.length == 10 || value.length == 26) {
|
||||||
|
for (let i = 0; i < value.length; i++) {
|
||||||
|
if (!((value[i] >= 'a' && value[i] <= 'f')
|
||||||
|
|| (value[i] >= 'A' && value[i] <= 'F')
|
||||||
|
|| (value[i] >= '0' && value[i] <= '9')))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (value.length == 5 || value.length == 13) {
|
||||||
|
for (let i = 0; i < value.length; i++) {
|
||||||
|
if (!((value[i] >= 'a' && value[i] <= 'z')
|
||||||
|
|| (value[i] >= 'A' && value[i] <= 'Z')))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
return false;
|
||||||
|
} else if (secret.wep_key_type == NetworkManager.WepKeyType.PASSPHRASE) {
|
||||||
|
if (value.length < 0 || value.length > 64)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
_getWirelessSecrets: function(secrets, wirelessSetting) {
|
||||||
|
let wirelessSecuritySetting = this._connection.get_setting_wireless_security();
|
||||||
|
switch (wirelessSecuritySetting.key_mgmt) {
|
||||||
|
// First the easy ones
|
||||||
|
case 'wpa-none':
|
||||||
|
case 'wpa-psk':
|
||||||
|
secrets.push({ label: _("Password: "), key: 'psk',
|
||||||
|
value: wirelessSecuritySetting.psk || '',
|
||||||
|
validate: this._validateWpaPsk, password: true });
|
||||||
|
break;
|
||||||
|
case 'none': // static WEP
|
||||||
|
secrets.push({ label: _("Key: "), key: 'wep-key' + wirelessSecuritySetting.wep_tx_keyidx,
|
||||||
|
value: wirelessSecuritySetting.get_wep_key(wirelessSecuritySetting.wep_tx_keyidx) || '',
|
||||||
|
wep_key_type: wirelessSecuritySetting.wep_key_type,
|
||||||
|
validate: this._validateStaticWep, password: true });
|
||||||
|
break;
|
||||||
|
case 'ieee8021x':
|
||||||
|
if (wirelessSecuritySetting.auth_alg == 'leap') // Cisco LEAP
|
||||||
|
secrets.push({ label: _("Password: "), key: 'leap-password',
|
||||||
|
value: wirelessSecuritySetting.leap_password || '', password: true });
|
||||||
|
else // Dynamic (IEEE 802.1x) WEP
|
||||||
|
this._get8021xSecrets(secrets);
|
||||||
|
break;
|
||||||
|
case 'wpa-eap':
|
||||||
|
this._get8021xSecrets(secrets);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
log('Invalid wireless key management: ' + wirelessSecuritySetting.key_mgmt);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_get8021xSecrets: function(secrets) {
|
||||||
|
let ieee8021xSetting = this._connection.get_setting_802_1x();
|
||||||
|
let phase2method;
|
||||||
|
|
||||||
|
switch (ieee8021xSetting.get_eap_method(0)) {
|
||||||
|
case 'md5':
|
||||||
|
case 'leap':
|
||||||
|
case 'ttls':
|
||||||
|
case 'peap':
|
||||||
|
// TTLS and PEAP are actually much more complicated, but this complication
|
||||||
|
// is not visible here since we only care about phase2 authentication
|
||||||
|
// (and don't even care of which one)
|
||||||
|
secrets.push({ label: _("Username: "), key: null,
|
||||||
|
value: ieee8021xSetting.identity || '', password: false });
|
||||||
|
secrets.push({ label: _("Password: "), key: 'password',
|
||||||
|
value: ieee8021xSetting.password || '', password: true });
|
||||||
|
break;
|
||||||
|
case 'tls':
|
||||||
|
secrets.push({ label: _("Identity: "), key: null,
|
||||||
|
value: ieee8021xSetting.identity || '', password: false });
|
||||||
|
secrets.push({ label: _("Private key password: "), key: 'private-key-password',
|
||||||
|
value: ieee8021xSetting.private_key_password || '', password: true });
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
log('Invalid EAP/IEEE802.1x method: ' + ieee8021xSetting.get_eap_method(0));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_getPPPoESecrets: function(secrets) {
|
||||||
|
let pppoeSetting = this._connection.get_setting_pppoe();
|
||||||
|
secrets.push({ label: _("Username: "), key: 'username',
|
||||||
|
value: pppoeSetting.username || '', password: false });
|
||||||
|
secrets.push({ label: _("Service: "), key: 'service',
|
||||||
|
value: pppoeSetting.service || '', password: false });
|
||||||
|
secrets.push({ label: _("Password: "), key: 'password',
|
||||||
|
value: pppoeSetting.password || '', password: true });
|
||||||
|
},
|
||||||
|
|
||||||
|
_getMobileSecrets: function(secrets, connectionType) {
|
||||||
|
let setting;
|
||||||
|
if (connectionType == 'bluetooth')
|
||||||
|
setting = this._connection.get_setting_cdma() || this._connection.get_setting_gsm();
|
||||||
|
else
|
||||||
|
setting = this._connection.get_setting_by_name(connectionType);
|
||||||
|
secrets.push({ label: _("Password: "), key: 'password',
|
||||||
|
value: setting.value || '', password: true });
|
||||||
|
},
|
||||||
|
|
||||||
|
_getContent: function() {
|
||||||
|
let connectionSetting = this._connection.get_setting_connection();
|
||||||
|
let connectionType = connectionSetting.get_connection_type();
|
||||||
|
let wirelessSetting;
|
||||||
|
let ssid;
|
||||||
|
|
||||||
|
let content = { };
|
||||||
|
content.secrets = [ ];
|
||||||
|
|
||||||
|
switch (connectionType) {
|
||||||
|
case '802-11-wireless':
|
||||||
|
wirelessSetting = this._connection.get_setting_wireless();
|
||||||
|
ssid = NetworkManager.utils_ssid_to_utf8(wirelessSetting.get_ssid());
|
||||||
|
content.title = _("Authentication required by wireless network");
|
||||||
|
content.message = _("Passwords or encryption keys are required to access the wireless network '%s'.").format(ssid);
|
||||||
|
this._getWirelessSecrets(content.secrets, wirelessSetting);
|
||||||
|
break;
|
||||||
|
case '802-3-ethernet':
|
||||||
|
content.title = _("Wired 802.1X authentication");
|
||||||
|
content.message = null;
|
||||||
|
content.secrets.push({ label: _("Network name: "), key: null,
|
||||||
|
value: connectionSetting.get_id(), password: false });
|
||||||
|
this._get8021xSecrets(content.secrets);
|
||||||
|
break;
|
||||||
|
case 'pppoe':
|
||||||
|
content.title = _("DSL authentication");
|
||||||
|
content.message = null;
|
||||||
|
this._getPPPoESecrets(content.secrets);
|
||||||
|
break;
|
||||||
|
case 'gsm':
|
||||||
|
if (this._hints.indexOf('pin') != -1) {
|
||||||
|
let gsmSetting = this._connection.get_setting_gsm();
|
||||||
|
content.title = _("PIN code required");
|
||||||
|
content.message = _("PIN code is needed for the mobile broadband device");
|
||||||
|
content.secrets.push({ label: _("PIN: "), key: 'pin',
|
||||||
|
value: gsmSetting.pin || '', password: true });
|
||||||
|
}
|
||||||
|
// fall through
|
||||||
|
case 'cdma':
|
||||||
|
case 'bluetooth':
|
||||||
|
content.title = _("Mobile broadband network password");
|
||||||
|
content.message = _("A password is required to connect to '%s'.").format(connectionSetting.get_id());
|
||||||
|
this._getMobileSecrets(content.secrets, connectionType);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
log('Invalid connection type: ' + connectionType);
|
||||||
|
};
|
||||||
|
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const VPNRequestHandler = new Lang.Class({
|
||||||
|
Name: 'VPNRequestHandler',
|
||||||
|
|
||||||
|
_init: function(agent, requestId, authHelper, serviceType, connection, hints, flags) {
|
||||||
|
this._agent = agent;
|
||||||
|
this._requestId = requestId;
|
||||||
|
this._connection = connection;
|
||||||
|
this._pluginOutBuffer = [];
|
||||||
|
this._title = null;
|
||||||
|
this._description = null;
|
||||||
|
this._content = [ ];
|
||||||
|
this._shellDialog = null;
|
||||||
|
|
||||||
|
let connectionSetting = connection.get_setting_connection();
|
||||||
|
|
||||||
|
let argv = [ authHelper.fileName,
|
||||||
|
'-u', connectionSetting.uuid,
|
||||||
|
'-n', connectionSetting.id,
|
||||||
|
'-s', serviceType
|
||||||
|
];
|
||||||
|
if (authHelper.externalUIMode)
|
||||||
|
argv.push('--external-ui-mode');
|
||||||
|
if (flags & NMClient.SecretAgentGetSecretsFlags.ALLOW_INTERACTION)
|
||||||
|
argv.push('-i');
|
||||||
|
if (flags & NMClient.SecretAgentGetSecretsFlags.REQUEST_NEW)
|
||||||
|
argv.push('-r');
|
||||||
|
|
||||||
|
this._newStylePlugin = authHelper.externalUIMode;
|
||||||
|
|
||||||
|
try {
|
||||||
|
let [success, pid, stdin, stdout, stderr] =
|
||||||
|
GLib.spawn_async_with_pipes(null, /* pwd */
|
||||||
|
argv,
|
||||||
|
null, /* envp */
|
||||||
|
GLib.SpawnFlags.DO_NOT_REAP_CHILD,
|
||||||
|
null /* child_setup */);
|
||||||
|
|
||||||
|
this._childPid = pid;
|
||||||
|
this._stdin = new Gio.UnixOutputStream({ fd: stdin, close_fd: true });
|
||||||
|
this._stdout = new Gio.UnixInputStream({ fd: stdout, close_fd: true });
|
||||||
|
// We need this one too, even if don't actually care of what the process
|
||||||
|
// has to say on stderr, because otherwise the fd opened by g_spawn_async_with_pipes
|
||||||
|
// is kept open indefinitely
|
||||||
|
let stderrStream = new Gio.UnixInputStream({ fd: stderr, close_fd: true });
|
||||||
|
stderrStream.close(null);
|
||||||
|
this._dataStdout = new Gio.DataInputStream({ base_stream: this._stdout });
|
||||||
|
|
||||||
|
if (this._newStylePlugin)
|
||||||
|
this._readStdoutNewStyle();
|
||||||
|
else
|
||||||
|
this._readStdoutOldStyle();
|
||||||
|
|
||||||
|
this._childWatch = GLib.child_watch_add(GLib.PRIORITY_DEFAULT, pid,
|
||||||
|
Lang.bind(this, this._vpnChildFinished));
|
||||||
|
|
||||||
|
this._writeConnection();
|
||||||
|
} catch(e) {
|
||||||
|
logError(e, 'error while spawning VPN auth helper');
|
||||||
|
|
||||||
|
this._agent.respond(requestId, Shell.NetworkAgentResponse.INTERNAL_ERROR);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
cancel: function(respond) {
|
||||||
|
if (respond)
|
||||||
|
this._agent.respond(this._requestId, Shell.NetworkAgentResponse.USER_CANCELED);
|
||||||
|
|
||||||
|
if (this._newStylePlugin && this._shellDialog) {
|
||||||
|
this._shellDialog.close(global.get_current_time());
|
||||||
|
this._shellDialog.destroy();
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
this._stdin.write('QUIT\n\n', null);
|
||||||
|
} catch(e) { /* ignore broken pipe errors */ }
|
||||||
|
}
|
||||||
|
|
||||||
|
this.destroy();
|
||||||
|
},
|
||||||
|
|
||||||
|
destroy: function() {
|
||||||
|
if (this._destroyed)
|
||||||
|
return;
|
||||||
|
|
||||||
|
GLib.source_remove(this._childWatch);
|
||||||
|
|
||||||
|
this._stdin.close(null);
|
||||||
|
// Stdout is closed when we finish reading from it
|
||||||
|
|
||||||
|
this._destroyed = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
_vpnChildFinished: function(pid, status, requestObj) {
|
||||||
|
if (this._newStylePlugin) {
|
||||||
|
// For new style plugin, all work is done in the async reading functions
|
||||||
|
// Just reap the process here
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let [exited, exitStatus] = Shell.util_wifexited(status);
|
||||||
|
|
||||||
|
if (exited) {
|
||||||
|
if (exitStatus != 0)
|
||||||
|
this._agent.respond(this._requestId, Shell.NetworkAgentResponse.USER_CANCELED);
|
||||||
|
else
|
||||||
|
this._agent.respond(this._requestId, Shell.NetworkAgentResponse.CONFIRMED);
|
||||||
|
} else
|
||||||
|
this._agent.respond(this._requestId, Shell.NetworkAgentResponse.INTERNAL_ERROR);
|
||||||
|
|
||||||
|
this.destroy();
|
||||||
|
},
|
||||||
|
|
||||||
|
_vpnChildProcessLineOldStyle: function(line) {
|
||||||
|
if (this._previousLine != undefined) {
|
||||||
|
// Two consecutive newlines mean that the child should be closed
|
||||||
|
// (the actual newlines are eaten by Gio.DataInputStream)
|
||||||
|
// Send a termination message
|
||||||
|
if (line == '' && this._previousLine == '') {
|
||||||
|
try {
|
||||||
|
this._stdin.write('QUIT\n\n', null);
|
||||||
|
} catch(e) { /* ignore broken pipe errors */ }
|
||||||
|
} else {
|
||||||
|
this._agent.set_password(this._requestId, this._previousLine, line);
|
||||||
|
this._previousLine = undefined;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this._previousLine = line;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_readStdoutOldStyle: function() {
|
||||||
|
this._dataStdout.read_line_async(GLib.PRIORITY_DEFAULT, null, Lang.bind(this, function(stream, result) {
|
||||||
|
let [line, len] = this._dataStdout.read_line_finish_utf8(result);
|
||||||
|
|
||||||
|
if (line == null) {
|
||||||
|
// end of file
|
||||||
|
this._stdout.close(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._vpnChildProcessLineOldStyle(line);
|
||||||
|
|
||||||
|
// try to read more!
|
||||||
|
this._readStdoutOldStyle();
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
|
||||||
|
_readStdoutNewStyle: function() {
|
||||||
|
this._dataStdout.fill_async(-1, GLib.PRIORITY_DEFAULT, null, Lang.bind(this, function(stream, result) {
|
||||||
|
let cnt = this._dataStdout.fill_finish(result);
|
||||||
|
|
||||||
|
if (cnt == 0) {
|
||||||
|
// end of file
|
||||||
|
this._showNewStyleDialog();
|
||||||
|
|
||||||
|
this._stdout.close(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try to read more
|
||||||
|
this._dataStdout.set_buffer_size(2 * this._dataStdout.get_buffer_size());
|
||||||
|
this._readStdoutNewStyle();
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
|
||||||
|
_showNewStyleDialog: function() {
|
||||||
|
let keyfile = new GLib.KeyFile();
|
||||||
|
let contentOverride;
|
||||||
|
|
||||||
|
try {
|
||||||
|
let data = this._dataStdout.peek_buffer();
|
||||||
|
keyfile.load_from_data(data.toString(), data.length,
|
||||||
|
GLib.KeyFileFlags.NONE);
|
||||||
|
|
||||||
|
if (keyfile.get_integer(VPN_UI_GROUP, 'Version') != 2)
|
||||||
|
throw new Error('Invalid plugin keyfile version, is %d');
|
||||||
|
|
||||||
|
contentOverride = { title: keyfile.get_string(VPN_UI_GROUP, 'Title'),
|
||||||
|
message: keyfile.get_string(VPN_UI_GROUP, 'Description'),
|
||||||
|
secrets: [] };
|
||||||
|
|
||||||
|
let [groups, len] = keyfile.get_groups();
|
||||||
|
for (let i = 0; i < groups.length; i++) {
|
||||||
|
if (groups[i] == VPN_UI_GROUP)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
let value = keyfile.get_string(groups[i], 'Value');
|
||||||
|
let shouldAsk = keyfile.get_boolean(groups[i], 'ShouldAsk');
|
||||||
|
|
||||||
|
if (shouldAsk) {
|
||||||
|
contentOverride.secrets.push({ label: keyfile.get_string(groups[i], 'Label'),
|
||||||
|
key: groups[i],
|
||||||
|
value: value,
|
||||||
|
password: keyfile.get_boolean(groups[i], 'IsSecret')
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (!value.length) // Ignore empty secrets
|
||||||
|
continue;
|
||||||
|
|
||||||
|
this._agent.set_password(this._requestId, groups[i], value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch(e) {
|
||||||
|
logError(e, 'error while reading VPN plugin output keyfile');
|
||||||
|
|
||||||
|
this._agent.respond(this._requestId, Shell.NetworkAgentResponse.INTERNAL_ERROR);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (contentOverride.secrets.length) {
|
||||||
|
// Only show the dialog if we actually have something to ask
|
||||||
|
this._shellDialog = new NetworkSecretDialog(this._agent, this._requestId, this._connection, 'vpn', [], contentOverride);
|
||||||
|
this._shellDialog.open(global.get_current_time());
|
||||||
|
} else {
|
||||||
|
this._agent.respond(this._requestId, Shell.NetworkAgentResponse.CONFIRMED);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_writeConnection: function() {
|
||||||
|
let vpnSetting = this._connection.get_setting_vpn();
|
||||||
|
|
||||||
|
try {
|
||||||
|
vpnSetting.foreach_data_item(Lang.bind(this, function(key, value) {
|
||||||
|
this._stdin.write('DATA_KEY=' + key + '\n', null);
|
||||||
|
this._stdin.write('DATA_VAL=' + (value || '') + '\n\n', null);
|
||||||
|
}));
|
||||||
|
vpnSetting.foreach_secret(Lang.bind(this, function(key, value) {
|
||||||
|
this._stdin.write('SECRET_KEY=' + key + '\n', null);
|
||||||
|
this._stdin.write('SECRET_VAL=' + (value || '') + '\n\n', null);
|
||||||
|
}));
|
||||||
|
this._stdin.write('DONE\n\n', null);
|
||||||
|
} catch(e) {
|
||||||
|
logError(e, 'internal error while writing connection to helper');
|
||||||
|
|
||||||
|
this._agent.respond(this._requestId, Shell.NetworkAgentResponse.INTERNAL_ERROR);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const NetworkAgent = new Lang.Class({
|
||||||
|
Name: 'NetworkAgent',
|
||||||
|
|
||||||
|
_init: function() {
|
||||||
|
this._native = new Shell.NetworkAgent({ auto_register: false,
|
||||||
|
identifier: 'org.gnome.Shell.NetworkAgent' });
|
||||||
|
|
||||||
|
this._dialogs = { };
|
||||||
|
this._vpnRequests = { };
|
||||||
|
|
||||||
|
this._native.connect('new-request', Lang.bind(this, this._newRequest));
|
||||||
|
this._native.connect('cancel-request', Lang.bind(this, this._cancelRequest));
|
||||||
|
},
|
||||||
|
|
||||||
|
enable: function() {
|
||||||
|
this._native.register();
|
||||||
|
},
|
||||||
|
|
||||||
|
disable: function() {
|
||||||
|
let requestId;
|
||||||
|
|
||||||
|
for (requestId in this._dialogs)
|
||||||
|
this._dialogs[requestId].cancel();
|
||||||
|
this._dialogs = { };
|
||||||
|
|
||||||
|
for (requestId in this._vpnRequests)
|
||||||
|
this._vpnRequests[requestId].cancel(true);
|
||||||
|
this._vpnRequests = { };
|
||||||
|
|
||||||
|
this._native.unregister();
|
||||||
|
},
|
||||||
|
|
||||||
|
_newRequest: function(agent, requestId, connection, settingName, hints, flags) {
|
||||||
|
if (settingName == 'vpn') {
|
||||||
|
this._vpnRequest(requestId, connection, hints, flags);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let dialog = new NetworkSecretDialog(agent, requestId, connection, settingName, hints);
|
||||||
|
dialog.connect('destroy', Lang.bind(this, function() {
|
||||||
|
delete this._dialogs[requestId];
|
||||||
|
}));
|
||||||
|
this._dialogs[requestId] = dialog;
|
||||||
|
dialog.open(global.get_current_time());
|
||||||
|
},
|
||||||
|
|
||||||
|
_cancelRequest: function(agent, requestId) {
|
||||||
|
if (this._dialogs[requestId]) {
|
||||||
|
this._dialogs[requestId].close(global.get_current_time());
|
||||||
|
this._dialogs[requestId].destroy();
|
||||||
|
delete this._dialogs[requestId];
|
||||||
|
} else if (this._vpnRequests[requestId]) {
|
||||||
|
this._vpnRequests[requestId].cancel(false);
|
||||||
|
delete this._vpnRequests[requestId];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_vpnRequest: function(requestId, connection, hints, flags) {
|
||||||
|
let vpnSetting = connection.get_setting_vpn();
|
||||||
|
let serviceType = vpnSetting.service_type;
|
||||||
|
|
||||||
|
this._buildVPNServiceCache();
|
||||||
|
|
||||||
|
let binary = this._vpnBinaries[serviceType];
|
||||||
|
if (!binary) {
|
||||||
|
log('Invalid VPN service type (cannot find authentication binary)');
|
||||||
|
|
||||||
|
/* cancel the auth process */
|
||||||
|
this._native.respond(requestId, Shell.NetworkAgentResponse.INTERNAL_ERROR);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._vpnRequests[requestId] = new VPNRequestHandler(this._native, requestId, binary, serviceType, connection, hints, flags);
|
||||||
|
},
|
||||||
|
|
||||||
|
_buildVPNServiceCache: function() {
|
||||||
|
if (this._vpnCacheBuilt)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this._vpnCacheBuilt = true;
|
||||||
|
this._vpnBinaries = { };
|
||||||
|
|
||||||
|
let dir = Gio.file_new_for_path(GLib.build_filenamev([Config.SYSCONFDIR, 'NetworkManager/VPN']));
|
||||||
|
try {
|
||||||
|
let fileEnum = dir.enumerate_children('standard::name', Gio.FileQueryInfoFlags.NONE, null);
|
||||||
|
let info;
|
||||||
|
|
||||||
|
while ((info = fileEnum.next_file(null))) {
|
||||||
|
let name = info.get_name();
|
||||||
|
if (name.substr(-5) != '.name')
|
||||||
|
continue;
|
||||||
|
|
||||||
|
try {
|
||||||
|
let keyfile = new GLib.KeyFile();
|
||||||
|
keyfile.load_from_file(dir.get_child(name).get_path(), GLib.KeyFileFlags.NONE);
|
||||||
|
let service = keyfile.get_string('VPN Connection', 'service');
|
||||||
|
let binary = keyfile.get_string('GNOME', 'auth-dialog');
|
||||||
|
let externalUIMode = false;
|
||||||
|
try {
|
||||||
|
externalUIMode = keyfile.get_boolean('GNOME', 'supports-external-ui-mode');
|
||||||
|
} catch(e) { } // ignore errors if key does not exist
|
||||||
|
let path = binary;
|
||||||
|
if (!GLib.path_is_absolute(path)) {
|
||||||
|
path = GLib.build_filenamev([Config.LIBEXECDIR, path]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GLib.file_test(path, GLib.FileTest.IS_EXECUTABLE))
|
||||||
|
this._vpnBinaries[service] = { fileName: path, externalUIMode: externalUIMode };
|
||||||
|
else
|
||||||
|
throw new Error('VPN plugin at %s is not executable'.format(path));
|
||||||
|
} catch(e) {
|
||||||
|
log('Error \'%s\' while processing VPN keyfile \'%s\''.
|
||||||
|
format(e.message, dir.get_child(name).get_path()));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch(e) {
|
||||||
|
logError(e, 'error while enumerating VPN auth helpers');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const Component = NetworkAgent;
|
@ -1,24 +1,4 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
*
|
|
||||||
* Copyright 2010 Red Hat, Inc
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
||||||
* 02111-1307, USA.
|
|
||||||
*
|
|
||||||
* Author: David Zeuthen <davidz@redhat.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
const Lang = imports.lang;
|
const Lang = imports.lang;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
@ -27,22 +7,25 @@ const AccountsService = imports.gi.AccountsService;
|
|||||||
const Clutter = imports.gi.Clutter;
|
const Clutter = imports.gi.Clutter;
|
||||||
const St = imports.gi.St;
|
const St = imports.gi.St;
|
||||||
const Pango = imports.gi.Pango;
|
const Pango = imports.gi.Pango;
|
||||||
|
const GLib = imports.gi.GLib;
|
||||||
const Gio = imports.gi.Gio;
|
const Gio = imports.gi.Gio;
|
||||||
const Mainloop = imports.mainloop;
|
const Mainloop = imports.mainloop;
|
||||||
const Polkit = imports.gi.Polkit;
|
const Polkit = imports.gi.Polkit;
|
||||||
const PolkitAgent = imports.gi.PolkitAgent;
|
const PolkitAgent = imports.gi.PolkitAgent;
|
||||||
|
|
||||||
|
const Components = imports.ui.components;
|
||||||
const ModalDialog = imports.ui.modalDialog;
|
const ModalDialog = imports.ui.modalDialog;
|
||||||
|
const ShellEntry = imports.ui.shellEntry;
|
||||||
|
const UserMenu = imports.ui.userMenu;
|
||||||
|
|
||||||
function AuthenticationDialog(actionId, message, cookie, userNames) {
|
const DIALOG_ICON_SIZE = 48;
|
||||||
this._init(actionId, message, cookie, userNames);
|
|
||||||
}
|
|
||||||
|
|
||||||
AuthenticationDialog.prototype = {
|
const AuthenticationDialog = new Lang.Class({
|
||||||
__proto__: ModalDialog.ModalDialog.prototype,
|
Name: 'AuthenticationDialog',
|
||||||
|
Extends: ModalDialog.ModalDialog,
|
||||||
|
|
||||||
_init: function(actionId, message, cookie, userNames) {
|
_init: function(actionId, message, cookie, userNames) {
|
||||||
ModalDialog.ModalDialog.prototype._init.call(this, { styleClass: 'polkit-dialog' });
|
this.parent({ styleClass: 'prompt-dialog' });
|
||||||
|
|
||||||
this.actionId = actionId;
|
this.actionId = actionId;
|
||||||
this.message = message;
|
this.message = message;
|
||||||
@ -50,7 +33,7 @@ AuthenticationDialog.prototype = {
|
|||||||
this._wasDismissed = false;
|
this._wasDismissed = false;
|
||||||
this._completed = false;
|
this._completed = false;
|
||||||
|
|
||||||
let mainContentBox = new St.BoxLayout({ style_class: 'polkit-dialog-main-layout',
|
let mainContentBox = new St.BoxLayout({ style_class: 'prompt-dialog-main-layout',
|
||||||
vertical: false });
|
vertical: false });
|
||||||
this.contentLayout.add(mainContentBox,
|
this.contentLayout.add(mainContentBox,
|
||||||
{ x_fill: true,
|
{ x_fill: true,
|
||||||
@ -63,19 +46,19 @@ AuthenticationDialog.prototype = {
|
|||||||
x_align: St.Align.END,
|
x_align: St.Align.END,
|
||||||
y_align: St.Align.START });
|
y_align: St.Align.START });
|
||||||
|
|
||||||
let messageBox = new St.BoxLayout({ style_class: 'polkit-dialog-message-layout',
|
let messageBox = new St.BoxLayout({ style_class: 'prompt-dialog-message-layout',
|
||||||
vertical: true });
|
vertical: true });
|
||||||
mainContentBox.add(messageBox,
|
mainContentBox.add(messageBox,
|
||||||
{ y_align: St.Align.START });
|
{ y_align: St.Align.START });
|
||||||
|
|
||||||
this._subjectLabel = new St.Label({ style_class: 'polkit-dialog-headline',
|
this._subjectLabel = new St.Label({ style_class: 'prompt-dialog-headline',
|
||||||
text: _("Authentication Required") });
|
text: _("Authentication Required") });
|
||||||
|
|
||||||
messageBox.add(this._subjectLabel,
|
messageBox.add(this._subjectLabel,
|
||||||
{ y_fill: false,
|
{ y_fill: false,
|
||||||
y_align: St.Align.START });
|
y_align: St.Align.START });
|
||||||
|
|
||||||
this._descriptionLabel = new St.Label({ style_class: 'polkit-dialog-description',
|
this._descriptionLabel = new St.Label({ style_class: 'prompt-dialog-description',
|
||||||
text: message });
|
text: message });
|
||||||
this._descriptionLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
this._descriptionLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
this._descriptionLabel.clutter_text.line_wrap = true;
|
this._descriptionLabel.clutter_text.line_wrap = true;
|
||||||
@ -87,10 +70,14 @@ AuthenticationDialog.prototype = {
|
|||||||
if (userNames.length > 1) {
|
if (userNames.length > 1) {
|
||||||
log('polkitAuthenticationAgent: Received ' + userNames.length +
|
log('polkitAuthenticationAgent: Received ' + userNames.length +
|
||||||
' identities that can be used for authentication. Only ' +
|
' identities that can be used for authentication. Only ' +
|
||||||
'considering the first one.');
|
'considering one.');
|
||||||
}
|
}
|
||||||
|
|
||||||
let userName = userNames[0];
|
let userName = GLib.get_user_name();
|
||||||
|
if (userNames.indexOf(userName) < 0)
|
||||||
|
userName = 'root';
|
||||||
|
if (userNames.indexOf(userName) < 0)
|
||||||
|
userName = userNames[0];
|
||||||
|
|
||||||
this._user = AccountsService.UserManager.get_default().get_user(userName);
|
this._user = AccountsService.UserManager.get_default().get_user(userName);
|
||||||
let userRealName = this._user.get_real_name()
|
let userRealName = this._user.get_real_name()
|
||||||
@ -114,9 +101,11 @@ AuthenticationDialog.prototype = {
|
|||||||
let userBox = new St.BoxLayout({ style_class: 'polkit-dialog-user-layout',
|
let userBox = new St.BoxLayout({ style_class: 'polkit-dialog-user-layout',
|
||||||
vertical: false });
|
vertical: false });
|
||||||
messageBox.add(userBox);
|
messageBox.add(userBox);
|
||||||
this._userIcon = new St.Icon();
|
this._userAvatar = new UserMenu.UserAvatarWidget(this._user,
|
||||||
this._userIcon.hide();
|
{ iconSize: DIALOG_ICON_SIZE,
|
||||||
userBox.add(this._userIcon,
|
styleClass: 'polkit-dialog-user-icon' });
|
||||||
|
this._userAvatar.actor.hide();
|
||||||
|
userBox.add(this._userAvatar.actor,
|
||||||
{ x_fill: true,
|
{ x_fill: true,
|
||||||
y_fill: false,
|
y_fill: false,
|
||||||
x_align: St.Align.END,
|
x_align: St.Align.END,
|
||||||
@ -132,26 +121,27 @@ AuthenticationDialog.prototype = {
|
|||||||
|
|
||||||
this._onUserChanged();
|
this._onUserChanged();
|
||||||
|
|
||||||
this._passwordBox = new St.BoxLayout({ vertical: false });
|
this._passwordBox = new St.BoxLayout({ vertical: false, style_class: 'prompt-dialog-password-box' });
|
||||||
messageBox.add(this._passwordBox);
|
messageBox.add(this._passwordBox);
|
||||||
this._passwordLabel = new St.Label(({ style_class: 'polkit-dialog-password-label' }));
|
this._passwordLabel = new St.Label(({ style_class: 'prompt-dialog-password-label' }));
|
||||||
this._passwordBox.add(this._passwordLabel);
|
this._passwordBox.add(this._passwordLabel, { y_fill: false, y_align: St.Align.MIDDLE });
|
||||||
this._passwordEntry = new St.Entry({ style_class: 'polkit-dialog-password-entry',
|
this._passwordEntry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
|
||||||
text: "",
|
text: "",
|
||||||
can_focus: true});
|
can_focus: true});
|
||||||
|
ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
|
||||||
this._passwordEntry.clutter_text.connect('activate', Lang.bind(this, this._onEntryActivate));
|
this._passwordEntry.clutter_text.connect('activate', Lang.bind(this, this._onEntryActivate));
|
||||||
this._passwordBox.add(this._passwordEntry,
|
this._passwordBox.add(this._passwordEntry,
|
||||||
{expand: true });
|
{ expand: true });
|
||||||
this.setInitialKeyFocus(this._passwordEntry);
|
this.setInitialKeyFocus(this._passwordEntry);
|
||||||
this._passwordBox.hide();
|
this._passwordBox.hide();
|
||||||
|
|
||||||
this._errorMessageLabel = new St.Label({ style_class: 'polkit-dialog-error-label' });
|
this._errorMessageLabel = new St.Label({ style_class: 'prompt-dialog-error-label' });
|
||||||
this._errorMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
this._errorMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
this._errorMessageLabel.clutter_text.line_wrap = true;
|
this._errorMessageLabel.clutter_text.line_wrap = true;
|
||||||
messageBox.add(this._errorMessageLabel);
|
messageBox.add(this._errorMessageLabel);
|
||||||
this._errorMessageLabel.hide();
|
this._errorMessageLabel.hide();
|
||||||
|
|
||||||
this._infoMessageLabel = new St.Label({ style_class: 'polkit-dialog-info-label' });
|
this._infoMessageLabel = new St.Label({ style_class: 'prompt-dialog-info-label' });
|
||||||
this._infoMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
this._infoMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
this._infoMessageLabel.clutter_text.line_wrap = true;
|
this._infoMessageLabel.clutter_text.line_wrap = true;
|
||||||
messageBox.add(this._infoMessageLabel);
|
messageBox.add(this._infoMessageLabel);
|
||||||
@ -161,8 +151,9 @@ AuthenticationDialog.prototype = {
|
|||||||
* infoMessage and errorMessageLabel - but it is still invisible because
|
* infoMessage and errorMessageLabel - but it is still invisible because
|
||||||
* gnome-shell.css sets the color to be transparent
|
* gnome-shell.css sets the color to be transparent
|
||||||
*/
|
*/
|
||||||
this._nullMessageLabel = new St.Label({ style_class: 'polkit-dialog-null-label',
|
this._nullMessageLabel = new St.Label({ style_class: 'prompt-dialog-null-label',
|
||||||
text: 'abc'});
|
text: 'abc'});
|
||||||
|
this._nullMessageLabel.add_style_class_name('hidden');
|
||||||
this._nullMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
this._nullMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
|
||||||
this._nullMessageLabel.clutter_text.line_wrap = true;
|
this._nullMessageLabel.clutter_text.line_wrap = true;
|
||||||
messageBox.add(this._nullMessageLabel);
|
messageBox.add(this._nullMessageLabel);
|
||||||
@ -173,7 +164,8 @@ AuthenticationDialog.prototype = {
|
|||||||
key: Clutter.Escape
|
key: Clutter.Escape
|
||||||
},
|
},
|
||||||
{ label: _("Authenticate"),
|
{ label: _("Authenticate"),
|
||||||
action: Lang.bind(this, this._onAuthenticateButtonPressed)
|
action: Lang.bind(this, this._onAuthenticateButtonPressed),
|
||||||
|
default: true
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
this._doneEmitted = false;
|
this._doneEmitted = false;
|
||||||
@ -264,7 +256,7 @@ AuthenticationDialog.prototype = {
|
|||||||
|
|
||||||
_onSessionRequest: function(session, request, echo_on) {
|
_onSessionRequest: function(session, request, echo_on) {
|
||||||
// Cheap localization trick
|
// Cheap localization trick
|
||||||
if (request == 'Password:')
|
if (request == 'Password:' || request == 'Password: ')
|
||||||
this._passwordLabel.set_text(_("Password:"));
|
this._passwordLabel.set_text(_("Password:"));
|
||||||
else
|
else
|
||||||
this._passwordLabel.set_text(request);
|
this._passwordLabel.set_text(request);
|
||||||
@ -307,19 +299,9 @@ AuthenticationDialog.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_onUserChanged: function() {
|
_onUserChanged: function() {
|
||||||
if (this._user.is_loaded) {
|
if (this._user.is_loaded && this._userAvatar) {
|
||||||
if (this._userIcon) {
|
this._userAvatar.update();
|
||||||
let iconFileName = this._user.get_icon_file();
|
this._userAvatar.actor.show();
|
||||||
let iconFile = Gio.file_new_for_path(iconFileName);
|
|
||||||
let icon;
|
|
||||||
if (iconFile.query_exists(null)) {
|
|
||||||
icon = new Gio.FileIcon({file: iconFile});
|
|
||||||
} else {
|
|
||||||
icon = new Gio.ThemedIcon({name: 'avatar-default'});
|
|
||||||
}
|
|
||||||
this._userIcon.set_gicon (icon);
|
|
||||||
this._userIcon.show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -328,21 +310,27 @@ AuthenticationDialog.prototype = {
|
|||||||
this.close(global.get_current_time());
|
this.close(global.get_current_time());
|
||||||
this._emitDone(false, true);
|
this._emitDone(false, true);
|
||||||
},
|
},
|
||||||
|
});
|
||||||
};
|
|
||||||
Signals.addSignalMethods(AuthenticationDialog.prototype);
|
Signals.addSignalMethods(AuthenticationDialog.prototype);
|
||||||
|
|
||||||
function AuthenticationAgent() {
|
const AuthenticationAgent = new Lang.Class({
|
||||||
this._init();
|
Name: 'AuthenticationAgent',
|
||||||
}
|
|
||||||
|
|
||||||
AuthenticationAgent.prototype = {
|
|
||||||
_init: function() {
|
_init: function() {
|
||||||
|
this._currentDialog = null;
|
||||||
|
this._isCompleting = false;
|
||||||
|
this._handle = null;
|
||||||
this._native = new Shell.PolkitAuthenticationAgent();
|
this._native = new Shell.PolkitAuthenticationAgent();
|
||||||
this._native.connect('initiate', Lang.bind(this, this._onInitiate));
|
this._native.connect('initiate', Lang.bind(this, this._onInitiate));
|
||||||
this._native.connect('cancel', Lang.bind(this, this._onCancel));
|
this._native.connect('cancel', Lang.bind(this, this._onCancel));
|
||||||
this._currentDialog = null;
|
},
|
||||||
this._isCompleting = false;
|
|
||||||
|
enable: function() {
|
||||||
|
this._native.register();
|
||||||
|
},
|
||||||
|
|
||||||
|
disable: function() {
|
||||||
|
this._native.unregister();
|
||||||
},
|
},
|
||||||
|
|
||||||
_onInitiate: function(nativeAgent, actionId, message, iconName, cookie, userNames) {
|
_onInitiate: function(nativeAgent, actionId, message, iconName, cookie, userNames) {
|
||||||
@ -392,13 +380,12 @@ AuthenticationAgent.prototype = {
|
|||||||
Lang.bind(this,
|
Lang.bind(this,
|
||||||
function() {
|
function() {
|
||||||
this._reallyCompleteRequest(wasDismissed);
|
this._reallyCompleteRequest(wasDismissed);
|
||||||
|
return false;
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
this._reallyCompleteRequest(wasDismissed);
|
this._reallyCompleteRequest(wasDismissed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
function init() {
|
const Component = AuthenticationAgent;
|
||||||
let agent = new AuthenticationAgent();
|
|
||||||
}
|
|
60
js/ui/components/recorder.js
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
|
||||||
|
const Lang = imports.lang;
|
||||||
|
|
||||||
|
const Gio = imports.gi.Gio;
|
||||||
|
const Meta = imports.gi.Meta;
|
||||||
|
const Shell = imports.gi.Shell;
|
||||||
|
|
||||||
|
const Recorder = new Lang.Class({
|
||||||
|
Name: 'Recorder',
|
||||||
|
|
||||||
|
_init: function() {
|
||||||
|
this._recorderSettings = new Gio.Settings({ schema: 'org.gnome.shell.recorder' });
|
||||||
|
this._desktopLockdownSettings = new Gio.Settings({ schema: 'org.gnome.desktop.lockdown' });
|
||||||
|
this._bindingSettings = new Gio.Settings({ schema: 'org.gnome.shell.keybindings' });
|
||||||
|
this._recorder = null;
|
||||||
|
},
|
||||||
|
|
||||||
|
enable: function() {
|
||||||
|
global.display.add_keybinding('toggle-recording',
|
||||||
|
this._bindingSettings,
|
||||||
|
Meta.KeyBindingFlags.NONE, Lang.bind(this, this._toggleRecorder));
|
||||||
|
},
|
||||||
|
|
||||||
|
disable: function() {
|
||||||
|
global.display.remove_keybinding('toggle-recording');
|
||||||
|
},
|
||||||
|
|
||||||
|
_ensureRecorder: function() {
|
||||||
|
if (this._recorder == null)
|
||||||
|
this._recorder = new Shell.Recorder({ stage: global.stage });
|
||||||
|
return this._recorder;
|
||||||
|
},
|
||||||
|
|
||||||
|
_toggleRecorder: function() {
|
||||||
|
let recorder = this._ensureRecorder();
|
||||||
|
if (recorder.is_recording()) {
|
||||||
|
recorder.close();
|
||||||
|
Meta.enable_unredirect_for_screen(global.screen);
|
||||||
|
} else if (!this._desktopLockdownSettings.get_boolean('disable-save-to-disk')) {
|
||||||
|
// read the parameters from GSettings always in case they have changed
|
||||||
|
recorder.set_framerate(this._recorderSettings.get_int('framerate'));
|
||||||
|
/* Translators: this is a filename used for screencast recording */
|
||||||
|
// xgettext:no-c-format
|
||||||
|
recorder.set_file_template(_("Screencast from %d %t") + '.' + this._recorderSettings.get_string('file-extension'));
|
||||||
|
let pipeline = this._recorderSettings.get_string('pipeline');
|
||||||
|
|
||||||
|
if (!pipeline.match(/^\s*$/))
|
||||||
|
recorder.set_pipeline(pipeline);
|
||||||
|
else
|
||||||
|
recorder.set_pipeline(null);
|
||||||
|
|
||||||
|
Meta.disable_unredirect_for_screen(global.screen);
|
||||||
|
recorder.record();
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const Component = Recorder;
|
@ -1,179 +0,0 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
|
||||||
|
|
||||||
const Folks = imports.gi.Folks
|
|
||||||
const Lang = imports.lang;
|
|
||||||
const Meta = imports.gi.Meta;
|
|
||||||
const Shell = imports.gi.Shell;
|
|
||||||
const St = imports.gi.St;
|
|
||||||
|
|
||||||
const Util = imports.misc.util;
|
|
||||||
const IconGrid = imports.ui.iconGrid;
|
|
||||||
const Search = imports.ui.search;
|
|
||||||
const SearchDisplay = imports.ui.searchDisplay;
|
|
||||||
|
|
||||||
const MAX_SEARCH_RESULTS_ROWS = 1;
|
|
||||||
const ICON_SIZE = 81;
|
|
||||||
|
|
||||||
function launchContact(id) {
|
|
||||||
Util.spawn(['gnome-contacts', '-i', id]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* This class represents a shown contact search result in the overview */
|
|
||||||
function Contact(id) {
|
|
||||||
this._init(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
Contact.prototype = {
|
|
||||||
_init: function(id) {
|
|
||||||
this.individual = Shell.ContactSystem.get_default().get_individual(id);
|
|
||||||
|
|
||||||
this.actor = new St.Bin({ style_class: 'contact',
|
|
||||||
reactive: true,
|
|
||||||
track_hover: true });
|
|
||||||
|
|
||||||
let content = new St.BoxLayout( { style_class: 'contact-content',
|
|
||||||
vertical: false });
|
|
||||||
this.actor.set_child(content);
|
|
||||||
|
|
||||||
let icon = new St.Icon({ icon_type: St.IconType.FULLCOLOR,
|
|
||||||
icon_size: ICON_SIZE,
|
|
||||||
style_class: 'contact-icon' });
|
|
||||||
if (this.individual.avatar != null)
|
|
||||||
icon.gicon = this.individual.avatar;
|
|
||||||
else
|
|
||||||
icon.icon_name = 'avatar-default';
|
|
||||||
|
|
||||||
content.add(icon, { x_fill: true,
|
|
||||||
y_fill: false,
|
|
||||||
x_align: St.Align.START,
|
|
||||||
y_align: St.Align.MIDDLE });
|
|
||||||
|
|
||||||
let details = new St.BoxLayout({ style_class: 'contact-details',
|
|
||||||
vertical: true });
|
|
||||||
content.add(details, { x_fill: true,
|
|
||||||
y_fill: false,
|
|
||||||
x_align: St.Align.START,
|
|
||||||
y_align: St.Align.MIDDLE });
|
|
||||||
|
|
||||||
let aliasText = this.individual.alias || _("Unknown");
|
|
||||||
let aliasLabel = new St.Label({ text: aliasText,
|
|
||||||
style_class: 'contact-details-alias' });
|
|
||||||
details.add(aliasLabel, { x_fill: true,
|
|
||||||
y_fill: false,
|
|
||||||
x_align: St.Align.START,
|
|
||||||
y_align: St.Align.START });
|
|
||||||
|
|
||||||
let presence = this._createPresence(this.individual.presence_type);
|
|
||||||
details.add(presence, { x_fill: false,
|
|
||||||
y_fill: true,
|
|
||||||
x_align: St.Align.START,
|
|
||||||
y_align: St.Align.END });
|
|
||||||
},
|
|
||||||
|
|
||||||
_createPresence: function(presence) {
|
|
||||||
let text;
|
|
||||||
let iconName;
|
|
||||||
|
|
||||||
switch(presence) {
|
|
||||||
case Folks.PresenceType.AVAILABLE:
|
|
||||||
text = _("Available");
|
|
||||||
iconName = 'user-available';
|
|
||||||
break;
|
|
||||||
case Folks.PresenceType.AWAY:
|
|
||||||
case Folks.PresenceType.EXTENDED_AWAY:
|
|
||||||
text = _("Away");
|
|
||||||
iconName = 'user-away';
|
|
||||||
break;
|
|
||||||
case Folks.PresenceType.BUSY:
|
|
||||||
text = _("Busy");
|
|
||||||
iconName = 'user-busy';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
text = _("Offline");
|
|
||||||
iconName = 'user-offline';
|
|
||||||
}
|
|
||||||
|
|
||||||
let icon = new St.Icon({ icon_name: iconName,
|
|
||||||
icon_type: St.IconType.FULLCOLOR,
|
|
||||||
icon_size: 16,
|
|
||||||
style_class: 'contact-details-status-icon' });
|
|
||||||
let label = new St.Label({ text: text });
|
|
||||||
|
|
||||||
let box = new St.BoxLayout({ vertical: false,
|
|
||||||
style_class: 'contact-details-status' });
|
|
||||||
box.add(icon, { x_fill: true,
|
|
||||||
y_fill: false,
|
|
||||||
x_align: St.Align.START,
|
|
||||||
y_align: St.Align.START });
|
|
||||||
|
|
||||||
box.add(label, { x_fill: true,
|
|
||||||
y_fill: false,
|
|
||||||
x_align: St.Align.END,
|
|
||||||
y_align: St.Align.START });
|
|
||||||
|
|
||||||
return box;
|
|
||||||
},
|
|
||||||
|
|
||||||
createIcon: function(size) {
|
|
||||||
let tc = St.TextureCache.get_default();
|
|
||||||
let icon = this.individual.avatar;
|
|
||||||
|
|
||||||
if (icon != null) {
|
|
||||||
return tc.load_gicon(null, icon, size);
|
|
||||||
} else {
|
|
||||||
return tc.load_icon_name(null, 'avatar-default', St.IconType.FULLCOLOR, size);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* Searches for and returns contacts */
|
|
||||||
function ContactSearchProvider() {
|
|
||||||
this._init();
|
|
||||||
}
|
|
||||||
|
|
||||||
ContactSearchProvider.prototype = {
|
|
||||||
__proto__: Search.SearchProvider.prototype,
|
|
||||||
|
|
||||||
_init: function() {
|
|
||||||
Search.SearchProvider.prototype._init.call(this, _("CONTACTS"));
|
|
||||||
this._contactSys = Shell.ContactSystem.get_default();
|
|
||||||
},
|
|
||||||
|
|
||||||
getResultMeta: function(id) {
|
|
||||||
let contact = new Contact(id);
|
|
||||||
return { 'id': id,
|
|
||||||
'name': contact.alias,
|
|
||||||
'createIcon': function(size) {
|
|
||||||
return contact.createIcon(size);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
getInitialResultSet: function(terms) {
|
|
||||||
return this._contactSys.initial_search(terms);
|
|
||||||
},
|
|
||||||
|
|
||||||
getSubsearchResultSet: function(previousResults, terms) {
|
|
||||||
return this._contactSys.subsearch(previousResults, terms);
|
|
||||||
},
|
|
||||||
|
|
||||||
createResultActor: function(resultMeta, terms) {
|
|
||||||
let contact = new Contact(resultMeta.id);
|
|
||||||
return contact.actor;
|
|
||||||
},
|
|
||||||
|
|
||||||
createResultContainerActor: function() {
|
|
||||||
let grid = new IconGrid.IconGrid({ rowLimit: MAX_SEARCH_RESULTS_ROWS,
|
|
||||||
xAlign: St.Align.START });
|
|
||||||
grid.actor.style_class = 'contact-grid';
|
|
||||||
|
|
||||||
let actor = new SearchDisplay.GridSearchResults(this, grid);
|
|
||||||
return actor;
|
|
||||||
},
|
|
||||||
|
|
||||||
activateResult: function(id, params) {
|
|
||||||
launchContact(id);
|
|
||||||
}
|
|
||||||
};
|
|
@ -1,4 +1,4 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const Clutter = imports.gi.Clutter;
|
const Clutter = imports.gi.Clutter;
|
||||||
const Gdk = imports.gi.Gdk;
|
const Gdk = imports.gi.Gdk;
|
||||||
@ -22,14 +22,11 @@ const SortGroup = {
|
|||||||
BOTTOM: 2
|
BOTTOM: 2
|
||||||
};
|
};
|
||||||
|
|
||||||
function CtrlAltTabManager() {
|
const CtrlAltTabManager = new Lang.Class({
|
||||||
this._init();
|
Name: 'CtrlAltTabManager',
|
||||||
}
|
|
||||||
|
|
||||||
CtrlAltTabManager.prototype = {
|
|
||||||
_init: function() {
|
_init: function() {
|
||||||
this._items = [];
|
this._items = [];
|
||||||
this._focusManager = St.FocusManager.get_for_stage(global.stage);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
addGroup: function(root, name, icon, params) {
|
addGroup: function(root, name, icon, params) {
|
||||||
@ -43,11 +40,11 @@ CtrlAltTabManager.prototype = {
|
|||||||
|
|
||||||
this._items.push(item);
|
this._items.push(item);
|
||||||
root.connect('destroy', Lang.bind(this, function() { this.removeGroup(root); }));
|
root.connect('destroy', Lang.bind(this, function() { this.removeGroup(root); }));
|
||||||
this._focusManager.add_group(root);
|
global.focus_manager.add_group(root);
|
||||||
},
|
},
|
||||||
|
|
||||||
removeGroup: function(root) {
|
removeGroup: function(root) {
|
||||||
this._focusManager.remove_group(root);
|
global.focus_manager.remove_group(root);
|
||||||
for (let i = 0; i < this._items.length; i++) {
|
for (let i = 0; i < this._items.length; i++) {
|
||||||
if (this._items[i].root == root) {
|
if (this._items[i].root == root) {
|
||||||
this._items.splice(i, 1);
|
this._items.splice(i, 1);
|
||||||
@ -57,16 +54,17 @@ CtrlAltTabManager.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
focusGroup: function(item) {
|
focusGroup: function(item) {
|
||||||
if (global.stage_input_mode == Shell.StageInputMode.NONREACTIVE ||
|
if (item.window) {
|
||||||
global.stage_input_mode == Shell.StageInputMode.NORMAL)
|
|
||||||
global.set_stage_input_mode(Shell.StageInputMode.FOCUSED);
|
|
||||||
|
|
||||||
if (item.window)
|
|
||||||
Main.activateWindow(item.window);
|
Main.activateWindow(item.window);
|
||||||
else if (item.focusCallback)
|
} else if (item.focusCallback) {
|
||||||
item.focusCallback();
|
item.focusCallback();
|
||||||
else
|
} else {
|
||||||
|
if (global.stage_input_mode == Shell.StageInputMode.NONREACTIVE ||
|
||||||
|
global.stage_input_mode == Shell.StageInputMode.NORMAL)
|
||||||
|
global.set_stage_input_mode(Shell.StageInputMode.FOCUSED);
|
||||||
|
|
||||||
item.root.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
|
item.root.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Sort the items into a consistent order; panel first, tray last,
|
// Sort the items into a consistent order; panel first, tray last,
|
||||||
@ -134,17 +132,15 @@ CtrlAltTabManager.prototype = {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
function mod(a, b) {
|
function mod(a, b) {
|
||||||
return (a + b) % b;
|
return (a + b) % b;
|
||||||
}
|
}
|
||||||
|
|
||||||
function CtrlAltTabPopup() {
|
const CtrlAltTabPopup = new Lang.Class({
|
||||||
this._init();
|
Name: 'CtrlAltTabPopup',
|
||||||
}
|
|
||||||
|
|
||||||
CtrlAltTabPopup.prototype = {
|
|
||||||
_init : function() {
|
_init : function() {
|
||||||
this.actor = new Shell.GenericContainer({ name: 'ctrlAltTabPopup',
|
this.actor = new Shell.GenericContainer({ name: 'ctrlAltTabPopup',
|
||||||
reactive: true });
|
reactive: true });
|
||||||
@ -187,7 +183,7 @@ CtrlAltTabPopup.prototype = {
|
|||||||
let [childMinHeight, childNaturalHeight] = this._switcher.actor.get_preferred_height(primary.width - hPadding);
|
let [childMinHeight, childNaturalHeight] = this._switcher.actor.get_preferred_height(primary.width - hPadding);
|
||||||
let [childMinWidth, childNaturalWidth] = this._switcher.actor.get_preferred_width(childNaturalHeight);
|
let [childMinWidth, childNaturalWidth] = this._switcher.actor.get_preferred_width(childNaturalHeight);
|
||||||
childBox.x1 = Math.max(primary.x + leftPadding, primary.x + Math.floor((primary.width - childNaturalWidth) / 2));
|
childBox.x1 = Math.max(primary.x + leftPadding, primary.x + Math.floor((primary.width - childNaturalWidth) / 2));
|
||||||
childBox.x2 = Math.min(primary.width - hPadding, childBox.x1 + childNaturalWidth);
|
childBox.x2 = Math.min(primary.x + primary.width - hPadding, childBox.x1 + childNaturalWidth);
|
||||||
childBox.y1 = primary.y + Math.floor((primary.height - childNaturalHeight) / 2);
|
childBox.y1 = primary.y + Math.floor((primary.height - childNaturalHeight) / 2);
|
||||||
childBox.y2 = childBox.y1 + childNaturalHeight;
|
childBox.y2 = childBox.y1 + childNaturalHeight;
|
||||||
this._switcher.actor.allocate(childBox, flags);
|
this._switcher.actor.allocate(childBox, flags);
|
||||||
@ -237,7 +233,7 @@ CtrlAltTabPopup.prototype = {
|
|||||||
|
|
||||||
_keyPressEvent : function(actor, event) {
|
_keyPressEvent : function(actor, event) {
|
||||||
let keysym = event.get_key_symbol();
|
let keysym = event.get_key_symbol();
|
||||||
let shift = (Shell.get_event_state(event) & Clutter.ModifierType.SHIFT_MASK);
|
let shift = (event.get_state() & Clutter.ModifierType.SHIFT_MASK);
|
||||||
if (shift && keysym == Clutter.KEY_Tab)
|
if (shift && keysym == Clutter.KEY_Tab)
|
||||||
keysym = Clutter.ISO_Left_Tab;
|
keysym = Clutter.ISO_Left_Tab;
|
||||||
|
|
||||||
@ -303,17 +299,14 @@ CtrlAltTabPopup.prototype = {
|
|||||||
this._selection = num;
|
this._selection = num;
|
||||||
this._switcher.highlight(num);
|
this._switcher.highlight(num);
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
function CtrlAltTabSwitcher(items) {
|
const CtrlAltTabSwitcher = new Lang.Class({
|
||||||
this._init(items);
|
Name: 'CtrlAltTabSwitcher',
|
||||||
}
|
Extends: AltTab.SwitcherList,
|
||||||
|
|
||||||
CtrlAltTabSwitcher.prototype = {
|
|
||||||
__proto__ : AltTab.SwitcherList.prototype,
|
|
||||||
|
|
||||||
_init : function(items) {
|
_init : function(items) {
|
||||||
AltTab.SwitcherList.prototype._init.call(this, true);
|
this.parent(true);
|
||||||
|
|
||||||
for (let i = 0; i < items.length; i++)
|
for (let i = 0; i < items.length; i++)
|
||||||
this._addIcon(items[i]);
|
this._addIcon(items[i]);
|
||||||
@ -326,7 +319,6 @@ CtrlAltTabSwitcher.prototype = {
|
|||||||
let icon = item.iconActor;
|
let icon = item.iconActor;
|
||||||
if (!icon) {
|
if (!icon) {
|
||||||
icon = new St.Icon({ icon_name: item.iconName,
|
icon = new St.Icon({ icon_name: item.iconName,
|
||||||
icon_type: St.IconType.SYMBOLIC,
|
|
||||||
icon_size: POPUP_APPICON_SIZE });
|
icon_size: POPUP_APPICON_SIZE });
|
||||||
}
|
}
|
||||||
box.add(icon, { x_fill: false, y_fill: false } );
|
box.add(icon, { x_fill: false, y_fill: false } );
|
||||||
@ -336,4 +328,4 @@ CtrlAltTabSwitcher.prototype = {
|
|||||||
|
|
||||||
this.addItem(box, text);
|
this.addItem(box, text);
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
536
js/ui/dash.js
@ -1,4 +1,4 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const Clutter = imports.gi.Clutter;
|
const Clutter = imports.gi.Clutter;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
@ -6,6 +6,7 @@ const Lang = imports.lang;
|
|||||||
const Meta = imports.gi.Meta;
|
const Meta = imports.gi.Meta;
|
||||||
const Shell = imports.gi.Shell;
|
const Shell = imports.gi.Shell;
|
||||||
const St = imports.gi.St;
|
const St = imports.gi.St;
|
||||||
|
const Mainloop = imports.mainloop;
|
||||||
|
|
||||||
const AppDisplay = imports.ui.appDisplay;
|
const AppDisplay = imports.ui.appDisplay;
|
||||||
const AppFavorites = imports.ui.appFavorites;
|
const AppFavorites = imports.ui.appFavorites;
|
||||||
@ -16,14 +17,26 @@ const Tweener = imports.ui.tweener;
|
|||||||
const Workspace = imports.ui.workspace;
|
const Workspace = imports.ui.workspace;
|
||||||
|
|
||||||
const DASH_ANIMATION_TIME = 0.2;
|
const DASH_ANIMATION_TIME = 0.2;
|
||||||
|
const DASH_ITEM_LABEL_SHOW_TIME = 0.15;
|
||||||
|
const DASH_ITEM_LABEL_HIDE_TIME = 0.1;
|
||||||
|
const DASH_ITEM_HOVER_TIMEOUT = 300;
|
||||||
|
|
||||||
|
function getAppFromSource(source) {
|
||||||
|
if (source instanceof AppDisplay.AppWellIcon) {
|
||||||
|
return source.app;
|
||||||
|
} else if (source.metaWindow) {
|
||||||
|
let tracker = Shell.WindowTracker.get_default();
|
||||||
|
return tracker.get_window_app(source.metaWindow);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// A container like StBin, but taking the child's scale into account
|
// A container like StBin, but taking the child's scale into account
|
||||||
// when requesting a size
|
// when requesting a size
|
||||||
function DashItemContainer() {
|
const DashItemContainer = new Lang.Class({
|
||||||
this._init();
|
Name: 'DashItemContainer',
|
||||||
}
|
|
||||||
|
|
||||||
DashItemContainer.prototype = {
|
|
||||||
_init: function() {
|
_init: function() {
|
||||||
this.actor = new Shell.GenericContainer({ style_class: 'dash-item-container' });
|
this.actor = new Shell.GenericContainer({ style_class: 'dash-item-container' });
|
||||||
this.actor.connect('get-preferred-width',
|
this.actor.connect('get-preferred-width',
|
||||||
@ -34,9 +47,16 @@ DashItemContainer.prototype = {
|
|||||||
Lang.bind(this, this._allocate));
|
Lang.bind(this, this._allocate));
|
||||||
this.actor._delegate = this;
|
this.actor._delegate = this;
|
||||||
|
|
||||||
|
this._labelText = "";
|
||||||
|
this.label = new St.Label({ style_class: 'dash-label'});
|
||||||
|
this.label.hide();
|
||||||
|
Main.layoutManager.addChrome(this.label);
|
||||||
|
this.actor.label_actor = this.label;
|
||||||
|
|
||||||
this.child = null;
|
this.child = null;
|
||||||
this._childScale = 1;
|
this._childScale = 1;
|
||||||
this._childOpacity = 255;
|
this._childOpacity = 255;
|
||||||
|
this.animatingOut = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
_allocate: function(actor, box, flags) {
|
_allocate: function(actor, box, flags) {
|
||||||
@ -85,11 +105,61 @@ DashItemContainer.prototype = {
|
|||||||
alloc.natural_size = natWidth * this.child.scale_y;
|
alloc.natural_size = natWidth * this.child.scale_y;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
showLabel: function() {
|
||||||
|
if (!this._labelText)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.label.set_text(this._labelText);
|
||||||
|
this.label.opacity = 0;
|
||||||
|
this.label.show();
|
||||||
|
|
||||||
|
let [stageX, stageY] = this.actor.get_transformed_position();
|
||||||
|
|
||||||
|
let itemHeight = this.actor.allocation.y2 - this.actor.allocation.y1;
|
||||||
|
|
||||||
|
let labelHeight = this.label.get_height();
|
||||||
|
let yOffset = Math.floor((itemHeight - labelHeight) / 2)
|
||||||
|
|
||||||
|
let y = stageY + yOffset;
|
||||||
|
|
||||||
|
let node = this.label.get_theme_node();
|
||||||
|
let xOffset = node.get_length('-x-offset');
|
||||||
|
|
||||||
|
let x;
|
||||||
|
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)
|
||||||
|
x = stageX - this.label.get_width() - xOffset;
|
||||||
|
else
|
||||||
|
x = stageX + this.actor.get_width() + xOffset;
|
||||||
|
|
||||||
|
this.label.set_position(x, y);
|
||||||
|
Tweener.addTween(this.label,
|
||||||
|
{ opacity: 255,
|
||||||
|
time: DASH_ITEM_LABEL_SHOW_TIME,
|
||||||
|
transition: 'easeOutQuad',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
setLabelText: function(text) {
|
||||||
|
this._labelText = text;
|
||||||
|
this.child.accessible_name = text;
|
||||||
|
},
|
||||||
|
|
||||||
|
hideLabel: function () {
|
||||||
|
Tweener.addTween(this.label,
|
||||||
|
{ opacity: 0,
|
||||||
|
time: DASH_ITEM_LABEL_HIDE_TIME,
|
||||||
|
transition: 'easeOutQuad',
|
||||||
|
onComplete: Lang.bind(this, function() {
|
||||||
|
this.label.hide();
|
||||||
|
})
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
setChild: function(actor) {
|
setChild: function(actor) {
|
||||||
if (this.child == actor)
|
if (this.child == actor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.actor.destroy_children();
|
this.actor.destroy_all_children();
|
||||||
|
|
||||||
this.child = actor;
|
this.child = actor;
|
||||||
this.actor.add_actor(this.child);
|
this.actor.add_actor(this.child);
|
||||||
@ -109,12 +179,23 @@ DashItemContainer.prototype = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
destroy: function() {
|
||||||
|
if (this.label)
|
||||||
|
this.label.destroy();
|
||||||
|
|
||||||
|
this.actor.destroy();
|
||||||
|
},
|
||||||
|
|
||||||
animateOutAndDestroy: function() {
|
animateOutAndDestroy: function() {
|
||||||
|
if (this.label)
|
||||||
|
this.label.destroy();
|
||||||
|
|
||||||
if (this.child == null) {
|
if (this.child == null) {
|
||||||
this.actor.destroy();
|
this.actor.destroy();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.animatingOut = true;
|
||||||
this.childScale = 1.0;
|
this.childScale = 1.0;
|
||||||
Tweener.addTween(this,
|
Tweener.addTween(this,
|
||||||
{ childScale: 0.0,
|
{ childScale: 0.0,
|
||||||
@ -155,63 +236,78 @@ DashItemContainer.prototype = {
|
|||||||
get childOpacity() {
|
get childOpacity() {
|
||||||
return this._childOpacity;
|
return this._childOpacity;
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
function RemoveFavoriteIcon() {
|
const ShowAppsIcon = new Lang.Class({
|
||||||
this._init();
|
Name: 'ShowAppsIcon',
|
||||||
}
|
Extends: DashItemContainer,
|
||||||
|
|
||||||
RemoveFavoriteIcon.prototype = {
|
|
||||||
__proto__: DashItemContainer.prototype,
|
|
||||||
|
|
||||||
_init: function() {
|
_init: function() {
|
||||||
DashItemContainer.prototype._init.call(this);
|
this.parent();
|
||||||
|
|
||||||
this._iconBin = new St.Bin({ style_class: 'remove-favorite' });
|
this.toggleButton = new St.Button({ style_class: 'show-apps',
|
||||||
|
track_hover: true,
|
||||||
|
can_focus: true,
|
||||||
|
toggle_mode: true });
|
||||||
this._iconActor = null;
|
this._iconActor = null;
|
||||||
this.icon = new IconGrid.BaseIcon(_("Remove"),
|
this.icon = new IconGrid.BaseIcon(_("Show Applications"),
|
||||||
{ setSizeManually: true,
|
{ setSizeManually: true,
|
||||||
showLabel: false,
|
showLabel: false,
|
||||||
createIcon: Lang.bind(this, this._createIcon) });
|
createIcon: Lang.bind(this, this._createIcon) });
|
||||||
this._iconBin.set_child(this.icon.actor);
|
this.toggleButton.add_actor(this.icon.actor);
|
||||||
this._iconBin._delegate = this;
|
this.toggleButton._delegate = this;
|
||||||
|
|
||||||
this.setChild(this._iconBin);
|
this.setChild(this.toggleButton);
|
||||||
this.hiding = false;
|
this.setDragApp(null);
|
||||||
},
|
|
||||||
|
|
||||||
animateOutAndDestroy: function() {
|
|
||||||
DashItemContainer.prototype.animateOutAndDestroy.call(this);
|
|
||||||
this.hiding = true;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_createIcon: function(size) {
|
_createIcon: function(size) {
|
||||||
this._iconActor = new St.Icon({ icon_name: 'user-trash',
|
this._iconActor = new St.Icon({ icon_name: 'view-grid-symbolic',
|
||||||
style_class: 'remove-favorite-icon',
|
icon_size: size,
|
||||||
icon_size: size });
|
style_class: 'show-apps-icon',
|
||||||
|
track_hover: true });
|
||||||
return this._iconActor;
|
return this._iconActor;
|
||||||
},
|
},
|
||||||
|
|
||||||
setHover: function(hovered) {
|
_canRemoveApp: function(app) {
|
||||||
this._iconBin.set_hover(hovered);
|
if (app == null)
|
||||||
if (this._iconActor)
|
return false;
|
||||||
this._iconActor.set_hover(hovered);
|
|
||||||
|
let id = app.get_id();
|
||||||
|
let isFavorite = AppFavorites.getAppFavorites().isFavorite(id);
|
||||||
|
return isFavorite;
|
||||||
|
},
|
||||||
|
|
||||||
|
setDragApp: function(app) {
|
||||||
|
let canRemove = this._canRemoveApp(app);
|
||||||
|
|
||||||
|
this.toggleButton.set_hover(canRemove);
|
||||||
|
if (this._iconActor)
|
||||||
|
this._iconActor.set_hover(canRemove);
|
||||||
|
|
||||||
|
if (canRemove)
|
||||||
|
this.setLabelText(_("Remove from Favorites"));
|
||||||
|
else
|
||||||
|
this.setLabelText(_("Show Applications"));
|
||||||
},
|
},
|
||||||
|
|
||||||
// Rely on the dragged item being a favorite
|
|
||||||
handleDragOver: function(source, actor, x, y, time) {
|
handleDragOver: function(source, actor, x, y, time) {
|
||||||
|
let app = getAppFromSource(source);
|
||||||
|
if (app == null)
|
||||||
|
return DND.DragMotionResult.NO_DROP;
|
||||||
|
|
||||||
|
let id = app.get_id();
|
||||||
|
let isFavorite = AppFavorites.getAppFavorites().isFavorite(id);
|
||||||
|
if (!isFavorite)
|
||||||
|
return DND.DragMotionResult.NO_DROP;
|
||||||
|
|
||||||
return DND.DragMotionResult.MOVE_DROP;
|
return DND.DragMotionResult.MOVE_DROP;
|
||||||
},
|
},
|
||||||
|
|
||||||
acceptDrop: function(source, actor, x, y, time) {
|
acceptDrop: function(source, actor, x, y, time) {
|
||||||
let app = null;
|
let app = getAppFromSource(source);
|
||||||
if (source instanceof AppDisplay.AppWellIcon) {
|
if (app == null)
|
||||||
let appSystem = Shell.AppSystem.get_default();
|
return false;
|
||||||
app = appSystem.lookup_app(source.getId());
|
|
||||||
} else if (source.metaWindow) {
|
|
||||||
let tracker = Shell.WindowTracker.get_default();
|
|
||||||
app = tracker.get_window_app(source.metaWindow);
|
|
||||||
}
|
|
||||||
|
|
||||||
let id = app.get_id();
|
let id = app.get_id();
|
||||||
|
|
||||||
@ -223,28 +319,54 @@ RemoveFavoriteIcon.prototype = {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
|
const DragPlaceholderItem = new Lang.Class({
|
||||||
function DragPlaceholderItem() {
|
Name: 'DragPlaceholderItem',
|
||||||
this._init();
|
Extends: DashItemContainer,
|
||||||
}
|
|
||||||
|
|
||||||
DragPlaceholderItem.prototype = {
|
|
||||||
__proto__: DashItemContainer.prototype,
|
|
||||||
|
|
||||||
_init: function() {
|
_init: function() {
|
||||||
DashItemContainer.prototype._init.call(this);
|
this.parent();
|
||||||
this.setChild(new St.Bin({ style_class: 'dash-placeholder' }));
|
this.setChild(new St.Bin({ style_class: 'placeholder' }));
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
|
const DashActor = new Lang.Class({
|
||||||
|
Name: 'DashActor',
|
||||||
|
Extends: St.Widget,
|
||||||
|
|
||||||
function Dash() {
|
_init: function() {
|
||||||
this._init();
|
let layout = new Clutter.BoxLayout({ orientation: Clutter.Orientation.VERTICAL });
|
||||||
}
|
this.parent({ name: 'dash',
|
||||||
|
layout_manager: layout,
|
||||||
|
clip_to_allocation: true });
|
||||||
|
},
|
||||||
|
|
||||||
|
vfunc_allocate: function(box, flags) {
|
||||||
|
let contentBox = this.get_theme_node().get_content_box(box);
|
||||||
|
let availWidth = contentBox.x2 - contentBox.x1;
|
||||||
|
|
||||||
|
this.set_allocation(box, flags);
|
||||||
|
|
||||||
|
let [appIcons, showAppsButton] = this.get_children();
|
||||||
|
let [showAppsMinHeight, showAppsNatHeight] = showAppsButton.get_preferred_height(availWidth);
|
||||||
|
|
||||||
|
let childBox = new Clutter.ActorBox();
|
||||||
|
childBox.x1 = contentBox.x1;
|
||||||
|
childBox.y1 = contentBox.y1;
|
||||||
|
childBox.x2 = contentBox.x2;
|
||||||
|
childBox.y2 = contentBox.y2 - showAppsNatHeight;
|
||||||
|
appIcons.allocate(childBox, flags);
|
||||||
|
|
||||||
|
childBox.y1 = contentBox.y2 - showAppsNatHeight;
|
||||||
|
childBox.y2 = contentBox.y2;
|
||||||
|
showAppsButton.allocate(childBox, flags);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const Dash = new Lang.Class({
|
||||||
|
Name: 'Dash',
|
||||||
|
|
||||||
Dash.prototype = {
|
|
||||||
_init : function() {
|
_init : function() {
|
||||||
this._maxHeight = -1;
|
this._maxHeight = -1;
|
||||||
this.iconSize = 64;
|
this.iconSize = 64;
|
||||||
@ -253,14 +375,25 @@ Dash.prototype = {
|
|||||||
this._dragPlaceholder = null;
|
this._dragPlaceholder = null;
|
||||||
this._dragPlaceholderPos = -1;
|
this._dragPlaceholderPos = -1;
|
||||||
this._animatingPlaceholdersCount = 0;
|
this._animatingPlaceholdersCount = 0;
|
||||||
this._favRemoveTarget = null;
|
this._showLabelTimeoutId = 0;
|
||||||
|
this._resetHoverTimeoutId = 0;
|
||||||
|
this._labelShowing = false;
|
||||||
|
|
||||||
this._box = new St.BoxLayout({ name: 'dash',
|
this._container = new DashActor();
|
||||||
vertical: true,
|
this._box = new St.BoxLayout({ vertical: true,
|
||||||
clip_to_allocation: true });
|
clip_to_allocation: true });
|
||||||
this._box._delegate = this;
|
this._box._delegate = this;
|
||||||
|
this._container.add_actor(this._box);
|
||||||
|
|
||||||
this.actor = new St.Bin({ y_align: St.Align.START, child: this._box });
|
this._showAppsIcon = new ShowAppsIcon();
|
||||||
|
this._showAppsIcon.icon.setIconSize(this.iconSize);
|
||||||
|
this._hookUpLabel(this._showAppsIcon);
|
||||||
|
|
||||||
|
this.showAppsButton = this._showAppsIcon.toggleButton;
|
||||||
|
|
||||||
|
this._container.add_actor(this._showAppsIcon.actor);
|
||||||
|
|
||||||
|
this.actor = new St.Bin({ child: this._container });
|
||||||
this.actor.connect('notify::height', Lang.bind(this,
|
this.actor.connect('notify::height', Lang.bind(this,
|
||||||
function() {
|
function() {
|
||||||
if (this._maxHeight != this.actor.height)
|
if (this._maxHeight != this.actor.height)
|
||||||
@ -270,7 +403,6 @@ Dash.prototype = {
|
|||||||
|
|
||||||
this._workId = Main.initializeDeferredWork(this._box, Lang.bind(this, this._redisplay));
|
this._workId = Main.initializeDeferredWork(this._box, Lang.bind(this, this._redisplay));
|
||||||
|
|
||||||
this._tracker = Shell.WindowTracker.get_default();
|
|
||||||
this._appSystem = Shell.AppSystem.get_default();
|
this._appSystem = Shell.AppSystem.get_default();
|
||||||
|
|
||||||
this._appSystem.connect('installed-changed', Lang.bind(this, this._queueRedisplay));
|
this._appSystem.connect('installed-changed', Lang.bind(this, this._queueRedisplay));
|
||||||
@ -313,56 +445,25 @@ Dash.prototype = {
|
|||||||
|
|
||||||
_endDrag: function() {
|
_endDrag: function() {
|
||||||
this._clearDragPlaceholder();
|
this._clearDragPlaceholder();
|
||||||
if (this._favRemoveTarget) {
|
this._showAppsIcon.setDragApp(null);
|
||||||
this._favRemoveTarget.actor.hide();
|
|
||||||
this._adjustIconSize();
|
|
||||||
this._favRemoveTarget.actor.show();
|
|
||||||
|
|
||||||
this._favRemoveTarget.animateOutAndDestroy();
|
|
||||||
this._favRemoveTarget.actor.connect('destroy', Lang.bind(this,
|
|
||||||
function() {
|
|
||||||
this._favRemoveTarget = null;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
DND.removeDragMonitor(this._dragMonitor);
|
DND.removeDragMonitor(this._dragMonitor);
|
||||||
},
|
},
|
||||||
|
|
||||||
_onDragMotion: function(dragEvent) {
|
_onDragMotion: function(dragEvent) {
|
||||||
let app = null;
|
let app = getAppFromSource(dragEvent.source);
|
||||||
if (dragEvent.source instanceof AppDisplay.AppWellIcon)
|
if (app == null)
|
||||||
app = this._appSystem.lookup_app(dragEvent.source.getId());
|
|
||||||
else if (dragEvent.source.metaWindow)
|
|
||||||
app = this._tracker.get_window_app(dragEvent.source.metaWindow);
|
|
||||||
else
|
|
||||||
return DND.DragMotionResult.CONTINUE;
|
return DND.DragMotionResult.CONTINUE;
|
||||||
|
|
||||||
let id = app.get_id();
|
let showAppsHovered =
|
||||||
|
this._showAppsIcon.actor.contains(dragEvent.targetActor);
|
||||||
|
|
||||||
let favorites = AppFavorites.getAppFavorites().getFavoriteMap();
|
if (!this._box.contains(dragEvent.targetActor) || showAppsHovered)
|
||||||
|
|
||||||
let srcIsFavorite = (id in favorites);
|
|
||||||
|
|
||||||
if (srcIsFavorite &&
|
|
||||||
dragEvent.source.actor &&
|
|
||||||
this.actor.contains (dragEvent.source.actor) &&
|
|
||||||
this._favRemoveTarget == null) {
|
|
||||||
this._favRemoveTarget = new RemoveFavoriteIcon();
|
|
||||||
this._favRemoveTarget.icon.setIconSize(this.iconSize);
|
|
||||||
this._box.add(this._favRemoveTarget.actor);
|
|
||||||
this._adjustIconSize();
|
|
||||||
this._favRemoveTarget.animateIn();
|
|
||||||
}
|
|
||||||
|
|
||||||
let favRemoveHovered = false;
|
|
||||||
if (this._favRemoveTarget)
|
|
||||||
favRemoveHovered =
|
|
||||||
this._favRemoveTarget.actor.contains(dragEvent.targetActor);
|
|
||||||
|
|
||||||
if (!this._box.contains(dragEvent.targetActor) || favRemoveHovered)
|
|
||||||
this._clearDragPlaceholder();
|
this._clearDragPlaceholder();
|
||||||
|
|
||||||
if (this._favRemoveTarget)
|
if (showAppsHovered)
|
||||||
this._favRemoveTarget.setHover(favRemoveHovered);
|
this._showAppsIcon.setDragApp(app);
|
||||||
|
else
|
||||||
|
this._showAppsIcon.setDragApp(null);
|
||||||
|
|
||||||
return DND.DragMotionResult.CONTINUE;
|
return DND.DragMotionResult.CONTINUE;
|
||||||
},
|
},
|
||||||
@ -378,57 +479,145 @@ Dash.prototype = {
|
|||||||
Main.queueDeferredWork(this._workId);
|
Main.queueDeferredWork(this._workId);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_hookUpLabel: function(item) {
|
||||||
|
item.child.connect('notify::hover', Lang.bind(this, function() {
|
||||||
|
this._onHover(item);
|
||||||
|
}));
|
||||||
|
|
||||||
|
Main.overview.connect('hiding', Lang.bind(this, function() {
|
||||||
|
this._labelShowing = false;
|
||||||
|
item.hideLabel();
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
|
||||||
_createAppItem: function(app) {
|
_createAppItem: function(app) {
|
||||||
let display = new AppDisplay.AppWellIcon(app,
|
let appIcon = new AppDisplay.AppWellIcon(app,
|
||||||
{ setSizeManually: true,
|
{ setSizeManually: true,
|
||||||
showLabel: false });
|
showLabel: false });
|
||||||
display._draggable.connect('drag-begin',
|
appIcon._draggable.connect('drag-begin',
|
||||||
Lang.bind(this, function() {
|
Lang.bind(this, function() {
|
||||||
display.actor.opacity = 50;
|
appIcon.actor.opacity = 50;
|
||||||
}));
|
}));
|
||||||
display._draggable.connect('drag-end',
|
appIcon._draggable.connect('drag-end',
|
||||||
Lang.bind(this, function() {
|
Lang.bind(this, function() {
|
||||||
display.actor.opacity = 255;
|
appIcon.actor.opacity = 255;
|
||||||
}));
|
}));
|
||||||
display.actor.set_tooltip_text(app.get_name());
|
appIcon.connect('menu-state-changed',
|
||||||
|
Lang.bind(this, function(appIcon, opened) {
|
||||||
|
this._itemMenuStateChanged(item, opened);
|
||||||
|
}));
|
||||||
|
|
||||||
let item = new DashItemContainer();
|
let item = new DashItemContainer();
|
||||||
item.setChild(display.actor);
|
item.setChild(appIcon.actor);
|
||||||
|
|
||||||
display.icon.setIconSize(this.iconSize);
|
// Override default AppWellIcon label_actor, now the
|
||||||
|
// accessible_name is set at DashItemContainer.setLabelText
|
||||||
|
appIcon.actor.label_actor = null;
|
||||||
|
item.setLabelText(app.get_name());
|
||||||
|
|
||||||
|
appIcon.icon.setIconSize(this.iconSize);
|
||||||
|
this._hookUpLabel(item);
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
},
|
},
|
||||||
|
|
||||||
_adjustIconSize: function() {
|
_itemMenuStateChanged: function(item, opened) {
|
||||||
let children = this._box.get_children();
|
// When the menu closes, it calls sync_hover, which means
|
||||||
if (children.length == 0) {
|
// that the notify::hover handler does everything we need to.
|
||||||
this._box.add_style_pseudo_class('empty');
|
if (opened) {
|
||||||
return;
|
if (this._showLabelTimeoutId > 0) {
|
||||||
}
|
Mainloop.source_remove(this._showLabelTimeoutId);
|
||||||
|
this._showLabelTimeoutId = 0;
|
||||||
|
}
|
||||||
|
|
||||||
this._box.remove_style_pseudo_class('empty');
|
item.hideLabel();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_onHover: function (item) {
|
||||||
|
if (item.child.get_hover()) {
|
||||||
|
if (this._showLabelTimeoutId == 0) {
|
||||||
|
let timeout = this._labelShowing ? 0 : DASH_ITEM_HOVER_TIMEOUT;
|
||||||
|
this._showLabelTimeoutId = Mainloop.timeout_add(timeout,
|
||||||
|
Lang.bind(this, function() {
|
||||||
|
this._labelShowing = true;
|
||||||
|
item.showLabel();
|
||||||
|
return false;
|
||||||
|
}));
|
||||||
|
if (this._resetHoverTimeoutId > 0) {
|
||||||
|
Mainloop.source_remove(this._resetHoverTimeoutId);
|
||||||
|
this._resetHoverTimeoutId = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (this._showLabelTimeoutId > 0)
|
||||||
|
Mainloop.source_remove(this._showLabelTimeoutId);
|
||||||
|
this._showLabelTimeoutId = 0;
|
||||||
|
item.hideLabel();
|
||||||
|
if (this._labelShowing) {
|
||||||
|
this._resetHoverTimeoutId = Mainloop.timeout_add(DASH_ITEM_HOVER_TIMEOUT,
|
||||||
|
Lang.bind(this, function() {
|
||||||
|
this._labelShowing = false;
|
||||||
|
return false;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_adjustIconSize: function() {
|
||||||
|
// For the icon size, we only consider children which are "proper"
|
||||||
|
// icons (i.e. ignoring drag placeholders) and which are not
|
||||||
|
// animating out (which means they will be destroyed at the end of
|
||||||
|
// the animation)
|
||||||
|
let iconChildren = this._box.get_children().filter(function(actor) {
|
||||||
|
return actor._delegate.child &&
|
||||||
|
actor._delegate.child._delegate &&
|
||||||
|
actor._delegate.child._delegate.icon &&
|
||||||
|
!actor._delegate.animatingOut;
|
||||||
|
});
|
||||||
|
|
||||||
|
iconChildren.push(this._showAppsIcon.actor);
|
||||||
|
|
||||||
if (this._maxHeight == -1)
|
if (this._maxHeight == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let iconChildren = children.filter(function(actor) {
|
let themeNode = this._container.get_theme_node();
|
||||||
return actor.visible &&
|
let maxAllocation = new Clutter.ActorBox({ x1: 0, y1: 0,
|
||||||
actor._delegate.child &&
|
x2: 42 /* whatever */,
|
||||||
actor._delegate.child._delegate &&
|
y2: this._maxHeight });
|
||||||
actor._delegate.child._delegate.icon;
|
let maxContent = themeNode.get_content_box(maxAllocation);
|
||||||
});
|
let availHeight = maxContent.y2 - maxContent.y1;
|
||||||
|
let spacing = themeNode.get_length('spacing');
|
||||||
|
|
||||||
// Compute the amount of extra space (or missing space) we have
|
|
||||||
// per icon with the current icon size
|
let firstIcon = iconChildren[0]._delegate.child._delegate.icon;
|
||||||
let [minHeight, natHeight] = this.actor.get_preferred_height(-1);
|
|
||||||
let diff = (this._maxHeight - natHeight) / iconChildren.length;
|
let minHeight, natHeight;
|
||||||
|
|
||||||
|
// Enforce the current icon size during the size request if
|
||||||
|
// the icon is animating
|
||||||
|
if (firstIcon._animating) {
|
||||||
|
let [currentWidth, currentHeight] = firstIcon.icon.get_size();
|
||||||
|
|
||||||
|
firstIcon.icon.set_size(this.iconSize, this.iconSize);
|
||||||
|
[minHeight, natHeight] = iconChildren[0].get_preferred_height(-1);
|
||||||
|
|
||||||
|
firstIcon.icon.set_size(currentWidth, currentHeight);
|
||||||
|
} else {
|
||||||
|
[minHeight, natHeight] = iconChildren[0].get_preferred_height(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Subtract icon padding and box spacing from the available height
|
||||||
|
availHeight -= iconChildren.length * (natHeight - this.iconSize) +
|
||||||
|
(iconChildren.length - 1) * spacing;
|
||||||
|
|
||||||
|
let availSize = availHeight / iconChildren.length;
|
||||||
|
|
||||||
let iconSizes = [ 16, 22, 24, 32, 48, 64 ];
|
let iconSizes = [ 16, 22, 24, 32, 48, 64 ];
|
||||||
|
|
||||||
let newIconSize = 16;
|
let newIconSize = 16;
|
||||||
for (let i = 0; i < iconSizes.length; i++) {
|
for (let i = 0; i < iconSizes.length; i++) {
|
||||||
if (iconSizes[i] < this.iconSize + diff)
|
if (iconSizes[i] < availSize)
|
||||||
newIconSize = iconSizes[i];
|
newIconSize = iconSizes[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -459,11 +648,15 @@ Dash.prototype = {
|
|||||||
icon.icon.set_size(icon.icon.width * scale,
|
icon.icon.set_size(icon.icon.width * scale,
|
||||||
icon.icon.height * scale);
|
icon.icon.height * scale);
|
||||||
|
|
||||||
|
icon._animating = true;
|
||||||
Tweener.addTween(icon.icon,
|
Tweener.addTween(icon.icon,
|
||||||
{ width: targetWidth,
|
{ width: targetWidth,
|
||||||
height: targetHeight,
|
height: targetHeight,
|
||||||
time: DASH_ANIMATION_TIME,
|
time: DASH_ANIMATION_TIME,
|
||||||
transition: 'easeOutQuad'
|
transition: 'easeOutQuad',
|
||||||
|
onComplete: function() {
|
||||||
|
icon._animating = false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -563,39 +756,26 @@ Dash.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < addedItems.length; i++)
|
for (let i = 0; i < addedItems.length; i++)
|
||||||
this._box.insert_actor(addedItems[i].item.actor,
|
this._box.insert_child_at_index(addedItems[i].item.actor,
|
||||||
addedItems[i].pos);
|
addedItems[i].pos);
|
||||||
|
|
||||||
// Hide removed actors to not take them into account
|
|
||||||
// when adjusting the icon size ...
|
|
||||||
for (let i = 0; i < removedActors.length; i++)
|
|
||||||
removedActors[i].hide();
|
|
||||||
|
|
||||||
// ... and do the same for the remove target if necessary
|
|
||||||
if (this._favRemoveTarget && this._favRemoveTarget.hiding)
|
|
||||||
this._favRemoveTarget.actor.hide();
|
|
||||||
|
|
||||||
this._adjustIconSize();
|
|
||||||
|
|
||||||
if (this._favRemoveTarget && this._favRemoveTarget.hiding)
|
|
||||||
this._favRemoveTarget.actor.show();
|
|
||||||
|
|
||||||
// Skip animations on first run when adding the initial set
|
|
||||||
// of items, to avoid all items zooming in at once
|
|
||||||
if (!this._shownInitially) {
|
|
||||||
this._shownInitially = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i = 0; i < removedActors.length; i++) {
|
for (let i = 0; i < removedActors.length; i++) {
|
||||||
removedActors[i].show();
|
|
||||||
let item = removedActors[i]._delegate;
|
let item = removedActors[i]._delegate;
|
||||||
|
|
||||||
// Don't animate item removal when the overview is hidden
|
// Don't animate item removal when the overview is hidden
|
||||||
if (Main.overview.visible)
|
if (Main.overview.visible)
|
||||||
item.animateOutAndDestroy();
|
item.animateOutAndDestroy();
|
||||||
else
|
else
|
||||||
item.actor.destroy();
|
item.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
this._adjustIconSize();
|
||||||
|
|
||||||
|
// Skip animations on first run when adding the initial set
|
||||||
|
// of items, to avoid all items zooming in at once
|
||||||
|
if (!this._shownInitially) {
|
||||||
|
this._shownInitially = true;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't animate item addition when the overview is hidden
|
// Don't animate item addition when the overview is hidden
|
||||||
@ -615,11 +795,7 @@ Dash.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleDragOver : function(source, actor, x, y, time) {
|
handleDragOver : function(source, actor, x, y, time) {
|
||||||
let app = null;
|
let app = getAppFromSource(source);
|
||||||
if (source instanceof AppDisplay.AppWellIcon)
|
|
||||||
app = this._appSystem.lookup_app(source.getId());
|
|
||||||
else if (source.metaWindow)
|
|
||||||
app = this._tracker.get_window_app(source.metaWindow);
|
|
||||||
|
|
||||||
// Don't allow favoriting of transient apps
|
// Don't allow favoriting of transient apps
|
||||||
if (app == null || app.is_window_backed())
|
if (app == null || app.is_window_backed())
|
||||||
@ -642,20 +818,10 @@ Dash.prototype = {
|
|||||||
numChildren--;
|
numChildren--;
|
||||||
}
|
}
|
||||||
|
|
||||||
let pos = Math.round(y * numChildren / boxHeight);
|
let pos = Math.floor(y * numChildren / boxHeight);
|
||||||
|
|
||||||
if (pos != this._dragPlaceholderPos && pos <= numFavorites) {
|
if (pos != this._dragPlaceholderPos && pos <= numFavorites && this._animatingPlaceholdersCount == 0) {
|
||||||
if (this._animatingPlaceholdersCount > 0) {
|
this._dragPlaceholderPos = pos;
|
||||||
let appChildren = children.filter(function(actor) {
|
|
||||||
return actor._delegate &&
|
|
||||||
actor._delegate.child &&
|
|
||||||
actor._delegate.child._delegate &&
|
|
||||||
actor._delegate.child._delegate.app;
|
|
||||||
});
|
|
||||||
this._dragPlaceholderPos = children.indexOf(appChildren[pos]);
|
|
||||||
} else {
|
|
||||||
this._dragPlaceholderPos = pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Don't allow positioning before or after self
|
// Don't allow positioning before or after self
|
||||||
if (favPos != -1 && (pos == favPos || pos == favPos + 1)) {
|
if (favPos != -1 && (pos == favPos || pos == favPos + 1)) {
|
||||||
@ -686,12 +852,20 @@ Dash.prototype = {
|
|||||||
this._dragPlaceholder = new DragPlaceholderItem();
|
this._dragPlaceholder = new DragPlaceholderItem();
|
||||||
this._dragPlaceholder.child.set_width (this.iconSize);
|
this._dragPlaceholder.child.set_width (this.iconSize);
|
||||||
this._dragPlaceholder.child.set_height (this.iconSize / 2);
|
this._dragPlaceholder.child.set_height (this.iconSize / 2);
|
||||||
this._box.insert_actor(this._dragPlaceholder.actor,
|
this._box.insert_child_at_index(this._dragPlaceholder.actor,
|
||||||
this._dragPlaceholderPos);
|
this._dragPlaceholderPos);
|
||||||
if (fadeIn)
|
if (fadeIn)
|
||||||
this._dragPlaceholder.animateIn();
|
this._dragPlaceholder.animateIn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove the drag placeholder if we are not in the
|
||||||
|
// "favorites zone"
|
||||||
|
if (pos > numFavorites && this._dragPlaceholder) {
|
||||||
|
this._clearDragPlaceholder();
|
||||||
|
}
|
||||||
|
if (!this._dragPlaceholder)
|
||||||
|
return DND.DragMotionResult.NO_DROP;
|
||||||
|
|
||||||
let srcIsFavorite = (favPos != -1);
|
let srcIsFavorite = (favPos != -1);
|
||||||
|
|
||||||
if (srcIsFavorite)
|
if (srcIsFavorite)
|
||||||
@ -702,12 +876,7 @@ Dash.prototype = {
|
|||||||
|
|
||||||
// Draggable target interface
|
// Draggable target interface
|
||||||
acceptDrop : function(source, actor, x, y, time) {
|
acceptDrop : function(source, actor, x, y, time) {
|
||||||
let app = null;
|
let app = getAppFromSource(source);
|
||||||
if (source instanceof AppDisplay.AppWellIcon) {
|
|
||||||
app = this._appSystem.lookup_app(source.getId());
|
|
||||||
} else if (source.metaWindow) {
|
|
||||||
app = this._tracker.get_window_app(source.metaWindow);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Don't allow favoriting of transient apps
|
// Don't allow favoriting of transient apps
|
||||||
if (app == null || app.is_window_backed()) {
|
if (app == null || app.is_window_backed()) {
|
||||||
@ -734,6 +903,11 @@ Dash.prototype = {
|
|||||||
favPos++;
|
favPos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// No drag placeholder means we don't wan't to favorite the app
|
||||||
|
// and we are dragging it to its original position
|
||||||
|
if (!this._dragPlaceholder)
|
||||||
|
return true;
|
||||||
|
|
||||||
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this,
|
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this,
|
||||||
function () {
|
function () {
|
||||||
let appFavorites = AppFavorites.getAppFavorites();
|
let appFavorites = AppFavorites.getAppFavorites();
|
||||||
@ -746,6 +920,6 @@ Dash.prototype = {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
Signals.addSignalMethods(Dash.prototype);
|
Signals.addSignalMethods(Dash.prototype);
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const GLib = imports.gi.GLib;
|
const GLib = imports.gi.GLib;
|
||||||
const Gio = imports.gi.Gio;
|
const Gio = imports.gi.Gio;
|
||||||
|
const GnomeDesktop = imports.gi.GnomeDesktop;
|
||||||
const Lang = imports.lang;
|
const Lang = imports.lang;
|
||||||
const Mainloop = imports.mainloop;
|
const Mainloop = imports.mainloop;
|
||||||
const Cairo = imports.cairo;
|
const Cairo = imports.cairo;
|
||||||
const Clutter = imports.gi.Clutter;
|
const Clutter = imports.gi.Clutter;
|
||||||
const Shell = imports.gi.Shell;
|
const Shell = imports.gi.Shell;
|
||||||
const St = imports.gi.St;
|
const St = imports.gi.St;
|
||||||
|
const Atk = imports.gi.Atk;
|
||||||
|
|
||||||
const Params = imports.misc.params;
|
const Params = imports.misc.params;
|
||||||
const Util = imports.misc.util;
|
const Util = imports.misc.util;
|
||||||
@ -15,14 +17,6 @@ const Main = imports.ui.main;
|
|||||||
const PanelMenu = imports.ui.panelMenu;
|
const PanelMenu = imports.ui.panelMenu;
|
||||||
const PopupMenu = imports.ui.popupMenu;
|
const PopupMenu = imports.ui.popupMenu;
|
||||||
const Calendar = imports.ui.calendar;
|
const Calendar = imports.ui.calendar;
|
||||||
const UPowerGlib = imports.gi.UPowerGlib;
|
|
||||||
|
|
||||||
// in org.gnome.desktop.interface
|
|
||||||
const CLOCK_FORMAT_KEY = 'clock-format';
|
|
||||||
|
|
||||||
// in org.gnome.shell.clock
|
|
||||||
const CLOCK_SHOW_DATE_KEY = 'show-date';
|
|
||||||
const CLOCK_SHOW_SECONDS_KEY = 'show-seconds';
|
|
||||||
|
|
||||||
function _onVertSepRepaint (area)
|
function _onVertSepRepaint (area)
|
||||||
{
|
{
|
||||||
@ -40,27 +34,27 @@ function _onVertSepRepaint (area)
|
|||||||
cr.stroke();
|
cr.stroke();
|
||||||
};
|
};
|
||||||
|
|
||||||
function DateMenuButton() {
|
const DateMenuButton = new Lang.Class({
|
||||||
this._init.apply(this, arguments);
|
Name: 'DateMenuButton',
|
||||||
}
|
Extends: PanelMenu.Button,
|
||||||
|
|
||||||
DateMenuButton.prototype = {
|
|
||||||
__proto__: PanelMenu.Button.prototype,
|
|
||||||
|
|
||||||
_init: function(params) {
|
|
||||||
params = Params.parse(params, { showEvents: true });
|
|
||||||
|
|
||||||
|
_init: function() {
|
||||||
let item;
|
let item;
|
||||||
let hbox;
|
let hbox;
|
||||||
let vbox;
|
let vbox;
|
||||||
|
|
||||||
let menuAlignment = 0.25;
|
let menuAlignment = 0.25;
|
||||||
if (St.Widget.get_default_direction() == St.TextDirection.RTL)
|
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)
|
||||||
menuAlignment = 1.0 - menuAlignment;
|
menuAlignment = 1.0 - menuAlignment;
|
||||||
PanelMenu.Button.prototype._init.call(this, menuAlignment);
|
this.parent(menuAlignment);
|
||||||
|
|
||||||
this._clock = new St.Label();
|
// At this moment calendar menu is not keyboard navigable at
|
||||||
this.actor.add_actor(this._clock);
|
// all (so not accessible), so it doesn't make sense to set as
|
||||||
|
// role ATK_ROLE_MENU like other elements of the panel.
|
||||||
|
this.actor.accessible_role = Atk.Role.LABEL;
|
||||||
|
|
||||||
|
this._clockDisplay = new St.Label();
|
||||||
|
this.actor.add_actor(this._clockDisplay);
|
||||||
|
|
||||||
hbox = new St.BoxLayout({name: 'calendarArea' });
|
hbox = new St.BoxLayout({name: 'calendarArea' });
|
||||||
this.menu.addActor(hbox);
|
this.menu.addActor(hbox);
|
||||||
@ -72,19 +66,12 @@ DateMenuButton.prototype = {
|
|||||||
|
|
||||||
// Date
|
// Date
|
||||||
this._date = new St.Label();
|
this._date = new St.Label();
|
||||||
|
this.actor.label_actor = this._clockDisplay;
|
||||||
this._date.style_class = 'datemenu-date-label';
|
this._date.style_class = 'datemenu-date-label';
|
||||||
vbox.add(this._date);
|
vbox.add(this._date);
|
||||||
|
|
||||||
if (params.showEvents) {
|
this._eventList = new Calendar.EventsList();
|
||||||
this._eventSource = new Calendar.DBusEventSource();
|
this._calendar = new Calendar.Calendar();
|
||||||
this._eventList = new Calendar.EventsList(this._eventSource);
|
|
||||||
} else {
|
|
||||||
this._eventSource = null;
|
|
||||||
this._eventList = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Calendar
|
|
||||||
this._calendar = new Calendar.Calendar(this._eventSource);
|
|
||||||
|
|
||||||
this._calendar.connect('selected-date-changed',
|
this._calendar.connect('selected-date-changed',
|
||||||
Lang.bind(this, function(calendar, date) {
|
Lang.bind(this, function(calendar, date) {
|
||||||
@ -102,31 +89,34 @@ DateMenuButton.prototype = {
|
|||||||
separator.setColumnWidths(1);
|
separator.setColumnWidths(1);
|
||||||
vbox.add(separator.actor, {y_align: St.Align.END, expand: true, y_fill: false});
|
vbox.add(separator.actor, {y_align: St.Align.END, expand: true, y_fill: false});
|
||||||
|
|
||||||
|
item.actor.show_on_set_parent = false;
|
||||||
item.actor.can_focus = false;
|
item.actor.can_focus = false;
|
||||||
item.actor.reparent(vbox);
|
item.actor.reparent(vbox);
|
||||||
|
this._dateAndTimeSeparator = separator;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.showEvents) {
|
this._separator = new St.DrawingArea({ style_class: 'calendar-vertical-separator',
|
||||||
// Add vertical separator
|
pseudo_class: 'highlighted' });
|
||||||
|
this._separator.connect('repaint', Lang.bind(this, _onVertSepRepaint));
|
||||||
|
hbox.add(this._separator);
|
||||||
|
|
||||||
item = new St.DrawingArea({ style_class: 'calendar-vertical-separator',
|
// Fill up the second column
|
||||||
pseudo_class: 'highlighted' });
|
vbox = new St.BoxLayout({ name: 'calendarEventsArea',
|
||||||
item.connect('repaint', Lang.bind(this, _onVertSepRepaint));
|
vertical: true });
|
||||||
hbox.add(item);
|
hbox.add(vbox, { expand: true });
|
||||||
|
|
||||||
// Fill up the second column
|
// Event list
|
||||||
vbox = new St.BoxLayout({name: 'calendarEventsArea',
|
vbox.add(this._eventList.actor, { expand: true });
|
||||||
vertical: true});
|
|
||||||
hbox.add(vbox, { expand: true });
|
|
||||||
|
|
||||||
// Event list
|
this._openCalendarItem = new PopupMenu.PopupMenuItem(_("Open Calendar"));
|
||||||
vbox.add(this._eventList.actor, { expand: true });
|
this._openCalendarItem.connect('activate', Lang.bind(this, this._onOpenCalendarActivate));
|
||||||
|
this._openCalendarItem.actor.can_focus = false;
|
||||||
|
vbox.add(this._openCalendarItem.actor, {y_align: St.Align.END, expand: true, y_fill: false});
|
||||||
|
|
||||||
item = new PopupMenu.PopupMenuItem(_("Open Calendar"));
|
this._calendarSettings = new Gio.Settings({ schema: 'org.gnome.desktop.default-applications.office.calendar' });
|
||||||
item.connect('activate', Lang.bind(this, this._onOpenCalendarActivate));
|
this._calendarSettings.connect('changed::exec',
|
||||||
item.actor.can_focus = false;
|
Lang.bind(this, this._calendarSettingsChanged));
|
||||||
vbox.add(item.actor, {y_align: St.Align.END, expand: true, y_fill: false});
|
this._calendarSettingsChanged();
|
||||||
}
|
|
||||||
|
|
||||||
// Whenever the menu is opened, select today
|
// Whenever the menu is opened, select today
|
||||||
this.menu.connect('open-state-changed', Lang.bind(this, function(menu, isOpen) {
|
this.menu.connect('open-state-changed', Lang.bind(this, function(menu, isOpen) {
|
||||||
@ -153,79 +143,75 @@ DateMenuButton.prototype = {
|
|||||||
|
|
||||||
// Done with hbox for calendar and event list
|
// Done with hbox for calendar and event list
|
||||||
|
|
||||||
// Track changes to clock settings
|
this._clock = new GnomeDesktop.WallClock();
|
||||||
this._desktopSettings = new Gio.Settings({ schema: 'org.gnome.desktop.interface' });
|
this._clock.connect('notify::clock', Lang.bind(this, this._updateClockAndDate));
|
||||||
this._clockSettings = new Gio.Settings({ schema: 'org.gnome.shell.clock' });
|
|
||||||
this._desktopSettings.connect('changed', Lang.bind(this, this._updateClockAndDate));
|
|
||||||
this._clockSettings.connect('changed', Lang.bind(this, this._updateClockAndDate));
|
|
||||||
|
|
||||||
// https://bugzilla.gnome.org/show_bug.cgi?id=655129
|
|
||||||
this._upClient = new UPowerGlib.Client();
|
|
||||||
this._upClient.connect('notify-resume', Lang.bind(this, this._updateClockAndDate));
|
|
||||||
|
|
||||||
// Start the clock
|
|
||||||
this._updateClockAndDate();
|
this._updateClockAndDate();
|
||||||
|
|
||||||
|
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
|
||||||
|
this._sessionUpdated();
|
||||||
|
},
|
||||||
|
|
||||||
|
_calendarSettingsChanged: function() {
|
||||||
|
let exec = this._calendarSettings.get_string('exec');
|
||||||
|
let fullExec = GLib.find_program_in_path(exec);
|
||||||
|
this._openCalendarItem.actor.visible = fullExec != null;
|
||||||
|
},
|
||||||
|
|
||||||
|
_setEventsVisibility: function(visible) {
|
||||||
|
this._openCalendarItem.actor.visible = visible;
|
||||||
|
this._separator.visible = visible;
|
||||||
|
if (visible) {
|
||||||
|
let alignment = 0.25;
|
||||||
|
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)
|
||||||
|
alignment = 1.0 - alignment;
|
||||||
|
this.menu._arrowAlignment = alignment;
|
||||||
|
this._eventList.actor.get_parent().show();
|
||||||
|
} else {
|
||||||
|
this.menu._arrowAlignment = 0.5;
|
||||||
|
this._eventList.actor.get_parent().hide();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_setEventSource: function(eventSource) {
|
||||||
|
this._calendar.setEventSource(eventSource);
|
||||||
|
this._eventList.setEventSource(eventSource);
|
||||||
|
},
|
||||||
|
|
||||||
|
_sessionUpdated: function() {
|
||||||
|
let eventSource;
|
||||||
|
let showEvents = Main.sessionMode.showCalendarEvents;
|
||||||
|
if (showEvents) {
|
||||||
|
eventSource = new Calendar.DBusEventSource();
|
||||||
|
} else {
|
||||||
|
eventSource = null;
|
||||||
|
}
|
||||||
|
this._setEventSource(eventSource);
|
||||||
|
this._setEventsVisibility(showEvents);
|
||||||
|
|
||||||
|
// This needs to be handled manually, as the code to
|
||||||
|
// autohide separators doesn't work across the vbox
|
||||||
|
this._dateAndTimeSeparator.actor.visible = Main.sessionMode.allowSettings;
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateClockAndDate: function() {
|
_updateClockAndDate: function() {
|
||||||
let format = this._desktopSettings.get_string(CLOCK_FORMAT_KEY);
|
this._clockDisplay.set_text(this._clock.clock);
|
||||||
let showDate = this._clockSettings.get_boolean(CLOCK_SHOW_DATE_KEY);
|
|
||||||
let showSeconds = this._clockSettings.get_boolean(CLOCK_SHOW_SECONDS_KEY);
|
|
||||||
|
|
||||||
let clockFormat;
|
|
||||||
let dateFormat;
|
|
||||||
|
|
||||||
switch (format) {
|
|
||||||
case '24h':
|
|
||||||
if (showDate)
|
|
||||||
/* Translators: This is the time format with date used
|
|
||||||
in 24-hour mode. */
|
|
||||||
clockFormat = showSeconds ? _("%a %b %e, %R:%S")
|
|
||||||
: _("%a %b %e, %R");
|
|
||||||
else
|
|
||||||
/* Translators: This is the time format without date used
|
|
||||||
in 24-hour mode. */
|
|
||||||
clockFormat = showSeconds ? _("%a %R:%S")
|
|
||||||
: _("%a %R");
|
|
||||||
break;
|
|
||||||
case '12h':
|
|
||||||
default:
|
|
||||||
if (showDate)
|
|
||||||
/* Translators: This is a time format with date used
|
|
||||||
for AM/PM. */
|
|
||||||
clockFormat = showSeconds ? _("%a %b %e, %l:%M:%S %p")
|
|
||||||
: _("%a %b %e, %l:%M %p");
|
|
||||||
else
|
|
||||||
/* Translators: This is a time format without date used
|
|
||||||
for AM/PM. */
|
|
||||||
clockFormat = showSeconds ? _("%a %l:%M:%S %p")
|
|
||||||
: _("%a %l:%M %p");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
let displayDate = new Date();
|
|
||||||
|
|
||||||
this._clock.set_text(displayDate.toLocaleFormat(clockFormat));
|
|
||||||
|
|
||||||
/* Translators: This is the date format to use when the calendar popup is
|
/* Translators: This is the date format to use when the calendar popup is
|
||||||
* shown - it is shown just below the time in the shell (e.g. "Tue 9:29 AM").
|
* shown - it is shown just below the time in the shell (e.g. "Tue 9:29 AM").
|
||||||
*/
|
*/
|
||||||
dateFormat = _("%A %B %e, %Y");
|
let dateFormat = _("%A %B %e, %Y");
|
||||||
|
let displayDate = new Date();
|
||||||
this._date.set_text(displayDate.toLocaleFormat(dateFormat));
|
this._date.set_text(displayDate.toLocaleFormat(dateFormat));
|
||||||
|
|
||||||
Mainloop.timeout_add_seconds(1, Lang.bind(this, this._updateClockAndDate));
|
|
||||||
return false;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_onOpenCalendarActivate: function() {
|
_onOpenCalendarActivate: function() {
|
||||||
this.menu.close();
|
this.menu.close();
|
||||||
let calendarSettings = new Gio.Settings({ schema: 'org.gnome.desktop.default-applications.office.calendar' });
|
let tool = this._calendarSettings.get_string('exec');
|
||||||
let tool = calendarSettings.get_string('exec');
|
if (tool.length == 0 || tool.substr(0, 9) == 'evolution') {
|
||||||
if (tool.length == 0 || tool == 'evolution') {
|
|
||||||
// TODO: pass the selected day
|
// TODO: pass the selected day
|
||||||
Util.spawn(['evolution', '-c', 'calendar']);
|
let app = Shell.AppSystem.get_default().lookup_app('evolution-calendar.desktop');
|
||||||
|
app.activate();
|
||||||
} else {
|
} else {
|
||||||
let needTerm = calendarSettings.get_boolean('needs-term');
|
let needTerm = this._calendarSettings.get_boolean('needs-term');
|
||||||
if (needTerm) {
|
if (needTerm) {
|
||||||
let terminalSettings = new Gio.Settings({ schema: 'org.gnome.desktop.default-applications.terminal' });
|
let terminalSettings = new Gio.Settings({ schema: 'org.gnome.desktop.default-applications.terminal' });
|
||||||
let term = terminalSettings.get_string('exec');
|
let term = terminalSettings.get_string('exec');
|
||||||
@ -239,4 +225,4 @@ DateMenuButton.prototype = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
51
js/ui/dnd.js
@ -1,4 +1,4 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const Clutter = imports.gi.Clutter;
|
const Clutter = imports.gi.Clutter;
|
||||||
const Gtk = imports.gi.Gtk;
|
const Gtk = imports.gi.Gtk;
|
||||||
@ -69,11 +69,9 @@ function removeDragMonitor(monitor) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function _Draggable(actor, params) {
|
const _Draggable = new Lang.Class({
|
||||||
this._init(actor, params);
|
Name: 'Draggable',
|
||||||
}
|
|
||||||
|
|
||||||
_Draggable.prototype = {
|
|
||||||
_init : function(actor, params) {
|
_init : function(actor, params) {
|
||||||
params = Params.parse(params, { manualMode: false,
|
params = Params.parse(params, { manualMode: false,
|
||||||
restoreOnSuccess: false,
|
restoreOnSuccess: false,
|
||||||
@ -105,8 +103,8 @@ _Draggable.prototype = {
|
|||||||
this._dragInProgress = false; // The drag has been started, and has not been dropped or cancelled yet.
|
this._dragInProgress = false; // The drag has been started, and has not been dropped or cancelled yet.
|
||||||
this._animationInProgress = false; // The drag is over and the item is in the process of animating to its original position (snapping back or reverting).
|
this._animationInProgress = false; // The drag is over and the item is in the process of animating to its original position (snapping back or reverting).
|
||||||
|
|
||||||
// During the drag, we eat enter/leave events so that actors don't prelight or show
|
// During the drag, we eat enter/leave events so that actors don't prelight.
|
||||||
// tooltips. But we remember the actors that we first left/last entered so we can
|
// But we remember the actors that we first left/last entered so we can
|
||||||
// fix up the hover state after the drag ends.
|
// fix up the hover state after the drag ends.
|
||||||
this._firstLeaveActor = null;
|
this._firstLeaveActor = null;
|
||||||
this._lastEnterActor = null;
|
this._lastEnterActor = null;
|
||||||
@ -122,13 +120,7 @@ _Draggable.prototype = {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
this._buttonDown = true;
|
this._buttonDown = true;
|
||||||
// special case St.Button: grabbing the pointer would mess up the
|
this._grabActor();
|
||||||
// internal state, so we start the drag manually on hover change
|
|
||||||
if (this.actor instanceof St.Button)
|
|
||||||
this.actor.connect('notify::hover',
|
|
||||||
Lang.bind(this, this._onButtonHoverChanged));
|
|
||||||
else
|
|
||||||
this._grabActor();
|
|
||||||
|
|
||||||
let [stageX, stageY] = event.get_coords();
|
let [stageX, stageY] = event.get_coords();
|
||||||
this._dragStartX = stageX;
|
this._dragStartX = stageX;
|
||||||
@ -137,15 +129,6 @@ _Draggable.prototype = {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
_onButtonHoverChanged: function(button) {
|
|
||||||
if (button.hover || !button.pressed)
|
|
||||||
return;
|
|
||||||
|
|
||||||
button.fake_release();
|
|
||||||
this.startDrag(this._dragStartX, this._dragStartY,
|
|
||||||
global.get_current_time());
|
|
||||||
},
|
|
||||||
|
|
||||||
_grabActor: function() {
|
_grabActor: function() {
|
||||||
Clutter.grab_pointer(this.actor);
|
Clutter.grab_pointer(this.actor);
|
||||||
this._onEventId = this.actor.connect('event',
|
this._onEventId = this.actor.connect('event',
|
||||||
@ -234,6 +217,13 @@ _Draggable.prototype = {
|
|||||||
currentDraggable = this;
|
currentDraggable = this;
|
||||||
this._dragInProgress = true;
|
this._dragInProgress = true;
|
||||||
|
|
||||||
|
// Special-case St.Button: the pointer grab messes with the internal
|
||||||
|
// state, so force a reset to a reasonable state here
|
||||||
|
if (this.actor instanceof St.Button) {
|
||||||
|
this.actor.fake_release();
|
||||||
|
this.actor.hover = false;
|
||||||
|
}
|
||||||
|
|
||||||
this.emit('drag-begin', time);
|
this.emit('drag-begin', time);
|
||||||
if (this._onEventId)
|
if (this._onEventId)
|
||||||
this._ungrabActor();
|
this._ungrabActor();
|
||||||
@ -245,6 +235,10 @@ _Draggable.prototype = {
|
|||||||
|
|
||||||
if (this.actor._delegate && this.actor._delegate.getDragActor) {
|
if (this.actor._delegate && this.actor._delegate.getDragActor) {
|
||||||
this._dragActor = this.actor._delegate.getDragActor(this._dragStartX, this._dragStartY);
|
this._dragActor = this.actor._delegate.getDragActor(this._dragStartX, this._dragStartY);
|
||||||
|
this._dragActor.reparent(Main.uiGroup);
|
||||||
|
this._dragActor.raise_top();
|
||||||
|
Shell.util_set_hidden_from_pick(this._dragActor, true);
|
||||||
|
|
||||||
// Drag actor does not always have to be the same as actor. For example drag actor
|
// Drag actor does not always have to be the same as actor. For example drag actor
|
||||||
// can be an image that's part of the actor. So to perform "snap back" correctly we need
|
// can be an image that's part of the actor. So to perform "snap back" correctly we need
|
||||||
// to know what was the drag actor source.
|
// to know what was the drag actor source.
|
||||||
@ -273,12 +267,17 @@ _Draggable.prototype = {
|
|||||||
this._dragOffsetY = this._dragActor.y - this._dragStartY;
|
this._dragOffsetY = this._dragActor.y - this._dragStartY;
|
||||||
} else {
|
} else {
|
||||||
this._dragActor = this.actor;
|
this._dragActor = this.actor;
|
||||||
|
|
||||||
this._dragActorSource = undefined;
|
this._dragActorSource = undefined;
|
||||||
this._dragOrigParent = this.actor.get_parent();
|
this._dragOrigParent = this.actor.get_parent();
|
||||||
this._dragOrigX = this._dragActor.x;
|
this._dragOrigX = this._dragActor.x;
|
||||||
this._dragOrigY = this._dragActor.y;
|
this._dragOrigY = this._dragActor.y;
|
||||||
this._dragOrigScale = this._dragActor.scale_x;
|
this._dragOrigScale = this._dragActor.scale_x;
|
||||||
|
|
||||||
|
this._dragActor.reparent(Main.uiGroup);
|
||||||
|
this._dragActor.raise_top();
|
||||||
|
Shell.util_set_hidden_from_pick(this._dragActor, true);
|
||||||
|
|
||||||
let [actorStageX, actorStageY] = this.actor.get_transformed_position();
|
let [actorStageX, actorStageY] = this.actor.get_transformed_position();
|
||||||
this._dragOffsetX = actorStageX - this._dragStartX;
|
this._dragOffsetX = actorStageX - this._dragStartX;
|
||||||
this._dragOffsetY = actorStageY - this._dragStartY;
|
this._dragOffsetY = actorStageY - this._dragStartY;
|
||||||
@ -290,10 +289,6 @@ _Draggable.prototype = {
|
|||||||
scaledHeight / this.actor.height);
|
scaledHeight / this.actor.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._dragActor.reparent(Main.uiGroup);
|
|
||||||
this._dragActor.raise_top();
|
|
||||||
Shell.util_set_hidden_from_pick(this._dragActor, true);
|
|
||||||
|
|
||||||
this._dragOrigOpacity = this._dragActor.opacity;
|
this._dragOrigOpacity = this._dragActor.opacity;
|
||||||
if (this._dragActorOpacity != undefined)
|
if (this._dragActorOpacity != undefined)
|
||||||
this._dragActor.opacity = this._dragActorOpacity;
|
this._dragActor.opacity = this._dragActorOpacity;
|
||||||
@ -596,7 +591,7 @@ _Draggable.prototype = {
|
|||||||
this._dragActor = undefined;
|
this._dragActor = undefined;
|
||||||
currentDraggable = null;
|
currentDraggable = null;
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
Signals.addSignalMethods(_Draggable.prototype);
|
Signals.addSignalMethods(_Draggable.prototype);
|
||||||
|
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
|
||||||
|
|
||||||
const DocInfo = imports.misc.docInfo;
|
|
||||||
const Params = imports.misc.params;
|
|
||||||
const Search = imports.ui.search;
|
|
||||||
|
|
||||||
|
|
||||||
function DocSearchProvider() {
|
|
||||||
this._init();
|
|
||||||
}
|
|
||||||
|
|
||||||
DocSearchProvider.prototype = {
|
|
||||||
__proto__: Search.SearchProvider.prototype,
|
|
||||||
|
|
||||||
_init: function(name) {
|
|
||||||
Search.SearchProvider.prototype._init.call(this, _("RECENT ITEMS"));
|
|
||||||
this._docManager = DocInfo.getDocManager();
|
|
||||||
},
|
|
||||||
|
|
||||||
getResultMeta: function(resultId) {
|
|
||||||
let docInfo = this._docManager.lookupByUri(resultId);
|
|
||||||
if (!docInfo)
|
|
||||||
return null;
|
|
||||||
return { 'id': resultId,
|
|
||||||
'name': docInfo.name,
|
|
||||||
'createIcon': function(size) {
|
|
||||||
return docInfo.createIcon(size);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
activateResult: function(id, params) {
|
|
||||||
params = Params.parse(params, { workspace: -1,
|
|
||||||
timestamp: 0 });
|
|
||||||
|
|
||||||
let docInfo = this._docManager.lookupByUri(id);
|
|
||||||
docInfo.launch(params.workspace);
|
|
||||||
},
|
|
||||||
|
|
||||||
getInitialResultSet: function(terms) {
|
|
||||||
return this._docManager.initialSearch(terms);
|
|
||||||
},
|
|
||||||
|
|
||||||
getSubsearchResultSet: function(previousResults, terms) {
|
|
||||||
return this._docManager.subsearch(previousResults, terms);
|
|
||||||
}
|
|
||||||
};
|
|
@ -1,5 +1,5 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
*
|
/*
|
||||||
* Copyright 2010 Red Hat, Inc
|
* Copyright 2010 Red Hat, Inc
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -18,23 +18,23 @@
|
|||||||
* 02111-1307, USA.
|
* 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const DBus = imports.dbus;
|
|
||||||
const Lang = imports.lang;
|
const Lang = imports.lang;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const AccountsService = imports.gi.AccountsService;
|
const AccountsService = imports.gi.AccountsService;
|
||||||
const Clutter = imports.gi.Clutter;
|
const Clutter = imports.gi.Clutter;
|
||||||
|
const Gio = imports.gi.Gio;
|
||||||
const GLib = imports.gi.GLib;
|
const GLib = imports.gi.GLib;
|
||||||
const Gtk = imports.gi.Gtk;
|
const Gtk = imports.gi.Gtk;
|
||||||
const Pango = imports.gi.Pango;
|
const Pango = imports.gi.Pango;
|
||||||
const St = imports.gi.St;
|
const St = imports.gi.St;
|
||||||
const Shell = imports.gi.Shell;
|
const Shell = imports.gi.Shell;
|
||||||
|
|
||||||
const GnomeSession = imports.misc.gnomeSession
|
const GnomeSession = imports.misc.gnomeSession;
|
||||||
const Lightbox = imports.ui.lightbox;
|
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
const ModalDialog = imports.ui.modalDialog;
|
const ModalDialog = imports.ui.modalDialog;
|
||||||
const Tweener = imports.ui.tweener;
|
const Tweener = imports.ui.tweener;
|
||||||
|
const UserMenu = imports.ui.userMenu;
|
||||||
|
|
||||||
let _endSessionDialog = null;
|
let _endSessionDialog = null;
|
||||||
|
|
||||||
@ -43,22 +43,23 @@ const _DIALOG_ICON_SIZE = 32;
|
|||||||
|
|
||||||
const GSM_SESSION_MANAGER_LOGOUT_FORCE = 2;
|
const GSM_SESSION_MANAGER_LOGOUT_FORCE = 2;
|
||||||
|
|
||||||
const EndSessionDialogIface = {
|
const EndSessionDialogIface = <interface name="org.gnome.SessionManager.EndSessionDialog">
|
||||||
name: 'org.gnome.SessionManager.EndSessionDialog',
|
<method name="Open">
|
||||||
methods: [{ name: 'Open',
|
<arg type="u" direction="in" />
|
||||||
inSignature: 'uuuao',
|
<arg type="u" direction="in" />
|
||||||
outSignature: ''
|
<arg type="u" direction="in" />
|
||||||
}
|
<arg type="ao" direction="in" />
|
||||||
],
|
</method>
|
||||||
signals: [{ name: 'Canceled',
|
<signal name="ConfirmedLogout" />
|
||||||
inSignature: '',
|
<signal name="ConfirmedReboot" />
|
||||||
}],
|
<signal name="ConfirmedShutdown" />
|
||||||
properties: []
|
<signal name="Canceled" />
|
||||||
};
|
<signal name="Closed" />
|
||||||
|
</interface>;
|
||||||
|
|
||||||
const logoutDialogContent = {
|
const logoutDialogContent = {
|
||||||
subjectWithUser: _("Log Out %s"),
|
subjectWithUser: C_("title", "Log Out %s"),
|
||||||
subject: _("Log Out"),
|
subject: C_("title", "Log Out"),
|
||||||
inhibitedDescription: _("Click Log Out to quit these applications and log out of the system."),
|
inhibitedDescription: _("Click Log Out to quit these applications and log out of the system."),
|
||||||
uninhibitedDescriptionWithUser: function(user, seconds) {
|
uninhibitedDescriptionWithUser: function(user, seconds) {
|
||||||
return ngettext("%s will be logged out automatically in %d second.",
|
return ngettext("%s will be logged out automatically in %d second.",
|
||||||
@ -72,12 +73,12 @@ const logoutDialogContent = {
|
|||||||
},
|
},
|
||||||
endDescription: _("Logging out of the system."),
|
endDescription: _("Logging out of the system."),
|
||||||
confirmButtons: [{ signal: 'ConfirmedLogout',
|
confirmButtons: [{ signal: 'ConfirmedLogout',
|
||||||
label: _("Log Out") }],
|
label: C_("button", "Log Out") }],
|
||||||
iconStyleClass: 'end-session-dialog-logout-icon'
|
iconStyleClass: 'end-session-dialog-logout-icon'
|
||||||
};
|
};
|
||||||
|
|
||||||
const shutdownDialogContent = {
|
const shutdownDialogContent = {
|
||||||
subject: _("Power Off"),
|
subject: C_("title", "Power Off"),
|
||||||
inhibitedDescription: _("Click Power Off to quit these applications and power off the system."),
|
inhibitedDescription: _("Click Power Off to quit these applications and power off the system."),
|
||||||
uninhibitedDescription: function(seconds) {
|
uninhibitedDescription: function(seconds) {
|
||||||
return ngettext("The system will power off automatically in %d second.",
|
return ngettext("The system will power off automatically in %d second.",
|
||||||
@ -86,15 +87,15 @@ const shutdownDialogContent = {
|
|||||||
},
|
},
|
||||||
endDescription: _("Powering off the system."),
|
endDescription: _("Powering off the system."),
|
||||||
confirmButtons: [{ signal: 'ConfirmedReboot',
|
confirmButtons: [{ signal: 'ConfirmedReboot',
|
||||||
label: _("Restart") },
|
label: C_("button", "Restart") },
|
||||||
{ signal: 'ConfirmedShutdown',
|
{ signal: 'ConfirmedShutdown',
|
||||||
label: _("Power Off") }],
|
label: C_("button", "Power Off") }],
|
||||||
iconName: 'system-shutdown',
|
iconName: 'system-shutdown-symbolic',
|
||||||
iconStyleClass: 'end-session-dialog-shutdown-icon'
|
iconStyleClass: 'end-session-dialog-shutdown-icon'
|
||||||
};
|
};
|
||||||
|
|
||||||
const restartDialogContent = {
|
const restartDialogContent = {
|
||||||
subject: _("Restart"),
|
subject: C_("title", "Restart"),
|
||||||
inhibitedDescription: _("Click Restart to quit these applications and restart the system."),
|
inhibitedDescription: _("Click Restart to quit these applications and restart the system."),
|
||||||
uninhibitedDescription: function(seconds) {
|
uninhibitedDescription: function(seconds) {
|
||||||
return ngettext("The system will restart automatically in %d second.",
|
return ngettext("The system will restart automatically in %d second.",
|
||||||
@ -103,8 +104,8 @@ const restartDialogContent = {
|
|||||||
},
|
},
|
||||||
endDescription: _("Restarting the system."),
|
endDescription: _("Restarting the system."),
|
||||||
confirmButtons: [{ signal: 'ConfirmedReboot',
|
confirmButtons: [{ signal: 'ConfirmedReboot',
|
||||||
label: _("Restart") }],
|
label: C_("button", "Restart") }],
|
||||||
iconName: 'system-shutdown',
|
iconName: 'view-refresh-symbolic',
|
||||||
iconStyleClass: 'end-session-dialog-shutdown-icon'
|
iconStyleClass: 'end-session-dialog-shutdown-icon'
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -115,37 +116,17 @@ const DialogContent = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function findAppFromInhibitor(inhibitor) {
|
function findAppFromInhibitor(inhibitor) {
|
||||||
let desktopFile = inhibitor.app_id;
|
let [desktopFile] = inhibitor.GetAppIdSync();
|
||||||
|
|
||||||
if (!GLib.str_has_suffix(desktopFile, '.desktop'))
|
if (!GLib.str_has_suffix(desktopFile, '.desktop'))
|
||||||
desktopFile += '.desktop';
|
desktopFile += '.desktop';
|
||||||
|
|
||||||
let candidateDesktopFiles = [];
|
return Shell.AppSystem.get_default().lookup_heuristic_basename(desktopFile);
|
||||||
|
|
||||||
candidateDesktopFiles.push(desktopFile);
|
|
||||||
candidateDesktopFiles.push('gnome-' + desktopFile);
|
|
||||||
|
|
||||||
let appSystem = Shell.AppSystem.get_default();
|
|
||||||
let app = null;
|
|
||||||
for (let i = 0; i < candidateDesktopFiles.length; i++) {
|
|
||||||
try {
|
|
||||||
app = appSystem.lookup_app(candidateDesktopFiles[i]);
|
|
||||||
|
|
||||||
if (app)
|
|
||||||
break;
|
|
||||||
} catch(e) {
|
|
||||||
// ignore errors
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return app;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ListItem(app, reason) {
|
const ListItem = new Lang.Class({
|
||||||
this._init(app, reason);
|
Name: 'ListItem',
|
||||||
}
|
|
||||||
|
|
||||||
ListItem.prototype = {
|
|
||||||
_init: function(app, reason) {
|
_init: function(app, reason) {
|
||||||
this._app = app;
|
this._app = app;
|
||||||
this._reason = reason;
|
this._reason = reason;
|
||||||
@ -180,6 +161,7 @@ ListItem.prototype = {
|
|||||||
|
|
||||||
this._descriptionLabel = new St.Label({ text: this._reason,
|
this._descriptionLabel = new St.Label({ text: this._reason,
|
||||||
style_class: 'end-session-dialog-app-list-item-description' });
|
style_class: 'end-session-dialog-app-list-item-description' });
|
||||||
|
this.actor.label_actor = this._nameLabel;
|
||||||
textLayout.add(this._descriptionLabel,
|
textLayout.add(this._descriptionLabel,
|
||||||
{ expand: true,
|
{ expand: true,
|
||||||
x_fill: true });
|
x_fill: true });
|
||||||
@ -191,7 +173,7 @@ ListItem.prototype = {
|
|||||||
this.emit('activate');
|
this.emit('activate');
|
||||||
this._app.activate();
|
this._app.activate();
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
Signals.addSignalMethods(ListItem.prototype);
|
Signals.addSignalMethods(ListItem.prototype);
|
||||||
|
|
||||||
// The logout timer only shows updates every 10 seconds
|
// The logout timer only shows updates every 10 seconds
|
||||||
@ -229,29 +211,19 @@ function _setLabelText(label, text) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function EndSessionDialog() {
|
|
||||||
if (_endSessionDialog == null) {
|
|
||||||
this._init();
|
|
||||||
DBus.session.exportObject('/org/gnome/SessionManager/EndSessionDialog',
|
|
||||||
this);
|
|
||||||
_endSessionDialog = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
return _endSessionDialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
// This always returns the same singleton object
|
// This always returns the same singleton object
|
||||||
// By instantiating it initially, we register the
|
// By instantiating it initially, we register the
|
||||||
// bus object, etc.
|
// bus object, etc.
|
||||||
let dialog = new EndSessionDialog();
|
_endSessionDialog = new EndSessionDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
EndSessionDialog.prototype = {
|
const EndSessionDialog = new Lang.Class({
|
||||||
__proto__: ModalDialog.ModalDialog.prototype,
|
Name: 'EndSessionDialog',
|
||||||
|
Extends: ModalDialog.ModalDialog,
|
||||||
|
|
||||||
_init: function() {
|
_init: function() {
|
||||||
ModalDialog.ModalDialog.prototype._init.call(this, { styleClass: 'end-session-dialog' });
|
this.parent({ styleClass: 'end-session-dialog' });
|
||||||
|
|
||||||
this._user = AccountsService.UserManager.get_default().get_user(GLib.get_user_name());
|
this._user = AccountsService.UserManager.get_default().get_user(GLib.get_user_name());
|
||||||
|
|
||||||
@ -309,23 +281,22 @@ EndSessionDialog.prototype = {
|
|||||||
scrollView.hide();
|
scrollView.hide();
|
||||||
|
|
||||||
this._applicationList = new St.BoxLayout({ vertical: true });
|
this._applicationList = new St.BoxLayout({ vertical: true });
|
||||||
scrollView.add_actor(this._applicationList,
|
scrollView.add_actor(this._applicationList);
|
||||||
{ x_fill: true,
|
|
||||||
y_fill: true,
|
|
||||||
x_align: St.Align.START,
|
|
||||||
y_align: St.Align.MIDDLE });
|
|
||||||
|
|
||||||
this._applicationList.connect('actor-added',
|
this._applicationList.connect('actor-added',
|
||||||
Lang.bind(this, function() {
|
Lang.bind(this, function() {
|
||||||
if (this._applicationList.get_children().length == 1)
|
if (this._applicationList.get_n_children() == 1)
|
||||||
scrollView.show();
|
scrollView.show();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this._applicationList.connect('actor-removed',
|
this._applicationList.connect('actor-removed',
|
||||||
Lang.bind(this, function() {
|
Lang.bind(this, function() {
|
||||||
if (this._applicationList.get_children().length == 0)
|
if (this._applicationList.get_n_children() == 0)
|
||||||
scrollView.hide();
|
scrollView.hide();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(EndSessionDialogIface, this);
|
||||||
|
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/SessionManager/EndSessionDialog');
|
||||||
},
|
},
|
||||||
|
|
||||||
_onDestroy: function() {
|
_onDestroy: function() {
|
||||||
@ -333,41 +304,7 @@ EndSessionDialog.prototype = {
|
|||||||
this._user.disconnect(this._userChangedId);
|
this._user.disconnect(this._userChangedId);
|
||||||
},
|
},
|
||||||
|
|
||||||
_setIconFromFile: function(iconFile, styleClass) {
|
_updateDescription: function() {
|
||||||
if (styleClass)
|
|
||||||
this._iconBin.set_style_class_name(styleClass);
|
|
||||||
this._iconBin.set_style(null);
|
|
||||||
|
|
||||||
this._iconBin.child = null;
|
|
||||||
if (iconFile) {
|
|
||||||
this._iconBin.show();
|
|
||||||
this._iconBin.set_style('background-image: url("' + iconFile + '");');
|
|
||||||
} else {
|
|
||||||
this._iconBin.hide();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_setIconFromName: function(iconName, styleClass) {
|
|
||||||
if (styleClass)
|
|
||||||
this._iconBin.set_style_class_name(styleClass);
|
|
||||||
this._iconBin.set_style(null);
|
|
||||||
|
|
||||||
if (iconName != null) {
|
|
||||||
let textureCache = St.TextureCache.get_default();
|
|
||||||
let icon = textureCache.load_icon_name(this._iconBin.get_theme_node(),
|
|
||||||
iconName,
|
|
||||||
St.IconType.SYMBOLIC,
|
|
||||||
_DIALOG_ICON_SIZE);
|
|
||||||
|
|
||||||
this._iconBin.child = icon;
|
|
||||||
this._iconBin.show();
|
|
||||||
} else {
|
|
||||||
this._iconBin.child = null;
|
|
||||||
this._iconBin.hide();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_updateContent: function() {
|
|
||||||
if (this.state != ModalDialog.State.OPENING &&
|
if (this.state != ModalDialog.State.OPENING &&
|
||||||
this.state != ModalDialog.State.OPENED)
|
this.state != ModalDialog.State.OPENED)
|
||||||
return;
|
return;
|
||||||
@ -377,17 +314,6 @@ EndSessionDialog.prototype = {
|
|||||||
let subject = dialogContent.subject;
|
let subject = dialogContent.subject;
|
||||||
let description;
|
let description;
|
||||||
|
|
||||||
if (this._user.is_loaded && !dialogContent.iconName) {
|
|
||||||
let iconFile = this._user.get_icon_file();
|
|
||||||
if (GLib.file_test(iconFile, GLib.FileTest.EXISTS))
|
|
||||||
this._setIconFromFile(iconFile, dialogContent.iconStyleClass);
|
|
||||||
else
|
|
||||||
this._setIconFromName('avatar-default', dialogContent.iconStyleClass);
|
|
||||||
} else if (dialogContent.iconName) {
|
|
||||||
this._setIconFromName(dialogContent.iconName,
|
|
||||||
dialogContent.iconStyleClass);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this._inhibitors.length > 0) {
|
if (this._inhibitors.length > 0) {
|
||||||
this._stopTimer();
|
this._stopTimer();
|
||||||
description = dialogContent.inhibitedDescription;
|
description = dialogContent.inhibitedDescription;
|
||||||
@ -420,6 +346,27 @@ EndSessionDialog.prototype = {
|
|||||||
_setLabelText(this._descriptionLabel, description);
|
_setLabelText(this._descriptionLabel, description);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_updateContent: function() {
|
||||||
|
if (this.state != ModalDialog.State.OPENING &&
|
||||||
|
this.state != ModalDialog.State.OPENED)
|
||||||
|
return;
|
||||||
|
|
||||||
|
let dialogContent = DialogContent[this._type];
|
||||||
|
if (dialogContent.iconName) {
|
||||||
|
this._iconBin.child = new St.Icon({ icon_name: dialogContent.iconName,
|
||||||
|
icon_size: _DIALOG_ICON_SIZE,
|
||||||
|
style_class: dialogContent.iconStyleClass });
|
||||||
|
} else {
|
||||||
|
let avatarWidget = new UserMenu.UserAvatarWidget(this._user,
|
||||||
|
{ iconSize: _DIALOG_ICON_SIZE,
|
||||||
|
styleClass: dialogContent.iconStyleClass });
|
||||||
|
this._iconBin.child = avatarWidget.actor;
|
||||||
|
avatarWidget.update();
|
||||||
|
}
|
||||||
|
|
||||||
|
this._updateDescription();
|
||||||
|
},
|
||||||
|
|
||||||
_updateButtons: function() {
|
_updateButtons: function() {
|
||||||
let dialogContent = DialogContent[this._type];
|
let dialogContent = DialogContent[this._type];
|
||||||
let buttons = [{ action: Lang.bind(this, this.cancel),
|
let buttons = [{ action: Lang.bind(this, this.cancel),
|
||||||
@ -439,26 +386,20 @@ EndSessionDialog.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
close: function() {
|
close: function() {
|
||||||
ModalDialog.ModalDialog.prototype.close.call(this);
|
this.parent();
|
||||||
DBus.session.emit_signal('/org/gnome/SessionManager/EndSessionDialog',
|
this._dbusImpl.emit_signal('Closed', null);
|
||||||
'org.gnome.SessionManager.EndSessionDialog',
|
|
||||||
'Closed', '', []);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
cancel: function() {
|
cancel: function() {
|
||||||
this._stopTimer();
|
this._stopTimer();
|
||||||
DBus.session.emit_signal('/org/gnome/SessionManager/EndSessionDialog',
|
this._dbusImpl.emit_signal('Canceled', null);
|
||||||
'org.gnome.SessionManager.EndSessionDialog',
|
|
||||||
'Canceled', '', []);
|
|
||||||
this.close(global.get_current_time());
|
this.close(global.get_current_time());
|
||||||
},
|
},
|
||||||
|
|
||||||
_confirm: function(signal) {
|
_confirm: function(signal) {
|
||||||
this._fadeOutDialog();
|
this._fadeOutDialog();
|
||||||
this._stopTimer();
|
this._stopTimer();
|
||||||
DBus.session.emit_signal('/org/gnome/SessionManager/EndSessionDialog',
|
this._dbusImpl.emit_signal(signal, null);
|
||||||
'org.gnome.SessionManager.EndSessionDialog',
|
|
||||||
signal, '', []);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_onOpened: function() {
|
_onOpened: function() {
|
||||||
@ -472,7 +413,7 @@ EndSessionDialog.prototype = {
|
|||||||
{ _secondsLeft: 0,
|
{ _secondsLeft: 0,
|
||||||
time: this._secondsLeft,
|
time: this._secondsLeft,
|
||||||
transition: 'linear',
|
transition: 'linear',
|
||||||
onUpdate: Lang.bind(this, this._updateContent),
|
onUpdate: Lang.bind(this, this._updateDescription),
|
||||||
onComplete: Lang.bind(this, function() {
|
onComplete: Lang.bind(this, function() {
|
||||||
let dialogContent = DialogContent[this._type];
|
let dialogContent = DialogContent[this._type];
|
||||||
let button = dialogContent.confirmButtons[dialogContent.confirmButtons.length - 1];
|
let button = dialogContent.confirmButtons[dialogContent.confirmButtons.length - 1];
|
||||||
@ -495,7 +436,8 @@ EndSessionDialog.prototype = {
|
|||||||
let app = findAppFromInhibitor(inhibitor);
|
let app = findAppFromInhibitor(inhibitor);
|
||||||
|
|
||||||
if (app) {
|
if (app) {
|
||||||
let item = new ListItem(app, inhibitor.reason);
|
let [reason] = inhibitor.GetReasonSync();
|
||||||
|
let item = new ListItem(app, reason);
|
||||||
item.connect('activate',
|
item.connect('activate',
|
||||||
Lang.bind(this, function() {
|
Lang.bind(this, function() {
|
||||||
this.close(global.get_current_time());
|
this.close(global.get_current_time());
|
||||||
@ -510,39 +452,41 @@ EndSessionDialog.prototype = {
|
|||||||
this._updateContent();
|
this._updateContent();
|
||||||
},
|
},
|
||||||
|
|
||||||
OpenAsync: function(type, timestamp, totalSecondsToStayOpen, inhibitorObjectPaths, callback) {
|
OpenAsync: function(parameters, invocation) {
|
||||||
|
let [type, timestamp, totalSecondsToStayOpen, inhibitorObjectPaths] = parameters;
|
||||||
this._totalSecondsToStayOpen = totalSecondsToStayOpen;
|
this._totalSecondsToStayOpen = totalSecondsToStayOpen;
|
||||||
this._inhibitors = [];
|
this._inhibitors = [];
|
||||||
this._applicationList.destroy_children();
|
this._applicationList.destroy_all_children();
|
||||||
this._type = type;
|
this._type = type;
|
||||||
|
|
||||||
if (!(this._type in DialogContent))
|
if (!(this._type in DialogContent)) {
|
||||||
throw new DBus.DBusError('org.gnome.Shell.ModalDialog.TypeError',
|
invocation.return_dbus_error('org.gnome.Shell.ModalDialog.TypeError',
|
||||||
"Unknown dialog type requested");
|
"Unknown dialog type requested");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (let i = 0; i < inhibitorObjectPaths.length; i++) {
|
for (let i = 0; i < inhibitorObjectPaths.length; i++) {
|
||||||
let inhibitor = new GnomeSession.Inhibitor(inhibitorObjectPaths[i]);
|
let inhibitor = new GnomeSession.Inhibitor(inhibitorObjectPaths[i], Lang.bind(this, function(proxy, error) {
|
||||||
|
this._onInhibitorLoaded(proxy);
|
||||||
|
}));
|
||||||
|
|
||||||
inhibitor.connect('is-loaded',
|
|
||||||
Lang.bind(this, function() {
|
|
||||||
this._onInhibitorLoaded(inhibitor);
|
|
||||||
}));
|
|
||||||
this._inhibitors.push(inhibitor);
|
this._inhibitors.push(inhibitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._updateButtons();
|
this._updateButtons();
|
||||||
|
|
||||||
if (!this.open(timestamp))
|
if (!this.open(timestamp)) {
|
||||||
throw new DBus.DBusError('org.gnome.Shell.ModalDialog.GrabError',
|
invocation.return_dbus_error('org.gnome.Shell.ModalDialog.GrabError',
|
||||||
"Cannot grab pointer and keyboard");
|
"Cannot grab pointer and keyboard");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this._updateContent();
|
this._updateContent();
|
||||||
|
|
||||||
let signalId = this.connect('opened',
|
let signalId = this.connect('opened',
|
||||||
Lang.bind(this, function() {
|
Lang.bind(this, function() {
|
||||||
callback();
|
invocation.return_value(null);
|
||||||
this.disconnect(signalId);
|
this.disconnect(signalId);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
DBus.conformExport(EndSessionDialog.prototype, EndSessionDialogIface);
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
imports.gi.versions.Clutter = '1.0';
|
imports.gi.versions.Clutter = '1.0';
|
||||||
imports.gi.versions.Gio = '2.0';
|
imports.gi.versions.Gio = '2.0';
|
||||||
@ -39,20 +39,23 @@ function _patchContainerClass(containerClass) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _makeLoggingFunc(func) {
|
||||||
|
return function() {
|
||||||
|
return func([].join.call(arguments, ', '));
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
// Add some bindings to the global JS namespace; (gjs keeps the web
|
// Add some bindings to the global JS namespace; (gjs keeps the web
|
||||||
// browser convention of having that namespace be called 'window'.)
|
// browser convention of having that namespace be called 'window'.)
|
||||||
window.global = Shell.Global.get();
|
window.global = Shell.Global.get();
|
||||||
|
|
||||||
|
window.log = _makeLoggingFunc(window.log);
|
||||||
|
|
||||||
window._ = Gettext.gettext;
|
window._ = Gettext.gettext;
|
||||||
window.C_ = Gettext.pgettext;
|
window.C_ = Gettext.pgettext;
|
||||||
window.ngettext = Gettext.ngettext;
|
window.ngettext = Gettext.ngettext;
|
||||||
|
|
||||||
// Set the default direction for St widgets (this needs to be done before any use of St)
|
|
||||||
if (Gtk.Widget.get_default_direction() == Gtk.TextDirection.RTL) {
|
|
||||||
St.Widget.set_default_direction(St.TextDirection.RTL);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Miscellaneous monkeypatching
|
// Miscellaneous monkeypatching
|
||||||
_patchContainerClass(St.BoxLayout);
|
_patchContainerClass(St.BoxLayout);
|
||||||
_patchContainerClass(St.Table);
|
_patchContainerClass(St.Table);
|
||||||
@ -64,10 +67,14 @@ function init() {
|
|||||||
let origToString = Object.prototype.toString;
|
let origToString = Object.prototype.toString;
|
||||||
Object.prototype.toString = function() {
|
Object.prototype.toString = function() {
|
||||||
let base = origToString.call(this);
|
let base = origToString.call(this);
|
||||||
if ('actor' in this && this.actor instanceof Clutter.Actor)
|
try {
|
||||||
return base.replace(/\]$/, ' delegate for ' + this.actor.toString().substring(1));
|
if ('actor' in this && this.actor instanceof Clutter.Actor)
|
||||||
else
|
return base.replace(/\]$/, ' delegate for ' + this.actor.toString().substring(1));
|
||||||
|
else
|
||||||
|
return base;
|
||||||
|
} catch(e) {
|
||||||
return base;
|
return base;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Work around https://bugzilla.mozilla.org/show_bug.cgi?id=508783
|
// Work around https://bugzilla.mozilla.org/show_bug.cgi?id=508783
|
||||||
@ -83,7 +90,7 @@ function init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// OK, now things are initialized enough that we can import shell JS
|
// OK, now things are initialized enough that we can import shell JS
|
||||||
const Format = imports.misc.format;
|
const Format = imports.format;
|
||||||
const Tweener = imports.ui.tweener;
|
const Tweener = imports.ui.tweener;
|
||||||
|
|
||||||
Tweener.init();
|
Tweener.init();
|
||||||
|
270
js/ui/extensionDownloader.js
Normal file
@ -0,0 +1,270 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
|
const Lang = imports.lang;
|
||||||
|
|
||||||
|
const Clutter = imports.gi.Clutter;
|
||||||
|
const GLib = imports.gi.GLib;
|
||||||
|
const Gio = imports.gi.Gio;
|
||||||
|
const Soup = imports.gi.Soup;
|
||||||
|
const St = imports.gi.St;
|
||||||
|
const Shell = imports.gi.Shell;
|
||||||
|
|
||||||
|
const Config = imports.misc.config;
|
||||||
|
const ExtensionUtils = imports.misc.extensionUtils;
|
||||||
|
const ExtensionSystem = imports.ui.extensionSystem;
|
||||||
|
const FileUtils = imports.misc.fileUtils;
|
||||||
|
const ModalDialog = imports.ui.modalDialog;
|
||||||
|
|
||||||
|
const _signals = ExtensionSystem._signals;
|
||||||
|
|
||||||
|
const REPOSITORY_URL_BASE = 'https://extensions.gnome.org';
|
||||||
|
const REPOSITORY_URL_DOWNLOAD = REPOSITORY_URL_BASE + '/download-extension/%s.shell-extension.zip';
|
||||||
|
const REPOSITORY_URL_INFO = REPOSITORY_URL_BASE + '/extension-info/';
|
||||||
|
const REPOSITORY_URL_UPDATE = REPOSITORY_URL_BASE + '/update-info/';
|
||||||
|
|
||||||
|
let _httpSession;
|
||||||
|
|
||||||
|
function installExtension(uuid, invocation) {
|
||||||
|
let params = { uuid: uuid,
|
||||||
|
shell_version: Config.PACKAGE_VERSION };
|
||||||
|
|
||||||
|
let message = Soup.form_request_new_from_hash('GET', REPOSITORY_URL_INFO, params);
|
||||||
|
|
||||||
|
_httpSession.queue_message(message, function(session, message) {
|
||||||
|
if (message.status_code != Soup.KnownStatusCode.OK) {
|
||||||
|
ExtensionSystem.logExtensionError(uuid, 'downloading info: ' + message.status_code);
|
||||||
|
invocation.return_dbus_error('org.gnome.Shell.DownloadInfoError', message.status_code.toString());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let info;
|
||||||
|
try {
|
||||||
|
info = JSON.parse(message.response_body.data);
|
||||||
|
} catch (e) {
|
||||||
|
ExtensionSystem.logExtensionError(uuid, 'parsing info: ' + e);
|
||||||
|
invocation.return_dbus_error('org.gnome.Shell.ParseInfoError', e.toString());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let dialog = new InstallExtensionDialog(uuid, info, invocation);
|
||||||
|
dialog.open(global.get_current_time());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function uninstallExtension(uuid) {
|
||||||
|
let extension = ExtensionUtils.extensions[uuid];
|
||||||
|
if (!extension)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Don't try to uninstall system extensions
|
||||||
|
if (extension.type != ExtensionUtils.ExtensionType.PER_USER)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!ExtensionSystem.unloadExtension(extension))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
FileUtils.recursivelyDeleteDir(extension.dir, true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function gotExtensionZipFile(session, message, uuid, dir, callback, errback) {
|
||||||
|
if (message.status_code != Soup.KnownStatusCode.OK) {
|
||||||
|
errback('DownloadExtensionError', message.status_code);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (!dir.query_exists(null))
|
||||||
|
dir.make_directory_with_parents(null);
|
||||||
|
} catch (e) {
|
||||||
|
errback('CreateExtensionDirectoryError', e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let [file, stream] = Gio.File.new_tmp('XXXXXX.shell-extension.zip');
|
||||||
|
let contents = message.response_body.flatten().get_as_bytes();
|
||||||
|
stream.output_stream.write_bytes(contents, null);
|
||||||
|
stream.close(null);
|
||||||
|
let [success, pid] = GLib.spawn_async(null,
|
||||||
|
['unzip', '-uod', dir.get_path(), '--', file.get_path()],
|
||||||
|
null,
|
||||||
|
GLib.SpawnFlags.SEARCH_PATH | GLib.SpawnFlags.DO_NOT_REAP_CHILD,
|
||||||
|
null);
|
||||||
|
|
||||||
|
if (!success) {
|
||||||
|
errback('ExtractExtensionError');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GLib.child_watch_add(GLib.PRIORITY_DEFAULT, pid, function(pid, status) {
|
||||||
|
GLib.spawn_close_pid(pid);
|
||||||
|
|
||||||
|
if (status != 0)
|
||||||
|
errback('ExtractExtensionError');
|
||||||
|
else
|
||||||
|
callback();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateExtension(uuid) {
|
||||||
|
// This gets a bit tricky. We want the update to be seamless -
|
||||||
|
// if we have any error during downloading or extracting, we
|
||||||
|
// want to not unload the current version.
|
||||||
|
|
||||||
|
let oldExtensionTmpDir = GLib.Dir.make_tmp('XXXXXX-shell-extension');
|
||||||
|
let newExtensionTmpDir = GLib.Dir.make_tmp('XXXXXX-shell-extension');
|
||||||
|
|
||||||
|
let params = { shell_version: Config.PACKAGE_VERSION };
|
||||||
|
|
||||||
|
let url = REPOSITORY_URL_DOWNLOAD.format(uuid);
|
||||||
|
let message = Soup.form_request_new_from_hash('GET', url, params);
|
||||||
|
|
||||||
|
_httpSession.queue_message(message, Lang.bind(this, function(session, message) {
|
||||||
|
gotExtensionZipFile(session, message, uuid, newExtensionTmpDir, function() {
|
||||||
|
let oldExtension = ExtensionUtils.extensions[uuid];
|
||||||
|
let extensionDir = oldExtension.dir;
|
||||||
|
|
||||||
|
if (!ExtensionSystem.unloadExtension(oldExtension))
|
||||||
|
return;
|
||||||
|
|
||||||
|
FileUtils.recursivelyMoveDir(extensionDir, oldExtensionTmpDir);
|
||||||
|
FileUtils.recursivelyMoveDir(newExtensionTmpDir, extensionDir);
|
||||||
|
|
||||||
|
let extension = ExtensionUtils.createExtensionObject(uuid, extensionDir, ExtensionUtils.ExtensionType.PER_USER);
|
||||||
|
|
||||||
|
try {
|
||||||
|
ExtensionSystem.loadExtension(extension);
|
||||||
|
} catch(e) {
|
||||||
|
ExtensionSystem.unloadExtension(extension);
|
||||||
|
|
||||||
|
logError(e, 'Error loading extension %s'.format(uuid));
|
||||||
|
|
||||||
|
FileUtils.recursivelyDeleteDir(extensionDir, false);
|
||||||
|
FileUtils.recursivelyMoveDir(oldExtensionTmpDir, extensionDir);
|
||||||
|
|
||||||
|
// Restore what was there before. We can't do much if we
|
||||||
|
// fail here.
|
||||||
|
ExtensionSystem.loadExtension(oldExtension);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileUtils.recursivelyDeleteDir(oldExtensionTmpDir, true);
|
||||||
|
}, function(code, message) {
|
||||||
|
log('Error while updating extension %s: %s (%s)'.format(uuid, code, message ? message : ''));
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkForUpdates() {
|
||||||
|
let metadatas = {};
|
||||||
|
for (let uuid in ExtensionUtils.extensions) {
|
||||||
|
metadatas[uuid] = ExtensionUtils.extensions[uuid].metadata;
|
||||||
|
}
|
||||||
|
|
||||||
|
let params = { shell_version: Config.PACKAGE_VERSION,
|
||||||
|
installed: JSON.stringify(metadatas) };
|
||||||
|
|
||||||
|
let url = REPOSITORY_URL_UPDATE;
|
||||||
|
let message = Soup.form_request_new_from_hash('GET', url, params);
|
||||||
|
_httpSession.queue_message(message, function(session, message) {
|
||||||
|
if (message.status_code != Soup.KnownStatusCode.OK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
let operations = JSON.parse(message.response_body.data);
|
||||||
|
for (let uuid in operations) {
|
||||||
|
let operation = operations[uuid];
|
||||||
|
if (operation == 'blacklist')
|
||||||
|
uninstallExtension(uuid);
|
||||||
|
else if (operation == 'upgrade' || operation == 'downgrade')
|
||||||
|
updateExtension(uuid);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const InstallExtensionDialog = new Lang.Class({
|
||||||
|
Name: 'InstallExtensionDialog',
|
||||||
|
Extends: ModalDialog.ModalDialog,
|
||||||
|
|
||||||
|
_init: function(uuid, info, invocation) {
|
||||||
|
this.parent({ styleClass: 'extension-dialog' });
|
||||||
|
|
||||||
|
this._uuid = uuid;
|
||||||
|
this._info = info;
|
||||||
|
this._invocation = invocation;
|
||||||
|
|
||||||
|
this.setButtons([{ label: _("Cancel"),
|
||||||
|
action: Lang.bind(this, this._onCancelButtonPressed),
|
||||||
|
key: Clutter.Escape
|
||||||
|
},
|
||||||
|
{ label: _("Install"),
|
||||||
|
action: Lang.bind(this, this._onInstallButtonPressed),
|
||||||
|
default: true
|
||||||
|
}]);
|
||||||
|
|
||||||
|
let message = _("Download and install '%s' from extensions.gnome.org?").format(info.name);
|
||||||
|
|
||||||
|
let box = new St.BoxLayout();
|
||||||
|
this.contentLayout.add(box);
|
||||||
|
|
||||||
|
let gicon = new Gio.FileIcon({ file: Gio.File.new_for_uri(REPOSITORY_URL_BASE + info.icon) })
|
||||||
|
let icon = new St.Icon({ gicon: gicon });
|
||||||
|
box.add(icon);
|
||||||
|
|
||||||
|
let label = new St.Label({ text: message });
|
||||||
|
box.add(label);
|
||||||
|
},
|
||||||
|
|
||||||
|
_onCancelButtonPressed: function(button, event) {
|
||||||
|
this.close(global.get_current_time());
|
||||||
|
this._invocation.return_value(GLib.Variant.new('(s)', ['cancelled']));
|
||||||
|
},
|
||||||
|
|
||||||
|
_onInstallButtonPressed: function(button, event) {
|
||||||
|
let params = { shell_version: Config.PACKAGE_VERSION };
|
||||||
|
|
||||||
|
let url = REPOSITORY_URL_DOWNLOAD.format(this._uuid);
|
||||||
|
let message = Soup.form_request_new_from_hash('GET', url, params);
|
||||||
|
|
||||||
|
let uuid = this._uuid;
|
||||||
|
let dir = Gio.File.new_for_path(GLib.build_filenamev([global.userdatadir, 'extensions', uuid]));
|
||||||
|
let invocation = this._invocation;
|
||||||
|
function errback(code, message) {
|
||||||
|
invocation.return_dbus_error('org.gnome.Shell.' + code, message ? message.toString() : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
function callback() {
|
||||||
|
// Add extension to 'enabled-extensions' for the user, always...
|
||||||
|
let enabledExtensions = global.settings.get_strv(ExtensionSystem.ENABLED_EXTENSIONS_KEY);
|
||||||
|
if (enabledExtensions.indexOf(uuid) == -1) {
|
||||||
|
enabledExtensions.push(uuid);
|
||||||
|
global.settings.set_strv(ExtensionSystem.ENABLED_EXTENSIONS_KEY, enabledExtensions);
|
||||||
|
}
|
||||||
|
|
||||||
|
let extension = ExtensionUtils.createExtensionObject(uuid, dir, ExtensionUtils.ExtensionType.PER_USER);
|
||||||
|
|
||||||
|
try {
|
||||||
|
ExtensionSystem.loadExtension(extension);
|
||||||
|
} catch(e) {
|
||||||
|
uninstallExtension(uuid);
|
||||||
|
errback('LoadExtensionError', e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
invocation.return_value(GLib.Variant.new('(s)', 'successful'));
|
||||||
|
}
|
||||||
|
|
||||||
|
_httpSession.queue_message(message, Lang.bind(this, function(session, message) {
|
||||||
|
gotExtensionZipFile(session, message, uuid, dir, callback, errback);
|
||||||
|
}));
|
||||||
|
|
||||||
|
this.close(global.get_current_time());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
_httpSession = new Soup.SessionAsync({ ssl_use_system_ca_file: true });
|
||||||
|
|
||||||
|
// See: https://bugzilla.gnome.org/show_bug.cgi?id=655189 for context.
|
||||||
|
// _httpSession.add_feature(new Soup.ProxyResolverDefault());
|
||||||
|
Soup.Session.prototype.add_feature.call(_httpSession, new Soup.ProxyResolverDefault());
|
||||||
|
}
|
@ -1,20 +1,14 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const Lang = imports.lang;
|
const Lang = imports.lang;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const Clutter = imports.gi.Clutter;
|
|
||||||
const GLib = imports.gi.GLib;
|
const GLib = imports.gi.GLib;
|
||||||
const Gio = imports.gi.Gio;
|
const Gio = imports.gi.Gio;
|
||||||
const St = imports.gi.St;
|
const St = imports.gi.St;
|
||||||
const Shell = imports.gi.Shell;
|
|
||||||
const Soup = imports.gi.Soup;
|
|
||||||
|
|
||||||
const Config = imports.misc.config;
|
const ExtensionUtils = imports.misc.extensionUtils;
|
||||||
const FileUtils = imports.misc.fileUtils;
|
const Main = imports.ui.main;
|
||||||
const ModalDialog = imports.ui.modalDialog;
|
|
||||||
|
|
||||||
const API_VERSION = 1;
|
|
||||||
|
|
||||||
const ExtensionState = {
|
const ExtensionState = {
|
||||||
ENABLED: 1,
|
ENABLED: 1,
|
||||||
@ -22,50 +16,17 @@ const ExtensionState = {
|
|||||||
ERROR: 3,
|
ERROR: 3,
|
||||||
OUT_OF_DATE: 4,
|
OUT_OF_DATE: 4,
|
||||||
DOWNLOADING: 5,
|
DOWNLOADING: 5,
|
||||||
|
INITIALIZED: 6,
|
||||||
|
|
||||||
// Used as an error state for operations on unknown extensions,
|
// Used as an error state for operations on unknown extensions,
|
||||||
// should never be in a real extensionMeta object.
|
// should never be in a real extensionMeta object.
|
||||||
UNINSTALLED: 99
|
UNINSTALLED: 99
|
||||||
};
|
};
|
||||||
|
|
||||||
const ExtensionType = {
|
|
||||||
SYSTEM: 1,
|
|
||||||
PER_USER: 2
|
|
||||||
};
|
|
||||||
|
|
||||||
const REPOSITORY_URL_BASE = 'https://extensions.gnome.org';
|
|
||||||
const REPOSITORY_URL_DOWNLOAD = REPOSITORY_URL_BASE + '/download-extension/%s.shell-extension.zip';
|
|
||||||
const REPOSITORY_URL_INFO = REPOSITORY_URL_BASE + '/extension-info/';
|
|
||||||
|
|
||||||
const _httpSession = new Soup.SessionAsync();
|
|
||||||
|
|
||||||
// The unfortunate state of gjs, gobject-introspection and libsoup
|
|
||||||
// means that I have to do a hack to add a feature.
|
|
||||||
// See: https://bugzilla.gnome.org/show_bug.cgi?id=655189 for context.
|
|
||||||
|
|
||||||
if (Soup.Session.prototype.add_feature != null)
|
|
||||||
Soup.Session.prototype.add_feature.call(_httpSession, new Soup.ProxyResolverDefault());
|
|
||||||
|
|
||||||
function _getCertFile() {
|
|
||||||
let localCert = GLib.build_filenamev([global.userdatadir, 'extensions.gnome.org.crt']);
|
|
||||||
if (GLib.file_test(localCert, GLib.FileTest.EXISTS))
|
|
||||||
return localCert;
|
|
||||||
else
|
|
||||||
return Config.SHELL_SYSTEM_CA_FILE;
|
|
||||||
}
|
|
||||||
|
|
||||||
_httpSession.ssl_ca_file = _getCertFile();
|
|
||||||
|
|
||||||
// Maps uuid -> metadata object
|
|
||||||
const extensionMeta = {};
|
|
||||||
// Maps uuid -> importer object (extension directory tree)
|
|
||||||
const extensions = {};
|
|
||||||
// Maps uuid -> extension state object (returned from init())
|
|
||||||
const extensionStateObjs = {};
|
|
||||||
// Arrays of uuids
|
// Arrays of uuids
|
||||||
var enabledExtensions;
|
var enabledExtensions;
|
||||||
// GFile for user extensions
|
// Contains the order that extensions were enabled in.
|
||||||
var userExtensionsDir = null;
|
const extensionOrder = [];
|
||||||
|
|
||||||
// We don't really have a class to add signals on. So, create
|
// We don't really have a class to add signals on. So, create
|
||||||
// a simple dummy object, add the signal methods, and export those
|
// a simple dummy object, add the signal methods, and export those
|
||||||
@ -76,330 +37,202 @@ Signals.addSignalMethods(_signals);
|
|||||||
const connect = Lang.bind(_signals, _signals.connect);
|
const connect = Lang.bind(_signals, _signals.connect);
|
||||||
const disconnect = Lang.bind(_signals, _signals.disconnect);
|
const disconnect = Lang.bind(_signals, _signals.disconnect);
|
||||||
|
|
||||||
// UUID => Array of error messages
|
|
||||||
var errors = {};
|
|
||||||
|
|
||||||
const ENABLED_EXTENSIONS_KEY = 'enabled-extensions';
|
const ENABLED_EXTENSIONS_KEY = 'enabled-extensions';
|
||||||
|
|
||||||
/**
|
var initted = false;
|
||||||
* versionCheck:
|
var enabled;
|
||||||
* @required: an array of versions we're compatible with
|
|
||||||
* @current: the version we have
|
|
||||||
*
|
|
||||||
* Check if a component is compatible for an extension.
|
|
||||||
* @required is an array, and at least one version must match.
|
|
||||||
* @current must be in the format <major>.<minor>.<point>.<micro>
|
|
||||||
* <micro> is always ignored
|
|
||||||
* <point> is ignored if <minor> is even (so you can target the
|
|
||||||
* whole stable release)
|
|
||||||
* <minor> and <major> must match
|
|
||||||
* Each target version must be at least <major> and <minor>
|
|
||||||
*/
|
|
||||||
function versionCheck(required, current) {
|
|
||||||
let currentArray = current.split('.');
|
|
||||||
let major = currentArray[0];
|
|
||||||
let minor = currentArray[1];
|
|
||||||
let point = currentArray[2];
|
|
||||||
for (let i = 0; i < required.length; i++) {
|
|
||||||
let requiredArray = required[i].split('.');
|
|
||||||
if (requiredArray[0] == major &&
|
|
||||||
requiredArray[1] == minor &&
|
|
||||||
(requiredArray[2] == point ||
|
|
||||||
(requiredArray[2] == undefined && parseInt(minor) % 2 == 0)))
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function installExtensionFromUUID(uuid, version_tag) {
|
|
||||||
let params = { uuid: uuid,
|
|
||||||
version_tag: version_tag,
|
|
||||||
shell_version: Config.PACKAGE_VERSION,
|
|
||||||
api_version: API_VERSION.toString() };
|
|
||||||
|
|
||||||
let message = Soup.form_request_new_from_hash('GET', REPOSITORY_URL_INFO, params);
|
|
||||||
|
|
||||||
_httpSession.queue_message(message,
|
|
||||||
function(session, message) {
|
|
||||||
let info = JSON.parse(message.response_body.data);
|
|
||||||
let dialog = new InstallExtensionDialog(uuid, version_tag, info.name);
|
|
||||||
dialog.open(global.get_current_time());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function uninstallExtensionFromUUID(uuid) {
|
|
||||||
let meta = extensionMeta[uuid];
|
|
||||||
if (!meta)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Try to disable it -- if it's ERROR'd, we can't guarantee that,
|
|
||||||
// but it will be removed on next reboot, and hopefully nothing
|
|
||||||
// broke too much.
|
|
||||||
disableExtension(uuid);
|
|
||||||
|
|
||||||
// Don't try to uninstall system extensions
|
|
||||||
if (meta.type != ExtensionType.PER_USER)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
meta.state = ExtensionState.UNINSTALLED;
|
|
||||||
_signals.emit('extension-state-changed', meta);
|
|
||||||
|
|
||||||
delete extensionMeta[uuid];
|
|
||||||
|
|
||||||
// Importers are marked as PERMANENT, so we can't do this.
|
|
||||||
// delete extensions[uuid];
|
|
||||||
extensions[uuid] = undefined;
|
|
||||||
|
|
||||||
delete extensionStateObjs[uuid];
|
|
||||||
delete errors[uuid];
|
|
||||||
|
|
||||||
FileUtils.recursivelyDeleteDir(Gio.file_new_for_path(meta.path));
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function gotExtensionZipFile(session, message, uuid) {
|
|
||||||
if (message.status_code != Soup.KnownStatusCode.OK) {
|
|
||||||
logExtensionError(uuid, 'downloading extension: ' + message.status_code);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME: use a GFile mkstemp-type method once one exists
|
|
||||||
let fd, tmpzip;
|
|
||||||
try {
|
|
||||||
[fd, tmpzip] = GLib.file_open_tmp('XXXXXX.shell-extension.zip');
|
|
||||||
} catch (e) {
|
|
||||||
logExtensionError(uuid, 'tempfile: ' + e.toString());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let stream = new Gio.UnixOutputStream({ fd: fd });
|
|
||||||
let dir = userExtensionsDir.get_child(uuid);
|
|
||||||
Shell.write_soup_message_to_stream(stream, message);
|
|
||||||
stream.close(null);
|
|
||||||
let [success, pid] = GLib.spawn_async(null,
|
|
||||||
['unzip', '-uod', dir.get_path(), '--', tmpzip],
|
|
||||||
null,
|
|
||||||
GLib.SpawnFlags.SEARCH_PATH | GLib.SpawnFlags.DO_NOT_REAP_CHILD,
|
|
||||||
null);
|
|
||||||
|
|
||||||
if (!success) {
|
|
||||||
logExtensionError(uuid, 'extract: could not extract');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
GLib.child_watch_add(GLib.PRIORITY_DEFAULT, pid, function(pid, status) {
|
|
||||||
GLib.spawn_close_pid(pid);
|
|
||||||
|
|
||||||
// Add extension to 'enabled-extensions' for the user, always...
|
|
||||||
let enabledExtensions = global.settings.get_strv(ENABLED_EXTENSIONS_KEY);
|
|
||||||
if (enabledExtensions.indexOf(uuid) == -1) {
|
|
||||||
enabledExtensions.push(uuid);
|
|
||||||
global.settings.set_strv(ENABLED_EXTENSIONS_KEY, enabledExtensions);
|
|
||||||
}
|
|
||||||
|
|
||||||
loadExtension(dir, true, ExtensionType.PER_USER);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function disableExtension(uuid) {
|
function disableExtension(uuid) {
|
||||||
let meta = extensionMeta[uuid];
|
let extension = ExtensionUtils.extensions[uuid];
|
||||||
if (!meta)
|
if (!extension)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (meta.state != ExtensionState.ENABLED)
|
if (extension.state != ExtensionState.ENABLED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let extensionState = extensionStateObjs[uuid];
|
// "Rebase" the extension order by disabling and then enabling extensions
|
||||||
|
// in order to help prevent conflicts.
|
||||||
|
|
||||||
try {
|
// Example:
|
||||||
extensionState.disable();
|
// order = [A, B, C, D, E]
|
||||||
} catch(e) {
|
// user disables C
|
||||||
logExtensionError(uuid, e.toString());
|
// this should: disable E, disable D, disable C, enable D, enable E
|
||||||
return;
|
|
||||||
|
let orderIdx = extensionOrder.indexOf(uuid);
|
||||||
|
let order = extensionOrder.slice(orderIdx + 1);
|
||||||
|
let orderReversed = order.slice().reverse();
|
||||||
|
|
||||||
|
for (let i = 0; i < orderReversed.length; i++) {
|
||||||
|
let uuid = orderReversed[i];
|
||||||
|
try {
|
||||||
|
ExtensionUtils.extensions[uuid].stateObj.disable();
|
||||||
|
} catch(e) {
|
||||||
|
logExtensionError(uuid, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
meta.state = ExtensionState.DISABLED;
|
if (extension.stylesheet) {
|
||||||
_signals.emit('extension-state-changed', meta);
|
let theme = St.ThemeContext.get_for_stage(global.stage).get_theme();
|
||||||
|
theme.unload_stylesheet(extension.stylesheet.get_path());
|
||||||
|
}
|
||||||
|
|
||||||
|
extension.stateObj.disable();
|
||||||
|
|
||||||
|
for (let i = 0; i < order.length; i++) {
|
||||||
|
let uuid = order[i];
|
||||||
|
try {
|
||||||
|
ExtensionUtils.extensions[uuid].stateObj.enable();
|
||||||
|
} catch(e) {
|
||||||
|
logExtensionError(uuid, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extensionOrder.splice(orderIdx, 1);
|
||||||
|
|
||||||
|
extension.state = ExtensionState.DISABLED;
|
||||||
|
_signals.emit('extension-state-changed', extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
function enableExtension(uuid) {
|
function enableExtension(uuid) {
|
||||||
let meta = extensionMeta[uuid];
|
let extension = ExtensionUtils.extensions[uuid];
|
||||||
if (!meta)
|
if (!extension)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (meta.state != ExtensionState.DISABLED)
|
if (extension.state == ExtensionState.INITIALIZED)
|
||||||
|
initExtension(uuid);
|
||||||
|
|
||||||
|
if (extension.state != ExtensionState.DISABLED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let extensionState = extensionStateObjs[uuid];
|
extensionOrder.push(uuid);
|
||||||
|
|
||||||
try {
|
let stylesheetFile = extension.dir.get_child('stylesheet.css');
|
||||||
extensionState.enable();
|
if (stylesheetFile.query_exists(null)) {
|
||||||
} catch(e) {
|
let theme = St.ThemeContext.get_for_stage(global.stage).get_theme();
|
||||||
logExtensionError(uuid, e.toString());
|
theme.load_stylesheet(stylesheetFile.get_path());
|
||||||
return;
|
extension.stylesheet = stylesheetFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
meta.state = ExtensionState.ENABLED;
|
extension.stateObj.enable();
|
||||||
_signals.emit('extension-state-changed', meta);
|
|
||||||
|
extension.state = ExtensionState.ENABLED;
|
||||||
|
_signals.emit('extension-state-changed', extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
function logExtensionError(uuid, message, state) {
|
function logExtensionError(uuid, error) {
|
||||||
if (!errors[uuid]) errors[uuid] = [];
|
let extension = ExtensionUtils.extensions[uuid];
|
||||||
errors[uuid].push(message);
|
if (!extension)
|
||||||
global.logError('Extension "%s" had error: %s'.format(uuid, message));
|
return;
|
||||||
state = state || ExtensionState.ERROR;
|
|
||||||
|
let message = '' + error;
|
||||||
|
|
||||||
|
if (error.state)
|
||||||
|
extension.state = error.state;
|
||||||
|
else
|
||||||
|
extension.state = ExtensionState.ERROR;
|
||||||
|
|
||||||
|
if (!extension.errors)
|
||||||
|
extension.errors = [];
|
||||||
|
|
||||||
|
log('Extension "%s" had error: %s'.format(uuid, message));
|
||||||
_signals.emit('extension-state-changed', { uuid: uuid,
|
_signals.emit('extension-state-changed', { uuid: uuid,
|
||||||
error: message,
|
error: message,
|
||||||
state: state });
|
state: extension.state });
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadExtension(dir, enabled, type) {
|
function loadExtension(extension) {
|
||||||
let info;
|
|
||||||
let uuid = dir.get_basename();
|
|
||||||
|
|
||||||
let metadataFile = dir.get_child('metadata.json');
|
|
||||||
if (!metadataFile.query_exists(null)) {
|
|
||||||
logExtensionError(uuid, 'Missing metadata.json');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let metadataContents;
|
|
||||||
try {
|
|
||||||
metadataContents = Shell.get_file_contents_utf8_sync(metadataFile.get_path());
|
|
||||||
} catch (e) {
|
|
||||||
logExtensionError(uuid, 'Failed to load metadata.json: ' + e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let meta;
|
|
||||||
try {
|
|
||||||
meta = JSON.parse(metadataContents);
|
|
||||||
} catch (e) {
|
|
||||||
logExtensionError(uuid, 'Failed to parse metadata.json: ' + e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let requiredProperties = ['uuid', 'name', 'description', 'shell-version'];
|
|
||||||
for (let i = 0; i < requiredProperties.length; i++) {
|
|
||||||
let prop = requiredProperties[i];
|
|
||||||
if (!meta[prop]) {
|
|
||||||
logExtensionError(uuid, 'missing "' + prop + '" property in metadata.json');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (extensions[uuid] != undefined) {
|
|
||||||
logExtensionError(uuid, "extension already loaded");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Encourage people to add this
|
|
||||||
if (!meta['url']) {
|
|
||||||
global.log('Warning: Missing "url" property in metadata.json');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (uuid != meta.uuid) {
|
|
||||||
logExtensionError(uuid, 'uuid "' + meta.uuid + '" from metadata.json does not match directory name "' + uuid + '"');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!versionCheck(meta['shell-version'], Config.PACKAGE_VERSION) ||
|
|
||||||
(meta['js-version'] && !versionCheck(meta['js-version'], Config.GJS_VERSION))) {
|
|
||||||
logExtensionError(uuid, 'extension is not compatible with current GNOME Shell and/or GJS version');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
extensionMeta[uuid] = meta;
|
|
||||||
meta.type = type;
|
|
||||||
meta.path = dir.get_path();
|
|
||||||
meta.error = '';
|
|
||||||
|
|
||||||
// Default to error, we set success as the last step
|
// Default to error, we set success as the last step
|
||||||
meta.state = ExtensionState.ERROR;
|
extension.state = ExtensionState.ERROR;
|
||||||
|
|
||||||
if (!versionCheck(meta['shell-version'], Config.PACKAGE_VERSION) ||
|
if (ExtensionUtils.isOutOfDate(extension)) {
|
||||||
(meta['js-version'] && !versionCheck(meta['js-version'], Config.GJS_VERSION))) {
|
let error = new Error('extension is not compatible with current GNOME Shell and/or GJS version');
|
||||||
logExtensionError(uuid, 'extension is not compatible with current GNOME Shell and/or GJS version', ExtensionState.OUT_OF_DATE);
|
error.state = ExtensionState.OUT_OF_DATE;
|
||||||
meta.state = ExtensionState.OUT_OF_DATE;
|
throw error;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let enabled = enabledExtensions.indexOf(extension.uuid) != -1;
|
||||||
|
if (enabled) {
|
||||||
|
initExtension(extension.uuid);
|
||||||
|
if (extension.state == ExtensionState.DISABLED)
|
||||||
|
enableExtension(extension.uuid);
|
||||||
|
} else {
|
||||||
|
extension.state = ExtensionState.INITIALIZED;
|
||||||
|
}
|
||||||
|
|
||||||
|
_signals.emit('extension-state-changed', extension);
|
||||||
|
}
|
||||||
|
|
||||||
|
function unloadExtension(extension) {
|
||||||
|
// Try to disable it -- if it's ERROR'd, we can't guarantee that,
|
||||||
|
// but it will be removed on next reboot, and hopefully nothing
|
||||||
|
// broke too much.
|
||||||
|
disableExtension(extension.uuid);
|
||||||
|
|
||||||
|
extension.state = ExtensionState.UNINSTALLED;
|
||||||
|
_signals.emit('extension-state-changed', extension);
|
||||||
|
|
||||||
|
delete ExtensionUtils.extensions[extension.uuid];
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function reloadExtension(oldExtension) {
|
||||||
|
// Grab the things we'll need to pass to createExtensionObject
|
||||||
|
// to reload it.
|
||||||
|
let { uuid: uuid, dir: dir, type: type } = oldExtension;
|
||||||
|
|
||||||
|
// Then unload the old extension.
|
||||||
|
unloadExtension(oldExtension);
|
||||||
|
|
||||||
|
// Now, recreate the extension and load it.
|
||||||
|
let newExtension = ExtensionUtils.createExtensionObject(uuid, dir, type);
|
||||||
|
loadExtension(newExtension);
|
||||||
|
}
|
||||||
|
|
||||||
|
function initExtension(uuid) {
|
||||||
|
let extension = ExtensionUtils.extensions[uuid];
|
||||||
|
let dir = extension.dir;
|
||||||
|
|
||||||
|
if (!extension)
|
||||||
|
throw new Error("Extension was not properly created. Call loadExtension first");
|
||||||
|
|
||||||
let extensionJs = dir.get_child('extension.js');
|
let extensionJs = dir.get_child('extension.js');
|
||||||
if (!extensionJs.query_exists(null)) {
|
if (!extensionJs.query_exists(null))
|
||||||
logExtensionError(uuid, 'Missing extension.js');
|
throw new Error('Missing extension.js');
|
||||||
return;
|
|
||||||
}
|
|
||||||
let stylesheetPath = null;
|
|
||||||
let themeContext = St.ThemeContext.get_for_stage(global.stage);
|
|
||||||
let theme = themeContext.get_theme();
|
|
||||||
let stylesheetFile = dir.get_child('stylesheet.css');
|
|
||||||
if (stylesheetFile.query_exists(null)) {
|
|
||||||
try {
|
|
||||||
theme.load_stylesheet(stylesheetFile.get_path());
|
|
||||||
} catch (e) {
|
|
||||||
logExtensionError(uuid, 'Stylesheet parse error: ' + e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let extensionModule;
|
let extensionModule;
|
||||||
let extensionState = null;
|
let extensionState = null;
|
||||||
try {
|
|
||||||
global.add_extension_importer('imports.ui.extensionSystem.extensions', meta.uuid, dir.get_path());
|
|
||||||
extensionModule = extensions[meta.uuid].extension;
|
|
||||||
} catch (e) {
|
|
||||||
if (stylesheetPath != null)
|
|
||||||
theme.unload_stylesheet(stylesheetPath);
|
|
||||||
logExtensionError(uuid, e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!extensionModule.init) {
|
ExtensionUtils.installImporter(extension);
|
||||||
logExtensionError(uuid, 'missing \'init\' function');
|
extensionModule = extension.imports.extension;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
if (extensionModule.init) {
|
||||||
extensionState = extensionModule.init(meta);
|
extensionState = extensionModule.init(extension);
|
||||||
} catch (e) {
|
|
||||||
if (stylesheetPath != null)
|
|
||||||
theme.unload_stylesheet(stylesheetPath);
|
|
||||||
logExtensionError(uuid, 'Failed to evaluate init function:' + e);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!extensionState)
|
if (!extensionState)
|
||||||
extensionState = extensionModule;
|
extensionState = extensionModule;
|
||||||
extensionStateObjs[uuid] = extensionState;
|
extension.stateObj = extensionState;
|
||||||
|
|
||||||
if (!extensionState.enable) {
|
extension.state = ExtensionState.DISABLED;
|
||||||
logExtensionError(uuid, 'missing \'enable\' function');
|
_signals.emit('extension-loaded', uuid);
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!extensionState.disable) {
|
|
||||||
logExtensionError(uuid, 'missing \'disable\' function');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
meta.state = ExtensionState.DISABLED;
|
|
||||||
|
|
||||||
if (enabled)
|
|
||||||
enableExtension(uuid);
|
|
||||||
|
|
||||||
_signals.emit('extension-loaded', meta.uuid);
|
|
||||||
_signals.emit('extension-state-changed', meta);
|
|
||||||
global.log('Loaded extension ' + meta.uuid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEnabledExtensionsChanged() {
|
function onEnabledExtensionsChanged() {
|
||||||
let newEnabledExtensions = global.settings.get_strv(ENABLED_EXTENSIONS_KEY);
|
let newEnabledExtensions = global.settings.get_strv(ENABLED_EXTENSIONS_KEY);
|
||||||
|
|
||||||
|
if (!enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
// Find and enable all the newly enabled extensions: UUIDs found in the
|
// Find and enable all the newly enabled extensions: UUIDs found in the
|
||||||
// new setting, but not in the old one.
|
// new setting, but not in the old one.
|
||||||
newEnabledExtensions.filter(function(uuid) {
|
newEnabledExtensions.filter(function(uuid) {
|
||||||
return enabledExtensions.indexOf(uuid) == -1;
|
return enabledExtensions.indexOf(uuid) == -1;
|
||||||
}).forEach(function(uuid) {
|
}).forEach(function(uuid) {
|
||||||
enableExtension(uuid);
|
try {
|
||||||
|
enableExtension(uuid);
|
||||||
|
} catch(e) {
|
||||||
|
logExtensionError(uuid, e);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Find and disable all the newly disabled extensions: UUIDs found in the
|
// Find and disable all the newly disabled extensions: UUIDs found in the
|
||||||
@ -407,125 +240,67 @@ function onEnabledExtensionsChanged() {
|
|||||||
enabledExtensions.filter(function(item) {
|
enabledExtensions.filter(function(item) {
|
||||||
return newEnabledExtensions.indexOf(item) == -1;
|
return newEnabledExtensions.indexOf(item) == -1;
|
||||||
}).forEach(function(uuid) {
|
}).forEach(function(uuid) {
|
||||||
disableExtension(uuid);
|
try {
|
||||||
|
disableExtension(uuid);
|
||||||
|
} catch(e) {
|
||||||
|
logExtensionError(uuid, e);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
enabledExtensions = newEnabledExtensions;
|
enabledExtensions = newEnabledExtensions;
|
||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
function _loadExtensions() {
|
||||||
let userExtensionsPath = GLib.build_filenamev([global.userdatadir, 'extensions']);
|
|
||||||
userExtensionsDir = Gio.file_new_for_path(userExtensionsPath);
|
|
||||||
try {
|
|
||||||
if (!userExtensionsDir.query_exists(null))
|
|
||||||
userExtensionsDir.make_directory_with_parents(null);
|
|
||||||
} catch (e) {
|
|
||||||
global.logError('' + e);
|
|
||||||
}
|
|
||||||
|
|
||||||
global.settings.connect('changed::' + ENABLED_EXTENSIONS_KEY, onEnabledExtensionsChanged);
|
global.settings.connect('changed::' + ENABLED_EXTENSIONS_KEY, onEnabledExtensionsChanged);
|
||||||
enabledExtensions = global.settings.get_strv(ENABLED_EXTENSIONS_KEY);
|
enabledExtensions = global.settings.get_strv(ENABLED_EXTENSIONS_KEY);
|
||||||
|
|
||||||
|
let finder = new ExtensionUtils.ExtensionFinder();
|
||||||
|
finder.connect('extension-found', function(signals, extension) {
|
||||||
|
try {
|
||||||
|
loadExtension(extension);
|
||||||
|
} catch(e) {
|
||||||
|
logExtensionError(extension.uuid, e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
finder.scanExtensions();
|
||||||
}
|
}
|
||||||
|
|
||||||
function _loadExtensionsIn(dir, type) {
|
function enableAllExtensions() {
|
||||||
let fileEnum;
|
if (enabled)
|
||||||
let file, info;
|
return;
|
||||||
try {
|
|
||||||
fileEnum = dir.enumerate_children('standard::*', Gio.FileQueryInfoFlags.NONE, null);
|
|
||||||
} catch (e) {
|
|
||||||
global.logError('' + e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
while ((info = fileEnum.next_file(null)) != null) {
|
if (!initted) {
|
||||||
let fileType = info.get_file_type();
|
_loadExtensions();
|
||||||
if (fileType != Gio.FileType.DIRECTORY)
|
initted = true;
|
||||||
continue;
|
} else {
|
||||||
let name = info.get_name();
|
enabledExtensions.forEach(function(uuid) {
|
||||||
let child = dir.get_child(name);
|
enableExtension(uuid);
|
||||||
let enabled = enabledExtensions.indexOf(name) != -1;
|
});
|
||||||
loadExtension(child, enabled, type);
|
|
||||||
}
|
}
|
||||||
fileEnum.close(null);
|
enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadExtensions() {
|
function disableAllExtensions() {
|
||||||
_loadExtensionsIn(userExtensionsDir, ExtensionType.PER_USER);
|
if (!enabled)
|
||||||
let systemDataDirs = GLib.get_system_data_dirs();
|
return;
|
||||||
for (let i = 0; i < systemDataDirs.length; i++) {
|
|
||||||
let dirPath = systemDataDirs[i] + '/gnome-shell/extensions';
|
if (initted) {
|
||||||
let dir = Gio.file_new_for_path(dirPath);
|
enabledExtensions.forEach(function(uuid) {
|
||||||
if (dir.query_exists(null))
|
disableExtension(uuid);
|
||||||
_loadExtensionsIn(dir, ExtensionType.SYSTEM);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function InstallExtensionDialog(uuid, version_tag, name) {
|
function _sessionUpdated() {
|
||||||
this._init(uuid, version_tag, name);
|
if (Main.sessionMode.allowExtensions)
|
||||||
|
enableAllExtensions();
|
||||||
|
else
|
||||||
|
disableAllExtensions();
|
||||||
}
|
}
|
||||||
|
|
||||||
InstallExtensionDialog.prototype = {
|
function init() {
|
||||||
__proto__: ModalDialog.ModalDialog.prototype,
|
Main.sessionMode.connect('updated', _sessionUpdated);
|
||||||
|
_sessionUpdated();
|
||||||
_init: function(uuid, version_tag, name) {
|
}
|
||||||
ModalDialog.ModalDialog.prototype._init.call(this, { styleClass: 'extension-dialog' });
|
|
||||||
|
|
||||||
this._uuid = uuid;
|
|
||||||
this._version_tag = version_tag;
|
|
||||||
this._name = name;
|
|
||||||
|
|
||||||
this.setButtons([{ label: _("Cancel"),
|
|
||||||
action: Lang.bind(this, this._onCancelButtonPressed),
|
|
||||||
key: Clutter.Escape
|
|
||||||
},
|
|
||||||
{ label: _("Install"),
|
|
||||||
action: Lang.bind(this, this._onInstallButtonPressed)
|
|
||||||
}]);
|
|
||||||
|
|
||||||
let message = _("Download and install '%s' from extensions.gnome.org?").format(name);
|
|
||||||
|
|
||||||
this._descriptionLabel = new St.Label({ text: message });
|
|
||||||
|
|
||||||
this.contentLayout.add(this._descriptionLabel,
|
|
||||||
{ y_fill: true,
|
|
||||||
y_align: St.Align.START });
|
|
||||||
},
|
|
||||||
|
|
||||||
_onCancelButtonPressed: function(button, event) {
|
|
||||||
this.close(global.get_current_time());
|
|
||||||
|
|
||||||
// Even though the extension is already "uninstalled", send through
|
|
||||||
// a state-changed signal for any users who want to know if the install
|
|
||||||
// went through correctly -- using proper async DBus would block more
|
|
||||||
// traditional clients like the plugin
|
|
||||||
let meta = { uuid: this._uuid,
|
|
||||||
state: ExtensionState.UNINSTALLED,
|
|
||||||
error: '' };
|
|
||||||
|
|
||||||
_signals.emit('extension-state-changed', meta);
|
|
||||||
},
|
|
||||||
|
|
||||||
_onInstallButtonPressed: function(button, event) {
|
|
||||||
let meta = { uuid: this._uuid,
|
|
||||||
state: ExtensionState.DOWNLOADING,
|
|
||||||
error: '' };
|
|
||||||
|
|
||||||
extensionMeta[this._uuid] = meta;
|
|
||||||
|
|
||||||
_signals.emit('extension-state-changed', meta);
|
|
||||||
|
|
||||||
let params = { version_tag: this._version_tag,
|
|
||||||
shell_version: Config.PACKAGE_VERSION,
|
|
||||||
api_version: API_VERSION.toString() };
|
|
||||||
|
|
||||||
let url = REPOSITORY_URL_DOWNLOAD.format(this._uuid);
|
|
||||||
let message = Soup.form_request_new_from_hash('GET', url, params);
|
|
||||||
|
|
||||||
_httpSession.queue_message(message,
|
|
||||||
Lang.bind(this, function(session, message) {
|
|
||||||
gotExtensionZipFile(session, message, this._uuid);
|
|
||||||
}));
|
|
||||||
|
|
||||||
this.close(global.get_current_time());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
45
js/ui/flashspot.js
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
|
const Lang = imports.lang;
|
||||||
|
|
||||||
|
const Lightbox = imports.ui.lightbox;
|
||||||
|
const Main = imports.ui.main;
|
||||||
|
const Tweener = imports.ui.tweener;
|
||||||
|
|
||||||
|
const FLASHSPOT_ANIMATION_TIME = 0.25; // seconds
|
||||||
|
|
||||||
|
const Flashspot = new Lang.Class({
|
||||||
|
Name: 'Flashspot',
|
||||||
|
Extends: Lightbox.Lightbox,
|
||||||
|
|
||||||
|
_init: function(area) {
|
||||||
|
this.parent(Main.uiGroup, { inhibitEvents: true,
|
||||||
|
width: area.width,
|
||||||
|
height: area.height });
|
||||||
|
|
||||||
|
this.actor.style_class = 'flashspot';
|
||||||
|
this.actor.set_position(area.x, area.y);
|
||||||
|
},
|
||||||
|
|
||||||
|
fire: function() {
|
||||||
|
this.actor.opacity = 0;
|
||||||
|
Tweener.addTween(this.actor,
|
||||||
|
{ opacity: 255,
|
||||||
|
time: FLASHSPOT_ANIMATION_TIME,
|
||||||
|
transition: 'linear',
|
||||||
|
onComplete: Lang.bind(this, this._onFireShowComplete)
|
||||||
|
});
|
||||||
|
this.actor.show();
|
||||||
|
},
|
||||||
|
|
||||||
|
_onFireShowComplete: function() {
|
||||||
|
Tweener.addTween(this.actor,
|
||||||
|
{ opacity: 0,
|
||||||
|
time: FLASHSPOT_ANIMATION_TIME,
|
||||||
|
transition: 'linear',
|
||||||
|
onComplete: Lang.bind(this, function() {
|
||||||
|
this.destroy();
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
358
js/ui/grabHelper.js
Normal file
@ -0,0 +1,358 @@
|
|||||||
|
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||||
|
|
||||||
|
const Clutter = imports.gi.Clutter;
|
||||||
|
const Gtk = imports.gi.Gtk;
|
||||||
|
const Lang = imports.lang;
|
||||||
|
const Meta = imports.gi.Meta;
|
||||||
|
const Shell = imports.gi.Shell;
|
||||||
|
const St = imports.gi.St;
|
||||||
|
|
||||||
|
const Main = imports.ui.main;
|
||||||
|
const Params = imports.misc.params;
|
||||||
|
|
||||||
|
function _navigateActor(actor) {
|
||||||
|
if (!actor)
|
||||||
|
return;
|
||||||
|
|
||||||
|
let needsGrab = true;
|
||||||
|
if (actor instanceof St.Widget)
|
||||||
|
needsGrab = !actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
|
||||||
|
if (needsGrab)
|
||||||
|
actor.grab_key_focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
// GrabHelper:
|
||||||
|
// @owner: the actor that owns the GrabHelper
|
||||||
|
//
|
||||||
|
// Creates a new GrabHelper object, for dealing with keyboard and pointer grabs
|
||||||
|
// associated with a set of actors.
|
||||||
|
//
|
||||||
|
// Note that the grab can be automatically dropped at any time by the user, and
|
||||||
|
// your code just needs to deal with it; you shouldn't adjust behavior directly
|
||||||
|
// after you call ungrab(), but instead pass an 'onUngrab' callback when you
|
||||||
|
// call grab().
|
||||||
|
const GrabHelper = new Lang.Class({
|
||||||
|
Name: 'GrabHelper',
|
||||||
|
|
||||||
|
_init: function(owner) {
|
||||||
|
this._owner = owner;
|
||||||
|
|
||||||
|
this._grabStack = [];
|
||||||
|
|
||||||
|
this._actors = [];
|
||||||
|
this._capturedEventId = 0;
|
||||||
|
this._eventId = 0;
|
||||||
|
this._keyFocusNotifyId = 0;
|
||||||
|
this._focusWindowChangedId = 0;
|
||||||
|
this._ignoreRelease = false;
|
||||||
|
|
||||||
|
this._modalCount = 0;
|
||||||
|
this._grabFocusCount = 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
// addActor:
|
||||||
|
// @actor: an actor
|
||||||
|
//
|
||||||
|
// Adds @actor to the set of actors that are allowed to process events
|
||||||
|
// during a grab.
|
||||||
|
addActor: function(actor) {
|
||||||
|
actor.__grabHelperDestroyId = actor.connect('destroy', Lang.bind(this, function() { this.removeActor(actor); }));
|
||||||
|
this._actors.push(actor);
|
||||||
|
},
|
||||||
|
|
||||||
|
// removeActor:
|
||||||
|
// @actor: an actor
|
||||||
|
//
|
||||||
|
// Removes @actor from the set of actors that are allowed to
|
||||||
|
// process events during a grab.
|
||||||
|
removeActor: function(actor) {
|
||||||
|
let index = this._actors.indexOf(actor);
|
||||||
|
if (index != -1)
|
||||||
|
this._actors.splice(index, 1);
|
||||||
|
if (actor.__grabHelperDestroyId) {
|
||||||
|
actor.disconnect(actor.__grabHelperDestroyId);
|
||||||
|
delete actor.__grabHelperDestroyId;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_isWithinGrabbedActor: function(actor) {
|
||||||
|
while (actor) {
|
||||||
|
if (this._actors.indexOf(actor) != -1)
|
||||||
|
return true;
|
||||||
|
actor = actor.get_parent();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
get currentGrab() {
|
||||||
|
return this._grabStack[this._grabStack.length - 1] || {};
|
||||||
|
},
|
||||||
|
|
||||||
|
_findStackIndex: function(actor) {
|
||||||
|
if (!actor)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
for (let i = 0; i < this._grabStack.length; i++) {
|
||||||
|
if (this._grabStack[i].actor === actor)
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
},
|
||||||
|
|
||||||
|
isActorGrabbed: function(actor) {
|
||||||
|
return this._findStackIndex(actor) >= 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
// grab:
|
||||||
|
// @params: A bunch of parameters, see below
|
||||||
|
//
|
||||||
|
// Grabs the mouse and keyboard, according to the GrabHelper's
|
||||||
|
// parameters. If @newFocus is not %null, then the keyboard focus
|
||||||
|
// is moved to the first #StWidget:can-focus widget inside it.
|
||||||
|
//
|
||||||
|
// The grab will automatically be dropped if:
|
||||||
|
// - The user clicks outside the grabbed actors
|
||||||
|
// - The user types Escape
|
||||||
|
// - The keyboard focus is moved outside the grabbed actors
|
||||||
|
// - A window is focused
|
||||||
|
//
|
||||||
|
// If @params.actor is not null, then it will be focused as the
|
||||||
|
// new actor. If you attempt to grab an already focused actor, the
|
||||||
|
// request to be focused will be ignored. The actor will not be
|
||||||
|
// added to the grab stack, so do not call a paired ungrab().
|
||||||
|
//
|
||||||
|
// If @params contains { modal: true }, then grab() will push a modal
|
||||||
|
// on the owner of the GrabHelper. As long as there is at least one
|
||||||
|
// { modal: true } actor on the grab stack, the grab will be kept.
|
||||||
|
// When the last { modal: true } actor is ungrabbed, then the modal
|
||||||
|
// will be dropped. A modal grab can fail if there is already a grab
|
||||||
|
// in effect from aother application; in this case the function returns
|
||||||
|
// false and nothing happens. Non-modal grabs can never fail.
|
||||||
|
//
|
||||||
|
// If @params contains { grabFocus: true }, then if you call grab()
|
||||||
|
// while the shell is outside the overview, it will set the stage
|
||||||
|
// input mode to %Shell.StageInputMode.FOCUSED, and ungrab() will
|
||||||
|
// revert it back, and re-focus the previously-focused window (if
|
||||||
|
// another window hasn't been explicitly focused before then).
|
||||||
|
grab: function(params) {
|
||||||
|
params = Params.parse(params, { actor: null,
|
||||||
|
modal: false,
|
||||||
|
grabFocus: false,
|
||||||
|
onUngrab: null });
|
||||||
|
|
||||||
|
let focus = global.stage.key_focus;
|
||||||
|
let hadFocus = focus && this._isWithinGrabbedActor(focus);
|
||||||
|
let newFocus = params.actor;
|
||||||
|
|
||||||
|
if (this.isActorGrabbed(params.actor))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
params.savedFocus = focus;
|
||||||
|
|
||||||
|
if (params.modal && !this._takeModalGrab())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (params.grabFocus && !this._takeFocusGrab(hadFocus))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (hadFocus || params.grabFocus)
|
||||||
|
_navigateActor(newFocus);
|
||||||
|
|
||||||
|
this._grabStack.push(params);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
_takeModalGrab: function() {
|
||||||
|
let firstGrab = (this._modalCount == 0);
|
||||||
|
if (firstGrab) {
|
||||||
|
if (!Main.pushModal(this._owner))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
this._capturedEventId = global.stage.connect('captured-event', Lang.bind(this, this._onCapturedEvent));
|
||||||
|
this._eventId = global.stage.connect('event', Lang.bind(this, this._onEvent));
|
||||||
|
}
|
||||||
|
|
||||||
|
this._modalCount++;
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
_releaseModalGrab: function() {
|
||||||
|
this._modalCount--;
|
||||||
|
if (this._modalCount > 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (this._capturedEventId > 0) {
|
||||||
|
global.stage.disconnect(this._capturedEventId);
|
||||||
|
this._capturedEventId = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._eventId > 0) {
|
||||||
|
global.stage.disconnect(this._eventId);
|
||||||
|
this._eventId = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Main.popModal(this._owner);
|
||||||
|
global.sync_pointer();
|
||||||
|
},
|
||||||
|
|
||||||
|
_takeFocusGrab: function(hadFocus) {
|
||||||
|
let firstGrab = (this._grabFocusCount == 0);
|
||||||
|
if (firstGrab) {
|
||||||
|
let metaDisplay = global.screen.get_display();
|
||||||
|
|
||||||
|
this._grabbedFromKeynav = hadFocus;
|
||||||
|
this._preGrabInputMode = global.stage_input_mode;
|
||||||
|
this._prevFocusedWindow = metaDisplay.focus_window;
|
||||||
|
|
||||||
|
if (this._preGrabInputMode == Shell.StageInputMode.NONREACTIVE ||
|
||||||
|
this._preGrabInputMode == Shell.StageInputMode.NORMAL) {
|
||||||
|
global.set_stage_input_mode(Shell.StageInputMode.FOCUSED);
|
||||||
|
}
|
||||||
|
|
||||||
|
this._keyFocusNotifyId = global.stage.connect('notify::key-focus', Lang.bind(this, this._onKeyFocusChanged));
|
||||||
|
this._focusWindowChangedId = metaDisplay.connect('notify::focus-window', Lang.bind(this, this._focusWindowChanged));
|
||||||
|
}
|
||||||
|
|
||||||
|
this._grabFocusCount++;
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
_releaseFocusGrab: function() {
|
||||||
|
this._grabFocusCount--;
|
||||||
|
if (this._grabFocusCount > 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (this._keyFocusNotifyId > 0) {
|
||||||
|
global.stage.disconnect(this._keyFocusNotifyId);
|
||||||
|
this._keyFocusNotifyId = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this._focusWindowChanged > 0) {
|
||||||
|
let metaDisplay = global.screen.get_display();
|
||||||
|
metaDisplay.disconnect(this._focusWindowChangedId);
|
||||||
|
this._focusWindowChangedId = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
let prePopInputMode = global.stage_input_mode;
|
||||||
|
|
||||||
|
if (this._grabbedFromKeynav) {
|
||||||
|
if (this._preGrabInputMode == Shell.StageInputMode.FOCUSED &&
|
||||||
|
prePopInputMode != Shell.StageInputMode.FULLSCREEN)
|
||||||
|
global.set_stage_input_mode(Shell.StageInputMode.FOCUSED);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._prevFocusedWindow) {
|
||||||
|
let metaDisplay = global.screen.get_display();
|
||||||
|
if (!metaDisplay.focus_window) {
|
||||||
|
metaDisplay.set_input_focus_window(this._prevFocusedWindow,
|
||||||
|
false, global.get_current_time());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// ignoreRelease:
|
||||||
|
//
|
||||||
|
// Make sure that the next button release event evaluated by the
|
||||||
|
// capture event handler returns false. This is designed for things
|
||||||
|
// like the ComboBoxMenu that go away on press, but need to eat
|
||||||
|
// the next release event.
|
||||||
|
ignoreRelease: function() {
|
||||||
|
this._ignoreRelease = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
// ungrab:
|
||||||
|
// @params: The parameters for the grab; see below.
|
||||||
|
//
|
||||||
|
// Pops an actor from the grab stack, potentially dropping the grab.
|
||||||
|
//
|
||||||
|
// If the actor that was popped from the grab stack was not the actor
|
||||||
|
// That was passed in, this call is ignored.
|
||||||
|
ungrab: function(params) {
|
||||||
|
params = Params.parse(params, { actor: this.currentGrab.actor });
|
||||||
|
|
||||||
|
let grabStackIndex = this._findStackIndex(params.actor);
|
||||||
|
if (grabStackIndex < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
let focus = global.stage.key_focus;
|
||||||
|
let hadFocus = focus && this._isWithinGrabbedActor(focus);
|
||||||
|
|
||||||
|
let poppedGrabs = this._grabStack.slice(grabStackIndex);
|
||||||
|
// "Pop" all newly ungrabbed actors off the grab stack
|
||||||
|
// by truncating the array.
|
||||||
|
this._grabStack.length = grabStackIndex;
|
||||||
|
|
||||||
|
for (let i = poppedGrabs.length - 1; i >= 0; i--) {
|
||||||
|
let poppedGrab = poppedGrabs[i];
|
||||||
|
|
||||||
|
if (poppedGrab.onUngrab)
|
||||||
|
poppedGrab.onUngrab();
|
||||||
|
|
||||||
|
if (poppedGrab.modal)
|
||||||
|
this._releaseModalGrab();
|
||||||
|
|
||||||
|
if (poppedGrab.grabFocus)
|
||||||
|
this._releaseFocusGrab();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hadFocus) {
|
||||||
|
let poppedGrab = poppedGrabs[0];
|
||||||
|
_navigateActor(poppedGrab.savedFocus);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_onCapturedEvent: function(actor, event) {
|
||||||
|
let type = event.type();
|
||||||
|
let press = type == Clutter.EventType.BUTTON_PRESS;
|
||||||
|
let release = type == Clutter.EventType.BUTTON_RELEASE;
|
||||||
|
let button = press || release;
|
||||||
|
|
||||||
|
if (release && this._ignoreRelease) {
|
||||||
|
this._ignoreRelease = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!button && this._modalCount == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (this._isWithinGrabbedActor(event.get_source()))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (Main.keyboard.shouldTakeEvent(event))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (button) {
|
||||||
|
// If we have a press event, ignore the next event,
|
||||||
|
// which should be a release event.
|
||||||
|
if (press)
|
||||||
|
this._ignoreRelease = true;
|
||||||
|
this.ungrab({ actor: this._grabStack[0].actor });
|
||||||
|
}
|
||||||
|
|
||||||
|
return this._modalCount > 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
// We catch 'event' rather than 'key-press-event' so that we get
|
||||||
|
// a chance to run before the overview's own Escape check
|
||||||
|
_onEvent: function(actor, event) {
|
||||||
|
if (event.type() == Clutter.EventType.KEY_PRESS &&
|
||||||
|
event.get_key_symbol() == Clutter.KEY_Escape) {
|
||||||
|
this.ungrab();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
_onKeyFocusChanged: function() {
|
||||||
|
let focus = global.stage.key_focus;
|
||||||
|
if (!focus || !this._isWithinGrabbedActor(focus))
|
||||||
|
this.ungrab();
|
||||||
|
},
|
||||||
|
|
||||||
|
_focusWindowChanged: function() {
|
||||||
|
let metaDisplay = global.screen.get_display();
|
||||||
|
if (metaDisplay.focus_window != null)
|
||||||
|
this.ungrab();
|
||||||
|
}
|
||||||
|
});
|
228
js/ui/ibusCandidatePopup.js
Normal file
@ -0,0 +1,228 @@
|
|||||||
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
|
const Clutter = imports.gi.Clutter;
|
||||||
|
const IBus = imports.gi.IBus;
|
||||||
|
const Lang = imports.lang;
|
||||||
|
const St = imports.gi.St;
|
||||||
|
|
||||||
|
const BoxPointer = imports.ui.boxpointer;
|
||||||
|
const Main = imports.ui.main;
|
||||||
|
const PopupMenu = imports.ui.popupMenu;
|
||||||
|
|
||||||
|
const MAX_CANDIDATES_PER_PAGE = 16;
|
||||||
|
|
||||||
|
const CandidateArea = new Lang.Class({
|
||||||
|
Name: 'CandidateArea',
|
||||||
|
Extends: PopupMenu.PopupBaseMenuItem,
|
||||||
|
|
||||||
|
_init: function() {
|
||||||
|
this.parent({ reactive: false });
|
||||||
|
|
||||||
|
// St.Table exhibits some sizing problems so let's go with a
|
||||||
|
// clutter layout manager for now.
|
||||||
|
this._table = new Clutter.Actor();
|
||||||
|
this.addActor(this._table);
|
||||||
|
|
||||||
|
this._tableLayout = new Clutter.TableLayout();
|
||||||
|
this._table.set_layout_manager(this._tableLayout);
|
||||||
|
|
||||||
|
this._indexLabels = [];
|
||||||
|
this._candidateLabels = [];
|
||||||
|
for (let i = 0; i < MAX_CANDIDATES_PER_PAGE; ++i) {
|
||||||
|
this._indexLabels.push(new St.Label({ style_class: 'candidate-index' }));
|
||||||
|
this._candidateLabels.push(new St.Label({ style_class: 'candidate-label' }));
|
||||||
|
}
|
||||||
|
|
||||||
|
this._orientation = -1;
|
||||||
|
this._cursorPosition = 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
_setOrientation: function(orientation) {
|
||||||
|
if (this._orientation == orientation)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this._orientation = orientation;
|
||||||
|
|
||||||
|
this._table.remove_all_children();
|
||||||
|
|
||||||
|
if (this._orientation == IBus.Orientation.HORIZONTAL)
|
||||||
|
for (let i = 0; i < MAX_CANDIDATES_PER_PAGE; ++i) {
|
||||||
|
this._tableLayout.pack(this._indexLabels[i], i*2, 0);
|
||||||
|
this._tableLayout.pack(this._candidateLabels[i], i*2 + 1, 0);
|
||||||
|
}
|
||||||
|
else // VERTICAL || SYSTEM
|
||||||
|
for (let i = 0; i < MAX_CANDIDATES_PER_PAGE; ++i) {
|
||||||
|
this._tableLayout.pack(this._indexLabels[i], 0, i);
|
||||||
|
this._tableLayout.pack(this._candidateLabels[i], 1, i);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
setCandidates: function(indexes, candidates, orientation, cursorPosition, cursorVisible) {
|
||||||
|
this._setOrientation(orientation);
|
||||||
|
|
||||||
|
for (let i = 0; i < MAX_CANDIDATES_PER_PAGE; ++i) {
|
||||||
|
let visible = i < candidates.length;
|
||||||
|
this._indexLabels[i].visible = visible;
|
||||||
|
this._candidateLabels[i].visible = visible;
|
||||||
|
|
||||||
|
if (!visible)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
this._indexLabels[i].text = ((indexes && indexes[i]) ? indexes[i] : '%x.'.format(i + 1));
|
||||||
|
this._candidateLabels[i].text = candidates[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
this._candidateLabels[this._cursorPosition].remove_style_pseudo_class('selected');
|
||||||
|
this._cursorPosition = cursorPosition;
|
||||||
|
if (cursorVisible)
|
||||||
|
this._candidateLabels[cursorPosition].add_style_pseudo_class('selected');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const CandidatePopup = new Lang.Class({
|
||||||
|
Name: 'CandidatePopup',
|
||||||
|
Extends: PopupMenu.PopupMenu,
|
||||||
|
|
||||||
|
_init: function() {
|
||||||
|
this._cursor = new St.Bin({ opacity: 0 });
|
||||||
|
Main.uiGroup.add_actor(this._cursor);
|
||||||
|
|
||||||
|
this.parent(this._cursor, 0, St.Side.TOP);
|
||||||
|
this.actor.hide();
|
||||||
|
Main.uiGroup.add_actor(this.actor);
|
||||||
|
|
||||||
|
this._preeditTextItem = new PopupMenu.PopupMenuItem('', { reactive: false });
|
||||||
|
this._preeditTextItem.actor.hide();
|
||||||
|
this.addMenuItem(this._preeditTextItem);
|
||||||
|
|
||||||
|
this._auxTextItem = new PopupMenu.PopupMenuItem('', { reactive: false });
|
||||||
|
this._auxTextItem.actor.hide();
|
||||||
|
this.addMenuItem(this._auxTextItem);
|
||||||
|
|
||||||
|
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
|
||||||
|
|
||||||
|
this._lookupTableItem = new CandidateArea();
|
||||||
|
this._lookupTableItem.actor.hide();
|
||||||
|
this.addMenuItem(this._lookupTableItem);
|
||||||
|
|
||||||
|
this._panelService = null;
|
||||||
|
},
|
||||||
|
|
||||||
|
setPanelService: function(panelService) {
|
||||||
|
this._panelService = panelService;
|
||||||
|
if (!panelService)
|
||||||
|
return;
|
||||||
|
|
||||||
|
panelService.connect('set-cursor-location',
|
||||||
|
Lang.bind(this, function(ps, x, y, w, h) {
|
||||||
|
this._cursor.set_position(x, y);
|
||||||
|
this._cursor.set_size(w, h);
|
||||||
|
}));
|
||||||
|
panelService.connect('update-preedit-text',
|
||||||
|
Lang.bind(this, function(ps, text, cursorPosition, visible) {
|
||||||
|
if (visible)
|
||||||
|
this._preeditTextItem.actor.show();
|
||||||
|
else
|
||||||
|
this._preeditTextItem.actor.hide();
|
||||||
|
this._updateVisibility();
|
||||||
|
|
||||||
|
this._preeditTextItem.actor.label_actor.text = text.get_text();
|
||||||
|
|
||||||
|
let attrs = text.get_attributes();
|
||||||
|
if (attrs)
|
||||||
|
this._setTextAttributes(this._preeditTextItem.actor.label_actor.clutter_text,
|
||||||
|
attrs);
|
||||||
|
}));
|
||||||
|
panelService.connect('show-preedit-text',
|
||||||
|
Lang.bind(this, function(ps) {
|
||||||
|
this._preeditTextItem.actor.show();
|
||||||
|
this._updateVisibility();
|
||||||
|
}));
|
||||||
|
panelService.connect('hide-preedit-text',
|
||||||
|
Lang.bind(this, function(ps) {
|
||||||
|
this._preeditTextItem.actor.hide();
|
||||||
|
this._updateVisibility();
|
||||||
|
}));
|
||||||
|
panelService.connect('update-auxiliary-text',
|
||||||
|
Lang.bind(this, function(ps, text, visible) {
|
||||||
|
if (visible)
|
||||||
|
this._auxTextItem.actor.show();
|
||||||
|
else
|
||||||
|
this._auxTextItem.actor.hide();
|
||||||
|
this._updateVisibility();
|
||||||
|
|
||||||
|
this._auxTextItem.actor.label_actor.text = text.get_text();
|
||||||
|
}));
|
||||||
|
panelService.connect('show-auxiliary-text',
|
||||||
|
Lang.bind(this, function(ps) {
|
||||||
|
this._auxTextItem.actor.show();
|
||||||
|
this._updateVisibility();
|
||||||
|
}));
|
||||||
|
panelService.connect('hide-auxiliary-text',
|
||||||
|
Lang.bind(this, function(ps) {
|
||||||
|
this._auxTextItem.actor.hide();
|
||||||
|
this._updateVisibility();
|
||||||
|
}));
|
||||||
|
panelService.connect('update-lookup-table',
|
||||||
|
Lang.bind(this, function(ps, lookupTable, visible) {
|
||||||
|
if (visible)
|
||||||
|
this._lookupTableItem.actor.show();
|
||||||
|
else
|
||||||
|
this._lookupTableItem.actor.hide();
|
||||||
|
this._updateVisibility();
|
||||||
|
|
||||||
|
let cursorPos = lookupTable.get_cursor_pos();
|
||||||
|
let pageSize = lookupTable.get_page_size();
|
||||||
|
let page = ((cursorPos == 0) ? 0 : Math.floor(cursorPos / pageSize));
|
||||||
|
let startIndex = page * pageSize;
|
||||||
|
let endIndex = Math.min((page + 1) * pageSize,
|
||||||
|
lookupTable.get_number_of_candidates());
|
||||||
|
let indexes = [];
|
||||||
|
let indexLabel;
|
||||||
|
for (let i = 0; indexLabel = lookupTable.get_label(i); ++i)
|
||||||
|
indexes.push(indexLabel.get_text());
|
||||||
|
|
||||||
|
let candidates = [];
|
||||||
|
for (let i = startIndex; i < endIndex; ++i)
|
||||||
|
candidates.push(lookupTable.get_candidate(i).get_text());
|
||||||
|
|
||||||
|
this._lookupTableItem.setCandidates(indexes,
|
||||||
|
candidates,
|
||||||
|
lookupTable.get_orientation(),
|
||||||
|
cursorPos % pageSize,
|
||||||
|
lookupTable.is_cursor_visible());
|
||||||
|
}));
|
||||||
|
panelService.connect('show-lookup-table',
|
||||||
|
Lang.bind(this, function(ps) {
|
||||||
|
this._lookupTableItem.actor.show();
|
||||||
|
this._updateVisibility();
|
||||||
|
}));
|
||||||
|
panelService.connect('hide-lookup-table',
|
||||||
|
Lang.bind(this, function(ps) {
|
||||||
|
this._lookupTableItem.actor.hide();
|
||||||
|
this._updateVisibility();
|
||||||
|
}));
|
||||||
|
panelService.connect('focus-out',
|
||||||
|
Lang.bind(this, function(ps) {
|
||||||
|
this.close(BoxPointer.PopupAnimation.NONE);
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
|
||||||
|
_updateVisibility: function() {
|
||||||
|
let isVisible = (this._preeditTextItem.actor.visible ||
|
||||||
|
this._auxTextItem.actor.visible ||
|
||||||
|
this._lookupTableItem.actor.visible);
|
||||||
|
|
||||||
|
if (isVisible)
|
||||||
|
this.open(BoxPointer.PopupAnimation.NONE);
|
||||||
|
else
|
||||||
|
this.close(BoxPointer.PopupAnimation.NONE);
|
||||||
|
},
|
||||||
|
|
||||||
|
_setTextAttributes: function(clutterText, ibusAttrList) {
|
||||||
|
let attr;
|
||||||
|
for (let i = 0; attr = ibusAttrList.get(i); ++i)
|
||||||
|
if (attr.get_attr_type() == IBus.AttrType.BACKGROUND)
|
||||||
|
clutterText.set_selection(attr.get_start_index(), attr.get_end_index());
|
||||||
|
}
|
||||||
|
});
|
@ -1,4 +1,4 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const Clutter = imports.gi.Clutter;
|
const Clutter = imports.gi.Clutter;
|
||||||
const Shell = imports.gi.Shell;
|
const Shell = imports.gi.Shell;
|
||||||
@ -10,11 +10,9 @@ const Params = imports.misc.params;
|
|||||||
const ICON_SIZE = 48;
|
const ICON_SIZE = 48;
|
||||||
|
|
||||||
|
|
||||||
function BaseIcon(label, createIcon) {
|
const BaseIcon = new Lang.Class({
|
||||||
this._init(label, createIcon);
|
Name: 'BaseIcon',
|
||||||
}
|
|
||||||
|
|
||||||
BaseIcon.prototype = {
|
|
||||||
_init : function(label, params) {
|
_init : function(label, params) {
|
||||||
params = Params.parse(params, { createIcon: null,
|
params = Params.parse(params, { createIcon: null,
|
||||||
setSizeManually: false,
|
setSizeManually: false,
|
||||||
@ -37,7 +35,8 @@ BaseIcon.prototype = {
|
|||||||
this.actor.set_child(box);
|
this.actor.set_child(box);
|
||||||
|
|
||||||
this.iconSize = ICON_SIZE;
|
this.iconSize = ICON_SIZE;
|
||||||
this._iconBin = new St.Bin();
|
this._iconBin = new St.Bin({ x_align: St.Align.MIDDLE,
|
||||||
|
y_align: St.Align.MIDDLE });
|
||||||
|
|
||||||
box.add_actor(this._iconBin);
|
box.add_actor(this._iconBin);
|
||||||
|
|
||||||
@ -127,12 +126,12 @@ BaseIcon.prototype = {
|
|||||||
this.iconSize = size;
|
this.iconSize = size;
|
||||||
this.icon = this.createIcon(this.iconSize);
|
this.icon = this.createIcon(this.iconSize);
|
||||||
|
|
||||||
|
this._iconBin.child = this.icon;
|
||||||
|
|
||||||
// The icon returned by createIcon() might actually be smaller than
|
// The icon returned by createIcon() might actually be smaller than
|
||||||
// the requested icon size (for instance StTextureCache does this
|
// the requested icon size (for instance StTextureCache does this
|
||||||
// for fallback icons), so set the size explicitly.
|
// for fallback icons), so set the size explicitly.
|
||||||
this.icon.set_size(this.iconSize, this.iconSize);
|
this._iconBin.set_size(this.iconSize, this.iconSize);
|
||||||
|
|
||||||
this._iconBin.child = this.icon;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_onStyleChanged: function() {
|
_onStyleChanged: function() {
|
||||||
@ -149,13 +148,11 @@ BaseIcon.prototype = {
|
|||||||
|
|
||||||
this._createIconTexture(size);
|
this._createIconTexture(size);
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
function IconGrid(params) {
|
const IconGrid = new Lang.Class({
|
||||||
this._init(params);
|
Name: 'IconGrid',
|
||||||
}
|
|
||||||
|
|
||||||
IconGrid.prototype = {
|
|
||||||
_init: function(params) {
|
_init: function(params) {
|
||||||
params = Params.parse(params, { rowLimit: null,
|
params = Params.parse(params, { rowLimit: null,
|
||||||
columnLimit: null,
|
columnLimit: null,
|
||||||
@ -168,7 +165,7 @@ IconGrid.prototype = {
|
|||||||
vertical: true });
|
vertical: true });
|
||||||
// Pulled from CSS, but hardcode some defaults here
|
// Pulled from CSS, but hardcode some defaults here
|
||||||
this._spacing = 0;
|
this._spacing = 0;
|
||||||
this._item_size = ICON_SIZE;
|
this._hItemSize = this._vItemSize = ICON_SIZE;
|
||||||
this._grid = new Shell.GenericContainer();
|
this._grid = new Shell.GenericContainer();
|
||||||
this.actor.add(this._grid, { expand: true, y_align: St.Align.START });
|
this.actor.add(this._grid, { expand: true, y_align: St.Align.START });
|
||||||
this.actor.connect('style-changed', Lang.bind(this, this._onStyleChanged));
|
this.actor.connect('style-changed', Lang.bind(this, this._onStyleChanged));
|
||||||
@ -187,8 +184,8 @@ IconGrid.prototype = {
|
|||||||
// Kind of a lie, but not really an issue right now. If
|
// Kind of a lie, but not really an issue right now. If
|
||||||
// we wanted to support some sort of hidden/overflow that would
|
// we wanted to support some sort of hidden/overflow that would
|
||||||
// need higher level design
|
// need higher level design
|
||||||
alloc.min_size = this._item_size;
|
alloc.min_size = this._hItemSize;
|
||||||
alloc.natural_size = nColumns * this._item_size + totalSpacing;
|
alloc.natural_size = nColumns * this._hItemSize + totalSpacing;
|
||||||
},
|
},
|
||||||
|
|
||||||
_getVisibleChildren: function() {
|
_getVisibleChildren: function() {
|
||||||
@ -210,7 +207,7 @@ IconGrid.prototype = {
|
|||||||
if (this._rowLimit)
|
if (this._rowLimit)
|
||||||
nRows = Math.min(nRows, this._rowLimit);
|
nRows = Math.min(nRows, this._rowLimit);
|
||||||
let totalSpacing = Math.max(0, nRows - 1) * this._spacing;
|
let totalSpacing = Math.max(0, nRows - 1) * this._spacing;
|
||||||
let height = nRows * this._item_size + totalSpacing;
|
let height = nRows * this._vItemSize + totalSpacing;
|
||||||
alloc.min_size = height;
|
alloc.min_size = height;
|
||||||
alloc.natural_size = height;
|
alloc.natural_size = height;
|
||||||
},
|
},
|
||||||
@ -243,13 +240,13 @@ IconGrid.prototype = {
|
|||||||
= children[i].get_preferred_size();
|
= children[i].get_preferred_size();
|
||||||
|
|
||||||
/* Center the item in its allocation horizontally */
|
/* Center the item in its allocation horizontally */
|
||||||
let width = Math.min(this._item_size, childNaturalWidth);
|
let width = Math.min(this._hItemSize, childNaturalWidth);
|
||||||
let childXSpacing = Math.max(0, width - childNaturalWidth) / 2;
|
let childXSpacing = Math.max(0, width - childNaturalWidth) / 2;
|
||||||
let height = Math.min(this._item_size, childNaturalHeight);
|
let height = Math.min(this._vItemSize, childNaturalHeight);
|
||||||
let childYSpacing = Math.max(0, height - childNaturalHeight) / 2;
|
let childYSpacing = Math.max(0, height - childNaturalHeight) / 2;
|
||||||
|
|
||||||
let childBox = new Clutter.ActorBox();
|
let childBox = new Clutter.ActorBox();
|
||||||
if (St.Widget.get_default_direction() == St.TextDirection.RTL) {
|
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) {
|
||||||
let _x = box.x2 - (x + width);
|
let _x = box.x2 - (x + width);
|
||||||
childBox.x1 = Math.floor(_x - childXSpacing);
|
childBox.x1 = Math.floor(_x - childXSpacing);
|
||||||
} else {
|
} else {
|
||||||
@ -273,10 +270,10 @@ IconGrid.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (columnIndex == 0) {
|
if (columnIndex == 0) {
|
||||||
y += this._item_size + this._spacing;
|
y += this._vItemSize + this._spacing;
|
||||||
x = box.x1 + leftPadding;
|
x = box.x1 + leftPadding;
|
||||||
} else {
|
} else {
|
||||||
x += this._item_size + this._spacing;
|
x += this._hItemSize + this._spacing;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -285,12 +282,16 @@ IconGrid.prototype = {
|
|||||||
return this._computeLayout(rowWidth)[0];
|
return this._computeLayout(rowWidth)[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getRowLimit: function() {
|
||||||
|
return this._rowLimit;
|
||||||
|
},
|
||||||
|
|
||||||
_computeLayout: function (forWidth) {
|
_computeLayout: function (forWidth) {
|
||||||
let nColumns = 0;
|
let nColumns = 0;
|
||||||
let usedWidth = 0;
|
let usedWidth = 0;
|
||||||
while ((this._colLimit == null || nColumns < this._colLimit) &&
|
while ((this._colLimit == null || nColumns < this._colLimit) &&
|
||||||
(usedWidth + this._item_size <= forWidth)) {
|
(usedWidth + this._hItemSize <= forWidth)) {
|
||||||
usedWidth += this._item_size + this._spacing;
|
usedWidth += this._hItemSize + this._spacing;
|
||||||
nColumns += 1;
|
nColumns += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -303,25 +304,27 @@ IconGrid.prototype = {
|
|||||||
_onStyleChanged: function() {
|
_onStyleChanged: function() {
|
||||||
let themeNode = this.actor.get_theme_node();
|
let themeNode = this.actor.get_theme_node();
|
||||||
this._spacing = themeNode.get_length('spacing');
|
this._spacing = themeNode.get_length('spacing');
|
||||||
this._item_size = themeNode.get_length('-shell-grid-item-size');
|
this._hItemSize = themeNode.get_length('-shell-grid-horizontal-item-size') || ICON_SIZE;
|
||||||
|
this._vItemSize = themeNode.get_length('-shell-grid-vertical-item-size') || ICON_SIZE;
|
||||||
this._grid.queue_relayout();
|
this._grid.queue_relayout();
|
||||||
},
|
},
|
||||||
|
|
||||||
removeAll: function () {
|
removeAll: function() {
|
||||||
this._grid.get_children().forEach(Lang.bind(this, function (child) {
|
this._grid.destroy_all_children();
|
||||||
child.destroy();
|
|
||||||
}));
|
|
||||||
},
|
},
|
||||||
|
|
||||||
addItem: function(actor) {
|
addItem: function(actor, index) {
|
||||||
this._grid.add_actor(actor);
|
if (index !== undefined)
|
||||||
|
this._grid.insert_child_at_index(actor, index);
|
||||||
|
else
|
||||||
|
this._grid.add_actor(actor);
|
||||||
},
|
},
|
||||||
|
|
||||||
getItemAtIndex: function(index) {
|
getItemAtIndex: function(index) {
|
||||||
return this._grid.get_children()[index];
|
return this._grid.get_child_at_index(index);
|
||||||
},
|
},
|
||||||
|
|
||||||
visibleItemsCount: function() {
|
visibleItemsCount: function() {
|
||||||
return this._grid.get_children().length - this._grid.get_n_skip_paint();
|
return this._grid.get_n_children() - this._grid.get_n_skip_paint();
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const Caribou = imports.gi.Caribou;
|
const Caribou = imports.gi.Caribou;
|
||||||
const Clutter = imports.gi.Clutter;
|
const Clutter = imports.gi.Clutter;
|
||||||
@ -20,53 +20,31 @@ const KEYBOARD_TYPE = 'keyboard-type';
|
|||||||
const A11Y_APPLICATIONS_SCHEMA = 'org.gnome.desktop.a11y.applications';
|
const A11Y_APPLICATIONS_SCHEMA = 'org.gnome.desktop.a11y.applications';
|
||||||
const SHOW_KEYBOARD = 'screen-keyboard-enabled';
|
const SHOW_KEYBOARD = 'screen-keyboard-enabled';
|
||||||
|
|
||||||
// Key constants taken from Antler
|
const CaribouKeyboardIface = <interface name='org.gnome.Caribou.Keyboard'>
|
||||||
// FIXME: ought to be moved into libcaribou
|
<method name='Show'>
|
||||||
const PRETTY_KEYS = {
|
<arg type='u' direction='in' />
|
||||||
'BackSpace': '\u232b',
|
</method>
|
||||||
'space': ' ',
|
<method name='Hide'>
|
||||||
'Return': '\u23ce',
|
<arg type='u' direction='in' />
|
||||||
'Caribou_Prefs': '\u2328',
|
</method>
|
||||||
'Caribou_ShiftUp': '\u2b06',
|
<method name='SetCursorLocation'>
|
||||||
'Caribou_ShiftDown': '\u2b07',
|
<arg type='i' direction='in' />
|
||||||
'Caribou_Emoticons': '\u263a',
|
<arg type='i' direction='in' />
|
||||||
'Caribou_Symbols': '123',
|
<arg type='i' direction='in' />
|
||||||
'Caribou_Symbols_More': '{#*',
|
<arg type='i' direction='in' />
|
||||||
'Caribou_Alpha': 'Abc',
|
</method>
|
||||||
'Tab': 'Tab',
|
<method name='SetEntryLocation'>
|
||||||
'Escape': 'Esc',
|
<arg type='i' direction='in' />
|
||||||
'Control_L': 'Ctrl',
|
<arg type='i' direction='in' />
|
||||||
'Alt_L': 'Alt'
|
<arg type='i' direction='in' />
|
||||||
};
|
<arg type='i' direction='in' />
|
||||||
|
</method>
|
||||||
|
<property name='Name' access='read' type='s' />
|
||||||
|
</interface>;
|
||||||
|
|
||||||
const CaribouKeyboardIface = {
|
const Key = new Lang.Class({
|
||||||
name: 'org.gnome.Caribou.Keyboard',
|
Name: 'Key',
|
||||||
methods: [ { name: 'Show',
|
|
||||||
inSignature: 'u',
|
|
||||||
outSignature: ''
|
|
||||||
},
|
|
||||||
{ name: 'Hide',
|
|
||||||
inSignature: 'u',
|
|
||||||
outSignature: ''
|
|
||||||
},
|
|
||||||
{ name: 'SetCursorLocation',
|
|
||||||
inSignature: 'iiii',
|
|
||||||
outSignature: ''
|
|
||||||
},
|
|
||||||
{ name: 'SetEntryLocation',
|
|
||||||
inSignature: 'iiii',
|
|
||||||
outSignature: ''
|
|
||||||
} ],
|
|
||||||
properties: [ { name: 'Name',
|
|
||||||
signature: 's',
|
|
||||||
access: 'read' } ]
|
|
||||||
};
|
|
||||||
|
|
||||||
function Key() {
|
|
||||||
this._init.apply(this, arguments);
|
|
||||||
}
|
|
||||||
|
|
||||||
Key.prototype = {
|
|
||||||
_init : function(key) {
|
_init : function(key) {
|
||||||
this._key = key;
|
this._key = key;
|
||||||
|
|
||||||
@ -75,7 +53,7 @@ Key.prototype = {
|
|||||||
this._extended_keys = this._key.get_extended_keys();
|
this._extended_keys = this._key.get_extended_keys();
|
||||||
this._extended_keyboard = null;
|
this._extended_keyboard = null;
|
||||||
|
|
||||||
if (this._key.name == "Control_L" || this._key.name == "Alt_L")
|
if (this._key.name == 'Control_L' || this._key.name == 'Alt_L')
|
||||||
this._key.latch = true;
|
this._key.latch = true;
|
||||||
|
|
||||||
this._key.connect('key-pressed', Lang.bind(this, function ()
|
this._key.connect('key-pressed', Lang.bind(this, function ()
|
||||||
@ -96,22 +74,12 @@ Key.prototype = {
|
|||||||
this._getExtendedKeys();
|
this._getExtendedKeys();
|
||||||
this.actor._extended_keys = this._extended_keyboard;
|
this.actor._extended_keys = this._extended_keyboard;
|
||||||
this._boxPointer.actor.hide();
|
this._boxPointer.actor.hide();
|
||||||
Main.layoutManager.addChrome(this._boxPointer.actor, { visibleInFullscreen: true });
|
Main.layoutManager.addChrome(this._boxPointer.actor);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_makeKey: function () {
|
_makeKey: function () {
|
||||||
let label = this._key.name;
|
let label = GLib.markup_escape_text(this._key.label, -1);
|
||||||
|
|
||||||
if (label.length > 1) {
|
|
||||||
let pretty = PRETTY_KEYS[label];
|
|
||||||
if (pretty)
|
|
||||||
label = pretty;
|
|
||||||
else
|
|
||||||
label = this._getUnichar(this._key);
|
|
||||||
}
|
|
||||||
|
|
||||||
label = GLib.markup_escape_text(label, -1);
|
|
||||||
let button = new St.Button ({ label: label,
|
let button = new St.Button ({ label: label,
|
||||||
style_class: 'keyboard-key' });
|
style_class: 'keyboard-key' });
|
||||||
|
|
||||||
@ -178,7 +146,7 @@ Key.prototype = {
|
|||||||
this.actor.fake_release();
|
this.actor.fake_release();
|
||||||
this._boxPointer.actor.raise_top();
|
this._boxPointer.actor.raise_top();
|
||||||
this._boxPointer.setPosition(this.actor, 0.5);
|
this._boxPointer.setPosition(this.actor, 0.5);
|
||||||
this._boxPointer.show(true);
|
this._boxPointer.show(BoxPointer.PopupAnimation.FULL);
|
||||||
this.actor.set_hover(false);
|
this.actor.set_hover(false);
|
||||||
if (!this._grabbed) {
|
if (!this._grabbed) {
|
||||||
Main.pushModal(this.actor);
|
Main.pushModal(this.actor);
|
||||||
@ -189,22 +157,24 @@ Key.prototype = {
|
|||||||
} else {
|
} else {
|
||||||
if (this._grabbed)
|
if (this._grabbed)
|
||||||
this._ungrab();
|
this._ungrab();
|
||||||
this._boxPointer.hide(true);
|
this._boxPointer.hide(BoxPointer.PopupAnimation.FULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
function Keyboard() {
|
const Keyboard = new Lang.Class({
|
||||||
this._init.apply(this, arguments);
|
// HACK: we can't set Name, because it collides with Name dbus property
|
||||||
}
|
// Name: 'Keyboard',
|
||||||
|
|
||||||
Keyboard.prototype = {
|
|
||||||
_init: function () {
|
_init: function () {
|
||||||
DBus.session.exportObject('/org/gnome/Caribou/Keyboard', this);
|
this._impl = Gio.DBusExportedObject.wrapJSObject(CaribouKeyboardIface, this);
|
||||||
|
this._impl.export(Gio.DBus.session, '/org/gnome/Caribou/Keyboard');
|
||||||
|
|
||||||
this.actor = null;
|
this.actor = null;
|
||||||
|
this._focusInTray = false;
|
||||||
|
this._focusInExtendedKeys = false;
|
||||||
|
|
||||||
this._timestamp = global.get_current_time();
|
this._timestamp = global.display.get_current_time_roundtrip();
|
||||||
Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._redraw));
|
Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._redraw));
|
||||||
|
|
||||||
this._keyboardSettings = new Gio.Settings({ schema: KEYBOARD_SCHEMA });
|
this._keyboardSettings = new Gio.Settings({ schema: KEYBOARD_SCHEMA });
|
||||||
@ -218,7 +188,7 @@ Keyboard.prototype = {
|
|||||||
this._redraw();
|
this._redraw();
|
||||||
},
|
},
|
||||||
|
|
||||||
_settingsChanged: function () {
|
_settingsChanged: function (settings, key) {
|
||||||
this._enableKeyboard = this._a11yApplicationsSettings.get_boolean(SHOW_KEYBOARD);
|
this._enableKeyboard = this._a11yApplicationsSettings.get_boolean(SHOW_KEYBOARD);
|
||||||
if (!this._enableKeyboard && !this._keyboard)
|
if (!this._enableKeyboard && !this._keyboard)
|
||||||
return;
|
return;
|
||||||
@ -228,9 +198,20 @@ Keyboard.prototype = {
|
|||||||
|
|
||||||
if (this._keyboard)
|
if (this._keyboard)
|
||||||
this._destroyKeyboard();
|
this._destroyKeyboard();
|
||||||
if (this._enableKeyboard)
|
|
||||||
this._setupKeyboard();
|
if (this._enableKeyboard) {
|
||||||
else
|
// If we've been called because the setting actually just
|
||||||
|
// changed to true (as opposed to being called from
|
||||||
|
// this._init()), then we want to pop up the keyboard.
|
||||||
|
let showKeyboard = (settings != null);
|
||||||
|
|
||||||
|
// However, caribou-gtk-module or this._onKeyFocusChanged
|
||||||
|
// will probably immediately tell us to hide it, so we
|
||||||
|
// have to fake things out so we'll ignore that request.
|
||||||
|
if (showKeyboard)
|
||||||
|
this._timestamp = global.display.get_current_time_roundtrip() + 1;
|
||||||
|
this._setupKeyboard(showKeyboard);
|
||||||
|
} else
|
||||||
Main.layoutManager.hideKeyboard(true);
|
Main.layoutManager.hideKeyboard(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -246,7 +227,7 @@ Keyboard.prototype = {
|
|||||||
this._destroySource();
|
this._destroySource();
|
||||||
},
|
},
|
||||||
|
|
||||||
_setupKeyboard: function() {
|
_setupKeyboard: function(show) {
|
||||||
this.actor = new St.BoxLayout({ name: 'keyboard', vertical: true, reactive: true });
|
this.actor = new St.BoxLayout({ name: 'keyboard', vertical: true, reactive: true });
|
||||||
Main.layoutManager.keyboardBox.add_actor(this.actor);
|
Main.layoutManager.keyboardBox.add_actor(this.actor);
|
||||||
Main.layoutManager.trackChrome(this.actor);
|
Main.layoutManager.trackChrome(this.actor);
|
||||||
@ -261,22 +242,41 @@ Keyboard.prototype = {
|
|||||||
|
|
||||||
this._addKeys();
|
this._addKeys();
|
||||||
|
|
||||||
|
// Keys should be layout according to the group, not the
|
||||||
|
// locale; as Caribou already provides the expected layout,
|
||||||
|
// this means enforcing LTR for all locales.
|
||||||
|
this.actor.text_direction = Clutter.TextDirection.LTR;
|
||||||
|
|
||||||
this._keyboardNotifyId = this._keyboard.connect('notify::active-group', Lang.bind(this, this._onGroupChanged));
|
this._keyboardNotifyId = this._keyboard.connect('notify::active-group', Lang.bind(this, this._onGroupChanged));
|
||||||
this._focusNotifyId = global.stage.connect('notify::key-focus', Lang.bind(this, this._onKeyFocusChanged));
|
this._focusNotifyId = global.stage.connect('notify::key-focus', Lang.bind(this, this._onKeyFocusChanged));
|
||||||
this._createSource();
|
|
||||||
|
if (show)
|
||||||
|
this.show();
|
||||||
|
else
|
||||||
|
this._createSource();
|
||||||
},
|
},
|
||||||
|
|
||||||
_onKeyFocusChanged: function () {
|
_onKeyFocusChanged: function () {
|
||||||
let focus = global.stage.key_focus;
|
let focus = global.stage.key_focus;
|
||||||
|
|
||||||
// Showing an extended key popup will grab focus, but ignore that
|
// Showing an extended key popup and clicking a key from the extended keys
|
||||||
if (focus && focus._extended_keys)
|
// will grab focus, but ignore that
|
||||||
|
let extendedKeysWereFocused = this._focusInExtendedKeys;
|
||||||
|
this._focusInExtendedKeys = focus && (focus._extended_keys || focus.extended_key);
|
||||||
|
if (this._focusInExtendedKeys || extendedKeysWereFocused)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Ignore focus changes caused by message tray showing/hiding
|
||||||
|
let trayWasFocused = this._focusInTray;
|
||||||
|
this._focusInTray = (focus && Main.messageTray.actor.contains(focus));
|
||||||
|
if (this._focusInTray || trayWasFocused)
|
||||||
|
return;
|
||||||
|
|
||||||
|
let time = global.get_current_time();
|
||||||
if (focus instanceof Clutter.Text)
|
if (focus instanceof Clutter.Text)
|
||||||
this.show();
|
this.Show(time);
|
||||||
else
|
else
|
||||||
this.hide();
|
this.Hide(time);
|
||||||
},
|
},
|
||||||
|
|
||||||
_addKeys: function () {
|
_addKeys: function () {
|
||||||
@ -305,7 +305,8 @@ Keyboard.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_getTrayIcon: function () {
|
_getTrayIcon: function () {
|
||||||
let trayButton = new St.Button ({ label: "tray", style_class: 'keyboard-key' });
|
let trayButton = new St.Button ({ label: _("tray"),
|
||||||
|
style_class: 'keyboard-key' });
|
||||||
trayButton.key_width = 1;
|
trayButton.key_width = 1;
|
||||||
trayButton.connect('button-press-event', Lang.bind(this, function () {
|
trayButton.connect('button-press-event', Lang.bind(this, function () {
|
||||||
Main.messageTray.toggle();
|
Main.messageTray.toggle();
|
||||||
@ -319,6 +320,13 @@ Keyboard.prototype = {
|
|||||||
trayButton.reactive = true;
|
trayButton.reactive = true;
|
||||||
trayButton.remove_style_pseudo_class('grayed');
|
trayButton.remove_style_pseudo_class('grayed');
|
||||||
}));
|
}));
|
||||||
|
Main.sessionMode.connect('updated', Lang.bind(this, function() {
|
||||||
|
trayButton.reactive = !Main.sessionMode.isLocked;
|
||||||
|
if (Main.sessionMode.isLocked)
|
||||||
|
trayButton.add_style_pseudo_class('grayed');
|
||||||
|
else
|
||||||
|
trayButton.remove_style_pseudo_class('grayed');
|
||||||
|
}));
|
||||||
|
|
||||||
return trayButton;
|
return trayButton;
|
||||||
},
|
},
|
||||||
@ -339,7 +347,7 @@ Keyboard.prototype = {
|
|||||||
right_box.add(button.actor);
|
right_box.add(button.actor);
|
||||||
else
|
else
|
||||||
left_box.add(button.actor);
|
left_box.add(button.actor);
|
||||||
if (key.name == "Caribou_Prefs") {
|
if (key.name == 'Caribou_Prefs') {
|
||||||
key.connect('key-released', Lang.bind(this, this.hide));
|
key.connect('key-released', Lang.bind(this, this.hide));
|
||||||
|
|
||||||
// Add new key for hiding message tray
|
// Add new key for hiding message tray
|
||||||
@ -448,6 +456,12 @@ Keyboard.prototype = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
shouldTakeEvent: function(event) {
|
||||||
|
let actor = event.get_source();
|
||||||
|
return Main.layoutManager.keyboardBox.contains(actor) ||
|
||||||
|
actor._extended_keys || actor.extended_key;
|
||||||
|
},
|
||||||
|
|
||||||
show: function () {
|
show: function () {
|
||||||
this._redraw();
|
this._redraw();
|
||||||
|
|
||||||
@ -474,58 +488,75 @@ Keyboard.prototype = {
|
|||||||
this._moveTemporarily();
|
this._moveTemporarily();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// _compareTimestamp:
|
||||||
|
//
|
||||||
|
// Compare two timestamps taking into account
|
||||||
|
// CURRENT_TIME (0)
|
||||||
|
_compareTimestamp: function(one, two) {
|
||||||
|
if (one == two)
|
||||||
|
return 0;
|
||||||
|
if (one == Clutter.CURRENT_TIME)
|
||||||
|
return 1;
|
||||||
|
if (two == Clutter.CURRENT_TIME)
|
||||||
|
return -1;
|
||||||
|
return one - two;
|
||||||
|
},
|
||||||
|
|
||||||
// D-Bus methods
|
// D-Bus methods
|
||||||
Show: function(timestamp) {
|
Show: function(timestamp) {
|
||||||
if (timestamp - this._timestamp < 0)
|
if (!this._enableKeyboard)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this._timestamp = timestamp;
|
if (this._compareTimestamp(timestamp, this._timestamp) < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (timestamp != Clutter.CURRENT_TIME)
|
||||||
|
this._timestamp = timestamp;
|
||||||
this.show();
|
this.show();
|
||||||
},
|
},
|
||||||
|
|
||||||
Hide: function(timestamp) {
|
Hide: function(timestamp) {
|
||||||
if (timestamp - this._timestamp < 0)
|
if (!this._enableKeyboard)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this._timestamp = timestamp;
|
if (this._compareTimestamp(timestamp, this._timestamp) < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (timestamp != Clutter.CURRENT_TIME)
|
||||||
|
this._timestamp = timestamp;
|
||||||
this.hide();
|
this.hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
SetCursorLocation: function(x, y, w, h) {
|
SetCursorLocation: function(x, y, w, h) {
|
||||||
this._setLocation(x, y);
|
if (!this._enableKeyboard)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// this._setLocation(x, y);
|
||||||
},
|
},
|
||||||
|
|
||||||
SetEntryLocation: function(x, y, w, h) {
|
SetEntryLocation: function(x, y, w, h) {
|
||||||
this._setLocation(x, y);
|
if (!this._enableKeyboard)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// this._setLocation(x, y);
|
||||||
},
|
},
|
||||||
|
|
||||||
get Name() {
|
get Name() {
|
||||||
return 'gnome-shell';
|
return 'gnome-shell';
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
DBus.conformExport(Keyboard.prototype, CaribouKeyboardIface);
|
|
||||||
|
|
||||||
function KeyboardSource() {
|
const KeyboardSource = new Lang.Class({
|
||||||
this._init.apply(this, arguments);
|
Name: 'KeyboardSource',
|
||||||
}
|
Extends: MessageTray.Source,
|
||||||
|
|
||||||
KeyboardSource.prototype = {
|
|
||||||
__proto__: MessageTray.Source.prototype,
|
|
||||||
|
|
||||||
_init: function(keyboard) {
|
_init: function(keyboard) {
|
||||||
this._keyboard = keyboard;
|
this._keyboard = keyboard;
|
||||||
MessageTray.Source.prototype._init.call(this, _("Keyboard"));
|
this.parent(_("Keyboard"), 'input-keyboard-symbolic');
|
||||||
|
this.keepTrayOnSummaryClick = true;
|
||||||
this._setSummaryIcon(this.createNotificationIcon());
|
|
||||||
},
|
},
|
||||||
|
|
||||||
createNotificationIcon: function() {
|
handleSummaryClick: function() {
|
||||||
return new St.Icon({ icon_name: 'input-keyboard',
|
|
||||||
icon_type: St.IconType.SYMBOLIC,
|
|
||||||
icon_size: this.ICON_SIZE });
|
|
||||||
},
|
|
||||||
|
|
||||||
handleSummaryClick: function() {
|
|
||||||
let event = Clutter.get_current_event();
|
let event = Clutter.get_current_event();
|
||||||
if (event.type() != Clutter.EventType.BUTTON_RELEASE)
|
if (event.type() != Clutter.EventType.BUTTON_RELEASE)
|
||||||
return false;
|
return false;
|
||||||
@ -537,4 +568,4 @@ KeyboardSource.prototype = {
|
|||||||
open: function() {
|
open: function() {
|
||||||
this._keyboard.show();
|
this._keyboard.show();
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|