mirror of
https://github.com/aarnt/octopi.git
synced 2025-11-21 01:54:42 +01:00
Compare commits
880 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b8dfb0388 | ||
|
|
50e1c6bb85 | ||
|
|
4805a95ff8 | ||
|
|
c5688495c0 | ||
|
|
400c4750fd | ||
|
|
ab8af8bc6e | ||
|
|
bb06f38da9 | ||
|
|
7f15a34bc9 | ||
|
|
8e9e0d05e9 | ||
|
|
a85d8af58f | ||
|
|
241f9e7241 | ||
|
|
b5fda06f3e | ||
|
|
ded5f7313a | ||
|
|
cda6193af7 | ||
|
|
d23117a714 | ||
|
|
226d0425c4 | ||
|
|
70d6220f4e | ||
|
|
a6349334a1 | ||
|
|
9f228d393a | ||
|
|
8599400779 | ||
|
|
eef29fb556 | ||
|
|
773caf0e0c | ||
|
|
70f1445df5 | ||
|
|
d35f3759a9 | ||
|
|
590c4143e1 | ||
|
|
42e8e4ed2b | ||
|
|
6563139418 | ||
|
|
6209e80e4c | ||
|
|
5e1e70666e | ||
|
|
4c93c474ff | ||
|
|
e5ef5085e5 | ||
|
|
3b94072502 | ||
|
|
535c70e695 | ||
|
|
0d1a835f66 | ||
|
|
36f5c818d1 | ||
|
|
e8794007d6 | ||
|
|
033b327ee6 | ||
|
|
9258b3a252 | ||
|
|
beb8d45dac | ||
|
|
34d38280ff | ||
|
|
e553367f22 | ||
|
|
a7cf805cda | ||
|
|
fd1b3516f4 | ||
|
|
6e05037eb9 | ||
|
|
5845f49b79 | ||
|
|
d7c2d23dfa | ||
|
|
6bebce8693 | ||
|
|
483bdf85e1 | ||
|
|
4ae0c6f436 | ||
|
|
3da5a4eac5 | ||
|
|
83087072c2 | ||
|
|
268dea6272 | ||
|
|
b966faa0dd | ||
|
|
2f96f12386 | ||
|
|
3e50690e0c | ||
|
|
c53774609b | ||
|
|
e3f626da8f | ||
|
|
ce1821f8dd | ||
|
|
ecc737d336 | ||
|
|
e553a4f045 | ||
|
|
cfb04970a8 | ||
|
|
bd7d92d18b | ||
|
|
cc9811b6de | ||
|
|
746bb9d7da | ||
|
|
a3f84b1573 | ||
|
|
7a63e3fc2f | ||
|
|
885ec83b23 | ||
|
|
91fdfc8c47 | ||
|
|
aa71f64d95 | ||
|
|
188f71b46b | ||
|
|
9825be81b4 | ||
|
|
20f4eb2810 | ||
|
|
79a7f4f698 | ||
|
|
039f98130d | ||
|
|
c780060214 | ||
|
|
a34ba69c24 | ||
|
|
af881e7912 | ||
|
|
93f3c74a59 | ||
|
|
db058e35f5 | ||
|
|
d1347b1820 | ||
|
|
33ceb0178f | ||
|
|
baeb542b38 | ||
|
|
fd787a74fc | ||
|
|
e60c516177 | ||
|
|
b32e94e0ce | ||
|
|
67f6692a48 | ||
|
|
0ad770c83e | ||
|
|
05a891b2a6 | ||
|
|
a1ed637f31 | ||
|
|
8ae7a0fd8f | ||
|
|
42064d75df | ||
|
|
064cb3ded3 | ||
|
|
5d36b8a957 | ||
|
|
f6961a89ca | ||
|
|
2d9c34fa18 | ||
|
|
aed6d3948a | ||
|
|
c19a324cda | ||
|
|
614e3b8bd3 | ||
|
|
a575a04981 | ||
|
|
b4899bcedc | ||
|
|
e159abaafc | ||
|
|
e55090a066 | ||
|
|
ec89b8a2bc | ||
|
|
95faab97a9 | ||
|
|
a7108f0835 | ||
|
|
48bf47fa48 | ||
|
|
2a5f9b32b6 | ||
|
|
208f689118 | ||
|
|
f7f34a6562 | ||
|
|
ad8732ef81 | ||
|
|
b432c40c26 | ||
|
|
3d1b4678bc | ||
|
|
363374f639 | ||
|
|
8141393314 | ||
|
|
76330f8b17 | ||
|
|
7da9c3edc0 | ||
|
|
f5b22fba98 | ||
|
|
8defc3bdd0 | ||
|
|
71238d3e93 | ||
|
|
121ad0d634 | ||
|
|
ad28a0678f | ||
|
|
3db8415077 | ||
|
|
6c3b63f98f | ||
|
|
f3a14edab0 | ||
|
|
043931eb2a | ||
|
|
1c578367b7 | ||
|
|
28e4c0f989 | ||
|
|
46535831d3 | ||
|
|
d1048abc9f | ||
|
|
8dcc30ca9e | ||
|
|
b87ed8345b | ||
|
|
4b3507539c | ||
|
|
6008d37c19 | ||
|
|
6b601439cc | ||
|
|
0dad821102 | ||
|
|
739397211e | ||
|
|
5bb1faa43b | ||
|
|
524f305cc2 | ||
|
|
c56d777c96 | ||
|
|
8e8decae26 | ||
|
|
e727c8e598 | ||
|
|
275d159d81 | ||
|
|
a2802044a6 | ||
|
|
218f27bce0 | ||
|
|
10c97c96c3 | ||
|
|
0066009d11 | ||
|
|
e46899b4f5 | ||
|
|
ed61820026 | ||
|
|
3db8927f28 | ||
|
|
1eff031e23 | ||
|
|
e2c87e2c50 | ||
|
|
58797754eb | ||
|
|
88590ec964 | ||
|
|
c770253981 | ||
|
|
67dc305cc9 | ||
|
|
a4454951e4 | ||
|
|
4fdcb953e8 | ||
|
|
11e437b5b5 | ||
|
|
3dc3fa73ec | ||
|
|
dad4f38804 | ||
|
|
bb0bc7b3f2 | ||
|
|
46ef3655c1 | ||
|
|
11010fbf23 | ||
|
|
af1d5829c9 | ||
|
|
abccec8324 | ||
|
|
70b36e25df | ||
|
|
94d368337f | ||
|
|
36ffdbaa86 | ||
|
|
ec48262a24 | ||
|
|
2dd6888d28 | ||
|
|
b21774789d | ||
|
|
f7f8067263 | ||
|
|
f491a77ee0 | ||
|
|
0d86bc1e2f | ||
|
|
cd2cc7045e | ||
|
|
ff65bad532 | ||
|
|
4a366da7d9 | ||
|
|
64b143b843 | ||
|
|
ff7f108e58 | ||
|
|
95d8882854 | ||
|
|
fa4451316c | ||
|
|
1ead404fac | ||
|
|
af48197cdc | ||
|
|
22c807eb00 | ||
|
|
c25660d304 | ||
|
|
292506e020 | ||
|
|
dab4844ebe | ||
|
|
cd3df70032 | ||
|
|
6817c63d83 | ||
|
|
071d489af0 | ||
|
|
a433ea673f | ||
|
|
fe0a38b7fc | ||
|
|
9e32b7846c | ||
|
|
ce8eb46a69 | ||
|
|
05f3607fb2 | ||
|
|
99f737e3cc | ||
|
|
2d0ffd8174 | ||
|
|
9f7ff44164 | ||
|
|
316a91d102 | ||
|
|
000c00b346 | ||
|
|
fae53c8d6e | ||
|
|
23c0ada511 | ||
|
|
a812cf5316 | ||
|
|
6742daf14c | ||
|
|
61b77290fe | ||
|
|
6a0a8002d9 | ||
|
|
5d49c4bd96 | ||
|
|
1072a3612f | ||
|
|
3fece6a554 | ||
|
|
d459833b44 | ||
|
|
0f217461a2 | ||
|
|
926c7ef117 | ||
|
|
9f90ed5f76 | ||
|
|
ca6826b3d7 | ||
|
|
846615374f | ||
|
|
e9e7ca3df8 | ||
|
|
cf7e52d71e | ||
|
|
1f384616c7 | ||
|
|
8b99edab3e | ||
|
|
10f7c2307c | ||
|
|
505621cc6d | ||
|
|
d9f6e6da92 | ||
|
|
a05add18cd | ||
|
|
fd5dcc07fa | ||
|
|
f67e3f27e8 | ||
|
|
b838d2fa26 | ||
|
|
e846990877 | ||
|
|
2250904a90 | ||
|
|
6500cb9e2e | ||
|
|
66311c1f4d | ||
|
|
dd261f4ed2 | ||
|
|
0d2ea072ca | ||
|
|
c6293bf567 | ||
|
|
622631bb1c | ||
|
|
5438954d7c | ||
|
|
7931b5f626 | ||
|
|
a32d8c6193 | ||
|
|
2cde060e2f | ||
|
|
64e82a2f34 | ||
|
|
0d322a718e | ||
|
|
00e3ee492f | ||
|
|
da2f616509 | ||
|
|
81fbb39c35 | ||
|
|
2334d2684e | ||
|
|
63bb50a602 | ||
|
|
e187d54d0b | ||
|
|
26029b124d | ||
|
|
4dc4a42570 | ||
|
|
69706789e2 | ||
|
|
337dc296ac | ||
|
|
fddcbc72b5 | ||
|
|
c6a5028306 | ||
|
|
791cc24d1e | ||
|
|
b741c49f2d | ||
|
|
8b83830c15 | ||
|
|
c4cec0b122 | ||
|
|
74a519472a | ||
|
|
e452f82542 | ||
|
|
c67771698a | ||
|
|
fa9f4ce1c7 | ||
|
|
c0538bd1ba | ||
|
|
6a91e57b58 | ||
|
|
4b5887b232 | ||
|
|
6046669135 | ||
|
|
aa4d30261b | ||
|
|
b8bf9495d0 | ||
|
|
4f7822b4fb | ||
|
|
2910f6ad34 | ||
|
|
f41beff873 | ||
|
|
31fb2dac94 | ||
|
|
7424ba3d60 | ||
|
|
26e5cd3514 | ||
|
|
0a7f7c782e | ||
|
|
5d6a3af63b | ||
|
|
90b237b9c8 | ||
|
|
dd71f2df80 | ||
|
|
c9be44ab2f | ||
|
|
6642916612 | ||
|
|
4dae7f8af4 | ||
|
|
894928eed3 | ||
|
|
3f8a5a6bd5 | ||
|
|
784fc6f20e | ||
|
|
f5d49c6ef6 | ||
|
|
9c8617d452 | ||
|
|
0867327d2a | ||
|
|
4df7758e82 | ||
|
|
25965581ab | ||
|
|
33b72056a9 | ||
|
|
ffc984824d | ||
|
|
5cccfce28e | ||
|
|
fe27630042 | ||
|
|
29180a1040 | ||
|
|
24789355be | ||
|
|
edb0f4b369 | ||
|
|
91b6dd48fe | ||
|
|
f667d025c5 | ||
|
|
7131a6bc84 | ||
|
|
9d60096df9 | ||
|
|
494403333b | ||
|
|
8c25a5299d | ||
|
|
c51789c892 | ||
|
|
6bdef66282 | ||
|
|
7796ad2a55 | ||
|
|
5241d0f58c | ||
|
|
f09c7753ab | ||
|
|
92a42d5c9b | ||
|
|
06b3f8c6b1 | ||
|
|
700809bc77 | ||
|
|
ca8196007c | ||
|
|
698ce813c1 | ||
|
|
6ad8d296ad | ||
|
|
b8a781e3c4 | ||
|
|
0f4d0d2cde | ||
|
|
195aca81bb | ||
|
|
162b31ef2a | ||
|
|
d076398cce | ||
|
|
abeee87c69 | ||
|
|
836cb01391 | ||
|
|
529a867a95 | ||
|
|
4b719f5106 | ||
|
|
b9cfee3163 | ||
|
|
5e9cd21f2b | ||
|
|
9eb1faa8ca | ||
|
|
a3e53728e3 | ||
|
|
c1dd1dd669 | ||
|
|
2623504bc8 | ||
|
|
6caaef4b9a | ||
|
|
7b3ccfb67d | ||
|
|
377bbc702a | ||
|
|
f388a9cc8c | ||
|
|
a3707b857d | ||
|
|
23323442f2 | ||
|
|
8f13211b8b | ||
|
|
c9a8e2156f | ||
|
|
614850f056 | ||
|
|
4fe304e5bf | ||
|
|
20e6874771 | ||
|
|
2610359c29 | ||
|
|
24099a0892 | ||
|
|
04127c4ab9 | ||
|
|
296a7848b4 | ||
|
|
041688a996 | ||
|
|
46f5efb418 | ||
|
|
abc5e76913 | ||
|
|
15899fccbd | ||
|
|
b048c1c002 | ||
|
|
a38b24afc4 | ||
|
|
8c50c14fe0 | ||
|
|
01b5e3c01b | ||
|
|
1b92868b15 | ||
|
|
0e8805e5eb | ||
|
|
661d28956b | ||
|
|
cdead9468c | ||
|
|
9aad3f97b6 | ||
|
|
002fd0180e | ||
|
|
245db0572a | ||
|
|
f913972868 | ||
|
|
db2eecd8bc | ||
|
|
3f912fe637 | ||
|
|
0e7a6c15a7 | ||
|
|
5eb575e496 | ||
|
|
b93df38efa | ||
|
|
bbe56f6f2d | ||
|
|
149517e436 | ||
|
|
907432c0b3 | ||
|
|
b5c7526cea | ||
|
|
de8019d8fc | ||
|
|
aacec874d7 | ||
|
|
b5dd3922a3 | ||
|
|
ed4a1d8f21 | ||
|
|
2a2eb93187 | ||
|
|
4eaed8dba6 | ||
|
|
4b0703ece5 | ||
|
|
b3c5378920 | ||
|
|
2b4b20b9fa | ||
|
|
3e4db580eb | ||
|
|
091f0a12b6 | ||
|
|
8ccc3016c7 | ||
|
|
0f17fb16c4 | ||
|
|
8890a7cb87 | ||
|
|
4a273bd826 | ||
|
|
f4c3222174 | ||
|
|
1d44a52981 | ||
|
|
ccabf3d4e9 | ||
|
|
ed0a6c8b82 | ||
|
|
044bf6c594 | ||
|
|
af37001a64 | ||
|
|
84810b9a97 | ||
|
|
f7e5e6ed7b | ||
|
|
95ff43b71d | ||
|
|
1ecdba57bd | ||
|
|
7c5e3f9f27 | ||
|
|
87b0a8e7af | ||
|
|
930b4c023f | ||
|
|
13848f9525 | ||
|
|
0f43222795 | ||
|
|
a88a20775d | ||
|
|
d04cf46c61 | ||
|
|
0bec405a61 | ||
|
|
99a2fb5c8f | ||
|
|
274da64555 | ||
|
|
ed43e44883 | ||
|
|
01ea313e93 | ||
|
|
ee03eb4a67 | ||
|
|
bf615b96a7 | ||
|
|
ce1374844a | ||
|
|
6f191e2dba | ||
|
|
07cd087d9e | ||
|
|
bc659f50dc | ||
|
|
98c4b4dc70 | ||
|
|
7a0ff75fba | ||
|
|
c2b1c84268 | ||
|
|
12b34017e7 | ||
|
|
d76eb8b1c8 | ||
|
|
9a679424d7 | ||
|
|
6855629524 | ||
|
|
87206bbcc8 | ||
|
|
395291481a | ||
|
|
2a5fe191b0 | ||
|
|
c5d39dae42 | ||
|
|
2f601d3650 | ||
|
|
f3128bf86d | ||
|
|
b4d38db487 | ||
|
|
f9aa8573a5 | ||
|
|
31060ae2b2 | ||
|
|
72a922a080 | ||
|
|
d23565750a | ||
|
|
841a0310cf | ||
|
|
198cc22caf | ||
|
|
bf229e28ce | ||
|
|
c780fddb47 | ||
|
|
43ed522fa8 | ||
|
|
d79b079677 | ||
|
|
b0448a4bd7 | ||
|
|
e0792d776f | ||
|
|
45941fa780 | ||
|
|
fdcb59ae4a | ||
|
|
ed2100c40f | ||
|
|
6d55356219 | ||
|
|
7b6b8d79b1 | ||
|
|
29860a0d80 | ||
|
|
954419baa3 | ||
|
|
8b05da2c3b | ||
|
|
ef3e5c6197 | ||
|
|
306b846b9d | ||
|
|
5d54c1f28f | ||
|
|
4b883b4870 | ||
|
|
2f5c563236 | ||
|
|
f94ee1a04b | ||
|
|
1060b3c800 | ||
|
|
1717ec4ceb | ||
|
|
ddb1131ea8 | ||
|
|
8fa0f1d4b8 | ||
|
|
7b81db5ce1 | ||
|
|
3d9dbfb5fa | ||
|
|
18ce8177f7 | ||
|
|
2145455c12 | ||
|
|
882f876e2b | ||
|
|
ab87f72781 | ||
|
|
b3c67e5d8f | ||
|
|
abc15557d9 | ||
|
|
8b1e670281 | ||
|
|
499cbbe9b9 | ||
|
|
31555d6bc4 | ||
|
|
7a32ba9ea2 | ||
|
|
a1775be6b0 | ||
|
|
22b89268c0 | ||
|
|
c1d60de3cc | ||
|
|
b550b4d7bf | ||
|
|
2e577dbbb2 | ||
|
|
b21ad34f77 | ||
|
|
4e9028462e | ||
|
|
24e73b68c9 | ||
|
|
c1c8d8e91a | ||
|
|
a6e171abee | ||
|
|
67ded2c136 | ||
|
|
85acca454f | ||
|
|
679477296f | ||
|
|
62a443dc31 | ||
|
|
67bfc99983 | ||
|
|
4fb2ea22f4 | ||
|
|
94d1cd3c27 | ||
|
|
178bbc1751 | ||
|
|
743f85015a | ||
|
|
ff8c2c8435 | ||
|
|
82f525c21e | ||
|
|
941e467b93 | ||
|
|
5e6be67cc9 | ||
|
|
34c446fc29 | ||
|
|
0ee7ca1a74 | ||
|
|
408cbd6446 | ||
|
|
535f2c1839 | ||
|
|
ec43d1ef12 | ||
|
|
0848e2f75e | ||
|
|
cd68e45ac4 | ||
|
|
957d4e8a03 | ||
|
|
27d053f5fb | ||
|
|
16f5d0deeb | ||
|
|
81c2232609 | ||
|
|
2f64c66b63 | ||
|
|
76ee38a2d3 | ||
|
|
fe495319e2 | ||
|
|
f33ec2cc48 | ||
|
|
3e5257cae9 | ||
|
|
c7eb428c9e | ||
|
|
63610228f2 | ||
|
|
1cc1036468 | ||
|
|
adfd514772 | ||
|
|
79731ccb69 | ||
|
|
9cb3f72a9b | ||
|
|
1dba4e4565 | ||
|
|
9600933b63 | ||
|
|
ec5a01925f | ||
|
|
d0a55bba67 | ||
|
|
df6f0467a5 | ||
|
|
3d6f0723f5 | ||
|
|
3ee20b8b76 | ||
|
|
359584ba93 | ||
|
|
fa8083599a | ||
|
|
25971985ee | ||
|
|
b0613be2a2 | ||
|
|
241169308a | ||
|
|
58757a23a2 | ||
|
|
e062b9c5f8 | ||
|
|
ead4189904 | ||
|
|
cdbaccaadd | ||
|
|
80414e2177 | ||
|
|
b7fa1be650 | ||
|
|
f46d16ca03 | ||
|
|
7d7910f934 | ||
|
|
6a5637023f | ||
|
|
251822c887 | ||
|
|
553068128b | ||
|
|
aea5e2cf09 | ||
|
|
91dfad1faf | ||
|
|
6f2401e10a | ||
|
|
72c0a0ba11 | ||
|
|
fa7e88d370 | ||
|
|
3935abcd82 | ||
|
|
10c78af877 | ||
|
|
2d2b29f0d0 | ||
|
|
45fa9697ad | ||
|
|
f0bf295aab | ||
|
|
17123d9428 | ||
|
|
b9f0c6b73c | ||
|
|
a64adfb404 | ||
|
|
f192bc7aa6 | ||
|
|
1c07b57afa | ||
|
|
e054cb0218 | ||
|
|
5009ee232c | ||
|
|
78604ed1f6 | ||
|
|
42918df4a3 | ||
|
|
cafc92e030 | ||
|
|
be5fa78234 | ||
|
|
cb16ea67de | ||
|
|
ab5866427e | ||
|
|
b9654265f9 | ||
|
|
598eff9abd | ||
|
|
73b1028fe8 | ||
|
|
abe3060ea9 | ||
|
|
2b644de025 | ||
|
|
ba802c6a7d | ||
|
|
2555fa645b | ||
|
|
96300a0491 | ||
|
|
d454c7e8f4 | ||
|
|
e1954e0821 | ||
|
|
36aff057a5 | ||
|
|
70a68fde41 | ||
|
|
6af126c47c | ||
|
|
7d5db3e3c7 | ||
|
|
3547036a00 | ||
|
|
3988003c17 | ||
|
|
1e585a9876 | ||
|
|
5a2e61ba13 | ||
|
|
3460389d2f | ||
|
|
0a599bfb0e | ||
|
|
d084dc016a | ||
|
|
66b9e7ee1f | ||
|
|
c413caadd1 | ||
|
|
bff4de2189 | ||
|
|
a9d9eb30d3 | ||
|
|
f9063cf252 | ||
|
|
61f6a199e9 | ||
|
|
e59fe5ac8c | ||
|
|
ee79c35b62 | ||
|
|
a3b1eaf68b | ||
|
|
9a419e5ab6 | ||
|
|
8f82f46852 | ||
|
|
f45a5a903a | ||
|
|
6b727bf114 | ||
|
|
2fad59554b | ||
|
|
e8c3ff875c | ||
|
|
12b7338b51 | ||
|
|
c615f97362 | ||
|
|
d36e793864 | ||
|
|
f6fd67a33e | ||
|
|
b9958cafc9 | ||
|
|
3849c5ad31 | ||
|
|
60bd2cd082 | ||
|
|
f9692ddd48 | ||
|
|
5e29bc7145 | ||
|
|
845311daf2 | ||
|
|
d35247c92a | ||
|
|
e8613527b6 | ||
|
|
c053cf21a6 | ||
|
|
e46725e998 | ||
|
|
27de3460cb | ||
|
|
c067a37787 | ||
|
|
6bc18dd768 | ||
|
|
c9dbaebec4 | ||
|
|
640d5633b4 | ||
|
|
b3887c8138 | ||
|
|
14c69b0b53 | ||
|
|
13218919aa | ||
|
|
465e23f98d | ||
|
|
b578189f0d | ||
|
|
fb7a1f9d6b | ||
|
|
3e3c6ae0fc | ||
|
|
eca942ec96 | ||
|
|
ff6c3c74e6 | ||
|
|
9c886b1800 | ||
|
|
52e111f5ab | ||
|
|
669e85b63d | ||
|
|
035cd35ada | ||
|
|
fbe16eea44 | ||
|
|
dab1bc3752 | ||
|
|
b48f4896e7 | ||
|
|
82acc74c24 | ||
|
|
8b4721320e | ||
|
|
d0ec92cd24 | ||
|
|
1759559de0 | ||
|
|
98c91ae853 | ||
|
|
a401e12573 | ||
|
|
2f45944be4 | ||
|
|
76aa51fa2e | ||
|
|
28d85c366a | ||
|
|
3e303ce310 | ||
|
|
e08f7a8815 | ||
|
|
91e559e35f | ||
|
|
5d6c5771cb | ||
|
|
24cb7b2eaf | ||
|
|
69fd73301b | ||
|
|
3d6928a391 | ||
|
|
f56bbbc168 | ||
|
|
673167059c | ||
|
|
365ddc48ea | ||
|
|
cda91af947 | ||
|
|
2fb2266d96 | ||
|
|
0f77565fdb | ||
|
|
05c03ebdec | ||
|
|
c346876f94 | ||
|
|
497cc66ea4 | ||
|
|
dfddcdcdcb | ||
|
|
139f3642aa | ||
|
|
b6aab3a315 | ||
|
|
329fae945d | ||
|
|
d14bb8ea31 | ||
|
|
23f0205037 | ||
|
|
4ad97ac0a1 | ||
|
|
2d6d0f76b4 | ||
|
|
ca25f656cb | ||
|
|
1fbcb598ce | ||
|
|
67e2e1f246 | ||
|
|
bb8636c5ee | ||
|
|
1f4cee54f6 | ||
|
|
7cd00bbc05 | ||
|
|
08b7ec4999 | ||
|
|
e8779ccbf6 | ||
|
|
f94457f12c | ||
|
|
e9c6174942 | ||
|
|
d6fcc3cf56 | ||
|
|
b09b9de684 | ||
|
|
ff118927ed | ||
|
|
c36eb4095d | ||
|
|
50a8036f4d | ||
|
|
930fc5ac77 | ||
|
|
fb0947ae7c | ||
|
|
967a6328f9 | ||
|
|
8ae9b55214 | ||
|
|
be36c2937b | ||
|
|
0dde2ab86e | ||
|
|
d54d3d8cd0 | ||
|
|
22622a7d71 | ||
|
|
e0817e2fb0 | ||
|
|
f3898716f3 | ||
|
|
4eaca6c9b3 | ||
|
|
f09bfc7003 | ||
|
|
d5d756d82d | ||
|
|
941aece11e | ||
|
|
21953d09d4 | ||
|
|
9e4fa4b7a3 | ||
|
|
347bd0ceb1 | ||
|
|
b8747195ed | ||
|
|
8800c47f55 | ||
|
|
e9773c1c86 | ||
|
|
5289caadff | ||
|
|
dd04860401 | ||
|
|
eed57cf144 | ||
|
|
6e0ebe9fc0 | ||
|
|
404a156f2b | ||
|
|
a699915ea7 | ||
|
|
fbc4b54811 | ||
|
|
a4de722874 | ||
|
|
c82f3c02fc | ||
|
|
17101da9b2 | ||
|
|
ccb1418a34 | ||
|
|
0864632d9e | ||
|
|
7ca2f7e93e | ||
|
|
be162818cb | ||
|
|
a1759d85fa | ||
|
|
af32397c04 | ||
|
|
d74618d332 | ||
|
|
5c9be7cbd1 | ||
|
|
4121c1e2a9 | ||
|
|
11fd4530ce | ||
|
|
b456284f75 | ||
|
|
122ae6a6ff | ||
|
|
e09727b56d | ||
|
|
10c114a867 | ||
|
|
a6bcf4ddbf | ||
|
|
b7936681cf | ||
|
|
e232c0bb5e | ||
|
|
e235be9895 | ||
|
|
95d5debfee | ||
|
|
a274a3d9ae | ||
|
|
51e8d51562 | ||
|
|
3ddf0118fc | ||
|
|
31f980ff4f | ||
|
|
dfb0dbfa90 | ||
|
|
9d566cc6c1 | ||
|
|
0c2d4dddd5 | ||
|
|
e34c251523 | ||
|
|
8325cb6b43 | ||
|
|
7eead7588d | ||
|
|
ae100280e3 | ||
|
|
5b951aac4f | ||
|
|
ff5cdadf4d | ||
|
|
1e669d08a0 | ||
|
|
c5ae8d2980 | ||
|
|
ec8f49b0d7 | ||
|
|
a1b0a5ec97 | ||
|
|
487c80b475 | ||
|
|
cec926a090 | ||
|
|
23623f9cee | ||
|
|
f92aa3426c | ||
|
|
989617366a | ||
|
|
96324d4595 | ||
|
|
17ba947380 | ||
|
|
bab0aa8ebc | ||
|
|
b44226bea7 | ||
|
|
d56ebd1ff9 | ||
|
|
e034d1bf03 | ||
|
|
e99ae35661 | ||
|
|
d283de66b5 | ||
|
|
4d690d6ca8 | ||
|
|
604ab88b09 | ||
|
|
cad306b6de | ||
|
|
6363f7c386 | ||
|
|
c8abdc6343 | ||
|
|
9a12e9831b | ||
|
|
d470485c49 | ||
|
|
ad292fa496 | ||
|
|
0f4cb05418 | ||
|
|
3f3fb1e2ab | ||
|
|
fc44e72bb1 | ||
|
|
de915f748f | ||
|
|
968f1f213d | ||
|
|
19eb70e425 | ||
|
|
e5544644a7 | ||
|
|
8781c23939 | ||
|
|
8e89cae659 | ||
|
|
a22f80c053 | ||
|
|
9a1d042fb8 | ||
|
|
f7dbf97c53 | ||
|
|
eb34d25272 | ||
|
|
d6a8313a19 | ||
|
|
1020f7a498 | ||
|
|
4232475053 | ||
|
|
42d4126a5d | ||
|
|
aa9f71cfd7 | ||
|
|
18bccb8e5b | ||
|
|
e3576c31a3 | ||
|
|
53f06c0382 | ||
|
|
cfad0498b8 | ||
|
|
24e3ad5ed5 | ||
|
|
7a2abbc325 | ||
|
|
30adc49bc0 | ||
|
|
c9cbafcf40 | ||
|
|
80d5fed085 | ||
|
|
d3a1a4bf1b | ||
|
|
b7560ca07b | ||
|
|
0f814c8e16 | ||
|
|
e864ea1999 | ||
|
|
89d47bf147 | ||
|
|
9929836cc4 | ||
|
|
0b31ebdee6 | ||
|
|
ff25031d1e | ||
|
|
4a540cfd7b | ||
|
|
bf39bfe921 | ||
|
|
b95a8f985e | ||
|
|
144c3f2ed7 | ||
|
|
bc5a017695 | ||
|
|
0cff45f88c | ||
|
|
b54f6904d4 | ||
|
|
7a2e7850ad | ||
|
|
4d0bc6caa9 | ||
|
|
13bb6b516a | ||
|
|
872d5fc7f7 | ||
|
|
13e19d0c16 | ||
|
|
1d334f5e27 | ||
|
|
a8e998993c | ||
|
|
dfaa9b0a00 | ||
|
|
9b34e85cea | ||
|
|
22f8b2b12f | ||
|
|
cdea76dd14 | ||
|
|
88bee2da43 | ||
|
|
e5b27d290b | ||
|
|
3cc847e532 | ||
|
|
b97a2bbb6d | ||
|
|
b390774d1b | ||
|
|
112e2783f8 | ||
|
|
d69961746d | ||
|
|
494cb645bd | ||
|
|
2b1c527171 | ||
|
|
695b1ad660 | ||
|
|
97d244cb4c | ||
|
|
a91978941d | ||
|
|
6564a2cebd | ||
|
|
2d1fe16358 | ||
|
|
56e1d5577c | ||
|
|
67a4a6d85d | ||
|
|
a8bc660efa | ||
|
|
74d6b88fb0 | ||
|
|
7b464f2f2e | ||
|
|
e43ceb07cc | ||
|
|
5f23e1bbd6 | ||
|
|
b6e53777bd | ||
|
|
271c7e191f | ||
|
|
ef2589b73b | ||
|
|
a45ca53c2e | ||
|
|
6b57c75bd6 | ||
|
|
014ef652ff | ||
|
|
eeefd39035 | ||
|
|
a76e2daa0a | ||
|
|
c33bbd30c6 | ||
|
|
1e7bbed24b | ||
|
|
37629fa69b | ||
|
|
51759fa6dd | ||
|
|
deaa0f8911 | ||
|
|
922b042914 | ||
|
|
12c1295761 | ||
|
|
7326de54c6 | ||
|
|
9a6a03cf79 | ||
|
|
cdea9b37a3 | ||
|
|
6e50e5adcb | ||
|
|
ebb5aecc82 | ||
|
|
b4c825b9c9 | ||
|
|
e53d10d736 | ||
|
|
2701df7a9b | ||
|
|
f07959e06b | ||
|
|
9e710f3ec7 | ||
|
|
28777174bc | ||
|
|
8fd614e8ca | ||
|
|
2978da8b46 | ||
|
|
dfdb01424a | ||
|
|
632e58de8f | ||
|
|
752e52f75e | ||
|
|
ec6349230b | ||
|
|
bb4512614b | ||
|
|
59140395e9 | ||
|
|
d051250a57 | ||
|
|
a3687cbd21 | ||
|
|
468fcd881c | ||
|
|
34f7ddd3bd | ||
|
|
dea7426857 | ||
|
|
fb117c4a65 | ||
|
|
8ca633171a | ||
|
|
c43008fed5 | ||
|
|
4a03666e82 | ||
|
|
6d92b42636 |
14
.gitignore
vendored
14
.gitignore
vendored
@@ -1,9 +1,21 @@
|
||||
*.user
|
||||
.qmake.stash
|
||||
Makefile
|
||||
bin/**
|
||||
build/**
|
||||
helper/*.o
|
||||
helper/moc*.*
|
||||
helper/octphelper
|
||||
cachecleaner/bin/**
|
||||
cachecleaner/build/**
|
||||
notifier/bin/**
|
||||
notifier/build/**
|
||||
qrc_resources.cpp
|
||||
octopi.pro.user
|
||||
qrc_resources.cpp
|
||||
repoeditor/bin/**
|
||||
repoeditor/build/**
|
||||
sudo/*.o
|
||||
sudo/moc*.*
|
||||
sudo/octopi-sudo
|
||||
sudo/qrc*.cpp
|
||||
sudo/ui_pass*.h
|
||||
|
||||
@@ -6,3 +6,4 @@ file_filter = resources/translations/octopi_<lang>.ts
|
||||
source_file = resources/translations/octopi_en.ts
|
||||
source_lang = en
|
||||
type = QT
|
||||
|
||||
|
||||
212
CHANGELOG
212
CHANGELOG
@@ -1,4 +1,160 @@
|
||||
0.8.1
|
||||
0.11 (dev)
|
||||
Added support for CMake build system (thanks to Tereius).
|
||||
Added support to build multiple foreign packages at once (they are first copied
|
||||
to the Actions' tree view just like official packages).
|
||||
Added "Open PKGBUILD" option to open the AUR PKGBUILD file in a text editor.
|
||||
Added "Show PKGBUILD diff" option to show the differences between latest and previous
|
||||
PKGBUILD files of the selected AUR package in a text editor.
|
||||
Added "Install Date" at Info tab.
|
||||
Added "Licenses", "Maintainer", "Depends On", "Make Deps", "Last Modified" and "Out-of-date"
|
||||
fields at Info tab while in AUR mode.
|
||||
Added option to display "Licenses", "Installed Size", "Build Date", "Install Date" and
|
||||
"Install Reason" columns in the package list.
|
||||
Added option to "Change Install Reason" of selected packages (Explicitly <-> As Dependency).
|
||||
Added a faster refresh package list code after checking for updates.
|
||||
Added "Build directory" option in AUR tab on options dialog, so users can change where
|
||||
makepkg builds the source code.
|
||||
Added support for '^' and '$' chars in AUR search
|
||||
Added "Open news in a browser" option on right clicking the News tab.
|
||||
Optional package dependencies are now installed with "--asdeps" parameter.
|
||||
Octopi-sudo code was synced to match project "lxqt-sudo" version 0.16.0.
|
||||
Updated PKGBUILD file following MatMoul's suggestion.
|
||||
Removed unused speedup service.
|
||||
Prevent users from running Octopi, Notifier and Cache Cleaner outside "/usr/bin" dir.
|
||||
BugFix: Disable Info/Files tab refresh while typing in filter/search line edit.
|
||||
BugFix: unset TMPDIR environment variable on every Octo tool startup
|
||||
(to avoid "octopi-helper[aborted]: Couldn't attach to memory" errors).
|
||||
BugFix: "total download size" showed the value 0 in Notifier if the database was not synched.
|
||||
BugFix: Pressing ESC in repoeditor could ask if you wanted to save your changes even
|
||||
if there were no changes made.
|
||||
BugFix: Running Notifier within a DE session could lead to a "Suspicious execution method" error.
|
||||
BugFix: If you tried to execute octopi after upgrading your system with notifier you got a
|
||||
notifier crash and an octopi freeze (thanks to linuxer for pointing that out).
|
||||
BugFix: Prevent icon changes in notifier when there were transaction errors.
|
||||
BugFix: The list of targets to install were not showing ok in the transaction dialog.
|
||||
BugFix: Restored support for command line parameters like "-sysupgrade-noconfirm" and "-style".
|
||||
BugFix: Updated "-help" output text.
|
||||
BugFix: Tab navigation improvements.
|
||||
BugFix: Statusbar showed a number of packages when the list was empty (the previous value).
|
||||
BugFix: Clicking on printed outdated packages in Output tab did not send to corresponding
|
||||
package in the main list after a 'Check updates'.
|
||||
BugFix: WM detection now uses "ps -aux".
|
||||
|
||||
0.10.0 (2020-07-19)
|
||||
Added a built-in default priviledge escalation tool: "octopi-sudo" as a slightly modified version
|
||||
of "lxqt-sudo" project (version 0.15.0). It's the only escalation tool supported!
|
||||
Added option to vote/unvote for AUR packages using aur.archlinux.org login.
|
||||
Added "pikaur" AUR tool support (thanks to ewilly).
|
||||
Added "yay" AUR tool support.
|
||||
Added option "--devel" in AUR tab to check for newer versions of dev packages.
|
||||
Added option to download a temporary yay-bin to enable AUR.
|
||||
Updated some UI icons and added an specific one for foreign non installed pkg.
|
||||
Dropped support for external terminal applications. QTermWidget is mandatory now!
|
||||
Print ".pacnew" file list summary after upgrade (if any).
|
||||
Added Lumina desktop support.
|
||||
RepoEditor now saves window size and position.
|
||||
Added "copy" command to octopi's embedded terminal context menu.
|
||||
Added option to enable/disable confirmation dialog in system upgrade.
|
||||
Added option to enable/disable internet checking.
|
||||
Renamed Transaction tab to Actions tab.
|
||||
Added left click support on package icon in package list to launch context menu.
|
||||
Added option to never check for package updates in Notifier.
|
||||
Added tooltip "Upgrading..." while Notifier is upgrading the system.
|
||||
Added "Info" option in package list context menu.
|
||||
Added ArcoLinux, Artix Linux, CondresOS and EndeavourOS distro support.
|
||||
Added support for sudo (and NOPASSWD) executing thru new octopi-helper subproject.
|
||||
Added option to exit Octopi while a transaction is already running.
|
||||
Added support for GNOME file manager/editor.
|
||||
Added option for changing use of alternating row colors in package list.
|
||||
Added a redesigned AUR tab in Options dialog.
|
||||
Added option to change terminal's color scheme, font family and font size through ~/.config/octopi/octopi.conf.
|
||||
Maximization of properties pane now hides tab bar.
|
||||
BugFix: Many clazy/manual code enhancements merged from luis-pereira (from LXQt organization).
|
||||
BugFix: AUR upgrades in notifier were not setting m_commandExecuting flag.
|
||||
BugFix: Make notifier code consistent with AUR upgrades.
|
||||
BugFix: Replaced 'Sync database' command text to 'Check updates'.
|
||||
BugFix: Always do a "pacman -Syu" in System Upgrade.
|
||||
BugFix: Notifier now uses "checkupdates" instead "pacman -Sy[y]". This means Octopi no longer can lead
|
||||
the OS to a "partial updates" state and works gracefully with other package tools.
|
||||
BugFix: Don't let user exits RepoEditor without answerig if he wants to save changes.
|
||||
BugFix: Sometimes non-outdated AUR packages did not get refreshed.
|
||||
BugFix: Now Actions tab is disable while in AUR mode.
|
||||
BugFix: Make "Open terminal here" option work with qtermwidget.
|
||||
BugFix: Added support for symbolic lynks in "open file".
|
||||
BugFix: Pkg build date obeys Locale datetime format.
|
||||
BugFix: SysInfo no longer pushes the collected logs to a remote paste service. It saves them locally.
|
||||
BugFix: "exists in filesystem" messages during transactions are shown again.
|
||||
BugFix: MultiselectionDialog did not resize pkg description automatically.
|
||||
BugFix: Some packages were not displaying Optional Deps at Info tab.
|
||||
BugFix: Huge delay when scrolling thru large package list.
|
||||
BugFix: Speed improvements in package list building.
|
||||
BugFix: OptionsDialog was not saving AUR settings if tab changed before clicking OK.
|
||||
BugFix: Changed Manjaro news url.
|
||||
BugFix: Notifier checked for available internet connection too early with an error dialog box.
|
||||
BugFix: Changed command string to Reinstall/Update when package is already installed or outdated.
|
||||
BugFix: Clear filter line edit when navigating thru package anchors at Info tab.
|
||||
BugFix: Info and Files tabs were not showing any info automaticaly when switching between
|
||||
foreign tool/pacman lists.
|
||||
BugFix: Enable a more complete UI lockdown during transactions.
|
||||
BugFix: Enable "Find a file" context menu option on a non installed pkg.
|
||||
|
||||
0.9.0 (2018-06-08)
|
||||
Parser changes: added counter for processed packages.
|
||||
Group pane now spans all window's height.
|
||||
SysInfo now uses ptpb site and does not block interface.
|
||||
Added Trizen (AUR tool) support.
|
||||
Added Terminal tab if user compiles project with libqtermwidget5 support.
|
||||
Added Terminal dialog in Notifier (AUR update) if user compiles project with
|
||||
libqtermwidget5 support.
|
||||
Added an Options dialog to Octopi and Notifier.
|
||||
Added button after progressbar to stop current running transaction.
|
||||
Added configurable "--noconfirm" and "--noedit" options to pacaur and "--noconfirm" to yaourt.
|
||||
Added "Search/Use Instant Search" toggle.
|
||||
Added slovenian translation (thanks to the translation crew).
|
||||
Added support fo drag pacman packages to Octopi's mainwindow so they can be installed.
|
||||
Added "Install Reason" field at Info tab.
|
||||
Added support for ALPM utils lib (thanks to guinux, from Pamac project). So, now it's possible to
|
||||
show "Download Size" in package list.
|
||||
Added link support in all Info tab package lists.
|
||||
Added option to upgrade outdated foreign packages from Octopi Notifier.
|
||||
Added Hindi translation (thanks to Panwar108).
|
||||
Name of AUR package in Info tab act as link to its site at https://aur.archlinux.org.
|
||||
Search line edit is always focused when the program starts.
|
||||
Prevent user to install partial upgrades in his system (ex: only some of the outdated packages).
|
||||
Do NOT clear search string when switching between AUR/pacman.
|
||||
BugFix: If threre are updated News after a synchronization, let's goto the News Tab.
|
||||
BugFix: Remove only Octopi tools related temporary files (qtsingleapp*).
|
||||
BugFix: Do not let program display an avalanche of internet related errors.
|
||||
BugFix: Exec internet tests before some commands in Octopi and Notifier.
|
||||
BugFix: Parser was not outputing repository errors when syncinc.
|
||||
BugFix: repoeditor now runs as normal user and asks for root password on save.
|
||||
BugFix: If Notifier hid Octopi and was closed, Octopi's window would stay hidden.
|
||||
BugFix: Notifier's about dialog was never screen centered.
|
||||
BugFix: When no AUR helper exists, the group of packages panel stayed disabled.
|
||||
BugFix: Cache Cleaner now saves its window geometry.
|
||||
BugFix: Infinite wait cursor in Cache Cleaner when user press Enter for more than two
|
||||
seconds in the spin boxes.
|
||||
BugFix: Some pkg download/installed sizes were not showing properly at Info tab.
|
||||
BugFix: If we find an outdated AUR pkg in the official pkg list, we remove it.
|
||||
BugFix: Install local packages did not work with space separated paths
|
||||
(thanks to voanhcuoc for pointing it out).
|
||||
BugFix: About and System Upgrade dialogs could be opened twice in notifier.
|
||||
BugFix: Max time in minutes for notification interval was not honoring > 1380.
|
||||
BugFix: Optional dependencies dialog can now be resized and new value is
|
||||
persisted on disk.
|
||||
BugFix: Using the alpm algorithm for package version comparison. Previous code
|
||||
was reporting false newer packages.
|
||||
BugFix: System upgrade button was not disabled while synching packages in notifier.
|
||||
BugFix: searchlineedit font fix.
|
||||
BugFix: 'yaourt' and 'pacaur' no longer honor "-a" option when querying outdated
|
||||
foreign packages.
|
||||
BugFix: System upgrade shortcut changed to "ctrl+P" as "ctrl+U" is used to cut text in
|
||||
QLineEdit widgets.
|
||||
BugFix: When user selected another search option, line edit was not being cleared.
|
||||
BugFix: Disable alien icon while in transaction.
|
||||
BugFix: Do not ask twice for password if a pacman lck file exists.
|
||||
|
||||
0.8.1 (2016-03-27)
|
||||
BugFix: Updated CHAKRA RSS site (thanks to s8321414).
|
||||
BugFix: Distro news now works with https KaOS site.
|
||||
BugFix: Files tab was not refreshing when enabling KCP mode in KaOS.
|
||||
@@ -21,7 +177,7 @@
|
||||
Added support for lxqt-sudo tool (thanks to Manjaro team).
|
||||
Added "pkgfile -u" (if available) in sync db transaction.
|
||||
|
||||
0.8.0
|
||||
0.8.0 (2015-11-08)
|
||||
This is a Qt5 only version (with the exception of 'octopi-notifier').
|
||||
BugFix: Speed optimizations in startup code (AUR outdated list).
|
||||
BugFix: Octopi now honors the $SHELL variable (thanks to LAC1213).
|
||||
@@ -52,7 +208,7 @@
|
||||
Help/About dialog now shows Pacman information.
|
||||
StatusBar msg got updated with number of selected packages more visible.
|
||||
|
||||
0.7.0
|
||||
0.7.0 (2015-04-27)
|
||||
Major speed fix: Faster pkg list building.
|
||||
Reverted to showing ALL packages at startup.
|
||||
Added a systemd service to speed up the very first octopi startup time.
|
||||
@@ -82,7 +238,7 @@
|
||||
BugFix: If user had no gksu/kdesu/root when clicking "clean" button in
|
||||
cachecleaner, cursor would remain waiting (thanks to imperator-).
|
||||
|
||||
0.6.0
|
||||
0.6.0 (2015-02-27)
|
||||
BugFix: Pkg list was being refreshed twice sometimes.
|
||||
BugFix: Removed some buggy strings from Output tab while in KF5.
|
||||
BugFix: ArrowUp/Down, PageUp/Down and Home/End keys now refresh Package Info tab.
|
||||
@@ -110,7 +266,7 @@
|
||||
Refactorings in SearchLineEdit.
|
||||
BugFixes in RepoEditor translation support (repoeditor is now in Transifex too).
|
||||
|
||||
0.5.0
|
||||
0.5.0 (2014-11-08)
|
||||
BugFix: RepoEditor would not compile with Qt5 lib (thanks to Philm).
|
||||
BugFix: Suppress GConf error strings in output.
|
||||
BugFix: mate-terminal is returning code 255 even when execution of
|
||||
@@ -136,14 +292,14 @@
|
||||
Added support for KStatusNotifier while in KDE (thanks to brcha).
|
||||
Updated translations.
|
||||
|
||||
0.4.2
|
||||
0.4.2 (2014-07-26)
|
||||
BugFix: when searching AUR pkgs, given search string was not being matched
|
||||
by package descriptions.
|
||||
BugFix: Sometimes got a gconf bug string at sync db.
|
||||
Updated a bunch of translations.
|
||||
Added support for the new kcp tool (Go version).
|
||||
|
||||
0.4.1
|
||||
0.4.1 (2014-07-12)
|
||||
Added basque translation (thanks to tarteka).
|
||||
Added es_AR translation (thanks to javier).
|
||||
Added japanese translation (thanks to UTUMI Hirosi - utuhiro78).
|
||||
@@ -171,7 +327,7 @@
|
||||
Added Search by file feature (pacman -Qo).
|
||||
Added a string validator in the search edit widget.
|
||||
|
||||
0.4.0
|
||||
0.4.0 (2014-05-24)
|
||||
Huge refactorings in model/view that brings consistent memory and
|
||||
speed improvements - a single model and a central data storage (thanks to
|
||||
Thomas Binkau - tbinkau).
|
||||
@@ -225,7 +381,7 @@
|
||||
Fixed getBuildDate code to always convert dates to english format.
|
||||
Updated some translations.
|
||||
|
||||
0.3.2
|
||||
0.3.2 (2014-02-14)
|
||||
Cleaned unused code.
|
||||
Added icon for mirror-check while in KaOS.
|
||||
Does a mirror-check at startup while in KaOS.
|
||||
@@ -240,7 +396,7 @@
|
||||
BugFix: When the user had no yaourt in the system, there were a zombie
|
||||
octopi process 'left running'.
|
||||
|
||||
0.3.1
|
||||
0.3.1 (2014-01-14)
|
||||
Added support for Qt5.
|
||||
Added chinese (Taiwan), malay, slovak and ukrainian translations.
|
||||
Added support to KaOS, a lean KDE centric Linux distro.
|
||||
@@ -251,7 +407,7 @@
|
||||
first searches into transaction queue for them.
|
||||
BugFix: Prevent header resizing in File and Transaction tabs.
|
||||
|
||||
0.3
|
||||
0.3.0 (2013-11-03)
|
||||
Code cleanings.
|
||||
BugFix: No need to refresh package list after a cache clean.
|
||||
BugFix: Konsole was not working with yaourt package installation.
|
||||
@@ -298,7 +454,7 @@
|
||||
Added an About Dialog to Octopi Notifier.
|
||||
Updated translations.
|
||||
|
||||
0.2
|
||||
0.2.0 (2013-08-24)
|
||||
Splitted the project in "octopi" and "octopi-notifier".
|
||||
Yaourt no longer runs with root permissions.
|
||||
Added support for package multi selection in Yaourt mode.
|
||||
@@ -319,23 +475,23 @@
|
||||
IgnorePkg option is now used to build outdated package list.
|
||||
BugFix: Empty pkg descriptions are now shown as empty.
|
||||
|
||||
0.1.9.1
|
||||
0.1.9.1 (2013-07-14)
|
||||
Important bugfixes to deal with multithreaded code.
|
||||
Added a "globals.h/.cpp" file to group QFutureWatcher globals.
|
||||
Updated style changing code in main.cpp.
|
||||
BugFix: when user cancelled a sysupgrade transaction inside a
|
||||
terminal, the package actions remained disabled.
|
||||
|
||||
0.1.9
|
||||
0.1.9 (2013-07-09)
|
||||
Added yaourt support.
|
||||
Updated most of the translations.
|
||||
|
||||
0.1.8
|
||||
0.1.8 (2013-06-16)
|
||||
Added czech translation.
|
||||
Added support to ArchBang Linux.
|
||||
Added a systemtray icon notifier feature using DBus technology.
|
||||
|
||||
0.1.7.3
|
||||
0.1.7.3 (2013-05-26)
|
||||
Added a TRANSLATIONS file.
|
||||
Added danish translation.
|
||||
Added indonesian translation.
|
||||
@@ -345,14 +501,14 @@ terminal, the package actions remained disabled.
|
||||
Bugfix: sysupgrade must refresh packagelist after syncdatabase.
|
||||
Bugfix: if sysupgrade uses SyncFirst, makes it automatically start a second upgrade.
|
||||
|
||||
0.1.7.2
|
||||
0.1.7.2 (2013-05-17)
|
||||
Added catalan translation.
|
||||
Bugfix: updated new binary translation files to the resources.
|
||||
|
||||
0.1.7.1
|
||||
0.1.7.1 (2013-05-11)
|
||||
Bugfix: menu icons were not being shown while in Xfce.
|
||||
|
||||
0.1.7
|
||||
0.1.7 (2013-05-11)
|
||||
Added "-sysupgrade" command line option.
|
||||
Added "-removecmd" command line option.
|
||||
Added lots of translations.
|
||||
@@ -360,11 +516,11 @@ terminal, the package actions remained disabled.
|
||||
Added an About dialog.
|
||||
Changed the old About tab to Usage tab.
|
||||
|
||||
0.1.6.1
|
||||
0.1.6.1 (2013-04-25)
|
||||
Added pt_BR translation.
|
||||
Added "Open root terminal" option in File menu.
|
||||
|
||||
0.1.6
|
||||
0.1.6 (2013-04-12)
|
||||
Added a new Transaction Dialog.
|
||||
Added a Firefox-like search inside Files, News and About tabs.
|
||||
Added support for Chakra.
|
||||
@@ -372,33 +528,33 @@ terminal, the package actions remained disabled.
|
||||
Added option to execute any transaction inside a terminal.
|
||||
Changed ProgressDialog to a progressBar at the screen bottom.
|
||||
|
||||
0.1.5
|
||||
0.1.5 (2013-04-06)
|
||||
Added option to search packages by description and name.
|
||||
Added support for pacman version 4.1.
|
||||
Transactions with conflict errors can be re-executed inside a terminal.
|
||||
Reworked Manjaro Linux theme.
|
||||
|
||||
0.1.4.1
|
||||
0.1.4.1 (2013-03-30)
|
||||
Bugfix release
|
||||
Added total download size information in transaction dialog.
|
||||
|
||||
0.1.4
|
||||
0.1.4 (2013-03-28)
|
||||
Added a Manjaro Linux theme.
|
||||
Changed position of filter line edit to the toolbar.
|
||||
|
||||
0.1.3
|
||||
0.1.3 (2013-03-19)
|
||||
Added better support to Qt dark themes.
|
||||
Added context menu support inside Files tab.
|
||||
Made URLs clickable inside Output tab.
|
||||
Fixed the annoying Packager information display bug.
|
||||
|
||||
0.1.2
|
||||
0.1.2 (2013-03-18)
|
||||
Tons of refactorings and bugfixes.
|
||||
Small changes in UI.
|
||||
|
||||
0.1.1
|
||||
0.1.1 (2013-03-17)
|
||||
Added all six tabs.
|
||||
Added support for groups of packages.
|
||||
|
||||
0.1.0
|
||||
0.1.0 (2013-03-11)
|
||||
Initial Proof of Concept release.
|
||||
|
||||
116
CMakeLists.txt
Normal file
116
CMakeLists.txt
Normal file
@@ -0,0 +1,116 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(octopi VERSION 0.11.0 LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD True)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
|
||||
add_subdirectory(sudo)
|
||||
add_subdirectory(helper)
|
||||
add_subdirectory(notifier)
|
||||
add_subdirectory(cachecleaner)
|
||||
add_subdirectory(repoeditor)
|
||||
|
||||
find_package(Qt5 5.14.0 REQUIRED COMPONENTS Core Gui Network Xml Widgets LinguistTools)
|
||||
find_package(qtermwidget5 REQUIRED)
|
||||
find_package(alpm_octopi_utils REQUIRED)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
file(GLOB TS_FILES LIST_DIRECTORIES false "${CMAKE_CURRENT_LIST_DIR}/resources/translations/*.ts")
|
||||
qt5_add_translation(qmFiles ${TS_FILES})
|
||||
|
||||
set(src
|
||||
src/QtSolutions/qtsingleapplication.cpp
|
||||
src/QtSolutions/qtlocalpeer.cpp
|
||||
repoeditor/repoentry.cpp
|
||||
src/aurvote.cpp
|
||||
src/propertiestabwidget.cpp
|
||||
src/qaesencryption.cpp
|
||||
src/repoconf.cpp
|
||||
src/main.cpp
|
||||
src/mainwindow.cpp
|
||||
src/strconstants.cpp
|
||||
src/searchlineedit.cpp
|
||||
src/argumentlist.cpp
|
||||
src/settingsmanager.cpp
|
||||
src/package.cpp
|
||||
src/unixcommand.cpp
|
||||
src/wmhelper.cpp
|
||||
src/treeviewpackagesitemdelegate.cpp
|
||||
src/mainwindow_init.cpp
|
||||
src/mainwindow_transaction.cpp
|
||||
src/mainwindow_events.cpp
|
||||
src/mainwindow_help.cpp
|
||||
src/searchbar.cpp
|
||||
src/mainwindow_searchbar.cpp
|
||||
src/transactiondialog.cpp
|
||||
src/mainwindow_news.cpp
|
||||
src/mainwindow_refresh.cpp
|
||||
src/globals.cpp
|
||||
src/multiselectiondialog.cpp
|
||||
src/packagerepository.cpp
|
||||
src/model/packagemodel.cpp
|
||||
src/ui/octopitabinfo.cpp
|
||||
src/utils.cpp
|
||||
src/terminal.cpp
|
||||
src/pacmanexec.cpp
|
||||
src/optionsdialog.cpp
|
||||
src/packagetreeview.cpp
|
||||
src/termwidget.cpp
|
||||
src/alpmbackend.cpp)
|
||||
|
||||
set(header
|
||||
src/QtSolutions/qtsingleapplication.h
|
||||
src/QtSolutions/qtlocalpeer.h
|
||||
repoeditor/repoentry.h
|
||||
src/aurvote.h
|
||||
src/propertiestabwidget.h
|
||||
src/qaesencryption.h
|
||||
src/repoconf.h
|
||||
src/mainwindow.h
|
||||
src/strconstants.h
|
||||
src/searchlineedit.h
|
||||
src/argumentlist.h
|
||||
src/settingsmanager.h
|
||||
src/uihelper.h
|
||||
src/package.h
|
||||
src/unixcommand.h
|
||||
src/wmhelper.h
|
||||
src/treeviewpackagesitemdelegate.h
|
||||
src/searchbar.h
|
||||
src/transactiondialog.h
|
||||
src/globals.h
|
||||
src/multiselectiondialog.h
|
||||
src/packagerepository.h
|
||||
src/model/packagemodel.h
|
||||
src/ui/octopitabinfo.h
|
||||
src/utils.h
|
||||
src/terminal.h
|
||||
src/pacmanexec.h
|
||||
src/constants.h
|
||||
src/optionsdialog.h
|
||||
src/packagetreeview.h
|
||||
src/termwidget.h
|
||||
src/alpmbackend.h)
|
||||
|
||||
set(ui ui/mainwindow.ui ui/transactiondialog.ui ui/multiselectiondialog.ui ui/optionsdialog.ui)
|
||||
|
||||
set(qrc resources.qrc)
|
||||
|
||||
qt5_wrap_ui(src ${ui})
|
||||
qt5_add_resources(src ${qrc})
|
||||
|
||||
add_executable(octopi ${src} ${header} ${qmFiles})
|
||||
target_compile_definitions(octopi PRIVATE OCTOPI_EXTENSIONS ALPM_BACKEND QT_DEPRECATED_WARNINGS QT_USE_QSTRINGBUILDER QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII QT_NO_URL_CAST_FROM_STRING QT_NO_CAST_FROM_BYTEARRAY)
|
||||
target_include_directories(octopi PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS})
|
||||
target_link_libraries(octopi PRIVATE Qt5::Core Qt5::Gui Qt5::Network Qt5::Xml Qt5::Widgets qtermwidget5 alpm_octopi_utils)
|
||||
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/resources/images/octopi_green.png" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
file(RENAME "${CMAKE_CURRENT_BINARY_DIR}/octopi_green.png" "${CMAKE_CURRENT_BINARY_DIR}/octopi.png")
|
||||
install(TARGETS octopi RUNTIME DESTINATION bin LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include)
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/octopi.desktop" DESTINATION share/applications)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/octopi.png" "${CMAKE_CURRENT_SOURCE_DIR}/resources/images/octopi_green.png" DESTINATION share/icons/gnome/32x32/apps)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/octopi.png" "${CMAKE_CURRENT_SOURCE_DIR}/resources/images/octopi_green.png"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/resources/images/octopi_red.png" "${CMAKE_CURRENT_SOURCE_DIR}/resources/images/octopi_yellow.png" DESTINATION share/icons)
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" DESTINATION share/licenses/octopi)
|
||||
17
INSTALL
17
INSTALL
@@ -1,6 +1,6 @@
|
||||
Installing Octopi is a pretty straightforward task.
|
||||
|
||||
Assuming you have updated Qt4(*) libs installed in your system, all
|
||||
Assuming you have updated Qt5 libs installed in your system, all
|
||||
you have to do is run:
|
||||
|
||||
makepkg -f
|
||||
@@ -8,21 +8,10 @@ you have to do is run:
|
||||
Wait for the compilation and then install the generated package (as
|
||||
root), using:
|
||||
|
||||
pacman -U [--force] <nameOfTheGeneratedOctopiPackage.tar.xz>
|
||||
pacman -U <nameOfTheGeneratedOctopiPackage.tar.[xz|zst]>
|
||||
|
||||
You can also install the generated package notifier, using:
|
||||
|
||||
pacman -U [--force] <nameOfTheGeneratedOctopiNotifierPackage.tar.xz>
|
||||
|
||||
Octopi is located at the system utilities menu of your Desktop
|
||||
Octopi is located on the system utilities menu of your Desktop
|
||||
Environment.
|
||||
|
||||
|
||||
Enjoy!
|
||||
|
||||
(*) Octopi is also Qt5 compatible, you'll only have to adjust the
|
||||
"depends" section in PKGBUILD.
|
||||
|
||||
If you are compiling Octopi in a KDE centric-distro like KaOS and Chakra, you should
|
||||
first uncomment the "#define NO_GTK_STYLE" string located at "src/main.cpp" and
|
||||
"notifier/octopi-notifier/main.cpp", otherwise it won't compile at all.
|
||||
|
||||
139
PKGBUILD
139
PKGBUILD
@@ -1,107 +1,52 @@
|
||||
pkgname=('octopi' 'octopi-notifier' 'octopi-repoeditor' 'octopi-cachecleaner')
|
||||
pkgver=0.8.1
|
||||
pkgname=octopi
|
||||
pkgver=0.11.0
|
||||
pkgrel=1
|
||||
pkgdesc="a powerful Pacman frontend using Qt libs"
|
||||
pkgdesc="This is Octopi, a powerful Pacman frontend using Qt libs"
|
||||
url="https://tintaescura.com/projects/octopi/"
|
||||
arch=('i686' 'x86_64')
|
||||
url="http://octopiproject.wordpress.com"
|
||||
license=('GPL2')
|
||||
install=$pkgname.install
|
||||
depends=('alpm_octopi_utils' 'pkgfile' 'qtermwidget' 'sudo')
|
||||
makedepends=('git')
|
||||
depends=('qt4' 'qt5-quickcontrols' 'xterm')
|
||||
optdepends=('kdesu: for KDE'
|
||||
'gksu: for XFCE, Gnome, LXDE, Cinnamon'
|
||||
'gnome-keyring: for password management'
|
||||
'gist: for SysInfo report'
|
||||
'yaourt: for AUR support'
|
||||
'octopi-notifier: for notifications'
|
||||
'pkgfile: to view uninstalled pkg contents in ArchLinux')
|
||||
provides=('octopi')
|
||||
md5sums=()
|
||||
groups=('system')
|
||||
install=octopi.install
|
||||
source=("git+https://github.com/aarnt/octopi.git")
|
||||
md5sums=('SKIP')
|
||||
|
||||
build() {
|
||||
cpucount=$(grep -c processor /proc/cpuinfo 2>/dev/null)
|
||||
jc=$((${cpucount:-1}))
|
||||
|
||||
#cd "$srcdir"
|
||||
msg "Starting build..."
|
||||
|
||||
cd $startdir
|
||||
qmake-qt5 $pkgname.pro
|
||||
make -j $jc
|
||||
|
||||
cd $startdir/notifier/pacmanhelper
|
||||
msg "Building pacmanhelper..."
|
||||
qmake-qt5 pacmanhelper.pro
|
||||
make -j $jc
|
||||
|
||||
cd $startdir/notifier/octopi-notifier
|
||||
msg "Building octopi-notifier..."
|
||||
qmake-qt4 octopi-notifier.pro
|
||||
make -j $jc
|
||||
|
||||
cd $startdir/repoeditor
|
||||
msg "Building octopi-repoeditor..."
|
||||
qmake-qt5 octopi-repoeditor.pro
|
||||
make -j $jc
|
||||
|
||||
cd $startdir/cachecleaner
|
||||
msg "Building octopi-cachecleaner..."
|
||||
qmake-qt5 octopi-cachecleaner.pro
|
||||
make -j $jc
|
||||
|
||||
}
|
||||
|
||||
package_octopi() {
|
||||
#Octopi main files
|
||||
install -D -m755 $startdir/bin/$pkgname ${pkgdir}/usr/bin/$pkgname
|
||||
install -D -m644 $startdir/$pkgname.desktop ${pkgdir}/usr/share/applications/$pkgname.desktop
|
||||
install -D -m644 $startdir/resources/images/${pkgname}_green.png ${pkgdir}/usr/share/icons/$pkgname.png
|
||||
install -D -m644 $startdir/resources/images/${pkgname}_green.png ${pkgdir}/usr/share/icons/gnome/32x32/apps/$pkgname.png
|
||||
install -D -m644 $startdir/resources/images/${pkgname}_red.png ${pkgdir}/usr/share/icons/${pkgname}_red.png
|
||||
install -D -m644 $startdir/resources/images/${pkgname}_yellow.png ${pkgdir}/usr/share/icons/${pkgname}_yellow.png
|
||||
|
||||
#speedup files
|
||||
install -D -m755 $startdir/speedup/speedup-octopi.sh ${pkgdir}/usr/bin/speedup-octopi.sh
|
||||
install -D -m644 $startdir/speedup/${pkgname}.service ${pkgdir}/etc/systemd/system/${pkgname}.service
|
||||
|
||||
#Pacmaneditor files
|
||||
install -D -m755 $startdir/repoeditor/bin/octopi-repoeditor ${pkgdir}/usr/bin/octopi-repoeditor
|
||||
|
||||
#Cachecleaner files
|
||||
install -D -m755 $startdir/cachecleaner/bin/octopi-cachecleaner ${pkgdir}/usr/bin/octopi-cachecleaner
|
||||
install -D -m644 $startdir/cachecleaner/octopi-cachecleaner.desktop ${pkgdir}/usr/share/applications/octopi-cachecleaner.desktop
|
||||
}
|
||||
|
||||
package_octopi-notifier() {
|
||||
pkgdesc="Notifier for Octopi"
|
||||
depends=('libnotify')
|
||||
optdepends=('octopi: launch graphical package manager from tray'
|
||||
'xfce4-notifyd: for notifications in XFCE')
|
||||
|
||||
#Pacmanhelper service files
|
||||
install -D -m755 $startdir/notifier/bin/pacmanhelper ${pkgdir}/usr/lib/octopi/pacmanhelper
|
||||
|
||||
install -D -m644 $startdir/notifier/pacmanhelper/polkit/org.octopi.pacman.policy ${pkgdir}/usr/share/polkit-1/actions/org.octopi.pacman.policy
|
||||
install -D -m644 $startdir/notifier/pacmanhelper/polkit/org.octopi.pacmanhelper.conf ${pkgdir}/etc/dbus-1/system.d/org.octopi.pacmanhelper.conf
|
||||
install -D -m644 $startdir/notifier/pacmanhelper/polkit/org.octopi.pacmanhelper.xml ${pkgdir}/usr/share/dbus-1/interfaces/org.octopi.pacmanhelper.xml
|
||||
install -D -m644 $startdir/notifier/pacmanhelper/polkit/org.octopi.pacmanhelper.service ${pkgdir}/usr/share/dbus-1/system-services/org.octopi.pacmanhelper.service
|
||||
|
||||
#Octopi-notifier file
|
||||
install -D -m755 $startdir/notifier/bin/octopi-notifier ${pkgdir}/usr/bin/octopi-notifier
|
||||
install -D -m644 $startdir/octopi-notifier.desktop ${pkgdir}/etc/xdg/autostart/octopi-notifier.desktop
|
||||
}
|
||||
|
||||
package_octopi-repoeditor() {
|
||||
pkgdesc="Repoeditor for Octopi"
|
||||
prepare() {
|
||||
cd "${pkgname}"
|
||||
|
||||
#Octopi-repoeditor file
|
||||
install -D -m755 $startdir/repoeditor/bin/octopi-repoeditor ${pkgdir}/usr/bin/octopi-repoeditor
|
||||
# enable the kstatus switch, disable if you wish to build without Plasma/knotifications support
|
||||
sed -e "s|DEFINES += ALPM_BACKEND #KSTATUS|DEFINES += ALPM_BACKEND KSTATUS|" -i notifier/octopi-notifier.pro
|
||||
|
||||
cp resources/images/octopi_green.png resources/images/octopi.png
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${pkgname}"
|
||||
echo "Starting build..."
|
||||
qmake-qt5 PREFIX=/usr QMAKE_CFLAGS="${CFLAGS}" QMAKE_CXXFLAGS="${CXXFLAGS}" QMAKE_LFLAGS="${LDFLAGS}" octopi.pro
|
||||
make
|
||||
|
||||
_subdirs="cachecleaner helper notifier repoeditor sudo"
|
||||
|
||||
for _subdir in $_subdirs; do
|
||||
pushd $_subdir
|
||||
echo "Building octopi-$_subdir..."
|
||||
qmake-qt5 PREFIX=/usr QMAKE_CFLAGS="${CFLAGS}" QMAKE_CXXFLAGS="${CXXFLAGS}" QMAKE_LFLAGS="${LDFLAGS}" "octopi-$_subdir.pro"
|
||||
make
|
||||
popd
|
||||
done
|
||||
}
|
||||
|
||||
package_octopi-cachecleaner() {
|
||||
pkgdesc="Cachecleaner for Octopi"
|
||||
package() {
|
||||
cd "${pkgname}"
|
||||
make INSTALL_ROOT="${pkgdir}" install
|
||||
|
||||
#Octopi-cachecleaner file
|
||||
install -D -m755 $startdir/cachecleaner/bin/octopi-cachecleaner ${pkgdir}/usr/bin/octopi-cachecleaner
|
||||
install -D -m644 $startdir/cachecleaner/$pkgname.desktop ${pkgdir}/usr/share/applications/$pkgname.desktop
|
||||
_subdirs="cachecleaner helper notifier repoeditor sudo"
|
||||
|
||||
for _subdir in $_subdirs; do
|
||||
pushd $_subdir
|
||||
make INSTALL_ROOT="${pkgdir}" install
|
||||
popd
|
||||
done
|
||||
}
|
||||
|
||||
143
README.md
143
README.md
@@ -1,57 +1,136 @@
|
||||
## This is Octopi, a powerful Pacman/AUR frontend using Qt libs.
|
||||
## This is Octopi, a powerful Pacman/AUR front end using Qt libs.
|
||||
|
||||
The project site is hosted at https://octopiproject.wordpress.com
|
||||

|
||||
|
||||
The project site is hosted on https://tintaescura.com/projects/octopi
|
||||
|
||||
Currently, 10 Linux distros are compatible with it
|
||||
|
||||
* [Antergos] (https://antergos.com/)
|
||||
* [ArchBang] (http://wiki.archbang.org/index.php?title=Main_Page)
|
||||
* [Arch] (https://www.archlinux.org/)
|
||||
* [ArchBSD] (https://pacbsd.org/)
|
||||
* [Chakra] (https://chakraos.org/)
|
||||
* [KaOS] (http://kaosx.us/)
|
||||
* [Manjaro] (http://manjaro.github.io/)
|
||||
* [mooOS] (http://mooos.org/)
|
||||
* [Netrunner (rolling)]
|
||||
(http://www.netrunner.com/netrunner-rolling-release/)
|
||||
* [Parabola GNU/Linux-libre] (http://www.parabola.nu/https/)
|
||||
* [ArchBang](http://archbang.org/)
|
||||
* [Arch Linux](https://www.archlinux.org/)
|
||||
* [ArcoLinux](https://arcolinux.info/)
|
||||
* [Artix Linux](https://artixlinux.org)
|
||||
* [Chakra](https://chakralinux.org/)
|
||||
* [CondresOS](https://condresos.codelinsoft.it/)
|
||||
* [EndeavourOS](https://endeavouros.com/)
|
||||
* [KaOS](https://kaosx.us/)
|
||||
* [Manjaro](https://manjaro.org/)
|
||||
* [Parabola GNU/Linux-libre](https://www.parabola.nu/)
|
||||
|
||||
### What you must install in your system to have Octopi fully functional
|
||||
### What you must install in order to have Octopi fully functional
|
||||
|
||||
You'll need a privilege escalation tool to use it, once running as
|
||||
root will ONLY work in KDE. Octopi supports gksu, kdesu and lxqt-sudo for
|
||||
that.
|
||||
You'll need:
|
||||
* [Alpm_octopi_utils](https://github.com/aarnt/alpm_octopi_utils/) library
|
||||
* A helper to execute pacman commands called "octphelper", available on "./helper" dir
|
||||
* A privilege escalation tool called "octopi-sudo", available on "./sudo" dir
|
||||
* qtermwidget >= 0.14.1 in order to build Octopi with embedded terminal support
|
||||
|
||||
### To install Octopi using pacman
|
||||
|
||||
### Simple steps to build Octopi code
|
||||
|
||||
Assuming you have Qt5 libs properly installed, go to the directory where the code is located:
|
||||
If Octopi package is available in your distro's repository, you can just type:
|
||||
|
||||
```
|
||||
$ cd OCTOPI_PATH
|
||||
$ qmake
|
||||
# pacman -S octopi
|
||||
```
|
||||
|
||||
### Steps to build Octopi source code (qmake)
|
||||
|
||||
Assuming you have vala compiler and Qt5 libs properly installed, follow these steps:
|
||||
|
||||
```
|
||||
$ git clone https://github.com/aarnt/alpm_octopi_utils
|
||||
$ cd alpm_octopi_utils
|
||||
$ make
|
||||
# make install
|
||||
$ cd ..
|
||||
$ git clone https://github.com/aarnt/octopi
|
||||
$ cd octopi/sudo
|
||||
$ qmake-qt5
|
||||
$ make
|
||||
# make install
|
||||
$ cd ../helper
|
||||
$ qmake-qt5
|
||||
$ make
|
||||
# make install
|
||||
$ cd ../notifier
|
||||
$ qmake-qt5
|
||||
$ make
|
||||
# make install
|
||||
$ cd ../cachecleaner
|
||||
$ qmake-qt5
|
||||
$ make
|
||||
# make install
|
||||
$ cd ../repoeditor
|
||||
$ qmake-qt5
|
||||
$ make
|
||||
# make install
|
||||
$ cd ..
|
||||
$ qmake-qt5
|
||||
$ make
|
||||
# make install
|
||||
```
|
||||
|
||||
You can also use the available PKGBUILD script that helps you build Octopi with all its tools:
|
||||
|
||||
```
|
||||
$ cd OCTOPI_PATH
|
||||
$ cd OCTOPI_PATH (where you git cloned the source code)
|
||||
$ makepkg -f
|
||||
```
|
||||
|
||||
### How to enable the "alien" icon at toolbar
|
||||
### Steps to build Octopi source code (CMake)
|
||||
|
||||
To enable AUR support, you'll need to install "yaourt" or "pacaur" in your system.
|
||||
In Chakra, "ccr" will be supported out of the box.
|
||||
In KaOS, "kcp" will be supported out of the box.
|
||||
As an alternative to qmake, Octopi can also be built with CMake. Make sure that at least CMake 3.5 is installed.
|
||||
|
||||
At first build and install alpm_octopi_utils.
|
||||
|
||||
```
|
||||
$ git clone https://github.com/aarnt/alpm_octopi_utils
|
||||
$ cd alpm_octopi_utils
|
||||
$ mkdir build_dir && cd build_dir
|
||||
$ cmake -G "Unix Makefiles" .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
|
||||
$ make
|
||||
$ sudo make install
|
||||
```
|
||||
|
||||
After that build and install Octopi.
|
||||
|
||||
```
|
||||
$ git clone https://github.com/aarnt/octopi
|
||||
$ cd octopi
|
||||
$ mkdir build_dir && cd build_dir
|
||||
$ cmake -G "Unix Makefiles" .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
|
||||
$ make
|
||||
$ sudo make install
|
||||
```
|
||||
|
||||
### To run Octopi
|
||||
|
||||
```
|
||||
$ /usr/bin/octopi
|
||||
```
|
||||
|
||||
### To run Octopi Notifier
|
||||
|
||||
```
|
||||
$ /usr/bin/octopi-notifier
|
||||
```
|
||||
|
||||
### To enable AUR support (that "green alien" icon on toolbar)
|
||||
|
||||
You'll need to install [pacaur](https://github.com/rmarquis/pacaur),
|
||||
[pikaur](https://github.com/actionless/pikaur), [trizen](https://github.com/trizen/trizen) or
|
||||
[yay](https://github.com/Jguer/yay) in your system.
|
||||
If neither of the previous tools are found Octopi will download latest "yay-bin" github binary.
|
||||
In Chakra, [chaser](https://github.com/ccr-tools/chaser) will be supported out of the box.
|
||||
In KaOS, [kcp](https://github.com/bvaudour/kcp) will be supported out of the box.
|
||||
|
||||
### Ways to help/support Octopi
|
||||
|
||||
* You can "Star" it at the Github page - https://github.com/aarnt/octopi/star
|
||||
* You can vote in the AUR package available at https://aur.archlinux.org/packages/octopi/
|
||||
* You can translate it to your mother language at https://www.transifex.com/projects/p/octopi/
|
||||
* You can follow author's twitter account at https://twitter.com/aaarnt
|
||||
* You can buy author's technical book (currently in portuguese) about Octopi and Qt5 at
|
||||
* You can "Star" it on the Github page - https://github.com/aarnt/octopi/
|
||||
* You can vote in the AUR package available on https://aur.archlinux.org/packages/octopi/
|
||||
* You can translate it to your mother language on https://www.transifex.com/projects/p/octopi/
|
||||
* You can follow author's twitter account on https://twitter.com/aaarnt
|
||||
* You can buy author's technical book (currently in portuguese) about Octopi and Qt5 on
|
||||
http://www.amazon.com.br/Aprendendo-Qt-com-projeto-Octopi-ebook/dp/B015ICHKV6
|
||||
* You can write a review about it (text / video)
|
||||
* You can donate money to the project Paypal - http://sourceforge.net/donate/index.php?group_id=186459
|
||||
|
||||
@@ -6,3 +6,4 @@ file_filter = resources/translations/octopi_cachecleaner_<lang>.ts
|
||||
source_file = resources/translations/octopi_cachecleaner_en.ts
|
||||
source_lang = en
|
||||
type = QT
|
||||
|
||||
|
||||
55
cachecleaner/CMakeLists.txt
Normal file
55
cachecleaner/CMakeLists.txt
Normal file
@@ -0,0 +1,55 @@
|
||||
find_package(Qt5 REQUIRED COMPONENTS Core Network Xml Widgets LinguistTools)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
file(GLOB TS_FILES LIST_DIRECTORIES false "${CMAKE_CURRENT_LIST_DIR}/resources/translations/*.ts")
|
||||
qt5_add_translation(qmFiles ${TS_FILES})
|
||||
|
||||
set(src
|
||||
main.cpp
|
||||
cachecleaner.cpp
|
||||
packagegroupmodel.cpp
|
||||
../src/strconstants.cpp
|
||||
../src/qaesencryption.cpp
|
||||
../src/unixcommand.cpp
|
||||
../src/wmhelper.cpp
|
||||
../src/terminal.cpp
|
||||
../src/settingsmanager.cpp
|
||||
../src/searchlineedit.cpp
|
||||
../src/utils.cpp
|
||||
../src/package.cpp
|
||||
../src/QtSolutions/qtsingleapplication.cpp
|
||||
../src/QtSolutions/qtlocalpeer.cpp
|
||||
#../src/QtSolutions/qtlockedfile.cpp
|
||||
../src/QtSolutions/qtsinglecoreapplication.cpp)
|
||||
|
||||
set(header
|
||||
cachecleaner.h
|
||||
packagegroupmodel.h
|
||||
../src/strconstants.h
|
||||
../src/qaesencryption.h
|
||||
../src/unixcommand.h
|
||||
../src/wmhelper.h
|
||||
../src/terminal.h
|
||||
../src/settingsmanager.h
|
||||
../src/searchlineedit.h
|
||||
../src/utils.h
|
||||
../src/package.h
|
||||
../src/QtSolutions/qtsingleapplication.h
|
||||
../src/QtSolutions/qtlocalpeer.h
|
||||
#../src/QtSolutions/qtlockedfile.h
|
||||
../src/QtSolutions/qtsinglecoreapplication.h)
|
||||
|
||||
set(ui ui/cachecleaner.ui)
|
||||
|
||||
set(qrc resources.qrc)
|
||||
|
||||
qt5_wrap_ui(src ${ui})
|
||||
qt5_add_resources(src ${qrc})
|
||||
|
||||
add_executable(octopi-cachecleaner ${src} ${header} ${qmFiles})
|
||||
target_compile_definitions(octopi-cachecleaner PRIVATE QT_USE_QSTRINGBUILDER QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII QT_NO_URL_CAST_FROM_STRING QT_NO_CAST_FROM_BYTEARRAY)
|
||||
target_include_directories(octopi-cachecleaner PRIVATE ${CMAKE_CURRENT_BINARY_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/src/QtSolutions" ${Qt5Core_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS})
|
||||
target_link_libraries(octopi-cachecleaner PRIVATE Qt5::Core Qt5::Network Qt5::Xml Qt5::Widgets)
|
||||
install(TARGETS octopi-cachecleaner RUNTIME DESTINATION bin LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include)
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/octopi-cachecleaner.desktop" DESTINATION share/applications)
|
||||
@@ -20,9 +20,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#include "cachecleaner.h"
|
||||
#include "ui_cachecleaner.h"
|
||||
|
||||
#include "../src/strconstants.h"
|
||||
|
||||
#include <QKeyEvent>
|
||||
#include <QTcpServer>
|
||||
#include <QTcpSocket>
|
||||
#include <QMessageBox>
|
||||
|
||||
/*
|
||||
* CacheCleaner window constructor
|
||||
*/
|
||||
@@ -30,7 +34,6 @@ CacheCleaner::CacheCleaner(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::CacheCleaner)
|
||||
{
|
||||
|
||||
//UI initialization
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -40,19 +43,23 @@ CacheCleaner::CacheCleaner(QWidget *parent) :
|
||||
int keepUninstalled = SettingsManager::getKeepNumUninstalledPackages();
|
||||
ui->keepUninstalledPackagesSpinner->setValue(keepUninstalled);
|
||||
|
||||
|
||||
//create package group wrappers
|
||||
m_installed = new PackageGroupModel("",
|
||||
m_installed = new PackageGroupModel(QLatin1String(""),
|
||||
ui->installedPackagesList,
|
||||
ui->keepInstalledPackagesSpinner,
|
||||
ui->refreshInstalledButton,
|
||||
ui->cleanInstalledButton);
|
||||
|
||||
m_uninstalled = new PackageGroupModel("-u",
|
||||
m_uninstalled = new PackageGroupModel(QStringLiteral("-u"),
|
||||
ui->uninstalledPackagesList,
|
||||
ui->keepUninstalledPackagesSpinner,
|
||||
ui->refreshUninstalledButton,
|
||||
ui->refreshUninstalledButton,
|
||||
ui->cleanUninstalledButton);
|
||||
|
||||
m_tcpServer = new QTcpServer(this);
|
||||
connect(m_tcpServer, &QTcpServer::newConnection, this, &CacheCleaner::onSendInfoToOctopiHelper);
|
||||
|
||||
restoreGeometry(SettingsManager::getCacheCleanerWindowSize());
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -65,11 +72,88 @@ CacheCleaner::~CacheCleaner()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
/*
|
||||
* Start listening for helper connections
|
||||
*/
|
||||
bool CacheCleaner::startServer()
|
||||
{
|
||||
bool res=true;
|
||||
|
||||
if (!m_tcpServer->listen(QHostAddress::LocalHost, 12703))
|
||||
{
|
||||
QMessageBox::critical(this, StrConstants::getApplicationName(),
|
||||
QStringLiteral("Unable to start the server: %1.")
|
||||
.arg(m_tcpServer->errorString()));
|
||||
res=false;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* Answers Helper if CacheCleaner is executing actions
|
||||
*/
|
||||
void CacheCleaner::onSendInfoToOctopiHelper()
|
||||
{
|
||||
QString msg;
|
||||
QByteArray block;
|
||||
QDataStream out(&block, QIODevice::WriteOnly);
|
||||
out.setVersion(QDataStream::Qt_5_10);
|
||||
|
||||
//Is octopi-helper running?
|
||||
bool isHelperExecuting=UnixCommand::isOctopiHelperRunning();
|
||||
|
||||
bool commandExecuting = (m_installed->isExecutingCommand || m_uninstalled->isExecutingCommand);
|
||||
|
||||
if (isHelperExecuting && commandExecuting)
|
||||
{
|
||||
msg=QLatin1String("Octopi est occupatus");
|
||||
out << msg;
|
||||
}
|
||||
else if (isHelperExecuting && !commandExecuting)
|
||||
{
|
||||
msg=QLatin1String("Octopi serenum est");
|
||||
out << msg;
|
||||
}
|
||||
else
|
||||
{
|
||||
msg=QLatin1String("Atramento nigro");
|
||||
out << msg;
|
||||
}
|
||||
|
||||
QTcpSocket *clientConnection = m_tcpServer->nextPendingConnection();
|
||||
if (clientConnection->isOpen())
|
||||
{
|
||||
connect(clientConnection, &QAbstractSocket::disconnected,
|
||||
clientConnection, &QObject::deleteLater);
|
||||
|
||||
clientConnection->write(block);
|
||||
clientConnection->disconnectFromHost();
|
||||
}
|
||||
|
||||
//m_installed->isExecutingCommand=false;
|
||||
//m_uninstalled->isExecutingCommand=false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Save settings when closing window
|
||||
*/
|
||||
void CacheCleaner::closeEvent(QCloseEvent *)
|
||||
{
|
||||
QByteArray windowSize=saveGeometry();
|
||||
|
||||
SettingsManager::setCacheCleanerWindowSize(windowSize);
|
||||
SettingsManager::setKeepNumInstalledPackages(ui->keepInstalledPackagesSpinner->value());
|
||||
SettingsManager::setKeepNumUninstalledPackages(ui->keepUninstalledPackagesSpinner->value());
|
||||
}
|
||||
|
||||
/*
|
||||
* Whenever user presses ESC, we quit the program
|
||||
*/
|
||||
void CacheCleaner::keyPressEvent(QKeyEvent *ke)
|
||||
{
|
||||
if (ke->key() == Qt::Key_Escape)
|
||||
{
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#include "packagegroupmodel.h"
|
||||
|
||||
class QTcpServer;
|
||||
|
||||
namespace Ui {
|
||||
class CacheCleaner;
|
||||
}
|
||||
@@ -38,16 +40,21 @@ class CacheCleaner : public QMainWindow
|
||||
|
||||
private:
|
||||
Ui::CacheCleaner *ui;
|
||||
|
||||
PackageGroupModel *m_installed;
|
||||
PackageGroupModel *m_uninstalled;
|
||||
QTcpServer *m_tcpServer;
|
||||
|
||||
private slots:
|
||||
void onSendInfoToOctopiHelper();
|
||||
|
||||
public:
|
||||
explicit CacheCleaner(QWidget *parent = 0);
|
||||
~CacheCleaner();
|
||||
bool startServer();
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *);
|
||||
void keyPressEvent(QKeyEvent *);
|
||||
};
|
||||
|
||||
#endif // CACHECLEANER_H
|
||||
|
||||
@@ -19,10 +19,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "cachecleaner.h"
|
||||
|
||||
#include "../src/strconstants.h"
|
||||
#include "../src/QtSolutions/qtsingleapplication.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QMessageBox>
|
||||
#include <QTranslator>
|
||||
#include <QLocale>
|
||||
#include <QLibraryInfo>
|
||||
@@ -30,27 +31,59 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
QtSingleApplication app( "Cache Cleaner - Octopi", argc, argv );
|
||||
unsetenv("TMPDIR");
|
||||
QtSingleApplication app( QStringLiteral("Cache Cleaner - Octopi"), argc, argv );
|
||||
|
||||
//If there is already an instance running...
|
||||
if (app.isRunning())
|
||||
{
|
||||
app.sendMessage("RAISE");
|
||||
app.sendMessage(QStringLiteral("RAISE"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
app.sendMessage("RAISE");
|
||||
app.sendMessage(QStringLiteral("RAISE"));
|
||||
|
||||
QTranslator appTranslator;
|
||||
appTranslator.load(":/resources/translations/octopi_cachecleaner_" +
|
||||
appTranslator.load(QLatin1String(":/resources/translations/octopi_cachecleaner_") +
|
||||
QLocale::system().name());
|
||||
app.installTranslator(&appTranslator);
|
||||
|
||||
if (UnixCommand::isRootRunning()){
|
||||
QMessageBox::critical( 0, StrConstants::getApplicationName(), StrConstants::getErrorRunningWithRoot());
|
||||
return (-2);
|
||||
}
|
||||
|
||||
if (!UnixCommand::hasTheExecutable(QStringLiteral("paccache")))
|
||||
{
|
||||
QMessageBox::critical( 0, StrConstants::getApplicationName(), StrConstants::getExecutableCouldNotBeFound().arg(QStringLiteral("\"paccache\"")));
|
||||
return (-3);
|
||||
}
|
||||
|
||||
if (!QFile::exists(ctn_OCTOPI_HELPER_PATH))
|
||||
{
|
||||
qDebug() << "Aborting cache-cleaner as 'octphelper' binary could not be found! [" << ctn_OCTOPI_HELPER_PATH << "]";
|
||||
return (-4);
|
||||
}
|
||||
|
||||
if (!QFile::exists(ctn_OCTOPISUDO))
|
||||
{
|
||||
qDebug() << "Aborting cache-cleaner as 'octopi-sudo' binary could not be found! [" << ctn_OCTOPISUDO << "]";
|
||||
return (-5);
|
||||
}
|
||||
|
||||
if (!UnixCommand::isOctoToolRunning(QStringLiteral("octopi-cachecle")))
|
||||
{
|
||||
QMessageBox::critical(nullptr, StrConstants::getApplicationName(), StrConstants::getErrorRunOctopiCacheCleanerAsUsrBin());
|
||||
return (-6);
|
||||
}
|
||||
|
||||
CacheCleaner w;
|
||||
app.setActivationWindow(&w);
|
||||
w.show();
|
||||
if (w.startServer())
|
||||
{
|
||||
app.setActivationWindow(&w);
|
||||
w.show();
|
||||
QResource::registerResource(QStringLiteral("./resources.qrc"));
|
||||
|
||||
QResource::registerResource("./resources.qrc");
|
||||
|
||||
return app.exec();
|
||||
return app.exec();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Desktop Entry]
|
||||
Name=Octopi CacheCleaner
|
||||
Icon=octopi
|
||||
Exec=octopi-cachecleaner
|
||||
Exec=/usr/bin/octopi-cachecleaner
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=GNOME;GTK;System;
|
||||
|
||||
@@ -7,6 +7,14 @@
|
||||
QT += core gui network xml widgets
|
||||
|
||||
CONFIG += qt console warn_on debug
|
||||
|
||||
# Disable automatic string conversions
|
||||
DEFINES += QT_USE_QSTRINGBUILDER \
|
||||
QT_NO_CAST_FROM_ASCII \
|
||||
QT_NO_CAST_TO_ASCII \
|
||||
QT_NO_URL_CAST_FROM_STRING \
|
||||
QT_NO_CAST_FROM_BYTEARRAY
|
||||
|
||||
TEMPLATE = app
|
||||
DESTDIR += bin
|
||||
OBJECTS_DIR += build
|
||||
@@ -16,6 +24,7 @@ UI_DIR += build
|
||||
HEADERS += cachecleaner.h \
|
||||
packagegroupmodel.h \
|
||||
../src/strconstants.h \
|
||||
../src/qaesencryption.h \
|
||||
../src/unixcommand.h \
|
||||
../src/wmhelper.h \
|
||||
../src/terminal.h \
|
||||
@@ -32,6 +41,8 @@ HEADERS += cachecleaner.h \
|
||||
SOURCES += main.cpp \
|
||||
cachecleaner.cpp \
|
||||
packagegroupmodel.cpp \
|
||||
../src/strconstants.cpp \
|
||||
../src/qaesencryption.cpp \
|
||||
../src/unixcommand.cpp \
|
||||
../src/wmhelper.cpp \
|
||||
../src/terminal.cpp \
|
||||
@@ -50,6 +61,7 @@ RESOURCES += resources.qrc
|
||||
|
||||
TRANSLATIONS += resources/translations/octopi_cachecleaner_pt_BR.ts \
|
||||
resources/translations/octopi_cachecleaner_fr_FR.ts \
|
||||
resources/translations/octopi_cachecleaner_fr.ts \
|
||||
resources/translations/octopi_cachecleaner_es_ES.ts \
|
||||
resources/translations/octopi_cachecleaner_es_419.ts \
|
||||
resources/translations/octopi_cachecleaner_es_AR.ts \
|
||||
@@ -66,6 +78,8 @@ TRANSLATIONS += resources/translations/octopi_cachecleaner_pt_BR.ts \
|
||||
resources/translations/octopi_cachecleaner_da.ts \
|
||||
resources/translations/octopi_cachecleaner_cs.ts \
|
||||
resources/translations/octopi_cachecleaner_he.ts \
|
||||
resources/translations/octopi_cachecleaner_hi.ts \
|
||||
resources/translations/octopi_cachecleaner_hi_IN.ts \
|
||||
resources/translations/octopi_cachecleaner_lt.ts \
|
||||
resources/translations/octopi_cachecleaner_nb.ts \
|
||||
resources/translations/octopi_cachecleaner_sr@latin.ts \
|
||||
@@ -79,6 +93,7 @@ TRANSLATIONS += resources/translations/octopi_cachecleaner_pt_BR.ts \
|
||||
resources/translations/octopi_cachecleaner_en_GB.ts \
|
||||
resources/translations/octopi_cachecleaner_pt_PT.ts \
|
||||
resources/translations/octopi_cachecleaner_sv.ts \
|
||||
resources/translations/octopi_cachecleaner_sl.ts \
|
||||
resources/translations/octopi_cachecleaner_hu.ts \
|
||||
resources/translations/octopi_cachecleaner_zh_TW.ts \
|
||||
resources/translations/octopi_cachecleaner_ms_MY.ts \
|
||||
@@ -89,5 +104,28 @@ TRANSLATIONS += resources/translations/octopi_cachecleaner_pt_BR.ts \
|
||||
resources/translations/octopi_cachecleaner_gl_ES.ts \
|
||||
resources/translations/octopi_cachecleaner_ast.ts \
|
||||
resources/translations/octopi_cachecleaner_hr.ts \
|
||||
resources/translations/octopi_cachecleaner_zh-Hans.ts
|
||||
resources/translations/octopi_cachecleaner_zh_CN.ts
|
||||
resources/translations/octopi_cachecleaner_zh-Hans.ts \
|
||||
resources/translations/octopi_cachecleaner_zh_CN.ts \
|
||||
resources/translations/octopi_cachecleaner_ko.ts
|
||||
|
||||
# install
|
||||
isEmpty(PREFIX) {
|
||||
PREFIX = /usr
|
||||
}
|
||||
|
||||
isEmpty(BINDIR) {
|
||||
BINDIR = $$PREFIX/bin
|
||||
}
|
||||
|
||||
isEmpty(DATADIR) {
|
||||
DATADIR = $$PREFIX/share
|
||||
}
|
||||
|
||||
target.path = $$BINDIR
|
||||
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro
|
||||
sources.path = .
|
||||
|
||||
desktop.path = $$DATADIR/applications
|
||||
desktop.files += cachecleaner/octopi-cachecleaner.desktop
|
||||
|
||||
INSTALLS += target desktop
|
||||
|
||||
@@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include "packagegroupmodel.h"
|
||||
#include "../src/strconstants.h"
|
||||
|
||||
#include <QSharedMemory>
|
||||
#include <QApplication>
|
||||
#include <QMessageBox>
|
||||
|
||||
@@ -49,6 +50,8 @@ PackageGroupModel::PackageGroupModel(QString optionsString,
|
||||
{
|
||||
m_cleanButton->setText(tr("Clean"));
|
||||
|
||||
m_sharedMemory=new QSharedMemory(QStringLiteral("org.arnt.octopi"), this);
|
||||
|
||||
//setup UI slots
|
||||
connect( m_spinner, SIGNAL( valueChanged(int) ), SLOT( updateKeepArchives() ) );
|
||||
connect( m_spinner, SIGNAL( valueChanged(int) ), SLOT( refreshCacheView() ) );
|
||||
@@ -56,6 +59,8 @@ PackageGroupModel::PackageGroupModel(QString optionsString,
|
||||
connect( m_refreshButton, SIGNAL( clicked() ), SLOT( refreshCacheView() ) );
|
||||
connect( m_cleanButton, SIGNAL( clicked() ), SLOT( cleanCache() ) );
|
||||
|
||||
isExecutingCommand = false;
|
||||
|
||||
//refresh cache informations at startup
|
||||
refreshCacheView();
|
||||
}
|
||||
@@ -65,6 +70,7 @@ PackageGroupModel::PackageGroupModel(QString optionsString,
|
||||
*/
|
||||
PackageGroupModel::~PackageGroupModel()
|
||||
{
|
||||
UnixCommand::removeSharedMemFiles();
|
||||
delete m_acc;
|
||||
delete m_cmd;
|
||||
}
|
||||
@@ -94,7 +100,7 @@ void PackageGroupModel::keepArchivesChanged()
|
||||
*/
|
||||
QString PackageGroupModel::getOptions()
|
||||
{
|
||||
return m_optionsString + " -k " + QString::number(m_spinner->value());
|
||||
return m_optionsString + QLatin1String("-k ") + QString::number(m_spinner->value());
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -102,6 +108,8 @@ QString PackageGroupModel::getOptions()
|
||||
*/
|
||||
void PackageGroupModel::refreshCacheView()
|
||||
{
|
||||
if (isExecutingCommand) return;
|
||||
|
||||
//update UI for background refresh
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_acc->reset();
|
||||
@@ -115,7 +123,13 @@ void PackageGroupModel::refreshCacheView()
|
||||
QObject::connect(m_cmd, SIGNAL( finished ( int, QProcess::ExitStatus )),
|
||||
this, SLOT( finishedDryrun ( int, QProcess::ExitStatus )) );
|
||||
|
||||
m_cmd->executeCommandAsNormalUser("paccache -v -d " + getOptions());
|
||||
QStringList sl;
|
||||
sl << QStringLiteral("-v");
|
||||
sl << QStringLiteral("-d");
|
||||
QStringList opt = getOptions().split(QStringLiteral(" "), Qt::SkipEmptyParts);
|
||||
sl << opt;
|
||||
m_cmd->executeCommandAsNormalUser(QStringLiteral("/usr/bin/paccache"), sl);
|
||||
isExecutingCommand = true;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -132,7 +146,7 @@ bool PackageGroupModel::isSUAvailable()
|
||||
else if (WMHelper::getSUCommand() == ctn_NO_SU_COMMAND){
|
||||
QMessageBox::critical( 0, StrConstants::getApplicationName(),
|
||||
StrConstants::getErrorNoSuCommand() +
|
||||
"\n" + StrConstants::getYoullNeedSuFrontend());
|
||||
QLatin1String("\n") + StrConstants::getYoullNeedSuFrontend());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -144,6 +158,8 @@ bool PackageGroupModel::isSUAvailable()
|
||||
*/
|
||||
void PackageGroupModel::cleanCache()
|
||||
{
|
||||
if (isExecutingCommand || UnixCommand::isPacmanDbLocked()) return;
|
||||
|
||||
if (!isSUAvailable())
|
||||
return;
|
||||
|
||||
@@ -157,8 +173,10 @@ void PackageGroupModel::cleanCache()
|
||||
QObject::connect(m_cmd, SIGNAL( finished ( int, QProcess::ExitStatus )),
|
||||
this, SLOT( finishedClean( int, QProcess::ExitStatus )) );
|
||||
|
||||
QByteArray tmp = "paccache -r " + getOptions().toLatin1();
|
||||
m_cmd->executeCommand(QLatin1String(tmp), ectn_LANG_USER_DEFINED);
|
||||
isExecutingCommand = true;
|
||||
const QString tmp = QLatin1String("paccache -r ") + getOptions();
|
||||
//UnixCommand::removeTemporaryFiles();
|
||||
m_cmd->executeCommandWithSharedMemHelper(tmp, m_sharedMemory);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -172,10 +190,12 @@ void PackageGroupModel::finishedDryrun(int exitCode, QProcess::ExitStatus)
|
||||
|
||||
QApplication::restoreOverrideCursor();
|
||||
|
||||
isExecutingCommand = false;
|
||||
|
||||
if(exitCode > 1)
|
||||
{
|
||||
//process failed, provide info on errors
|
||||
QMessageBox::critical(m_listView, "Error whith the underlying process", m_acc->getErrors());
|
||||
QMessageBox::critical(m_listView, QStringLiteral("Error whith the underlying process"), m_acc->getErrors());
|
||||
}
|
||||
else if (exitCode == 0)
|
||||
{
|
||||
@@ -198,10 +218,11 @@ void PackageGroupModel::finishedClean(int exitCode, QProcess::ExitStatus)
|
||||
|
||||
QApplication::restoreOverrideCursor();
|
||||
|
||||
isExecutingCommand = false;
|
||||
|
||||
if(exitCode != 0)
|
||||
{
|
||||
//process failed, provide info on errors
|
||||
QMessageBox::critical(m_listView, "Error whith the underlying process",m_acc->getErrors());
|
||||
//process failed, return to main window
|
||||
m_refreshButton->setEnabled(true);
|
||||
m_cleanButton->setEnabled(true);
|
||||
}
|
||||
@@ -218,9 +239,9 @@ void PackageGroupModel::finishedClean(int exitCode, QProcess::ExitStatus)
|
||||
* @param output The output of the dryrun process
|
||||
*/
|
||||
void PackageGroupModel::processDryrunResult(QString output) {
|
||||
QStringList lines = output.split(QRegExp("\\n"), QString::SkipEmptyParts);
|
||||
QStringList lines = output.split(QRegularExpression(QStringLiteral("\\n")), Qt::SkipEmptyParts);
|
||||
|
||||
if(lines.length() == 1 || output.contains("*.pkg.tar?(.+([^.]))"))
|
||||
if(lines.length() == 1 || output.contains(QLatin1String("*.pkg.tar?(.+([^.]))")))
|
||||
{
|
||||
//"==> no candidate packages found for pruning"
|
||||
m_cleanButton->setText(tr("Clean"));
|
||||
@@ -239,14 +260,14 @@ void PackageGroupModel::processDryrunResult(QString output) {
|
||||
else if(i == lines.length() - 1)
|
||||
{
|
||||
//extract size from "==> finished dry run: 8 candidates (disk space saved: 19.11 MiB)")
|
||||
QStringList components = line.split(" ");
|
||||
QStringList components = line.split(QStringLiteral(" "));
|
||||
|
||||
QString unit = components.takeLast();
|
||||
unit.remove(unit.length() - 1, 1);
|
||||
|
||||
QString size = components.takeLast();
|
||||
|
||||
m_cleanButton->setText(tr("Clean %1").arg(" " + size + " " + unit));
|
||||
m_cleanButton->setText(tr("Clean %1").arg(QLatin1Char(' ') + size + QLatin1Char(' ') + unit));
|
||||
}
|
||||
else
|
||||
m_listView->addItem(line);
|
||||
|
||||
@@ -82,10 +82,12 @@ class PackageGroupModel : public QObject
|
||||
|
||||
private:
|
||||
bool isSUAvailable();
|
||||
QSharedMemory *m_sharedMemory;
|
||||
|
||||
public:
|
||||
PackageGroupModel(QString, QListWidget *, QSpinBox *, QPushButton *, QPushButton *);
|
||||
~PackageGroupModel();
|
||||
bool isExecutingCommand;
|
||||
|
||||
protected:
|
||||
QString m_optionsString;
|
||||
|
||||
@@ -18,7 +18,10 @@
|
||||
<file>resources/translations/octopi_cachecleaner_fi.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_fi_FI.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_fr_FR.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_fr.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_he.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_hi.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_hi_IN.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_hu.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_id.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_it.qm</file>
|
||||
@@ -36,7 +39,9 @@
|
||||
<file>resources/translations/octopi_cachecleaner_sr@latin.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_sr_RS.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_sv.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_sl.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_tr_TR.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_tr.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_uk.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_uz.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_vi.qm</file>
|
||||
@@ -44,5 +49,6 @@
|
||||
<file>resources/translations/octopi_cachecleaner_zh-Hans.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_zh_CN.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_hr.qm</file>
|
||||
<file>resources/translations/octopi_cachecleaner_ko.qm</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -4,7 +4,7 @@
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="14"/>
|
||||
<source>Cache Cleaner - Octopi</source>
|
||||
<translation>Llimpiador de caché - Octopi</translation>
|
||||
<translation>Llimpiador de la caché - Octopi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="49"/>
|
||||
@@ -21,7 +21,7 @@
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="82"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="157"/>
|
||||
<source>Number of old versions to keep</source>
|
||||
<translation>Númberu de versiones vieyes pa caltener</translation>
|
||||
<translation>Númberu de versiones vieyes a caltener</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="102"/>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -4,7 +4,7 @@
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="14"/>
|
||||
<source>Cache Cleaner - Octopi</source>
|
||||
<translation>Netejador de la cau (Cache) - Octopi</translation>
|
||||
<translation>Netejador de la cau - Octopi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="49"/>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -4,7 +4,7 @@
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="14"/>
|
||||
<source>Cache Cleaner - Octopi</source>
|
||||
<translation>Cache Renser - Octopi</translation>
|
||||
<translation>Cache-renser - Octopi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="49"/>
|
||||
|
||||
Binary file not shown.
@@ -4,7 +4,7 @@
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="14"/>
|
||||
<source>Cache Cleaner - Octopi</source>
|
||||
<translation>Cache säubern - Octopi</translation>
|
||||
<translation>Zwischenspeicher säubern - Octopi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="49"/>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -15,7 +15,7 @@
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="75"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="150"/>
|
||||
<source>Keep :</source>
|
||||
<translation>Säilytä</translation>
|
||||
<translation>Säilytä:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="82"/>
|
||||
|
||||
Binary file not shown.
@@ -40,12 +40,12 @@
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/packagegroupmodel.cpp" line="199"/>
|
||||
<source>Clean</source>
|
||||
<translation>Putsaa</translation>
|
||||
<translation>Tyhjennä</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/packagegroupmodel.cpp" line="222"/>
|
||||
<source>Clean %1</source>
|
||||
<translation>Putsattu 1%</translation>
|
||||
<translation>Tyhjennä %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
BIN
cachecleaner/resources/translations/octopi_cachecleaner_fr.qm
Normal file
BIN
cachecleaner/resources/translations/octopi_cachecleaner_fr.qm
Normal file
Binary file not shown.
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" ?><!DOCTYPE TS><TS language="fr" version="2.0">
|
||||
<context>
|
||||
<name>CacheCleaner</name>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="14"/>
|
||||
<source>Cache Cleaner - Octopi</source>
|
||||
<translation>Nettoyeur de cache - Octopi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="49"/>
|
||||
<source>Uninstalled packages</source>
|
||||
<translation>Paquets non installés</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="75"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="150"/>
|
||||
<source>Keep :</source>
|
||||
<translation>Conserver :</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="82"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="157"/>
|
||||
<source>Number of old versions to keep</source>
|
||||
<translation>Nombre d'anciennes versions à conserver</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="102"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="183"/>
|
||||
<source>Refresh</source>
|
||||
<translation>Actualiser</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="127"/>
|
||||
<source>Installed packages</source>
|
||||
<translation>Paquets installés</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PackageGroupModel</name>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/packagegroupmodel.cpp" line="199"/>
|
||||
<source>Clean</source>
|
||||
<translation>Nettoyer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/packagegroupmodel.cpp" line="222"/>
|
||||
<source>Clean %1</source>
|
||||
<translation>Nettoyer %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
cachecleaner/resources/translations/octopi_cachecleaner_hi.qm
Normal file
BIN
cachecleaner/resources/translations/octopi_cachecleaner_hi.qm
Normal file
Binary file not shown.
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" ?><!DOCTYPE TS><TS language="hi" version="2.0">
|
||||
<context>
|
||||
<name>CacheCleaner</name>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="14"/>
|
||||
<source>Cache Cleaner - Octopi</source>
|
||||
<translation>कैश हटाने हेतु साधन - ऑक्टोपी</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="49"/>
|
||||
<source>Uninstalled packages</source>
|
||||
<translation>हटाए गए पैकेज</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="75"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="150"/>
|
||||
<source>Keep :</source>
|
||||
<translation>रखें :</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="82"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="157"/>
|
||||
<source>Number of old versions to keep</source>
|
||||
<translation>रखने हेतु पुराने पैकेज की संस्करण संख्या</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="102"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="183"/>
|
||||
<source>Refresh</source>
|
||||
<translation> रिफ्रेश करें</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="127"/>
|
||||
<source>Installed packages</source>
|
||||
<translation>इंस्टॉल हो रखें पैकेज</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PackageGroupModel</name>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/packagegroupmodel.cpp" line="199"/>
|
||||
<source>Clean</source>
|
||||
<translation>हटाएँ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/packagegroupmodel.cpp" line="222"/>
|
||||
<source>Clean %1</source>
|
||||
<translation>%1 हटाएँ</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
BIN
cachecleaner/resources/translations/octopi_cachecleaner_hi_IN.qm
Normal file
BIN
cachecleaner/resources/translations/octopi_cachecleaner_hi_IN.qm
Normal file
Binary file not shown.
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" ?><!DOCTYPE TS><TS language="hi_IN" version="2.0">
|
||||
<context>
|
||||
<name>CacheCleaner</name>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="14"/>
|
||||
<source>Cache Cleaner - Octopi</source>
|
||||
<translation>कैश हटाने हेतु साधन - ऑक्टोपी</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="49"/>
|
||||
<source>Uninstalled packages</source>
|
||||
<translation>हटाए गए पैकेज</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="75"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="150"/>
|
||||
<source>Keep :</source>
|
||||
<translation>रखें :</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="82"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="157"/>
|
||||
<source>Number of old versions to keep</source>
|
||||
<translation>रखने हेतु पुराने पैकेज की संस्करण संख्या</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="102"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="183"/>
|
||||
<source>Refresh</source>
|
||||
<translation> रिफ्रेश करें</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="127"/>
|
||||
<source>Installed packages</source>
|
||||
<translation>इंस्टॉल हो रखें पैकेज</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PackageGroupModel</name>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/packagegroupmodel.cpp" line="199"/>
|
||||
<source>Clean</source>
|
||||
<translation>हटाएँ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/packagegroupmodel.cpp" line="222"/>
|
||||
<source>Clean %1</source>
|
||||
<translation>%1 हटाएँ</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
cachecleaner/resources/translations/octopi_cachecleaner_ko.qm
Normal file
BIN
cachecleaner/resources/translations/octopi_cachecleaner_ko.qm
Normal file
Binary file not shown.
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" ?><!DOCTYPE TS><TS language="ko" version="2.0">
|
||||
<context>
|
||||
<name>CacheCleaner</name>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="14"/>
|
||||
<source>Cache Cleaner - Octopi</source>
|
||||
<translation>캐시 클리너 - Octopi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="49"/>
|
||||
<source>Uninstalled packages</source>
|
||||
<translation>제거된 패키지</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="75"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="150"/>
|
||||
<source>Keep :</source>
|
||||
<translation>보관 :</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="82"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="157"/>
|
||||
<source>Number of old versions to keep</source>
|
||||
<translation>보관할 이전 버전 수</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="102"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="183"/>
|
||||
<source>Refresh</source>
|
||||
<translation>새로 고침</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="127"/>
|
||||
<source>Installed packages</source>
|
||||
<translation>새로 고침</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PackageGroupModel</name>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/packagegroupmodel.cpp" line="199"/>
|
||||
<source>Clean</source>
|
||||
<translation>청소하기</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/packagegroupmodel.cpp" line="222"/>
|
||||
<source>Clean %1</source>
|
||||
<translation>%1 청소하기</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -4,12 +4,12 @@
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="14"/>
|
||||
<source>Cache Cleaner - Octopi</source>
|
||||
<translation>Limpeza do Cache - Octopi</translation>
|
||||
<translation>Limpador do Cache - Octopi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="49"/>
|
||||
<source>Uninstalled packages</source>
|
||||
<translation>Pacotes não instalados</translation>
|
||||
<translation>Pacotes desinstalados</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="75"/>
|
||||
|
||||
Binary file not shown.
@@ -4,7 +4,7 @@
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="14"/>
|
||||
<source>Cache Cleaner - Octopi</source>
|
||||
<translation>Limpador de cache - Octopi</translation>
|
||||
<translation>Limpar Cache - Octopi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="49"/>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
cachecleaner/resources/translations/octopi_cachecleaner_sl.qm
Normal file
BIN
cachecleaner/resources/translations/octopi_cachecleaner_sl.qm
Normal file
Binary file not shown.
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" ?><!DOCTYPE TS><TS language="sl" version="2.0">
|
||||
<context>
|
||||
<name>CacheCleaner</name>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="14"/>
|
||||
<source>Cache Cleaner - Octopi</source>
|
||||
<translation>Čistilnik predpomnilnika - Octopi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="49"/>
|
||||
<source>Uninstalled packages</source>
|
||||
<translation>Odstranjeni paketi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="75"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="150"/>
|
||||
<source>Keep :</source>
|
||||
<translation>Obdrži:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="82"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="157"/>
|
||||
<source>Number of old versions to keep</source>
|
||||
<translation>Število namestitvenih datotek za obržati</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="102"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="183"/>
|
||||
<source>Refresh</source>
|
||||
<translation>Osveži</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="127"/>
|
||||
<source>Installed packages</source>
|
||||
<translation>Nameščeni paketi</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PackageGroupModel</name>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/packagegroupmodel.cpp" line="199"/>
|
||||
<source>Clean</source>
|
||||
<translation>Počisti</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/packagegroupmodel.cpp" line="222"/>
|
||||
<source>Clean %1</source>
|
||||
<translation>Počisti %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
cachecleaner/resources/translations/octopi_cachecleaner_tr.qm
Normal file
BIN
cachecleaner/resources/translations/octopi_cachecleaner_tr.qm
Normal file
Binary file not shown.
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" ?><!DOCTYPE TS><TS language="tr" version="2.0">
|
||||
<context>
|
||||
<name>CacheCleaner</name>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="14"/>
|
||||
<source>Cache Cleaner - Octopi</source>
|
||||
<translation>Ön Bellek Temizleyici - Octupi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="49"/>
|
||||
<source>Uninstalled packages</source>
|
||||
<translation>Kaldırılmış paketler</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="75"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="150"/>
|
||||
<source>Keep :</source>
|
||||
<translation>Sakla:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="82"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="157"/>
|
||||
<source>Number of old versions to keep</source>
|
||||
<translation>Saklanacak eski versiyonların sayısı</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="102"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="183"/>
|
||||
<source>Refresh</source>
|
||||
<translation>Yenile</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="127"/>
|
||||
<source>Installed packages</source>
|
||||
<translation>Yüklenmiş paketler</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PackageGroupModel</name>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/packagegroupmodel.cpp" line="199"/>
|
||||
<source>Clean</source>
|
||||
<translation>Temizle</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/packagegroupmodel.cpp" line="222"/>
|
||||
<source>Clean %1</source>
|
||||
<translation>Temiz %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
Binary file not shown.
Binary file not shown.
@@ -32,7 +32,7 @@
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="127"/>
|
||||
<source>Installed packages</source>
|
||||
<translation>Установлені пакунки</translation>
|
||||
<translation>Встановлені пакунки</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,15 +1,15 @@
|
||||
<?xml version="1.0" ?><!DOCTYPE TS><TS language="zh-Hans" version="2.0">
|
||||
<?xml version="1.0" ?><!DOCTYPE TS><TS language="zh_CN" version="2.0">
|
||||
<context>
|
||||
<name>CacheCleaner</name>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="14"/>
|
||||
<source>Cache Cleaner - Octopi</source>
|
||||
<translation>缓存清理 - Octopi</translation>
|
||||
<translation> 缓存清理器 - Octopi </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="49"/>
|
||||
<source>Uninstalled packages</source>
|
||||
<translation>未安装软件包</translation>
|
||||
<translation>已卸载的软件包</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="75"/>
|
||||
@@ -21,7 +21,7 @@
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="82"/>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="157"/>
|
||||
<source>Number of old versions to keep</source>
|
||||
<translation>要保留的旧版本数</translation>
|
||||
<translation>要保留的旧版本数量</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="102"/>
|
||||
@@ -32,7 +32,7 @@
|
||||
<message>
|
||||
<location filename="Projects/octopi/cachecleaner/ui/cachecleaner.ui" line="127"/>
|
||||
<source>Installed packages</source>
|
||||
<translation>已安装软件包</translation>
|
||||
<translation>已安装的软件包</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
||||
Binary file not shown.
13
helper/CMakeLists.txt
Normal file
13
helper/CMakeLists.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
find_package(Qt5 REQUIRED COMPONENTS Core Network)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
set(src main.cpp octopihelper.cpp ../src/argumentlist.cpp)
|
||||
|
||||
set(header octopihelper.h ../src/argumentlist.h)
|
||||
|
||||
add_executable(octphelper ${src} ${header})
|
||||
target_compile_definitions(octphelper PRIVATE QT_DEPRECATED_WARNINGS QT_USE_QSTRINGBUILDER QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII QT_NO_URL_CAST_FROM_STRING QT_NO_CAST_FROM_BYTEARRAY QT_NO_FOREACH)
|
||||
target_include_directories(octphelper PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${Qt5Core_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS})
|
||||
target_link_libraries(octphelper PRIVATE Qt5::Core Qt5::Network)
|
||||
install(TARGETS octphelper RUNTIME DESTINATION lib/octopi LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include)
|
||||
5
helper/README.md
Normal file
5
helper/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
## OCTOPI-HELPER
|
||||
|
||||
This is a simple helper to execute octopi transactions. It aims to ease integration with sudo NOPASSWD switch.
|
||||
|
||||
NOPASSWD mode will *ONLY* work with integrated ["octopi-sudo"](https://github.com/aarnt/octopi/tree/master/sudo) root escalation tool.
|
||||
67
helper/main.cpp
Normal file
67
helper/main.cpp
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* This file is part of Octopi, an open-source GUI for pacman.
|
||||
* Copyright (C) 2019 Alexandre Albuquerque Arnt
|
||||
*
|
||||
* 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 of the License, 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
|
||||
*
|
||||
*/
|
||||
|
||||
#include "octopihelper.h"
|
||||
#include "../src/argumentlist.h"
|
||||
#include <unistd.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QTextStream>
|
||||
|
||||
bool isRootRunning()
|
||||
{
|
||||
int uid = geteuid();
|
||||
return (uid == 0);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
ArgumentList *argList = new ArgumentList(argc, argv);
|
||||
|
||||
if (argList->getSwitch(QStringLiteral("-version")))
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << "octopi-helper: version " << ctn_OCTOPI_HELPER_VERSION << Qt::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!isRootRunning())
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: Only root can run..." << Qt::endl;
|
||||
return ctn_NO_ROOT_RUNNING;
|
||||
}
|
||||
|
||||
QCoreApplication a(argc, argv);
|
||||
unsetenv("TMPDIR");
|
||||
|
||||
OctopiHelper helper;
|
||||
|
||||
if (argList->getSwitch(QStringLiteral("-ts")))
|
||||
{
|
||||
return helper.executePkgTransactionWithSharedMem();
|
||||
}
|
||||
else
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: Suspicious execution method" << Qt::endl;
|
||||
return ctn_SUSPICIOUS_EXECUTION_METHOD;
|
||||
}
|
||||
}
|
||||
49
helper/octopi-helper.pro
Normal file
49
helper/octopi-helper.pro
Normal file
@@ -0,0 +1,49 @@
|
||||
QT -= gui
|
||||
QT += core network
|
||||
|
||||
CONFIG += c++11 console
|
||||
CONFIG -= app_bundle
|
||||
TARGET = octphelper
|
||||
|
||||
# The following define makes your compiler emit warnings if you use
|
||||
# any Qt feature that has been marked deprecated (the exact warnings
|
||||
# depend on your compiler). Please consult the documentation of the
|
||||
# deprecated API in order to know how to port your code away from it.
|
||||
DEFINES += QT_DEPRECATED_WARNINGS
|
||||
|
||||
# Disable automatic string conversions
|
||||
DEFINES += QT_USE_QSTRINGBUILDER \
|
||||
QT_NO_CAST_FROM_ASCII \
|
||||
QT_NO_CAST_TO_ASCII \
|
||||
QT_NO_URL_CAST_FROM_STRING \
|
||||
QT_NO_CAST_FROM_BYTEARRAY \
|
||||
QT_NO_FOREACH
|
||||
|
||||
# You can also make your code fail to compile if it uses deprecated APIs.
|
||||
# In order to do so, uncomment the following line.
|
||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
HEADERS += \
|
||||
../src/argumentlist.h \
|
||||
octopihelper.h
|
||||
|
||||
SOURCES += \
|
||||
main.cpp \
|
||||
../src/argumentlist.cpp \
|
||||
octopihelper.cpp
|
||||
|
||||
# install
|
||||
isEmpty(PREFIX) {
|
||||
PREFIX = /usr
|
||||
}
|
||||
|
||||
isEmpty(LIBDIR) {
|
||||
LIBDIR = $$PREFIX/lib
|
||||
}
|
||||
|
||||
target.path = $$LIBDIR/octopi
|
||||
sources.files = $$SOURCES $$HEADERS *.pro
|
||||
sources.path = .
|
||||
|
||||
INSTALLS += target
|
||||
521
helper/octopihelper.cpp
Normal file
521
helper/octopihelper.cpp
Normal file
@@ -0,0 +1,521 @@
|
||||
/*
|
||||
* This file is part of Octopi, an open-source GUI for pacman.
|
||||
* Copyright (C) 2019 Alexandre Albuquerque Arnt
|
||||
*
|
||||
* 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 of the License, 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
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../src/constants.h"
|
||||
#include "octopihelper.h"
|
||||
|
||||
#include <QProcess>
|
||||
#include <QDir>
|
||||
#include <QObject>
|
||||
#include <QTextStream>
|
||||
#include <QSharedMemory>
|
||||
#include <QRegularExpression>
|
||||
#include <QStringLiteral>
|
||||
#include <QTcpSocket>
|
||||
#include <QDataStream>
|
||||
#include <QFile>
|
||||
#include <QSettings>
|
||||
|
||||
QFile *OctopiHelper::m_temporaryFile = nullptr;
|
||||
|
||||
/*
|
||||
* Removes temporary transaction files
|
||||
*/
|
||||
void removeTemporaryFiles()
|
||||
{
|
||||
QDir tempDir(QDir::tempPath());
|
||||
QStringList nameFilters;
|
||||
nameFilters << QStringLiteral(".qt_temp_octopi*");
|
||||
const QFileInfoList list = tempDir.entryInfoList(nameFilters, QDir::Dirs | QDir::Files | QDir::System | QDir::Hidden);
|
||||
|
||||
for(const auto &file : list){
|
||||
QFile fileAux(file.filePath());
|
||||
|
||||
if (!file.isDir()){
|
||||
fileAux.remove();
|
||||
}
|
||||
else{
|
||||
QDir dir(file.filePath());
|
||||
const QFileInfoList listd = dir.entryInfoList(QDir::Files | QDir::System);
|
||||
|
||||
for(const auto &filed : listd){
|
||||
QFile fileAuxd(filed.filePath());
|
||||
fileAuxd.remove();
|
||||
}
|
||||
|
||||
dir.rmdir(file.filePath());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the SHELL environment variable, if not set defaults to bash.
|
||||
*/
|
||||
QString getShell()
|
||||
{
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
QString shell = env.value(QStringLiteral("SHELL"), QStringLiteral("/usr/bin/bash"));
|
||||
QFileInfo fi(shell);
|
||||
|
||||
if (fi.fileName() == QLatin1String("fish"))
|
||||
return QStringLiteral("/usr/bin/bash");
|
||||
else
|
||||
return fi.fileName();
|
||||
}
|
||||
|
||||
/*
|
||||
* If justOneInstance = false (default), returns TRUE if one instance of the app is ALREADY running
|
||||
* Otherwise, it returns TRUE if the given app is running.
|
||||
*/
|
||||
bool isAppRunning(const QString &appName, bool justOneInstance)
|
||||
{
|
||||
QStringList slParam;
|
||||
QProcess proc;
|
||||
slParam << QStringLiteral("-C");
|
||||
slParam << appName;
|
||||
proc.start(QStringLiteral("/usr/bin/ps"), slParam);
|
||||
proc.waitForFinished();
|
||||
QString out = QString::fromUtf8(proc.readAll());
|
||||
proc.close();
|
||||
|
||||
if (justOneInstance)
|
||||
{
|
||||
if (out.count(appName)>0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (out.count(appName)>1)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
OctopiHelper::OctopiHelper()
|
||||
{
|
||||
//If old helper still exists, let's remove it
|
||||
if (QFileInfo::exists(QStringLiteral("/usr/lib/octopi/octopi-helper")))
|
||||
QFile::remove(QStringLiteral("/usr/lib/octopi/octopi-helper"));
|
||||
|
||||
m_exitCode = -9999;
|
||||
m_process = new QProcess();
|
||||
//m_suspiciousChars = QStringLiteral("(\\s|[][!#$&'()*,;<=+>?\\^`{}|~])");
|
||||
m_suspiciousChars = QStringLiteral("[!#$&'()*,;<=>?\\^`{}|~\\[\\]]");
|
||||
|
||||
//These settings enable all "pacman" output go thru QProcess output methods
|
||||
m_process->setProcessChannelMode(QProcess::ForwardedChannels);
|
||||
m_process->setInputChannelMode(QProcess::ForwardedInputChannel);
|
||||
}
|
||||
|
||||
OctopiHelper::~OctopiHelper()
|
||||
{
|
||||
m_process->close();
|
||||
if (m_temporaryFile != nullptr)
|
||||
QFile::remove(m_temporaryFile->fileName());
|
||||
removeTemporaryFiles();
|
||||
}
|
||||
|
||||
/*
|
||||
* Logs passed str in a file called "octphelper.log" (for debugging purposes)
|
||||
*/
|
||||
void OctopiHelper::log(const QString &str)
|
||||
{
|
||||
QString fname = QStringLiteral("/usr/lib/octopi/octphelper.log");
|
||||
QFile file(fname);
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||
return;
|
||||
|
||||
QTextStream out(&file);
|
||||
out << str << Qt::endl;
|
||||
|
||||
file.flush();
|
||||
file.close();
|
||||
}
|
||||
|
||||
/*
|
||||
* A bit of settings to better run "pacman" commands using QProcess
|
||||
*/
|
||||
QProcessEnvironment OctopiHelper::getProcessEnvironment()
|
||||
{
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
env.remove(QStringLiteral("LANG"));
|
||||
env.remove(QStringLiteral("LC_MESSAGES"));
|
||||
env.insert(QStringLiteral("LANG"), QStringLiteral("C"));
|
||||
env.insert(QStringLiteral("LC_MESSAGES"), QStringLiteral("C"));
|
||||
env.remove(QStringLiteral("COLUMNS"));
|
||||
env.insert(QStringLiteral("COLUMNS"), QStringLiteral("132"));
|
||||
return env;
|
||||
}
|
||||
|
||||
/*
|
||||
* Retrieves Proxy_Settings config from "/root/.config/octopi/octopi.conf"
|
||||
*/
|
||||
QString OctopiHelper::getProxySettings()
|
||||
{
|
||||
QSettings settings(QSettings::UserScope, ctn_ORGANIZATION, ctn_APPLICATION);
|
||||
return (settings.value(ctn_KEY_PROXY_SETTINGS, QLatin1String("")).toString());
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if Octopi/Octopi-notifier, cache-cleaner, etc is being executed
|
||||
*/
|
||||
bool OctopiHelper::isOctoToolRunning(const QString &octoToolName)
|
||||
{
|
||||
bool res=false;
|
||||
|
||||
QProcess proc;
|
||||
proc.setProcessEnvironment(getProcessEnvironment());
|
||||
QStringList sl;
|
||||
sl << QStringLiteral("-C");
|
||||
sl << octoToolName;
|
||||
sl << QStringLiteral("-o");
|
||||
sl << QStringLiteral("command");
|
||||
proc.start(QStringLiteral("/usr/bin/ps"), sl);
|
||||
proc.waitForFinished();
|
||||
|
||||
QString out = QString::fromUtf8(proc.readAll().trimmed());
|
||||
if (out.contains(QLatin1String("|"))) return false;
|
||||
out=out.remove(QStringLiteral("\n"));
|
||||
out=out.remove(QStringLiteral("COMMAND"));
|
||||
|
||||
if (octoToolName==QLatin1String("octopi-cachecle"))
|
||||
{
|
||||
if (out == QLatin1String("/usr/bin/octopi-cachecleaner")) res=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
QStringList options;
|
||||
options << QStringLiteral("/usr/bin/octopi-notifier -d");
|
||||
options << QStringLiteral("/usr/bin/octopi -d");
|
||||
options << QStringLiteral("/usr/bin/octopi -sysupgrade");
|
||||
options << QStringLiteral("/usr/bin/octopi -sysupgrade-noconfirm");
|
||||
|
||||
//QRegularExpression re(QStringLiteral("(/usr/bin/octopi-notifier -session )[a-fA-F0-9_]+"));
|
||||
QRegularExpression re(QStringLiteral("(/usr/bin/octopi-notifier.*)"));
|
||||
QRegularExpressionMatch match = re.match(out);
|
||||
bool hasMatchInSession = match.capturedLength()==out.length();
|
||||
|
||||
re=QRegularExpression(QStringLiteral("(/usr/bin/octopi -style )\\S+"));
|
||||
match = re.match(out);
|
||||
bool hasMatchInStyle = match.capturedLength()==out.length();
|
||||
|
||||
if (out == QLatin1String("/usr/bin/") + octoToolName ||
|
||||
(options.indexOf(out)!=-1) ||
|
||||
(hasMatchInSession) ||
|
||||
(hasMatchInStyle)) res=true;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* Executes all commands inside Octopi's SharedMemory - "octopi-helper -ts"
|
||||
*/
|
||||
int OctopiHelper::executePkgTransactionWithSharedMem()
|
||||
{
|
||||
bool isOctopiRunning=isOctoToolRunning(QStringLiteral("octopi"));
|
||||
bool isNotifierRunning=isOctoToolRunning(QStringLiteral("octopi-notifier"));
|
||||
bool isCacheCleanerRunning=isOctoToolRunning(QStringLiteral("octopi-cachecle"));
|
||||
|
||||
if(!isOctopiRunning &&
|
||||
!isNotifierRunning &&
|
||||
!isCacheCleanerRunning)
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: Suspicious execution method" << Qt::endl;
|
||||
return ctn_SUSPICIOUS_EXECUTION_METHOD;
|
||||
}
|
||||
|
||||
//Let's retrieve commands from sharedmem pool
|
||||
QSharedMemory *sharedMem = new QSharedMemory(QStringLiteral("org.arnt.octopi"), this);
|
||||
if (!sharedMem->attach(QSharedMemory::ReadOnly))
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: Couldn't attach to memory" << Qt::endl;
|
||||
return ctn_COULD_NOT_ATTACH_TO_MEM;
|
||||
}
|
||||
|
||||
QByteArray sharedData(sharedMem->size(), '\0');
|
||||
sharedMem->lock();
|
||||
memcpy(sharedData.data(), sharedMem->data(), sharedMem->size());
|
||||
sharedMem->unlock();
|
||||
QString contents=QString::fromLatin1(sharedData);
|
||||
sharedMem->detach();
|
||||
delete sharedMem;
|
||||
|
||||
bool suspicious = false;
|
||||
|
||||
if (contents.isEmpty() || contents.contains(QRegularExpression(m_suspiciousChars)))
|
||||
suspicious = true;
|
||||
|
||||
if (suspicious)
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: Suspicious transaction detected -> \"" << contents << "\"" << Qt::endl;
|
||||
return ctn_SUSPICIOUS_ACTIONS_FILE;
|
||||
}
|
||||
|
||||
const QStringList lines = contents.split(QStringLiteral("\n"), Qt::SkipEmptyParts);
|
||||
bool testCommandFromOctopi=false;
|
||||
bool testCommandFromNotifier=false;
|
||||
bool testCommandFromCacheCleaner=false;
|
||||
|
||||
for(auto line : lines)
|
||||
{
|
||||
line = line.trimmed();
|
||||
|
||||
if ((line == QLatin1String("killall pacman")) ||
|
||||
(line == QLatin1String("rm ") + ctn_PACMAN_DATABASE_LOCK_FILE) ||
|
||||
(line == QLatin1String("echo -e")) ||
|
||||
(line == QLatin1String("echo \"Press any key to continue...\"")) ||
|
||||
(line == QLatin1String("read -n 1 -p \"Press any key to continue...\"")) ||
|
||||
(line == QLatin1String("pkgfile -u")) ||
|
||||
(line == QLatin1String("paccache -r -k 0")) ||
|
||||
(line == QLatin1String("paccache -r -k 1")) ||
|
||||
(line == QLatin1String("paccache -r -k 2")) ||
|
||||
(line == QLatin1String("paccache -r -k 3")) ||
|
||||
(line == QLatin1String("pacman -Syu")) ||
|
||||
(line == QLatin1String("pacman -Syu --noconfirm")) ||
|
||||
(line.startsWith(QLatin1String("pacman -D --asexplicit "))) ||
|
||||
(line.startsWith(QLatin1String("pacman -D --asdeps "))) ||
|
||||
(line.startsWith(QLatin1String("pacman -S "))) ||
|
||||
(line.startsWith(QLatin1String("pacman -R "))))
|
||||
{
|
||||
if (line.startsWith(QLatin1String("pacman -D --asexplicit ")) ||
|
||||
line.startsWith(QLatin1String("pacman -D --asdeps ")) ||
|
||||
line.startsWith(QLatin1String("pacman -S ")) ||
|
||||
line.startsWith(QLatin1String("pacman -R ")))
|
||||
{
|
||||
testCommandFromOctopi=true;
|
||||
}
|
||||
else if (line.startsWith(QLatin1String("pacman -Syu")))
|
||||
{
|
||||
testCommandFromOctopi=true;
|
||||
testCommandFromNotifier=true;
|
||||
}
|
||||
else if (line.startsWith(QLatin1String("paccache -r -k")))
|
||||
{
|
||||
testCommandFromCacheCleaner=true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
suspicious = true;
|
||||
}
|
||||
|
||||
if (suspicious)
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: Suspicious transaction detected -> \"" << line << "\"" << Qt::endl;
|
||||
//log(QStringLiteral("Offending line: ") + line);
|
||||
return ctn_SUSPICIOUS_ACTIONS_FILE;
|
||||
}
|
||||
}
|
||||
|
||||
//Using full path binaries
|
||||
contents = contents.replace(QLatin1String("killall pacman"), QLatin1String("/usr/bin/killall pacman"));
|
||||
contents = contents.replace(QLatin1String("rm ") + ctn_PACMAN_DATABASE_LOCK_FILE, QLatin1String("/usr/bin/rm ") + ctn_PACMAN_DATABASE_LOCK_FILE);
|
||||
contents = contents.replace(QLatin1String("pkgfile -u"), QLatin1String("/usr/bin/pkgfile -u"));
|
||||
contents = contents.replace(QLatin1String("paccache -r"), QLatin1String("/usr/bin/paccache -r"));
|
||||
contents = contents.replace(QLatin1String("pacman -Syu"), QLatin1String("/usr/bin/pacman -Syu"));
|
||||
contents = contents.replace(QLatin1String("pacman -D "), QLatin1String("/usr/bin/pacman -D "));
|
||||
contents = contents.replace(QLatin1String("pacman -S "), QLatin1String("/usr/bin/pacman -S "));
|
||||
contents = contents.replace(QLatin1String("pacman -R "), QLatin1String("/usr/bin/pacman -R "));
|
||||
|
||||
//If there is a "pacman" process executing elsewhere, let's abort octopi-helper!
|
||||
if (contents != QLatin1String("/usr/bin/killall pacman\n/usr/bin/rm ") + ctn_PACMAN_DATABASE_LOCK_FILE +QLatin1Char('\n') && isAppRunning(QStringLiteral("pacman"), true))
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: Pacman process already running" << Qt::endl;
|
||||
return ctn_PACMAN_PROCESS_EXECUTING;
|
||||
}
|
||||
|
||||
if (testCommandFromOctopi)
|
||||
{
|
||||
if (!isOctopiRunning && !testCommandFromNotifier)
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: Suspicious execution method" << Qt::endl;
|
||||
return ctn_SUSPICIOUS_EXECUTION_METHOD;
|
||||
}
|
||||
|
||||
//Let's make a connection to Octopi server to ensure it sent this command.
|
||||
QTcpSocket socket;
|
||||
socket.connectToHost(QStringLiteral("127.0.0.1"), 12701);
|
||||
|
||||
if (!socket.waitForConnected(5000))
|
||||
{
|
||||
if (!testCommandFromNotifier)
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: Timeout connecting to Octopi" << Qt::endl;
|
||||
return ctn_TIMEOUT_CONNECTING;
|
||||
}
|
||||
else goto testNotifierConnection;
|
||||
}
|
||||
|
||||
QDataStream in(&socket);
|
||||
in.setVersion(QDataStream::Qt_5_10);
|
||||
QString octopiResponse;
|
||||
|
||||
do
|
||||
{
|
||||
if (!socket.waitForReadyRead() && !testCommandFromNotifier)
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: Timeout contacting Octopi" << Qt::endl;
|
||||
return ctn_TIMEOUT_CONNECTING;
|
||||
}
|
||||
|
||||
in.startTransaction();
|
||||
in >> octopiResponse;
|
||||
} while (!in.commitTransaction());
|
||||
|
||||
if (octopiResponse == QLatin1String("Octopi est occupatus"))
|
||||
{
|
||||
testCommandFromNotifier=false;
|
||||
}
|
||||
else if (octopiResponse != QLatin1String("Octopi est occupatus") && !testCommandFromNotifier)
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: No transaction being executed" << Qt::endl;
|
||||
return ctn_NO_TRANSACTION_EXECUTING;
|
||||
}
|
||||
}
|
||||
|
||||
testNotifierConnection:
|
||||
if (testCommandFromNotifier)
|
||||
{
|
||||
if (!isNotifierRunning)
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: Suspicious execution method" << Qt::endl;
|
||||
return ctn_SUSPICIOUS_EXECUTION_METHOD;
|
||||
}
|
||||
|
||||
//Let's make a connection to Octopi-Notifier server to ensure it sent this command.
|
||||
QTcpSocket socket;
|
||||
socket.connectToHost(QStringLiteral("127.0.0.1"), 12702);
|
||||
|
||||
if (!socket.waitForConnected(5000))
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: Timeout connecting to Octopi-Notifier" << Qt::endl;
|
||||
return ctn_TIMEOUT_CONNECTING;
|
||||
}
|
||||
|
||||
QDataStream in(&socket);
|
||||
in.setVersion(QDataStream::Qt_5_10);
|
||||
QString octopiResponse;
|
||||
|
||||
do
|
||||
{
|
||||
if (!socket.waitForReadyRead())
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: Timeout contacting Octopi-Notifier" << Qt::endl;
|
||||
return ctn_TIMEOUT_CONNECTING;
|
||||
}
|
||||
|
||||
in.startTransaction();
|
||||
in >> octopiResponse;
|
||||
} while (!in.commitTransaction());
|
||||
|
||||
if (octopiResponse != QLatin1String("Octopi est occupatus"))
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: No transaction being executed" << Qt::endl;
|
||||
return ctn_NO_TRANSACTION_EXECUTING;
|
||||
}
|
||||
}
|
||||
|
||||
if (testCommandFromCacheCleaner)
|
||||
{
|
||||
if (!isCacheCleanerRunning)
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: Suspicious execution method" << Qt::endl;
|
||||
return ctn_SUSPICIOUS_EXECUTION_METHOD;
|
||||
}
|
||||
|
||||
//Let's make a connection to Octopi-Notifier server to ensure it sent this command.
|
||||
QTcpSocket socket;
|
||||
socket.connectToHost(QStringLiteral("127.0.0.1"), 12703);
|
||||
|
||||
if (!socket.waitForConnected(5000))
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: Timeout connecting to Octopi-CacheCleaner" << Qt::endl;
|
||||
return ctn_TIMEOUT_CONNECTING;
|
||||
}
|
||||
|
||||
QDataStream in(&socket);
|
||||
in.setVersion(QDataStream::Qt_5_10);
|
||||
QString octopiResponse;
|
||||
|
||||
do
|
||||
{
|
||||
if (!socket.waitForReadyRead())
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: Timeout contacting Octopi-CacheCleaner" << Qt::endl;
|
||||
return ctn_TIMEOUT_CONNECTING;
|
||||
}
|
||||
|
||||
in.startTransaction();
|
||||
in >> octopiResponse;
|
||||
} while (!in.commitTransaction());
|
||||
|
||||
if (octopiResponse != QLatin1String("Octopi est occupatus"))
|
||||
{
|
||||
QTextStream qout(stdout);
|
||||
qout << Qt::endl << "octopi-helper[aborted]: No transaction being executed" << Qt::endl;
|
||||
return ctn_NO_TRANSACTION_EXECUTING;
|
||||
}
|
||||
}
|
||||
|
||||
//Let's construct the root owned execution file
|
||||
QFile *ftemp = generateTemporaryFile();
|
||||
QTextStream out(ftemp);
|
||||
|
||||
QString proxySettings = getProxySettings();
|
||||
if (!proxySettings.isEmpty())
|
||||
{
|
||||
if (proxySettings.contains(QLatin1String("ftp://")))
|
||||
out << QLatin1String("export ftp_proxy=") + proxySettings + QLatin1Char('\n');
|
||||
else if (proxySettings.contains(QLatin1String("http://")))
|
||||
out << QLatin1String("export http_proxy=") + proxySettings + QLatin1Char('\n');
|
||||
else if (proxySettings.contains(QLatin1String("https://")))
|
||||
out << QLatin1String("export https_proxy=") + proxySettings + QLatin1Char('\n');
|
||||
}
|
||||
|
||||
out << QLatin1String("unalias -a\n") << contents;
|
||||
out.flush();
|
||||
ftemp->close();
|
||||
|
||||
m_process->setProcessEnvironment(getProcessEnvironment());
|
||||
m_process->start(getShell(), QStringList() << m_temporaryFile->fileName());
|
||||
m_process->waitForStarted(-1);
|
||||
m_process->waitForFinished(-1);
|
||||
|
||||
return m_process->exitCode();
|
||||
}
|
||||
64
helper/octopihelper.h
Normal file
64
helper/octopihelper.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* This file is part of Octopi, an open-source GUI for pacman.
|
||||
* Copyright (C) 2019 Alexandre Albuquerque Arnt
|
||||
*
|
||||
* 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 of the License, 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
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef OCTOPIHELPER_H
|
||||
#define OCTOPIHELPER_H
|
||||
|
||||
#include "../src/constants.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QProcess>
|
||||
#include <QObject>
|
||||
#include <QFile>
|
||||
#include <QRandomGenerator>
|
||||
|
||||
class OctopiHelper: QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
int m_exitCode;
|
||||
QProcess *m_process;
|
||||
QProcessEnvironment getProcessEnvironment();
|
||||
QString m_suspiciousChars;
|
||||
static QFile *m_temporaryFile;
|
||||
|
||||
static QString getProxySettings();
|
||||
|
||||
static QFile* generateTemporaryFile(){
|
||||
quint32 gen = QRandomGenerator::global()->generate();
|
||||
m_temporaryFile = new QFile(ctn_TEMP_ACTIONS_FILE + QString::number(gen));
|
||||
m_temporaryFile->open(QIODevice::ReadWrite|QIODevice::Text);
|
||||
m_temporaryFile->setPermissions(QFile::Permissions(QFile::ExeOwner|QFile::ReadOwner));
|
||||
|
||||
return m_temporaryFile;
|
||||
}
|
||||
|
||||
public:
|
||||
OctopiHelper();
|
||||
virtual ~OctopiHelper();
|
||||
|
||||
void log(const QString &str);
|
||||
int executePkgTransactionWithSharedMem();
|
||||
inline int getExitCode() { return m_exitCode; }
|
||||
bool isOctoToolRunning(const QString &octoToolName);
|
||||
};
|
||||
|
||||
#endif // OCTOPIHELPER_H
|
||||
74
notifier/CMakeLists.txt
Normal file
74
notifier/CMakeLists.txt
Normal file
@@ -0,0 +1,74 @@
|
||||
find_package(Qt5 REQUIRED COMPONENTS Core Xml Gui Widgets Network)
|
||||
find_package(qtermwidget5 REQUIRED)
|
||||
find_package(alpm_octopi_utils REQUIRED)
|
||||
find_package(KF5Notifications QUIET)
|
||||
|
||||
if(NOT KF5Notifications_FOUND)
|
||||
message(WARNING "KNotifications not found. Skipping")
|
||||
endif()
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
set(src
|
||||
main.cpp
|
||||
mainwindow.cpp
|
||||
outputdialog.cpp
|
||||
../src/terminal.cpp
|
||||
../src/unixcommand.cpp
|
||||
../src/package.cpp
|
||||
../src/wmhelper.cpp
|
||||
../src/strconstants.cpp
|
||||
../src/settingsmanager.cpp
|
||||
../src/utils.cpp
|
||||
../src/transactiondialog.cpp
|
||||
../src/argumentlist.cpp
|
||||
../src/pacmanexec.cpp
|
||||
../src/searchlineedit.cpp
|
||||
../src/searchbar.cpp
|
||||
../src/optionsdialog.cpp
|
||||
../src/termwidget.cpp
|
||||
../src/aurvote.cpp
|
||||
../src/qaesencryption.cpp
|
||||
../src/alpmbackend.cpp)
|
||||
|
||||
set(header
|
||||
mainwindow.h
|
||||
outputdialog.h
|
||||
../src/uihelper.h
|
||||
../src/terminal.h
|
||||
../src/unixcommand.h
|
||||
../src/wmhelper.h
|
||||
../src/strconstants.h
|
||||
../src/package.h
|
||||
../src/utils.h
|
||||
../src/transactiondialog.h
|
||||
../src/argumentlist.h
|
||||
../src/pacmanexec.h
|
||||
../src/searchlineedit.h
|
||||
../src/searchbar.h
|
||||
../src/optionsdialog.h
|
||||
../src/termwidget.h
|
||||
../src/aurvote.h
|
||||
../src/qaesencryption.h
|
||||
../src/alpmbackend.h)
|
||||
|
||||
set(ui ../ui/transactiondialog.ui ../ui/optionsdialog.ui)
|
||||
|
||||
set(qrc ../resources.qrc)
|
||||
|
||||
qt5_wrap_ui(src ${ui})
|
||||
qt5_add_resources(src ${qrc})
|
||||
|
||||
add_executable(octopi-notifier ${src} ${header})
|
||||
target_compile_definitions(octopi-notifier PRIVATE ALPM_BACKEND QT_USE_QSTRINGBUILDER QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII QT_NO_URL_CAST_FROM_STRING QT_NO_CAST_FROM_BYTEARRAY)
|
||||
target_include_directories(octopi-notifier PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${Qt5Core_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS})
|
||||
target_link_libraries(octopi-notifier PRIVATE Qt5::Core Qt5::Xml Qt5::Gui Qt5::Widgets Qt5::Network qtermwidget5 alpm_octopi_utils)
|
||||
if(KF5Notifications_FOUND)
|
||||
target_compile_definitions(octopi-notifier PRIVATE KSTATUS)
|
||||
find_package(Qt5 REQUIRED COMPONENTS DBus)
|
||||
target_include_directories(octopi-notifier PRIVATE ${Qt5DBus_INCLUDE_DIRS})
|
||||
target_link_libraries(octopi-notifier PRIVATE Qt5::DBus KF5::Notifications)
|
||||
endif()
|
||||
install(TARGETS octopi-notifier RUNTIME DESTINATION bin LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include)
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/octopi-notifier.desktop" DESTINATION share/applications)
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/octopi-notifier.desktop" DESTINATION /etc/xdg/autostart)
|
||||
114
notifier/main.cpp
Normal file
114
notifier/main.cpp
Normal file
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* This file is part of Octopi, an open-source GUI for pacman.
|
||||
* Copyright (C) 2013 Alexandre Albuquerque Arnt
|
||||
*
|
||||
* 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 of the License, 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
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../src/unixcommand.h"
|
||||
#include "../src/wmhelper.h"
|
||||
#include "../src/strconstants.h"
|
||||
#include "../src/argumentlist.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QtGui>
|
||||
#include <QMessageBox>
|
||||
#include <QDebug>
|
||||
|
||||
#define NO_GTK_STYLE
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
bool debugInfo = false;
|
||||
|
||||
ArgumentList *argList = new ArgumentList(argc, argv);
|
||||
if (argList->getSwitch(QStringLiteral("-d")))
|
||||
{
|
||||
//If user chooses to switch debug info on...
|
||||
debugInfo = true;
|
||||
}
|
||||
|
||||
if (debugInfo)
|
||||
qDebug() << QString(QLatin1String("Octopi Notifier - ") + StrConstants::getApplicationVersion() +
|
||||
QLatin1String(" (") + StrConstants::getQtVersion() + QLatin1String(")"));
|
||||
|
||||
if (UnixCommand::isAppRunning(QStringLiteral("octopi-notifier")))
|
||||
{
|
||||
qDebug() << "Aborting notifier as another instance is already running!";
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (!QFile::exists(ctn_CHECKUPDATES_BINARY))
|
||||
{
|
||||
qDebug() << "Aborting notifier as 'checkupdates' binary could not be found! [" << ctn_CHECKUPDATES_BINARY << "]";
|
||||
return (-2);
|
||||
}
|
||||
|
||||
if (!QFile::exists(ctn_OCTOPI_HELPER_PATH))
|
||||
{
|
||||
qDebug() << "Aborting notifier as 'octphelper' binary could not be found! [" << ctn_OCTOPI_HELPER_PATH << "]";
|
||||
return (-3);
|
||||
}
|
||||
|
||||
if (!QFile::exists(ctn_OCTOPISUDO))
|
||||
{
|
||||
qDebug() << "Aborting notifier as 'octopi-sudo' binary could not be found! [" << ctn_OCTOPISUDO << "]";
|
||||
return (-4);
|
||||
}
|
||||
|
||||
QApplication a(argc, argv);
|
||||
QTranslator appTranslator;
|
||||
appTranslator.load(QLatin1String(":/resources/translations/octopi_") +
|
||||
QLocale::system().name());
|
||||
a.installTranslator(&appTranslator);
|
||||
a.setQuitOnLastWindowClosed(false);
|
||||
|
||||
if (!UnixCommand::isOctoToolRunning(QStringLiteral("octopi-notifier")))
|
||||
{
|
||||
QMessageBox::critical(nullptr, StrConstants::getApplicationName(), StrConstants::getErrorRunOctopiNotifierAsUsrBin());
|
||||
return (-6);
|
||||
}
|
||||
|
||||
if (UnixCommand::isRootRunning()){
|
||||
QMessageBox::critical(nullptr, StrConstants::getApplicationName(), StrConstants::getErrorRunningWithRoot());
|
||||
return (-5);
|
||||
}
|
||||
|
||||
unsetenv("TMPDIR");
|
||||
|
||||
setenv("COLORTERM", "truecolor", 1);
|
||||
setenv("TERM", "xterm-256color", 1);
|
||||
|
||||
QString buildDir=SettingsManager::getAURBuildDir();
|
||||
if (!buildDir.isEmpty())
|
||||
{
|
||||
setenv("BUILDDIR", buildDir.toLatin1().data(), 1);
|
||||
}
|
||||
|
||||
MainWindow w;
|
||||
if (w.startServer())
|
||||
{
|
||||
QResource::registerResource(QStringLiteral("./resources.qrc"));
|
||||
|
||||
QGuiApplication::setDesktopFileName(QStringLiteral("octopi-notifier"));
|
||||
|
||||
if (debugInfo)
|
||||
w.turnDebugInfoOn();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
}
|
||||
1327
notifier/mainwindow.cpp
Normal file
1327
notifier/mainwindow.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@@ -21,8 +21,8 @@
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include "../../src/unixcommand.h"
|
||||
#include "../../src/pacmanexec.h"
|
||||
#include "../src/unixcommand.h"
|
||||
#include "../src/pacmanexec.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QProcess>
|
||||
@@ -34,8 +34,12 @@ class QIcon;
|
||||
class QMenu;
|
||||
class QAction;
|
||||
class QFileSystemWatcher;
|
||||
class PacmanHelperClient;
|
||||
class SetupDialog;
|
||||
class OptionsDialog;
|
||||
class TransactionDialog;
|
||||
class QTcpServer;
|
||||
class OutputDialog;
|
||||
|
||||
enum CheckUpdate { ectn_AUTO_CHECK, ectn_USER_CHECK};
|
||||
|
||||
#ifdef KSTATUS
|
||||
class KStatusNotifierItem;
|
||||
@@ -46,54 +50,73 @@ class MainWindow : public QMainWindow
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
explicit MainWindow(QWidget *parent = 0);
|
||||
explicit MainWindow(QWidget *parent = nullptr);
|
||||
virtual ~MainWindow();
|
||||
|
||||
inline void turnDebugInfoOn() { m_debugInfo = true;}
|
||||
bool startServer();
|
||||
|
||||
private slots:
|
||||
|
||||
void pacmanHelperTimerTimeout();
|
||||
void afterPacmanHelperSyncDatabase();
|
||||
void afterCheckUpdates(int exitCode, QProcess::ExitStatus);
|
||||
|
||||
void execSystemTrayActivated(QSystemTrayIcon::ActivationReason);
|
||||
void execSystemTrayKF5();
|
||||
|
||||
void syncDatabase();
|
||||
void checkUpdates(CheckUpdate check = ectn_USER_CHECK);
|
||||
void refreshOutdatedPkgsTooltip();
|
||||
void refreshAppIcon();
|
||||
void runOctopi(ExecOpt execOptions = ectn_SYSUPGRADE_EXEC_OPT);
|
||||
void runOctopiSysUpgrade();
|
||||
void runOctopiCheckUpdates();
|
||||
void runOctopiSysUpgrade();
|
||||
void runOctopiAURUpgrade();
|
||||
|
||||
inline void startOctopi() { runOctopi(ectn_NORMAL_EXEC_OPT); }
|
||||
void aboutOctopiNotifier();
|
||||
void hideOctopi();
|
||||
void showOctopi();
|
||||
void exitNotifier();
|
||||
void doSystemUpgrade();
|
||||
void doSystemUpgradeFinished();
|
||||
void doAURUpgrade();
|
||||
void doSystemUpgradeFinished(int exitCode);
|
||||
void toggleEnableInterface(bool state);
|
||||
void showConfigDialog();
|
||||
void showOptionsDialog();
|
||||
void onSendInfoToOctopiHelper();
|
||||
void onCallRefreshAppIcon();
|
||||
|
||||
private:
|
||||
|
||||
SetupDialog *m_setupDialog;
|
||||
bool m_debugInfo;
|
||||
int m_numberOfCheckUpdatesPackages;
|
||||
int m_numberOfOutdatedPackages;
|
||||
int m_numberOfOutdatedAURPackages;
|
||||
bool m_systemUpgradeDialog;
|
||||
bool isOctopiBusy();
|
||||
bool canOctopiUpgrade();
|
||||
|
||||
CommandExecuting m_commandExecuting;
|
||||
UnixCommand *m_unixCommand;
|
||||
|
||||
PacmanExec *m_pacmanExec;
|
||||
TransactionDialog *m_transactionDialog;
|
||||
OptionsDialog *m_optionsDialog;
|
||||
QTcpServer *m_tcpServer;
|
||||
QAction *m_actionOctopi;
|
||||
QAction *m_actionSetInterval;
|
||||
QAction *m_actionSyncDatabase;
|
||||
QAction *m_actionOptions;
|
||||
QAction *m_actionCheckUpdates;
|
||||
QAction *m_actionSystemUpgrade;
|
||||
QAction *m_actionAURUpgrade;
|
||||
QAction *m_actionAbout;
|
||||
QAction *m_actionExit;
|
||||
|
||||
QIcon m_icon;
|
||||
QHash<QString, QString> *m_checkUpdatesNameNewVersion;
|
||||
QStringList m_checkUpdatesStringList;
|
||||
QStringList *m_outdatedStringList;
|
||||
QStringList *m_outdatedAURStringList;
|
||||
QTimer *m_pacmanHelperTimer;
|
||||
bool m_debugInfo;
|
||||
QTimer *m_callRefreshAppIcon;
|
||||
QMenu *m_systemTrayIconMenu;
|
||||
QFileSystemWatcher *m_pacmanDatabaseSystemWatcher;
|
||||
|
||||
OutputDialog *m_outputDialog;
|
||||
|
||||
#ifdef KSTATUS
|
||||
KStatusNotifierItem * m_systemTrayIcon;
|
||||
@@ -101,13 +124,11 @@ private:
|
||||
QSystemTrayIcon *m_systemTrayIcon;
|
||||
#endif
|
||||
|
||||
QMenu *m_systemTrayIconMenu;
|
||||
QFileSystemWatcher *m_pacmanDatabaseSystemWatcher;
|
||||
PacmanHelperClient *m_pacmanHelperClient;
|
||||
|
||||
bool _isSUAvailable();
|
||||
bool isInternetAvailable();
|
||||
void initActions();
|
||||
void initSystemTrayIcon();
|
||||
void sendNotification(const QString &msg);
|
||||
void setUpgradingTooltip();
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
@@ -1,7 +1,7 @@
|
||||
[Desktop Entry]
|
||||
Name=Octopi Notifier
|
||||
Icon=octopi
|
||||
Exec=octopi-notifier
|
||||
Exec=/usr/bin/octopi-notifier
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=GNOME;GTK;System;
|
||||
128
notifier/octopi-notifier.pro
Normal file
128
notifier/octopi-notifier.pro
Normal file
@@ -0,0 +1,128 @@
|
||||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2013-07-20T16:15:14
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += core xml gui network
|
||||
|
||||
# This controls whether octopi-notifier uses KStatusNotifier lib
|
||||
# You SHOULD REALLY enable KSTATUS define in plasma 5 desktops!
|
||||
DEFINES += ALPM_BACKEND #KSTATUS
|
||||
|
||||
# Disable automatic string conversions
|
||||
DEFINES += QT_USE_QSTRINGBUILDER \
|
||||
QT_NO_CAST_FROM_ASCII \
|
||||
QT_NO_CAST_TO_ASCII \
|
||||
QT_NO_URL_CAST_FROM_STRING \
|
||||
QT_NO_CAST_FROM_BYTEARRAY
|
||||
|
||||
CONFIG += qt warn_on debug link_pkgconfig ALPM_BACKEND
|
||||
|
||||
ALPM_BACKEND {
|
||||
QMAKE_CXXFLAGS += -std=c++17
|
||||
PKGCONFIG += glib-2.0 libalpm
|
||||
LIBS += -lalpm_octopi_utils
|
||||
} else {
|
||||
QMAKE_CXXFLAGS += -std=c++17
|
||||
}
|
||||
|
||||
LIBS += -lqtermwidget5
|
||||
|
||||
contains(DEFINES, KSTATUS){
|
||||
QT += dbus KNotifications
|
||||
}
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
CONFIG += qt console warn_on debug
|
||||
QMAKE_CXXFLAGS += -std=c++11
|
||||
TARGET = octopi-notifier
|
||||
TEMPLATE = app
|
||||
DESTDIR += ./bin
|
||||
OBJECTS_DIR += ./build
|
||||
MOC_DIR += ./build
|
||||
UI_DIR += ./build
|
||||
|
||||
HEADERS += \
|
||||
mainwindow.h \
|
||||
outputdialog.h \
|
||||
../src/uihelper.h \
|
||||
../src/terminal.h \
|
||||
../src/unixcommand.h \
|
||||
../src/wmhelper.h \
|
||||
../src/strconstants.h \
|
||||
../src/package.h \
|
||||
../src/utils.h \
|
||||
../src/transactiondialog.h \
|
||||
../src/argumentlist.h \
|
||||
../src/pacmanexec.h \
|
||||
../src/searchlineedit.h \
|
||||
../src/searchbar.h \
|
||||
../src/optionsdialog.h \
|
||||
../src/termwidget.h \
|
||||
../src/aurvote.h \
|
||||
../src/qaesencryption.h
|
||||
|
||||
ALPM_BACKEND{
|
||||
HEADERS += ../src/alpmbackend.h
|
||||
}
|
||||
|
||||
SOURCES += main.cpp \
|
||||
mainwindow.cpp \
|
||||
outputdialog.cpp \
|
||||
../src/terminal.cpp \
|
||||
../src/unixcommand.cpp \
|
||||
../src/package.cpp \
|
||||
../src/wmhelper.cpp \
|
||||
../src/strconstants.cpp \
|
||||
../src/settingsmanager.cpp \
|
||||
../src/utils.cpp \
|
||||
../src/transactiondialog.cpp \
|
||||
../src/argumentlist.cpp \
|
||||
../src/pacmanexec.cpp \
|
||||
../src/searchlineedit.cpp \
|
||||
../src/searchbar.cpp \
|
||||
../src/optionsdialog.cpp \
|
||||
../src/termwidget.cpp \
|
||||
../src/aurvote.cpp \
|
||||
../src/qaesencryption.cpp
|
||||
|
||||
ALPM_BACKEND{
|
||||
SOURCES += ../src/alpmbackend.cpp
|
||||
}
|
||||
|
||||
FORMS += ../ui/transactiondialog.ui \
|
||||
../ui/optionsdialog.ui
|
||||
|
||||
RESOURCES += \
|
||||
../resources.qrc
|
||||
|
||||
# install
|
||||
isEmpty(PREFIX) {
|
||||
PREFIX = /usr
|
||||
}
|
||||
|
||||
isEmpty(BINDIR) {
|
||||
BINDIR = $$PREFIX/bin
|
||||
}
|
||||
|
||||
isEmpty(DATADIR) {
|
||||
DATADIR = $$PREFIX/share
|
||||
}
|
||||
|
||||
isEmpty(ETCDIR) {
|
||||
ETCDIR = /etc
|
||||
}
|
||||
|
||||
target.path = $$BINDIR
|
||||
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro
|
||||
sources.path = .
|
||||
|
||||
autostart.path = $$ETCDIR/xdg/autostart
|
||||
autostart.files += octopi-notifier.desktop
|
||||
|
||||
desktop.path = $$DATADIR/applications
|
||||
desktop.files += octopi-notifier.desktop
|
||||
|
||||
INSTALLS += target autostart desktop
|
||||
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* This file is part of Octopi, an open-source GUI for pacman.
|
||||
* Copyright (C) 2013 Alexandre Albuquerque Arnt
|
||||
*
|
||||
* 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 of the License, 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
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../src/unixcommand.h"
|
||||
#include "../../src/wmhelper.h"
|
||||
#include "../../src/strconstants.h"
|
||||
#include "../../src/argumentlist.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QtGui>
|
||||
#include <QDebug>
|
||||
|
||||
#define NO_GTK_STYLE
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
bool debugInfo = false;
|
||||
|
||||
ArgumentList *argList = new ArgumentList(argc, argv);
|
||||
if (argList->getSwitch("-d"))
|
||||
{
|
||||
//If user chooses to switch debug info on...
|
||||
debugInfo = true;
|
||||
}
|
||||
|
||||
if (debugInfo)
|
||||
qDebug() << QString("Octopi Notifier - " + StrConstants::getApplicationVersion() +
|
||||
" (" + StrConstants::getQtVersion() + ")");
|
||||
|
||||
if (UnixCommand::isAppRunning("octopi-notifier"))
|
||||
{
|
||||
qDebug() << "Aborting notifier as another instance is already running!";
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (!QFile::exists(ctn_PACMANHELPER_BINARY))
|
||||
{
|
||||
qDebug() << "Aborting notifier as 'pacmanhelper' binary could not be found! [" << ctn_PACMANHELPER_BINARY << "]";
|
||||
return (-2);
|
||||
}
|
||||
|
||||
if (!QFile::exists(ctn_DBUS_PACMANHELPER_SERVICE))
|
||||
{
|
||||
qDebug() << "Aborting notifier as 'pacmanhelper' DBus service could not be found! [" << ctn_DBUS_PACMANHELPER_SERVICE << "]";
|
||||
return (-3);
|
||||
}
|
||||
|
||||
QApplication a(argc, argv);
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
#ifndef NO_GTK_STYLE
|
||||
QApplication::setGraphicsSystem(QLatin1String("raster"));
|
||||
|
||||
if(!WMHelper::isKDERunning() && (!WMHelper::isLXQTRunning()) && (!WMHelper::isRazorQtRunning()))
|
||||
{
|
||||
qApp->setStyle(new QGtkStyle());
|
||||
}
|
||||
else
|
||||
qApp->setStyle(new QCleanlooksStyle);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
QTranslator appTranslator;
|
||||
appTranslator.load(":/resources/translations/octopi_" +
|
||||
QLocale::system().name());
|
||||
|
||||
a.installTranslator(&appTranslator);
|
||||
a.setQuitOnLastWindowClosed(false);
|
||||
|
||||
MainWindow w;
|
||||
QResource::registerResource("./resources.qrc");
|
||||
|
||||
if (debugInfo)
|
||||
w.turnDebugInfoOn();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
@@ -1,817 +0,0 @@
|
||||
/*
|
||||
* This file is part of Octopi, an open-source GUI for pacman.
|
||||
* Copyright (C) 2013 Alexandre Albuquerque Arnt
|
||||
*
|
||||
* 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 of the License, 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
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "setupdialog.h"
|
||||
#include "outputdialog.h"
|
||||
#include "../pacmanhelper/pacmanhelperclient.h"
|
||||
#include "../../src/strconstants.h"
|
||||
#include "../../src/uihelper.h"
|
||||
#include "../../src/package.h"
|
||||
#include "../../src/transactiondialog.h"
|
||||
|
||||
#include <QTimer>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QProcess>
|
||||
#include <QMessageBox>
|
||||
#include <QDebug>
|
||||
|
||||
#ifdef KSTATUS
|
||||
#include <kstatusnotifieritem.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This is Octopi Notifier slim interface code :-)
|
||||
*/
|
||||
|
||||
/*
|
||||
* The obligatory constructor...
|
||||
*/
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent)
|
||||
{
|
||||
m_debugInfo = false;
|
||||
m_setupDialog = nullptr;
|
||||
m_pacmanDatabaseSystemWatcher =
|
||||
new QFileSystemWatcher(QStringList() << ctn_PACMAN_DATABASE_DIR, this);
|
||||
|
||||
connect(m_pacmanDatabaseSystemWatcher,
|
||||
SIGNAL(directoryChanged(QString)), this, SLOT(refreshAppIcon()));
|
||||
|
||||
initSystemTrayIcon();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
#ifdef KSTATUS
|
||||
delete m_systemTrayIcon;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Let's initialize the system tray object...
|
||||
*/
|
||||
void MainWindow::initSystemTrayIcon()
|
||||
{
|
||||
if (m_debugInfo)
|
||||
qDebug() << "At initSystemTrayIcon()...";
|
||||
|
||||
m_commandExecuting = ectn_NONE;
|
||||
m_outdatedStringList = new QStringList();
|
||||
|
||||
#ifdef KSTATUS
|
||||
m_systemTrayIcon = new KStatusNotifierItem(0);
|
||||
#else
|
||||
m_systemTrayIcon = new QSystemTrayIcon(this);
|
||||
#endif
|
||||
|
||||
m_systemTrayIcon->setObjectName("systemTrayIcon");
|
||||
|
||||
#ifdef KSTATUS
|
||||
m_systemTrayIcon->setIconByPixmap(m_icon);
|
||||
m_systemTrayIcon->setToolTipIconByPixmap(m_icon);
|
||||
m_systemTrayIcon->setTitle("Octopi Notifier");
|
||||
#else
|
||||
m_systemTrayIcon->setIcon(m_icon);
|
||||
#endif
|
||||
|
||||
m_actionExit = new QAction(IconHelper::getIconExit(), tr("Exit"), this);
|
||||
connect(m_actionExit, SIGNAL(triggered()), this, SLOT(exitNotifier()));
|
||||
|
||||
m_actionAbout = new QAction(StrConstants::getHelpAbout(), this);
|
||||
m_actionAbout->setIconVisibleInMenu(true);
|
||||
connect(m_actionAbout, SIGNAL(triggered()), this, SLOT(aboutOctopiNotifier()));
|
||||
|
||||
m_actionOctopi = new QAction(this);
|
||||
m_actionOctopi->setText("Octopi...");
|
||||
connect(m_actionOctopi, SIGNAL(triggered()), this, SLOT(startOctopi()));
|
||||
|
||||
m_actionSetInterval = new QAction(this);
|
||||
m_actionSetInterval->setText(StrConstants::getSetInterval());
|
||||
connect(m_actionSetInterval, SIGNAL(triggered()), this, SLOT(showConfigDialog()));
|
||||
|
||||
m_actionSyncDatabase = new QAction(this);
|
||||
m_actionSyncDatabase->setIconVisibleInMenu(true);
|
||||
m_actionSyncDatabase->setText(StrConstants::getSyncDatabase());
|
||||
m_actionSyncDatabase->setIcon(IconHelper::getIconSyncDatabase());
|
||||
connect(m_actionSyncDatabase, SIGNAL(triggered()), this, SLOT(syncDatabase()));
|
||||
|
||||
m_actionSystemUpgrade = new QAction(this);
|
||||
m_actionSystemUpgrade->setIconVisibleInMenu(true);
|
||||
m_actionSystemUpgrade->setText(tr("System upgrade"));
|
||||
m_actionSystemUpgrade->setIcon(IconHelper::getIconSystemUpgrade());
|
||||
connect(m_actionSystemUpgrade, SIGNAL(triggered()), this, SLOT(runOctopiSysUpgrade()));
|
||||
|
||||
m_systemTrayIconMenu = new QMenu( this );
|
||||
|
||||
if (UnixCommand::hasTheExecutable("octopi"))
|
||||
m_systemTrayIconMenu->addAction(m_actionOctopi);
|
||||
|
||||
m_systemTrayIconMenu->addAction(m_actionSetInterval);
|
||||
m_systemTrayIconMenu->addAction(m_actionSyncDatabase);
|
||||
m_systemTrayIconMenu->addAction(m_actionSystemUpgrade);
|
||||
m_systemTrayIconMenu->addSeparator();
|
||||
m_systemTrayIconMenu->addAction(m_actionAbout);
|
||||
m_systemTrayIconMenu->addAction(m_actionExit);
|
||||
m_systemTrayIcon->setContextMenu(m_systemTrayIconMenu);
|
||||
|
||||
// disable "standard" actions (restore & quit)
|
||||
#ifdef KSTATUS
|
||||
m_systemTrayIcon->setStandardActionsEnabled(false);
|
||||
connect (m_systemTrayIcon, SIGNAL(activateRequested(bool,QPoint)),
|
||||
this, SLOT(execSystemTrayKF5()) );
|
||||
#else
|
||||
connect ( m_systemTrayIcon , SIGNAL( activated( QSystemTrayIcon::ActivationReason ) ),
|
||||
this, SLOT( execSystemTrayActivated ( QSystemTrayIcon::ActivationReason ) ) );
|
||||
#endif
|
||||
|
||||
m_pacmanHelperClient = new PacmanHelperClient("org.octopi.pacmanhelper", "/", QDBusConnection::systemBus(), 0);
|
||||
connect(m_pacmanHelperClient, SIGNAL(syncdbcompleted()), this, SLOT(afterPacmanHelperSyncDatabase()));
|
||||
|
||||
m_pacmanHelperTimer = new QTimer();
|
||||
m_pacmanHelperTimer->setInterval(1000);
|
||||
m_pacmanHelperTimer->start();
|
||||
|
||||
connect(m_pacmanHelperTimer, SIGNAL(timeout()), this, SLOT(pacmanHelperTimerTimeout()));
|
||||
}
|
||||
|
||||
/*
|
||||
* Whenever this timer ticks, we need to call the PacmanHelper DBus interface to sync Pacman's dbs
|
||||
*/
|
||||
void MainWindow::pacmanHelperTimerTimeout()
|
||||
{
|
||||
static bool firstTime=true;
|
||||
|
||||
if (!UnixCommand::hasInternetConnection() || m_commandExecuting != ectn_NONE) return;
|
||||
|
||||
if (firstTime)
|
||||
{
|
||||
refreshAppIcon();
|
||||
|
||||
#ifdef KSTATUS
|
||||
m_systemTrayIcon->setToolTipTitle("Octopi");
|
||||
#else
|
||||
m_systemTrayIcon->show();
|
||||
#endif
|
||||
|
||||
//From now on, we verify if it's time to check for updates every 5 minutes
|
||||
m_pacmanHelperTimer->setInterval(60000 * 5);
|
||||
setWindowIcon(m_icon);
|
||||
firstTime=false;
|
||||
}
|
||||
|
||||
//Is it time to syncdb again?
|
||||
QDateTime lastCheckTime = SettingsManager::getLastSyncDbTime();
|
||||
int syncDbInterval = SettingsManager::getSyncDbInterval();
|
||||
QDateTime now = QDateTime::currentDateTime();
|
||||
bool syncTime = false;
|
||||
int syncHour = SettingsManager::getSyncDbHour();
|
||||
|
||||
//User did not set the check interval, so we assume it's once a day
|
||||
if (syncDbInterval == -1)
|
||||
{
|
||||
if (syncHour >= 0) //Once a day at a certain time?
|
||||
{
|
||||
if (m_debugInfo)
|
||||
qDebug() << "SyncDb is scheduled once a day, at " << syncHour << " hours";
|
||||
|
||||
if (lastCheckTime.daysTo(now) >= 1 && now.time().hour() == syncHour)
|
||||
{
|
||||
syncTime = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_debugInfo)
|
||||
qDebug() << "SyncDb is scheduled once a day";
|
||||
}
|
||||
|
||||
if ((syncHour == -1 && (
|
||||
lastCheckTime.isNull() ||
|
||||
lastCheckTime.daysTo(now) >= 1)) || (syncTime))
|
||||
{
|
||||
syncDatabase();
|
||||
//Then we set new LastCheckTime...
|
||||
SettingsManager::setLastSyncDbTime(now);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lastCheckTime.isNull() || now.addSecs(-(syncDbInterval * 60)) >= lastCheckTime)
|
||||
{
|
||||
syncDatabase();
|
||||
//Then we set new LastCheckTime...
|
||||
SettingsManager::setLastSyncDbTime(now);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_debugInfo)
|
||||
qDebug() << "SyncDb is scheduled once every " << syncDbInterval << " minutes.";
|
||||
}
|
||||
|
||||
m_pacmanHelperTimer->stop();
|
||||
m_pacmanHelperTimer->start();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper to a runOctopi with a call to SystemUpgrade
|
||||
*/
|
||||
void MainWindow::runOctopiSysUpgrade()
|
||||
{
|
||||
runOctopi(ectn_SYSUPGRADE_EXEC_OPT);
|
||||
}
|
||||
|
||||
/*
|
||||
* Shows Octopi About Dialog...
|
||||
*/
|
||||
void MainWindow::aboutOctopiNotifier()
|
||||
{
|
||||
QString aboutText = "<b>Octopi Notifier - " +
|
||||
StrConstants::getApplicationVersion() + "</b>" + " (" + StrConstants::getQtVersion() + ")<br>";
|
||||
aboutText += "<a href=\"http://octopiproject.wordpress.com/\">http://octopiproject.wordpress.com</a><br><br>";
|
||||
aboutText += "© Alexandre Albuquerque Arnt";
|
||||
QMessageBox::about(this, StrConstants::getHelpAbout(), aboutText);
|
||||
}
|
||||
|
||||
/*
|
||||
* Hides Octopi
|
||||
*/
|
||||
void MainWindow::hideOctopi()
|
||||
{
|
||||
QProcess::startDetached("octopi -hide");
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if some SU utility is available...
|
||||
* Returns false if not!
|
||||
*/
|
||||
bool MainWindow::_isSUAvailable()
|
||||
{
|
||||
//If there are no means to run the actions, we must warn!
|
||||
if (WMHelper::getSUCommand() == ctn_NO_SU_COMMAND)
|
||||
{
|
||||
QMessageBox::critical( 0, StrConstants::getApplicationName(),
|
||||
StrConstants::getErrorNoSuCommand() +
|
||||
"\n" + StrConstants::getYoullNeedSuFrontend());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Calls only the Octopi system upgrade window
|
||||
*/
|
||||
void MainWindow::doSystemUpgrade()
|
||||
{
|
||||
//Shows a dialog indicating the targets needed to be retrieved and asks for the user's permission.
|
||||
QList<PackageListData> * targets = Package::getTargetUpgradeList();
|
||||
|
||||
//There are no new updates to install!
|
||||
if (targets->count() == 0 && m_outdatedStringList->count() == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (targets->count() == 0 && m_outdatedStringList->count() > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QString list;
|
||||
double totalDownloadSize = 0;
|
||||
|
||||
foreach(PackageListData target, *targets)
|
||||
{
|
||||
totalDownloadSize += target.downloadSize;
|
||||
list = list + target.name + "-" + target.version + "\n";
|
||||
}
|
||||
list.remove(list.size()-1, 1);
|
||||
|
||||
totalDownloadSize = totalDownloadSize / 1024;
|
||||
QString ds = Package::kbytesToSize(totalDownloadSize);
|
||||
TransactionDialog question(this);
|
||||
|
||||
if(targets->count()==1)
|
||||
question.setText(StrConstants::getRetrievePackage() +
|
||||
"\n\n" + StrConstants::getTotalDownloadSize().arg(ds).remove(" KB"));
|
||||
else
|
||||
question.setText(StrConstants::getRetrievePackages(targets->count()) +
|
||||
"\n\n" + StrConstants::getTotalDownloadSize().arg(ds).remove(" KB"));
|
||||
|
||||
question.setWindowTitle(StrConstants::getConfirmation());
|
||||
question.setInformativeText(StrConstants::getConfirmationQuestion());
|
||||
question.setDetailedText(list);
|
||||
|
||||
m_systemUpgradeDialog = true;
|
||||
int result = question.exec();
|
||||
|
||||
if (result == QDialogButtonBox::Yes)
|
||||
{
|
||||
m_commandExecuting = ectn_SYSTEM_UPGRADE;
|
||||
|
||||
m_systemUpgradeDialog = false;
|
||||
toggleEnableInterface(false);
|
||||
m_actionSystemUpgrade->setEnabled(false);
|
||||
|
||||
OutputDialog *dlg = new OutputDialog(this);
|
||||
|
||||
if (m_debugInfo)
|
||||
dlg->setDebugMode(true);
|
||||
|
||||
QObject::connect(dlg, SIGNAL( finished(int)),
|
||||
this, SLOT( doSystemUpgradeFinished() ));
|
||||
dlg->show();
|
||||
}
|
||||
else if(result == QDialogButtonBox::AcceptRole)
|
||||
{
|
||||
m_systemUpgradeDialog = false;
|
||||
|
||||
//If there are no means to run the actions, we must warn!
|
||||
if (!_isSUAvailable()) return;
|
||||
|
||||
QStringList lastCommandList;
|
||||
lastCommandList.append("pacman -Su;");
|
||||
lastCommandList.append("echo -e;");
|
||||
lastCommandList.append("read -n1 -p \"" + StrConstants::getPressAnyKey() + "\"");
|
||||
|
||||
m_unixCommand = new UnixCommand(this);
|
||||
|
||||
QObject::connect(m_unixCommand, SIGNAL( finished ( int, QProcess::ExitStatus )),
|
||||
this, SLOT( doSystemUpgradeFinished() ));
|
||||
|
||||
toggleEnableInterface(false);
|
||||
m_actionSystemUpgrade->setEnabled(false);
|
||||
|
||||
if (result == QDialogButtonBox::AcceptRole)
|
||||
{
|
||||
m_commandExecuting = ectn_RUN_SYSTEM_UPGRADE_IN_TERMINAL;
|
||||
m_unixCommand->runCommandInTerminal(lastCommandList);
|
||||
}
|
||||
}
|
||||
else if (result == QDialogButtonBox::No)
|
||||
{
|
||||
m_systemUpgradeDialog = false;
|
||||
toggleEnableInterface(true);
|
||||
refreshAppIcon();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* When system upgrade process is finished...
|
||||
*/
|
||||
void MainWindow::doSystemUpgradeFinished()
|
||||
{
|
||||
m_commandExecuting = ectn_NONE;
|
||||
refreshAppIcon();
|
||||
|
||||
//Does it still need to upgrade another packages due to SyncFirst issues???
|
||||
if ((m_commandExecuting == ectn_RUN_SYSTEM_UPGRADE_IN_TERMINAL)
|
||||
&& m_outdatedStringList->count() > 0)
|
||||
{
|
||||
m_commandExecuting = ectn_NONE;
|
||||
m_unixCommand->removeTemporaryFile();
|
||||
|
||||
doSystemUpgrade();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
m_unixCommand->removeTemporaryFile();
|
||||
toggleEnableInterface(true);
|
||||
}
|
||||
|
||||
/*
|
||||
* Enables and Disables some UI elements of Octopi-notifier
|
||||
*/
|
||||
void MainWindow::toggleEnableInterface(bool state)
|
||||
{
|
||||
m_actionOctopi->setEnabled(state);
|
||||
m_actionSyncDatabase->setEnabled(state);
|
||||
m_actionSetInterval->setEnabled(state);
|
||||
m_actionExit->setEnabled(state);
|
||||
}
|
||||
|
||||
/*
|
||||
* Called right after the PacmanHelper syncdb() method has finished!
|
||||
*/
|
||||
void MainWindow::afterPacmanHelperSyncDatabase()
|
||||
{
|
||||
if (m_debugInfo)
|
||||
qDebug() << "At afterPacmanHelperSyncDatabase()...";
|
||||
toggleEnableInterface(true);
|
||||
|
||||
#ifndef KSTATUS
|
||||
m_systemTrayIcon->setContextMenu(m_systemTrayIconMenu);
|
||||
m_systemTrayIconMenu->close();
|
||||
#endif
|
||||
|
||||
m_commandExecuting = ectn_NONE;
|
||||
|
||||
int numberOfOutdatedPackages = m_numberOfOutdatedPackages;
|
||||
refreshAppIcon();
|
||||
|
||||
if (numberOfOutdatedPackages != m_numberOfOutdatedPackages)
|
||||
{
|
||||
if (m_numberOfOutdatedPackages > 0)
|
||||
{
|
||||
QString notification;
|
||||
|
||||
if (m_numberOfOutdatedPackages == 1)
|
||||
{
|
||||
notification = StrConstants::getOneNewUpdate();
|
||||
|
||||
#ifdef KSTATUS
|
||||
m_systemTrayIcon->setToolTipSubTitle(notification);
|
||||
m_systemTrayIcon->showMessage("Octopi",
|
||||
notification, m_systemTrayIcon->iconName());
|
||||
#else
|
||||
m_systemTrayIcon->setToolTip(notification);
|
||||
//if (!UnixCommand::isAppRunning("spun", true)) sendNotification(notification);
|
||||
#endif
|
||||
}
|
||||
else if (m_numberOfOutdatedPackages > 1)
|
||||
{
|
||||
notification = StrConstants::getNewUpdates(m_numberOfOutdatedPackages);
|
||||
|
||||
#ifdef KSTATUS
|
||||
m_systemTrayIcon->setToolTipSubTitle(notification);
|
||||
m_systemTrayIcon->showMessage("Octopi",
|
||||
notification, m_systemTrayIcon->iconName());
|
||||
#else
|
||||
m_systemTrayIcon->setToolTip(notification);
|
||||
//if (!UnixCommand::isAppRunning("spun", true)) sendNotification(notification);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QString notification;
|
||||
|
||||
if (numberOfOutdatedPackages == 1)
|
||||
{
|
||||
notification = StrConstants::getOneNewUpdate();
|
||||
|
||||
#ifdef KSTATUS
|
||||
m_systemTrayIcon->setToolTipSubTitle(notification);
|
||||
m_systemTrayIcon->showMessage("Octopi",
|
||||
notification, m_systemTrayIcon->iconName());
|
||||
#else
|
||||
m_systemTrayIcon->setToolTip(notification);
|
||||
//if (!UnixCommand::isAppRunning("spun", true)) sendNotification(notification);
|
||||
#endif
|
||||
}
|
||||
else if (numberOfOutdatedPackages > 1)
|
||||
{
|
||||
notification = StrConstants::getNewUpdates(numberOfOutdatedPackages);
|
||||
|
||||
#ifdef KSTATUS
|
||||
m_systemTrayIcon->setToolTipSubTitle(notification);
|
||||
m_systemTrayIcon->showMessage("Octopi",
|
||||
notification, m_systemTrayIcon->iconName());
|
||||
#else
|
||||
m_systemTrayIcon->setToolTip(notification);
|
||||
//if (!UnixCommand::isAppRunning("spun", true)) sendNotification(notification);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Called every time user selects "Sync databases..." menu option
|
||||
*/
|
||||
void MainWindow::syncDatabase()
|
||||
{
|
||||
disconnect(m_pacmanDatabaseSystemWatcher,
|
||||
SIGNAL(directoryChanged(QString)), this, SLOT(refreshAppIcon()));
|
||||
|
||||
QTime now;
|
||||
if (m_debugInfo)
|
||||
qDebug() << now.currentTime().toString("HH:mm").toLatin1().data() << ": At syncDatabase()...";
|
||||
toggleEnableInterface(false);
|
||||
m_icon = IconHelper::getIconOctopiTransparent();
|
||||
|
||||
#ifdef KSTATUS
|
||||
m_systemTrayIcon->setIconByPixmap(m_icon);
|
||||
m_systemTrayIcon->setToolTipIconByPixmap(m_icon);
|
||||
m_systemTrayIcon->setToolTipSubTitle(StrConstants::getSyncDatabases());
|
||||
#else
|
||||
m_systemTrayIcon->setIcon(m_icon);
|
||||
m_systemTrayIcon->setToolTip(StrConstants::getSyncDatabases());
|
||||
#endif
|
||||
|
||||
qApp->processEvents();
|
||||
|
||||
m_systemTrayIconMenu->close();
|
||||
|
||||
#ifndef KSTATUS
|
||||
m_systemTrayIcon->setContextMenu(0);
|
||||
#endif
|
||||
|
||||
m_commandExecuting = ectn_SYNC_DATABASE;
|
||||
|
||||
//Let's synchronize kcp database too...
|
||||
if (UnixCommand::getLinuxDistro() == ectn_KAOS && UnixCommand::hasTheExecutable("kcp"))
|
||||
{
|
||||
if (m_debugInfo)
|
||||
qDebug() << "Synchronizing kcp database...";
|
||||
UnixCommand::execCommandAsNormalUser("kcp -u");
|
||||
}
|
||||
|
||||
m_pacmanHelperClient->syncdb();
|
||||
}
|
||||
|
||||
/*
|
||||
* Uses notify-send to send a notification to the systray area
|
||||
*/
|
||||
void MainWindow::sendNotification(const QString &msg)
|
||||
{
|
||||
QString processToExec("notify-send");
|
||||
|
||||
if (UnixCommand::hasTheExecutable(processToExec))
|
||||
{
|
||||
processToExec += " -i /usr/share/icons/octopi_red.png -t 5000 \"" +
|
||||
StrConstants::getApplicationName() + "\" \"" + msg + "\"";
|
||||
QProcess::startDetached(processToExec);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have some outdated packages, let's put an angry red face icon in this app!
|
||||
*/
|
||||
void MainWindow::refreshAppIcon()
|
||||
{
|
||||
disconnect(m_pacmanDatabaseSystemWatcher,
|
||||
SIGNAL(directoryChanged(QString)), this, SLOT(refreshAppIcon()));
|
||||
|
||||
if (m_debugInfo)
|
||||
qDebug() << "At refreshAppIcon()...";
|
||||
m_outdatedStringList = Package::getOutdatedStringList();
|
||||
bool hasAURTool = UnixCommand::hasTheExecutable(StrConstants::getForeignRepositoryToolName());
|
||||
|
||||
if (hasAURTool)
|
||||
{
|
||||
m_outdatedAURStringList = Package::getOutdatedAURStringList();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_outdatedAURStringList = new QStringList();
|
||||
}
|
||||
|
||||
m_numberOfOutdatedPackages = m_outdatedStringList->count();
|
||||
m_numberOfOutdatedAURPackages = m_outdatedAURStringList->count();
|
||||
|
||||
if (m_numberOfOutdatedPackages == 0 && m_numberOfOutdatedAURPackages == 0)
|
||||
{
|
||||
#ifdef KSTATUS
|
||||
m_systemTrayIcon->setToolTipSubTitle("");
|
||||
#else
|
||||
m_systemTrayIcon->setToolTip("");
|
||||
#endif
|
||||
}
|
||||
else if (m_numberOfOutdatedPackages > 0)
|
||||
{
|
||||
if (m_numberOfOutdatedPackages == 1)
|
||||
{
|
||||
#ifdef KSTATUS
|
||||
m_systemTrayIcon->setToolTipSubTitle(StrConstants::getOneNewUpdate());
|
||||
#else
|
||||
m_systemTrayIcon->setToolTip(StrConstants::getOneNewUpdate());
|
||||
#endif
|
||||
}
|
||||
else if (m_numberOfOutdatedPackages > 1)
|
||||
{
|
||||
#ifdef KSTATUS
|
||||
m_systemTrayIcon->setToolTipSubTitle(
|
||||
StrConstants::getNewUpdates(m_numberOfOutdatedPackages));
|
||||
#else
|
||||
m_systemTrayIcon->setToolTip(StrConstants::getNewUpdates(m_numberOfOutdatedPackages));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (m_numberOfOutdatedAURPackages > 0)
|
||||
{
|
||||
if (m_numberOfOutdatedAURPackages == 1)
|
||||
{
|
||||
#ifdef KSTATUS
|
||||
m_systemTrayIcon->setToolTipSubTitle(StrConstants::getOneNewUpdate() +
|
||||
" (" + StrConstants::getForeignRepositoryName() + ")");
|
||||
#else
|
||||
m_systemTrayIcon->setToolTip(StrConstants::getOneNewUpdate() +
|
||||
" (" + StrConstants::getForeignRepositoryName() + ")");
|
||||
#endif
|
||||
}
|
||||
else if (m_numberOfOutdatedAURPackages > 1)
|
||||
{
|
||||
#ifdef KSTATUS
|
||||
m_systemTrayIcon->setToolTipSubTitle(
|
||||
StrConstants::getNewUpdates(m_numberOfOutdatedAURPackages) +
|
||||
" (" + StrConstants::getForeignRepositoryName() + ")");
|
||||
#else
|
||||
m_systemTrayIcon->setToolTip(StrConstants::getNewUpdates(m_numberOfOutdatedAURPackages) +
|
||||
" (" + StrConstants::getForeignRepositoryName() + ")");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if(m_outdatedStringList->count() > 0) //RED ICON!
|
||||
{
|
||||
if(m_commandExecuting == ectn_NONE)
|
||||
{
|
||||
m_actionSystemUpgrade->setEnabled(true);
|
||||
m_actionSystemUpgrade->setVisible(true);
|
||||
}
|
||||
|
||||
if (m_debugInfo)
|
||||
qDebug() << "Got a RED icon!";
|
||||
m_icon = IconHelper::getIconOctopiRed();
|
||||
|
||||
|
||||
#ifdef KSTATUS
|
||||
m_systemTrayIcon->setAttentionIconByPixmap(m_icon);
|
||||
m_systemTrayIcon->setStatus(KStatusNotifierItem::NeedsAttention);
|
||||
#endif
|
||||
}
|
||||
else if(m_outdatedAURStringList->count() > 0) //YELLOW ICON!
|
||||
{
|
||||
m_actionSystemUpgrade->setVisible(false);
|
||||
m_icon = IconHelper::getIconOctopiYellow();
|
||||
if (m_debugInfo)
|
||||
qDebug() << "Got a YELLOW icon!";
|
||||
|
||||
#ifdef KSTATUS
|
||||
m_systemTrayIcon->setAttentionIconByPixmap(m_icon);
|
||||
m_systemTrayIcon->setStatus(KStatusNotifierItem::NeedsAttention);
|
||||
#endif
|
||||
}
|
||||
else //YEAHHH... GREEN ICON!
|
||||
{
|
||||
m_actionSystemUpgrade->setVisible(false);
|
||||
m_icon = IconHelper::getIconOctopiGreen();
|
||||
if (m_debugInfo)
|
||||
qDebug() << "Got a GREEN icon!";
|
||||
|
||||
#ifdef KSTATUS
|
||||
m_systemTrayIcon->setStatus(KStatusNotifierItem::Passive);
|
||||
#endif
|
||||
}
|
||||
|
||||
setWindowIcon(m_icon);
|
||||
|
||||
#ifdef KSTATUS
|
||||
m_systemTrayIcon->setIconByPixmap(m_icon);
|
||||
m_systemTrayIcon->setToolTipIconByPixmap(m_icon);
|
||||
#else
|
||||
m_systemTrayIcon->setIcon(m_icon);
|
||||
#endif
|
||||
|
||||
connect(m_pacmanDatabaseSystemWatcher,
|
||||
SIGNAL(directoryChanged(QString)), this, SLOT(refreshAppIcon()));
|
||||
}
|
||||
|
||||
/*
|
||||
* Whenever the user clicks on the systemTray icon...
|
||||
*/
|
||||
void MainWindow::execSystemTrayActivated(QSystemTrayIcon::ActivationReason ar)
|
||||
{
|
||||
if (m_commandExecuting != ectn_NONE) return;
|
||||
|
||||
switch (ar)
|
||||
{
|
||||
case QSystemTrayIcon::DoubleClick:
|
||||
{
|
||||
if (m_outdatedStringList->count() > 0)
|
||||
{
|
||||
runOctopi(ectn_SYSUPGRADE_EXEC_OPT);
|
||||
}
|
||||
else
|
||||
{
|
||||
runOctopi(ectn_NORMAL_EXEC_OPT);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case QSystemTrayIcon::Trigger:
|
||||
{
|
||||
if (UnixCommand::isAppRunning("octopi", true))
|
||||
{
|
||||
hideOctopi();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This slot is called only when we're using Knotifications from KF5
|
||||
*/
|
||||
void MainWindow::execSystemTrayKF5()
|
||||
{
|
||||
static bool hidingOctopi = true;
|
||||
|
||||
if (UnixCommand::isAppRunning("octopi", true))
|
||||
{
|
||||
if (!hidingOctopi)
|
||||
runOctopi(ectn_NORMAL_EXEC_OPT);
|
||||
else
|
||||
hideOctopi();
|
||||
|
||||
hidingOctopi = !hidingOctopi;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* When the users quit this notifier...
|
||||
*/
|
||||
void MainWindow::exitNotifier()
|
||||
{
|
||||
if (m_debugInfo)
|
||||
qDebug() << "At exitNotifier()...";
|
||||
qApp->quit();
|
||||
}
|
||||
|
||||
/*
|
||||
* Execs Octopi
|
||||
*/
|
||||
void MainWindow::runOctopi(ExecOpt execOptions)
|
||||
{
|
||||
if (execOptions == ectn_SYSUPGRADE_NOCONFIRM_EXEC_OPT)
|
||||
{
|
||||
if (!WMHelper::isKDERunning() && (!WMHelper::isRazorQtRunning()) && (!WMHelper::isLXQTRunning()))
|
||||
{
|
||||
QProcess::startDetached("octopi -sysupgrade-noconfirm -style gtk");
|
||||
}
|
||||
else
|
||||
{
|
||||
QProcess::startDetached("octopi -sysupgrade-noconfirm");
|
||||
}
|
||||
}
|
||||
else if (execOptions == ectn_SYSUPGRADE_EXEC_OPT &&
|
||||
!UnixCommand::isAppRunning("octopi", true) && m_outdatedStringList->count() > 0)
|
||||
{
|
||||
doSystemUpgrade();
|
||||
}
|
||||
else if (execOptions == ectn_SYSUPGRADE_EXEC_OPT &&
|
||||
UnixCommand::isAppRunning("octopi", true) && m_outdatedStringList->count() > 0)
|
||||
{
|
||||
if (!WMHelper::isKDERunning() && (!WMHelper::isRazorQtRunning()) && (!WMHelper::isLXQTRunning()))
|
||||
{
|
||||
QProcess::startDetached("octopi -sysupgrade -style gtk");
|
||||
}
|
||||
else
|
||||
{
|
||||
QProcess::startDetached("octopi -sysupgrade");
|
||||
}
|
||||
}
|
||||
else if (execOptions == ectn_NORMAL_EXEC_OPT)
|
||||
{
|
||||
if (!WMHelper::isKDERunning() && (!WMHelper::isRazorQtRunning()) && (!WMHelper::isLXQTRunning()))
|
||||
{
|
||||
QProcess::startDetached("octopi -style gtk");
|
||||
}
|
||||
else
|
||||
{
|
||||
QProcess::startDetached("octopi");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Calls the QDialog to set notifier interval
|
||||
*/
|
||||
void MainWindow::showConfigDialog()
|
||||
{
|
||||
if (m_setupDialog == nullptr)
|
||||
{
|
||||
m_setupDialog = new SetupDialog(this);
|
||||
#if QT_VERSION >= 0x050000
|
||||
utils::positionWindowAtScreenCenter(m_setupDialog);
|
||||
#endif
|
||||
m_setupDialog->exec();
|
||||
|
||||
delete m_setupDialog;
|
||||
m_setupDialog = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2013-07-20T16:15:14
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += core xml gui network dbus
|
||||
|
||||
# This controls whether octopi-notifier uses KStatusNotifier lib
|
||||
# You SHOULD REALLY enable the following define in plasma 5 desktops!
|
||||
#DEFINES += KSTATUS
|
||||
|
||||
contains(DEFINES, KSTATUS){
|
||||
QT += KNotifications
|
||||
}
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
CONFIG += qt console warn_on debug
|
||||
QMAKE_CXXFLAGS += -std=c++11
|
||||
TARGET = octopi-notifier
|
||||
TEMPLATE = app
|
||||
DESTDIR += ../bin
|
||||
OBJECTS_DIR += ../build-octopi-notifier
|
||||
MOC_DIR += ../build-octopi-notifier
|
||||
UI_DIR += ../build-octopi-notifier
|
||||
|
||||
SOURCES += main.cpp \
|
||||
mainwindow.cpp \
|
||||
setupdialog.cpp \
|
||||
outputdialog.cpp \
|
||||
../../src/terminal.cpp \
|
||||
../../src/unixcommand.cpp \
|
||||
../../src/package.cpp \
|
||||
../../src/wmhelper.cpp \
|
||||
../../src/settingsmanager.cpp \
|
||||
../pacmanhelper/pacmanhelperclient.cpp \
|
||||
../../src/utils.cpp \
|
||||
../../src/transactiondialog.cpp \
|
||||
../../src/argumentlist.cpp \
|
||||
../../src/pacmanexec.cpp \
|
||||
../../src/searchlineedit.cpp \
|
||||
../../src/searchbar.cpp
|
||||
|
||||
HEADERS += \
|
||||
mainwindow.h \
|
||||
setupdialog.h \
|
||||
outputdialog.h \
|
||||
../../src/uihelper.h \
|
||||
../../src/terminal.h \
|
||||
../../src/unixcommand.h \
|
||||
../../src/wmhelper.h \
|
||||
../../src/strconstants.h \
|
||||
../../src/package.h \
|
||||
../pacmanhelper/pacmanhelperclient.h \
|
||||
../../src/utils.h \
|
||||
../../src/transactiondialog.h \
|
||||
../../src/argumentlist.h \
|
||||
../../src/pacmanexec.h \
|
||||
../../src/searchlineedit.h \
|
||||
../../src/searchbar.h
|
||||
|
||||
FORMS += ../../ui/transactiondialog.ui \
|
||||
ui/setupdialog.ui
|
||||
|
||||
RESOURCES += \
|
||||
../../resources.qrc
|
||||
@@ -1,277 +0,0 @@
|
||||
/*
|
||||
* This file is part of Octopi, an open-source GUI for pacman.
|
||||
* Copyright (C) 2013 Alexandre Albuquerque Arnt
|
||||
*
|
||||
* 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 of the License, 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
|
||||
*
|
||||
*/
|
||||
|
||||
#include "outputdialog.h"
|
||||
#include "../../src/pacmanexec.h"
|
||||
#include "../../src/searchbar.h"
|
||||
#include "../../src/uihelper.h"
|
||||
#include "../../src/strconstants.h"
|
||||
|
||||
#include <QTextBrowser>
|
||||
#include <QVBoxLayout>
|
||||
#include <QProgressBar>
|
||||
#include <QCloseEvent>
|
||||
#include <QMessageBox>
|
||||
|
||||
/*
|
||||
* Class that displays pacman output for system upgrade
|
||||
*/
|
||||
|
||||
/*
|
||||
* The obligatory constructor...
|
||||
*/
|
||||
OutputDialog::OutputDialog(QWidget *parent): QDialog(parent)
|
||||
{
|
||||
init();
|
||||
m_upgradeRunning = false;
|
||||
m_debugInfo = false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets if pacmanExec will be called in debugMode or not
|
||||
*/
|
||||
void OutputDialog::setDebugMode(bool newValue)
|
||||
{
|
||||
m_debugInfo = newValue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Let's build the main widgets...
|
||||
*/
|
||||
void OutputDialog::init()
|
||||
{
|
||||
this->resize(650, 500);
|
||||
|
||||
setWindowTitle(QCoreApplication::translate("MainWindow", "System upgrade"));
|
||||
setWindowIcon(IconHelper::getIconSystemUpgrade());
|
||||
m_mainLayout = new QVBoxLayout(this);
|
||||
m_textBrowser = new QTextBrowser(this);
|
||||
m_progressBar = new QProgressBar(this);
|
||||
|
||||
m_textBrowser->setGeometry(QRect(0, 0, 650, 500));
|
||||
|
||||
m_mainLayout->addWidget(m_textBrowser);
|
||||
|
||||
m_searchBar = new SearchBar(this);
|
||||
connect(m_searchBar, SIGNAL(textChanged(QString)), this, SLOT(onSearchBarTextChanged(QString)));
|
||||
connect(m_searchBar, SIGNAL(closed()), this, SLOT(onSearchBarClosed()));
|
||||
connect(m_searchBar, SIGNAL(findNext()), this, SLOT(onSearchBarFindNext()));
|
||||
connect(m_searchBar, SIGNAL(findPrevious()), this, SLOT(onSearchBarFindPrevious()));
|
||||
m_mainLayout->addWidget(m_progressBar);
|
||||
m_mainLayout->addWidget(m_searchBar);
|
||||
m_mainLayout->setSpacing(0);
|
||||
m_mainLayout->setSizeConstraint(QLayout::SetMinimumSize);
|
||||
m_mainLayout->setContentsMargins(2, 2, 2, 2);
|
||||
|
||||
m_progressBar->setMinimum(0);
|
||||
m_progressBar->setMaximum(100);
|
||||
m_progressBar->setValue(0);
|
||||
m_progressBar->close();
|
||||
m_searchBar->show();
|
||||
}
|
||||
|
||||
/*
|
||||
* Calls PacmanExec to begin system upgrade
|
||||
*/
|
||||
void OutputDialog::doSystemUpgrade()
|
||||
{
|
||||
m_pacmanExec = new PacmanExec();
|
||||
|
||||
if (m_debugInfo)
|
||||
m_pacmanExec->setDebugMode(true);
|
||||
|
||||
QObject::connect(m_pacmanExec, SIGNAL( finished ( int, QProcess::ExitStatus )),
|
||||
this, SLOT( pacmanProcessFinished(int, QProcess::ExitStatus) ));
|
||||
|
||||
QObject::connect(m_pacmanExec, SIGNAL(percentage(int)), this, SLOT(onPencertange(int)));
|
||||
QObject::connect(m_pacmanExec, SIGNAL(textToPrintExt(QString)), this, SLOT(onWriteOutput(QString)));
|
||||
|
||||
m_upgradeRunning = true;
|
||||
m_pacmanExec->doSystemUpgrade();
|
||||
|
||||
//m_pacmanExec->doInstall("octopi"); //TEST CODE!
|
||||
}
|
||||
|
||||
/*
|
||||
* Centers the dialog in the screen
|
||||
*/
|
||||
void OutputDialog::show()
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
utils::positionWindowAtScreenCenter(this);
|
||||
#endif
|
||||
QDialog::show();
|
||||
doSystemUpgrade();
|
||||
}
|
||||
|
||||
/*
|
||||
* Whenever the user presses the ESC key
|
||||
*/
|
||||
void OutputDialog::reject()
|
||||
{
|
||||
if (!m_upgradeRunning)
|
||||
{
|
||||
QDialog::reject();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Slot called whenever PacmanExec emits a new percentage change
|
||||
*/
|
||||
void OutputDialog::onPencertange(int percentage)
|
||||
{
|
||||
if (percentage > 0 && !m_progressBar->isVisible()) m_progressBar->show();
|
||||
m_progressBar->setValue(percentage);
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper method to position the text cursor always in the end of doc
|
||||
*/
|
||||
void OutputDialog::positionTextEditCursorAtEnd()
|
||||
{
|
||||
QTextCursor tc = m_textBrowser->textCursor();
|
||||
tc.clearSelection();
|
||||
tc.movePosition(QTextCursor::End);
|
||||
m_textBrowser->setTextCursor(tc);
|
||||
}
|
||||
|
||||
/*
|
||||
* A helper method which writes the given string to the textbrowser
|
||||
*/
|
||||
void OutputDialog::writeToTabOutput(const QString &msg, TreatURLLinks treatURLLinks)
|
||||
{
|
||||
utils::writeToTextBrowser(m_textBrowser, msg, treatURLLinks);
|
||||
}
|
||||
|
||||
/*
|
||||
* Slot called whenever PacmanExec emits a new output
|
||||
*/
|
||||
void OutputDialog::onWriteOutput(const QString &output)
|
||||
{
|
||||
utils::positionTextEditCursorAtEnd(m_textBrowser);
|
||||
m_textBrowser->insertHtml(output);
|
||||
m_textBrowser->ensureCursorVisible();
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper method to find the given "findText" in a TextEdit
|
||||
*/
|
||||
bool OutputDialog::textInTabOutput(const QString& findText)
|
||||
{
|
||||
return (utils::strInQTextEdit(m_textBrowser, findText));
|
||||
}
|
||||
|
||||
/*
|
||||
* Slot called whenever PacmanExec finishes its job
|
||||
*/
|
||||
void OutputDialog::pacmanProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
|
||||
{
|
||||
m_progressBar->close();
|
||||
|
||||
if ((exitCode == 0) && exitStatus == QProcess::NormalExit)
|
||||
{
|
||||
writeToTabOutput("<br><b>" + StrConstants::getCommandFinishedOK() + "</b><br>");
|
||||
}
|
||||
else
|
||||
{
|
||||
writeToTabOutput("<br><b>" + StrConstants::getCommandFinishedWithErrors() + "</b><br>");
|
||||
}
|
||||
|
||||
if (exitCode != 0 && (textInTabOutput("conflict"))) //|| _textInTabOutput("could not satisfy dependencies")))
|
||||
{
|
||||
int res = QMessageBox::question(this, StrConstants::getThereHasBeenATransactionError(),
|
||||
StrConstants::getConfirmExecuteTransactionInTerminal(),
|
||||
QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
|
||||
|
||||
if (res == QMessageBox::Yes)
|
||||
{
|
||||
m_pacmanExec->runLastestCommandInTerminal();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
delete m_pacmanExec;
|
||||
m_upgradeRunning = false;
|
||||
}
|
||||
|
||||
/*
|
||||
* User changed text to search in the line edit
|
||||
*/
|
||||
void OutputDialog::onSearchBarTextChanged(QString strToSearch)
|
||||
{
|
||||
utils::searchBarTextChangedInTextBrowser(m_textBrowser, m_searchBar, strToSearch);
|
||||
}
|
||||
|
||||
/*
|
||||
* User closed the search bar
|
||||
*/
|
||||
void OutputDialog::onSearchBarClosed()
|
||||
{
|
||||
utils::searchBarClosedInTextBrowser(m_textBrowser, m_searchBar);
|
||||
}
|
||||
|
||||
/*
|
||||
* User requested next found string
|
||||
*/
|
||||
void OutputDialog::onSearchBarFindNext()
|
||||
{
|
||||
utils::searchBarFindNextInTextBrowser(m_textBrowser, m_searchBar);
|
||||
}
|
||||
|
||||
/*
|
||||
* User requested previous found string
|
||||
*/
|
||||
void OutputDialog::onSearchBarFindPrevious()
|
||||
{
|
||||
utils::searchBarFindPreviousInTextBrowser(m_textBrowser, m_searchBar);
|
||||
}
|
||||
|
||||
/*
|
||||
* Let's not exit the dialog if a system upgrade is running
|
||||
*/
|
||||
void OutputDialog::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
//We cannot quit while there is a running transaction!
|
||||
if(m_upgradeRunning)
|
||||
{
|
||||
event->ignore();
|
||||
}
|
||||
else
|
||||
{
|
||||
emit finished(0);
|
||||
event->accept();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Whenever user presses Ctrl+F, we show the searchbar again
|
||||
*/
|
||||
void OutputDialog::keyPressEvent(QKeyEvent *ke)
|
||||
{
|
||||
if(ke->key() == Qt::Key_F && ke->modifiers() == Qt::ControlModifier)
|
||||
{
|
||||
m_searchBar->show();
|
||||
}
|
||||
else if(ke->key() == Qt::Key_Escape)
|
||||
{
|
||||
reject();
|
||||
}
|
||||
else ke->accept();
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user