Compare commits

...

158 Commits

Author SHA1 Message Date
494590475a release 2.3.2 2015-07-04 02:35:09 +03:00
27ab7d9cd7 fix cast int as float 2015-07-03 00:05:47 +03:00
1869a68122 fix bug with no actions
set network speed units as MB/s if the value more than 1k KB/s
2015-07-03 00:04:03 +03:00
aa0a4b417d improve battery support 2015-07-01 01:14:04 +03:00
41deb8ef72 fix plasma crash with extquotes
rewrite main widget to use signal-slot model
2015-06-30 07:13:58 +03:00
aa15e13713 update fr translations 2015-06-14 17:19:38 +03:00
ad63f78929 update links to opensuse packages 2015-06-12 15:05:56 +03:00
224e558a98 release 2.3.1 2015-06-11 01:49:22 +03:00
a391df2804 - fix bug with invalid values updates from configuration UI
* merge fan tags to temp ones for better handling
2015-06-10 10:31:41 +03:00
755d0b39f8 Merge pull request #56 from underr/master
Update PT-BR translations
2015-06-06 13:18:40 +03:00
fcd612880f Update PT-BR translations 2015-06-05 21:54:24 -03:00
5aff2d2e4e update Spain translations 2015-06-05 00:19:02 +03:00
5a52c056a7 update Ukrainian translation 2015-06-04 01:54:26 +03:00
42615a6fdc update translation, fix #53 2015-06-02 01:21:03 +03:00
b431d2c6cf Release 2.3.0 2015-06-01 01:40:06 +03:00
f96b3fcb07 implement \r to default json of ExtScripts
some refactoring
bump ApiVer of ExtQuotes
update changelog
2015-05-31 02:57:43 +03:00
f534a6854a try to implement timeouts support to quotes (ref to #54) 2015-05-29 18:29:13 +03:00
b51c97abbb drop qxml, port quotes from xml to json (xml has been used for qt4
branch)
2015-05-28 09:16:27 +03:00
8dc3510a30 more pretty configuration interface
implement quotes changes
2015-05-25 02:28:09 +03:00
fce098cb5c improve work with filters for custom scripts
implement new line filters for widget text
fix bug with html parsing
implement key sorting in combo boxes
2015-05-24 00:03:54 +03:00
5f4bf9ec29 edit readme.md
implement initial support of filters (dep #53)
2015-05-23 02:07:16 +03:00
8c73b2560b Release 2.2.2
* update screenshots
+ add error logging to extquotes
- fix paragraph bug
- fix bug with DP settings
2015-05-22 00:18:14 +03:00
78931b3ae0 fix CMake 2015-05-20 00:39:07 +03:00
a53c5ec38c drop kde4 from master 2015-05-20 00:36:48 +03:00
3bac9ac09f * fix hddtemp definition (create workaround)
* create git pkgbuild
* fix plugin build
* replace hddtemp to smartctl by default
2015-05-19 09:41:15 +03:00
b82d78bcbe implement #51 for upgrade and scripts 2015-05-18 00:57:47 +03:00
396fa95ec3 some refactoring
update resizing
2015-05-17 14:09:08 +03:00
c6cadba4b6 some part of refactoring
move plugin from private
fix translation issue (#50)
2015-05-12 00:19:08 +03:00
daa362fc16 Merge branch 'master' of github.com:arcan1s/awesome-widgets 2015-05-11 01:29:57 +03:00
26c51007e0 some fixes in ui 2015-05-11 01:29:42 +03:00
7919e6d250 update DP paint 2015-05-08 16:49:13 +03:00
88c3e780cf implement tag number support to widget
bump api ver to 2
2015-05-07 00:17:35 +03:00
7f4dfe1060 * more correct sizes in the configuration interface
* remove additional debug information
* increase limits for extscripts intervals to 10000 (fix #48)
2015-05-06 00:31:37 +03:00
15d88ee3ba more correct widget resizing. Create width and height options (#47) 2015-05-05 02:18:39 +03:00
104bb52557 add work with key cache
fix bug with invalid dataengine settings in UI
2015-05-03 03:49:39 +03:00
9a6b883905 fixed bugs with dataengine settings saving 2015-05-02 01:40:20 +03:00
fd8f2127d9 initial support of quotes 2015-04-28 16:43:34 +03:00
7ae90bf82d release 2.2.1 2015-02-24 00:14:04 +03:00
bcf26156d1 * implement interval to extupgrade (ApiVer = 1) (fix #45)
* improve extscript logic
* add cache values to both of them
2015-02-24 00:02:59 +03:00
4cee2535ee add desktop files reconfiguring
fix target on cmake builds
improve cmake version check logic
2015-02-17 03:37:06 +03:00
e1ebd87871 update pkg logic 2015-02-16 13:12:38 +03:00
4cef889fd4 implement is-active properties 2015-02-16 03:45:49 +03:00
d785839d1d remote sensors from deplist 2015-02-16 02:20:22 +03:00
cf6ccc293b update readme 2015-02-16 02:13:37 +03:00
e9ee6150c1 release 2.2.0 (KF5 developer preview) 2015-02-15 19:14:19 +03:00
30577e91ec changes in notifications 2015-02-14 21:25:18 +03:00
e5006ed2d6 fix update pkg
add notify flag
2015-02-13 08:11:56 +03:00
3bd73d0458 fix cppcheck warnings
improvements of interaction with items
2015-02-12 02:57:05 +03:00
4dbf5150fc update supporting files 2015-02-11 07:38:30 +03:00
061244b1d0 update translations
add notifications
edit resizing
fix reading ps
some fixes
2015-02-11 05:04:56 +03:00
8055647f34 * remove panel hidding functions (comment in)
* remove ps calls from DE. Now processes are reading from /proc
* remove qdbus calls from DE. Now mpris information is reading using
  native DBus functions
* update graphicalitem in KDE4

TODO:
* widgets resizing
* tests and optimizations
* update DE configuration for KDE4 package
2015-02-10 18:50:36 +03:00
d74c7cb030 add forgotten freeing 2015-02-09 14:09:18 +03:00
f5006af977 add remove button 2015-02-09 14:08:51 +03:00
16d7d2bc20 update DP
update aw-kde4
2015-02-08 12:57:25 +03:00
6e27717dc8 rollback gi 2015-02-07 01:29:22 +03:00
d1f1d79752 Merge branch 'master' of github.com:arcan1s/awesome-widgets
Conflicts:
	sources/awesome-widget-kde4/graphicalitem.cpp
2015-02-07 01:28:14 +03:00
862d14dc0e udpate aw-kde4 2015-02-06 16:22:31 +03:00
685c0390b4 end porting core part
todo: panels control, windows preview
2015-02-05 12:31:34 +03:00
35a5aa6a6c fix memory leak 2015-02-05 05:32:38 +03:00
681fec4cac start work on desktop panel 2015-02-05 04:26:19 +03:00
bb88892125 add notifications
edit widget.qml
fix bug in monitor
2015-02-04 05:20:00 +03:00
f01fd96cf6 add support of smartctl (TODO remove qdbus calls)
end work on awesome-widget (prerelease state)
2015-02-04 04:17:40 +03:00
eac1319889 some work on tooltip 2015-02-03 08:33:46 +03:00
86d4bd76ea some fixes 2015-02-03 02:01:43 +03:00
27fd4e8f1e end work on awesomewidget
edit setdatabysource method
2015-02-02 08:21:56 +03:00
9611677254 some updates 2015-02-01 03:34:16 +03:00
a61cff7caa remove fucking connector 2015-01-31 07:20:22 +03:00
4966a0a5bf some work on configuration interface
correct file locations
create configuration slots
TODO сделать этот ебаный коннектор или выкинуть его нахуй
2015-01-31 06:10:21 +03:00
b1abf74e89 work on interface 2015-01-30 08:35:22 +03:00
16170c72b0 move back desktop files
add widget configuration
append plugin slots
rewrite KF5 and DE to use ExtUpgrade class
some fixes
2015-01-30 02:43:31 +03:00
c5a0ba3796 end work on core part. Now widget works normally
(except for configuration and appearance)
2015-01-28 07:53:31 +03:00
cce37d66e5 dataengine fixes 2015-01-25 17:26:54 +03:00
c850aaf2a3 some work on porting 2015-01-24 19:16:00 +03:00
43efbbba72 minor changes 2015-01-23 08:36:27 +03:00
3a0cbee39f realize keys methods 2015-01-21 08:06:48 +03:00
213595b3c1 split plugin to classes
rewrite extscripts
fix building
implement several methods
2015-01-20 01:08:21 +03:00
f5fbb80d91 work on plugin 2015-01-19 08:31:48 +03:00
0288e6e1eb edit translations build 2015-01-18 04:16:40 +03:00
6667b45919 edit translations 2015-01-17 23:24:14 +03:00
9ff07241b1 implement general methods to plugin 2015-01-17 02:30:16 +03:00
cc7b7b5659 create skel for aw 2015-01-16 05:27:41 +03:00
3e709f549d port dataengine to kf5 2015-01-16 04:09:39 +03:00
adcf6c942f start work on porting 2015-01-15 18:46:56 +03:00
7415a6830f release 2.1.0 2014-12-31 01:04:50 +03:00
c23846f7b4 update readme 2014-12-28 16:49:43 +03:00
e957a2723b Merge branch 'master' of github.com:arcan1s/awesome-widgets 2014-12-26 02:31:29 +03:00
5369bbda65 remove script 2014-12-26 02:31:13 +03:00
6a8842163e update text in version.h 2014-12-25 00:14:03 +03:00
56e7ee3d11 approve translation 2014-12-24 00:05:40 +03:00
ce72c46cd9 Merge pull request #40 from underr/master
pt_BR translation
2014-12-24 00:00:59 +03:00
78ab09c1da pt_BR translation 2014-12-23 14:21:32 -02:00
498a965488 add skel to create rpm and debs 2014-12-23 10:32:18 +03:00
d1d4a97fa4 apply fix to extscripts 2014-12-22 06:19:25 +03:00
8f1e8606d4 update Ukrainian transaltion 2014-12-18 01:37:06 +03:00
b682c6dbd6 update Spanish translation 2014-12-16 09:36:02 +03:00
c8bf047e76 implement #36
fix (?) initialization
update translations
2014-12-15 02:41:39 +03:00
a336d9aa04 fix #37 2014-12-12 01:04:31 +03:00
2272b0c2c0 auto commit 2014-12-12 00:02:48 +03:00
0533ee8cd5 add #38 2014-12-07 03:04:35 +03:00
be792a4c5a add graphical settings 2014-12-03 04:33:13 +00:00
997e13706b add comments to template 2014-11-29 22:48:52 +03:00
6bcb6798a2 fix #37 2014-11-28 21:02:45 +03:00
4e3593a2a9 fix build 2014-11-25 04:00:01 +03:00
4b471593c7 update changelogs 2014-11-24 09:36:17 +03:00
695a85be29 update translations, implement copy method 2014-11-21 05:13:01 +03:00
bae34ba898 update translations, version and readme 2014-11-21 03:28:11 +03:00
93db63b16c * fix naming
* fix notification
2014-11-20 06:13:09 +03:00
0cd2ff6813 rewrite all ui interfaces t oKDE standards 2014-11-20 06:01:56 +03:00
222db43dc1 update extscripts and dp ui files to kde standards 2014-11-20 04:21:24 +03:00
e4be3b2e02 simplify custom script class
remove QGraphicsView border
2014-11-20 04:07:14 +03:00
543e39a7ac Merge branch 'master' of github.com:arcan1s/awesome-widgets 2014-11-20 03:18:53 +03:00
ca60a85241 update graphicalitem 2014-11-19 16:19:23 +03:00
2c3c575493 * add .desktop suffix to files if they have not
* remove frameshape
2014-11-19 15:04:10 +03:00
5f37a9d8c7 fix direction 2014-11-19 12:28:43 +03:00
c3420a8393 some simplification of graphicalitem 2014-11-19 12:08:54 +03:00
5ce3a5c213 fix configuration 2014-11-19 11:14:55 +03:00
179a97b01b implement tooltip to configuration interface 2014-11-18 12:58:56 +03:00
f0c79a4dab implement contextual menu to listWidgets 2014-11-18 11:54:23 +03:00
f56f319075 some update on graphical items 2014-11-18 06:56:22 +03:00
f7b7d5b6b4 fix run 2014-11-17 17:38:02 +03:00
3193de1a85 implement ExtScripts configuration 2014-11-17 17:04:31 +03:00
8cdfdd4e81 start work on porting extscripts to *.desktop configuration 2014-11-17 10:29:09 +03:00
16d7ca2005 update extscript to inherit from QDialog 2014-11-17 10:01:57 +03:00
e54ab7e1a5 small update 2014-11-16 22:37:55 +03:00
a335979830 implement grapicalitem settings 2014-11-16 13:33:09 +03:00
8460d07875 implement tryDelete() method 2014-11-16 11:40:16 +03:00
5ec26c7747 implement graphical item to aw (except for configuration) 2014-11-14 07:16:55 +03:00
8aafdb6fc4 update gi to use desktop conf files 2014-11-14 04:19:53 +03:00
9eedaf246f rename ring to circle 2014-11-13 12:03:48 +03:00
e7714042bb yet another fix margin 2014-11-13 11:21:51 +03:00
0f4bbbfba1 some intermediate commit 2014-11-12 05:16:05 +03:00
7069758b73 add colorsettings to DP tooltip
remove deprecated settings from AW
2014-11-10 01:53:27 +03:00
bbc9d72606 fix margin 2014-11-10 00:51:43 +03:00
b53b1111f9 fix tooltip to DP 2014-11-09 08:22:05 +03:00
64fdc4bebe move tooltip to proxydiwget 2014-11-09 04:50:22 +03:00
583046e195 update translations 2014-11-08 18:41:33 +03:00
71b3a4e6ab implement #35 2014-11-07 05:36:36 +03:00
4b90fac0c4 implement #28 2014-11-07 04:56:32 +03:00
2fa0acf13d some intermediate commit 2014-11-06 20:42:53 +03:00
0f9d2e52ab fix #24 2014-11-04 00:06:22 +03:00
373bab14db some edit of external scripts 2014-11-04 00:04:13 +03:00
7e095c4349 implement script function 2014-11-03 06:33:39 +03:00
a4af7ffc07 some improvemance of external scripts 2014-11-03 05:03:14 +03:00
0ab4878b22 update translations 2014-11-01 23:26:47 +03:00
1748829901 implement script feature to the widget 2014-10-31 07:20:14 +03:00
6a41fa2b8a implement script feature to dataengine 2014-10-31 06:13:49 +03:00
2cd04e1f7f end work on extscript class 2014-10-31 04:43:17 +03:00
0a61d926f8 create properties 2014-10-31 01:54:35 +03:00
45c248b101 some intermediate commit 2014-10-30 01:05:09 +03:00
6a784d2e28 remove install script from git pkgbuild 2014-10-27 04:33:16 +03:00
13023a4985 add workaround for #34 to AW 2014-10-27 04:20:13 +03:00
6463ed3bf7 add pkgbuild-git 2014-10-26 17:06:39 +03:00
5bf3847bc9 add checkupdates function 2014-10-15 16:41:31 +04:00
4fc2e238bd fix regexp matching 2014-10-14 05:15:13 +04:00
c18bb61521 implement about window 2014-10-12 15:01:07 +04:00
9e82210463 implement autoupdate function to aw (see #32) 2014-10-11 03:38:19 +04:00
171d545562 add skel for #32 2014-10-10 23:36:11 +04:00
c6fa1f2a79 update tasks 2014-10-08 22:39:39 +04:00
167 changed files with 21411 additions and 12980 deletions

View File

@ -1,3 +1,81 @@
Ver.2.3.2:
+ change network speed units from KB/s to MB/s if value is more than 1000 KB/s (metrics are the same)
- fix bug with no actions on link activation (thanks to infans)
* improve quotes support, e.g. fix plasma crash
* rewrite main widget to signal-slot update model
* improve battery calculation for system which has several batteries
Ver.2.3.1:
- fix bug with no updates from configuration UI
- fix invalid vertical tab parsing
* translation update
* merge fan tags to temp ones, improve lmsensors tags handling
Ver.2.3.0:
+ implement fitlers support to ExtScripts (ApiVer = 3) (#53)
+ implement ability to wrap `\n` as new lines (#53)
+ implement key sorting in comboboxes
+ implement (perc)(bid|ask|price)chg tag support (ApiVer = 2)
+ implement timeouts to quotes (#54)
- fix bug with invalid html parsing
* move from XML to JSON in ExtQuotes (ApiVer = 2)
* more pretty configuration UI
* some part of refactoring
Ver.2.2.2:
+ add quotes support (#46)
+ add support of properties height and width (#47)
+ add transtaltion support to the plugins (#50)
+ add support of key caching
+ add support of X-AW-Number to ExtScript and ExtUpgrade (ApiVer = 2)
+ add reconnection to DataEngine (in some cases some values are not updated)
+ add widgets width and height update
- fix bug with Ext* items update (#49)
- fix bug with GPUDEV, HDDDEV settings saving from UI
- fix Desktop Panel settings
- fix bug with adding paragraph settings
* drop support of KDE4 support, created a separated branch
* increase intervals limits (#48)
* hddtemp was replaced to smartctl by default
* plugins were moved from private
* more correct interface painting
Ver.2.2.1:
+ add key X-AW-Interval to ExtUpgrade (ApiVer = 1, default = 3600)
+ add values cache to ExtScript and ExtUpgrade
+ add support isActive to ExtUpgrade
* change cmake version check
* improve logic of ExtScript and ExtUpgrade
Ver.2.2.0:
* port to Plasma 5
+ add support of windows list in tooltip
+ add notifications on system events
+ add ability to show selected tag
+ add tags $downN, $upN
+ add new engine netdev
+ add support of smartctl
- remove ability to hide panel on hotkey
* small changes in widget logic
* edit window preview painting
* KDE4 code upgrade to new ABI
* DataEngine optimization
* PKGCMD was replaced by ExtUpgrade
Ver.2.1.0:
+ add support of custom scripts
+ add support of desktop preview to DP
+ add bar support
+ add autoupdate function
- remove custom command
- fix #34
* fix notifications
* rewrite UI to KDE standards
* fix margins on graphical objects
* rewrite DP abd DE to use library calls
* edit GPU properties definition
* edit regexp matching
Ver.2.0.5:
+ add tooltip bottom (#30)
* fix network interface update
@ -56,7 +134,7 @@ Ver.1.11.0:
+ add desktop label (tags $name, $number, $total)
+ add ability to interact with players using mpris
* rewrite to use submodules
* rewrite dataengine to use tasks
* rewrite DataEngine to use tasks
* fix nvidia temperature definition
Ver.1.10.2:
@ -85,7 +163,7 @@ Ver.1.10.0:
- remove util.py
- remove createNotifyrc since it isn't needed
* refactoring of configuration interface
* player settings was moved from plasmoid to dataengine
* player settings was moved from plasmoid to DataEngine
* edit readme call
* change readme from md to html
@ -133,8 +211,8 @@ Ver.1.7.3:
Ver.1.7.2:
+ add tags $dd, $d, $hh, $h, $mm, $m to custom uptime format
+ add scalling to tooltips
+ add dataengine configuration from ptm
+ add custom command to dataengine
+ add DataEngine configuration from ptm
+ add custom command to DataEngine
- remove custom command from ptm
- remove tags $ds, $hs, $ms

View File

@ -1,3 +1,81 @@
Вер.2.3.2:
+ добавлено изменение скорости интернета с KB/s на MB/s, если величина более 1000 KB/s
- пофикшен баг с отсутствием действия при активации ссылки (спасибо infans)
* улучшена поддержка котировок, например пофикшен возможный сегфолт плазмы
* переписать основной виджет к модели сигнал-слот
* улучшена поддержка расчета заряда батареи для нескольких батарей
Вер.2.3.1:
- пофикшен баг с отсутствием обновлений значений из настроек
- убрана поддержка фильтра `\t`
* обновлены переводы
* теги fan были объединены с temp, улучшена поддержка тегов lmsensors
Вер.2.3.0:
+ добавлена поддержка фильтров в ExtScript (ApiVer = 3) (#53)
+ добавлена возможность отображать `\n`, как перенос строки (#53)
+ добавлена сортировка ключей в комбобоксах
+ добавлена поддержка тегов (perc)(bid|ask|price)chg (ApiVer = 2)
+ добавлены таймауты запросов котировок (#54)
- исправлен баг с неправильным парсингом html
* ExtQuotes теперь использует JSON вместо XML (ApiVer = 2)
* более красивый UI настроек
* некоторый рефакторинг
Вер.2.2.2:
+ добавлена поддержка котировок (#46)
+ добавлена поддержка свойств height и width (#47)
+ добавлена поддержка перевода в плагины (#50)
+ добавлено кеширование ключей
+ добавлена поддержка X-AW-Number в ExtScript, ExtUpgrade (ApiVer=2)
+ добавлено переподключение DataEngine (в некоторых случаях отдельные значения не обновляются)
+ добавлено обновление ширины и высоты виджета
- исправлен баг при обновлении Ext* (#49)
- исправлен баг с сохранением настроек GPUDEV, HDDDEV из графического интерфейса
- исправлены настройки Desktop Panel
- исправлен баг с добавлением настроек параграфа
* дропнута поддержка KDE4 версии (отдельная ветка разработки)
* увеличены лимиты для интервалов (#48)
* hddtemp был заменен на smartctl по умолчанию
* плагины были перемещены из private
* более корректное рисование интерфейса
Вер.2.2.1:
+ добавлен ключ X-AW-Interval в ExtUpgrade (ApiVer = 1, default = 3600)
+ добавлено кеширование значений в ExtScript и ExtUpgrade
+ добавлена поддержка isActive в ExtUpgrade
* изменена проверка версий cmake
* улучшена логика работы ExtScript и ExtUpgrade
Вер.2.2.0:
* портирование на Plasma 5
+ добавлена поддержка списка окон в тултипе
+ добавлены уведомления на системные события
+ добавлена возможность показать выбранный тег
+ добавлены теги $downN, $upN
+ добавлен инструмент netdev
+ добавлена поддержка smartctl
- убрана возможность сокрытия панелей
* незначительно изменена логика работы виджета
* исправлена отрисовка превью окон
* обновление кодовой базы KDE4 под новый ABI
* оптимизация работы DataEngine
* PKGCMD были заменены на ExtUpgrade
Вер.2.1.0:
+ добавлена функция автообновления
+ добавлена поддерка кастомных скриптов
+ добавлена поддержка превью рабочего стола для DP
+ добавлена поддержка баров
- удалена поддержка кастомных команд
- фикс #34
* исправлены уведомления
* переписан UI в соответствии со стандартами KDE
* исправлены границы для графических объектов
* переписан DP и DE на использование библиотечных функций
* изменено определение свойств GPU
* изменен поиск регулярных выражений
Вер.2.0.5:
+ добавлен нижний край к тултипу (#30)
* исправлен баг с обновлением сетевого интерфейса
@ -56,7 +134,7 @@
+ добавлено поле текущий рабочий стол (теги $name, $number, $total)
+ добавлена возможность взаимодействия с плеерами через mpris
* добавлено использование сабмодулей
* dataengine переписан с использованием tasks
* DataEngine переписан с использованием tasks
* фикс чтения температуры nvidia
Вер.1.10.2:
@ -85,7 +163,7 @@
- удален util.py
- удалены функции createNotifyrc, поскольку они больше не нужны
* рефакторинг конфигурационного интерфейса
* настройки плеера были перенесены из виджета в dataengine
* настройки плеера были перенесены из виджета в DataEngine
* исправлен вызов readme под четырехсимвольное обозначение
* перенос readme с md на html

272
README.md
View File

@ -4,247 +4,22 @@ awesome-widgets (ex-pytextmonitor)
Information
-----------
A collection of minimalistic widgets which looks like Awesome WM widgets.
A collection of minimalistic widgets which looks like Awesome Window Manager widgets.
**NOTE** [LOOKING FOR TRANSLATORS!](https://github.com/arcan1s/awesome-widgets/issues/14)
Configuration
-------------
Features
========
For edited output you must open Settings window and setup output format in lines:
* easy and fully configurable native Plasma widget which may be used as Conky widget or as Awesome-like information panel
* panel which shows active desktop status
* clear Conky-like configuration with html tags support
* custom command support (it may be simple action as well as special custom tag)
* graphical item support - tooltips, bars
* tag `$time` - time in default format. For example, *fri Nov 6 04:48:01 2013*
* tag `$isotime` - time in iso format
* tag `$shorttime` - time in short locale format
* tag `$longtime` - time in long locale format
* tag `$ctime` - custom time format
* tag `$uptime` - uptime, *---d--h--m*
* tag `$cuptime` - custom uptime format
* tag `$cpu` - total load cpu, *%*
* tag `$cpuN` - load CPU for core N, *%*
* tag `$cpucl` - average cpu clock, *MHz*
* tag `$cpuclN` - cpu clock for core N, *MHz*
* tag `$tempN` - temperature for device N. For example, `$temp0`
* tag `$fanN` - fan speed for device N. For example, `$fan0`
* tag `$gpu` - GPU usage, *%*. `aticonfig` or `nvidia-smi` must be installed
* tag `$gputemp` - GPU temperature. `aticonfig` or `nvidia-smi` must be installed
* tag `$mem` - usage memory, *%*
* tag `$memmb` - usage memory, *MB*
* tag `$memgb` - usage memory, *GB*
* tag `$memfreemb` - free RAM, *MB*
* tag `$memfreegb` - free RAM, *GB*
* tag `$memtotmb` - total RAM, *MB*
* tag `$memtotgb` - total RAM, *GB*
* tag `$memusedmb` - used and cached RAM, *MB*
* tag `$memusedgb` - used and cached RAM, *GB*
* tag `$swap` - swap, *%*
* tag `$swapmb` - swap, *MB*
* tag `$swapgb` - swap, *GB*
* tag `$swapfreemb` - free swap, *MB*
* tag `$swapfreegb` - free swap, *GB*
* tag `$swaptotmb` - total swap, *MB*
* tag `$swaptotgb` - total swap, *GB*
* tag `$hddN` - usage for mount point N, *%*. For example, `$hdd0`
* tag `$hddmbN` - usage for mount point N, *MB*. For example, `$hddmb0`
* tag `$hddgbN` - usage for mount point N, *GB*. For example, `$hddgb0`
* tag `$hddfreembN` - free space for mount point N, *MB*. For example, `$hddfreemb0`
* tag `$hddfreegbN` - free space for mount point N, *GB*. For example, `$hddfreegb0`
* tag `$hddtotmbN` - total size of mount point N, *MB*. For example, `$hddtotmb0`
* tag `$hddtotgbN` - total size of mount point N, *GB*. For example, `$hddtotgb0`
* tag `$hddrN` - read speed of disk N, *KB/s*. For example, `$hddr0`
* tag `$hddwN` - write speed of disk N, *KB/s*. For example, `$hddw0`
* tag `$hddtempN` - temperature for HDD N. For example, `$hddtemp0`
* tag `$down` - download speed, *KB/s*
* tag `$up` - upload speed, *KB/s*
* tag `$netdev` - current network device
* tag `$bat` - average battery charge, *%*
* tag `$batN` - battery N charge, *%*
* tag `$ac` - status AC device. Return (\*) if AC device is online or *( )* if offline
* tag `$album` - current song album. One of supported music players must be installed
* tag `$artist` - current song artist. One of supported music players must be installed
* tag `$duration` - current song duration. One of supported music players must be installed
* tag `$progress` - current song progress. One of supported music players must be installed
* tag `$title` - current song title. One of supported music players must be installed
* tag `$pscount` - number of running processes
* tag `$pstotal` - total number of processes
* tag `$ps` - list of running processes
* tag `$pkgcountN` - number of packages, which available to upgrade for command N. For example, `$pkgcount0`
* tag `$customN` - returns output for custom command N. For example, `$custom0`
* tag `$desktop` - name of the current desktop
* tag `$ndesktop` - number of the current desktop
* tag `$tdesktops` - total number of desktops
See [links](#Links) for more details.
Tips & tricks
-------------
You may use different colors for labels. Just put label text into html code. See [issue](https://github.com/arcan1s/awesome-widgets/issues/9) for more details.
Numbering of elements of temperature, HDD usage, HDD speed, HDD temperature refers to elements order from second tab (*Advanced settings*). You should add item to the required listWidget first. And the first element in the listWidget will be `$tag0`. See [issue](https://github.com/arcan1s/awesome-widgets/issues/17) for more details.
Advanced settings
-----------------
**Enable background**
Uncheck to disable default background and set transparent one.
**Enable popup**
Uncheck box if you do not use popup messages.
**Custom time**
* tag `$dddd` - weekday in long format
* tag `$ddd` - weekday in short format
* tag `$dd` - day
* tag `$d` - day without zero
* tag `$MMMM` - month in long format
* tag `$MMM` - month in short format
* tag `$MM` - month
* tag `$M` - month without zero
* tag `$yyyy` - year
* tag `$yy` - year in short format
* tag `$hh` - hours
* tag `$h` - hours without zero
* tag `$mm` - minutes
* tag `$m` - minutes without zero
* tag `$ss` - seconds
* tag `$s` - seconds without zero
**Custom uptime**
* tag `$dd` - uptime days
* tag `$d` - uptime days without zero
* tag `$hh` - uptime hours
* tag `$h` - uptime hours without zero
* tag `$mm` - uptime minutes
* tag `$m` - uptime minutes without zero
**Temperature units**
Select units for temperature. Available units are Celsius, Farenheit, Kelvin, Reaumur, cm^-1, kJ/mol, kcal/mol.
**Temperature devices**
List of devices, which will be observed in temp label (items come from `sensors`). List widget is editable,
**Mount points**
List of mount points, which will be observed in hdd label (items come from `mount`). List widget is editable.
**HDD (speed)**
List of hard disk devices, which will be observed in hddspeed label (items come from DataEngine). List widget is editable.
**HDD (temperature)**
List of hard disk devices, which will be observed in hddtemp label (items come from `find`). List widget is editable.
**Network device**
Use specified device as active. Will disable auto select network device.
**AC online tag**
Line which will be shown when AC is online.
**AC offline tag**
Line which will be shown when AC is offline.
Tooltip settings
----------------
Since version 1.7.0 CPU, CPU clock, memory, swap and network labels support graphical tooltip. To enable them just make the needed checkboxes a fully checked. The number of stored values can be set in the tab. Colors of graphs are configurable too.
DataEngine settings
-------------------
**ACPI path**
Path to APCI devices. Default is `/sys/class/power_supply/`.
**Custom command**
Commands, which will be run for custom label.
**Desktop cmd**
Type a command which will be run for desktop DataEngine. Default is `qdbus org.kde.kwin /KWin currentDesktop`.
**GPU device**
Select one of supported GPU devices. `auto` will enable auto selection, `disable` will disable definition of GPU states. Default is `auto`.
**HDD**
Select one of HDDs for HDD temperature monitor. `all` will enable monitor for all devices, `disable` will disable definition of HDD temperature. Default is `all`.
**hddtemp cmd**
Type a command which will be run for hddtemp DataEngine. Default is `sudo hddtemp`.
**MPD address**
Address of MPD server. Default is `localhost`.
**MPD port**
Port of MPD server. Default is `6600`.
**MPRIS player name**
MPRIS player name. The DBus interface of an music player should be enabled. Default is `auto`.
**Package manager**
List of commands, which will be run. Number of null lines is a number of unneeded lines. Defaults:
* *Arch*: `PKGCMD=pacman -Qu`, `PKGNULL=0`
* *Debian*: `PKGCMD=apt-show-versions -u -b`, `PKGNULL=0`
* *Ubuntu*: `PKGCMD=aptitude search '~U'`, `PKGNULL=0`
* *Fedora*: `PKGCMD=yum list updates`, `PKGNULL=3`
* *FreeBSD*: `PKGCMD=pkg_version -I -l '<'`, `PKGNULL=0`
* *Mandriva*: `PKGCMD=urpmq --auto-select`, `PKGNULL=0`
**Music player**
Select one of supported music playes for player label.
Desktop panel
=================
Since version 1.11.0 it provides a minimalistic panel for monitoring on desktops written on `C++`. And yes, it looks like the same panel in Awesome.
Desktop panel configuration
---------------------------
**Enable background**
Uncheck to disable default background and set transparent one.
**Vertical layout**
Use vertical layout instead of horizontal one.
**Add stretch**
Add stretch (spacer) to the selected side of the widget.
**Mark**
Type symbol (or string) which will be shown if this desktop is active now.
**Pattern tags**
* tag `$mark` - show mark if this desktop is active
* tag `$name` - name of the current desktop
* tag `$number` - number of the current desktop
* tag `$total` - total number of desktops
**Command**
Type command which will be run on left click on the selected desktop. Available variables are same as for pattern. Default is `dbus org.kde.kwin /KWin setCurrentDesktop $number`.
**Didn't find required feature?** [Just ask for it!](https://github.com/arcan1s/awesome-widgets/issues)
Instruction
===========
@ -252,23 +27,21 @@ Instruction
Dependencies
------------
* kdebase-workspace
* kdebindings-python2
* lm_sensors (*for definition temperature device*)
* plasma-framework
Optional dependencies
---------------------
* sysstat (*for notification*)
* proprietary video driver
* hddtemp (make sure that it may be run with `sudo` without password. Just add following line to `/etc/sudoers`: `$USERNAME ALL=NOPASSWD: /usr/bin/hddtemp`)
* music player (amarok, clementine, mpd or qmmp)
* hddtemp
* smartmontools
* music player (mpd or supported MPRIS)
Make dependencies
-----------------
* automoc4
* cmake
* extra-cmake-modules
Installation
------------
@ -277,15 +50,11 @@ Installation
* install
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`kde4-config --localprefix` ../
make && make install
Also you may install it to `/`:
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` ../
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ../
make && sudo make install
**NOTE** on Plasma 5 it may require `-DKDE_INSTALL_USE_QT_SYS_PATHS=ON` flag
Additional information
======================
@ -298,6 +67,9 @@ Links
-----
* [Homepage](http://arcanis.name/projects/awesome-widgets/)
* [Migration to 2.*](http://arcanis.name/en/2014/09/04/migration-to-v2/)
* [Scripts and bars](http://arcanis.name/en/2014/12/19/aw-v21-bells-and-whistles/)
* Plasmoid on [kde-look](http://kde-look.org/content/show.php/Awesome+Widgets?content=157124)
* DataEngine on [kde-look](http://kde-look.org/content/show.php/Extended+Systemmonitor+DataEngine?content=158773)
* Archlinux [AUR](https://aur.archlinux.org/packages/kdeplasma-applets-awesome-widgets/) package
* Archlinux [AUR](https://aur.archlinux.org/packages/plasma5-applet-awesome-widgets/) package
* [OpenSuse](http://software.opensuse.org/search?q=awesome-widgets) packages, [KF5 OpenSuse](http://software.opensuse.org/package/plasma5-awesome-widgets) package

View File

@ -1,26 +1,24 @@
# Maintainer: Evgeniy Alekseev <arcanis at archlinux dot org>
pkgname=kdeplasma-applets-awesome-widgets
pkgname=plasma5-applet-awesome-widgets
_pkgname=awesome-widgets
pkgver=2.0.5
pkgver=2.3.2
pkgrel=1
pkgdesc="Collection of minimalistic Plasmoids which look like Awesome WM widgets (ex-PyTextMonitor)"
arch=('i686' 'x86_64')
url="http://arcanis.name/projects/awesome-widgets"
license=('GPL3')
depends=('kdebase-workspace' 'lm_sensors')
optdepends=("amarok: for music player monitor"
"clementine: for music player monitor"
"catalyst: for GPU monitor"
depends=('plasma-framework')
optdepends=("catalyst: for GPU monitor"
"hddtemp: for HDD temperature monitor"
"smartmontools: for HDD temperature monitor"
"mpd: for music player monitor"
"nvidia-utils: for GPU monitor"
"qmmp: for music player monitor")
makedepends=('automoc4' 'cmake')
"nvidia-utils: for GPU monitor")
makedepends=('cmake' 'extra-cmake-modules')
source=(https://github.com/arcan1s/awesome-widgets/releases/download/V.${pkgver}/${_pkgname}-${pkgver}-src.tar.xz)
install=${pkgname}.install
md5sums=('a86de1841491ea1fc1d8021c5b3d9d43')
backup=('usr/share/config/extsysmon.conf')
md5sums=('8902769bcfd223c8c28fa6a9cf492b41')
backup=('etc/xdg/plasma-dataengine-extsysmon.conf')
prepare() {
rm -rf "${srcdir}/build"
@ -29,8 +27,9 @@ prepare() {
build () {
cd "${srcdir}/build"
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$(kde4-config --prefix) \
cmake -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
"../${_pkgname}"
make
}

54
arch/PKGBUILD-git Normal file
View File

@ -0,0 +1,54 @@
# Maintainer: Evgeniy Alekseev <arcanis at archlinux dot org>
pkgname=plasma5-applet-awesome-widgets
_pkgname=awesome-widgets
pkgver=2.2.1.r15.g78931b3
pkgrel=1
pkgdesc="Collection of minimalistic Plasmoids which look like Awesome WM widgets (ex-PyTextMonitor). Git version"
arch=('i686' 'x86_64')
url="http://arcanis.name/projects/awesome-widgets"
license=('GPL3')
depends=('plasma-framework')
optdepends=("amarok: for music player monitor"
"clementine: for music player monitor"
"catalyst: for GPU monitor"
"hddtemp: for HDD temperature monitor"
"smartmontools: for HDD temperature monitor"
"mpd: for music player monitor"
"nvidia-utils: for GPU monitor"
"qmmp: for music player monitor")
makedepends=('cmake' 'extra-cmake-modules')
source=(${_pkgname}::git+https://github.com/arcan1s/awesome-widgets/)
install=${pkgname}.install
md5sums=('SKIP')
backup=('etc/xdg/plasma-dataengine-extsysmon.conf')
pkgver() {
cd "${srcdir}/${_pkgname}"
git describe --tags --long | sed 's/V\.//' | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
rm -rf "${srcdir}/${_pkgname}/build"
mkdir "${srcdir}/${_pkgname}/build"
# update submobules
cd "${srcdir}/${_pkgname}"
git submodule init
git submodule update --recursive
echo "$pkgver"
}
build () {
cd "${srcdir}/${_pkgname}/build"
cmake -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
"../sources"
make
}
package() {
cd "${srcdir}/${_pkgname}/build"
make DESTDIR="${pkgdir}" install
}

View File

@ -1,5 +1,5 @@
post_install() {
kbuildsycoca4 > /dev/null 2>&1
kbuildsycoca5 > /dev/null 2>&1
}
post_upgrade() {

View File

@ -6,8 +6,11 @@ MINOR=$(grep -m1 PROJECT_VERSION_MINOR sources/CMakeLists.txt | awk '{print $3}'
PATCH=$(grep -m1 PROJECT_VERSION_PATCH sources/CMakeLists.txt | awk '{print $3}' | sed 's/.$//g')
VERSION="${MAJOR}.${MINOR}.${PATCH}"
# update submodules
git submodule update --init --recursive
# build dataengine
ARCHIVE="ext-sysmon"
ARCHIVE="extsysmon"
# create archive
[[ -e ${ARCHIVE}-${VERSION}-src.tar.xz ]] && rm -f ${ARCHIVE}-${VERSION}-src.tar.xz
[[ -d ${ARCHIVE} ]] && rm -rf "${ARCHIVE}"
@ -18,7 +21,7 @@ rm -rf "${ARCHIVE}"
# build widget
ARCHIVE="awesome-widgets"
FILES="AUTHORS CHANGELOG CHANGELOG-RU COPYING"
IGNORELIST="build usr"
IGNORELIST="build usr .kdev4 *.kdev4"
# create archive
[[ -e ${ARCHIVE}-${VERSION}-src.tar.xz ]] && rm -f "${ARCHIVE}-${VERSION}-src.tar.xz"
[[ -d ${ARCHIVE} ]] && rm -rf "${ARCHIVE}"
@ -26,9 +29,13 @@ cp -r "${SRCDIR}" "${ARCHIVE}"
for FILE in ${FILES[*]}; do cp -r "$FILE" "${ARCHIVE}"; done
for FILE in ${IGNORELIST[*]}; do rm -rf "${ARCHIVE}/${FILE}"; done
tar cJf "${ARCHIVE}-${VERSION}-src.tar.xz" "${ARCHIVE}"
ln -sf "../${ARCHIVE}-${VERSION}-src.tar.xz" arch
rm -rf "${ARCHIVE}"
# update md5sum
MD5SUMS=$(md5sum ${ARCHIVE}-${VERSION}-src.tar.xz | awk '{print $1}')
sed -i "/md5sums=('[0-9A-Fa-f]*/s/[^'][^)]*/md5sums=('${MD5SUMS}'/" PKGBUILD
sed -i "s/pkgver=[0-9.]*/pkgver=${VERSION}/" PKGBUILD
sed -i "/md5sums=('[0-9A-Fa-f]*/s/[^'][^)]*/md5sums=('${MD5SUMS}'/" arch/PKGBUILD
sed -i "s/pkgver=[0-9.]*/pkgver=${VERSION}/" arch/PKGBUILD
# clear
find . -type f -name '*src.tar.xz' -not -name "*${VERSION}-src.tar.xz" -exec rm -rf {} \;
find arch -type l -xtype l -exec rm -rf {} \;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 53 KiB

BIN
screenshots/config_06.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@ -0,0 +1,23 @@
[Buildset]
BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x1e\x00a\x00w\x00e\x00s\x00o\x00m\x00e\x00-\x00w\x00i\x00d\x00g\x00e\x00t\x00s)
[CMake]
Build Directory Count=1
Current Build Directory Index=0
ProjectRootRelative=./
[CMake][CMake Build Directory 0]
Build Directory Path=file:///home/arcanis/Documents/github/awesome-widgets/build
Build Type=Release
CMake Binary=file:///usr/bin/cmake
Environment Profile=
Extra Arguments=
Install Directory=file:///usr
[Defines And Includes][Compiler]
Name=GCC
Path=gcc
Type=GCC
[Project]
VersionControlSupport=kdevgit

View File

@ -0,0 +1,23 @@
[Buildset]
BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x1e\x00a\x00w\x00e\x00s\x00o\x00m\x00e\x00-\x00w\x00i\x00d\x00g\x00e\x00t\x00s)
[CMake]
Build Directory Count=1
Current Build Directory Index=0
ProjectRootRelative=./
[CMake][CMake Build Directory 0]
Build Directory Path=file:///home/arcanis/Documents/github/awesome-widgets/build
Build Type=Release
CMake Binary=file:///usr/bin/cmake
Environment Profile=
Extra Arguments=
Install Directory=file:///usr
[Defines And Includes][Compiler]
Name=GCC
Path=gcc
Type=GCC
[Project]
VersionControlSupport=kdevgit

218
sources/3rdparty/about/about.ui vendored Normal file
View File

@ -0,0 +1,218 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>About</class>
<widget class="QWidget" name="About">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>450</width>
<height>359</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab_About">
<attribute name="title">
<string>About</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QScrollArea" name="scrollArea_about">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_about">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>418</width>
<height>284</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_name">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_version">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_description">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignJustify|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_links">
<property name="text">
<string/>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item>
<spacer name="spacer_about">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_ackn">
<attribute name="title">
<string>Acknowledgement</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QScrollArea" name="scrollArea_ackn">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_ackn">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>418</width>
<height>284</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QLabel" name="label_translators">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_trdparty">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item>
<spacer name="spacer_ackn">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>229</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QLabel" name="label_license">
<property name="text">
<string/>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,28 +1,46 @@
cmake_minimum_required (VERSION 2.8)
cmake_minimum_required (VERSION 2.8.12)
cmake_policy (SET CMP0003 OLD)
cmake_policy (SET CMP0002 OLD)
cmake_policy (SET CMP0011 NEW)
cmake_policy (SET CMP0015 NEW)
project (awesome-widgets)
project (awesomewidgets)
set (PROJECT_AUTHOR "Evgeniy Alekseev")
set (PROJECT_CONTACT "esalexeev@gmail.com")
set (PROJECT_LICENSE "GPLv3")
set (PROJECT_VERSION_MAJOR 2)
set (PROJECT_VERSION_MINOR 0)
set (PROJECT_VERSION_PATCH 5)
set (PROJECT_VERSION_MINOR 3)
set (PROJECT_VERSION_PATCH 2)
set (PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
set (PROJECT_TRDPARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty)
string (TIMESTAMP CURRENT_DATE "%Y-%m-%d %H:%M" UTC)
string (TIMESTAMP CURRENT_YEAR "%Y")
message (STATUS "Project: ${PROJECT_NAME}")
message (STATUS "Version: ${PROJECT_VERSION}")
message (STATUS "Build date: ${CURRENT_DATE}")
# flags
if (CMAKE_COMPILER_IS_GNUCXX)
set (CMAKE_CXX_FLAGS "-Wall -Wno-cpp -std=c++11")
set (CMAKE_CXX_FLAGS_DEBUG "-g -O0")
set (CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
set (CMAKE_CXX_FLAGS "-Wall -Wno-cpp -std=c++11")
set (CMAKE_CXX_FLAGS_DEBUG "-g -O0")
set (CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
# avoid newer gcc warnings
add_definitions (-D_DEFAULT_SOURCE)
else ()
message (STATUS "Unknown compiler")
message (STATUS "Unknown compiler")
endif ()
if (CMAKE_BUILD_TYPE MATCHES Debug)
set (CMAKE_VERBOSE_MAKEFILE ON)
endif ()
configure_file (${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
set (PROJECT_TRDPARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty)
add_subdirectory (extsysmon)
add_subdirectory (awesome-widget)
add_subdirectory (ext-sysmon)
add_subdirectory (desktop-panel)
# translations
add_subdirectory (translations)

View File

@ -1,41 +1,19 @@
# set project name
set (SUBPROJECT plasma_applet_awesome-widget)
set (PLUGIN_NAME ${SUBPROJECT})
message (STATUS "Subproject ${SUBPROJECT}")
# find required libaries
find_package (KDE4 REQUIRED)
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
add_subdirectory (po)
include (KDE4Defaults)
include_directories (${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${KDE4_INCLUDES}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../
${PROJECT_TRDPARTY_DIR})
# set sources
file (GLOB SUBPROJECT_DESKTOP_IN *.desktop)
file (RELATIVE_PATH SUBPROJECT_DESKTOP ${CMAKE_SOURCE_DIR} ${SUBPROJECT_DESKTOP_IN})
file (GLOB_RECURSE SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp
${PROJECT_TRDPARTY_DIR}/fontdialog/*.cpp)
set (TASK_HEADER ${PROJECT_TRDPARTY_DIR}/task/task.h)
file (GLOB SUBPROJECT_UI *.ui)
file (GLOB SUBPROJECT_NOTIFY *.notifyrc)
# prepare
configure_file (${SUBPROJECT_DESKTOP_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP})
configure_file (metadata.desktop ${CMAKE_CURRENT_SOURCE_DIR}/package/metadata.desktop)
# make
qt4_wrap_cpp (TASK_MOC_SOURCE ${TASK_HEADER})
kde4_add_ui_files (SUBPROJECT_SOURCE ${SUBPROJECT_UI})
kde4_add_plugin (${PLUGIN_NAME} ${SUBPROJECT_SOURCE} ${TASK_MOC_SOURCE})
target_link_libraries (${PLUGIN_NAME} ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS})
find_package (ECM 0.0.12 REQUIRED NO_MODULE)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
# install
install (TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGIN_INSTALL_DIR})
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP} DESTINATION ${SERVICES_INSTALL_DIR})
install (FILES ${SUBPROJECT_NOTIFY} DESTINATION ${DATA_INSTALL_DIR}/${PLUGIN_NAME})
find_package (Qt5 REQUIRED COMPONENTS Core Network Qml)
find_package (KF5 REQUIRED COMPONENTS I18n Notifications Plasma)
include (KDEInstallDirs)
include (KDECMakeSettings)
include (KDECompilerSettings)
add_subdirectory (plugin)
plasma_install_package (package org.kde.plasma.awesomewidget)

View File

@ -1,447 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AdvancedWindow</class>
<widget class="QWidget" name="AdvancedWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>594</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>700</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="windowTitle">
<string notr="true">Advanced</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollArea_advanced">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="contents_advanced">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>677</width>
<height>677</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QCheckBox" name="checkBox_background">
<property name="text">
<string>Enable background</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_popup">
<property name="text">
<string>Enable popup on mouse click</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="layout_timeFormat">
<item>
<widget class="QLabel" name="label_timeFormat">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Custom time format</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_timeFormat">
<property name="toolTip">
<string>$dddd - long weekday
$ddd - short weekday
$dd - day
$d - day w\o zero
$MMMM - long month
$MMM - short month
$MM - month
$M - month w\o zero
$yyyy - year
$yy - short year
$hh - hours (24 only)
$h - hours w\o zero (24 only)
$mm - minutes
$m - minutes w\o zero
$ss - seconds
$s - seconds w\o zero</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_uptimeFormat">
<item>
<widget class="QLabel" name="label_uptimeFormat">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Custom uptime format</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_uptimeFormat">
<property name="toolTip">
<string>$dd - uptime days
$d - uptime days without zero
$hh - uptime hours
$h - uptime hours without zero
$mm - uptime minutes
$m - uptime minutes without zero</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_tempUnits">
<item>
<widget class="QLabel" name="label_tempUnits">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Temperature units</string>
</property>
</widget>
</item>
<item>
<spacer name="spacer_tempUnits">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QComboBox" name="comboBox_tempUnits">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<item>
<property name="text">
<string notr="true">Celsius</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">Fahrenheit</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">Kelvin</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">Reaumur</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">cm^-1</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">kJ/mol</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">kcal/mol</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="layout_tempDevice">
<item>
<widget class="QLabel" name="label_tempDevice">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Temperature devices</string>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget_tempDevice">
<property name="toolTip">
<string>Editable</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="layout_fanDevice">
<item>
<widget class="QLabel" name="label_fanDevice">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Fan devices</string>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget_fanDevice">
<property name="toolTip">
<string>Editable</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="layout_mount">
<item>
<widget class="QLabel" name="label_mount">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Mount points</string>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget_mount">
<property name="toolTip">
<string>Editable</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="layout_hddSpeedDevice">
<item>
<widget class="QLabel" name="label_hddSpeedDevice">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>HDD devices (speed)</string>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget_hddSpeedDevice">
<property name="toolTip">
<string>Editable</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="layout_hddDevice">
<item>
<widget class="QLabel" name="label_hddDevice">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>HDD devices (temp)</string>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget_hddDevice">
<property name="toolTip">
<string>Editable</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_netdev">
<item>
<widget class="QCheckBox" name="checkBox_netdev">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Disable auto select device and set specified device</string>
</property>
<property name="text">
<string>Set network device</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_netdev">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_acOnline">
<item>
<widget class="QLabel" name="label_acOnline">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>AC online tag</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_acOnline">
<property name="toolTip">
<string>Line, which returns when AC is online</string>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_acOffline">
<item>
<widget class="QLabel" name="label_acOffline">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>AC offline tag</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_acOffline">
<property name="toolTip">
<string>Line, which returns when AC is offline</string>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="spacer_advanced">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,373 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AppearanceWindow</class>
<widget class="QWidget" name="AppearanceWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>594</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>700</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="windowTitle">
<string notr="true">Appearance</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollArea_appearance">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="contents_appearance">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>684</width>
<height>578</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
<layout class="QHBoxLayout" name="layout_interval">
<item>
<widget class="QLabel" name="label_interval">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Time interval</string>
</property>
</widget>
</item>
<item>
<spacer name="spacer_interval">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBox_interval">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>10000</number>
</property>
<property name="singleStep">
<number>500</number>
</property>
<property name="value">
<number>2000</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_font">
<item>
<widget class="QLabel" name="label_font">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Font</string>
</property>
</widget>
</item>
<item>
<spacer name="spacer_font">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QFontComboBox" name="fontComboBox">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_size">
<item>
<widget class="QLabel" name="label_size">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Font size</string>
</property>
</widget>
</item>
<item>
<spacer name="spacer_size">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBox_size">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>99</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="value">
<number>12</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_color">
<item>
<widget class="QLabel" name="label_color">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Font color</string>
</property>
</widget>
</item>
<item>
<spacer name="spacer_color">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="KColorCombo" name="kcolorcombo">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_style">
<item>
<widget class="QLabel" name="label_style">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Font style</string>
</property>
</widget>
</item>
<item>
<spacer name="spacer_style">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QComboBox" name="comboBox_style">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<item>
<property name="text">
<string notr="true">normal</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">italic</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_weight">
<item>
<widget class="QLabel" name="label_weight">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Font weight</string>
</property>
</widget>
</item>
<item>
<spacer name="spacer_weight">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>19</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBox_weight">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>100</number>
</property>
<property name="maximum">
<number>900</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>400</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="spacer_text">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KColorCombo</class>
<extends>QComboBox</extends>
<header>kcolorcombo.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -1,373 +0,0 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "awesome-widget.h"
#include <KStandardDirs>
#include <Plasma/ToolTipManager>
#include <QDesktopServices>
#include <QDir>
#include <QGraphicsGridLayout>
#include <QGraphicsProxyWidget>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QNetworkInterface>
#include <QProcessEnvironment>
#include <QTextCodec>
#include <QTimer>
#include "customlabel.h"
#include <pdebug/pdebug.h>
#include <task/taskadds.h>
AwesomeWidget::AwesomeWidget(QObject *parent, const QVariantList &args)
: Plasma::Applet(parent, args)
{
// debug
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
if (debugEnv == QString("yes"))
debug = true;
else
debug = false;
setBackgroundHints(DefaultBackground);
setAspectRatioMode(Plasma::IgnoreAspectRatio);
setHasConfigurationInterface(true);
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
// text format init
formatLine.append(QString(""));
formatLine.append(QString(""));
}
AwesomeWidget::~AwesomeWidget()
{
if (debug) qDebug() << PDEBUG;
}
QList<QAction *> AwesomeWidget::contextualActions()
{
if (debug) qDebug() << PDEBUG;
return contextMenu;
}
void AwesomeWidget::createActions()
{
if (debug) qDebug() << PDEBUG;
contextMenu.clear();
contextMenu.append(new QAction(QIcon::fromTheme(QString("utilities-system-monitor")),
i18n("Run ksysguard"), this));
connect(contextMenu[0], SIGNAL(triggered(bool)), this, SLOT(showKsysguard()));
contextMenu.append(new QAction(QIcon::fromTheme(QString("text-x-readme")),
i18n("Show README"), this));
connect(contextMenu[1], SIGNAL(triggered(bool)), this, SLOT(showReadme()));
contextMenu.append(new QAction(QIcon::fromTheme(QString("stock-refresh")),
i18n("Update text"), this));
connect(contextMenu[2], SIGNAL(triggered(bool)), this, SLOT(updateNetworkDevice()));
connect(contextMenu[2], SIGNAL(triggered(bool)), extsysmonEngine, SLOT(updateAllSources()));
connect(contextMenu[2], SIGNAL(triggered(bool)), sysmonEngine, SLOT(updateAllSources()));
}
QString AwesomeWidget::getNetworkDevice()
{
if (debug) qDebug() << PDEBUG;
QString device = QString("lo");
if (configuration[QString("useCustomNetdev")].toInt() == 2)
device = configuration[QString("customNetdev")];
else {
QList<QNetworkInterface> rawInterfaceList = QNetworkInterface::allInterfaces();
for (int i=0; i<rawInterfaceList.count(); i++)
if ((rawInterfaceList[i].flags().testFlag(QNetworkInterface::IsUp)) &&
(!rawInterfaceList[i].flags().testFlag(QNetworkInterface::IsLoopBack)) &&
(!rawInterfaceList[i].flags().testFlag(QNetworkInterface::IsPointToPoint)))
device = rawInterfaceList[i].name();
}
return device;
}
int AwesomeWidget::getNumberCpus()
{
if (debug) qDebug() << PDEBUG;
QString cmd = QString("grep -c ^processor /proc/cpuinfo");
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
TaskResult process = runTask(cmd);
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
if (process.exitCode != 0)
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
return QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed().toInt();
}
float AwesomeWidget::getTemp(const float temp)
{
if (debug) qDebug() << PDEBUG;
float convertedTemp = temp;
if (configuration[QString("tempUnits")] == QString("Celsius"))
;
else if (configuration[QString("tempUnits")] == QString("Fahrenheit"))
convertedTemp = temp * 9.0 / 5.0 + 32.0;
else if (configuration[QString("tempUnits")] == QString("Kelvin"))
convertedTemp = temp + 273.15;
else if (configuration[QString("tempUnits")] == QString("Reaumur"))
convertedTemp = temp * 0.8;
else if (configuration[QString("tempUnits")] == QString("cm^-1"))
convertedTemp = (temp + 273.15) * 0.695;
else if (configuration[QString("tempUnits")] == QString("kJ/mol"))
convertedTemp = (temp + 273.15) * 8.31;
else if (configuration[QString("tempUnits")] == QString("kcal/mol"))
convertedTemp = (temp + 273.15) * 1.98;
return convertedTemp;
}
QStringList AwesomeWidget::getTimeKeys()
{
if (debug) qDebug() << PDEBUG;
QStringList timeKeys;
timeKeys.append(QString("dddd"));
timeKeys.append(QString("ddd"));
timeKeys.append(QString("dd"));
timeKeys.append(QString("d"));
timeKeys.append(QString("MMMM"));
timeKeys.append(QString("MMM"));
timeKeys.append(QString("MM"));
timeKeys.append(QString("M"));
timeKeys.append(QString("yyyy"));
timeKeys.append(QString("yy"));
timeKeys.append(QString("hh"));
timeKeys.append(QString("h"));
timeKeys.append(QString("mm"));
timeKeys.append(QString("m"));
timeKeys.append(QString("ss"));
timeKeys.append(QString("s"));
return timeKeys;
}
void AwesomeWidget::init()
{
if (debug) qDebug() << PDEBUG;
// dataengines
extsysmonEngine = dataEngine(QString("ext-sysmon"));
sysmonEngine = dataEngine(QString("systemmonitor"));
connect(sysmonEngine, SIGNAL(sourceAdded(QString)), this, SLOT(addDiskDevice(QString)));
timeEngine = dataEngine(QString("time"));
// tooltip
toolTip = Plasma::ToolTipContent();
toolTip.setMainText(QString("Awesome Widget"));
toolTip.setSubText(QString(""));
toolTipScene = new QGraphicsScene();
toolTipView = new QGraphicsView(toolTipScene);
toolTipView->setStyleSheet(QString("background: transparent"));
toolTipView->setContentsMargins(0, 0, 0, 0);
toolTipView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
toolTipView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
Plasma::ToolTipManager::self()->setContent(this, toolTip);
// body
createActions();
mainLayout = new QGraphicsGridLayout();
mainLayout->setContentsMargins(1, 1, 1, 1);
setLayout(mainLayout);
textLabel = new CustomLabel(this, debug);
QGraphicsProxyWidget *pw = new QGraphicsProxyWidget(this);
textLabel->setAttribute(Qt::WA_TranslucentBackground, true);
pw->setWidget(textLabel);
mainLayout->addItem(pw, 0, 0);
// read variables
configChanged();
timer = new QTimer(this);
timer->setSingleShot(false);
timer->setInterval(configuration[QString("interval")].toInt());
connect(timer, SIGNAL(timeout()), this, SLOT(updateText()));
connect(timer, SIGNAL(timeout()), this, SLOT(updateTooltip()));
timer->start();
}
void AwesomeWidget::addDiskDevice(const QString source)
{
if (debug) qDebug() << PDEBUG;
QRegExp diskRegexp = QRegExp(QString("disk/(?:md|sd|hd)[a-z|0-9]_.*/Rate/(?:rblk)"));
if (diskRegexp.indexIn(source) > -1) {
QStringList splitSource = source.split(QChar('/'));
QString device = splitSource[0] + QString("/") + splitSource[1];
diskDevices.append(device);
}
}
QStringList AwesomeWidget::findKeys()
{
if (debug) qDebug() << PDEBUG;
QStringList selectedKeys;
for (int i=0; i<keys.count(); i++)
if (configuration[QString("text")]
.indexOf(QString("$") + keys[i]) > -1) {
if (debug) qDebug() << PDEBUG << ":" << "Found key" << keys[i];
selectedKeys.append(keys[i]);
}
return selectedKeys;
}
QStringList AwesomeWidget::getKeys()
{
if (debug) qDebug() << PDEBUG;
QStringList allKeys;
// time
allKeys.append(QString("time"));
allKeys.append(QString("isotime"));
allKeys.append(QString("shorttime"));
allKeys.append(QString("longtime"));
allKeys.append(QString("ctime"));
// uptime
allKeys.append(QString("uptime"));
allKeys.append(QString("cuptime"));
// cpuclock
for (int i=counts[QString("cpu")]-1; i>=0; i--)
allKeys.append(QString("cpucl") + QString::number(i));
allKeys.append(QString("cpucl"));
// cpu
for (int i=counts[QString("cpu")]-1; i>=0; i--)
allKeys.append(QString("cpu") + QString::number(i));
allKeys.append(QString("cpu"));
// temperature
for (int i=counts[QString("temp")]-1; i>=0; i--)
allKeys.append(QString("temp") + QString::number(i));
for (int i=counts[QString("fan")]-1; i>=0; i--)
allKeys.append(QString("fan") + QString::number(i));
// gputemp
allKeys.append(QString("gputemp"));
// gpu
allKeys.append(QString("gpu"));
// memory
allKeys.append(QString("memmb"));
allKeys.append(QString("memgb"));
allKeys.append(QString("memfreemb"));
allKeys.append(QString("memfreegb"));
allKeys.append(QString("memtotmb"));
allKeys.append(QString("memtotgb"));
allKeys.append(QString("memusedmb"));
allKeys.append(QString("memusedgb"));
allKeys.append(QString("mem"));
// swap
allKeys.append(QString("swapmb"));
allKeys.append(QString("swapgb"));
allKeys.append(QString("swapfreemb"));
allKeys.append(QString("swapfreegb"));
allKeys.append(QString("swaptotmb"));
allKeys.append(QString("swaptotgb"));
allKeys.append(QString("swap"));
// hdd
for (int i=counts[QString("mount")]-1; i>=0; i--) {
allKeys.append(QString("hddmb") + QString::number(i));
allKeys.append(QString("hddgb") + QString::number(i));
allKeys.append(QString("hddfreemb") + QString::number(i));
allKeys.append(QString("hddfreegb") + QString::number(i));
allKeys.append(QString("hddtotmb") + QString::number(i));
allKeys.append(QString("hddtotgb") + QString::number(i));
allKeys.append(QString("hdd") + QString::number(i));
}
// hdd speed
for (int i=counts[QString("disk")]-1; i>=0; i--) {
allKeys.append(QString("hddr") + QString::number(i));
allKeys.append(QString("hddw") + QString::number(i));
}
// hdd temp
for (int i=counts[QString("hddtemp")]-1; i>=0; i--) {
allKeys.append(QString("hddtemp") + QString::number(i));
allKeys.append(QString("hddtemp") + QString::number(i));
}
// network
allKeys.append(QString("down"));
allKeys.append(QString("up"));
allKeys.append(QString("netdev"));
// battery
allKeys.append(QString("ac"));
for (int i=counts[QString("bat")]-1; i>=0; i--)
allKeys.append(QString("bat") + QString::number(i));
allKeys.append(QString("bat"));
// player
allKeys.append(QString("album"));
allKeys.append(QString("artist"));
allKeys.append(QString("duration"));
allKeys.append(QString("progress"));
allKeys.append(QString("title"));
// ps
allKeys.append(QString("pscount"));
allKeys.append(QString("pstotal"));
allKeys.append(QString("ps"));
// package manager
for (int i=counts[QString("pkg")]-1; i>=0; i--)
allKeys.append(QString("pkgcount") + QString::number(i));
// custom
for (int i=counts[QString("custom")]-1; i>=0; i--)
allKeys.append(QString("custom") + QString::number(i));
// desktop
allKeys.append(QString("desktop"));
allKeys.append(QString("ndesktop"));
allKeys.append(QString("tdesktops"));
return allKeys;
}
void AwesomeWidget::showKsysguard()
{
if (debug) qDebug() << PDEBUG;
QString cmd = QString("ksysguard");
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
TaskResult process = runTask(cmd);
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
if (process.exitCode != 0)
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
}
void AwesomeWidget::showReadme()
{
if (debug) qDebug() << PDEBUG;
QDesktopServices::openUrl(QString("http://arcanis.name/projects/awesome-widgets/"));
}
K_EXPORT_PLASMA_APPLET(awesome-widget, AwesomeWidget)

View File

@ -1,128 +0,0 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef AWESOME_WIDGET_H
#define AWESOME_WIDGET_H
#include <Plasma/Applet>
#include <Plasma/DataEngine>
#include <Plasma/ToolTipContent>
#include <ui_advanced.h>
#include <ui_appearance.h>
#include <ui_deconfig.h>
#include <ui_tooltipconfig.h>
#include <ui_widget.h>
class CustomLabel;
class QGraphicsGridLayout;
class QGraphicsScene;
class AwesomeWidget : public Plasma::Applet
{
Q_OBJECT
public:
AwesomeWidget(QObject *parent, const QVariantList &args);
~AwesomeWidget();
QString getNetworkDevice();
int getNumberCpus();
float getTemp(const float temp);
QStringList getTimeKeys();
void init();
// de configuration
QMap<QString, QString> readDataEngineConfiguration();
void writeDataEngineConfiguration(const QMap<QString, QString> settings);
QMap<QString, QString> updateDataEngineConfiguration(const QMap<QString, QString> rawConfig);
public slots:
// contextual actions
void showKsysguard();
void showReadme();
// dataengine
void addDiskDevice(const QString source);
void connectToEngine();
void dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data);
void disconnectFromEngine();
// configuration interface
void configAccepted();
void configChanged();
// update events
void sendNotification(const QString eventId, const QString message);
void updateNetworkDevice(const bool delay = true);
void updateText(const bool clear = false);
void updateTooltip();
private slots:
void reinit();
// configuration interface
void addNewCustomCommand(QTableWidgetItem *item);
void addNewPkgCommand(QTableWidgetItem *item);
void contextMenuCustomCommand(const QPoint pos);
void contextMenuPkgCommand(const QPoint pos);
void editFanItem(QListWidgetItem *item);
void editHddItem(QListWidgetItem *item);
void editHddSpeedItem(QListWidgetItem *item);
void editMountItem(QListWidgetItem *item);
void editTempItem(QListWidgetItem *item);
void setFontFormating();
void setFormating();
protected:
QList<QAction *> contextualActions();
void createConfigurationInterface(KConfigDialog *parent);
private:
// functions
void createActions();
QStringList findKeys();
QStringList getKeys();
// ui
QGraphicsGridLayout *mainLayout = nullptr;
CustomLabel *textLabel = nullptr;
QTimer *timer;
QList<QAction *> contextMenu;
// tooltip
Plasma::ToolTipContent toolTip;
QGraphicsScene *toolTipScene;
QGraphicsView *toolTipView;
// values
int networkDeviceUpdate;
QMap<QString, int> counts;
QMap<QString, QList<float>> tooltipValues;
QMap<QString, QString> values;
// debug
bool debug;
// data engine
Plasma::DataEngine *extsysmonEngine;
Plasma::DataEngine *sysmonEngine;
Plasma::DataEngine *timeEngine;
// configuration interface
Ui::AdvancedWindow uiAdvancedConfig;
Ui::AppearanceWindow uiAppConfig;
Ui::ConfigWindow uiWidConfig;
Ui::DEWindow uiDEConfig;
Ui::TooltipWindow uiTooltipConfig;
// configuration
QMap<QString, QString> configuration;
QStringList diskDevices, keys, formatLine, foundKeys;
};
#endif /* AWESOME_WIDGET_H */

View File

@ -1,808 +0,0 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "awesome-widget.h"
#include <KConfigDialog>
#include <KGlobal>
#include <KStandardDirs>
#include <QDir>
#include <QMenu>
#include <QNetworkInterface>
#include <QTextCodec>
#include <fontdialog/fontdialog.h>
#include <pdebug/pdebug.h>
#include <task/taskadds.h>
QMap<QString, QString> AwesomeWidget::readDataEngineConfiguration()
{
if (debug) qDebug() << PDEBUG;
QMap<QString, QString> rawConfig;
rawConfig[QString("ACPIPATH")] = QString("/sys/class/power_supply/");
rawConfig[QString("CUSTOM")] = QString("wget -qO- http://ifconfig.me/ip");
rawConfig[QString("DESKTOPCMD")] = QString("qdbus org.kde.kwin /KWin currentDesktop");
rawConfig[QString("GPUDEV")] = QString("auto");
rawConfig[QString("HDDDEV")] = QString("all");
rawConfig[QString("HDDTEMPCMD")] = QString("sudo hddtemp");
rawConfig[QString("MPDADDRESS")] = QString("localhost");
rawConfig[QString("MPDPORT")] = QString("6600");
rawConfig[QString("MPRIS")] = QString("auto");
rawConfig[QString("PKGCMD")] = QString("pacman -Qu");
rawConfig[QString("PKGNULL")] = QString("0");
rawConfig[QString("PLAYER")] = QString("mpris");
QString fileName = KGlobal::dirs()->findResource("config", "extsysmon.conf");
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << fileName;
QFile configFile(fileName);
if (!configFile.open(QIODevice::ReadOnly))
return updateDataEngineConfiguration(rawConfig);
QString fileStr;
QStringList value;
while (true) {
fileStr = QString(configFile.readLine()).trimmed();
if ((fileStr.isEmpty()) && (!configFile.atEnd())) continue;
if ((fileStr[0] == QChar('#')) && (!configFile.atEnd())) continue;
if ((fileStr[0] == QChar(';')) && (!configFile.atEnd())) continue;
if (fileStr.contains(QChar('='))) {
value.clear();
for (int i=1; i<fileStr.split(QChar('=')).count(); i++)
value.append(fileStr.split(QChar('='))[i]);
rawConfig[fileStr.split(QChar('='))[0]] = value.join(QChar('='));
}
if (configFile.atEnd()) break;
}
configFile.close();
return updateDataEngineConfiguration(rawConfig);
}
void AwesomeWidget::writeDataEngineConfiguration(const QMap<QString, QString> settings)
{
if (debug) qDebug() << PDEBUG;
QMap<QString, QString> config = updateDataEngineConfiguration(settings);
QString fileName = KGlobal::dirs()->locateLocal("config", "extsysmon.conf");
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << fileName;
QFile configFile(fileName);
if (!configFile.open(QIODevice::WriteOnly)) return;
for (int i=0; i<config.keys().count(); i++) {
QByteArray string = (config.keys()[i] + QString("=") + config[config.keys()[i]] + QString("\n")).toUtf8();
configFile.write(string);
}
configFile.close();
}
QMap<QString, QString> AwesomeWidget::updateDataEngineConfiguration(const QMap<QString, QString> rawConfig)
{
if (debug) qDebug() << PDEBUG;
QMap<QString, QString> config;
QString key, value;
// remove spaces and copy source map
for (int i=0; i<rawConfig.keys().count(); i++) {
key = rawConfig.keys()[i];
value = rawConfig[key];
key.remove(QChar(' '));
if ((key != QString("CUSTOM")) &&
(key != QString("DESKTOPCMD")) &&
(key != QString("HDDTEMPCMD")) &&
(key != QString("PKGCMD")))
value.remove(QChar(' '));
config[key] = value;
}
// pkgcmd
for (int i=config[QString("PKGNULL")].split(QString(","), QString::SkipEmptyParts).count();
i<config[QString("PKGCMD")].split(QString(","), QString::SkipEmptyParts).count()+1;
i++)
config[QString("PKGNULL")] += QString(",0");
for (int i=0; i<config.keys().count(); i++)
if (debug) qDebug() << PDEBUG << ":" << config.keys()[i] + QString("=") + config[config.keys()[i]];
return config;
}
void AwesomeWidget::createConfigurationInterface(KConfigDialog *parent)
{
if (debug) qDebug() << PDEBUG;
QString cmd, qoutput;
QStringList headerList;
TaskResult process;
QWidget *advWidget = new QWidget;
uiAdvancedConfig.setupUi(advWidget);
QWidget *appWidget = new QWidget;
uiAppConfig.setupUi(appWidget);
QWidget *configWidget = new QWidget;
uiWidConfig.setupUi(configWidget);
QWidget *deConfigWidget = new QWidget;
uiDEConfig.setupUi(deConfigWidget);
QWidget *tooltipWidget = new QWidget;
uiTooltipConfig.setupUi(tooltipWidget);
//widget
uiWidConfig.textEdit_elements->setPlainText(configuration[QString("text")]);
uiWidConfig.comboBox_tags->clear();
uiWidConfig.comboBox_tags->addItems(getKeys());
// advanced
if (configuration[QString("background")].toInt() == 0)
uiAdvancedConfig.checkBox_background->setCheckState(Qt::Unchecked);
else
uiAdvancedConfig.checkBox_background->setCheckState(Qt::Checked);
if (configuration[QString("popup")].toInt() == 0)
uiAdvancedConfig.checkBox_popup->setCheckState(Qt::Unchecked);
else
uiAdvancedConfig.checkBox_popup->setCheckState(Qt::Checked);
uiAdvancedConfig.lineEdit_timeFormat->setText(configuration[QString("customTime")]);
uiAdvancedConfig.lineEdit_uptimeFormat->setText(configuration[QString("customUptime")]);
uiAdvancedConfig.comboBox_tempUnits->setCurrentIndex(
uiAdvancedConfig.comboBox_tempUnits->findText(configuration[QString("tempUnits")],
Qt::MatchFixedString));
cmd = QString("sensors");
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
process = runTask(cmd);
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
if (process.exitCode != 0)
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed();
uiAdvancedConfig.listWidget_tempDevice->clear();
for (int i=0; i<qoutput.split(QString("\n\n")).count(); i++) {
QString sensor = qoutput.split(QString("\n\n"))[i];
for (int j=0; j<sensor.split(QChar('\n')).count(); j++) {
QString device = sensor.split(QChar('\n'))[j];
if (device.contains(QChar(0260))) {
QListWidgetItem *item = new QListWidgetItem(QString("lmsensors/") + sensor.split(QChar('\n'))[0] + QString("/") +
device.split(QChar(':'))[0].replace(QChar(' '), QChar('_')));
item->setCheckState(Qt::Unchecked);
uiAdvancedConfig.listWidget_tempDevice->addItem(item);
} else if (device.contains(QString("RPM"))) {
QListWidgetItem *item = new QListWidgetItem(QString("lmsensors/") + sensor.split(QChar('\n'))[0] + QString("/") +
device.split(QChar(':'))[0].replace(QChar(' '), QChar('_')));
item->setCheckState(Qt::Unchecked);
uiAdvancedConfig.listWidget_fanDevice->addItem(item);
}
}
}
for (int i=0; i<configuration[QString("tempDevice")].split(QString("@@")).count(); i++) {
QList<QListWidgetItem *> items = uiAdvancedConfig.listWidget_tempDevice
->findItems(configuration[QString("tempDevice")].split(QString("@@"))[i], Qt::MatchFixedString);
if ((items.isEmpty()) &&
(!configuration[QString("tempDevice")].split(QString("@@"))[i].isEmpty())) {
QListWidgetItem *item = new QListWidgetItem(configuration[QString("tempDevice")].split(QString("@@"))[i]);
item->setCheckState(Qt::Checked);
uiAdvancedConfig.listWidget_tempDevice->addItem(item);
} else
for (int j=0; j<items.count(); j++)
items[j]->setCheckState(Qt::Checked);
}
for (int i=0; i<configuration[QString("fanDevice")].split(QString("@@")).count(); i++) {
QList<QListWidgetItem *> items = uiAdvancedConfig.listWidget_fanDevice
->findItems(configuration[QString("fanDevice")].split(QString("@@"))[i], Qt::MatchFixedString);
if ((items.isEmpty()) &&
(!configuration[QString("fanDevice")].split(QString("@@"))[i].isEmpty())) {
QListWidgetItem *item = new QListWidgetItem(configuration[QString("fanDevice")].split(QString("@@"))[i]);
item->setCheckState(Qt::Checked);
uiAdvancedConfig.listWidget_fanDevice->addItem(item);
} else
for (int j=0; j<items.count(); j++)
items[j]->setCheckState(Qt::Checked);
}
cmd = QString("mount");
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
process = runTask(cmd);
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
if (process.exitCode != 0)
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed();
uiAdvancedConfig.listWidget_mount->clear();
for (int i=0; i<qoutput.split(QChar('\n')).count(); i++) {
QString mountPoint = qoutput.split(QChar('\n'))[i].split(QString(" on "))[1].split(QString(" type "))[0];
QListWidgetItem *item = new QListWidgetItem(mountPoint);
item->setCheckState(Qt::Unchecked);
uiAdvancedConfig.listWidget_mount->addItem(item);
}
for (int i=0; i<configuration[QString("mount")].split(QString("@@")).count(); i++) {
QList<QListWidgetItem *> items = uiAdvancedConfig.listWidget_mount
->findItems(configuration[QString("mount")].split(QString("@@"))[i], Qt::MatchFixedString);
if ((items.isEmpty()) &&
(!configuration[QString("mount")].split(QString("@@"))[i].isEmpty())) {
QListWidgetItem *item = new QListWidgetItem(configuration[QString("mount")].split(QString("@@"))[i]);
item->setCheckState(Qt::Checked);
uiAdvancedConfig.listWidget_mount->addItem(item);
} else
for (int j=0; j<items.count(); j++)
items[j]->setCheckState(Qt::Checked);
}
uiAdvancedConfig.listWidget_hddSpeedDevice->clear();
for (int i=0; i<diskDevices.count(); i++) {
QListWidgetItem *item = new QListWidgetItem(diskDevices[i]);
item->setCheckState(Qt::Unchecked);
uiAdvancedConfig.listWidget_hddSpeedDevice->addItem(item);
}
for (int i=0; i<configuration[QString("disk")].split(QString("@@")).count(); i++) {
QList<QListWidgetItem *> items = uiAdvancedConfig.listWidget_hddSpeedDevice
->findItems(configuration[QString("disk")].split(QString("@@"))[i], Qt::MatchFixedString);
if ((items.isEmpty()) &&
(!configuration[QString("disk")].split(QString("@@"))[i].isEmpty())) {
QListWidgetItem *item = new QListWidgetItem(configuration[QString("disk")].split(QString("@@"))[i]);
item->setCheckState(Qt::Checked);
uiAdvancedConfig.listWidget_hddSpeedDevice->addItem(item);
} else
for (int j=0; j<items.count(); j++)
items[j]->setCheckState(Qt::Checked);
}
cmd = QString("find /dev -name [hms]d[a-z]");
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
process = runTask(cmd);
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
if (process.exitCode != 0)
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed();
uiAdvancedConfig.listWidget_hddDevice->clear();
for (int i=0; i<qoutput.split(QChar('\n')).count(); i++) {
QListWidgetItem *item = new QListWidgetItem(qoutput.split(QChar('\n'))[i]);
item->setCheckState(Qt::Unchecked);
uiAdvancedConfig.listWidget_hddDevice->addItem(item);
}
for (int i=0; i<configuration[QString("hdd")].split(QString("@@")).count(); i++) {
QList<QListWidgetItem *> items = uiAdvancedConfig.listWidget_hddDevice
->findItems(configuration[QString("hdd")].split(QString("@@"))[i], Qt::MatchFixedString);
if ((items.isEmpty()) &&
(!configuration[QString("hdd")].split(QString("@@"))[i].isEmpty())) {
QListWidgetItem *item = new QListWidgetItem(configuration[QString("hdd")].split(QString("@@"))[i]);
item->setCheckState(Qt::Checked);
uiAdvancedConfig.listWidget_hddDevice->addItem(item);
} else
for (int j=0; j<items.count(); j++)
items[j]->setCheckState(Qt::Checked);
}
if (configuration[QString("useCustomNetdev")].toInt() == 0)
uiAdvancedConfig.checkBox_netdev->setCheckState(Qt::Unchecked);
else
uiAdvancedConfig.checkBox_netdev->setCheckState(Qt::Checked);
QList<QNetworkInterface> rawInterfaceList = QNetworkInterface::allInterfaces();
QStringList interfaceList;
for (int i=0; i<rawInterfaceList.count(); i++)
interfaceList.append(rawInterfaceList[i].name());
if ((!interfaceList.contains(configuration[QString("customNetdev")])) &&
(!configuration[QString("customNetdev")].isEmpty()))
interfaceList.append(configuration[QString("customNetdev")]);
uiAdvancedConfig.comboBox_netdev->clear();
uiAdvancedConfig.comboBox_netdev->addItems(interfaceList);
uiAdvancedConfig.comboBox_netdev->setCurrentIndex(
uiAdvancedConfig.comboBox_netdev->findText(configuration[QString("customNetdev")],
Qt::MatchFixedString));
uiAdvancedConfig.lineEdit_acOnline->setText(configuration[QString("acOnline")]);
uiAdvancedConfig.lineEdit_acOffline->setText(configuration[QString("acOffline")]);
// tooltip
uiTooltipConfig.spinBox_tooltipNum->setValue(configuration[QString("tooltipNumber")].toInt());
if (configuration[QString("useTooltipBackground")].toInt() == 0)
uiTooltipConfig.checkBox_background->setCheckState(Qt::Unchecked);
else
uiTooltipConfig.checkBox_background->setCheckState(Qt::Checked);
uiTooltipConfig.kcolorcombo_background->setColor(QColor(configuration[QString("tooltipBackground")]));
if (configuration[QString("cpuTooltip")].toInt() == 0)
uiTooltipConfig.checkBox_cpu->setCheckState(Qt::Unchecked);
else
uiTooltipConfig.checkBox_cpu->setCheckState(Qt::Checked);
uiTooltipConfig.kcolorcombo_cpu->setColor(QColor(configuration[QString("cpuColor")]));
if (configuration[QString("cpuclTooltip")].toInt() == 0)
uiTooltipConfig.checkBox_cpuclock->setCheckState(Qt::Unchecked);
else
uiTooltipConfig.checkBox_cpuclock->setCheckState(Qt::Checked);
uiTooltipConfig.kcolorcombo_cpuclock->setColor(QColor(configuration[QString("cpuclColor")]));
if (configuration[QString("memTooltip")].toInt() == 0)
uiTooltipConfig.checkBox_mem->setCheckState(Qt::Unchecked);
else
uiTooltipConfig.checkBox_mem->setCheckState(Qt::Checked);
uiTooltipConfig.kcolorcombo_mem->setColor(QColor(configuration[QString("memColor")]));
if (configuration[QString("swapTooltip")].toInt() == 0)
uiTooltipConfig.checkBox_swap->setCheckState(Qt::Unchecked);
else
uiTooltipConfig.checkBox_swap->setCheckState(Qt::Checked);
uiTooltipConfig.kcolorcombo_swap->setColor(QColor(configuration[QString("swapColor")]));
if (configuration[QString("downTooltip")].toInt() == 0)
uiTooltipConfig.checkBox_down->setCheckState(Qt::Unchecked);
else
uiTooltipConfig.checkBox_down->setCheckState(Qt::Checked);
uiTooltipConfig.kcolorcombo_down->setColor(QColor(configuration[QString("downColor")]));
uiTooltipConfig.kcolorcombo_up->setColor(QColor(configuration[QString("upColor")]));
if (configuration[QString("batteryTooltip")].toInt() == 0)
uiTooltipConfig.checkBox_battery->setCheckState(Qt::Unchecked);
else
uiTooltipConfig.checkBox_battery->setCheckState(Qt::Checked);
uiTooltipConfig.kcolorcombo_battery->setColor(QColor(configuration[QString("batteryColor")]));
uiTooltipConfig.kcolorcombo_batteryIn->setColor(QColor(configuration[QString("batteryInColor")]));
// appearance
KConfigGroup cg = config();
CFont font = CFont(cg.readEntry("fontFamily", "Terminus"));
font.setPointSize(cg.readEntry("fontSize", 10));
font.setCurrentColor(QColor(cg.readEntry("fontColor", "#000000")));
font.setHtmlWeight(cg.readEntry("fontWeight", 400));
font.setItalic(cg.readEntry("fontStyle", "normal") == QString("italic"));
uiAppConfig.spinBox_interval->setValue(configuration[QString("interval")].toInt());
uiAppConfig.fontComboBox->setCurrentFont(font.toQFont());
uiAppConfig.spinBox_size->setValue(font.pointSize());
uiAppConfig.kcolorcombo->setColor(font.color());
if (font.italic())
uiAppConfig.comboBox_style->setCurrentIndex(1);
else
uiAppConfig.comboBox_style->setCurrentIndex(0);
uiAppConfig.spinBox_weight->setValue(font.htmlWeight());
// dataengine
QMap<QString, QString> deSettings = readDataEngineConfiguration();
uiDEConfig.lineEdit_acpi->setText(deSettings[QString("ACPIPATH")]);
uiDEConfig.tableWidget_customCommand->clear();
uiDEConfig.tableWidget_customCommand->setRowCount(deSettings[QString("CUSTOM")].split(QString("@@")).count() + 1);
headerList.clear();
headerList.append(i18n("Custom command"));
uiDEConfig.tableWidget_customCommand->setHorizontalHeaderLabels(headerList);
uiDEConfig.tableWidget_customCommand->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
for (int i=0; i<deSettings[QString("CUSTOM")].split(QString("@@")).count(); i++)
uiDEConfig.tableWidget_customCommand->setItem(i, 0, new QTableWidgetItem(deSettings[QString("CUSTOM")].split(QString("@@"))[i]));
uiDEConfig.lineEdit_desktopCmd->setText(deSettings[QString("DESKTOPCMD")]);
uiDEConfig.comboBox_gpudev->setCurrentIndex(
uiDEConfig.comboBox_gpudev->findText(deSettings[QString("GPUDEV")], Qt::MatchFixedString));
cmd = QString("find /dev -name [hms]d[a-z]");
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
process = runTask(cmd);
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
if (process.exitCode != 0)
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed();
uiDEConfig.comboBox_hdddev->clear();
uiDEConfig.comboBox_hdddev->addItem(QString("all"));
uiDEConfig.comboBox_hdddev->addItem(QString("disable"));
for (int i=0; i<qoutput.split(QChar('\n')).count(); i++)
uiDEConfig.comboBox_hdddev->addItem(qoutput.split(QChar('\n'))[i]);
uiDEConfig.comboBox_hdddev->setCurrentIndex(
uiDEConfig.comboBox_hdddev->findText(deSettings[QString("HDDDEV")], Qt::MatchFixedString));
uiDEConfig.lineEdit_hddtempCmd->setText(deSettings[QString("HDDTEMPCMD")]);
uiDEConfig.lineEdit_mpdaddress->setText(deSettings[QString("MPDADDRESS")]);
uiDEConfig.spinBox_mpdport->setValue(deSettings[QString("MPDPORT")].toInt());
uiDEConfig.comboBox_mpris->addItem(deSettings[QString("MPRIS")]);
uiDEConfig.comboBox_mpris->setCurrentIndex(uiDEConfig.comboBox_mpris->count() - 1);
uiDEConfig.tableWidget_pkgCommand->clear();
uiDEConfig.tableWidget_pkgCommand->setRowCount(deSettings[QString("PKGCMD")].split(QChar(',')).count() + 1);
headerList.clear();
headerList.append(i18n("Package manager"));
headerList.append(i18n("Null lines"));
uiDEConfig.tableWidget_pkgCommand->setHorizontalHeaderLabels(headerList);
uiDEConfig.tableWidget_pkgCommand->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
for (int i=0; i<deSettings[QString("PKGCMD")].split(QChar(',')).count(); i++) {
uiDEConfig.tableWidget_pkgCommand->setItem(i, 0, new QTableWidgetItem(deSettings[QString("PKGCMD")].split(QChar(','))[i]));
uiDEConfig.tableWidget_pkgCommand->setItem(i, 1, new QTableWidgetItem(deSettings[QString("PKGNULL")].split(QChar(','))[i]));
}
uiDEConfig.tableWidget_pkgCommand->setItem(uiDEConfig.tableWidget_pkgCommand->rowCount() - 1, 1,
new QTableWidgetItem(QString("0")));
uiDEConfig.comboBox_playerSelect->setCurrentIndex(
uiDEConfig.comboBox_playerSelect->findText(deSettings[QString("PLAYER")], Qt::MatchFixedString));
parent->addPage(configWidget, i18n("Widget"), Applet::icon());
parent->addPage(advWidget, i18n("Advanced"), QString("system-run"));
parent->addPage(tooltipWidget, i18n("Tooltip"), QString("preferences-desktop-color"));
parent->addPage(appWidget, i18n("Appearance"), QString("preferences-desktop-theme"));
parent->addPage(deConfigWidget, i18n("DataEngine"), QString("utilities-system-monitor"));
connect(uiAdvancedConfig.listWidget_fanDevice, SIGNAL(itemActivated(QListWidgetItem *)),
this, SLOT(editFanItem(QListWidgetItem *)));
connect(uiAdvancedConfig.listWidget_hddDevice, SIGNAL(itemActivated(QListWidgetItem *)),
this, SLOT(editHddItem(QListWidgetItem *)));
connect(uiAdvancedConfig.listWidget_hddSpeedDevice, SIGNAL(itemActivated(QListWidgetItem *)),
this, SLOT(editHddSpeedItem(QListWidgetItem *)));
connect(uiAdvancedConfig.listWidget_mount, SIGNAL(itemActivated(QListWidgetItem *)),
this, SLOT(editMountItem(QListWidgetItem *)));
connect(uiAdvancedConfig.listWidget_tempDevice, SIGNAL(itemActivated(QListWidgetItem *)),
this, SLOT(editTempItem(QListWidgetItem *)));
connect(uiDEConfig.tableWidget_customCommand, SIGNAL(itemChanged(QTableWidgetItem *)),
this, SLOT(addNewCustomCommand(QTableWidgetItem *)));
connect(uiDEConfig.tableWidget_customCommand, SIGNAL(customContextMenuRequested(QPoint)),
this, SLOT(contextMenuCustomCommand(QPoint)));
connect(uiDEConfig.tableWidget_pkgCommand, SIGNAL(itemChanged(QTableWidgetItem *)),
this, SLOT(addNewPkgCommand(QTableWidgetItem *)));
connect(uiDEConfig.tableWidget_pkgCommand, SIGNAL(customContextMenuRequested(QPoint)),
this, SLOT(contextMenuPkgCommand(QPoint)));
connect(uiWidConfig.pushButton_tags, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(uiWidConfig.pushButton_br, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(uiWidConfig.pushButton_font, SIGNAL(clicked(bool)), this, SLOT(setFontFormating()));
connect(uiWidConfig.pushButton_bold, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(uiWidConfig.pushButton_italic, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(uiWidConfig.pushButton_underline, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(uiWidConfig.pushButton_strike, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(uiWidConfig.pushButton_left, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(uiWidConfig.pushButton_center, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(uiWidConfig.pushButton_right, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(uiWidConfig.pushButton_fill, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(parent, SIGNAL(okClicked()), this, SLOT(configAccepted()));
connect(parent, SIGNAL(applyClicked()), this, SLOT(configAccepted()));
}
void AwesomeWidget::configAccepted()
{
if (debug) qDebug() << PDEBUG;
QStringList items;
disconnectFromEngine();
KConfigGroup cg = config();
// widget
cg.writeEntry("text", uiWidConfig.textEdit_elements->toPlainText());
// advanced
cg.writeEntry("background", QString::number(uiAdvancedConfig.checkBox_background->checkState()));
cg.writeEntry("popup", QString::number(uiAdvancedConfig.checkBox_popup->checkState()));
cg.writeEntry("customTime", uiAdvancedConfig.lineEdit_timeFormat->text());
cg.writeEntry("customUptime", uiAdvancedConfig.lineEdit_uptimeFormat->text());
cg.writeEntry("tempUnits", uiAdvancedConfig.comboBox_tempUnits->currentText());
items.clear();
for (int i=0; i<uiAdvancedConfig.listWidget_tempDevice->count(); i++)
if (uiAdvancedConfig.listWidget_tempDevice->item(i)->checkState() == Qt::Checked)
items.append(uiAdvancedConfig.listWidget_tempDevice->item(i)->text());
cg.writeEntry("tempDevice", items.join(QString("@@")));
items.clear();
for (int i=0; i<uiAdvancedConfig.listWidget_fanDevice->count(); i++)
if (uiAdvancedConfig.listWidget_fanDevice->item(i)->checkState() == Qt::Checked)
items.append(uiAdvancedConfig.listWidget_fanDevice->item(i)->text());
cg.writeEntry("fanDevice", items.join(QString("@@")));
items.clear();
for (int i=0; i<uiAdvancedConfig.listWidget_mount->count(); i++)
if (uiAdvancedConfig.listWidget_mount->item(i)->checkState() == Qt::Checked)
items.append(uiAdvancedConfig.listWidget_mount->item(i)->text());
cg.writeEntry("mount", items.join(QString("@@")));
items.clear();
for (int i=0; i<uiAdvancedConfig.listWidget_hddDevice->count(); i++)
if (uiAdvancedConfig.listWidget_hddDevice->item(i)->checkState() == Qt::Checked)
items.append(uiAdvancedConfig.listWidget_hddDevice->item(i)->text());
cg.writeEntry("hdd", items.join(QString("@@")));
items.clear();
for (int i=0; i<uiAdvancedConfig.listWidget_hddSpeedDevice->count(); i++)
if (uiAdvancedConfig.listWidget_hddSpeedDevice->item(i)->checkState() == Qt::Checked)
items.append(uiAdvancedConfig.listWidget_hddSpeedDevice->item(i)->text());
cg.writeEntry("disk", items.join(QString("@@")));
cg.writeEntry("useCustomNetdev", QString::number(uiAdvancedConfig.checkBox_netdev->checkState()));
cg.writeEntry("customNetdev", uiAdvancedConfig.comboBox_netdev->currentText());
cg.writeEntry("acOnline", uiAdvancedConfig.lineEdit_acOnline->text());
cg.writeEntry("acOffline", uiAdvancedConfig.lineEdit_acOffline->text());
// tooltip
cg.writeEntry("tooltipNumber", QString::number(uiTooltipConfig.spinBox_tooltipNum->value()));
cg.writeEntry("useTooltipBackground", QString::number(uiTooltipConfig.checkBox_background->checkState()));
cg.writeEntry("tooltipBackground", uiTooltipConfig.kcolorcombo_background->color().name());
cg.writeEntry("cpuTooltip", QString::number(uiTooltipConfig.checkBox_cpu->checkState()));
cg.writeEntry("cpuColor", uiTooltipConfig.kcolorcombo_cpu->color().name());
cg.writeEntry("cpuclTooltip", QString::number(uiTooltipConfig.checkBox_cpuclock->checkState()));
cg.writeEntry("cpuclColor", uiTooltipConfig.kcolorcombo_cpuclock->color().name());
cg.writeEntry("memTooltip", QString::number(uiTooltipConfig.checkBox_mem->checkState()));
cg.writeEntry("memColor", uiTooltipConfig.kcolorcombo_mem->color().name());
cg.writeEntry("swapTooltip", QString::number(uiTooltipConfig.checkBox_swap->checkState()));
cg.writeEntry("swapColor", uiTooltipConfig.kcolorcombo_swap->color().name());
cg.writeEntry("downTooltip", QString::number(uiTooltipConfig.checkBox_down->checkState()));
cg.writeEntry("downColor", uiTooltipConfig.kcolorcombo_down->color().name());
cg.writeEntry("upColor", uiTooltipConfig.kcolorcombo_up->color().name());
cg.writeEntry("batteryTooltip", QString::number(uiTooltipConfig.checkBox_battery->checkState()));
cg.writeEntry("batteryColor", uiTooltipConfig.kcolorcombo_battery->color().name());
cg.writeEntry("batteryInColor", uiTooltipConfig.kcolorcombo_batteryIn->color().name());
// appearance
cg.writeEntry("interval", QString::number(uiAppConfig.spinBox_interval->value()));
cg.writeEntry("fontFamily", uiAppConfig.fontComboBox->currentFont().family());
cg.writeEntry("fontSize", QString::number(uiAppConfig.spinBox_size->value()));
cg.writeEntry("fontColor", uiAppConfig.kcolorcombo->color().name());
cg.writeEntry("fontStyle", uiAppConfig.comboBox_style->currentText());
cg.writeEntry("fontWeight", QString::number(uiAppConfig.spinBox_weight->value()));
// dataengine
QMap<QString, QString> deSettings;
deSettings[QString("ACPIPATH")] = uiDEConfig.lineEdit_acpi->text();
items.clear();
for (int i=0; i<uiDEConfig.tableWidget_customCommand->rowCount(); i++)
if (uiDEConfig.tableWidget_customCommand->item(i, 0) != 0)
items.append(uiDEConfig.tableWidget_customCommand->item(i, 0)->text());
deSettings[QString("CUSTOM")] = items.join(QString("@@"));
deSettings[QString("DESKTOPCMD")] = uiDEConfig.lineEdit_desktopCmd->text();
deSettings[QString("GPUDEV")] = uiDEConfig.comboBox_gpudev->currentText();
deSettings[QString("HDDDEV")] = uiDEConfig.comboBox_hdddev->currentText();
deSettings[QString("HDDTEMPCMD")] = uiDEConfig.lineEdit_hddtempCmd->text();
deSettings[QString("MPDADDRESS")] = uiDEConfig.lineEdit_mpdaddress->text();
deSettings[QString("MPDPORT")] = QString::number(uiDEConfig.spinBox_mpdport->value());
deSettings[QString("MPRIS")] = uiDEConfig.comboBox_mpris->currentText();
items.clear();
for (int i=0; i<uiDEConfig.tableWidget_pkgCommand->rowCount(); i++)
if (uiDEConfig.tableWidget_pkgCommand->item(i, 0) != 0)
items.append(uiDEConfig.tableWidget_pkgCommand->item(i, 0)->text());
deSettings[QString("PKGCMD")] = items.join(QChar(','));
items.clear();
for (int i=0; i<uiDEConfig.tableWidget_pkgCommand->rowCount(); i++)
if (uiDEConfig.tableWidget_pkgCommand->item(i, 0) != 0)
items.append(uiDEConfig.tableWidget_pkgCommand->item(i, 1)->text());
deSettings[QString("PKGNULL")] = items.join(QChar(','));
deSettings[QString("PLAYER")] = uiDEConfig.comboBox_playerSelect->currentText();
writeDataEngineConfiguration(deSettings);
}
void AwesomeWidget::configChanged()
{
if (debug) qDebug() << PDEBUG;
KConfigGroup cg = config();
// widget
configuration[QString("text")] = cg.readEntry("text", "[cpu: $cpu%] [mem: $mem%] [swap: $swap%] [$netdev: $down/$upKB/s]");
// advanced
configuration[QString("background")] = cg.readEntry("background", "2");
configuration[QString("popup")] = cg.readEntry("popup", "2");
configuration[QString("customTime")] = cg.readEntry("customTime", "$hh:$mm");
configuration[QString("customUptime")] = cg.readEntry("customUptime", "$dd,$hh,$mm");
configuration[QString("tempUnits")] = cg.readEntry("tempUnits", "Celsius");
configuration[QString("tempDevice")] = cg.readEntry("tempDevice", "");
configuration[QString("fanDevice")] = cg.readEntry("fanDevice", "");
configuration[QString("mount")] = cg.readEntry("mount", "/");
configuration[QString("hdd")] = cg.readEntry("hdd", "/dev/sda");
configuration[QString("disk")] = cg.readEntry("disk", "disk/sda_(8:0)");
configuration[QString("useCustomNetdev")] = cg.readEntry("useCustomNetdev", "0");
configuration[QString("customNetdev")] = cg.readEntry("customNetdev", "lo");
configuration[QString("acOnline")] = cg.readEntry("acOnline", "(*)");
configuration[QString("acOffline")] = cg.readEntry("acOffline", "( )");
// tooltip
tooltipValues.clear();
configuration[QString("tooltipNumber")] = cg.readEntry("tooltipNumber", "100");
configuration[QString("useTooltipBackground")] = cg.readEntry("useTooltipBackground", "2");
configuration[QString("tooltipBackground")] = cg.readEntry("tooltipBackground", "#ffffff");
configuration[QString("cpuTooltip")] = cg.readEntry("cpuTooltip", "2");
if (configuration[QString("cpuTooltip")].toInt() == 2) {
tooltipValues[QString("cpu")].append(0.0);
tooltipValues[QString("cpu")].append(0.01);
}
configuration[QString("cpuColor")] = cg.readEntry("cpuColor", "#ff0000");
configuration[QString("cpuclTooltip")] = cg.readEntry("cpuclTooltip", "2");
if (configuration[QString("cpuclTooltip")].toInt() == 2) {
tooltipValues[QString("cpucl")].append(0.0);
tooltipValues[QString("cpucl")].append(0.01);
}
configuration[QString("cpuclColor")] = cg.readEntry("cpuclColor", "#00ff00");
configuration[QString("memTooltip")] = cg.readEntry("memTooltip", "2");
if (configuration[QString("memTooltip")].toInt() == 2) {
tooltipValues[QString("mem")].append(0.0);
tooltipValues[QString("mem")].append(0.01);
}
configuration[QString("memColor")] = cg.readEntry("memColor", "#0000ff");
configuration[QString("swapTooltip")] = cg.readEntry("swapTooltip", "2");
if (configuration[QString("swapTooltip")].toInt() == 2) {
tooltipValues[QString("swap")].append(0.0);
tooltipValues[QString("swap")].append(0.01);
}
configuration[QString("swapColor")] = cg.readEntry("swapColor", "#ffff00");
configuration[QString("downTooltip")] = cg.readEntry("downTooltip", "2");
if (configuration[QString("downTooltip")].toInt() == 2) {
tooltipValues[QString("down")].append(0.0);
tooltipValues[QString("down")].append(0.01);
tooltipValues[QString("up")].append(0.0);
tooltipValues[QString("up")].append(0.01);
}
configuration[QString("downColor")] = cg.readEntry("downColor", "#00ffff");
configuration[QString("upColor")] = cg.readEntry("upColor", "#ff00ff");
configuration[QString("batteryTooltip")] = cg.readEntry("batteryTooltip", "2");
if (configuration[QString("batteryTooltip")].toInt() == 2) {
tooltipValues[QString("bat")].append(0.0);
tooltipValues[QString("bat")].append(0.01);
}
configuration[QString("batteryColor")] = cg.readEntry("batteryColor", "#008800");
configuration[QString("batteryInColor")] = cg.readEntry("batteryInColor", "#880000");
// appearance
configuration[QString("interval")] = cg.readEntry("interval", "1000");
CFont font = CFont(cg.readEntry("fontFamily", "Terminus"));
font.setPointSize(cg.readEntry("fontSize", 10));
font.setCurrentColor(QColor(cg.readEntry("fontColor", "#000000")));
font.setHtmlWeight(cg.readEntry("fontWeight", 400));
font.setItalic(cg.readEntry("fontStyle", "normal") == QString("italic"));
QString fontStyle;
if (font.italic())
fontStyle = QString("italic");
else
fontStyle = QString("normal");
formatLine[0] = QString("<html><head><style type=\"text/css\">p, li { white-space: pre-wrap; }</style>\
</head><body style=\"font-family:'%1'; font-size:%2pt; font-weight:%3; font-style:%4; color:%5;\">")
.arg(font.family())
.arg(font.pointSize())
.arg(font.htmlWeight())
.arg(fontStyle)
.arg(font.color().name());
formatLine[1] = QString("</body></html>");
// counts
QMap<QString, QString> deSettings = readDataEngineConfiguration();
counts[QString("bat")] = 0;
QStringList acpiDevices = QDir(deSettings[QString("ACPIPATH")]).entryList(QDir::Dirs | QDir::NoDotAndDotDot);
QRegExp batRegexp = QRegExp(QString("BAT.*"));
for (int i=0; i<acpiDevices.count(); i++)
if (acpiDevices[i].indexOf(batRegexp) > -1)
counts[QString("bat")]++;
counts[QString("cpu")] = getNumberCpus();
counts[QString("custom")] = deSettings[QString("CUSTOM")].split(QString("@@")).count();
counts[QString("disk")] = configuration[QString("disk")].split(QString("@@")).count();
counts[QString("fan")] = configuration[QString("fanDevice")].split(QString("@@")).count();
counts[QString("hddtemp")] = configuration[QString("hdd")].split(QString("@@")).count();
counts[QString("mount")] = configuration[QString("mount")].split(QString("@@")).count();
counts[QString("pkg")] = deSettings[QString("PKGCMD")].split(QChar(',')).count();
counts[QString("temp")] = configuration[QString("tempDevice")].split(QString("@@")).count();
counts[QString("tooltip")] = 0;
counts[QString("tooltip")] += configuration[QString("cpuTooltip")].toInt();
counts[QString("tooltip")] += configuration[QString("cpuclTooltip")].toInt();
counts[QString("tooltip")] += configuration[QString("memTooltip")].toInt();
counts[QString("tooltip")] += configuration[QString("swapTooltip")].toInt();
counts[QString("tooltip")] += configuration[QString("downTooltip")].toInt();
counts[QString("tooltip")] += configuration[QString("batteryTooltip")].toInt();
counts[QString("tooltip")] = counts[QString("tooltip")] / 2;
reinit();
}
void AwesomeWidget::addNewCustomCommand(QTableWidgetItem *item)
{
if (debug) qDebug() << PDEBUG;
if (item->row() == (uiDEConfig.tableWidget_customCommand->rowCount() - 1))
uiDEConfig.tableWidget_customCommand->insertRow(
uiDEConfig.tableWidget_customCommand->rowCount());
}
void AwesomeWidget::addNewPkgCommand(QTableWidgetItem *item)
{
if (debug) qDebug() << PDEBUG;
if ((item->row() == (uiDEConfig.tableWidget_pkgCommand->rowCount() - 1)) &&
(item->column() == 0)) {
uiDEConfig.tableWidget_pkgCommand->insertRow(
uiDEConfig.tableWidget_pkgCommand->rowCount());
uiDEConfig.tableWidget_pkgCommand->setItem(
uiDEConfig.tableWidget_pkgCommand->rowCount() - 1, 1,
new QTableWidgetItem(QString("0")));
}
}
void AwesomeWidget::contextMenuCustomCommand(const QPoint pos)
{
if (debug) qDebug() << PDEBUG;
if (uiDEConfig.tableWidget_customCommand->currentItem() == 0) return;
QMenu menu(uiDEConfig.tableWidget_customCommand);
QAction *remove = menu.addAction(QIcon::fromTheme("edit-delete"), i18n("Remove"));
QAction *action = menu.exec(uiDEConfig.tableWidget_customCommand->viewport()->mapToGlobal(pos));
if (action == remove)
uiDEConfig.tableWidget_customCommand->removeRow(
uiDEConfig.tableWidget_customCommand->currentRow());
}
void AwesomeWidget::contextMenuPkgCommand(const QPoint pos)
{
if (debug) qDebug() << PDEBUG;
if (uiDEConfig.tableWidget_pkgCommand->currentItem() == 0) return;
QMenu menu(uiDEConfig.tableWidget_pkgCommand);
QAction *remove = menu.addAction(QIcon::fromTheme("edit-delete"), i18n("Remove"));
QAction *action = menu.exec(uiDEConfig.tableWidget_pkgCommand->viewport()->mapToGlobal(pos));
if (action == remove)
uiDEConfig.tableWidget_pkgCommand->removeRow(
uiDEConfig.tableWidget_pkgCommand->currentRow());
}
void AwesomeWidget::editFanItem(QListWidgetItem *item)
{
if (debug) qDebug() << PDEBUG;
uiAdvancedConfig.listWidget_fanDevice->openPersistentEditor(item);
}
void AwesomeWidget::editHddItem(QListWidgetItem *item)
{
if (debug) qDebug() << PDEBUG;
uiAdvancedConfig.listWidget_hddDevice->openPersistentEditor(item);
}
void AwesomeWidget::editHddSpeedItem(QListWidgetItem *item)
{
if (debug) qDebug() << PDEBUG;
uiAdvancedConfig.listWidget_hddSpeedDevice->openPersistentEditor(item);
}
void AwesomeWidget::editMountItem(QListWidgetItem *item)
{
if (debug) qDebug() << PDEBUG;
uiAdvancedConfig.listWidget_mount->openPersistentEditor(item);
}
void AwesomeWidget::editTempItem(QListWidgetItem *item)
{
if (debug) qDebug() << PDEBUG;
uiAdvancedConfig.listWidget_tempDevice->openPersistentEditor(item);
}
void AwesomeWidget::setFontFormating()
{
if (debug) qDebug() << PDEBUG;
CFont defaultFont = CFont(uiAppConfig.fontComboBox->currentFont().family(),
uiAppConfig.spinBox_size->value(),
400, false, uiAppConfig.kcolorcombo->color());
CFont font = CFontDialog::getFont(i18n("Select font"), defaultFont,
false, false);
if (font != defaultFont) {
QString selectedText = uiWidConfig.textEdit_elements->textCursor().selectedText();
uiWidConfig.textEdit_elements->insertPlainText(QString("<span style=\"color:%1; font-family:'%2'; font-size:%3pt;\">")
.arg(font.color().name()).arg(font.family()).arg(font.pointSize()) +
selectedText + QString("</span>"));
}
}
void AwesomeWidget::setFormating()
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Sender" << sender();
QString selectedText = uiWidConfig.textEdit_elements->textCursor().selectedText();
if (sender() == uiWidConfig.pushButton_tags)
uiWidConfig.textEdit_elements->insertPlainText(QString("$") + uiWidConfig.comboBox_tags->currentText());
else if (sender() == uiWidConfig.pushButton_br)
uiWidConfig.textEdit_elements->insertPlainText(QString("<br>\n"));
else if (sender() == uiWidConfig.pushButton_bold)
uiWidConfig.textEdit_elements->insertPlainText(QString("<b>") + selectedText + QString("</b>"));
else if (sender() == uiWidConfig.pushButton_italic)
uiWidConfig.textEdit_elements->insertPlainText(QString("<i>") + selectedText + QString("</i>"));
else if (sender() == uiWidConfig.pushButton_underline)
uiWidConfig.textEdit_elements->insertPlainText(QString("<u>") + selectedText + QString("</u>"));
else if (sender() == uiWidConfig.pushButton_strike)
uiWidConfig.textEdit_elements->insertPlainText(QString("<s>") + selectedText + QString("</s>"));
else if (sender() == uiWidConfig.pushButton_left)
uiWidConfig.textEdit_elements->insertPlainText(QString("<p align=\"left\">") + selectedText + QString("</p>"));
else if (sender() == uiWidConfig.pushButton_center)
uiWidConfig.textEdit_elements->insertPlainText(QString("<p align=\"center\">") + selectedText + QString("</p>"));
else if (sender() == uiWidConfig.pushButton_right)
uiWidConfig.textEdit_elements->insertPlainText(QString("<p align=\"right\">") + selectedText + QString("</p>"));
else if (sender() == uiWidConfig.pushButton_fill)
uiWidConfig.textEdit_elements->insertPlainText(QString("<p align=\"justify\">") + selectedText + QString("</p>"));
}

View File

@ -1,97 +0,0 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "customlabel.h"
#include <QGraphicsSceneMouseEvent>
#include <QTextCodec>
#include "awesome-widget.h"
#include <pdebug/pdebug.h>
#include <task/taskadds.h>
CustomLabel::CustomLabel(AwesomeWidget *wid, const bool debugCmd)
: QLabel(0),
widget(wid),
debug(debugCmd)
{
setWordWrap(false);
}
CustomLabel::~CustomLabel()
{
if (debug) qDebug() << PDEBUG;
}
void CustomLabel::setPopupEnabled(const bool state)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "State" << state;
enablePopup = state;
}
void CustomLabel::mousePressEvent(QMouseEvent *event)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Get signal" << event->button();
if ((enablePopup) && (event->button() == Qt::LeftButton)) {
QString cmd, text;
TaskResult process;
// kernel
cmd = QString("uname -rsm");
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
process = runTask(cmd);
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
if (process.exitCode != 0)
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
text += QString("Kernel: %1\n").arg(QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed());
// hostname
cmd = QString("uname -n");
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
process = runTask(cmd);
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
if (process.exitCode != 0)
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
text += QString("Hostname: %1\n").arg(QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed());
// whoami
cmd = QString("whoami");
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
process = runTask(cmd);
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
if (process.exitCode != 0)
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
text += QString("Whoami: %1\n").arg(QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed());
// uptime
cmd = QString("uptime");
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
process = runTask(cmd);
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
if (process.exitCode != 0)
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
text += QString("Uptime: %1\n").arg(QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed());
widget->sendNotification(QString("system"), text);
}
emit(QLabel::mousePressEvent(event));
}

View File

@ -1,497 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DEWindow</class>
<widget class="QWidget" name="DEWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>592</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>700</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="windowTitle">
<string notr="true">DE</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollArea_dattaengine">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="contents_dattaengine">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>684</width>
<height>576</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="4" column="0">
<layout class="QHBoxLayout" name="layout_hdddev">
<item>
<widget class="QLabel" name="label_hdddev">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>HDD</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_hdddev">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item row="7" column="0">
<layout class="QHBoxLayout" name="layout_mpdport">
<item>
<widget class="QLabel" name="label_mpdport">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>MPD port</string>
</property>
</widget>
</item>
<item>
<spacer name="spacer_mpdport">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>19</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBox_mpdport">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>50000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>6600</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="layout_gpudev">
<item>
<widget class="QLabel" name="label_gpudev">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>GPU device</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_gpudev">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<item>
<property name="text">
<string notr="true">auto</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">disable</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">nvidia</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">ati</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="11" column="0">
<spacer name="spacer_dataengine">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="0">
<layout class="QHBoxLayout" name="layout_hddtempCmd">
<item>
<widget class="QLabel" name="label_hddtempCmd">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>hddtemp cmd</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_hddtempCmd">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="9" column="0">
<layout class="QHBoxLayout" name="layout_playerSelect">
<item>
<widget class="QLabel" name="label_playerSelect">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Music player</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_playerSelect">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<item>
<property name="text">
<string notr="true">mpris</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">mpd</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="6" column="0">
<layout class="QHBoxLayout" name="layout_mpdaddress">
<item>
<widget class="QLabel" name="label_mpdaddress">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>MPD address</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_mpdaddress">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="layout_desktopCmd">
<item>
<widget class="QLabel" name="label_desktopCmd">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Desktop check cmd</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_desktopCmd">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="8" column="0">
<layout class="QVBoxLayout" name="layout_mpris">
<item>
<widget class="QLabel" name="label_mprisInfo">
<property name="text">
<string>&lt;b&gt;NOTE:&lt;/b&gt; Player DBus interface should be an active</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="layout_mprisSelect">
<item>
<widget class="QLabel" name="label_mpris">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>MPRIS player name</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_mpris">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string notr="true">auto</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">amarok</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">audacious</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">clementine</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">deadbeef</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">vlc</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">qmmp</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">xmms2</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="10" column="0">
<layout class="QVBoxLayout" name="layout_pkgCommand">
<item>
<widget class="QTableWidget" name="tableWidget_pkgCommand">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="toolTip">
<string>Editable
del - remove item</string>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string>Package manager</string>
</property>
</column>
<column>
<property name="text">
<string>Null lines</string>
</property>
</column>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QTableWidget" name="tableWidget_customCommand">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="toolTip">
<string>Editable
del - remove item</string>
</property>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string>Custom command</string>
</property>
</column>
</widget>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="layout_acpi">
<item>
<widget class="QLabel" name="label_acpi">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>ACPI path</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_acpi">
<property name="toolTip">
<string>&quot;/sys/class/power_supply/&quot; by default</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,551 +0,0 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "awesome-widget.h"
#include <QRegExp>
#include <math.h>
#include <pdebug/pdebug.h>
void AwesomeWidget::connectToEngine()
{
if (debug) qDebug() << PDEBUG;
QRegExp regExp;
// battery
regExp = QRegExp(QString("(ac|bat.*)"));
if ((foundKeys.indexOf(regExp) > -1) ||
(configuration[QString("batteryTooltip")].toInt() == 2))
extsysmonEngine->connectSource(QString("battery"),
this, configuration[QString("interval")].toInt());
// cpu
regExp = QRegExp(QString("cpu(?!cl).*"));
if ((foundKeys.indexOf(regExp) > -1) ||
(configuration[QString("cpuTooltip")].toInt() == 2)) {
sysmonEngine->connectSource(QString("cpu/system/TotalLoad"),
this, configuration[QString("interval")].toInt());
for (int i=0; i<counts[QString("cpu")]; i++)
sysmonEngine->connectSource(QString("cpu/cpu") + QString::number(i) + QString("/TotalLoad"),
this, configuration[QString("interval")].toInt());
}
// cpuclock
regExp = QRegExp(QString("cpucl.*"));
if ((foundKeys.indexOf(regExp) > -1) ||
(configuration[QString("cpuclTooltip")].toInt() == 2)) {
sysmonEngine->connectSource(QString("cpu/system/AverageClock"),
this, configuration[QString("interval")].toInt());
for (int i=0; i<counts[QString("cpu")]; i++)
sysmonEngine->connectSource(QString("cpu/cpu") + QString::number(i) + QString("/clock"),
this, configuration[QString("interval")].toInt());
}
// custom command
regExp = QRegExp(QString("custom.*"));
if (foundKeys.indexOf(regExp) > -1)
extsysmonEngine->connectSource(QString("custom"),
this, configuration[QString("interval")].toInt());
// desktop
regExp = QRegExp(QString(".*desktop.*"));
if (foundKeys.indexOf(regExp) > -1)
extsysmonEngine->connectSource(QString("desktop"),
this, configuration[QString("interval")].toInt());
// disk speed
regExp = QRegExp(QString("hdd[rw].*"));
if (foundKeys.indexOf(regExp) > -1)
for (int i=0; i<configuration[QString("disk")].split(QString("@@")).count(); i++) {
sysmonEngine->connectSource(configuration[QString("disk")].split(QString("@@"))[i] + QString("/Rate/rblk"),
this, configuration[QString("interval")].toInt());
sysmonEngine->connectSource(configuration[QString("disk")].split(QString("@@"))[i] + QString("/Rate/wblk"),
this, configuration[QString("interval")].toInt());
}
// fan
regExp = QRegExp(QString("fan.*"));
if (foundKeys.indexOf(regExp) > -1)
for (int i=0; i<configuration[QString("fanDevice")].split(QString("@@")).count(); i++)
sysmonEngine->connectSource(configuration[QString("fanDevice")].split(QString("@@"))[i],
this, configuration[QString("interval")].toInt());
// gpu
regExp = QRegExp(QString("gpu"));
if (foundKeys.indexOf(regExp) > -1)
extsysmonEngine->connectSource(QString("gpu"),
this, configuration[QString("interval")].toInt());
// gputemp
regExp = QRegExp(QString("gputemp"));
if (foundKeys.indexOf(regExp) > -1)
extsysmonEngine->connectSource(QString("gputemp"),
this, configuration[QString("interval")].toInt());
// mount
regExp = QRegExp(QString("hdd([0-9]|mb|gb|freemb|freegb|totmb|totgb).*"));
if (foundKeys.indexOf(regExp) > -1)
for (int i=0; i<configuration[QString("mount")].split(QString("@@")).count(); i++) {
sysmonEngine->connectSource(QString("partitions") + configuration[QString("mount")].split(QString("@@"))[i] + QString("/filllevel"),
this, configuration[QString("interval")].toInt());
sysmonEngine->connectSource(QString("partitions") + configuration[QString("mount")].split(QString("@@"))[i] + QString("/freespace"),
this, configuration[QString("interval")].toInt());
sysmonEngine->connectSource(QString("partitions") + configuration[QString("mount")].split(QString("@@"))[i] + QString("/usedspace"),
this, configuration[QString("interval")].toInt());
}
// hddtemp
regExp = QRegExp(QString("hddtemp.*"));
if (foundKeys.indexOf(regExp) > -1)
extsysmonEngine->connectSource(QString("hddtemp"),
this, configuration[QString("interval")].toInt());
// memory
regExp = QRegExp(QString("mem.*"));
if ((foundKeys.indexOf(regExp) > -1) ||
(configuration[QString("memTooltip")].toInt() == 2)) {
sysmonEngine->connectSource(QString("mem/physical/free"),
this, configuration[QString("interval")].toInt());
sysmonEngine->connectSource(QString("mem/physical/used"),
this, configuration[QString("interval")].toInt());
sysmonEngine->connectSource(QString("mem/physical/application"),
this, configuration[QString("interval")].toInt());
}
// network
networkDeviceUpdate = 0;
regExp = QRegExp(QString("(down|up|netdev)"));
if ((foundKeys.indexOf(regExp) > -1) ||
(configuration[QString("downTooltip")].toInt() == 2)) {
sysmonEngine->connectSource(QString("network/interfaces/") + values[QString("netdev")] + QString("/transmitter/data"),
this, configuration[QString("interval")].toInt());
sysmonEngine->connectSource(QString("network/interfaces/") + values[QString("netdev")] + QString("/receiver/data"),
this, configuration[QString("interval")].toInt());
}
// package manager
regExp = QRegExp(QString("pkgcount.*"));
if (foundKeys.indexOf(regExp) > -1)
extsysmonEngine->connectSource(QString("pkg"),
this, 60*60*1000, Plasma::AlignToHour);
// player
regExp = QRegExp(QString("(album|artist|duration|progress|title)"));
if (foundKeys.indexOf(regExp) > -1)
extsysmonEngine->connectSource(QString("player"),
this, configuration[QString("interval")].toInt());
// ps
regExp = QRegExp(QString("ps.*"));
if (foundKeys.indexOf(regExp) > -1)
extsysmonEngine->connectSource(QString("ps"),
this, configuration[QString("interval")].toInt());
// swap
regExp = QRegExp(QString("swap.*"));
if ((foundKeys.indexOf(regExp) > -1) ||
(configuration[QString("swapTooltip")].toInt() == 2)) {
sysmonEngine->connectSource(QString("mem/swap/free"),
this, configuration[QString("interval")].toInt());
sysmonEngine->connectSource(QString("mem/swap/used"),
this, configuration[QString("interval")].toInt());
}
// temp
regExp = QRegExp(QString("temp.*"));
if (foundKeys.indexOf(regExp) > -1)
for (int i=0; i<configuration[QString("tempDevice")].split(QString("@@")).count(); i++)
sysmonEngine->connectSource(configuration[QString("tempDevice")].split(QString("@@"))[i],
this, configuration[QString("interval")].toInt());
// time
regExp = QRegExp(QString("(^|iso|short|long|c)time"));
if (foundKeys.indexOf(regExp) > -1)
timeEngine->connectSource(QString("Local"),
this, 1000);
// uptime
regExp = QRegExp(QString("(^|c)uptime"));
if (foundKeys.indexOf(regExp) > -1)
sysmonEngine->connectSource(QString("system/uptime"),
this, configuration[QString("interval")].toInt());
}
void AwesomeWidget::dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Source" << sourceName;
// regular expressions
QRegExp cpuRegExp = QRegExp(QString("cpu/cpu.*/TotalLoad"));
QRegExp cpuclRegExp = QRegExp(QString("cpu/cpu.*/clock"));
QRegExp hddrRegExp = QRegExp(QString("disk/.*/Rate/rblk"));
QRegExp hddwRegExp = QRegExp(QString("disk/.*/Rate/wblk"));
QRegExp mountFillRegExp = QRegExp(QString("partitions/.*/filllevel"));
QRegExp mountFreeRegExp = QRegExp(QString("partitions/.*/freespace"));
QRegExp mountUsedRegExp = QRegExp(QString("partitions/.*/usedspace"));
QRegExp netRecRegExp = QRegExp(QString("network/interfaces/.*/receiver/data"));
QRegExp netTransRegExp = QRegExp(QString("network/interfaces/.*/transmitter/data"));
QRegExp tempRegExp = QRegExp(QString("lmsensors/.*"));
if (data.keys().isEmpty()) return;
if (sourceName == QString("battery")) {
for (int i=0; i<data.keys().count(); i++) {
if (data.keys()[i] == QString("ac")) {
if (data[QString("ac")].toBool())
values[QString("ac")] = configuration[QString("acOnline")];
else
values[QString("ac")] = configuration[QString("acOffline")];
} else
values[data.keys()[i]] = QString("%1").arg(data[data.keys()[i]].toFloat(), 3, 'f', 0);
}
if ((configuration[QString("batteryTooltip")].toInt() == 2) &&
(!isnan(data[QString("bat")].toFloat()))) {
if (tooltipValues[QString("bat")].count() > configuration[QString("tooltipNumber")].toInt())
tooltipValues[QString("bat")].takeFirst();
if (data[QString("ac")].toBool())
tooltipValues[QString("bat")].append(data[QString("bat")].toFloat());
else
tooltipValues[QString("bat")].append(-data[QString("bat")].toFloat());
}
} else if (sourceName == QString("cpu/system/TotalLoad")) {
values[QString("cpu")] = QString("%1").arg(data[QString("value")].toFloat(), 5, 'f', 1);
if ((configuration[QString("cpuTooltip")].toInt() == 2) &&
(!isnan(data[QString("value")].toFloat()))) {
if (tooltipValues[QString("cpu")].count() > configuration[QString("tooltipNumber")].toInt())
tooltipValues[QString("cpu")].takeFirst();
tooltipValues[QString("cpu")].append(data[QString("value")].toFloat());
}
} else if (sourceName.indexOf(cpuRegExp) > -1) {
QString number = sourceName;
number.remove(QString("cpu/cpu"));
number.remove(QString("/TotalLoad"));
values[QString("cpu") + number] = QString("%1").arg(data[QString("value")].toFloat(), 5, 'f', 1);
} else if (sourceName == QString("cpu/system/AverageClock")) {
values[QString("cpucl")] = QString("%1").arg(data[QString("value")].toFloat(), 4, 'f', 0);
if ((configuration[QString("cpuclTooltip")].toInt() == 2) &&
(!isnan(data[QString("value")].toFloat()))) {
if (tooltipValues[QString("cpucl")].count() > configuration[QString("tooltipNumber")].toInt())
tooltipValues[QString("cpucl")].takeFirst();
tooltipValues[QString("cpucl")].append(data[QString("value")].toFloat());
}
} else if (sourceName.indexOf(cpuclRegExp) > -1) {
QString number = sourceName;
number.remove(QString("cpu/cpu"));
number.remove(QString("/clock"));
values[QString("cpucl") + number] = QString("%1").arg(data[QString("value")].toFloat(), 4, 'f', 0);
} else if (sourceName == QString("custom")) {
for (int i=0; i<data.keys().count(); i++)
values[data.keys()[i]] = data[data.keys()[i]].toString();
} else if (sourceName == QString("desktop")) {
values[QString("desktop")] = data[QString("currentName")].toString();
values[QString("ndesktop")] = QString("%1").arg(data[QString("currentNumber")].toInt());
values[QString("tdesktops")] = QString("%1").arg(data[QString("number")].toInt());
} else if (sourceName.indexOf(hddrRegExp) > -1) {
QString device = sourceName;
device.remove(QString("/Rate/rblk"));
for (int i=0; i<counts[QString("disk")]; i++)
if (configuration[QString("disk")].split(QString("@@"))[i] == device) {
values[QString("hddr") + QString::number(i)] = QString("%1").arg(data[QString("value")].toFloat(), 5, 'f', 0);
break;
}
} else if (sourceName.indexOf(hddwRegExp) > -1) {
QString device = sourceName;
device.remove(QString("/Rate/wblk"));
for (int i=0; i<counts[QString("disk")]; i++)
if (configuration[QString("disk")].split(QString("@@"))[i] == device) {
values[QString("hddw") + QString::number(i)] = QString("%1").arg(data[QString("value")].toFloat(), 5, 'f', 0);
break;
}
} else if (sourceName == QString("gpu")) {
values[QString("gpu")] = QString("%1").arg(data[QString("GPU")].toFloat(), 5, 'f', 1);
} else if (sourceName == QString("gputemp")) {
values[QString("gputemp")] = QString("%1").arg(getTemp(data[QString("GPUTemp")].toFloat()), 4, 'f', 1);
} else if (sourceName.indexOf(mountFillRegExp) > -1) {
QString mount = sourceName;
mount.remove(QString("partitions"));
mount.remove(QString("/filllevel"));
for (int i=0; i<counts[QString("mount")]; i++)
if (configuration[QString("mount")].split(QString("@@"))[i] == mount) {
values[QString("hdd") + QString::number(i)] = QString("%1").arg(data[QString("value")].toFloat(), 5, 'f', 1);
break;
}
} else if (sourceName.indexOf(mountFreeRegExp) > -1) {
QString mount = sourceName;
mount.remove(QString("partitions"));
mount.remove(QString("/freespace"));
for (int i=0; i<counts[QString("mount")]; i++)
if (configuration[QString("mount")].split(QString("@@"))[i] == mount) {
values[QString("hddfreemb") + QString::number(i)] = QString("%1").arg(
data[QString("value")].toFloat() / 1024.0, 5, 'f', 0);
values[QString("hddfreegb") + QString::number(i)] = QString("%1").arg(
data[QString("value")].toFloat() / (1024.0 * 1024.0), 5, 'f', 1);
break;
}
} else if (sourceName.indexOf(mountUsedRegExp) > -1) {
QString mount = sourceName;
mount.remove(QString("partitions"));
mount.remove(QString("/usedspace"));
for (int i=0; i<counts[QString("mount")]; i++)
if (configuration[QString("mount")].split(QString("@@"))[i] == mount) {
values[QString("hddmb") + QString::number(i)] = QString("%1").arg(
data[QString("value")].toFloat() / 1024.0, 5, 'f', 0);
values[QString("hddgb") + QString::number(i)] = QString("%1").arg(
data[QString("value")].toFloat() / (1024.0 * 1024.0), 5, 'f', 1);
// total
values[QString("hddtotmb") + QString::number(i)] = QString("%1").arg(
values[QString("hddfreemb") + QString::number(i)].toInt() +
values[QString("hddmb") + QString::number(i)].toInt());
values[QString("hddtotgb") + QString::number(i)] = QString("%1").arg(
values[QString("hddfreegb") + QString::number(i)].toFloat() +
values[QString("hddgb") + QString::number(i)].toFloat(),
5, 'f', 1);
break;
}
} else if (sourceName == QString("hddtemp")) {
for (int i=0; i<data.keys().count(); i++)
for (int j=0; j<counts[QString("hddtemp")]; j++)
if (data.keys()[i] == configuration[QString("hdd")].split(QString("@@"))[j]) {
values[QString("hddtemp") + QString::number(j)] = QString("%1").arg(getTemp(data[data.keys()[i]].toFloat()), 4, 'f', 1);
break;
}
} else if (sourceName == QString("mem/physical/application")) {
values[QString("memmb")] = QString("%1").arg(data[QString("value")].toFloat() / 1024.0, 5, 'f', 0);
values[QString("memgb")] = QString("%1").arg(data[QString("value")].toFloat() / (1024.0 * 1024.0), 5, 'f', 1);
} else if (sourceName == QString("mem/physical/free")) {
values[QString("memfreemb")] = QString("%1").arg(data[QString("value")].toFloat() / 1024.0, 5, 'f', 0);
values[QString("memfreegb")] = QString("%1").arg(data[QString("value")].toFloat() / (1024.0 * 1024.0), 4, 'f', 1);
} else if (sourceName == QString("mem/physical/used")) {
values[QString("memusedmb")] = QString("%1").arg(data[QString("value")].toFloat() / 1024.0, 0, 'f', 0);
values[QString("memusedgb")] = QString("%1").arg(data[QString("value")].toFloat() / (1024.0 * 1024.0), 4, 'f', 1);
// total
values[QString("memtotmb")] = QString("%1").arg(
values[QString("memusedmb")].toInt() + values[QString("memfreemb")].toInt(), 5);
values[QString("memtotgb")] = QString("%1").arg(
values[QString("memusedgb")].toFloat() + values[QString("memfreegb")].toFloat(),
4, 'f', 1);
// percentage
values[QString("mem")] = QString("%1").arg(100.0 * values[QString("memmb")].toFloat() / values[QString("memtotmb")].toFloat(),
5, 'f', 1);
if ((configuration[QString("memTooltip")].toInt() == 2) &&
(!isnan(values[QString("mem")].toFloat()))) {
if (tooltipValues[QString("mem")].count() > configuration[QString("tooltipNumber")].toInt())
tooltipValues[QString("mem")].takeFirst();
tooltipValues[QString("mem")].append(values[QString("mem")].toFloat());
}
} else if (sourceName.indexOf(netRecRegExp) > -1) {
values[QString("down")] = QString("%1").arg(data[QString("value")].toFloat(), 4, 'f', 0);
if ((configuration[QString("downTooltip")].toInt() == 2) &&
(!isnan(data[QString("value")].toFloat()))) {
if (tooltipValues[QString("down")].count() > configuration[QString("tooltipNumber")].toInt())
tooltipValues[QString("down")].takeFirst();
tooltipValues[QString("down")].append(data[QString("value")].toFloat());
}
networkDeviceUpdate++;
if (networkDeviceUpdate >= 30) {
networkDeviceUpdate = 0;
if (configuration[QString("useCustomNetdev")].toInt() == 0) {
sysmonEngine->disconnectSource(QString("network/interfaces/") + values[QString("netdev")] + QString("/transmitter/data"), this);
sysmonEngine->disconnectSource(QString("network/interfaces/") + values[QString("netdev")] + QString("/receiver/data"), this);
updateNetworkDevice(false);
sysmonEngine->connectSource(QString("network/interfaces/") + values[QString("netdev")] + QString("/transmitter/data"),
this, configuration[QString("interval")].toInt());
sysmonEngine->connectSource(QString("network/interfaces/") + values[QString("netdev")] + QString("/receiver/data"),
this, configuration[QString("interval")].toInt());
}
}
} else if (sourceName.indexOf(netTransRegExp) > -1) {
values[QString("up")] = QString("%1").arg(data[QString("value")].toFloat(), 4, 'f', 0);
if ((configuration[QString("downTooltip")].toInt() == 2) &&
(!isnan(data[QString("value")].toFloat()))) {
if (tooltipValues[QString("up")].count() > configuration[QString("tooltipNumber")].toInt())
tooltipValues[QString("up")].takeFirst();
tooltipValues[QString("up")].append(data[QString("value")].toFloat());
}
} else if (sourceName == QString("pkg")) {
for (int i=0; i<data.keys().count(); i++)
values[data.keys()[i].toLower()] = QString("%1").arg(data[data.keys()[i]].toInt(), 2);
} else if (sourceName == QString("player")) {
values[QString("album")] = data[QString("album")].toString();
values[QString("artist")] = data[QString("artist")].toString();
values[QString("duration")] = data[QString("duration")].toString();
values[QString("progress")] = data[QString("progress")].toString();
values[QString("title")] = data[QString("title")].toString();
} else if (sourceName == QString("ps")) {
values[QString("ps")] = data[QString("ps")].toString();
values[QString("pscount")] = QString("%1").arg(data[QString("psCount")].toInt(), 2);
values[QString("pstotal")] = QString("%1").arg(data[QString("psTotal")].toInt(), 3);
} else if (sourceName == QString("mem/swap/free")) {
values[QString("swapfreemb")] = QString("%1").arg(data[QString("value")].toFloat() / 1024.0, 5, 'f', 0);
values[QString("swapfreegb")] = QString("%1").arg(data[QString("value")].toFloat() / (1024.0 * 1024.0), 4, 'f', 1);
} else if (sourceName == QString("mem/swap/used")) {
values[QString("swapmb")] = QString("%1").arg(data[QString("value")].toFloat() / 1024.0, 5, 'f', 0);
values[QString("swapgb")] = QString("%1").arg(data[QString("value")].toFloat() / (1024.0 * 1024.0), 4, 'f', 1);
// total
values[QString("swaptotmb")] = QString("%1").arg(
values[QString("swapmb")].toInt() + values[QString("swapfreemb")].toInt(), 5);
values[QString("swaptotgb")] = QString("%1").arg(
values[QString("swapgb")].toFloat() + values[QString("swapfreegb")].toFloat(), 4, 'f', 1);
// percentage
values[QString("swap")] = QString("%1").arg(100.0 * values[QString("swapmb")].toFloat() / values[QString("swaptotmb")].toFloat(),
5, 'f', 1);
if ((configuration[QString("swapTooltip")].toInt() == 2) &&
(!isnan(values[QString("swap")].toFloat()))) {
if (tooltipValues[QString("swap")].count() > configuration[QString("tooltipNumber")].toInt())
tooltipValues[QString("swap")].takeFirst();
tooltipValues[QString("swap")].append(values[QString("swap")].toFloat());
}
} else if (sourceName.indexOf(tempRegExp) > -1) {
if (data[QString("units")].toString() == QString("rpm")) {
for (int i=0; i<counts[QString("fan")]; i++)
if (sourceName == configuration[QString("fanDevice")].split(QString("@@"))[i]) {
values[QString("fan") + QString::number(i)] = QString("%1").arg(data[QString("value")].toFloat(), 4, 'f', 1);
break;
}
} else {
for (int i=0; i<counts[QString("temp")]; i++)
if (sourceName == configuration[QString("tempDevice")].split(QString("@@"))[i]) {
values[QString("temp") + QString::number(i)] = QString("%1").arg(getTemp(data[QString("value")].toFloat()), 4, 'f', 1);
break;
}
}
} else if (sourceName == QString("Local")) {
values[QString("time")] = data[QString("DateTime")].toDateTime().toString(Qt::TextDate);
values[QString("isotime")] = data[QString("DateTime")].toDateTime().toString(Qt::ISODate);
values[QString("shorttime")] = data[QString("DateTime")].toDateTime().toString(Qt::SystemLocaleShortDate);
values[QString("longtime")] = data[QString("DateTime")].toDateTime().toString(Qt::SystemLocaleLongDate);
QStringList timeKeys = getTimeKeys();
values[QString("ctime")] = configuration[QString("customTime")];
for (int i=0; i<timeKeys.count(); i++)
values[QString("ctime")].replace(QString("$") + timeKeys[i],
data[QString("DateTime")].toDateTime().toString(timeKeys[i]));
} else if (sourceName == QString("system/uptime")) {
int uptime = data[QString("value")].toFloat();
int seconds = uptime - uptime % 60;
int minutes = seconds / 60 % 60;
int hours = ((seconds / 60) - minutes) / 60 % 24;
int days = (((seconds / 60) - minutes) / 60 - hours) / 24;
values[QString("uptime")] = QString("%1d%2h%3m").arg(days, 3).arg(hours, 2).arg(minutes, 2);
values[QString("cuptime")] = configuration[QString("customUptime")];
values[QString("cuptime")].replace(QString("$dd"), QString("%1").arg(days, 3, 10, QChar('0')));
values[QString("cuptime")].replace(QString("$d"), QString("%1").arg(days));
values[QString("cuptime")].replace(QString("$hh"), QString("%1").arg(hours, 2, 10, QChar('0')));
values[QString("cuptime")].replace(QString("$h"), QString("%1").arg(hours));
values[QString("cuptime")].replace(QString("$mm"), QString("%1").arg(minutes, 2, 10, QChar('0')));
values[QString("cuptime")].replace(QString("$m"), QString("%1").arg(minutes));
}
}
void AwesomeWidget::disconnectFromEngine()
{
if (debug) qDebug() << PDEBUG;
QRegExp regExp;
// battery
regExp = QRegExp(QString("(ac|bat)"));
if ((foundKeys.indexOf(regExp) > -1) ||
(configuration[QString("batteryTooltip")].toInt() == 2))
extsysmonEngine->disconnectSource(QString("battery"), this);
// cpu
regExp = QRegExp(QString("cpu(?!cl).*"));
if ((foundKeys.indexOf(regExp) > -1) ||
(configuration[QString("cpuTooltip")].toInt() == 2)) {
sysmonEngine->disconnectSource(QString("cpu/system/TotalLoad"), this);
for (int i=0; i<counts[QString("cpu")]; i++)
sysmonEngine->disconnectSource(QString("cpu/cpu") + QString::number(i) + QString("/TotalLoad"), this);
}
// cpuclock
regExp = QRegExp(QString("cpucl.*"));
if ((foundKeys.indexOf(regExp) > -1) ||
(configuration[QString("cpuclTooltip")].toInt() == 2)) {
sysmonEngine->disconnectSource(QString("cpu/system/AverageClock"), this);
for (int i=0; i<counts[QString("cpu")]; i++)
sysmonEngine->disconnectSource(QString("cpu/cpu") + QString::number(i) + QString("/clock"), this);
}
// custom command
regExp = QRegExp(QString("custom.*"));
if (foundKeys.indexOf(regExp) > -1)
extsysmonEngine->disconnectSource(QString("custom"), this);
// desktop
regExp = QRegExp(QString(".*desktop.*"));
if (foundKeys.indexOf(regExp) > -1)
extsysmonEngine->disconnectSource(QString("desktop"), this);
// disk speed
regExp = QRegExp(QString("hdd[rw].*"));
if (foundKeys.indexOf(regExp) > -1)
for (int i=0; i<configuration[QString("disk")].split(QString("@@")).count(); i++) {
sysmonEngine->disconnectSource(configuration[QString("disk")].split(QString("@@"))[i] + QString("/Rate/rblk"), this);
sysmonEngine->disconnectSource(configuration[QString("disk")].split(QString("@@"))[i] + QString("/Rate/wblk"), this);
}
// fan
regExp = QRegExp(QString("fan.*"));
if (foundKeys.indexOf(regExp) > -1)
for (int i=0; i<configuration[QString("fanDevice")].split(QString("@@")).count(); i++)
sysmonEngine->disconnectSource(configuration[QString("fanDevice")].split(QString("@@"))[i], this);
// gpu
regExp = QRegExp(QString("gpu"));
if (foundKeys.indexOf(regExp) > -1)
extsysmonEngine->disconnectSource(QString("gpu"), this);
// gputemp
regExp = QRegExp(QString("gputemp"));
if (foundKeys.indexOf(regExp) > -1)
extsysmonEngine->disconnectSource(QString("gputemp"), this);
// mount
regExp = QRegExp(QString("hdd([0-9]|mb|gb|freemb|freegb|totmb|totgb).*"));
if (foundKeys.indexOf(regExp) > -1)
for (int i=0; i<configuration[QString("mount")].split(QString("@@")).count(); i++) {
sysmonEngine->disconnectSource(QString("partitions") + configuration[QString("mount")].split(QString("@@"))[i] + QString("/filllevel"), this);
sysmonEngine->disconnectSource(QString("partitions") + configuration[QString("mount")].split(QString("@@"))[i] + QString("/freespace"), this);
sysmonEngine->disconnectSource(QString("partitions") + configuration[QString("mount")].split(QString("@@"))[i] + QString("/usedspace"), this);
}
// hddtemp
regExp = QRegExp(QString("hddtemp.*"));
if (foundKeys.indexOf(regExp) > -1)
extsysmonEngine->disconnectSource(QString("hddtemp"), this);
// memory
regExp = QRegExp(QString("mem.*"));
if ((foundKeys.indexOf(regExp) > -1) ||
(configuration[QString("memTooltip")].toInt() == 2)) {
sysmonEngine->disconnectSource(QString("mem/physical/free"), this);
sysmonEngine->disconnectSource(QString("mem/physical/used"), this);
sysmonEngine->disconnectSource(QString("mem/physical/application"), this);
}
// network
regExp = QRegExp(QString("(down|up|netdev)"));
if ((foundKeys.indexOf(regExp) > -1) ||
(configuration[QString("downTooltip")].toInt() == 2)) {
sysmonEngine->disconnectSource(QString("network/interfaces/") + values[QString("netdev")] + QString("/transmitter/data"), this);
sysmonEngine->disconnectSource(QString("network/interfaces/") + values[QString("netdev")] + QString("/receiver/data"), this);
}
// package manager
regExp = QRegExp(QString("pkgcount.*"));
if (foundKeys.indexOf(regExp) > -1)
extsysmonEngine->disconnectSource(QString("pkg"), this);
// player
regExp = QRegExp(QString("(album|artist|duration|progress|title)"));
if (foundKeys.indexOf(regExp) > -1)
extsysmonEngine->disconnectSource(QString("player"), this);
// ps
regExp = QRegExp(QString("ps.*"));
if (foundKeys.indexOf(regExp) > -1)
extsysmonEngine->disconnectSource(QString("ps"), this);
// swap
regExp = QRegExp(QString("swap.*"));
if ((foundKeys.indexOf(regExp) > -1) ||
(configuration[QString("swapTooltip")].toInt() == 2)) {
sysmonEngine->disconnectSource(QString("mem/swap/free"), this);
sysmonEngine->disconnectSource(QString("mem/swap/used"), this);
}
// temp
regExp = QRegExp(QString("temp.*"));
if (foundKeys.indexOf(regExp) > -1)
for (int i=0; i<configuration[QString("tempDevice")].split(QString("@@")).count(); i++)
sysmonEngine->disconnectSource(configuration[QString("tempDevice")].split(QString("@@"))[i], this);
// time
regExp = QRegExp(QString("(^|iso|short|long|c)time"));
if (foundKeys.indexOf(regExp) > -1)
timeEngine->disconnectSource(QString("Local"), this);
// uptime
regExp = QRegExp(QString("(^|c)uptime"));
if (foundKeys.indexOf(regExp) > -1)
sysmonEngine->disconnectSource(QString("system/uptime"), this);
}

View File

@ -12,11 +12,14 @@ X-KDE-ServiceTypes=Plasma/Applet
Type=Service
Icon=utilities-system-monitor
X-KDE-Library=plasma_applet_awesome-widget
X-KDE-ServiceTypes=Plasma/Applet
X-Plasma-API=declarativeappletscript
X-Plasma-MainScript=ui/main.qml
X-Plasma-RemoteLocation=
X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis
X-KDE-PluginInfo-Email=esalexeev@gmail.com
X-KDE-PluginInfo-Name=awesome-widget
X-KDE-PluginInfo-Name=org.kde.plasma.awesomewidget
X-KDE-PluginInfo-Version=@PROJECT_VERSION@
X-KDE-PluginInfo-Website=http://arcanis.name/projects/awesome-widgets/
X-KDE-PluginInfo-Category=System Information

View File

@ -0,0 +1,59 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import org.kde.plasma.configuration 2.0
ConfigModel {
ConfigCategory {
name: i18n("Widget")
icon: "utilities-system-monitor"
source: "widget.qml"
}
ConfigCategory {
name: i18n("Advanced")
icon: "system-run"
source: "advanced.qml"
}
ConfigCategory {
name: i18n("Tooltip")
icon: "preferences-desktop-color"
source: "tooltip.qml"
}
ConfigCategory {
name: i18n("Appearance")
icon: "preferences-desktop-theme"
source: "appearance.qml"
}
ConfigCategory {
name: i18n("DataEngine")
icon: "utilities-system-monitor"
source: "dataengine.qml"
}
ConfigCategory {
name: i18n("About")
icon: "help-about"
source: "about.qml"
}
}

View File

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name=""/>
<group name="Widget">
<!-- widget -->
<entry name="text" type="string">
<default>[cpu: $cpu%] [mem: $mem%] [swap: $swap%] [$netdev: $down/$upKB/s]</default>
</entry>
</group>
<group name="Advanced">
<!-- advanced -->
<entry name="height" type="int">
<default>0</default>
</entry>
<entry name="width" type="int">
<default>0</default>
</entry>
<entry name="notify" type="bool">
<default>true</default>
</entry>
<entry name="wrapNewLines" type="bool">
<default>false</default>
</entry>
<entry name="background" type="bool">
<default>true</default>
</entry>
<entry name="customTime" type="string">
<default>$hh:$mm</default>
</entry>
<entry name="customUptime" type="string">
<default>$dd,$hh,$mm</default>
</entry>
<entry name="tempUnits" type="string">
<default>Celsius</default>
</entry>
<entry name="acOnline" type="string">
<default>(*)</default>
</entry>
<entry name="acOffline" type="string">
<default>( )</default>
</entry>
<entry name="checkUpdates" type="bool">
<default>true</default>
</entry>
</group>
<group name="Tooltip">
<entry name="tooltipNumber" type="int">
<default>100</default>
</entry>
<entry name="useTooltipBackground" type="bool">
<default>true</default>
</entry>
<entry name="tooltipBackground" type="string">
<default>#ffffff</default>
</entry>
<entry name="cpuTooltip" type="bool">
<default>true</default>
</entry>
<entry name="cpuTooltipColor" type="string">
<default>#ff0000</default>
</entry>
<entry name="cpuclTooltip" type="bool">
<default>true</default>
</entry>
<entry name="cpuclTooltipColor" type="string">
<default>#00ff00</default>
</entry>
<entry name="memTooltip" type="bool">
<default>true</default>
</entry>
<entry name="memTooltipColor" type="string">
<default>#0000ff</default>
</entry>
<entry name="swapTooltip" type="bool">
<default>true</default>
</entry>
<entry name="swapTooltipColor" type="string">
<default>#ffff00</default>
</entry>
<entry name="downTooltip" type="bool">
<default>true</default>
</entry>
<entry name="downTooltipColor" type="string">
<default>#00ffff</default>
</entry>
<entry name="upTooltipColor" type="string">
<default>#ff00ff</default>
</entry>
<entry name="batTooltip" type="bool">
<default>true</default>
</entry>
<entry name="batTooltipColor" type="string">
<default>#008800</default>
</entry>
<entry name="batInTooltipColor" type="string">
<default>#880000</default>
</entry>
</group>
<group name="Appearance">
<!-- appearance -->
<entry name="interval" type="int">
<default>1000</default>
</entry>
<entry name="textAlign" type="string">
<default>center</default>
</entry>
<entry name="fontFamily" type="string">
<default>Terminus</default>
</entry>
<entry name="fontSize" type="int">
<default>12</default>
</entry>
<entry name="fontColor" type="string">
<default>#000000</default>
</entry>
<entry name="fontWeight" type="string">
<default>normal</default>
</entry>
<entry name="fontStyle" type="string">
<default>normal</default>
</entry>
</group>
</kcfg>

View File

@ -0,0 +1,111 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import QtQuick.Layouts 1.0 as QtLayouts
import org.kde.plasma.awesomewidget 1.0
Item {
id: aboutPage
width: childrenRect.width
height: childrenRect.height
implicitWidth: pageColumn.implicitWidth
implicitHeight: pageColumn.implicitHeight
property bool debug: AWKeys.isDebugEnabled()
Column {
id: pageColumn
anchors.fill: parent
QtControls.TabView {
height: parent.height
width: parent.width
QtControls.Tab {
title: i18n("About")
QtLayouts.ColumnLayout {
QtControls.Label {
QtLayouts.Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
text: AWActions.getAboutText("header")
}
QtControls.Label {
QtLayouts.Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
text: AWActions.getAboutText("version")
}
QtControls.Label {
QtLayouts.Layout.fillWidth: true
horizontalAlignment: Text.AlignJustify
text: AWActions.getAboutText("description")
}
QtControls.Label {
QtLayouts.Layout.fillWidth: true
horizontalAlignment: Text.AlignLeft
textFormat: Text.RichText
text: AWActions.getAboutText("links")
onLinkActivated: Qt.openUrlExternally(link);
}
QtControls.Label {
QtLayouts.Layout.fillHeight: true
QtLayouts.Layout.fillWidth: true
font.capitalization: Font.SmallCaps
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom
textFormat: Text.RichText
text: AWActions.getAboutText("copy")
}
}
}
QtControls.Tab {
title: i18n("Acknowledgment")
QtLayouts.ColumnLayout {
QtControls.Label {
QtLayouts.Layout.fillWidth: true
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignJustify
text: AWActions.getAboutText("translators")
}
QtControls.Label {
QtLayouts.Layout.fillHeight: true
QtLayouts.Layout.fillWidth: true
horizontalAlignment: Text.AlignJustify
verticalAlignment: Text.AlignTop
textFormat: Text.RichText
text: AWActions.getAboutText("3rdparty")
onLinkActivated: Qt.openUrlExternally(link);
}
}
}
}
}
Component.onCompleted: {
if (debug) console.log("[about::onCompleted]")
}
}

View File

@ -0,0 +1,257 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import org.kde.plasma.awesomewidget 1.0
Item {
id: advancedPage
width: childrenRect.width
height: childrenRect.height
implicitWidth: pageColumn.implicitWidth
implicitHeight: pageColumn.implicitHeight
property bool debug: AWKeys.isDebugEnabled()
property alias cfg_height: widgetHeight.value
property alias cfg_width: widgetWidth.value
property alias cfg_notify: notify.checked
property alias cfg_wrapNewLines: wrapNewLines.checked
property alias cfg_background: background.checked
property alias cfg_customTime: customTime.text
property alias cfg_customUptime: customUptime.text
property string cfg_tempUnits: tempUnits.currentText
property alias cfg_acOnline: acOnline.text
property alias cfg_acOffline: acOffline.text
Column {
id: pageColumn
anchors.fill: parent
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Widget height, px")
}
QtControls.SpinBox {
id: widgetHeight
width: parent.width * 3 / 5
minimumValue: 0
maximumValue: 4096
stepSize: 50
value: plasmoid.configuration.height
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Widget width, px")
}
QtControls.SpinBox {
id: widgetWidth
width: parent.width * 3 / 5
minimumValue: 0
maximumValue: 4096
stepSize: 50
value: plasmoid.configuration.width
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.heigth
width: parent.width * 2 / 5
}
QtControls.CheckBox {
id: notify
width: parent.width * 3 / 5
text: i18n("Enable notifications")
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.heigth
width: parent.width * 2 / 5
}
QtControls.CheckBox {
id: wrapNewLines
width: parent.width * 3 / 5
text: i18n("Wrap new lines")
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.heigth
width: parent.width * 2 / 5
}
QtControls.CheckBox {
id: background
width: parent.width * 3 / 5
text: i18n("Enable background")
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Custom time format")
}
QtControls.TextField {
id: customTime
width: parent.width * 3 / 5
text: plasmoid.configuration.customTime
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Custom uptime format")
}
QtControls.TextField {
id: customUptime
width: parent.width * 3 / 5
text: plasmoid.configuration.customUptime
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Temperature units")
}
QtControls.ComboBox {
id: tempUnits
width: parent.width * 3 / 5
textRole: "label"
model: [
{
'label': i18n("Celsius"),
'name': "Celsius"
},
{
'label': i18n("Fahrenheit"),
'name': "Fahrenheit"
},
{
'label': i18n("Kelvin"),
'name': "Kelvin"
},
{
'label': i18n("Reaumur"),
'name': "Reaumur"
},
{
'label': i18n("cm^-1"),
'name': "cm^-1"
},
{
'label': i18n("kJ/mol"),
'name': "kJ/mol"
},
{
'label': i18n("kcal/mol"),
'name': "kcal/mol"
}
]
onCurrentIndexChanged: cfg_tempUnits = model[currentIndex]["name"]
Component.onCompleted: {
for (var i = 0; i < model.length; i++) {
if (model[i]["name"] == plasmoid.configuration.tempUnits) {
tempUnits.currentIndex = i;
}
}
}
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("AC online tag")
}
QtControls.TextField {
id: acOnline
width: parent.width * 3 / 5
text: plasmoid.configuration.acOnline
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("AC offline tag")
}
QtControls.TextField {
id: acOffline
width: parent.width * 3 / 5
text: plasmoid.configuration.acOffline
}
}
}
Component.onCompleted: {
if (debug) console.log("[advanced::onCompleted]")
}
}

View File

@ -0,0 +1,239 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import QtQuick.Controls.Styles 1.3 as QtStyles
import QtQuick.Dialogs 1.1 as QtDialogs
import org.kde.plasma.awesomewidget 1.0
Item {
id: appearancePage
width: childrenRect.width
height: childrenRect.height
implicitWidth: pageColumn.implicitWidth
implicitHeight: pageColumn.implicitHeight
property bool debug: AWKeys.isDebugEnabled()
property variant weight: {
25: 0,
50: 1,
63: 3,
75: 4,
87: 5
}
property alias cfg_interval: update.value
property alias cfg_fontFamily: selectFont.text
property alias cfg_fontSize: fontSize.value
property string cfg_fontWeight: fontWeight.currentText
property string cfg_fontStyle: fontStyle.currentText
property alias cfg_fontColor: selectColor.text
Column {
id: pageColumn
anchors.fill: parent
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Time interval")
}
QtControls.SpinBox {
id: update
width: parent.width * 2 / 3
minimumValue: 1000
maximumValue: 10000
stepSize: 500
value: plasmoid.configuration.interval
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font")
}
QtControls.Button {
id: selectFont
width: parent.width * 2 / 3
text: plasmoid.configuration.fontFamily
onClicked: fontDialog.visible = true
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font size")
}
QtControls.SpinBox {
id: fontSize
width: parent.width * 2 / 3
minimumValue: 8
maximumValue: 32
stepSize: 1
value: plasmoid.configuration.fontSize
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font weight")
}
QtControls.ComboBox {
id: fontWeight
width: parent.width * 2 / 3
textRole: "label"
model: [
{
'label': i18n("light"),
'name': "light"
},
{
'label': i18n("normal"),
'name': "normal"
},
{
'label': i18n("demi bold"),
'name': "demibold"
},
{
'label': i18n("bold"),
'name': "bold"
},
{
'label': i18n("black"),
'name': "black"
}
]
onCurrentIndexChanged: cfg_fontWeight = model[currentIndex]["name"]
Component.onCompleted: {
for (var i = 0; i < model.length; i++) {
if (model[i]["name"] == plasmoid.configuration.fontWeight) {
fontWeight.currentIndex = i;
}
}
}
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font style")
}
QtControls.ComboBox {
id: fontStyle
width: parent.width * 2 / 3
textRole: "label"
model: [
{
'label': i18n("normal"),
'name': "normal"
},
{
'label': i18n("italic"),
'name': "italic"
}
]
onCurrentIndexChanged: cfg_fontStyle = model[currentIndex]["name"]
Component.onCompleted: {
for (var i = 0; i < model.length; i++) {
if (model[i]["name"] == plasmoid.configuration.fontStyle) {
fontStyle.currentIndex = i;
}
}
}
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font color")
}
QtControls.Button {
id: selectColor
width: parent.width * 2 / 3
style: QtStyles.ButtonStyle {
background: Rectangle {
color: plasmoid.configuration.fontColor
}
}
text: plasmoid.configuration.fontColor
onClicked: colorDialog.visible = true
}
}
}
QtDialogs.ColorDialog {
id: colorDialog
title: i18n("Select a color")
color: selectColor.text
onAccepted: selectColor.text = colorDialog.color
}
QtDialogs.FontDialog {
id: fontDialog
title: i18n("Select a font")
font: Qt.font({ family: selectFont.text, pointSize: fontSize.value, weight: Font.Normal })
onAccepted: {
selectFont.text = fontDialog.font.family
fontSize.value = fontDialog.font.pointSize
fontStyle.currentIndex = fontDialog.font.italic ? 1 : 0
fontWeight.currentIndex = weight[fontDialog.font.weight]
}
}
Component.onCompleted: {
if (debug) console.log("[appearance::onCompleted]")
}
}

View File

@ -0,0 +1,288 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.0 as QtControls
import QtQuick.Dialogs 1.1 as QtDialogs
import QtQuick.Layouts 1.0 as QtLayouts
import QtQuick.Controls.Styles 1.3 as QtStyles
import org.kde.plasma.awesomewidget 1.0
Item {
id: dataenginePage
width: childrenRect.width
height: childrenRect.height
implicitWidth: pageColumn.implicitWidth
implicitHeight: pageColumn.implicitHeight
property bool debug: AWKeys.isDebugEnabled()
property variant tooltipSettings: {
"tooltipNumber": plasmoid.configuration.tooltipNumber,
"useTooltipBackground": plasmoid.configuration.useTooltipBackground,
"tooltipBackgroung": plasmoid.configuration.tooltipBackgroung,
"cpuTooltip": plasmoid.configuration.cpuTooltip,
"cpuclTooltip": plasmoid.configuration.cpuclTooltip,
"memTooltip": plasmoid.configuration.memTooltip,
"swapTooltip": plasmoid.configuration.swapTooltip,
"downTooltip": plasmoid.configuration.downTooltip,
"upTooltip": plasmoid.configuration.downTooltip,
"batTooltip": plasmoid.configuration.batTooltip,
"cpuTooltipColor": plasmoid.configuration.cpuTooltipColor,
"cpuclTooltipColor": plasmoid.configuration.cpuclTooltipColor,
"memTooltipColor": plasmoid.configuration.memTooltipColor,
"swapTooltipColor": plasmoid.configuration.swapTooltipColor,
"downTooltipColor": plasmoid.configuration.downTooltipColor,
"upTooltipColor": plasmoid.configuration.upTooltipColor,
"batTooltipColor": plasmoid.configuration.batTooltipColor,
"batInTooltipColor": plasmoid.configuration.batInTooltipColor
}
property variant cfg_dataengine: AWActions.readDataEngineConfiguration()
Column {
id: pageColumn
anchors.fill: parent
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("ACPI path")
}
QtControls.TextField {
width: parent.width * 3 / 5
text: cfg_dataengine["ACPIPATH"]
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Custom scripts")
}
QtControls.Button {
width: parent.width * 3 / 5
text: i18n("Edit scripts")
onClicked: AWKeys.editItem("extscript")
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("GPU device")
}
QtControls.ComboBox {
id: gpuDev
width: parent.width * 3 / 5
model: ["auto", "disable", "ati", "nvidia"]
Component.onCompleted: {
for (var i=0; i<model.length; i++) {
if (model[i] == cfg_dataengine["GPUDEV"]) {
currentIndex = i;
}
}
}
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("HDD")
}
QtControls.ComboBox {
id: hdd
width: parent.width * 3 / 5
model: AWKeys.getHddDevices(true)
Component.onCompleted: {
for (var i=0; i<model.length; i++) {
if (model[i] == cfg_dataengine["HDDDEV"]) {
hdd.currentIndex = i;
}
}
}
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("hddtemp cmd")
}
QtControls.TextField {
width: parent.width * 3 / 5
text: cfg_dataengine["HDDTEMPCMD"]
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("MPD address")
}
QtControls.TextField {
width: parent.width * 3 / 5
text: cfg_dataengine["MPDADDRESS"]
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("MPD port")
}
QtControls.SpinBox {
width: parent.width * 3 / 5
minimumValue: 1000
maximumValue: 65535
stepSize: 1
value: cfg_dataengine["MPDPORT"]
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("MPRIS player name")
}
QtControls.ComboBox {
id: mpris
width: parent.width * 3 / 5
editable: true
model: ["auto", "amarok", "audacious", "clementine", "deadbeef",
"vlc", "qmmp", "xmms2", cfg_dataengine["MPRIS"]]
currentIndex: model.length - 1
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Music player")
}
QtControls.ComboBox {
id: player
width: parent.width * 3 / 5
model: ["mpris", "mpd"]
Component.onCompleted: {
for (var i=0; i<model.length; i++) {
if (model[i] == cfg_dataengine["PLAYER"]) {
player.currentIndex = i;
}
}
}
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Quotes monitor")
}
QtControls.Button {
width: parent.width * 3 / 5
text: i18n("Edit tickers")
onClicked: AWKeys.editItem("extquotes")
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Package manager")
}
QtControls.Button {
width: parent.width * 3 / 5
text: i18n("Edit command")
onClicked: AWKeys.editItem("extupgrade")
}
}
}
Component.onCompleted: {
if (debug) console.log("[dataengine::onCompleted]")
// init submodule
AWKeys.initKeys(plasmoid.configuration.text)
}
Component.onDestruction: {
if (debug) console.log("[dataengine::onDestruction]")
cfg_dataengine["GPUDEV"] = gpuDev.currentText
cfg_dataengine["HDDDEV"] = hdd.currentText
cfg_dataengine["PLAYER"] = player.currentText
cfg_dataengine["MPRIS"] = mpris.currentText
AWActions.writeDataEngineConfiguration(cfg_dataengine)
}
}

View File

@ -0,0 +1,36 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
pragma Singleton
import QtQuick 2.0
QtObject {
property variant fontWeight: {
"light": Font.Light,
"normal": Font.Normal,
"demibold": Font.DemiBold,
"bold": Font.Bold,
"black": Font.Black
}
property variant align: {
"left": Text.AlignLeft,
"center": Text.AlignHCenter,
"right": Text.AlignRight,
"justify": Text.AlignJustify
}
}

View File

@ -0,0 +1,244 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.4
import QtQuick.Controls 1.3 as QtControls
import QtQuick.Layouts 1.1
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.awesomewidget 1.0
import "."
Item {
id: main
property bool debug: AWKeys.isDebugEnabled()
property variant settings: {
"customTime": plasmoid.configuration.customTime,
"customUptime": plasmoid.configuration.customUptime,
"tempUnits": plasmoid.configuration.tempUnits,
"acOnline": plasmoid.configuration.acOnline,
"acOffline": plasmoid.configuration.acOffline
}
property variant tooltipSettings: {
"tooltipNumber": plasmoid.configuration.tooltipNumber,
"useTooltipBackground": plasmoid.configuration.useTooltipBackground,
"tooltipBackground": plasmoid.configuration.tooltipBackground,
"cpuTooltip": plasmoid.configuration.cpuTooltip,
"cpuclTooltip": plasmoid.configuration.cpuclTooltip,
"memTooltip": plasmoid.configuration.memTooltip,
"swapTooltip": plasmoid.configuration.swapTooltip,
"downTooltip": plasmoid.configuration.downTooltip,
"upTooltip": plasmoid.configuration.downTooltip,
"batTooltip": plasmoid.configuration.batTooltip,
"cpuTooltipColor": plasmoid.configuration.cpuTooltipColor,
"cpuclTooltipColor": plasmoid.configuration.cpuclTooltipColor,
"memTooltipColor": plasmoid.configuration.memTooltipColor,
"swapTooltipColor": plasmoid.configuration.swapTooltipColor,
"downTooltipColor": plasmoid.configuration.downTooltipColor,
"upTooltipColor": plasmoid.configuration.upTooltipColor,
"batTooltipColor": plasmoid.configuration.batTooltipColor,
"batInTooltipColor": plasmoid.configuration.batInTooltipColor
}
signal dropSource(string sourceName)
signal needUpdate
signal sizeUpdate
// init
Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation
Plasmoid.compactRepresentation: Plasmoid.fullRepresentation
Layout.fillWidth: plasmoid.formFactor != PlasmaCore.Planar
Layout.fillHeight: plasmoid.formFactor != PlasmaCore.Planar
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Plasmoid.icon: "utilities-system-monitor"
Plasmoid.backgroundHints: plasmoid.configuration.background ? "DefaultBackground" : "NoBackground"
Plasmoid.associatedApplication: "ksysguard"
PlasmaCore.DataSource {
id: systemmonitorDE
engine: "systemmonitor"
connectedSources: systemmonitorDE.sources
interval: plasmoid.configuration.interval
onNewData: {
if (debug) console.log("[main::onNewData] : Update source " + sourceName)
// FIXME: ugly workaround to make some sources working
systemmonitorDE.interval = plasmoid.configuration.interval
AWKeys.setDataBySource(sourceName, data, settings)
}
onSourceAdded: {
if (debug) console.log("[main::onSourceAdded] : Source " + source)
AWKeys.addDevice(source)
}
}
PlasmaCore.DataSource {
id: extsysmonDE
engine: "extsysmon"
connectedSources: extsysmonDE.sources
interval: plasmoid.configuration.interval
onNewData: {
if (debug) console.log("[main::onNewData] : Update source " + sourceName)
// FIXME: ugly workaround to make some sources working
extsysmonDE.interval = plasmoid.configuration.interval
AWKeys.setDataBySource(sourceName, data, settings)
}
}
PlasmaCore.DataSource {
id: timeDE
engine: "time"
connectedSources: ["Local"]
interval: 1000
onNewData: {
if (debug) console.log("[main::onNewData] : Update source " + sourceName)
AWKeys.setDataBySource(sourceName, data, settings)
}
}
// ui
Text {
id: text
anchors.fill: parent
textFormat: Text.RichText
wrapMode: Text.NoWrap
horizontalAlignment: general.align[plasmoid.configuration.textAlign]
verticalAlignment: Text.AlignVCenter
color: plasmoid.configuration.fontColor
font.family: plasmoid.configuration.fontFamily
font.italic: plasmoid.configuration.fontStyle == "italic" ? true : false
font.pointSize: plasmoid.configuration.fontSize
font.weight: general.fontWeight[plasmoid.configuration.fontWeight]
text: plasmoid.configuration.text
PlasmaCore.ToolTipArea {
height: tooltip.height
width: tooltip.width
mainItem: Text {
id: tooltip
height: contentHeight
width: contentWidth
textFormat: Text.RichText
}
}
}
Component.onCompleted: {
if (debug) console.log("[main::onCompleted]")
// actions
plasmoid.setAction("requestKey", i18n("Request key"), "utilities-system-monitor")
plasmoid.setAction("showReadme", i18n("Show README"), "text-x-readme")
plasmoid.setAction("checkUpdates", i18n("Check updates"), "system-software-update")
// plasmoid.setAction("report", i18n("Mail to developers"), "email")
// init submodule
Plasmoid.userConfiguringChanged(false)
// connect data
AWKeys.dropSourceFromDataengine.connect(dropSource)
AWKeys.needToBeUpdated.connect(needUpdate)
}
onDropSource: {
if (debug) console.log("[main::onDropSource]")
if (debug) console.log("[main::onDropSource] : Source " + sourceName)
systemmonitorDE.disconnectSource(sourceName)
}
onNeedUpdate: {
if (debug) console.log("[main::onNeedUpdate]")
text.text = AWKeys.parsePattern()
tooltip.text = AWKeys.toolTipImage()
sizeUpdate()
}
onSizeUpdate: {
if (debug) console.log("[main::onSizeUpdate]")
if (plasmoid.configuration.height == 0) {
Layout.minimumHeight = text.contentHeight
Layout.maximumHeight = -1
} else {
Layout.minimumHeight = plasmoid.configuration.height
Layout.maximumHeight = plasmoid.configuration.height
}
if (plasmoid.configuration.width == 0) {
Layout.minimumWidth = text.contentWidth
Layout.maximumWidth = -1
} else {
Layout.minimumWidth = plasmoid.configuration.width
Layout.maximumWidth = plasmoid.configuration.width
}
}
Plasmoid.onUserConfiguringChanged: {
if (plasmoid.userConfiguring) return
if (debug) console.log("[main::onUserConfiguringChanged]")
// init submodule
AWKeys.initKeys(plasmoid.configuration.text)
AWKeys.initTooltip(tooltipSettings)
AWKeys.setPopupEnabled(plasmoid.configuration.notify)
AWKeys.setWrapNewLines(plasmoid.configuration.wrapNewLines)
needUpdate()
}
function action_checkUpdates() {
if (debug) console.log("[main::action_checkUpdates]")
AWActions.checkUpdates()
}
function action_showReadme() {
if (debug) console.log("[main::action_showReadme]")
AWActions.showReadme()
}
function action_report() {
if (debug) console.log("[main::action_report]")
AWActions.sendEmail()
}
function action_requestKey() {
if (debug) console.log("[main::action_requestKey]")
AWKeys.graphicalValueByKey()
}
}

View File

@ -0,0 +1 @@
singleton general general.qml

View File

@ -0,0 +1,513 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import QtQuick.Controls.Styles 1.3 as QtStyles
import QtQuick.Dialogs 1.1 as QtDialogs
import org.kde.plasma.awesomewidget 1.0
Item {
id: tooltipPage
width: childrenRect.width
height: childrenRect.height
implicitWidth: pageColumn.implicitWidth
implicitHeight: pageColumn.implicitHeight
property bool debug: AWKeys.isDebugEnabled()
property alias cfg_tooltipNumber: tooltipNumber.value
property alias cfg_useTooltipBackground: useTooltipBackground.checked
property alias cfg_tooltipBackground: tooltipBackground.text
property alias cfg_cpuTooltip: cpuTooltip.checked
property alias cfg_cpuTooltipColor: cpuTooltipColor.text
property alias cfg_cpuclTooltip: cpuclTooltip.checked
property alias cfg_cpuclTooltipColor: cpuclTooltipColor.text
property alias cfg_memTooltip: memTooltip.checked
property alias cfg_memTooltipColor: memTooltipColor.text
property alias cfg_swapTooltip: swapTooltip.checked
property alias cfg_swapTooltipColor: swapTooltipColor.text
property alias cfg_downTooltip: downTooltip.checked
property alias cfg_downTooltipColor: downTooltipColor.text
property alias cfg_upTooltipColor: upTooltipColor.text
property alias cfg_batTooltip: batTooltip.checked
property alias cfg_batTooltipColor: batTooltipColor.text
property alias cfg_batInTooltipColor: batInTooltipColor.text
Column {
id: pageColumn
anchors.fill: parent
QtControls.Label {
width: parent.width
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
text: i18n("CPU, CPU clock, memory, swap and network labels support graphical tooltip. To enable them just make needed checkbox fully checked.")
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Number of values for tooltips")
}
QtControls.SpinBox {
id: tooltipNumber
width: parent.width * 3 / 5
minimumValue: 50
maximumValue: 1000
stepSize: 25
value: plasmoid.configuration.tooltipNumber
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5 - useTooltipBackground.width
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Background")
}
QtControls.CheckBox {
id: useTooltipBackground
height: parent.height
width: implicitWidth
style: QtStyles.CheckBoxStyle {
indicator: Rectangle {
implicitWidth: 16
implicitHeight: 16
radius: 3
border.width: 1
border.color: control.activeFocus ? "darkblue" : "gray"
Rectangle {
visible: control.checked
radius: 1
anchors.fill: parent
anchors.margins: 4
color: "#555555"
border.color: "#333333"
}
}
}
}
QtControls.Button {
id: tooltipBackground
width: parent.width * 3 / 5
style: QtStyles.ButtonStyle {
background: Rectangle {
color: plasmoid.configuration.tooltipBackground
}
}
text: plasmoid.configuration.tooltipBackground
onClicked: tooltipBackgroundDialog.visible = true
}
QtDialogs.ColorDialog {
id: tooltipBackgroundDialog
title: i18n("Select a color")
color: tooltipBackground.text
onAccepted: tooltipBackground.text = tooltipBackgroundDialog.color
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5 - cpuTooltip.width
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("CPU color")
}
QtControls.CheckBox {
id: cpuTooltip
height: parent.height
width: implicitWidth
style: QtStyles.CheckBoxStyle {
indicator: Rectangle {
implicitWidth: 16
implicitHeight: 16
radius: 3
border.width: 1
border.color: control.activeFocus ? "darkblue" : "gray"
Rectangle {
visible: control.checked
radius: 1
anchors.fill: parent
anchors.margins: 4
color: "#555555"
border.color: "#333333"
}
}
}
}
QtControls.Button {
id: cpuTooltipColor
width: parent.width * 3 / 5
style: QtStyles.ButtonStyle {
background: Rectangle {
color: plasmoid.configuration.cpuTooltipColor
}
}
text: plasmoid.configuration.cpuTooltipColor
onClicked: cpuTooltipColorDialog.visible = true
}
QtDialogs.ColorDialog {
id: cpuTooltipColorDialog
title: i18n("Select a color")
color: cpuTooltipColor.text
onAccepted: cpuTooltipColor.text = cpuTooltipColorDialog.color
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5 - cpuclTooltip.width
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("CPU clock color")
}
QtControls.CheckBox {
id: cpuclTooltip
height: parent.height
width: implicitWidth
style: QtStyles.CheckBoxStyle {
indicator: Rectangle {
implicitWidth: 16
implicitHeight: 16
radius: 3
border.width: 1
border.color: control.activeFocus ? "darkblue" : "gray"
Rectangle {
visible: control.checked
radius: 1
anchors.fill: parent
anchors.margins: 4
color: "#555555"
border.color: "#333333"
}
}
}
}
QtControls.Button {
id: cpuclTooltipColor
width: parent.width * 3 / 5
style: QtStyles.ButtonStyle {
background: Rectangle {
color: plasmoid.configuration.cpuclTooltipColor
}
}
text: plasmoid.configuration.cpuclTooltipColor
onClicked: cpuclTooltipColorDialog.visible = true
}
QtDialogs.ColorDialog {
id: cpuclTooltipColorDialog
title: i18n("Select a color")
color: cpuclTooltipColor.text
onAccepted: cpuclTooltipColor.text = cpuclTooltipColorDialog.color
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5 - memTooltip.width
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Memory color")
}
QtControls.CheckBox {
id: memTooltip
height: parent.height
width: implicitWidth
style: QtStyles.CheckBoxStyle {
indicator: Rectangle {
implicitWidth: 16
implicitHeight: 16
radius: 3
border.width: 1
border.color: control.activeFocus ? "darkblue" : "gray"
Rectangle {
visible: control.checked
radius: 1
anchors.fill: parent
anchors.margins: 4
color: "#555555"
border.color: "#333333"
}
}
}
}
QtControls.Button {
id: memTooltipColor
width: parent.width * 3 / 5
style: QtStyles.ButtonStyle {
background: Rectangle {
color: plasmoid.configuration.memTooltipColor
}
}
text: plasmoid.configuration.memTooltipColor
onClicked: memTooltipColorDialog.visible = true
}
QtDialogs.ColorDialog {
id: memTooltipColorDialog
title: i18n("Select a color")
color: memTooltipColor.text
onAccepted: memTooltipColor.text = memTooltipColorDialog.color
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5 - swapTooltip.width
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Swap color")
}
QtControls.CheckBox {
id: swapTooltip
height: parent.height
width: implicitWidth
style: QtStyles.CheckBoxStyle {
indicator: Rectangle {
implicitWidth: 16
implicitHeight: 16
radius: 3
border.width: 1
border.color: control.activeFocus ? "darkblue" : "gray"
Rectangle {
visible: control.checked
radius: 1
anchors.fill: parent
anchors.margins: 4
color: "#555555"
border.color: "#333333"
}
}
}
}
QtControls.Button {
id: swapTooltipColor
width: parent.width * 3 / 5
style: QtStyles.ButtonStyle {
background: Rectangle {
color: plasmoid.configuration.swapTooltipColor
}
}
text: plasmoid.configuration.swapTooltipColor
onClicked: swapTooltipColorDialog.visible = true
}
QtDialogs.ColorDialog {
id: swapTooltipColorDialog
title: i18n("Select a color")
color: swapTooltipColor.text
onAccepted: swapTooltipColor.text = swapTooltipColorDialog.color
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5 - downTooltip.width
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Download speed color")
}
QtControls.CheckBox {
id: downTooltip
height: parent.height
width: implicitWidth
style: QtStyles.CheckBoxStyle {
indicator: Rectangle {
implicitWidth: 16
implicitHeight: 16
radius: 3
border.width: 1
border.color: control.activeFocus ? "darkblue" : "gray"
Rectangle {
visible: control.checked
radius: 1
anchors.fill: parent
anchors.margins: 4
color: "#555555"
border.color: "#333333"
}
}
}
}
QtControls.Button {
id: downTooltipColor
width: parent.width * 3 / 5
style: QtStyles.ButtonStyle {
background: Rectangle {
color: plasmoid.configuration.downTooltipColor
}
}
text: plasmoid.configuration.downTooltipColor
onClicked: downTooltipColorDialog.visible = true
}
QtDialogs.ColorDialog {
id: downTooltipColorDialog
title: i18n("Select a color")
color: downTooltipColor.text
onAccepted: downTooltipColor.text = downTooltipColorDialog.color
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Upload speed color")
}
QtControls.Button {
id: upTooltipColor
width: parent.width * 3 / 5
style: QtStyles.ButtonStyle {
background: Rectangle {
color: plasmoid.configuration.upTooltipColor
}
}
text: plasmoid.configuration.upTooltipColor
onClicked: upTooltipColorDialog.visible = true
}
QtDialogs.ColorDialog {
id: upTooltipColorDialog
title: i18n("Select a color")
color: upTooltipColor.text
onAccepted: upTooltipColor.text = upTooltipColorDialog.color
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5 - batTooltip.width
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Battery active color")
}
QtControls.CheckBox {
id: batTooltip
height: parent.height
width: implicitWidth
style: QtStyles.CheckBoxStyle {
indicator: Rectangle {
implicitWidth: 16
implicitHeight: 16
radius: 3
border.width: 1
border.color: control.activeFocus ? "darkblue" : "gray"
Rectangle {
visible: control.checked
radius: 1
anchors.fill: parent
anchors.margins: 4
color: "#555555"
border.color: "#333333"
}
}
}
}
QtControls.Button {
id: batTooltipColor
width: parent.width * 3 / 5
style: QtStyles.ButtonStyle {
background: Rectangle {
color: plasmoid.configuration.batTooltipColor
}
}
text: plasmoid.configuration.batTooltipColor
onClicked: batTooltipColorDialog.visible = true
}
QtDialogs.ColorDialog {
id: batTooltipColorDialog
title: i18n("Select a color")
color: batTooltipColor.text
onAccepted: batTooltipColor.text = batTooltipColorDialog.color
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Battery inactive color")
}
QtControls.Button {
id: batInTooltipColor
width: parent.width * 3 / 5
style: QtStyles.ButtonStyle {
background: Rectangle {
color: plasmoid.configuration.batInTooltipColor
}
}
text: plasmoid.configuration.batInTooltipColor
onClicked: batInTooltipColorDialog.visible = true
}
QtDialogs.ColorDialog {
id: batInTooltipColorDialog
title: i18n("Select a color")
color: batInTooltipColor.text
onAccepted: batInTooltipColor.text = batInTooltipColorDialog.color
}
}
}
Component.onCompleted: {
if (debug) console.log("[tooltip::onCompleted]")
}
}

View File

@ -0,0 +1,327 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.awesomewidget 1.0
Item {
id: widgetPage
width: childrenRect.width
height: childrenRect.height
implicitWidth: pageColumn.implicitWidth
implicitHeight: pageColumn.implicitHeight
property bool debug: AWKeys.isDebugEnabled()
property variant settings: {
"customTime": plasmoid.configuration.customTime,
"customUptime": plasmoid.configuration.customUptime,
"tempUnits": plasmoid.configuration.tempUnits,
"acOnline": plasmoid.configuration.acOnline,
"acOffline": plasmoid.configuration.acOffline
}
property variant tooltipSettings: {
"tooltipNumber": plasmoid.configuration.tooltipNumber,
"useTooltipBackground": plasmoid.configuration.useTooltipBackground,
"tooltipBackgroung": plasmoid.configuration.tooltipBackgroung,
"cpuTooltip": plasmoid.configuration.cpuTooltip,
"cpuclTooltip": plasmoid.configuration.cpuclTooltip,
"memTooltip": plasmoid.configuration.memTooltip,
"swapTooltip": plasmoid.configuration.swapTooltip,
"downTooltip": plasmoid.configuration.downTooltip,
"upTooltip": plasmoid.configuration.downTooltip,
"batTooltip": plasmoid.configuration.batTooltip,
"cpuTooltipColor": plasmoid.configuration.cpuTooltipColor,
"cpuclTooltipColor": plasmoid.configuration.cpuclTooltipColor,
"memTooltipColor": plasmoid.configuration.memTooltipColor,
"swapTooltipColor": plasmoid.configuration.swapTooltipColor,
"downTooltipColor": plasmoid.configuration.downTooltipColor,
"upTooltipColor": plasmoid.configuration.upTooltipColor,
"batTooltipColor": plasmoid.configuration.batTooltipColor,
"batInTooltipColor": plasmoid.configuration.batInTooltipColor
}
property alias cfg_text: textPattern.text
Column {
id: pageColumn
anchors.fill: parent
QtControls.Label {
width: parent.width
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
text: i18n("Detailed information may be found on <a href=\"http://arcanis.name/projects/awesome-widgets/\">project homepage</a>")
onLinkActivated: Qt.openUrlExternally(link);
}
Row {
height: implicitHeight
width: parent.width
QtControls.Button {
width: parent.width * 3 / 12
text: i18n("Font")
iconName: "font"
onClicked: {
if (debug) console.log("[widget::onClicked] : Font button")
var defaultFont = {
"color": plasmoid.configuration.fontColor,
"family": plasmoid.configuration.fontFamily,
"size": plasmoid.configuration.fontSize
}
var font = AWActions.getFont(defaultFont)
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, "<span style=\"color:" + font.color +
"; font-family:'" + font.family +
"'; font-size:" + font.size + "pt;\">" +
selected + "</span>")
}
}
QtControls.Button {
width: parent.width / 12
iconName: "format-indent-more"
onClicked: {
if (debug) console.log("[widget::onClicked] : Indent button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, selected + "<br>\n")
}
}
QtControls.Button {
width: parent.width / 12
iconName: "format-text-bold"
onClicked: {
if (debug) console.log("[widget::onClicked] : Bold button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, "<b>" + selected + "</b>")
}
}
QtControls.Button {
width: parent.width / 12
iconName: "format-text-italic"
onClicked: {
if (debug) console.log("[widget::onClicked] : Italic button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, "<i>" + selected + "</i>")
}
}
QtControls.Button {
width: parent.width / 12
iconName: "format-text-underline"
onClicked: {
if (debug) console.log("[widget::onClicked] : Underline button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, "<u>" + selected + "</u>")
}
}
QtControls.Button {
width: parent.width / 12
iconName: "format-text-strikethrough"
onClicked: {
if (debug) console.log("[widget::onClicked] : Strike button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, "<s>" + selected + "</s>")
}
}
QtControls.Button {
width: parent.width / 12
iconName: "format-justify-left"
onClicked: {
if (debug) console.log("[widget::onClicked] : Left button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, "<p align=\"left\">" + selected + "</p>")
}
}
QtControls.Button {
width: parent.width / 12
iconName: "format-justify-center"
onClicked: {
if (debug) console.log("[widget::onClicked] : Center button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, "<p align=\"center\">" + selected + "</p>")
}
}
QtControls.Button {
width: parent.width / 12
iconName: "format-justify-right"
onClicked: {
if (debug) console.log("[widget::onClicked] : Right button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, "<p align=\"right\">" + selected + "</p>")
}
}
QtControls.Button {
width: parent.width / 12
iconName: "format-justify-fill"
onClicked: {
if (debug) console.log("[widget::onClicked] : Justify button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, "<p align=\"justify\">" + selected + "</p>")
}
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.ComboBox {
id: tags
width: parent.width - addTagButton.width - showValueButton.width
}
QtControls.Button {
id: addTagButton
text: i18n("Add")
onClicked: {
if (debug) console.log("[widget::onClicked] : Add tag button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, selected + "$" + tags.currentText)
}
}
QtControls.Button {
id: showValueButton
text: i18n("Show value")
onClicked: {
if (debug) console.log("[widget::onClicked] : Show tag button")
var message = i18n("Tag: %1", tags.currentText)
message += "<br>"
message += i18n("Value: %1", AWKeys.valueByKey(tags.currentText))
message += "<br>"
message += i18n("Info: %1", AWKeys.infoByKey(tags.currentText))
AWActions.sendNotification("tag", message)
}
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Button {
width: parent.width
text: i18n("Edit bars")
onClicked: AWKeys.editItem("graphicalitem")
}
}
QtControls.TextArea {
id: textPattern
width: parent.width
height: parent.height * 4 / 5
textFormat: TextEdit.PlainText
text: plasmoid.configuration.text
}
}
// we need to initializate DataEngines here too
// because we need to get keys and values
PlasmaCore.DataSource {
id: systemmonitorDE
engine: "systemmonitor"
connectedSources: systemmonitorDE.sources
interval: 5000
onNewData: {
if (debug) console.log("[widget::onNewData] : Update source " + sourceName)
AWKeys.setDataBySource(sourceName, data, settings)
}
}
PlasmaCore.DataSource {
id: extsysmonDE
engine: "extsysmon"
connectedSources: extsysmonDE.sources
interval: 5000
onNewData: {
if (debug) console.log("[widget::onNewData] : Update source " + sourceName)
AWKeys.setDataBySource(sourceName, data, settings)
}
}
PlasmaCore.DataSource {
id: timeDE
engine: "time"
connectedSources: ["Local"]
interval: 5000
onNewData: {
if (debug) console.log("[widget::onNewData] : Update source " + sourceName)
AWKeys.setDataBySource(sourceName, data, settings)
}
}
Component.onCompleted: {
if (debug) console.log("[widget::onCompleted]")
// init submodule
AWKeys.initKeys(plasmoid.configuration.text)
tags.model = AWKeys.dictKeys(true)
}
}

View File

@ -0,0 +1,28 @@
[Desktop Entry]
Encoding=UTF-8
Name=Awesome Widget
Comment=A minimalistic Plasmoid
Comment[en]=A minimalistic Plasmoid
Comment[es]=Un plasmoide minimalista
Comment[es]=Un script Plasmoïde minimaliste
Comment[pt_BR]=Um script Plasmoid
Comment[ru]=Минималистичный плазмоид
Comment[uk]=Мінімалістичний плазмоїд
X-KDE-ServiceTypes=Plasma/Applet
Type=Service
Icon=utilities-system-monitor
X-KDE-ServiceTypes=Plasma/Applet
X-Plasma-API=declarativeappletscript
X-Plasma-MainScript=ui/main.qml
X-Plasma-RemoteLocation=
X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis
X-KDE-PluginInfo-Email=esalexeev@gmail.com
X-KDE-PluginInfo-Name=org.kde.plasma.awesomewidget
X-KDE-PluginInfo-Version=2.3.2
X-KDE-PluginInfo-Website=http://arcanis.name/projects/awesome-widgets/
X-KDE-PluginInfo-Category=System Information
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPLv3
X-KDE-PluginInfo-EnabledByDefault=true

View File

@ -1,9 +0,0 @@
[Global]
IconName=system
Name=Awesome Widget
Comment=Awesome widget information
[Event/system]
Name=System information
Comment=System information
Action=Popup

View File

@ -0,0 +1,38 @@
set (PLUGIN_NAME awplugin)
add_definitions(-DTRANSLATION_DOMAIN=\"plasma_applet_org.kde.plasma.awesomewidget\")
add_definitions (${Qt5Core_DEFINITIONS} ${Qt5Network_DEFINITIONS})
set (Qt_INCLUDE ${Qt5Core_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5Qml_INCLUDE_DIRS})
set (Qt_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Qml_LIBRARIES})
set (Kf5_INCLUDE ${I18n_INCLUDE_DIR}
${Notifications_INCLUDE_DIR})
set (Kf5_LIBRARIES KF5::I18n
KF5::Notifications)
include_directories (${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../
${PROJECT_TRDPARTY_DIR}
../../extsysmon
${CMAKE_CURRENT_BINARY_DIR}/../../extsysmon
${Qt_INCLUDE}
${Kf5_INCLUDE})
# task source is required by extscripts
file (GLOB_RECURSE SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/fontdialog/*.cpp
../../extsysmon/extquotes.cpp
../../extsysmon/extscript.cpp
../../extsysmon/extupgrade.cpp)
file (GLOB SUBPROJECT_UI *.ui)
file (GLOB SUBPROJECT_NOTIFY *.notifyrc)
set (SUBPROJECT_DESKTOP ${CMAKE_CURRENT_SOURCE_DIR}/desktops)
qt5_wrap_ui (SUBPROJECT_UI_HEADER ${SUBPROJECT_UI})
add_library (${PLUGIN_NAME} SHARED ${SUBPROJECT_SOURCE} ${SUBPROJECT_UI_HEADER})
target_link_libraries (${PLUGIN_NAME} ${Qt_LIBRARIES} ${Kf5_LIBRARIES})
install (TARGETS ${PLUGIN_NAME} DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/awesomewidget)
install (FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/awesomewidget)
install (FILES ${SUBPROJECT_NOTIFY} DESTINATION ${KNOTIFYRC_INSTALL_DIR})
install (DIRECTORY ${SUBPROJECT_DESKTOP} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})

View File

@ -0,0 +1,253 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "awactions.h"
#include <KI18n/KLocalizedString>
#include <KNotifications/KNotification>
#include <QDebug>
#include <QDesktopServices>
#include <QDir>
#include <QMessageBox>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QProcess>
#include <QProcessEnvironment>
#include <QSettings>
#include <QStandardPaths>
#include <fontdialog/fontdialog.h>
#include <pdebug/pdebug.h>
#include "extscript.h"
#include "graphicalitem.h"
#include "version.h"
AWActions::AWActions(QObject *parent)
: QObject(parent)
{
// debug
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
debug = (debugEnv == QString("yes"));
}
AWActions::~AWActions()
{
if (debug) qDebug() << PDEBUG;
}
void AWActions::checkUpdates()
{
if (debug) qDebug() << PDEBUG;
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(versionReplyRecieved(QNetworkReply *)));
manager->get(QNetworkRequest(QUrl(VERSION_API)));
}
void AWActions::runCmd(const QString cmd)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Cmd" << cmd;
QProcess command;
sendNotification(QString("Info"), i18n("Run %1", cmd));
command.startDetached(cmd);
}
void AWActions::sendEmail()
{
if (debug) qDebug() << PDEBUG;
}
void AWActions::showReadme()
{
if (debug) qDebug() << PDEBUG;
QDesktopServices::openUrl(QString(HOMEPAGE));
}
QString AWActions::getAboutText(const QString type)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Type" << type;
QString text;
if (type == QString("header"))
text = QString(NAME);
else if (type == QString("version"))
text = i18n("Version %1 (build date %2)", QString(VERSION), QString(BUILD_DATE));
else if (type == QString("description"))
text = i18n("A set of minimalistic plasmoid widgets");
else if (type == QString("links"))
text = i18n("Links:") + QString("<br>") +
QString("<a href=\"%1\">%2</a><br>").arg(QString(HOMEPAGE)).arg(i18n("Homepage")) +
QString("<a href=\"%1\">%2</a><br>").arg(QString(REPOSITORY)).arg(i18n("Repository")) +
QString("<a href=\"%1\">%2</a><br>").arg(QString(BUGTRACKER)).arg(i18n("Bugtracker")) +
QString("<a href=\"%1\">%2</a><br>").arg(QString(TRANSLATION)).arg(i18n("Translation issue")) +
QString("<a href=\"%1\">%2</a><br>").arg(QString(AUR_PACKAGES)).arg(i18n("AUR packages")) +
QString("<a href=\"%1\">%2</a>").arg(QString(OPENSUSE_PACKAGES)).arg(i18n("openSUSE packages"));
else if (type == QString("copy"))
text = QString("<small>&copy; %1 <a href=\"mailto:%2\">%3</a><br>").arg(QString(DATE)).arg(QString(EMAIL)).arg(QString(AUTHOR)) +
i18n("This software is licensed under %1", QString(LICENSE)) + QString("</small>");
else if (type == QString("translators"))
text = i18n("Translators: %1", QString(TRANSLATORS));
else if (type == QString("3rdparty")) {
QStringList trdPartyList = QString(TRDPARTY_LICENSE).split(QChar(';'), QString::SkipEmptyParts);
for (int i=0; i<trdPartyList.count(); i++)
trdPartyList[i] = QString("<a href=\"%3\">%1</a> (%2 license)")
.arg(trdPartyList[i].split(QChar(','))[0])
.arg(trdPartyList[i].split(QChar(','))[1])
.arg(trdPartyList[i].split(QChar(','))[2]);
text = i18n("This software uses: %1", trdPartyList.join(QString(", ")));
}
return text;
}
QVariantMap AWActions::getFont(const QVariantMap defaultFont)
{
if (debug) qDebug() << PDEBUG;
QVariantMap fontMap;
CFont defaultCFont = CFont(defaultFont[QString("family")].toString(),
defaultFont[QString("size")].toInt(),
400, false, defaultFont[QString("color")].toString());
CFont font = CFontDialog::getFont(i18n("Select font"), defaultCFont,
false, false);
fontMap[QString("color")] = font.color().name();
fontMap[QString("family")] = font.family();
fontMap[QString("size")] = font.pointSize();
return fontMap;
}
QVariantMap AWActions::readDataEngineConfiguration()
{
if (debug) qDebug() << PDEBUG;
QString fileName = QStandardPaths::locate(QStandardPaths::ConfigLocation, QString("plasma-dataengine-extsysmon.conf"));
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << fileName;
QSettings settings(fileName, QSettings::IniFormat);
QVariantMap configuration;
settings.beginGroup(QString("Configuration"));
configuration[QString("ACPIPATH")] = settings.value(QString("ACPIPATH"), QString("/sys/class/power_supply/"));
configuration[QString("GPUDEV")] = settings.value(QString("GPUDEV"), QString("auto"));
configuration[QString("HDDDEV")] = settings.value(QString("HDDDEV"), QString("all"));
configuration[QString("HDDTEMPCMD")] = settings.value(QString("HDDTEMPCMD"), QString("sudo smartctl -a"));
configuration[QString("MPDADDRESS")] = settings.value(QString("MPDADDRESS"), QString("localhost"));
configuration[QString("MPDPORT")] = settings.value(QString("MPDPORT"), QString("6600"));
configuration[QString("MPRIS")] = settings.value(QString("MPRIS"), QString("auto"));
configuration[QString("PLAYER")] = settings.value(QString("PLAYER"), QString("mpris"));
settings.endGroup();
return configuration;
}
void AWActions::writeDataEngineConfiguration(const QVariantMap configuration)
{
if (debug) qDebug() << PDEBUG;
QString fileName = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QString("/plasma-dataengine-extsysmon.conf");
QSettings settings(fileName, QSettings::IniFormat);
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << settings.fileName();
settings.beginGroup(QString("Configuration"));
settings.setValue(QString("ACPIPATH"), configuration[QString("ACPIPATH")]);
settings.setValue(QString("GPUDEV"), configuration[QString("GPUDEV")]);
settings.setValue(QString("HDDDEV"), configuration[QString("HDDDEV")]);
settings.setValue(QString("HDDTEMPCMD"), configuration[QString("HDDTEMPCMD")]);
settings.setValue(QString("MPDADDRESS"), configuration[QString("MPDADDRESS")]);
settings.setValue(QString("MPDPORT"), configuration[QString("MPDPORT")]);
settings.setValue(QString("MPRIS"), configuration[QString("MPRIS")]);
settings.setValue(QString("PLAYER"), configuration[QString("PLAYER")]);
settings.endGroup();
settings.sync();
}
void AWActions::sendNotification(const QString eventId, const QString message, const bool enablePopup)
{
if ((eventId == QString("event")) && (!enablePopup)) return;
KNotification *notification = KNotification::event(eventId, QString("Awesome Widget ::: %1").arg(eventId), message);
notification->setComponentName(QString("plasma-applet-org.kde.plasma.awesome-widget"));
}
void AWActions::showUpdates(QString version)
{
if (debug) qDebug() << PDEBUG;
QString text;
text += i18n("Current version : %1", QString(VERSION)) + QString("\n");
text += i18n("New version : %1", version) + QString("\n\n");
text += i18n("Click \"Ok\" to download");
int select = QMessageBox::information(0, i18n("There are updates"), text, QMessageBox::Ok | QMessageBox::Cancel);
switch (select) {
case QMessageBox::Ok:
QDesktopServices::openUrl(QString(RELEASES) + version);
break;
}
}
void AWActions::versionReplyRecieved(QNetworkReply *reply)
{
if (debug) qDebug() << PDEBUG;
QString answer = reply->readAll();
if (!answer.contains(QString("tag_name"))) return;
QString version = QString(VERSION);
if (debug) qDebug() << PDEBUG << answer;
for (int i=0; i<answer.split(QString("tag_name")).count(); i++) {
version = answer.split(QString("tag_name"))[1].split(QChar(','))[0];
version.remove(QChar('"'));
version.remove(QChar(':'));
version.remove(QString("V."));
break;
}
int old_major = QString(VERSION).split(QChar('.'))[0].toInt();
int old_minor = QString(VERSION).split(QChar('.'))[1].toInt();
int old_patch = QString(VERSION).split(QChar('.'))[2].toInt();
int new_major = QString(version).split(QChar('.'))[0].toInt();
int new_minor = QString(version).split(QChar('.'))[1].toInt();
int new_patch = QString(version).split(QChar('.'))[2].toInt();
if ((old_major < new_major) ||
((old_major == new_major) && (old_minor < new_minor)) ||
((old_major == new_major) && (old_minor == new_minor) && (old_patch < new_patch)))
showUpdates(version);
}

View File

@ -0,0 +1,62 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef AWACTIONS_H
#define AWACTIONS_H
#include <QMap>
#include <QObject>
#include <QVariant>
class QNetworkReply;
class AWActions : public QObject
{
Q_OBJECT
public:
AWActions(QObject *parent = nullptr);
~AWActions();
Q_INVOKABLE void checkUpdates();
Q_INVOKABLE void runCmd(const QString cmd = QString("/usr/bin/true"));
Q_INVOKABLE void sendEmail();
Q_INVOKABLE void showReadme();
// configuration slots
Q_INVOKABLE QString getAboutText(const QString type = QString("header"));
Q_INVOKABLE QVariantMap getFont(const QVariantMap defaultFont);
// dataengine
Q_INVOKABLE QVariantMap readDataEngineConfiguration();
Q_INVOKABLE void writeDataEngineConfiguration(const QVariantMap configuration);
public slots:
Q_INVOKABLE static void sendNotification(const QString eventId, const QString message,
const bool enablePopup = false);
private slots:
void showUpdates(QString version);
void versionReplyRecieved(QNetworkReply *reply);
private:
// variables
bool debug = false;
};
#endif /* AWACTIONS_H */

View File

@ -0,0 +1,50 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "awesomewidget.h"
#include <QtQml>
#include "awactions.h"
#include "awkeys.h"
static QObject *awactions_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine);
Q_UNUSED(scriptEngine);
return new AWActions();
}
static QObject *awkeys_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine);
Q_UNUSED(scriptEngine);
return new AWKeys();
}
void AWPlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.plasma.awesomewidget"));
qmlRegisterSingletonType<AWActions>(uri, 1, 0, "AWActions", awactions_singletontype_provider);
qmlRegisterSingletonType<AWKeys>(uri, 1, 0, "AWKeys", awkeys_singletontype_provider);
}

View File

@ -15,31 +15,21 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef CUSTOMLABEL_H
#define CUSTOMLABEL_H
#include <QLabel>
#ifndef AWPLUGIN_H
#define AWPLUGIN_H
#include <QQmlExtensionPlugin>
class AwesomeWidget;
class CustomLabel : public QLabel
class AWPlugin : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
public:
CustomLabel(AwesomeWidget *wid, const bool debugCmd = false);
~CustomLabel();
void setPopupEnabled(const bool state);
protected:
void mousePressEvent(QMouseEvent *event);
private:
AwesomeWidget *widget;
bool debug;
bool enablePopup;
void registerTypes(const char *uri);
};
#endif /* CUSTOMLABEL_H */
#endif /* AWPLUGIN_H */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,130 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef AWKEYS_H
#define AWKEYS_H
#include <QDialog>
#include <QDialogButtonBox>
#include <QListWidget>
#include <QMap>
#include <QObject>
#include <QStringList>
#include <QPushButton>
#include <QVariant>
class AWToolTip;
class ExtQuotes;
class ExtScript;
class ExtUpgrade;
class GraphicalItem;
class AWKeys : public QObject
{
Q_OBJECT
enum RequestedItem {
Nothing,
RequestedGraphicalItem,
RequestedExtQuotes,
RequestedExtScript,
RequestedExtUpgrade
};
public:
AWKeys(QObject *parent = nullptr);
~AWKeys();
Q_INVOKABLE void initKeys(const QString currentPattern);
Q_INVOKABLE void initTooltip(const QVariantMap tooltipParams);
Q_INVOKABLE void setPopupEnabled(const bool popup = false);
Q_INVOKABLE void setWrapNewLines(const bool wrap = false);
Q_INVOKABLE bool isDebugEnabled();
Q_INVOKABLE QString parsePattern();
Q_INVOKABLE QString toolTipImage();
Q_INVOKABLE QSize toolTipSize();
// keys
Q_INVOKABLE void addDevice(const QString source);
Q_INVOKABLE QStringList dictKeys(const bool sorted = false);
Q_INVOKABLE QStringList getHddDevices();
Q_INVOKABLE void setDataBySource(const QString sourceName, const QVariantMap data,
const QVariantMap params);
// values
Q_INVOKABLE void graphicalValueByKey();
Q_INVOKABLE QString infoByKey(QString key);
Q_INVOKABLE QString valueByKey(QString key);
// configuration
Q_INVOKABLE void editItem(const QString type);
signals:
void dropSourceFromDataengine(const QString source);
void needToBeUpdated();
private slots:
void loadKeysFromCache();
void reinitKeys();
// editor
void editItemButtonPressed(QAbstractButton *button);
void copyBar(const QString original);
void copyQuotes(const QString original);
void copyScript(const QString original);
void copyUpgrade(const QString original);
private:
// methods
void addKeyToCache(const QString type, const QString key = QString(""));
bool checkKeys(const QVariantMap data);
QString htmlValue(QString key);
int numberCpus();
float temperature(const float temp, const QString units);
// find methods
QStringList findGraphicalItems();
QStringList findKeys();
// get methods
QList<ExtQuotes *> getExtQuotes();
QList<ExtScript *> getExtScripts();
QList<ExtUpgrade *> getExtUpgrade();
QList<GraphicalItem *> getGraphicalItems();
GraphicalItem *getItemByTag(const QString tag);
QStringList getTimeKeys();
AWToolTip *toolTip = nullptr;
// graphical elements
QDialog *dialog = nullptr;
QListWidget *widgetDialog = nullptr;
QDialogButtonBox *dialogButtons = nullptr;
QPushButton *copyButton = nullptr;
QPushButton *createButton = nullptr;
QPushButton *deleteButton = nullptr;
RequestedItem requestedItem = Nothing;
// variables
bool debug = false;
bool enablePopup = false;
bool wrapNewLines = false;
QList<GraphicalItem *> graphicalItems;
QList<ExtQuotes *> extQuotes;
QList<ExtScript *> extScripts;
QList<ExtUpgrade *> extUpgrade;
QStringList foundBars, foundKeys, keys;
QString pattern;
QMap<QString, QString> values;
QStringList diskDevices, hddDevices, mountDevices, networkDevices, tempDevices;
};
#endif /* AWKEYS_H */

View File

@ -0,0 +1,154 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "awtooltip.h"
#include <QDebug>
#include <QProcessEnvironment>
#include <math.h>
#include <pdebug/pdebug.h>
AWToolTip::AWToolTip(QObject *parent, QVariantMap settings)
: QObject(parent),
configuration(settings)
{
// debug
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
debug = (debugEnv == QString("yes"));
toolTipScene = new QGraphicsScene();
toolTipView = new QGraphicsView(toolTipScene);
toolTipView->setStyleSheet(QString("background: transparent"));
toolTipView->setContentsMargins(0, 0, 0, 0);
toolTipView->setFrameShape(QFrame::NoFrame);
toolTipView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
toolTipView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
counts += configuration[QString("cpuTooltip")].toInt();
counts += configuration[QString("cpuclTooltip")].toInt();
counts += configuration[QString("memTooltip")].toInt();
counts += configuration[QString("swapTooltip")].toInt();
counts += configuration[QString("downTooltip")].toInt();
counts += configuration[QString("batTooltip")].toInt();
boundaries[QString("cpuTooltip")] = 100.0;
boundaries[QString("cpuclTooltip")] = 4000.0;
boundaries[QString("memTooltip")] = 100.0;
boundaries[QString("swapTooltip")] = 100.0;
boundaries[QString("downTooltip")] = 1.0;
boundaries[QString("upTooltip")] = 1.0;
boundaries[QString("batTooltip")] = 100.0;
size.setHeight(105.0);
size.setWidth(100.0 * counts);
if (configuration[QString("cpuTooltip")].toBool()) requiredKeys.append(QString("cpuTooltip"));
if (configuration[QString("cpuclTooltip")].toBool()) requiredKeys.append(QString("cpuclTooltip"));
if (configuration[QString("memTooltip")].toBool()) requiredKeys.append(QString("memTooltip"));
if (configuration[QString("swapTooltip")].toBool()) requiredKeys.append(QString("swapTooltip"));
if (configuration[QString("downTooltip")].toBool()) requiredKeys.append(QString("downTooltip"));
if (configuration[QString("upTooltip")].toBool()) requiredKeys.append(QString("upTooltip"));
if (configuration[QString("batTooltip")].toBool()) requiredKeys.append(QString("batTooltip"));
}
AWToolTip::~AWToolTip()
{
if (debug) qDebug() << PDEBUG;
delete toolTipView;
delete toolTipScene;
}
QSize AWToolTip::getSize()
{
if (debug) qDebug() << PDEBUG;
return size;
}
QPixmap AWToolTip::image()
{
if (debug) qDebug() << PDEBUG;
toolTipView->resize(size);
// create image
toolTipScene->clear();
QPen pen = QPen();
// background
if (configuration[QString("useTooltipBackground")].toBool())
toolTipScene->setBackgroundBrush(QBrush(QColor(configuration[QString("tooltipBackground")].toString())));
else
toolTipScene->setBackgroundBrush(QBrush(Qt::NoBrush));
bool down = false;
for (int i=0; i<requiredKeys.count(); i++) {
float normX = 100.0 / static_cast<float>(data[requiredKeys[i]].count());
float normY = 100.0 / (1.5 * boundaries[requiredKeys[i]]);
if (requiredKeys[i] != QString("batTooltip"))
pen.setColor(QColor(configuration[QString("%1Color").arg(requiredKeys[i])].toString()));
float shift = i * 100.0;
if (down) shift -= 100.0;
for (int j=0; j<data[requiredKeys[i]].count()-1; j++) {
float x1 = j * normX + shift;
float y1 = - fabs(data[requiredKeys[i]][j]) * normY + 5.0;
float x2 = (j + 1) * normX + shift;
float y2 = - fabs(data[requiredKeys[i]][j+1]) * normY + 5.0;
if (requiredKeys[i] == QString("batTooltip")) {
if (data[requiredKeys[i]][j+1] > 0)
pen.setColor(QColor(configuration[QString("batTooltipColor")].toString()));
else
pen.setColor(QColor(configuration[QString("batInTooltipColor")].toString()));
}
toolTipScene->addLine(x1, y1, x2, y2, pen);
}
if (requiredKeys[i] == QString("downTooltip")) down = true;
}
return toolTipView->grab();
}
void AWToolTip::setData(const QString source, float value, const bool ac)
{
if (debug) qDebug() << PDEBUG;
if (data[source].count() == 0)
data[source].append(0.0);
else if (data[source].count() > configuration[QString("tooltipNumber")].toInt())
data[source].takeFirst();
if (isnan(value)) value = 0.0;
if (ac)
data[source].append(value);
else
data[source].append(-value);
if ((source == QString("downTooltip")) || (source == QString("upTooltip"))) {
for (int i=0; i<data[QString("downTooltip")].count(); i++)
if (boundaries[QString("downTooltip")] < data[QString("downTooltip")][i])
boundaries[QString("downTooltip")] = data[QString("downTooltip")][i];
for (int i=0; i<data[QString("upTooltip")].count(); i++)
if (boundaries[QString("downTooltip")] < data[QString("upTooltip")][i])
boundaries[QString("downTooltip")] = data[QString("upTooltip")][i];
boundaries[QString("downTooltip")] *= 1.2;
boundaries[QString("upTooltip")] = boundaries[QString("downTooltip")];
}
}

View File

@ -0,0 +1,58 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef AWTOOLTIP_H
#define AWTOOLTIP_H
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QMap>
#include <QObject>
#include <QPixmap>
#include <QVariant>
class AWToolTip : public QObject
{
Q_OBJECT
public:
AWToolTip(QObject *parent = nullptr, QVariantMap settings = QVariantMap());
~AWToolTip();
QSize getSize();
QPixmap image();
void setData(const QString source, float value,
const bool ac = true);
private:
// ui
QGraphicsScene *toolTipScene = nullptr;
QGraphicsView *toolTipView = nullptr;
// variables
bool debug = false;
int counts = 0;
QVariantMap configuration;
QMap<QString, float> boundaries;
QMap<QString, QList<float>> data;
QStringList requiredKeys;
QSize size;
};
#endif /* AWTOOLTIP_H */

View File

@ -0,0 +1,12 @@
[Desktop Entry]
Encoding=UTF-8
Name=bar3
Comment=Simple bat bar
X-AW-Value=bat
X-AW-ActiveColor="0,0,0,255"
X-AW-InactiveColor="255,255,255,255"
X-AW-Type=Horizontal
X-AW-Direction=LeftToRight
X-AW-Height=25
X-AW-Width=100
X-AW-ApiVersion=1

View File

@ -0,0 +1,12 @@
[Desktop Entry]
Encoding=UTF-8
Name=bar0
Comment=Simple cpu bar
X-AW-Value=cpu
X-AW-ActiveColor="0,0,0,255"
X-AW-InactiveColor="255,255,255,255"
X-AW-Type=Horizontal
X-AW-Direction=LeftToRight
X-AW-Height=25
X-AW-Width=100
X-AW-ApiVersion=1

View File

@ -0,0 +1,12 @@
[Desktop Entry]
Encoding=UTF-8
Name=bar1
Comment=Simple mem bar
X-AW-Value=mem
X-AW-ActiveColor="0,0,0,255"
X-AW-InactiveColor="255,255,255,255"
X-AW-Type=Horizontal
X-AW-Direction=LeftToRight
X-AW-Height=25
X-AW-Width=100
X-AW-ApiVersion=1

View File

@ -0,0 +1,12 @@
[Desktop Entry]
Encoding=UTF-8
Name=bar2
Comment=Simple swap bar
X-AW-Value=swap
X-AW-ActiveColor="0,0,0,255"
X-AW-InactiveColor="255,255,255,255"
X-AW-Type=Horizontal
X-AW-Direction=LeftToRight
X-AW-Height=25
X-AW-Width=100
X-AW-ApiVersion=1

View File

@ -0,0 +1,525 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "graphicalitem.h"
#include "ui_graphicalitem.h"
#include <KI18n/KLocalizedString>
#include <QBuffer>
#include <QColorDialog>
#include <QDebug>
#include <QDir>
#include <QGraphicsEllipseItem>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QSettings>
#include <pdebug/pdebug.h>
#include "version.h"
GraphicalItem::GraphicalItem(QWidget *parent, const QString desktopName, const QStringList directories, const bool debugCmd)
: QDialog(parent),
m_fileName(desktopName),
m_dirs(directories),
debug(debugCmd),
ui(new Ui::GraphicalItem)
{
readConfiguration();
ui->setupUi(this);
connect(ui->pushButton_activeColor, SIGNAL(clicked()), this, SLOT(changeColor()));
connect(ui->pushButton_inactiveColor, SIGNAL(clicked()), this, SLOT(changeColor()));
}
GraphicalItem::~GraphicalItem()
{
if (debug) qDebug() << PDEBUG;
delete ui;
}
QString GraphicalItem::image(const float value)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Value" << value;
if (m_bar == QString("none")) return QString("");
QColor active = stringToColor(m_activeColor);
QColor inactive = stringToColor(m_inactiveColor);
float percent = value / 100.0;
int scale[2] = {1, 1};
QPen pen = QPen();
QGraphicsScene *scene = new QGraphicsScene();
scene->setBackgroundBrush(QBrush(Qt::NoBrush));
QGraphicsView *view = new QGraphicsView(scene);
view->setStyleSheet(QString("background: transparent"));
view->setContentsMargins(0, 0, 0, 0);
view->setFrameShape(QFrame::NoFrame);
view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
view->resize(m_width + 5.0, m_height + 5.0);
// paint
switch (m_type) {
case Vertical:
pen.setWidth(m_width);
// inactive
pen.setColor(inactive);
scene->addLine(0.5 * m_width, -0.5 * m_width, 0.5 * m_width,
(1.0 - percent) * m_height - 0.5 * m_width, pen);
// active
pen.setColor(active);
scene->addLine(0.5 * m_width, (1.0 - percent) * m_height + 0.5 * m_width,
0.5 * m_width, m_height + 0.5 * m_width, pen);
// scale
scale[1] = -2 * static_cast<int>(m_direction) + 1;
break;
case Circle:
QGraphicsEllipseItem *circle;
pen.setWidth(1.0);
// inactive
pen.setColor(inactive);
circle = scene->addEllipse(0.0, 0.0, m_width, m_height, pen, QBrush(inactive, Qt::SolidPattern));
circle->setSpanAngle(- (1.0 - percent) * 360.0 * 16.0);
circle->setStartAngle(90.0 * 16.0 - percent * 360.0 * 16.0);
// active
pen.setColor(active);
circle = scene->addEllipse(0.0, 0.0, m_width, m_height, pen, QBrush(active, Qt::SolidPattern));
circle->setSpanAngle(- percent * 360.0 * 16.0);
circle->setStartAngle(90.0 * 16.0);
// scale
scale[0] = -2 * static_cast<int>(m_direction) + 1;
break;
default:
pen.setWidth(m_height);
// inactive
pen.setColor(inactive);
scene->addLine(percent * m_width + 0.5 * m_height, 0.5 * m_height,
m_width + 0.5 * m_height, 0.5 * m_height, pen);
// active
pen.setColor(active);
scene->addLine(-0.5 * m_height, 0.5 * m_height,
percent * m_width - 0.5 * m_height, 0.5 * m_height, pen);
// scale
scale[0] = -2 * static_cast<int>(m_direction) + 1;
break;
}
// convert
QPixmap pixmap = view->grab().transformed(QTransform().scale(scale[0], scale[1]));
QByteArray byteArray;
QBuffer buffer(&byteArray);
pixmap.save(&buffer, "PNG");
QString url = QString("<img src=\"data:image/png;base64,%1\"/>").arg(QString(byteArray.toBase64()));
delete view;
delete scene;
return url;
}
QString GraphicalItem::fileName()
{
if (debug) qDebug() << PDEBUG;
return m_fileName;
}
int GraphicalItem::apiVersion()
{
if (debug) qDebug() << PDEBUG;
return m_apiVersion;
}
QString GraphicalItem::name()
{
if (debug) qDebug() << PDEBUG;
return m_name;
}
QString GraphicalItem::comment()
{
if (debug) qDebug() << PDEBUG;
return m_comment;
}
QString GraphicalItem::bar()
{
if (debug) qDebug() << PDEBUG;
return m_bar;
}
QString GraphicalItem::activeColor()
{
if (debug) qDebug() << PDEBUG;
return m_activeColor;
}
QString GraphicalItem::inactiveColor()
{
if (debug) qDebug() << PDEBUG;
return m_inactiveColor;
}
GraphicalItem::Type GraphicalItem::type()
{
if (debug) qDebug() << PDEBUG;
return m_type;
}
QString GraphicalItem::strType()
{
if (debug) qDebug() << PDEBUG;
QString value;
switch (m_type) {
case Vertical:
value = QString("Vertical");
break;
case Circle:
value = QString("Circle");
break;
default:
value = QString("Horizontal");
break;
}\
return value;
}
GraphicalItem::Direction GraphicalItem::direction()
{
if (debug) qDebug() << PDEBUG;
return m_direction;
}
QString GraphicalItem::strDirection()
{
if (debug) qDebug() << PDEBUG;
QString value;
switch (m_direction) {
case RightToLeft:
value = QString("RightToLeft");
break;
default:
value = QString("LeftToRight");
break;
}
return value;
}
int GraphicalItem::height()
{
if (debug) qDebug() << PDEBUG;
return m_height;
}
int GraphicalItem::width()
{
if (debug) qDebug() << PDEBUG;
return m_width;
}
void GraphicalItem::setApiVersion(const int _apiVersion)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Version" << _apiVersion;
m_apiVersion = _apiVersion;
}
void GraphicalItem::setName(const QString _name)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Name" << _name;
m_name = _name;
}
void GraphicalItem::setComment(const QString _comment)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Comment" << _comment;
m_comment = _comment;
}
void GraphicalItem::setBar(const QString _bar)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Bar" << _bar;
if ((!_bar.contains(QRegExp(QString("cpu(?!cl).*")))) &&
(!_bar.contains(QRegExp(QString("gpu")))) &&
(!_bar.contains(QRegExp(QString("mem")))) &&
(!_bar.contains(QRegExp(QString("swap")))) &&
(!_bar.contains(QRegExp(QString("hdd[0-9].*")))) &&
(!_bar.contains(QRegExp(QString("bat.*")))))
m_bar = QString("none");
else
m_bar = _bar;
}
void GraphicalItem::setActiveColor(const QString _color)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Color" << _color;
m_activeColor = _color;
}
void GraphicalItem::setInactiveColor(const QString _color)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Color" << _color;
m_inactiveColor = _color;
}
void GraphicalItem::setType(const Type _type)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Type" << _type;
m_type = _type;
}
void GraphicalItem::setStrType(const QString _type)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Type" << _type;
if (_type == QString("Vertical"))
setType(Vertical);
else if (_type == QString("Circle"))
setType(Circle);
else
setType(Horizontal);
}
void GraphicalItem::setDirection(const Direction _direction)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Direction" << _direction;
m_direction = _direction;
}
void GraphicalItem::setStrDirection(const QString _direction)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Direction" << _direction;
if (_direction == QString("RightToLeft"))
setDirection(RightToLeft);
else
setDirection(LeftToRight);
}
void GraphicalItem::setHeight(const int _height)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Height" << _height;
if (_height <= 0) return;
m_height = _height;
}
void GraphicalItem::setWidth(const int _width)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Width" << _width;
if (_width <= 0) return;
m_width = _width;
}
void GraphicalItem::readConfiguration()
{
if (debug) qDebug() << PDEBUG;
for (int i=m_dirs.count()-1; i>=0; i--) {
if (!QDir(m_dirs[i]).entryList(QDir::Files).contains(m_fileName)) continue;
QSettings settings(QString("%1/%2").arg(m_dirs[i]).arg(m_fileName), QSettings::IniFormat);
settings.beginGroup(QString("Desktop Entry"));
setName(settings.value(QString("Name"), m_name).toString());
setComment(settings.value(QString("Comment"), m_comment).toString());
setApiVersion(settings.value(QString("X-AW-ApiVersion"), AWGIAPI).toInt());
setBar(settings.value(QString("X-AW-Value"), m_bar).toString());
setActiveColor(settings.value(QString("X-AW-ActiveColor"), m_activeColor).toString());
setInactiveColor(settings.value(QString("X-AW-InactiveColor"), m_inactiveColor).toString());
setStrType(settings.value(QString("X-AW-Type"), strType()).toString());
setStrDirection(settings.value(QString("X-AW-Direction"), strDirection()).toString());
setHeight(settings.value(QString("X-AW-Height"), m_height).toInt());
setWidth(settings.value(QString("X-AW-Width"), m_width).toInt());
settings.endGroup();
}
}
int GraphicalItem::showConfiguration(const QStringList tags)
{
if (debug) qDebug() << PDEBUG;
ui->label_nameValue->setText(m_name);
ui->lineEdit_comment->setText(m_comment);
ui->comboBox_value->addItems(tags);
ui->comboBox_value->addItem(m_bar);
ui->comboBox_value->setCurrentIndex(ui->comboBox_value->count() - 1);
ui->pushButton_activeColor->setText(m_activeColor);
ui->pushButton_inactiveColor->setText(m_inactiveColor);
ui->comboBox_type->setCurrentIndex(static_cast<int>(m_type));
ui->comboBox_direction->setCurrentIndex(static_cast<int>(m_direction));
ui->spinBox_height->setValue(m_height);
ui->spinBox_width->setValue(m_width);
int ret = exec();
if (ret != 1) return ret;
setName(ui->label_nameValue->text());
setComment(ui->lineEdit_comment->text());
setApiVersion(AWGIAPI);
setBar(ui->comboBox_value->currentText());
setActiveColor(ui->pushButton_activeColor->text().remove(QChar('&')));
setInactiveColor(ui->pushButton_inactiveColor->text().remove(QChar('&')));
setStrType(ui->comboBox_type->currentText());
setStrDirection(ui->comboBox_direction->currentText());
setHeight(ui->spinBox_height->value());
setWidth(ui->spinBox_width->value());
writeConfiguration();
return ret;
}
bool GraphicalItem::tryDelete()
{
if (debug) qDebug() << PDEBUG;
for (int i=0; i<m_dirs.count(); i++)
if (debug) qDebug() << PDEBUG << ":" << "Remove file" << QString("%1/%2").arg(m_dirs[i]).arg(m_fileName) <<
QFile::remove(QString("%1/%2").arg(m_dirs[i]).arg(m_fileName));
// check if exists
for (int i=0; i<m_dirs.count(); i++)
if (QFile::exists(QString("%1/%2").arg(m_dirs[i]).arg(m_fileName))) return false;
return true;
}
void GraphicalItem::writeConfiguration()
{
if (debug) qDebug() << PDEBUG;
QSettings settings(QString("%1/%2").arg(m_dirs[0]).arg(m_fileName), QSettings::IniFormat);
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << settings.fileName();
settings.beginGroup(QString("Desktop Entry"));
settings.setValue(QString("Encoding"), QString("UTF-8"));
settings.setValue(QString("Name"), m_name);
settings.setValue(QString("Comment"), m_comment);
settings.setValue(QString("X-AW-ApiVersion"), m_apiVersion);
settings.setValue(QString("X-AW-Value"), m_bar);
settings.setValue(QString("X-AW-ActiveColor"), m_activeColor);
settings.setValue(QString("X-AW-InactiveColor"), m_inactiveColor);
settings.setValue(QString("X-AW-Type"), strType());
settings.setValue(QString("X-AW-Direction"), strDirection());
settings.setValue(QString("X-AW-Height"), m_height);
settings.setValue(QString("X-AW-Width"), m_width);
settings.endGroup();
settings.sync();
}
void GraphicalItem::changeColor()
{
if (debug) qDebug() << PDEBUG;
QColor color = stringToColor((dynamic_cast<QPushButton *>(sender()))->text());
QColor newColor = QColorDialog::getColor(color, 0, i18n("Select color"),
QColorDialog::ShowAlphaChannel);
if (!newColor.isValid()) return;
QStringList colorText;
colorText.append(QString("%1").arg(newColor.red()));
colorText.append(QString("%1").arg(newColor.green()));
colorText.append(QString("%1").arg(newColor.blue()));
colorText.append(QString("%1").arg(newColor.alpha()));
dynamic_cast<QPushButton *>(sender())->setText(colorText.join(QChar(',')));
}
QColor GraphicalItem::stringToColor(const QString _color)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Color" << _color;
QColor qcolor;
QStringList listColor = _color.split(QChar(','));
while (listColor.count() < 4)
listColor.append(QString("0"));
qcolor.setRed(listColor[0].toInt());
qcolor.setGreen(listColor[1].toInt());
qcolor.setBlue(listColor[2].toInt());
qcolor.setAlpha(listColor[3].toInt());
return qcolor;
}

View File

@ -0,0 +1,115 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef GRAPHICALITEM_H
#define GRAPHICALITEM_H
#include <QColor>
#include <QDialog>
namespace Ui {
class GraphicalItem;
}
class GraphicalItem : public QDialog
{
Q_OBJECT
Q_PROPERTY(int apiVersion READ apiVersion WRITE setApiVersion)
Q_PROPERTY(QString name READ name WRITE setName)
Q_PROPERTY(QString comment READ comment WRITE setComment)
Q_PROPERTY(QString bar READ bar WRITE setBar)
Q_PROPERTY(QString activeColor READ activeColor WRITE setActiveColor)
Q_PROPERTY(QString inactiveColor READ inactiveColor WRITE setInactiveColor)
Q_PROPERTY(Type type READ type WRITE setType)
Q_PROPERTY(Direction direction READ direction WRITE setDirection)
Q_PROPERTY(int height READ height WRITE setHeight)
Q_PROPERTY(int width READ width WRITE setWidth)
public:
enum Direction {
LeftToRight = 0,
RightToLeft
};
enum Type {
Horizontal = 0,
Vertical,
Circle
};
explicit GraphicalItem(QWidget *parent = nullptr, const QString desktopName = QString(),
const QStringList directories = QStringList(), const bool debugCmd = false);
~GraphicalItem();
QString fileName();
QString image(const float value);
// get methods
int apiVersion();
QString name();
QString comment();
QString bar();
QString activeColor();
QString inactiveColor();
Type type();
QString strType();
Direction direction();
QString strDirection();
int height();
int width();
// set methods
void setApiVersion(const int _apiVersion = 0);
void setName(const QString _name = QString("none"));
void setComment(const QString _comment = QString("empty"));
void setBar(const QString _bar = QString("cpu"));
void setActiveColor(const QString _color = QString("0,0,0,130"));
void setInactiveColor(const QString _color = QString("255,255,255,130"));
void setType(const Type _type = Horizontal);
void setStrType(const QString _type = QString("Horizontal"));
void setDirection(const Direction _direction = LeftToRight);
void setStrDirection(const QString _direction = QString("LeftToRight"));
void setHeight(const int _height = 100);
void setWidth(const int _width = 100);
public slots:
void readConfiguration();
int showConfiguration(const QStringList tags = QStringList());
bool tryDelete();
void writeConfiguration();
private slots:
void changeColor();
private:
QColor stringToColor(const QString _color);
QString m_fileName;
QStringList m_dirs;
bool debug;
Ui::GraphicalItem *ui;
// properties
int m_apiVersion = 0;
QString m_name = QString("none");
QString m_comment = QString("empty");
QString m_bar = QString("cpu");
QString m_activeColor = QString("0,0,0,130");
QString m_inactiveColor = QString("255,255,255,130");
Type m_type = Horizontal;
Direction m_direction = LeftToRight;
int m_height = 100;
int m_width = 100;
};
#endif /* GRAPHICALITEM_H */

View File

@ -0,0 +1,293 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>GraphicalItem</class>
<widget class="QDialog" name="GraphicalItem">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>416</width>
<height>325</height>
</rect>
</property>
<property name="windowTitle">
<string>Configuration</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="layout_name">
<item>
<widget class="QLabel" name="label_name">
<property name="text">
<string>Name</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_nameValue">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_comment">
<item>
<widget class="QLabel" name="label_comment">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Comment</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_comment"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_value">
<item>
<widget class="QLabel" name="label_value">
<property name="text">
<string>Value</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_value">
<property name="editable">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_activeColor">
<item>
<widget class="QLabel" name="label_activeColor">
<property name="text">
<string>Active color</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_activeColor">
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_inactiveColor">
<item>
<widget class="QLabel" name="label_inactiveColor">
<property name="text">
<string>Inactive color</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_inactiveColor">
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_type">
<item>
<widget class="QLabel" name="label_type">
<property name="text">
<string>Type</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_type">
<item>
<property name="text">
<string notr="true">Horizontal</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">Vertical</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">Circle</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_direction">
<item>
<widget class="QLabel" name="label_direction">
<property name="text">
<string>Direction</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_direction">
<item>
<property name="text">
<string notr="true">LeftToRight</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">RightToLeft</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_height">
<item>
<widget class="QLabel" name="label_height">
<property name="text">
<string>Height</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_height">
<property name="maximum">
<number>2000</number>
</property>
<property name="singleStep">
<number>25</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_width">
<item>
<widget class="QLabel" name="label_width">
<property name="text">
<string>Width</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_width">
<property name="maximum">
<number>2000</number>
</property>
<property name="singleStep">
<number>25</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>GraphicalItem</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>GraphicalItem</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -0,0 +1,24 @@
[Global]
IconName=system
Name=Awesome Widget
Comment=Awesome widget notifications
[info]
Name=Information
Comment=Information
Action=Popup
[Event/event]
Name=Event
Comment=Some event occurs
Action=Popup
[Event/system]
Name=System information
Comment=System information
Action=Popup
[Event/tag]
Name=Tag information
Comment=Tag information
Action=Popup

View File

@ -0,0 +1,3 @@
module org.kde.plasma.awesomewidget
plugin awplugin

View File

@ -1,25 +0,0 @@
find_package(KDE4 REQUIRED)
find_package(Gettext REQUIRED)
if (NOT GETTEXT_MSGFMT_EXECUTABLE)
message(FATAL_ERROR "Please install the msgfmt binary")
endif (NOT GETTEXT_MSGFMT_EXECUTABLE)
file (GLOB _po_files *.po)
set (_gmoFiles)
foreach (_current_PO_FILE ${_po_files})
get_filename_component (_lang ${_current_PO_FILE} NAME_WE)
set (_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
add_custom_command (OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
DEPENDS ${_current_PO_FILE}
)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo DESTINATION ${LOCALE_INSTALL_DIR}/${_lang}/LC_MESSAGES/
RENAME plasma_applet_awesome-widget.mo)
list (APPEND _gmoFiles ${_gmoFile})
endforeach (_current_PO_FILE)
add_custom_target (pofiles ALL DEPENDS ${_gmoFiles})

View File

@ -1,684 +0,0 @@
# Copyright (C) 2014
# This file is distributed under the same license as the PyTextMonitor package.
#
# Evgeniy Alekseev <esalexeev@gmail.com>, 2014.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
"POT-Creation-Date: 2014-09-21 20:18+0400\n"
"PO-Revision-Date: 2014-09-21 20:19+0400\n"
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
"Language-Team: English <kde-russian@lists.kde.ru>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Lokalize 1.5\n"
#: awesome-widget.cpp:78
msgid "Run ksysguard"
msgstr "Run ksysguard"
#: awesome-widget.cpp:81
msgid "Show README"
msgstr "Show README"
#: awesome-widget.cpp:84
msgid "Update text"
msgstr "Update text"
#: configuration.cpp:362 po/rc.cpp:151 rc.cpp:151
msgid "Custom command"
msgstr "Custom command"
#: configuration.cpp:392 po/rc.cpp:141 rc.cpp:141
msgid "Package manager"
msgstr "Package manager"
#: configuration.cpp:393 po/rc.cpp:144 rc.cpp:144
msgid "Null lines"
msgstr "Null lines"
#: configuration.cpp:405
msgid "Widget"
msgstr "Widget"
#: configuration.cpp:406
msgid "Advanced"
msgstr "Advanced"
#: configuration.cpp:407
msgid "Tooltip"
msgstr "Tooltip"
#: configuration.cpp:408
msgid "Appearance"
msgstr "Appearance"
#: configuration.cpp:409
msgid "DataEngine"
msgstr "DataEngine"
#: configuration.cpp:697 configuration.cpp:711
msgid "Remove"
msgstr "Remove"
#: configuration.cpp:766
msgid "Select font"
msgstr "Select font"
#: po/rc.cpp:3 rc.cpp:3
msgid "Enable background"
msgstr "Enable background"
#: po/rc.cpp:6 rc.cpp:6
msgid "Enable popup on mouse click"
msgstr "Enable popup on mouse click"
#: po/rc.cpp:9 rc.cpp:9
msgid "Custom time format"
msgstr "Custom time format"
#: po/rc.cpp:12 rc.cpp:12
msgid ""
"$dddd - long weekday\n"
"$ddd - short weekday\n"
"$dd - day\n"
"$d - day w\\o zero\n"
"$MMMM - long month\n"
"$MMM - short month\n"
"$MM - month\n"
"$M - month w\\o zero\n"
"$yyyy - year\n"
"$yy - short year\n"
"$hh - hours (24 only)\n"
"$h - hours w\\o zero (24 only)\n"
"$mm - minutes\n"
"$m - minutes w\\o zero\n"
"$ss - seconds\n"
"$s - seconds w\\o zero"
msgstr ""
"$dddd - long weekday\n"
"$ddd - short weekday\n"
"$dd - day\n"
"$d - day w\\o zero\n"
"$MMMM - long month\n"
"$MMM - short month\n"
"$MM - month\n"
"$M - month w\\o zero\n"
"$yyyy - year\n"
"$yy - short year\n"
"$hh - hours (24 only)\n"
"$h - hours w\\o zero (24 only)\n"
"$mm - minutes\n"
"$m - minutes w\\o zero\n"
"$ss - seconds\n"
"$s - seconds w\\o zero"
#: po/rc.cpp:30 rc.cpp:30
msgid "Custom uptime format"
msgstr "Custom uptime format"
#: po/rc.cpp:33 rc.cpp:33
msgid ""
"$dd - uptime days\n"
"$d - uptime days without zero\n"
"$hh - uptime hours\n"
"$h - uptime hours without zero\n"
"$mm - uptime minutes\n"
"$m - uptime minutes without zero"
msgstr ""
"$dd - uptime days\n"
"$d - uptime days without zero\n"
"$hh - uptime hours\n"
"$h - uptime hours without zero\n"
"$mm - uptime minutes\n"
"$m - uptime minutes without zero"
#: po/rc.cpp:41 rc.cpp:41
msgid "Temperature units"
msgstr "Temperature units"
#: po/rc.cpp:44 rc.cpp:44
msgid "Temperature devices"
msgstr "Temperature devices"
#: po/rc.cpp:47 po/rc.cpp:53 po/rc.cpp:59 po/rc.cpp:65 po/rc.cpp:71 rc.cpp:47
#: rc.cpp:53 rc.cpp:59 rc.cpp:65 rc.cpp:71
msgid "Editable"
msgstr "Editable"
#: po/rc.cpp:50 rc.cpp:50
msgid "Fan devices"
msgstr "Fan devices"
#: po/rc.cpp:56 rc.cpp:56
msgid "Mount points"
msgstr "Mount points"
#: po/rc.cpp:62 rc.cpp:62
msgid "HDD devices (speed)"
msgstr "HDD (speed)"
#: po/rc.cpp:68 rc.cpp:68
msgid "HDD devices (temp)"
msgstr "HDD (temp)"
#: po/rc.cpp:74 rc.cpp:74
msgid "Disable auto select device and set specified device"
msgstr "Disable auto select device and set specified device"
#: po/rc.cpp:77 rc.cpp:77
msgid "Set network device"
msgstr "Set network device"
#: po/rc.cpp:80 rc.cpp:80
msgid "AC online tag"
msgstr "AC online tag"
#: po/rc.cpp:83 rc.cpp:83
msgid "Line, which returns when AC is online"
msgstr "Line, which returns when AC is online"
#: po/rc.cpp:86 rc.cpp:86
msgid "AC offline tag"
msgstr "AC offline tag"
#: po/rc.cpp:89 rc.cpp:89
msgid "Line, which returns when AC is offline"
msgstr "Line, which returns when AC is offline"
#: po/rc.cpp:92 rc.cpp:92
msgid "Time interval"
msgstr "Time interval"
#: po/rc.cpp:95 po/rc.cpp:196 rc.cpp:95 rc.cpp:196
msgid "Font"
msgstr "Font"
#: po/rc.cpp:98 rc.cpp:98
msgid "Font size"
msgstr "Font size"
#: po/rc.cpp:101 rc.cpp:101
msgid "Font color"
msgstr "Font color"
#: po/rc.cpp:104 rc.cpp:104
msgid "Font style"
msgstr "Font style"
#: po/rc.cpp:107 rc.cpp:107
msgid "Font weight"
msgstr "Font weight"
#: po/rc.cpp:110 rc.cpp:110
msgid "HDD"
msgstr "HDD"
#: po/rc.cpp:113 rc.cpp:113
msgid "MPD port"
msgstr "MPD port"
#: po/rc.cpp:116 rc.cpp:116
msgid "GPU device"
msgstr "GPU device"
#: po/rc.cpp:119 rc.cpp:119
msgid "hddtemp cmd"
msgstr "hddtemp cmd"
#: po/rc.cpp:122 rc.cpp:122
msgid "Music player"
msgstr "Music player"
#: po/rc.cpp:125 rc.cpp:125
msgid "MPD address"
msgstr "MPD address"
#: po/rc.cpp:128 rc.cpp:128
msgid "Desktop check cmd"
msgstr "Desktop check cmd"
#: po/rc.cpp:131 rc.cpp:131
msgid "<b>NOTE:</b> Player DBus interface should be an active"
msgstr "<b>NOTE:</b> Player DBus interface should be an active"
#: po/rc.cpp:134 rc.cpp:134
msgid "MPRIS player name"
msgstr "MPRIS player name"
#: po/rc.cpp:137 po/rc.cpp:147 rc.cpp:137 rc.cpp:147
msgid ""
"Editable\n"
"del - remove item"
msgstr ""
"Editable\n"
"del - remove item"
#: po/rc.cpp:154 rc.cpp:154
msgid "ACPI path"
msgstr "ACPI path"
#: po/rc.cpp:157 rc.cpp:157
msgid "\"/sys/class/power_supply/\" by default"
msgstr "\"/sys/class/power_supply/\" by default"
#: po/rc.cpp:160 rc.cpp:160
msgid ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
msgstr ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
#: po/rc.cpp:163 rc.cpp:163
msgid "Number of values for tooltips"
msgstr "Number of values for tooltips"
#: po/rc.cpp:166 rc.cpp:166
msgid "Background"
msgstr "Background"
#: po/rc.cpp:169 rc.cpp:169
msgid "CPU color"
msgstr "CPU color"
#: po/rc.cpp:172 rc.cpp:172
msgid "CPU clock color"
msgstr "CPU clock color"
#: po/rc.cpp:175 rc.cpp:175
msgid "Memory color"
msgstr "Memory color"
#: po/rc.cpp:178 rc.cpp:178
msgid "Swap color"
msgstr "Swap color"
#: po/rc.cpp:181 rc.cpp:181
msgid "Download speed color"
msgstr "Download speed color"
#: po/rc.cpp:184 rc.cpp:184
msgid "Upload speed color"
msgstr "Upload speed color"
#: po/rc.cpp:187 rc.cpp:187
msgid "Battery active color"
msgstr "Battery active color"
#: po/rc.cpp:190 rc.cpp:190
msgid "Battery inactive color"
msgstr "Battery inactive color"
#: po/rc.cpp:193 rc.cpp:193
msgid ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
msgstr ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
#: po/rc.cpp:199 rc.cpp:199
msgid "Ctrl+B"
msgstr "Ctrl+B"
#: po/rc.cpp:202 rc.cpp:202
msgid "Ctrl+I"
msgstr "Ctrl+I"
#: po/rc.cpp:205 rc.cpp:205
msgid "Ctrl+U"
msgstr "Ctrl+U"
#: po/rc.cpp:208 rc.cpp:208
msgid "Add"
msgstr "Add"
#: po/rc.cpp:209 rc.cpp:209
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "Evgeniy Alekseev"
#: po/rc.cpp:210 rc.cpp:210
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "esalexeev@gmail.com"
#~ msgid "Battery device"
#~ msgstr "Battery device"
#~ msgid "\"/sys/class/power_supply/BAT0/capacity\" by default"
#~ msgstr "\"/sys/class/power_supply/BAT0/capacity\" by default"
#~ msgid "Vertical layout"
#~ msgstr "Vertical layout"
#~ msgid "Add stretch to left/top of the layout"
#~ msgstr "Add stretch to left/top of the layout"
#~ msgid "Add stretch to right/bottom of the layout"
#~ msgstr "Add stretch to right/bottom of the layout"
#~ msgid "Advanced configuration"
#~ msgstr "Advanced configuration"
#~ msgid "Appearance configuration"
#~ msgstr "Appearance configuration"
#~ msgid "DE Configuration"
#~ msgstr "DE Configuration"
#~ msgid "Tooltip configuration"
#~ msgstr "Tooltip configuration"
#~ msgid "Widget configuration"
#~ msgstr "Widget configuration"
#~ msgid "Form"
#~ msgstr "Form"
#~ msgid "Network directory"
#~ msgstr "Network directory"
#~ msgid "\"/sys/class/net\" by default"
#~ msgstr "\"/sys/class/net\" by default"
#~ msgid "Custom command to run"
#~ msgstr "Custom command to run"
#~ msgid "Time"
#~ msgstr "Time"
#~ msgid ""
#~ "$time - time in default format\n"
#~ "$isotime - time in ISO format\n"
#~ "$shorttime - time in short format\n"
#~ "$longtime - time in log format\n"
#~ "$custom - custom time format"
#~ msgstr ""
#~ "$time - time in default format\n"
#~ "$isotime - time in ISO format\n"
#~ "$shorttime - time in short format\n"
#~ "$longtime - time in log format\n"
#~ "$custom - custom time format"
#~ msgid "Uptime"
#~ msgstr "Uptime"
#~ msgid ""
#~ "$uptime - system uptime\n"
#~ "$custom - custom format"
#~ msgstr ""
#~ "$uptime - system uptime\n"
#~ "$custom - custom format"
#~ msgid "CPU"
#~ msgstr "CPU"
#~ msgid ""
#~ "$cpu - total load CPU, %\n"
#~ "$cpu0 - load CPU for core 0, %\n"
#~ "...\n"
#~ "$cpu9 - load CPU for core 9, %\n"
#~ "...\n"
#~ "$cpuN - load CPU for core N, %"
#~ msgstr ""
#~ "$cpu - total load CPU, %\n"
#~ "$cpu0 - load CPU for core 0, %\n"
#~ "...\n"
#~ "$cpu9 - load CPU for core 9, %\n"
#~ "...\n"
#~ "$cpuN - load CPU for core N, %"
#~ msgid "CPU Clock"
#~ msgstr "CPU Clock"
#~ msgid ""
#~ "$cpucl - average CPU clock, MHz\n"
#~ "$cpucl0 - CPU clock for core 0, MHz\n"
#~ "...\n"
#~ "$cpucl9 - CPU clock for core 9, MHz\n"
#~ "...\n"
#~ "$cpuclN - CPU clock for core N, MHz"
#~ msgstr ""
#~ "$cpucl - average CPU clock, MHz\n"
#~ "$cpucl0 - CPU clock for core 0, MHz\n"
#~ "...\n"
#~ "$cpucl9 - CPU clock for core 9, MHz\n"
#~ "...\n"
#~ "$cpuclN - CPU clock for core N, MHz"
#~ msgid "Temperature"
#~ msgstr "Temperature"
#~ msgid "$tempN - physical temperature on device N (from 0). Example: $temp0"
#~ msgstr "$tempN - physical temperature on device N (from 0). Example: $temp0"
#~ msgid "GPU"
#~ msgstr "GPU"
#~ msgid "$gpu - gpu usage, %"
#~ msgstr "$gpu - gpu usage, %"
#~ msgid "GPU Temp"
#~ msgstr "GPU Temp"
#~ msgid "$gputemp - physical temperature on GPU"
#~ msgstr "$gputemp - physical temperature on GPU"
#~ msgid "Memory"
#~ msgstr "Memory"
#~ msgid ""
#~ "$mem - RAM usage, %\n"
#~ "$memmb - RAM usage, MB\n"
#~ "$memgb - RAM usage, GB\n"
#~ "$memtotmb - total RAM, MB\n"
#~ "$memtotgb - total RAM, GB"
#~ msgstr ""
#~ "$mem - RAM usage, %\n"
#~ "$memmb - RAM usage, MB\n"
#~ "$memgb - RAM usage, GB\n"
#~ "$memtotmb - total RAM, MB\n"
#~ "$memtotgb - total RAM, GB"
#~ msgid "Swap"
#~ msgstr "Swap"
#~ msgid ""
#~ "$swap - swap usage, %\n"
#~ "$swapmb - swap usage, MB\n"
#~ "$swapgb - swap usage, GB\n"
#~ "$swaptotmb - total swap, MB\n"
#~ "$swaptotgb - total swap, GB"
#~ msgstr ""
#~ "$swap - swap usage, %\n"
#~ "$swapmb - swap usage, MB\n"
#~ "$swapgb - swap usage, GB\n"
#~ "$swaptotmb - total swap, MB\n"
#~ "$swaptotgb - total swap, GB"
#~ msgid ""
#~ "$hddN - usage for mount point N (from 0), %. Example: $hdd0\n"
#~ "$hddmbN - usage for mount point N (from 0), MB. Example: $hddmb0\n"
#~ "$hddgbN - usage for mount point N (from 0), GB. Example: $hddgb0\n"
#~ "$hddtotmbN - total size of mount point N (from 0), MB. Example: "
#~ "$hddtotmb0\n"
#~ "$hddtotgbN - total size of mount point N (from 0), GB. Example: $hddtotgb0"
#~ msgstr ""
#~ "$hddN - usage for mount point N (from 0), %. Example: $hdd0\n"
#~ "$hddmbN - usage for mount point N (from 0), MB. Example: $hddmb0\n"
#~ "$hddgbN - usage for mount point N (from 0), GB. Example: $hddgb0\n"
#~ "$hddtotmbN - total size of mount point N (from 0), MB. Example: "
#~ "$hddtotmb0\n"
#~ "$hddtotgbN - total size of mount point N (from 0), GB. Example: $hddtotgb0"
#~ msgid "HDD speed"
#~ msgstr "HDD speed"
#~ msgid ""
#~ "$hddrN - read speed HDD N (from 0), KB/s. Example: $hddr0\n"
#~ "$hddwN - write speed HDD N (from 0), KB/s. Example: $hddw0"
#~ msgstr ""
#~ "$hddrN - read speed HDD N (from 0), KB/s. Example: $hddr0\n"
#~ "$hddwN - write speed HDD N (from 0), KB/s. Example: $hddw0"
#~ msgid "HDD temp"
#~ msgstr "HDD temp"
#~ msgid ""
#~ "$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0"
#~ msgstr ""
#~ "$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0"
#~ msgid "Network"
#~ msgstr "Network"
#~ msgid ""
#~ "$down - download speed, KB/s\n"
#~ "$up - upload speed, KB/s\n"
#~ "$netdev - current network device"
#~ msgstr ""
#~ "$down - download speed, KB/s\n"
#~ "$up - upload speed, KB/s\n"
#~ "$netdev - current network device"
#~ msgid "Battery"
#~ msgstr "Battery"
#~ msgid ""
#~ "$bat - battery charge, %\n"
#~ "$ac - AC status"
#~ msgstr ""
#~ "$bat - battery charge, %\n"
#~ "$ac - AC status"
#~ msgid ""
#~ "$album - song album\n"
#~ "$artist - song artist\n"
#~ "$progress - song progress\n"
#~ "$time - song duration\n"
#~ "$title - song title"
#~ msgstr ""
#~ "$album - song album\n"
#~ "$artist - song artist\n"
#~ "$progress - song progress\n"
#~ "$time - song duration\n"
#~ "$title - song title"
#~ msgid "Processes"
#~ msgstr "Processes"
#~ msgid ""
#~ "$pscount - number of running processes\n"
#~ "$pstotal - total number of running processes\n"
#~ "$ps - list of running processes comma separated"
#~ msgstr ""
#~ "$pscount - number of running processes\n"
#~ "$pstotal - total number of running processes\n"
#~ "$ps - list of running processes comma separated"
#~ msgid ""
#~ "$pkgcountN - number of packages which are available for updates, command "
#~ "N. For example $pkgcount0"
#~ msgstr ""
#~ "$pkgcountN - number of packages which are available for updates, command "
#~ "N. For example $pkgcount0"
#~ msgid "Custom"
#~ msgstr "Custom"
#~ msgid ""
#~ "$customN - get output from custom command N (from N). Example `$custom0`"
#~ msgstr ""
#~ "$customN - get output from custom command N (from N). Example `$custom0`"
#~ msgid "Current desktop"
#~ msgstr "Current desktop"
#~ msgid ""
#~ "$name - desktop name\n"
#~ "$number - desktop number\n"
#~ "$total - total number of desktops"
#~ msgstr ""
#~ "$name - desktop name\n"
#~ "$number - desktop number\n"
#~ "$total - total number of desktops"
#~ msgid "Widget settings"
#~ msgstr "Widget settings"
#~ msgid "pacman -Qu"
#~ msgstr "pacman -Qu"
#~ msgid "apt-show-versions -u -b"
#~ msgstr "apt-show-versions -u -b"
#~ msgid "aptitude search '~U'"
#~ msgstr "aptitude search '~U'"
#~ msgid "yum list updates"
#~ msgstr "yum list updates"
#~ msgid "pkg_version -I -l '<'"
#~ msgstr "pkg_version -I -l '<'"
#~ msgid "urpmq --auto-select"
#~ msgstr "urpmq --auto-select"
#~ msgid "amarok"
#~ msgstr "amarok"
#~ msgid "mpd"
#~ msgstr "mpd"
#~ msgid "qmmp"
#~ msgstr "qmmp"
#~ msgid "auto"
#~ msgstr "auto"
#~ msgid "nvidia"
#~ msgstr "nvidia"
#~ msgid "ati"
#~ msgstr "ati"
#~ msgid "$hddN - usage for mount point N (from 0), %. Example: $hdd0"
#~ msgstr "$hddN - usage for mount point N (from 0), %. Example: $hdd0"
#~ msgid ""
#~ "$ds - uptime days\n"
#~ "$hs - uptime hours\n"
#~ "$ms - uptime minutes"
#~ msgstr ""
#~ "$ds - uptime days\n"
#~ "$hs - uptime hours\n"
#~ "$ms - uptime minutes"
#~ msgid ""
#~ "Command to run, example:\n"
#~ "wget -qO- http://ifconfig.me/ip - get external IP"
#~ msgstr ""
#~ "Command to run, example:\n"
#~ "wget -qO- http://ifconfig.me/ip - get external IP"
#~ msgid "@@/;@@ - mount point usage, %"
#~ msgstr "@@/;@@ - mount point usage, %"
#~ msgid "@@/dev/sda@@ - physical temperature on /dev/sda"
#~ msgstr "@@/dev/sda@@ - physical temperature on /dev/sda"
#~ msgid ""
#~ "$net - network speed, down/up, KB/s\n"
#~ "$netdev - current network device\n"
#~ "@@eth0@@ - disable auto select device and set specified device"
#~ msgstr ""
#~ "$net - network speed, down/up, KB/s\n"
#~ "$netdev - current network device\n"
#~ "@@eth0@@ - disable auto select device and set specified device"

View File

@ -1,619 +0,0 @@
# Copyright (C) 2014
# This file is distributed under the same license as the PyTextMonitor package.
#
# Ernesto Avilés Vzqz <whippiii@gmail.com>, 2014.
# Evgeniy Alekseev <esalexeev@gmail.com>, 2014.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
"POT-Creation-Date: 2014-09-21 20:18+0400\n"
"PO-Revision-Date: 2014-09-05 11:18+0400\n"
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
"Language-Team: Spanish <kde-russian@lists.kde.ru>\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Lokalize 1.5\n"
#: awesome-widget.cpp:78
msgid "Run ksysguard"
msgstr "Ejecutar ksysguard"
#: awesome-widget.cpp:81
msgid "Show README"
msgstr "Mostrar el README"
#: awesome-widget.cpp:84
msgid "Update text"
msgstr "Actualizar texto"
#: configuration.cpp:362 po/rc.cpp:151 rc.cpp:151
msgid "Custom command"
msgstr "Comando personalizado"
#: configuration.cpp:392 po/rc.cpp:141 rc.cpp:141
msgid "Package manager"
msgstr "Gestor de paquetes"
#: configuration.cpp:393 po/rc.cpp:144 rc.cpp:144
msgid "Null lines"
msgstr "Número de líneas nulas"
#: configuration.cpp:405
msgid "Widget"
msgstr "Widget"
#: configuration.cpp:406
msgid "Advanced"
msgstr "Avanzado"
#: configuration.cpp:407
msgid "Tooltip"
msgstr "Ventana emergente"
#: configuration.cpp:408
msgid "Appearance"
msgstr "Apariencia"
#: configuration.cpp:409
msgid "DataEngine"
msgstr "DataEngine"
#: configuration.cpp:697 configuration.cpp:711
msgid "Remove"
msgstr "Eliminar"
#: configuration.cpp:766
msgid "Select font"
msgstr ""
#: po/rc.cpp:3 rc.cpp:3
msgid "Enable background"
msgstr ""
#: po/rc.cpp:6 rc.cpp:6
msgid "Enable popup on mouse click"
msgstr "Habilitar ventana emergente al hacer clic"
#: po/rc.cpp:9 rc.cpp:9
msgid "Custom time format"
msgstr "Formato personalizado para la hora"
#: po/rc.cpp:12 rc.cpp:12
msgid ""
"$dddd - long weekday\n"
"$ddd - short weekday\n"
"$dd - day\n"
"$d - day w\\o zero\n"
"$MMMM - long month\n"
"$MMM - short month\n"
"$MM - month\n"
"$M - month w\\o zero\n"
"$yyyy - year\n"
"$yy - short year\n"
"$hh - hours (24 only)\n"
"$h - hours w\\o zero (24 only)\n"
"$mm - minutes\n"
"$m - minutes w\\o zero\n"
"$ss - seconds\n"
"$s - seconds w\\o zero"
msgstr ""
"$dddd - día de la semana largo\n"
"$ddd - día de la semana corto\n"
"$dd - día\n"
"$d - día (sin ceros)\n"
"$MMMM - mes largo\n"
"$MMM - mes corto\n"
"$MM - mes\n"
"$M - mes (sin ceros)\n"
"$yyyy - año\n"
"$yy - año largo\n"
"$hh - horas (solo formato de 24 horas)\n"
"$h - horas (sin ceros, solo formato de 24 horas)\n"
"$mm - minutos\n"
"$m - minutos (sin ceros)\n"
"$ss - segundos\n"
"$s - segundos (sin ceros)"
#: po/rc.cpp:30 rc.cpp:30
msgid "Custom uptime format"
msgstr "Formato personalizado para el tiempo de actividad del sistema"
#: po/rc.cpp:33 rc.cpp:33
msgid ""
"$dd - uptime days\n"
"$d - uptime days without zero\n"
"$hh - uptime hours\n"
"$h - uptime hours without zero\n"
"$mm - uptime minutes\n"
"$m - uptime minutes without zero"
msgstr ""
"$dd - días\n"
"$d - días (sin ceros)\n"
"$hh - horas\n"
"$h - horas (sin ceros)\n"
"$mm - minutos\n"
"$m - minutos (sin ceros)"
#: po/rc.cpp:41 rc.cpp:41
msgid "Temperature units"
msgstr "Unidades de temperatura"
#: po/rc.cpp:44 rc.cpp:44
msgid "Temperature devices"
msgstr "Dispositivos de temperatura"
#: po/rc.cpp:47 po/rc.cpp:53 po/rc.cpp:59 po/rc.cpp:65 po/rc.cpp:71 rc.cpp:47
#: rc.cpp:53 rc.cpp:59 rc.cpp:65 rc.cpp:71
msgid "Editable"
msgstr "Editable"
#: po/rc.cpp:50 rc.cpp:50
#, fuzzy
msgid "Fan devices"
msgstr "Dispositivo de alimentación"
#: po/rc.cpp:56 rc.cpp:56
msgid "Mount points"
msgstr "Puntos de montaje"
#: po/rc.cpp:62 rc.cpp:62
msgid "HDD devices (speed)"
msgstr "Disco duro (velocidad)"
#: po/rc.cpp:68 rc.cpp:68
msgid "HDD devices (temp)"
msgstr "Disco duro (temperatura)"
#: po/rc.cpp:74 rc.cpp:74
msgid "Disable auto select device and set specified device"
msgstr "Inhabilitar selección automática del dispositivo y especificar uno"
#: po/rc.cpp:77 rc.cpp:77
msgid "Set network device"
msgstr "Establecer dispositivo de red"
#: po/rc.cpp:80 rc.cpp:80
msgid "AC online tag"
msgstr "Etiqueta para alimentación conectada"
#: po/rc.cpp:83 rc.cpp:83
msgid "Line, which returns when AC is online"
msgstr "Línea que devuelve si la alimentación está conectada"
#: po/rc.cpp:86 rc.cpp:86
msgid "AC offline tag"
msgstr "Etiqueta para la alimentación desconectada"
#: po/rc.cpp:89 rc.cpp:89
msgid "Line, which returns when AC is offline"
msgstr "Línea que devuelve si la alimentación está desconectada"
#: po/rc.cpp:92 rc.cpp:92
msgid "Time interval"
msgstr "Intervalo de tiempo"
#: po/rc.cpp:95 po/rc.cpp:196 rc.cpp:95 rc.cpp:196
msgid "Font"
msgstr "Fuente"
#: po/rc.cpp:98 rc.cpp:98
msgid "Font size"
msgstr "Tamaño de fuente"
#: po/rc.cpp:101 rc.cpp:101
msgid "Font color"
msgstr "Color de fuente"
#: po/rc.cpp:104 rc.cpp:104
msgid "Font style"
msgstr "Estilo de fuente"
#: po/rc.cpp:107 rc.cpp:107
msgid "Font weight"
msgstr "Grosor de la fuente"
#: po/rc.cpp:110 rc.cpp:110
msgid "HDD"
msgstr "Disco duro"
#: po/rc.cpp:113 rc.cpp:113
msgid "MPD port"
msgstr "Puerto de MPD"
#: po/rc.cpp:116 rc.cpp:116
msgid "GPU device"
msgstr "Dispositivo de GPU"
#: po/rc.cpp:119 rc.cpp:119
msgid "hddtemp cmd"
msgstr "Comando hddtemp"
#: po/rc.cpp:122 rc.cpp:122
msgid "Music player"
msgstr "Reproductor de música"
#: po/rc.cpp:125 rc.cpp:125
msgid "MPD address"
msgstr "Dirección de MPD"
#: po/rc.cpp:128 rc.cpp:128
msgid "Desktop check cmd"
msgstr ""
#: po/rc.cpp:131 rc.cpp:131
msgid "<b>NOTE:</b> Player DBus interface should be an active"
msgstr ""
#: po/rc.cpp:134 rc.cpp:134
msgid "MPRIS player name"
msgstr ""
#: po/rc.cpp:137 po/rc.cpp:147 rc.cpp:137 rc.cpp:147
msgid ""
"Editable\n"
"del - remove item"
msgstr ""
"Editable\n"
"del - eliminar elemento"
#: po/rc.cpp:154 rc.cpp:154
msgid "ACPI path"
msgstr ""
#: po/rc.cpp:157 rc.cpp:157
#, fuzzy
msgid "\"/sys/class/power_supply/\" by default"
msgstr "\"/sys/class/power_supply/AC/online\" por defecto"
#: po/rc.cpp:160 rc.cpp:160
msgid ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
msgstr ""
"Las etiquetas para CPU, frecuencia de la CPU, memoria, swap y red soportan "
"ventanas emergentes. Para habilitarlas habilite la caja de seleccione la "
"casilla de verificación pertinente."
#: po/rc.cpp:163 rc.cpp:163
msgid "Number of values for tooltips"
msgstr "Número de valores para las ventanas emergentes"
#: po/rc.cpp:166 rc.cpp:166
msgid "Background"
msgstr ""
#: po/rc.cpp:169 rc.cpp:169
msgid "CPU color"
msgstr "Color de la CPU"
#: po/rc.cpp:172 rc.cpp:172
msgid "CPU clock color"
msgstr "Color de la frecuencia de la CPU"
#: po/rc.cpp:175 rc.cpp:175
msgid "Memory color"
msgstr "Color de la memoria"
#: po/rc.cpp:178 rc.cpp:178
msgid "Swap color"
msgstr "Color de la swap"
#: po/rc.cpp:181 rc.cpp:181
msgid "Download speed color"
msgstr "Color de la velocidad de recepción"
#: po/rc.cpp:184 rc.cpp:184
msgid "Upload speed color"
msgstr "Color de la velocidad de envío"
#: po/rc.cpp:187 rc.cpp:187
msgid "Battery active color"
msgstr ""
#: po/rc.cpp:190 rc.cpp:190
#, fuzzy
msgid "Battery inactive color"
msgstr "Dispositivo de batería"
#: po/rc.cpp:193 rc.cpp:193
msgid ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
msgstr ""
"Puede encontrar información detallada en el <a href=\"http://arcanis.name/"
"projects/awesome-widgets/\">sitio del proyecto</a>"
#: po/rc.cpp:199 rc.cpp:199
msgid "Ctrl+B"
msgstr "Ctrl+B"
#: po/rc.cpp:202 rc.cpp:202
msgid "Ctrl+I"
msgstr "Ctrl+I"
#: po/rc.cpp:205 rc.cpp:205
msgid "Ctrl+U"
msgstr "Ctrl+U"
#: po/rc.cpp:208 rc.cpp:208
msgid "Add"
msgstr "Añadir"
#: po/rc.cpp:209 rc.cpp:209
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "Tu nombre"
#: po/rc.cpp:210 rc.cpp:210
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "Tus correos"
#~ msgid "Battery device"
#~ msgstr "Dispositivo de batería"
#~ msgid "\"/sys/class/power_supply/BAT0/capacity\" by default"
#~ msgstr "\"/sys/class/power_supply/BAT0/capacity\" por defecto"
#~ msgid "Vertical layout"
#~ msgstr "Orientación vertical"
#~ msgid "Add stretch to left/top of the layout"
#~ msgstr "Añadir extensión a la izquierda/superior de la distribución"
#~ msgid "Add stretch to right/bottom of the layout"
#~ msgstr "Añadir extensión a la derecha/inferior de la distribución"
#~ msgid "Form"
#~ msgstr "Formulario"
#~ msgid "Network directory"
#~ msgstr "Directorio de la red"
#~ msgid "\"/sys/class/net\" by default"
#~ msgstr "\"/sys/class/net\" por defecto"
#~ msgid "Custom command to run"
#~ msgstr "Comando personalizado para ejecutar"
#~ msgid "Time"
#~ msgstr "Hora"
#~ msgid ""
#~ "$time - time in default format\n"
#~ "$isotime - time in ISO format\n"
#~ "$shorttime - time in short format\n"
#~ "$longtime - time in log format\n"
#~ "$custom - custom time format"
#~ msgstr ""
#~ "$time - hora en el formato por defecto\n"
#~ "$isotime - hora en formato ISO\n"
#~ "$shorttime - hora en formato corto\n"
#~ "$longtime - hora en formato largo\n"
#~ "$custom - hora en formato personalizado"
#~ msgid "Uptime"
#~ msgstr "Tiempo de actividad"
#~ msgid ""
#~ "$uptime - system uptime\n"
#~ "$custom - custom format"
#~ msgstr ""
#~ "$uptime - tiempo de actividad del sistema\n"
#~ "$custom - formato personalizado"
#~ msgid "CPU"
#~ msgstr "CPU"
#~ msgid ""
#~ "$cpu - total load CPU, %\n"
#~ "$cpu0 - load CPU for core 0, %\n"
#~ "...\n"
#~ "$cpu9 - load CPU for core 9, %\n"
#~ "...\n"
#~ "$cpuN - load CPU for core N, %"
#~ msgstr ""
#~ "$cpu - carga total de la CPU, %\n"
#~ "$cpu0 - carga de la CPU para el núcleo 0, %\n"
#~ "...\n"
#~ "$cpu9 - carga de la CPU para el núcleo 9, %\n"
#~ "...\n"
#~ "$cpuN - carga de la CPU para el núcleo N, %"
#~ msgid "CPU Clock"
#~ msgstr "Frecuencia de la CPU"
#~ msgid ""
#~ "$cpucl - average CPU clock, MHz\n"
#~ "$cpucl0 - CPU clock for core 0, MHz\n"
#~ "...\n"
#~ "$cpucl9 - CPU clock for core 9, MHz\n"
#~ "...\n"
#~ "$cpuclN - CPU clock for core N, MHz"
#~ msgstr ""
#~ "$cpucl - frecuencia de la CPU promedio, MHz\n"
#~ "$cpucl0 - frecuencia de la CPU para el núcleo 0, MHz\n"
#~ "...\n"
#~ "$cpucl9 - frecuencia de la CPU para el núcleo 9, MHz\n"
#~ "...\n"
#~ "$cpuclN - frecuencia de la CPU para el núcleo N, MHz"
#~ msgid "Temperature"
#~ msgstr "Temperatura"
#~ msgid "$tempN - physical temperature on device N (from 0). Example: $temp0"
#~ msgstr ""
#~ "$tempN - temperatura física en el dispositivo N (a partir de 0). Ejemplo: "
#~ "$temp0"
#~ msgid "GPU"
#~ msgstr "GPU"
#~ msgid "$gpu - gpu usage, %"
#~ msgstr "$gpu - uso de la GPU, %"
#~ msgid "GPU Temp"
#~ msgstr "Temperatura de la GPU"
#~ msgid "$gputemp - physical temperature on GPU"
#~ msgstr "$gputemp - temperatura física de la GPU"
#~ msgid "Memory"
#~ msgstr "Memoria"
#~ msgid ""
#~ "$mem - RAM usage, %\n"
#~ "$memmb - RAM usage, MB\n"
#~ "$memgb - RAM usage, GB\n"
#~ "$memtotmb - total RAM, MB\n"
#~ "$memtotgb - total RAM, GB"
#~ msgstr ""
#~ "$mem - uso de la RAM, %\n"
#~ "$memmb - uso de la RAM, MB\n"
#~ "$memgb - uso de la RAM, GB\n"
#~ "$memtotmb - uso total de la RAM, MB\n"
#~ "$memtotgb - uso total de la RAM, GB"
#~ msgid "Swap"
#~ msgstr "Swap"
#~ msgid ""
#~ "$swap - swap usage, %\n"
#~ "$swapmb - swap usage, MB\n"
#~ "$swapgb - swap usage, GB\n"
#~ "$swaptotmb - total swap, MB\n"
#~ "$swaptotgb - total swap, GB"
#~ msgstr ""
#~ "$swap - uso de la swap, %\n"
#~ "$swapmb - uso de la swap, MB\n"
#~ "$swapgb - uso de la swap, GB\n"
#~ "$swaptotmb - uso total de la swap, MB\n"
#~ "$swaptotgb - uso total de la swap, GB"
#~ msgid ""
#~ "$hddN - usage for mount point N (from 0), %. Example: $hdd0\n"
#~ "$hddmbN - usage for mount point N (from 0), MB. Example: $hddmb0\n"
#~ "$hddgbN - usage for mount point N (from 0), GB. Example: $hddgb0\n"
#~ "$hddtotmbN - total size of mount point N (from 0), MB. Example: "
#~ "$hddtotmb0\n"
#~ "$hddtotgbN - total size of mount point N (from 0), GB. Example: $hddtotgb0"
#~ msgstr ""
#~ "$hddN - uso para el punto de montaje N (a partir de 0), %. Ejemplo: "
#~ "$hdd0\n"
#~ "$hddmbN - uso para el punto de montaje N (a partir de 0), MB. Ejemplo: "
#~ "$hddmb0\n"
#~ "$hddgbN - uso para el punto de montaje N (a partir de 0), GB. Ejemplo: "
#~ "$hddgb0\n"
#~ "$hddtotmbN - uso total para el punto de montaje N (a partir de 0), MB. "
#~ "Ejemplo: $hddtotmb0\n"
#~ "$hddtotgbN - uso total para el punto de montaje N (a partir de 0), GB. "
#~ "Ejemplo: $hddtotgb0"
#~ msgid "HDD speed"
#~ msgstr "Velocidad del disco duro"
#~ msgid ""
#~ "$hddrN - read speed HDD N (from 0), KB/s. Example: $hddr0\n"
#~ "$hddwN - write speed HDD N (from 0), KB/s. Example: $hddw0"
#~ msgstr ""
#~ "$hddrN - velocidad de lectura del disco N (a partir de 0), KB/s. Por "
#~ "ejemplo: $hddr0\n"
#~ "$hddwN - velocidad de escritura del disco N (a partir de 0), KB/s. Por "
#~ "ejemplo: $hddw0"
#~ msgid "HDD temp"
#~ msgstr "Temperatura del disco duro"
#~ msgid ""
#~ "$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0"
#~ msgstr ""
#~ "$hddtempN - temperatura física en el dispositivo N (a partir de 0). "
#~ "Ejemplo: $hddtemp0"
#~ msgid "Network"
#~ msgstr "Red"
#~ msgid ""
#~ "$down - download speed, KB/s\n"
#~ "$up - upload speed, KB/s\n"
#~ "$netdev - current network device"
#~ msgstr ""
#~ "$down - velocidad de recepción, KB/s\n"
#~ "$up - velocidad de envío, KB/s\n"
#~ "$netdev - dispositivo de red actual"
#~ msgid "Battery"
#~ msgstr "Batería"
#~ msgid ""
#~ "$bat - battery charge, %\n"
#~ "$ac - AC status"
#~ msgstr ""
#~ "$bat - carga de la batería, %\n"
#~ "$ac - estado de la alimentación"
#~ msgid ""
#~ "$album - song album\n"
#~ "$artist - song artist\n"
#~ "$progress - song progress\n"
#~ "$time - song duration\n"
#~ "$title - song title"
#~ msgstr ""
#~ "$album - álbum de la canción\n"
#~ "$artist - artista de la canción\n"
#~ "$progress - progreso de la canción\n"
#~ "$time - duración de la canción\n"
#~ "$title - título de la canción"
#~ msgid "Processes"
#~ msgstr "Procesos"
#~ msgid ""
#~ "$pscount - number of running processes\n"
#~ "$pstotal - total number of running processes\n"
#~ "$ps - list of running processes comma separated"
#~ msgstr ""
#~ "$pscount - número de procesos en ejecución\n"
#~ "$pstotal - total de procesos en ejecución\n"
#~ "$ps - listado de procesos en ejecución separados por coma"
#~ msgid ""
#~ "$pkgcountN - number of packages which are available for updates, command "
#~ "N. For example $pkgcount0"
#~ msgstr ""
#~ "$pkgcountN - número de paquetes con actualizaciones disponibles, comando "
#~ "N. Por ejemplo $pkgcount0"
#~ msgid "Custom"
#~ msgstr "Personalizado"
#~ msgid ""
#~ "$customN - get output from custom command N (from N). Example `$custom0`"
#~ msgstr ""
#~ "$customN - obtener la salida de ejecución del comando personalizado N (a "
#~ "partir de 0). Por ejemplo: $custom0"
#~ msgid "Widget settings"
#~ msgstr "Configuración del componente"
#~ msgid "pacman -Qu"
#~ msgstr "pacman -Qu"
#~ msgid "apt-show-versions -u -b"
#~ msgstr "apt-show-versions -u -b"
#~ msgid "aptitude search '~U'"
#~ msgstr "aptitude search '~U'"
#~ msgid "yum list updates"
#~ msgstr "yum list updates"
#~ msgid "pkg_version -I -l '<'"
#~ msgstr "pkg_version -I -l '<'"
#~ msgid "urpmq --auto-select"
#~ msgstr "urpmq --auto-select"

View File

@ -1,41 +0,0 @@
#!/bin/sh
BASEDIR="../" # root of translatable sources
PROJECT="plasma_applet_awesome-widget" # project name
BUGADDR="https://github.com/arcan1s/awesome-widgets/issues" # MSGID-Bugs
WDIR=$(pwd) # working dir
echo "Preparing rc files"
cd "${BASEDIR}"
find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' -o -name '*.py' | sort > "${WDIR}/rcfiles.list"
xargs --arg-file=${WDIR}/rcfiles.list extractrc > "${WDIR}/rc.cpp"
echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> "${WDIR}/rc.cpp"
echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> "${WDIR}/rc.cpp"
echo "Done preparing rc files"
echo "Extracting messages"
cd "${WDIR}"
cd "${BASEDIR}"
find . -name '*.cpp' -o -name '*.h' -o -name '*.c' -o -name '*.py' | sort > "${WDIR}/infiles.list"
echo "rc.cpp" >> "${WDIR}/infiles.list"
cd "${WDIR}"
xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \
-kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \
--msgid-bugs-address="${BUGADDR}" --language=Python \
--files-from=infiles.list -D "${BASEDIR}" -D "${WDIR}" -o "${PROJECT}.pot" || { echo "error while calling xgettext. aborting."; exit 1; }
echo "Done extracting messages"
echo "Merging translations"
catalogs=$(find . -name '*.po')
for cat in $catalogs; do
echo $cat
msgmerge -o "$cat.new" "$cat" "${PROJECT}.pot"
mv "$cat.new" "$cat"
done
echo "Done merging translations"
echo "Cleaning up"
cd "${WDIR}"
rm -f rcfiles.list infiles.list rc.cpp
echo "Done"

View File

@ -1,670 +0,0 @@
# Copyright (C) 2014
# This file is distributed under the same license as the PyTextMonitor package.
#
# Evgeniy Alekseev <esalexeev@gmail.com>, 2014.
# Mermouy <mermouy@gmail.com>, 2014.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
"POT-Creation-Date: 2014-09-21 20:18+0400\n"
"PO-Revision-Date: 2014-09-05 11:20+0400\n"
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
"Language-Team: French <kde-russian@lists.kde.ru>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Lokalize 1.5\n"
#: awesome-widget.cpp:78
msgid "Run ksysguard"
msgstr "Lancer ksysguard"
#: awesome-widget.cpp:81
msgid "Show README"
msgstr "Voir le README"
#: awesome-widget.cpp:84
msgid "Update text"
msgstr "Mettre à jour le texte"
#: configuration.cpp:362 po/rc.cpp:151 rc.cpp:151
msgid "Custom command"
msgstr "Commande personnalisée"
#: configuration.cpp:392 po/rc.cpp:141 rc.cpp:141
msgid "Package manager"
msgstr "Gestionnaire de paquets"
#: configuration.cpp:393 po/rc.cpp:144 rc.cpp:144
msgid "Null lines"
msgstr "Nombre d'éléments pour les conseils"
#: configuration.cpp:405
msgid "Widget"
msgstr "Widget"
#: configuration.cpp:406
msgid "Advanced"
msgstr "Avancé"
#: configuration.cpp:407
msgid "Tooltip"
msgstr "Conseil"
#: configuration.cpp:408
msgid "Appearance"
msgstr "Apparence"
#: configuration.cpp:409
msgid "DataEngine"
msgstr "Moteur de données"
#: configuration.cpp:697 configuration.cpp:711
msgid "Remove"
msgstr "Supprimer"
#: configuration.cpp:766
msgid "Select font"
msgstr ""
#: po/rc.cpp:3 rc.cpp:3
msgid "Enable background"
msgstr ""
#: po/rc.cpp:6 rc.cpp:6
msgid "Enable popup on mouse click"
msgstr "Popup lors d'un click souris"
#: po/rc.cpp:9 rc.cpp:9
msgid "Custom time format"
msgstr "Format de l'heure personnalisé"
#: po/rc.cpp:12 rc.cpp:12
msgid ""
"$dddd - long weekday\n"
"$ddd - short weekday\n"
"$dd - day\n"
"$d - day w\\o zero\n"
"$MMMM - long month\n"
"$MMM - short month\n"
"$MM - month\n"
"$M - month w\\o zero\n"
"$yyyy - year\n"
"$yy - short year\n"
"$hh - hours (24 only)\n"
"$h - hours w\\o zero (24 only)\n"
"$mm - minutes\n"
"$m - minutes w\\o zero\n"
"$ss - seconds\n"
"$s - seconds w\\o zero"
msgstr ""
"$dddd - Jour de la semaine long\n"
"$ddd - Jour de la semaine court\n"
"$dd - jour\n"
"$d - jour sans zéro\n"
"$MMMM - mois long\n"
"$MMM - mois court\n"
"$MM - mois\n"
"$M - mois sans zéro\n"
"$yyyy - année\n"
"$yy - année courte\n"
"$hh - heures (24 uniquement)\n"
"$h - heures sans zéro (24 uniquement)\n"
"$mm - minutes\n"
"$m - minutes sans zéro\n"
"$ss - secondes\n"
"$s - secondes sans zéro"
#: po/rc.cpp:30 rc.cpp:30
msgid "Custom uptime format"
msgstr "Temps de fonctionnement personalisé"
#: po/rc.cpp:33 rc.cpp:33
msgid ""
"$dd - uptime days\n"
"$d - uptime days without zero\n"
"$hh - uptime hours\n"
"$h - uptime hours without zero\n"
"$mm - uptime minutes\n"
"$m - uptime minutes without zero"
msgstr ""
"$dd - temps de fonctionnement en jours\n"
"$d - temps de fonctionnement en jours sans zéro\n"
"$hh - temps de fonctionnement en heures\n"
"$h - temps de fonctionnement en heures sans zéro\n"
"$mm - temps de fonctionnement en minutes\n"
"$m - temps de fonctionnement en minutes sans zéro"
#: po/rc.cpp:41 rc.cpp:41
msgid "Temperature units"
msgstr "Unités de température"
#: po/rc.cpp:44 rc.cpp:44
msgid "Temperature devices"
msgstr "Temperature des périphériques"
#: po/rc.cpp:47 po/rc.cpp:53 po/rc.cpp:59 po/rc.cpp:65 po/rc.cpp:71 rc.cpp:47
#: rc.cpp:53 rc.cpp:59 rc.cpp:65 rc.cpp:71
msgid "Editable"
msgstr "Modifiable"
#: po/rc.cpp:50 rc.cpp:50
#, fuzzy
msgid "Fan devices"
msgstr "Périphérique d'alimentation"
#: po/rc.cpp:56 rc.cpp:56
msgid "Mount points"
msgstr "Points de montage"
#: po/rc.cpp:62 rc.cpp:62
msgid "HDD devices (speed)"
msgstr "Périphériques HDD (la vitesse)"
#: po/rc.cpp:68 rc.cpp:68
msgid "HDD devices (temp)"
msgstr "Périphériques HDD (température)"
#: po/rc.cpp:74 rc.cpp:74
msgid "Disable auto select device and set specified device"
msgstr ""
"Désactiver la sélection automatique de périphériques et le sélectionner "
"manuellement"
#: po/rc.cpp:77 rc.cpp:77
msgid "Set network device"
msgstr "Sélectionner le périphérique réseau"
#: po/rc.cpp:80 rc.cpp:80
msgid "AC online tag"
msgstr "Tag alimentation branchée"
#: po/rc.cpp:83 rc.cpp:83
msgid "Line, which returns when AC is online"
msgstr "Ligne qui est renvoyée lorsque l'alimentation est branchée"
#: po/rc.cpp:86 rc.cpp:86
msgid "AC offline tag"
msgstr "Tag alimentation débranchée"
#: po/rc.cpp:89 rc.cpp:89
msgid "Line, which returns when AC is offline"
msgstr "Ligne, qui est renvoyée lorsque l'alimentation est débranchée"
#: po/rc.cpp:92 rc.cpp:92
msgid "Time interval"
msgstr "Intervalle"
#: po/rc.cpp:95 po/rc.cpp:196 rc.cpp:95 rc.cpp:196
msgid "Font"
msgstr "Police"
#: po/rc.cpp:98 rc.cpp:98
msgid "Font size"
msgstr "Taille de la police"
#: po/rc.cpp:101 rc.cpp:101
msgid "Font color"
msgstr "Couleur de la police"
#: po/rc.cpp:104 rc.cpp:104
msgid "Font style"
msgstr "Style de la police"
#: po/rc.cpp:107 rc.cpp:107
msgid "Font weight"
msgstr "Épaisseur de la police"
#: po/rc.cpp:110 rc.cpp:110
msgid "HDD"
msgstr "Disque dur"
#: po/rc.cpp:113 rc.cpp:113
msgid "MPD port"
msgstr "Port MPD"
#: po/rc.cpp:116 rc.cpp:116
msgid "GPU device"
msgstr "Périphérique graphique"
#: po/rc.cpp:119 rc.cpp:119
msgid "hddtemp cmd"
msgstr "Commande de température HDD"
#: po/rc.cpp:122 rc.cpp:122
msgid "Music player"
msgstr "Lecteur audio"
#: po/rc.cpp:125 rc.cpp:125
msgid "MPD address"
msgstr "Adresse MPD"
#: po/rc.cpp:128 rc.cpp:128
msgid "Desktop check cmd"
msgstr ""
#: po/rc.cpp:131 rc.cpp:131
msgid "<b>NOTE:</b> Player DBus interface should be an active"
msgstr ""
#: po/rc.cpp:134 rc.cpp:134
msgid "MPRIS player name"
msgstr ""
#: po/rc.cpp:137 po/rc.cpp:147 rc.cpp:137 rc.cpp:147
msgid ""
"Editable\n"
"del - remove item"
msgstr ""
"Modifiable\n"
"del - supprimer un élément"
#: po/rc.cpp:154 rc.cpp:154
msgid "ACPI path"
msgstr ""
#: po/rc.cpp:157 rc.cpp:157
#, fuzzy
msgid "\"/sys/class/power_supply/\" by default"
msgstr "\"/sys/class/power_supply/AC/online\" par défaut"
#: po/rc.cpp:160 rc.cpp:160
msgid ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
msgstr ""
"CPU, horloge du CPU, mémoire vive, mémoire swap et noms réseau supportent "
"les conseils visuels. Pour les activer cochez simplement les cases "
"correspondantes."
#: po/rc.cpp:163 rc.cpp:163
msgid "Number of values for tooltips"
msgstr "Nombre d'éléments pour les conseils"
#: po/rc.cpp:166 rc.cpp:166
msgid "Background"
msgstr ""
#: po/rc.cpp:169 rc.cpp:169
msgid "CPU color"
msgstr "Couleur processeur"
#: po/rc.cpp:172 rc.cpp:172
msgid "CPU clock color"
msgstr "Couleur de l'horloge processeur"
#: po/rc.cpp:175 rc.cpp:175
msgid "Memory color"
msgstr "Couleur de la mémoire"
#: po/rc.cpp:178 rc.cpp:178
msgid "Swap color"
msgstr "Couleur de la mémoire d'échange"
#: po/rc.cpp:181 rc.cpp:181
msgid "Download speed color"
msgstr "Couleur de la vitesse de téléchargement"
#: po/rc.cpp:184 rc.cpp:184
msgid "Upload speed color"
msgstr "Couleur du téléversement"
#: po/rc.cpp:187 rc.cpp:187
msgid "Battery active color"
msgstr ""
#: po/rc.cpp:190 rc.cpp:190
#, fuzzy
msgid "Battery inactive color"
msgstr "Batterie"
#: po/rc.cpp:193 rc.cpp:193
msgid ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
msgstr ""
"D'avantage d'informations se trouvent sur <a href=\"http://arcanis.name/"
"projects/awesome-widgets/\">la page du projet</a>"
#: po/rc.cpp:199 rc.cpp:199
msgid "Ctrl+B"
msgstr "Ctrl+B"
#: po/rc.cpp:202 rc.cpp:202
msgid "Ctrl+I"
msgstr "Ctrl+I"
#: po/rc.cpp:205 rc.cpp:205
msgid "Ctrl+U"
msgstr "Ctrl+U"
#: po/rc.cpp:208 rc.cpp:208
msgid "Add"
msgstr "Ajouter"
#: po/rc.cpp:209 rc.cpp:209
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "Evgeniy Alekseev"
#: po/rc.cpp:210 rc.cpp:210
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "esalexeev@gmail.com"
#~ msgid "Battery device"
#~ msgstr "Batterie"
#~ msgid "\"/sys/class/power_supply/BAT0/capacity\" by default"
#~ msgstr "\"/sys/class/power_supply/BAT0/capacity\" par défaut"
#~ msgid "Vertical layout"
#~ msgstr "Positionnement vertical"
#~ msgid "Add stretch to left/top of the layout"
#~ msgstr "Étirer le positionnement vers haut/gauche"
#~ msgid "Add stretch to right/bottom of the layout"
#~ msgstr "Étirer le positionnement vers bas/droite"
#~ msgid "Form"
#~ msgstr "Entrées"
#~ msgid "Network directory"
#~ msgstr "Voisinage réseau"
#~ msgid "\"/sys/class/net\" by default"
#~ msgstr "\"/sys/class/net\" par défaut"
#~ msgid "Custom command to run"
#~ msgstr "Commande personnalisée à exécuter"
#~ msgid "Time"
#~ msgstr "Durée"
#~ msgid ""
#~ "$time - time in default format\n"
#~ "$isotime - time in ISO format\n"
#~ "$shorttime - time in short format\n"
#~ "$longtime - time in log format\n"
#~ "$custom - custom time format"
#~ msgstr ""
#~ "$time - l'heure au format par défaut\n"
#~ "$isotime - l'heure au format ISO\n"
#~ "$shorttime - l'heure format court\n"
#~ "$longtime - l'heure au format log\n"
#~ "$custom - l'heure, format personnalisé"
#~ msgid "Uptime"
#~ msgstr "temps de fonctionnement"
#~ msgid ""
#~ "$uptime - system uptime\n"
#~ "$custom - custom format"
#~ msgstr ""
#~ "$uptime - temps de fonctionnement\n"
#~ "$custom - format personnalisé"
#~ msgid "CPU"
#~ msgstr "CPU"
#~ msgid ""
#~ "$cpu - total load CPU, %\n"
#~ "$cpu0 - load CPU for core 0, %\n"
#~ "...\n"
#~ "$cpu9 - load CPU for core 9, %\n"
#~ "...\n"
#~ "$cpuN - load CPU for core N, %"
#~ msgstr ""
#~ "$cpu - charge totale du processeur, %\n"
#~ "$cpu0 - charge du processeur pour le coeur 0, %\n"
#~ "...\n"
#~ "$cpuN - charge processeur pour le coeur N, %"
#~ msgid "CPU Clock"
#~ msgstr "Horloge processeur"
#~ msgid ""
#~ "$cpucl - average CPU clock, MHz\n"
#~ "$cpucl0 - CPU clock for core 0, MHz\n"
#~ "...\n"
#~ "$cpucl9 - CPU clock for core 9, MHz\n"
#~ "...\n"
#~ "$cpuclN - CPU clock for core N, MHz"
#~ msgstr ""
#~ "$cpucl - Moyenne de l'horloge du processeur, MHz\n"
#~ "$cpucl0 - Horloge du coeur 0, MHz\n"
#~ "...\n"
#~ "$cpuclN - Horloge du coeur N, MHz"
#~ msgid "Temperature"
#~ msgstr "Température"
#~ msgid "$tempN - physical temperature on device N (from 0). Example: $temp0"
#~ msgstr ""
#~ "$tempN - Température physique du périphérique N (à partir de 0). Exemple: "
#~ "$temp0"
#~ msgid "GPU"
#~ msgstr "Processeur graphique"
#~ msgid "$gpu - gpu usage, %"
#~ msgstr "$gpu - utilisation du processeur graphique, %"
#~ msgid "GPU Temp"
#~ msgstr "Temp du processeur graphique"
#~ msgid "$gputemp - physical temperature on GPU"
#~ msgstr "$gputemp - Température physique du processeur graphique"
#~ msgid "Memory"
#~ msgstr "Mémoire"
#~ msgid ""
#~ "$mem - RAM usage, %\n"
#~ "$memmb - RAM usage, MB\n"
#~ "$memgb - RAM usage, GB\n"
#~ "$memtotmb - total RAM, MB\n"
#~ "$memtotgb - total RAM, GB"
#~ msgstr ""
#~ "$mem - utilisation de la RAM, %\n"
#~ "$memmb - utilisation de la RAM, MB\n"
#~ "$memgb - utilisation de la RAM, GB\n"
#~ "$memtotmb - RAM, MB\n"
#~ "$memtotgb - RAM, GB"
#~ msgid "Swap"
#~ msgstr "mémoire d'échange (swap)"
#~ msgid ""
#~ "$swap - swap usage, %\n"
#~ "$swapmb - swap usage, MB\n"
#~ "$swapgb - swap usage, GB\n"
#~ "$swaptotmb - total swap, MB\n"
#~ "$swaptotgb - total swap, GB"
#~ msgstr ""
#~ "$swap - utilisation swap, %\n"
#~ "$swapmb - utilisation swap, MB\n"
#~ "$swapgb - utilisation swap, MB\n"
#~ "$swaptotmb - swap, MB\n"
#~ "$swaptotgb - swap, GB"
#~ msgid ""
#~ "$hddN - usage for mount point N (from 0), %. Example: $hdd0\n"
#~ "$hddmbN - usage for mount point N (from 0), MB. Example: $hddmb0\n"
#~ "$hddgbN - usage for mount point N (from 0), GB. Example: $hddgb0\n"
#~ "$hddtotmbN - total size of mount point N (from 0), MB. Example: "
#~ "$hddtotmb0\n"
#~ "$hddtotgbN - total size of mount point N (from 0), GB. Example: $hddtotgb0"
#~ msgstr ""
#~ "$hddN - utilisation du point de montage N (à partir de 0), %. Exemple: "
#~ "$hdd0\n"
#~ "$hddmbN - utilisation du point de montage N (à partir de 0), MB. Exemple: "
#~ "$hddmb0\n"
#~ "$hddgbN - utilisation du point de montage N (à partir de 0), GB. Exemple: "
#~ "$hddgb0\n"
#~ "$hddtotmbN - taille totale de point de montage N (à partir de 0), MB. "
#~ "Exemple: $hddtotmb0\n"
#~ "$hddtotgbN - taille totale de point de montage N (à partir de 0), GB. "
#~ "Exemple: $hddtotgb0"
#~ msgid "HDD speed"
#~ msgstr "Vitesse HDD"
#~ msgid ""
#~ "$hddrN - read speed HDD N (from 0), KB/s. Example: $hddr0\n"
#~ "$hddwN - write speed HDD N (from 0), KB/s. Example: $hddw0"
#~ msgstr ""
#~ "$hddrN - vitesse de lecture HDD N (à partir de 0), KB/s. Exemple: $hddr0\n"
#~ "$hddwN - vitesse d'écriture HDD N (à partir de 0), KB/s. Exemple: $hddw0"
#~ msgid "HDD temp"
#~ msgstr "Température HDD"
#~ msgid ""
#~ "$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0"
#~ msgstr ""
#~ "$hddtempN - température physique du périphérique N (à partir de 0). "
#~ "Exemple: $hddtemp0"
#~ msgid "Network"
#~ msgstr "Réseau"
#~ msgid ""
#~ "$down - download speed, KB/s\n"
#~ "$up - upload speed, KB/s\n"
#~ "$netdev - current network device"
#~ msgstr ""
#~ "$down - vitesse de téléchargement, KB/s\n"
#~ "$up - vitesse ascendante, KB/s\n"
#~ "$netdev - périphérique réseau actuel"
#~ msgid "Battery"
#~ msgstr "Batterie"
#~ msgid ""
#~ "$bat - battery charge, %\n"
#~ "$ac - AC status"
#~ msgstr ""
#~ "$bat - charge de la batterie, %\n"
#~ "$ac - état de l'alimentation"
#~ msgid ""
#~ "$album - song album\n"
#~ "$artist - song artist\n"
#~ "$progress - song progress\n"
#~ "$time - song duration\n"
#~ "$title - song title"
#~ msgstr ""
#~ "$album - album du morceau\n"
#~ "$artist - artiste du morceau\n"
#~ "$progress - avancement du morceau\n"
#~ "$time - durée du morceau\n"
#~ "$title - titre du morceau"
#~ msgid "Processes"
#~ msgstr "Processus"
#~ msgid ""
#~ "$pscount - number of running processes\n"
#~ "$pstotal - total number of running processes\n"
#~ "$ps - list of running processes comma separated"
#~ msgstr ""
#~ "$pscount - nombre de processus actifs\n"
#~ "$pstotal - nombre total de processus actifs\n"
#~ "$ps - liste des processus actifs séparés par une virgule"
#~ msgid ""
#~ "$pkgcountN - number of packages which are available for updates, command "
#~ "N. For example $pkgcount0"
#~ msgstr ""
#~ "$pkgcountN - nombre de paquets à mettre à jour, commande N. Par exemple "
#~ "$pkgcount0"
#~ msgid "Custom"
#~ msgstr "Personnalisé"
#~ msgid ""
#~ "$customN - get output from custom command N (from N). Example `$custom0`"
#~ msgstr ""
#~ "$customN - sortie d'une commande personnelle N (à partir de 0). Exemple: "
#~ "$custom0"
#~ msgid "Widget settings"
#~ msgstr "Paramètres de l'applet"
#~ msgid "pacman -Qu"
#~ msgstr "pacman -Qu"
#~ msgid "apt-show-versions -u -b"
#~ msgstr "apt-show-versions -u -b"
#~ msgid "aptitude search '~U'"
#~ msgstr "aptitude search '~U'"
#~ msgid "yum list updates"
#~ msgstr "yum list updates"
#~ msgid "pkg_version -I -l '<'"
#~ msgstr "pkg_version -I -l '<'"
#~ msgid "urpmq --auto-select"
#~ msgstr "urpmq --auto-select"
#~ msgid "$hddN - usage for mount point N (from 0), %. Example: $hdd0"
#~ msgstr ""
#~ "$hddN - espace occupé sur le point de montage N (à partir de 0), %. "
#~ "Exemple: $hdd0"
#~ msgid "amarok"
#~ msgstr "amarok"
#~ msgid "mpd"
#~ msgstr "mpd"
#~ msgid "qmmp"
#~ msgstr "qmmp"
#~ msgid "auto"
#~ msgstr "auto"
#~ msgid "nvidia"
#~ msgstr "nvidia"
#~ msgid "ati"
#~ msgstr "ati"
#~ msgid ""
#~ "$ds - uptime days\n"
#~ "$hs - uptime hours\n"
#~ "$ms - uptime minutes"
#~ msgstr ""
#~ "$ds - uptime days\n"
#~ "$hs - uptime hours\n"
#~ "$ms - uptime minutes"
#~ msgid ""
#~ "Command to run, example:\n"
#~ "wget -qO- http://ifconfig.me/ip - get external IP"
#~ msgstr ""
#~ "Command to run, example:\n"
#~ "wget -qO- http://ifconfig.me/ip - get external IP"
#~ msgid "@@/;@@ - mount point usage, %"
#~ msgstr "@@/;@@ - mount point usage, %"
#~ msgid "@@/dev/sda@@ - physical temperature on /dev/sda"
#~ msgstr "@@/dev/sda@@ - physical temperature on /dev/sda"
#~ msgid ""
#~ "$net - network speed, down/up, KB/s\n"
#~ "$netdev - current network device\n"
#~ "@@eth0@@ - disable auto select device and set specified device"
#~ msgstr ""
#~ "$net - network speed, down/up, KB/s\n"
#~ "$netdev - current network device\n"
#~ "@@eth0@@ - disable auto select device and set specified device"

View File

@ -1,321 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
"POT-Creation-Date: 2014-09-21 20:18+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: awesome-widget.cpp:78
msgid "Run ksysguard"
msgstr ""
#: awesome-widget.cpp:81
msgid "Show README"
msgstr ""
#: awesome-widget.cpp:84
msgid "Update text"
msgstr ""
#: configuration.cpp:362 po/rc.cpp:151 rc.cpp:151
msgid "Custom command"
msgstr ""
#: configuration.cpp:392 po/rc.cpp:141 rc.cpp:141
msgid "Package manager"
msgstr ""
#: configuration.cpp:393 po/rc.cpp:144 rc.cpp:144
msgid "Null lines"
msgstr ""
#: configuration.cpp:405
msgid "Widget"
msgstr ""
#: configuration.cpp:406
msgid "Advanced"
msgstr ""
#: configuration.cpp:407
msgid "Tooltip"
msgstr ""
#: configuration.cpp:408
msgid "Appearance"
msgstr ""
#: configuration.cpp:409
msgid "DataEngine"
msgstr ""
#: configuration.cpp:697 configuration.cpp:711
msgid "Remove"
msgstr ""
#: configuration.cpp:766
msgid "Select font"
msgstr ""
#: po/rc.cpp:3 rc.cpp:3
msgid "Enable background"
msgstr ""
#: po/rc.cpp:6 rc.cpp:6
msgid "Enable popup on mouse click"
msgstr ""
#: po/rc.cpp:9 rc.cpp:9
msgid "Custom time format"
msgstr ""
#: po/rc.cpp:12 rc.cpp:12
msgid ""
"$dddd - long weekday\n"
"$ddd - short weekday\n"
"$dd - day\n"
"$d - day w\\o zero\n"
"$MMMM - long month\n"
"$MMM - short month\n"
"$MM - month\n"
"$M - month w\\o zero\n"
"$yyyy - year\n"
"$yy - short year\n"
"$hh - hours (24 only)\n"
"$h - hours w\\o zero (24 only)\n"
"$mm - minutes\n"
"$m - minutes w\\o zero\n"
"$ss - seconds\n"
"$s - seconds w\\o zero"
msgstr ""
#: po/rc.cpp:30 rc.cpp:30
msgid "Custom uptime format"
msgstr ""
#: po/rc.cpp:33 rc.cpp:33
msgid ""
"$dd - uptime days\n"
"$d - uptime days without zero\n"
"$hh - uptime hours\n"
"$h - uptime hours without zero\n"
"$mm - uptime minutes\n"
"$m - uptime minutes without zero"
msgstr ""
#: po/rc.cpp:41 rc.cpp:41
msgid "Temperature units"
msgstr ""
#: po/rc.cpp:44 rc.cpp:44
msgid "Temperature devices"
msgstr ""
#: po/rc.cpp:47 po/rc.cpp:53 po/rc.cpp:59 po/rc.cpp:65 po/rc.cpp:71 rc.cpp:47
#: rc.cpp:53 rc.cpp:59 rc.cpp:65 rc.cpp:71
msgid "Editable"
msgstr ""
#: po/rc.cpp:50 rc.cpp:50
msgid "Fan devices"
msgstr ""
#: po/rc.cpp:56 rc.cpp:56
msgid "Mount points"
msgstr ""
#: po/rc.cpp:62 rc.cpp:62
msgid "HDD devices (speed)"
msgstr ""
#: po/rc.cpp:68 rc.cpp:68
msgid "HDD devices (temp)"
msgstr ""
#: po/rc.cpp:74 rc.cpp:74
msgid "Disable auto select device and set specified device"
msgstr ""
#: po/rc.cpp:77 rc.cpp:77
msgid "Set network device"
msgstr ""
#: po/rc.cpp:80 rc.cpp:80
msgid "AC online tag"
msgstr ""
#: po/rc.cpp:83 rc.cpp:83
msgid "Line, which returns when AC is online"
msgstr ""
#: po/rc.cpp:86 rc.cpp:86
msgid "AC offline tag"
msgstr ""
#: po/rc.cpp:89 rc.cpp:89
msgid "Line, which returns when AC is offline"
msgstr ""
#: po/rc.cpp:92 rc.cpp:92
msgid "Time interval"
msgstr ""
#: po/rc.cpp:95 po/rc.cpp:196 rc.cpp:95 rc.cpp:196
msgid "Font"
msgstr ""
#: po/rc.cpp:98 rc.cpp:98
msgid "Font size"
msgstr ""
#: po/rc.cpp:101 rc.cpp:101
msgid "Font color"
msgstr ""
#: po/rc.cpp:104 rc.cpp:104
msgid "Font style"
msgstr ""
#: po/rc.cpp:107 rc.cpp:107
msgid "Font weight"
msgstr ""
#: po/rc.cpp:110 rc.cpp:110
msgid "HDD"
msgstr ""
#: po/rc.cpp:113 rc.cpp:113
msgid "MPD port"
msgstr ""
#: po/rc.cpp:116 rc.cpp:116
msgid "GPU device"
msgstr ""
#: po/rc.cpp:119 rc.cpp:119
msgid "hddtemp cmd"
msgstr ""
#: po/rc.cpp:122 rc.cpp:122
msgid "Music player"
msgstr ""
#: po/rc.cpp:125 rc.cpp:125
msgid "MPD address"
msgstr ""
#: po/rc.cpp:128 rc.cpp:128
msgid "Desktop check cmd"
msgstr ""
#: po/rc.cpp:131 rc.cpp:131
msgid "<b>NOTE:</b> Player DBus interface should be an active"
msgstr ""
#: po/rc.cpp:134 rc.cpp:134
msgid "MPRIS player name"
msgstr ""
#: po/rc.cpp:137 po/rc.cpp:147 rc.cpp:137 rc.cpp:147
msgid ""
"Editable\n"
"del - remove item"
msgstr ""
#: po/rc.cpp:154 rc.cpp:154
msgid "ACPI path"
msgstr ""
#: po/rc.cpp:157 rc.cpp:157
msgid "\"/sys/class/power_supply/\" by default"
msgstr ""
#: po/rc.cpp:160 rc.cpp:160
msgid ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
msgstr ""
#: po/rc.cpp:163 rc.cpp:163
msgid "Number of values for tooltips"
msgstr ""
#: po/rc.cpp:166 rc.cpp:166
msgid "Background"
msgstr ""
#: po/rc.cpp:169 rc.cpp:169
msgid "CPU color"
msgstr ""
#: po/rc.cpp:172 rc.cpp:172
msgid "CPU clock color"
msgstr ""
#: po/rc.cpp:175 rc.cpp:175
msgid "Memory color"
msgstr ""
#: po/rc.cpp:178 rc.cpp:178
msgid "Swap color"
msgstr ""
#: po/rc.cpp:181 rc.cpp:181
msgid "Download speed color"
msgstr ""
#: po/rc.cpp:184 rc.cpp:184
msgid "Upload speed color"
msgstr ""
#: po/rc.cpp:187 rc.cpp:187
msgid "Battery active color"
msgstr ""
#: po/rc.cpp:190 rc.cpp:190
msgid "Battery inactive color"
msgstr ""
#: po/rc.cpp:193 rc.cpp:193
msgid ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
msgstr ""
#: po/rc.cpp:199 rc.cpp:199
msgid "Ctrl+B"
msgstr ""
#: po/rc.cpp:202 rc.cpp:202
msgid "Ctrl+I"
msgstr ""
#: po/rc.cpp:205 rc.cpp:205
msgid "Ctrl+U"
msgstr ""
#: po/rc.cpp:208 rc.cpp:208
msgid "Add"
msgstr ""
#: po/rc.cpp:209 rc.cpp:209
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr ""
#: po/rc.cpp:210 rc.cpp:210
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr ""

View File

@ -1,594 +0,0 @@
# Copyright (C) 2014
# This file is distributed under the same license as the PyTextMonitor package.
#
# Evgeniy Alekseev <esalexeev@gmail.com>, 2014.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
"POT-Creation-Date: 2014-09-21 20:18+0400\n"
"PO-Revision-Date: 2014-09-05 11:21+0400\n"
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
"Language-Team: Brazilian Portuguese <kde-russian@lists.kde.ru>\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Lokalize 1.5\n"
#: awesome-widget.cpp:78
msgid "Run ksysguard"
msgstr "Abrir ksysguard"
#: awesome-widget.cpp:81
msgid "Show README"
msgstr "Mostrar README"
#: awesome-widget.cpp:84
msgid "Update text"
msgstr "Atualizar texto"
#: configuration.cpp:362 po/rc.cpp:151 rc.cpp:151
msgid "Custom command"
msgstr "Comando personalizado"
#: configuration.cpp:392 po/rc.cpp:141 rc.cpp:141
msgid "Package manager"
msgstr "Gerenciador de pacotes"
#: configuration.cpp:393 po/rc.cpp:144 rc.cpp:144
msgid "Null lines"
msgstr "Número de valores para dicas de contexto"
#: configuration.cpp:405
msgid "Widget"
msgstr "Widget"
#: configuration.cpp:406
msgid "Advanced"
msgstr "Avançado"
#: configuration.cpp:407
msgid "Tooltip"
msgstr "Dica de contexto"
#: configuration.cpp:408
msgid "Appearance"
msgstr "Aparência"
#: configuration.cpp:409
msgid "DataEngine"
msgstr "Engine de dados"
#: configuration.cpp:697 configuration.cpp:711
msgid "Remove"
msgstr "Remover"
#: configuration.cpp:766
msgid "Select font"
msgstr ""
#: po/rc.cpp:3 rc.cpp:3
msgid "Enable background"
msgstr ""
#: po/rc.cpp:6 rc.cpp:6
msgid "Enable popup on mouse click"
msgstr "Ativar popup no clique do mouse"
#: po/rc.cpp:9 rc.cpp:9
msgid "Custom time format"
msgstr "Formato de hora personalizado"
#: po/rc.cpp:12 rc.cpp:12
msgid ""
"$dddd - long weekday\n"
"$ddd - short weekday\n"
"$dd - day\n"
"$d - day w\\o zero\n"
"$MMMM - long month\n"
"$MMM - short month\n"
"$MM - month\n"
"$M - month w\\o zero\n"
"$yyyy - year\n"
"$yy - short year\n"
"$hh - hours (24 only)\n"
"$h - hours w\\o zero (24 only)\n"
"$mm - minutes\n"
"$m - minutes w\\o zero\n"
"$ss - seconds\n"
"$s - seconds w\\o zero"
msgstr ""
"$dddd - dia da semana completo\n"
"$ddd - dia da semana curto\n"
"$dd - dia\n"
"$d - dia com zero\n"
"$MMMM - mês completo\n"
"$MMM - mês curto\n"
"$MM - mês\n"
"$M - mês com zero\n"
"$hh - horas (somente 24)\n"
"$h - horas sem zeros (somente 24)\n"
"$mm - minutos\n"
"$m - minutos sem zeros\n"
"$ss - segundos\n"
"$s segundos sem zeros"
#: po/rc.cpp:30 rc.cpp:30
msgid "Custom uptime format"
msgstr "Tempo em atividade com formato personalizado"
#: po/rc.cpp:33 rc.cpp:33
msgid ""
"$dd - uptime days\n"
"$d - uptime days without zero\n"
"$hh - uptime hours\n"
"$h - uptime hours without zero\n"
"$mm - uptime minutes\n"
"$m - uptime minutes without zero"
msgstr ""
"$dd - tempo em atividade em dias\n"
"$d - tempo em atividade em dias sem zeros\n"
"$hh - tempo em atividade em horas\n"
"$h - tempo em atividade em horas sem zeros\n"
"$mm - tempo em atividade em minutos\n"
"$m - tempo em atividade em minuto sem zeros"
#: po/rc.cpp:41 rc.cpp:41
msgid "Temperature units"
msgstr "Unidades de temperatura"
#: po/rc.cpp:44 rc.cpp:44
msgid "Temperature devices"
msgstr "Dispositivos de temperatura"
#: po/rc.cpp:47 po/rc.cpp:53 po/rc.cpp:59 po/rc.cpp:65 po/rc.cpp:71 rc.cpp:47
#: rc.cpp:53 rc.cpp:59 rc.cpp:65 rc.cpp:71
msgid "Editable"
msgstr "Editável"
#: po/rc.cpp:50 rc.cpp:50
#, fuzzy
msgid "Fan devices"
msgstr "Dispositivo do carregador"
#: po/rc.cpp:56 rc.cpp:56
msgid "Mount points"
msgstr "Pontos de montagem"
#: po/rc.cpp:62 rc.cpp:62
msgid "HDD devices (speed)"
msgstr "Dispositivos HDD (velocidade) "
#: po/rc.cpp:68 rc.cpp:68
msgid "HDD devices (temp)"
msgstr "Dispositivos HDD (temperatura)"
#: po/rc.cpp:74 rc.cpp:74
msgid "Disable auto select device and set specified device"
msgstr ""
"Desativar auto seleção de dispositivos e escolher um dispositivo específico"
#: po/rc.cpp:77 rc.cpp:77
msgid "Set network device"
msgstr "Escolher dispositivo de rede"
#: po/rc.cpp:80 rc.cpp:80
msgid "AC online tag"
msgstr "Rótulo com carregador conectado"
#: po/rc.cpp:83 rc.cpp:83
msgid "Line, which returns when AC is online"
msgstr "Linha, que aparece quando o carregador está conectado"
#: po/rc.cpp:86 rc.cpp:86
msgid "AC offline tag"
msgstr "Rótulo com carregador desconectado"
#: po/rc.cpp:89 rc.cpp:89
msgid "Line, which returns when AC is offline"
msgstr "Linha, que aparece quando o carregador está offline"
#: po/rc.cpp:92 rc.cpp:92
msgid "Time interval"
msgstr "Intervalo de tempo"
#: po/rc.cpp:95 po/rc.cpp:196 rc.cpp:95 rc.cpp:196
msgid "Font"
msgstr "Tamanho da fonte"
#: po/rc.cpp:98 rc.cpp:98
msgid "Font size"
msgstr "Tamanho da fonte"
#: po/rc.cpp:101 rc.cpp:101
msgid "Font color"
msgstr "Cor da fonte"
#: po/rc.cpp:104 rc.cpp:104
msgid "Font style"
msgstr "Estilo da fonte"
#: po/rc.cpp:107 rc.cpp:107
msgid "Font weight"
msgstr "Peso da fonte"
#: po/rc.cpp:110 rc.cpp:110
msgid "HDD"
msgstr "HDD"
#: po/rc.cpp:113 rc.cpp:113
msgid "MPD port"
msgstr "Porta do MPD"
#: po/rc.cpp:116 rc.cpp:116
msgid "GPU device"
msgstr "Dispositivo GPU"
#: po/rc.cpp:119 rc.cpp:119
msgid "hddtemp cmd"
msgstr "comando hddtemp "
#: po/rc.cpp:122 rc.cpp:122
msgid "Music player"
msgstr "Reprodutor de áudio"
#: po/rc.cpp:125 rc.cpp:125
msgid "MPD address"
msgstr "Endereço do MPD"
#: po/rc.cpp:128 rc.cpp:128
msgid "Desktop check cmd"
msgstr ""
#: po/rc.cpp:131 rc.cpp:131
msgid "<b>NOTE:</b> Player DBus interface should be an active"
msgstr ""
#: po/rc.cpp:134 rc.cpp:134
msgid "MPRIS player name"
msgstr ""
#: po/rc.cpp:137 po/rc.cpp:147 rc.cpp:137 rc.cpp:147
msgid ""
"Editable\n"
"del - remove item"
msgstr ""
"Editável\n"
"del - remover item"
#: po/rc.cpp:154 rc.cpp:154
msgid "ACPI path"
msgstr ""
#: po/rc.cpp:157 rc.cpp:157
#, fuzzy
msgid "\"/sys/class/power_supply/\" by default"
msgstr "\"/sys/class/power_supply/AC/online\" por padrão"
#: po/rc.cpp:160 rc.cpp:160
msgid ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
msgstr ""
"Os rótulos de CPU, frequência de GPU, memória, swap e rede suportam dica de "
"contexto gráfica. Para ativá-los, basta selecionar a caixa necessária."
#: po/rc.cpp:163 rc.cpp:163
msgid "Number of values for tooltips"
msgstr "Número de valores para dicas de contexto"
#: po/rc.cpp:166 rc.cpp:166
msgid "Background"
msgstr ""
#: po/rc.cpp:169 rc.cpp:169
msgid "CPU color"
msgstr "Cor da frequência da GPU"
#: po/rc.cpp:172 rc.cpp:172
msgid "CPU clock color"
msgstr "Cor da frequência da GPU"
#: po/rc.cpp:175 rc.cpp:175
msgid "Memory color"
msgstr "Cor da memória"
#: po/rc.cpp:178 rc.cpp:178
msgid "Swap color"
msgstr "Cor do swap"
#: po/rc.cpp:181 rc.cpp:181
msgid "Download speed color"
msgstr "Cor da velocidade de download"
#: po/rc.cpp:184 rc.cpp:184
msgid "Upload speed color"
msgstr "Cor da velocidade de upload"
#: po/rc.cpp:187 rc.cpp:187
msgid "Battery active color"
msgstr ""
#: po/rc.cpp:190 rc.cpp:190
#, fuzzy
msgid "Battery inactive color"
msgstr "Dispositivo do carregador"
#: po/rc.cpp:193 rc.cpp:193
msgid ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
msgstr ""
"Informações detalhadas podem ser encontradas na <a href=\"http://arcanis."
"name/projects/awesome-widgets/\">página do projeto</a>"
#: po/rc.cpp:199 rc.cpp:199
msgid "Ctrl+B"
msgstr "Ctrl+B"
#: po/rc.cpp:202 rc.cpp:202
msgid "Ctrl+I"
msgstr "Ctrl+I"
#: po/rc.cpp:205 rc.cpp:205
msgid "Ctrl+U"
msgstr "Ctrl+U"
#: po/rc.cpp:208 rc.cpp:208
msgid "Add"
msgstr "Adicionar"
#: po/rc.cpp:209 rc.cpp:209
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "under"
#: po/rc.cpp:210 rc.cpp:210
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "dreanazous@gmail.com"
#~ msgid "Battery device"
#~ msgstr "Dispositivo do carregador"
#~ msgid "\"/sys/class/power_supply/BAT0/capacity\" by default"
#~ msgstr "\"/sys/class/power_supply/BAT0/capacity\" por padrão"
#~ msgid "Vertical layout"
#~ msgstr "Layout vertical"
#~ msgid "Add stretch to left/top of the layout"
#~ msgstr "Adicionar esticamento à esquerda/topo do layout"
#~ msgid "Add stretch to right/bottom of the layout"
#~ msgstr "Adicionar esticamento à direita/inferior do layout"
#~ msgid "Form"
#~ msgstr "Forma"
#~ msgid "Network directory"
#~ msgstr "Diretório de rede"
#~ msgid "\"/sys/class/net\" by default"
#~ msgstr "\"/sys/class/power_supply/AC/online\" por padrão"
#~ msgid "Custom command to run"
#~ msgstr "Comando personalizado para usar"
#~ msgid "Time"
#~ msgstr "Hora"
#~ msgid ""
#~ "$time - time in default format\n"
#~ "$isotime - time in ISO format\n"
#~ "$shorttime - time in short format\n"
#~ "$longtime - time in log format\n"
#~ "$custom - custom time format"
#~ msgstr ""
#~ "$time - hora no formato padrão\n"
#~ "$isotime - hora no formato ISO\n"
#~ "$shorttime - hora em formato curto \n"
#~ "$longtime - hora em formato completo\n"
#~ "$custom - hora em formato personalizado"
#~ msgid "Uptime"
#~ msgstr "Tempo em atividade"
#~ msgid ""
#~ "$uptime - system uptime\n"
#~ "$custom - custom format"
#~ msgstr ""
#~ "$uptime - tempo em atividade do sistema\n"
#~ "$custom - formato personalizado "
#~ msgid "CPU"
#~ msgstr "CPU"
#~ msgid ""
#~ "$cpu - total load CPU, %\n"
#~ "$cpu0 - load CPU for core 0, %\n"
#~ "...\n"
#~ "$cpu9 - load CPU for core 9, %\n"
#~ "...\n"
#~ "$cpuN - load CPU for core N, %"
#~ msgstr ""
#~ "$cpu - carga total da CPU, %\n"
#~ "$cpu0 - carga total para o núcleo 0 da CPU, %\n"
#~ "...\n"
#~ "$cpu9 - carga total para o núcleo 9 da CPU, %\n"
#~ "...\n"
#~ "$cpuN - carga total para o núcleo N da CPU, %"
#~ msgid "CPU Clock"
#~ msgstr "Frequência da CPU "
#~ msgid ""
#~ "$cpucl - average CPU clock, MHz\n"
#~ "$cpucl0 - CPU clock for core 0, MHz\n"
#~ "...\n"
#~ "$cpucl9 - CPU clock for core 9, MHz\n"
#~ "...\n"
#~ "$cpuclN - CPU clock for core N, MHz"
#~ msgstr ""
#~ "$cpucl - frequência média da CPU, MHz\n"
#~ "$cpucl0 - frequência da CPU para o núcleo 0, MHz\n"
#~ "...\n"
#~ "$cpucl9 - frequência da CPU para o núcleo 9, MHz\n"
#~ "...\n"
#~ "$cpuclN - frequência da CPU para o núcleo N, MHz"
#~ msgid "Temperature"
#~ msgstr "Temperatura "
#~ msgid "$tempN - physical temperature on device N (from 0). Example: $temp0"
#~ msgstr ""
#~ "$hddtempN - temperatura física no dispositivo N (começando por 0). "
#~ "Exemplo: $hddtemp0"
#~ msgid "GPU"
#~ msgstr "GPU"
#~ msgid "$gpu - gpu usage, %"
#~ msgstr "$gpu - uso da GPU, %"
#~ msgid "GPU Temp"
#~ msgstr "Temperatura da GPU"
#~ msgid "$gputemp - physical temperature on GPU"
#~ msgstr "$gputemp - temperatura física da GPU"
#~ msgid "Memory"
#~ msgstr "Memória"
#~ msgid ""
#~ "$mem - RAM usage, %\n"
#~ "$memmb - RAM usage, MB\n"
#~ "$memgb - RAM usage, GB\n"
#~ "$memtotmb - total RAM, MB\n"
#~ "$memtotgb - total RAM, GB"
#~ msgstr ""
#~ "$mem - uso de RAM, %\n"
#~ "$memmb - uso de RAM, MB\n"
#~ "$memgb - uso de RAM, GB\n"
#~ "$memtotmb - RAM total, MB\n"
#~ "$memtotgb - RAM total, GB"
#~ msgid "Swap"
#~ msgstr "Swap"
#~ msgid ""
#~ "$swap - swap usage, %\n"
#~ "$swapmb - swap usage, MB\n"
#~ "$swapgb - swap usage, GB\n"
#~ "$swaptotmb - total swap, MB\n"
#~ "$swaptotgb - total swap, GB"
#~ msgstr ""
#~ "$swap - uso de swap, %\n"
#~ "$swapmb - uso de swap, MB\n"
#~ "$swapgb - uso de swap, GB\n"
#~ "$swaptotmb - swap total, MB\n"
#~ "$swaptotgb - swap total, GB"
#~ msgid ""
#~ "$hddN - usage for mount point N (from 0), %. Example: $hdd0\n"
#~ "$hddmbN - usage for mount point N (from 0), MB. Example: $hddmb0\n"
#~ "$hddgbN - usage for mount point N (from 0), GB. Example: $hddgb0\n"
#~ "$hddtotmbN - total size of mount point N (from 0), MB. Example: "
#~ "$hddtotmb0\n"
#~ "$hddtotgbN - total size of mount point N (from 0), GB. Example: $hddtotgb0"
#~ msgstr ""
#~ "$hddN - uso do ponto de montagem N (começando por 0), %. Exemplo: $hdd0\n"
#~ "$hddmbN - uso do ponto de montagem N (começando por 0), MB. Exemplo: "
#~ "$hddmb0\n"
#~ "$hddgbN - uso do ponto de montagem N (começando por 0), GB. Exemplo: "
#~ "$hddgbN0\n"
#~ "$hddtotmbN - tamanho total do ponto de montagem N (começando por 0), MB. "
#~ "Exemplo: $hddtotmbN\n"
#~ "$hddtotgbN - tamanho total do ponto de montagem N (começando por 0), GB. "
#~ "Exemplo: $hddtogbN"
#~ msgid "HDD speed"
#~ msgstr "Velocidade do HDD"
#~ msgid ""
#~ "$hddrN - read speed HDD N (from 0), KB/s. Example: $hddr0\n"
#~ "$hddwN - write speed HDD N (from 0), KB/s. Example: $hddw0"
#~ msgstr ""
#~ "$hddrN - velocidade de leitura do HDD (começando por 0), KB/s. Exemplo: "
#~ "$hddr0\n"
#~ "$hddwN - velocidade de escrita do HDD (começando por 0), Kb/s. Exemplo: "
#~ "$hddw0"
#~ msgid "HDD temp"
#~ msgstr "Temperatura do HDD "
#~ msgid ""
#~ "$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0"
#~ msgstr ""
#~ "$hddtempN - temperatura física no dispositivo N (começando por 0). "
#~ "Exemplo: $hddtemp0"
#~ msgid "Network"
#~ msgstr "Rede"
#~ msgid ""
#~ "$down - download speed, KB/s\n"
#~ "$up - upload speed, KB/s\n"
#~ "$netdev - current network device"
#~ msgstr ""
#~ "$down - velocidade de download, KB/s\n"
#~ "$up - velocidade de upload, KB/s\n"
#~ "$netdev - dispositivo de rede atual"
#~ msgid "Battery"
#~ msgstr "Bateria"
#~ msgid ""
#~ "$bat - battery charge, %\n"
#~ "$ac - AC status"
#~ msgstr ""
#~ "bateria - carga da bateria, %\n"
#~ "$ac - status do carregador"
#~ msgid ""
#~ "$album - song album\n"
#~ "$artist - song artist\n"
#~ "$progress - song progress\n"
#~ "$time - song duration\n"
#~ "$title - song title"
#~ msgstr ""
#~ "$album - album da música\n"
#~ "$artist - artista da música\n"
#~ "$progress - progresso da música\n"
#~ "$time - duração da música\n"
#~ "$title - título da música"
#~ msgid "Processes"
#~ msgstr "Processos "
#~ msgid ""
#~ "$pscount - number of running processes\n"
#~ "$pstotal - total number of running processes\n"
#~ "$ps - list of running processes comma separated"
#~ msgstr ""
#~ "$pscount - número de processos rodando\n"
#~ "$pstotal - número total de processos rodando\n"
#~ "$ps - lista dos processos rodando separados por vírgula"
#~ msgid ""
#~ "$pkgcountN - number of packages which are available for updates, command "
#~ "N. For example $pkgcount0"
#~ msgstr ""
#~ "$pkgcountN - número de pacotes disponíveis para atualizar, comando N. Por "
#~ "exemplo $pkgcount0"
#~ msgid "Custom"
#~ msgstr "Personalizado"
#~ msgid ""
#~ "$customN - get output from custom command N (from N). Example `$custom0`"
#~ msgstr ""
#~ "$customN - leia a saída de um comando personalizado N (a partir de N). "
#~ "Exemplo: `$custom0`"

View File

@ -1,684 +0,0 @@
# Copyright (C) 2014
# This file is distributed under the same license as the PyTextMonitor package.
#
# Evgeniy Alekseev <esalexeev@gmail.com>, 2014.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
"POT-Creation-Date: 2014-09-21 20:18+0400\n"
"PO-Revision-Date: 2014-09-21 20:19+0400\n"
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
"Language-Team: Russian <kde-russian@lists.kde.ru>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Lokalize 1.5\n"
#: awesome-widget.cpp:78
msgid "Run ksysguard"
msgstr "Запустить ksysguard"
#: awesome-widget.cpp:81
msgid "Show README"
msgstr "Показать README"
#: awesome-widget.cpp:84
msgid "Update text"
msgstr "Обновить текст"
#: configuration.cpp:362 po/rc.cpp:151 rc.cpp:151
msgid "Custom command"
msgstr "Своя команда"
#: configuration.cpp:392 po/rc.cpp:141 rc.cpp:141
msgid "Package manager"
msgstr "Пакетный менеджер"
#: configuration.cpp:393 po/rc.cpp:144 rc.cpp:144
msgid "Null lines"
msgstr "Число пустых линий"
#: configuration.cpp:405
msgid "Widget"
msgstr "Виджет"
#: configuration.cpp:406
msgid "Advanced"
msgstr "Расширенные"
#: configuration.cpp:407
msgid "Tooltip"
msgstr "Тултип"
#: configuration.cpp:408
msgid "Appearance"
msgstr "Внешний вид"
#: configuration.cpp:409
msgid "DataEngine"
msgstr "DataEngine"
#: configuration.cpp:697 configuration.cpp:711
msgid "Remove"
msgstr "Удалить"
#: configuration.cpp:766
msgid "Select font"
msgstr "Выберете шрифт"
#: po/rc.cpp:3 rc.cpp:3
msgid "Enable background"
msgstr "Включить фон"
#: po/rc.cpp:6 rc.cpp:6
msgid "Enable popup on mouse click"
msgstr "Включить сообщения по клику мыши"
#: po/rc.cpp:9 rc.cpp:9
msgid "Custom time format"
msgstr "Свой формат времени"
#: po/rc.cpp:12 rc.cpp:12
msgid ""
"$dddd - long weekday\n"
"$ddd - short weekday\n"
"$dd - day\n"
"$d - day w\\o zero\n"
"$MMMM - long month\n"
"$MMM - short month\n"
"$MM - month\n"
"$M - month w\\o zero\n"
"$yyyy - year\n"
"$yy - short year\n"
"$hh - hours (24 only)\n"
"$h - hours w\\o zero (24 only)\n"
"$mm - minutes\n"
"$m - minutes w\\o zero\n"
"$ss - seconds\n"
"$s - seconds w\\o zero"
msgstr ""
"$dddd - день недели (длинный)\n"
"$ddd - день недели (короткий)\n"
"$dd - день\n"
"$d - день без 0\n"
"$MMMM - месяц (длинный)\n"
"$MMM - месяц (короткий)\n"
"$MM - месяц\n"
"$M - месяц без 0\n"
"$yyyy - год\n"
"$yy - год (короткий)\n"
"$hh - часы (24)\n"
"$h - часы без 0 (24)\n"
"$mm - минуты\n"
"$m - минуты без 0\n"
"$ss - секунды\n"
"$s - секунды без 0"
#: po/rc.cpp:30 rc.cpp:30
msgid "Custom uptime format"
msgstr "Свой формат аптайма"
#: po/rc.cpp:33 rc.cpp:33
msgid ""
"$dd - uptime days\n"
"$d - uptime days without zero\n"
"$hh - uptime hours\n"
"$h - uptime hours without zero\n"
"$mm - uptime minutes\n"
"$m - uptime minutes without zero"
msgstr ""
"$dd - дни аптайма\n"
"$d - дни аптайма без нулей\n"
"$hh - часы аптайма\n"
"$h - часы аптайма без нулей\n"
"$mm - минуты аптайма\n"
"$m - минуты аптайма без нулей"
#: po/rc.cpp:41 rc.cpp:41
msgid "Temperature units"
msgstr "Температурные единицы"
#: po/rc.cpp:44 rc.cpp:44
msgid "Temperature devices"
msgstr "Температурные устройства"
#: po/rc.cpp:47 po/rc.cpp:53 po/rc.cpp:59 po/rc.cpp:65 po/rc.cpp:71 rc.cpp:47
#: rc.cpp:53 rc.cpp:59 rc.cpp:65 rc.cpp:71
msgid "Editable"
msgstr "Редактируемо"
#: po/rc.cpp:50 rc.cpp:50
msgid "Fan devices"
msgstr "Кулеры"
#: po/rc.cpp:56 rc.cpp:56
msgid "Mount points"
msgstr "Точки монтирования"
#: po/rc.cpp:62 rc.cpp:62
msgid "HDD devices (speed)"
msgstr "HDD (скорость)"
#: po/rc.cpp:68 rc.cpp:68
msgid "HDD devices (temp)"
msgstr "HDD (температура)"
#: po/rc.cpp:74 rc.cpp:74
msgid "Disable auto select device and set specified device"
msgstr "Отключить автовыбор устройства и использовать указанное"
#: po/rc.cpp:77 rc.cpp:77
msgid "Set network device"
msgstr "Выберете сетевое устройство"
#: po/rc.cpp:80 rc.cpp:80
msgid "AC online tag"
msgstr "AC подключен"
#: po/rc.cpp:83 rc.cpp:83
msgid "Line, which returns when AC is online"
msgstr "Строка, возвращаемая при подключенном адаптере питания"
#: po/rc.cpp:86 rc.cpp:86
msgid "AC offline tag"
msgstr "AC отключен"
#: po/rc.cpp:89 rc.cpp:89
msgid "Line, which returns when AC is offline"
msgstr "Строка, возвращаемая при отключенном адаптере питания"
#: po/rc.cpp:92 rc.cpp:92
msgid "Time interval"
msgstr "Интервал обновления"
#: po/rc.cpp:95 po/rc.cpp:196 rc.cpp:95 rc.cpp:196
msgid "Font"
msgstr "Шрифт"
#: po/rc.cpp:98 rc.cpp:98
msgid "Font size"
msgstr "Размер шрифта"
#: po/rc.cpp:101 rc.cpp:101
msgid "Font color"
msgstr "Цвет шрифта"
#: po/rc.cpp:104 rc.cpp:104
msgid "Font style"
msgstr "Стиль шрифта"
#: po/rc.cpp:107 rc.cpp:107
msgid "Font weight"
msgstr "Ширина шрифта"
#: po/rc.cpp:110 rc.cpp:110
msgid "HDD"
msgstr "HDD"
#: po/rc.cpp:113 rc.cpp:113
msgid "MPD port"
msgstr "Порт сервера MPD"
#: po/rc.cpp:116 rc.cpp:116
msgid "GPU device"
msgstr "Устройство GPU"
#: po/rc.cpp:119 rc.cpp:119
msgid "hddtemp cmd"
msgstr "Команда hddtemp"
#: po/rc.cpp:122 rc.cpp:122
msgid "Music player"
msgstr "Музыкальный плеер"
#: po/rc.cpp:125 rc.cpp:125
msgid "MPD address"
msgstr "Адрес сервера MPD"
#: po/rc.cpp:128 rc.cpp:128
msgid "Desktop check cmd"
msgstr "Команда для проверки рабочего стола"
#: po/rc.cpp:131 rc.cpp:131
msgid "<b>NOTE:</b> Player DBus interface should be an active"
msgstr "<b>ВНИМАНИЕ:</b> DBus интерфейс плеера должен быть активен"
#: po/rc.cpp:134 rc.cpp:134
msgid "MPRIS player name"
msgstr "Имя плеера в MPRIS"
#: po/rc.cpp:137 po/rc.cpp:147 rc.cpp:137 rc.cpp:147
msgid ""
"Editable\n"
"del - remove item"
msgstr ""
"Редактируемо\n"
"del - удалить строку"
#: po/rc.cpp:154 rc.cpp:154
msgid "ACPI path"
msgstr "Пусть к ACPI"
#: po/rc.cpp:157 rc.cpp:157
msgid "\"/sys/class/power_supply/\" by default"
msgstr "\"/sys/class/power_supply/\" по умолчанию"
#: po/rc.cpp:160 rc.cpp:160
msgid ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
msgstr ""
"Поля \"CPU\", \"Частота CPU\", \"Память\", \"Swap\", \"Сеть\" поддерживают "
"графический тултип. Чтобы включить его, просто сделайте требуемые чекбоксы "
"полностью чекнутыми."
#: po/rc.cpp:163 rc.cpp:163
msgid "Number of values for tooltips"
msgstr "Число хранящихся значений"
#: po/rc.cpp:166 rc.cpp:166
msgid "Background"
msgstr "Фон"
#: po/rc.cpp:169 rc.cpp:169
msgid "CPU color"
msgstr "Цвет CPU"
#: po/rc.cpp:172 rc.cpp:172
msgid "CPU clock color"
msgstr "Цвет частоты CPU"
#: po/rc.cpp:175 rc.cpp:175
msgid "Memory color"
msgstr "Цвет памяти"
#: po/rc.cpp:178 rc.cpp:178
msgid "Swap color"
msgstr "Цвет swap"
#: po/rc.cpp:181 rc.cpp:181
msgid "Download speed color"
msgstr "Цвет скорости загрузки"
#: po/rc.cpp:184 rc.cpp:184
msgid "Upload speed color"
msgstr "Цвет скорости отдачи"
#: po/rc.cpp:187 rc.cpp:187
msgid "Battery active color"
msgstr "Цвет заряжаемой батареи"
#: po/rc.cpp:190 rc.cpp:190
msgid "Battery inactive color"
msgstr "Цвет разряжаемой батареи"
#: po/rc.cpp:193 rc.cpp:193
msgid ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
msgstr ""
"Подробная информация может быть найдена на <a href=\"http://arcanis.name/ru/"
"projects/awesome-widgets/\">домашней странице проекта</a>"
#: po/rc.cpp:199 rc.cpp:199
msgid "Ctrl+B"
msgstr "Ctrl+B"
#: po/rc.cpp:202 rc.cpp:202
msgid "Ctrl+I"
msgstr "Ctrl+I"
#: po/rc.cpp:205 rc.cpp:205
msgid "Ctrl+U"
msgstr "Ctrl+U"
#: po/rc.cpp:208 rc.cpp:208
msgid "Add"
msgstr "Добавить"
#: po/rc.cpp:209 rc.cpp:209
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "Evgeniy Alekseev"
#: po/rc.cpp:210 rc.cpp:210
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "esalexeev@gmail.com"
#~ msgid "Battery device"
#~ msgstr "Устройство батареи"
#~ msgid "\"/sys/class/power_supply/BAT0/capacity\" by default"
#~ msgstr "\"/sys/class/power_supply/BAT0/capacity\" по умолчанию"
#~ msgid "Vertical layout"
#~ msgstr "Вертикальная разметка"
#~ msgid "Add stretch to left/top of the layout"
#~ msgstr "Добавить пустое место слева/вверху виджета"
#~ msgid "Add stretch to right/bottom of the layout"
#~ msgstr "Добавить пустое место справа/внизу виджета"
#~ msgid "Advanced configuration"
#~ msgstr "Расширенная настройка"
#~ msgid "Appearance configuration"
#~ msgstr "Настройка внешнего вида"
#~ msgid "DE Configuration"
#~ msgstr "Настройка DE"
#~ msgid "Tooltip configuration"
#~ msgstr "Настройка тултипа"
#~ msgid "Widget configuration"
#~ msgstr "Настройка виджета"
#~ msgid "Form"
#~ msgstr "Form"
#~ msgid "Network directory"
#~ msgstr "Путь к интерфейсам"
#~ msgid "\"/sys/class/net\" by default"
#~ msgstr "\"/sys/class/net\" по умолчанию"
#~ msgid "Custom command to run"
#~ msgstr "Своя команда для запуска"
#~ msgid "Time"
#~ msgstr "Время"
#~ msgid ""
#~ "$time - time in default format\n"
#~ "$isotime - time in ISO format\n"
#~ "$shorttime - time in short format\n"
#~ "$longtime - time in log format\n"
#~ "$custom - custom time format"
#~ msgstr ""
#~ "$time - время в стандартном формате\n"
#~ "$isotime - время в ISO формате\n"
#~ "$shorttime - время в коротком формате\n"
#~ "$longtime - время в длинном формате\n"
#~ "$custom - свой формат времени"
#~ msgid "Uptime"
#~ msgstr "Время работы"
#~ msgid ""
#~ "$uptime - system uptime\n"
#~ "$custom - custom format"
#~ msgstr ""
#~ "$uptime - время работы\n"
#~ "$custom - свой формат"
#~ msgid "CPU"
#~ msgstr "CPU"
#~ msgid ""
#~ "$cpu - total load CPU, %\n"
#~ "$cpu0 - load CPU for core 0, %\n"
#~ "...\n"
#~ "$cpu9 - load CPU for core 9, %\n"
#~ "...\n"
#~ "$cpuN - load CPU for core N, %"
#~ msgstr ""
#~ "$cpu - общая загрузка CPU, %\n"
#~ "$cpu0 - загрузка CPU для ядра 0, %\n"
#~ "...\n"
#~ "$cpu9 - загрузка CPU для ядра 9, %\n"
#~ "...\n"
#~ "$cpuN - загрузка CPU для ядра N, %"
#~ msgid "CPU Clock"
#~ msgstr "Частота CPU"
#~ msgid ""
#~ "$cpucl - average CPU clock, MHz\n"
#~ "$cpucl0 - CPU clock for core 0, MHz\n"
#~ "...\n"
#~ "$cpucl9 - CPU clock for core 9, MHz\n"
#~ "...\n"
#~ "$cpuclN - CPU clock for core N, MHz"
#~ msgstr ""
#~ "$cpucl - средняя частота CPU, MHz\n"
#~ "$cpucl0 - частота CPU для ядра 0, MHz\n"
#~ "...\n"
#~ "$cpucl9 - частота CPU для ядра 9, MHz\n"
#~ "...\n"
#~ "$cpuclN - частота CPU для ядра N, MHz"
#~ msgid "Temperature"
#~ msgstr "Температура"
#~ msgid "$tempN - physical temperature on device N (from 0). Example: $temp0"
#~ msgstr ""
#~ "$tempN - физическая температура на устройстве N (от 0). Пример: $temp0"
#~ msgid "GPU"
#~ msgstr "GPU"
#~ msgid "$gpu - gpu usage, %"
#~ msgstr "$gpu - использование GPU, %"
#~ msgid "GPU Temp"
#~ msgstr "Температура GPU"
#~ msgid "$gputemp - physical temperature on GPU"
#~ msgstr "$gputemp - физическая температура на GPU"
#~ msgid "Memory"
#~ msgstr "Память"
#~ msgid ""
#~ "$mem - RAM usage, %\n"
#~ "$memmb - RAM usage, MB\n"
#~ "$memgb - RAM usage, GB\n"
#~ "$memtotmb - total RAM, MB\n"
#~ "$memtotgb - total RAM, GB"
#~ msgstr ""
#~ "$mem - использование RAM, %\n"
#~ "$memmb - использование RAM, MB\n"
#~ "$memgb - использование RAM, GB\n"
#~ "$memtotmb - RAM, MB\n"
#~ "$memtotgb - RAM, GB"
#~ msgid "Swap"
#~ msgstr "Swap"
#~ msgid ""
#~ "$swap - swap usage, %\n"
#~ "$swapmb - swap usage, MB\n"
#~ "$swapgb - swap usage, GB\n"
#~ "$swaptotmb - total swap, MB\n"
#~ "$swaptotgb - total swap, GB"
#~ msgstr ""
#~ "$swap - использование swap, %\n"
#~ "$swapmb - использование swap, MB\n"
#~ "$swapgb - использование swap, GB\n"
#~ "$swaptotmb - swap, MB\n"
#~ "$swaptotgb - swap, GB"
#~ msgid ""
#~ "$hddN - usage for mount point N (from 0), %. Example: $hdd0\n"
#~ "$hddmbN - usage for mount point N (from 0), MB. Example: $hddmb0\n"
#~ "$hddgbN - usage for mount point N (from 0), GB. Example: $hddgb0\n"
#~ "$hddtotmbN - total size of mount point N (from 0), MB. Example: "
#~ "$hddtotmb0\n"
#~ "$hddtotgbN - total size of mount point N (from 0), GB. Example: $hddtotgb0"
#~ msgstr ""
#~ "$hddN - использование точки монтирования N (от 0), %. Пример: $hdd0\n"
#~ "$hddmbN - использование точки монтирования N (от 0), MB. Пример: $hddmb0\n"
#~ "$hddgbN - использование точки монтирования N (от 0), GB. Пример: $hddgb0\n"
#~ "$hddtotmbN - размер точки монтирования N (от 0), MB. Пример: $hddtotmb0\n"
#~ "$hddtotgbN - размер точки монтирования N (от 0), GB. Пример: $hddtotgb0"
#~ msgid "HDD speed"
#~ msgstr "Скорость HDD"
#~ msgid ""
#~ "$hddrN - read speed HDD N (from 0), KB/s. Example: $hddr0\n"
#~ "$hddwN - write speed HDD N (from 0), KB/s. Example: $hddw0"
#~ msgstr ""
#~ "$hddrN - скорость записи на HDD N (от 0), KB/s. Например: $hddr0\n"
#~ "$hddwN - скорость чтения с HDD N (от 0), KB/s. Например: $hddw0"
#~ msgid "HDD temp"
#~ msgstr "Температура HDD"
#~ msgid ""
#~ "$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0"
#~ msgstr "$hddtempN - температура на устройстве N (от 0). Пример: $hddtemp0"
#~ msgid "Network"
#~ msgstr "Сеть"
#~ msgid ""
#~ "$down - download speed, KB/s\n"
#~ "$up - upload speed, KB/s\n"
#~ "$netdev - current network device"
#~ msgstr ""
#~ "$down - скорость скачки, KB/s\n"
#~ "$up - скорость загрузки, KB/s\n"
#~ "$netdev - текущее устройство"
#~ msgid "Battery"
#~ msgstr "Батарея"
#~ msgid ""
#~ "$bat - battery charge, %\n"
#~ "$ac - AC status"
#~ msgstr ""
#~ "$bat - заряд батареи, %\n"
#~ "$ac - статус адаптера питания"
#~ msgid ""
#~ "$album - song album\n"
#~ "$artist - song artist\n"
#~ "$progress - song progress\n"
#~ "$time - song duration\n"
#~ "$title - song title"
#~ msgstr ""
#~ "$album - альбом\n"
#~ "$artist - исполнитель\n"
#~ "$progress - прогресс\n"
#~ "$time - продолжительность\n"
#~ "$title - название"
#~ msgid "Processes"
#~ msgstr "Процессы"
#~ msgid ""
#~ "$pscount - number of running processes\n"
#~ "$pstotal - total number of running processes\n"
#~ "$ps - list of running processes comma separated"
#~ msgstr ""
#~ "$pscount - число запущенных процессов\n"
#~ "$pstotal - общее число процессов\n"
#~ "$ps - список запущенных процессов, разделенных запятыми"
#~ msgid ""
#~ "$pkgcountN - number of packages which are available for updates, command "
#~ "N. For example $pkgcount0"
#~ msgstr ""
#~ "$pkgcountN - число пакетов, которые доступны для обновления, для команды "
#~ "N. Например, $pkgcount0"
#~ msgid "Custom"
#~ msgstr "Своя команда"
#~ msgid ""
#~ "$customN - get output from custom command N (from N). Example `$custom0`"
#~ msgstr ""
#~ "$customN - получить информацию из своей команды N. Например $custom0"
#~ msgid "Current desktop"
#~ msgstr "Текущий рабочий стол"
#~ msgid ""
#~ "$name - desktop name\n"
#~ "$number - desktop number\n"
#~ "$total - total number of desktops"
#~ msgstr ""
#~ "$name - имя рабочего стола\n"
#~ "$number - номер рабочего стола\n"
#~ "$total - общее число рабочих столов"
#~ msgid "Widget settings"
#~ msgstr "Настройки виджета"
#~ msgid "pacman -Qu"
#~ msgstr "pacman -Qu"
#~ msgid "apt-show-versions -u -b"
#~ msgstr "apt-show-versions -u -b"
#~ msgid "aptitude search '~U'"
#~ msgstr "aptitude search '~U'"
#~ msgid "yum list updates"
#~ msgstr "yum list updates"
#~ msgid "pkg_version -I -l '<'"
#~ msgstr "pkg_version -I -l '<'"
#~ msgid "urpmq --auto-select"
#~ msgstr "urpmq --auto-select"
#~ msgid "amarok"
#~ msgstr "amarok"
#~ msgid "mpd"
#~ msgstr "mpd"
#~ msgid "qmmp"
#~ msgstr "qmmp"
#~ msgid "auto"
#~ msgstr "auto"
#~ msgid "nvidia"
#~ msgstr "nvidia"
#~ msgid "ati"
#~ msgstr "ati"
#~ msgid "$hddN - usage for mount point N (from 0), %. Example: $hdd0"
#~ msgstr "$hddN - использование точки монтирования N (от 0), %. Пример: $hdd0"
#~ msgid ""
#~ "$ds - uptime days\n"
#~ "$hs - uptime hours\n"
#~ "$ms - uptime minutes"
#~ msgstr ""
#~ "$ds - дни работы\n"
#~ "$hs - часы\n"
#~ "$ms - минуты"
#~ msgid ""
#~ "Command to run, example:\n"
#~ "wget -qO- http://ifconfig.me/ip - get external IP"
#~ msgstr ""
#~ "Команда для запуска, например:\n"
#~ "wget -qO- http://ifconfig.me/ip - получить внешний IP"
#~ msgid "@@/;@@ - mount point usage, %"
#~ msgstr "@@/;@@ - использование точки монтирования, %"
#~ msgid "@@/dev/sda@@ - physical temperature on /dev/sda"
#~ msgstr "@@/dev/sda@@ - физическая температура /dev/sda"
#~ msgid ""
#~ "$net - network speed, down/up, KB/s\n"
#~ "$netdev - current network device\n"
#~ "@@eth0@@ - disable auto select device and set specified device"
#~ msgstr ""
#~ "$net - скорость передачи данных, down/up, KB/s\n"
#~ "$netdev - используемое устройство\n"
#~ "@@eth0@@ - отключить автовыбор устройства и установить указанное"

View File

@ -1,587 +0,0 @@
# Copyright (C) 2014
# This file is distributed under the same license as the PyTextMonitor package.
#
# Evgeniy Alekseev <esalexeev@gmail.com>, 2014.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
"POT-Creation-Date: 2014-09-21 20:18+0400\n"
"PO-Revision-Date: 2014-09-05 11:22+0400\n"
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
"Language-Team: Ukrainian <kde-russian@lists.kde.ru>\n"
"Language: ua\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Lokalize 1.5\n"
#: awesome-widget.cpp:78
msgid "Run ksysguard"
msgstr "Запустити ksysguard"
#: awesome-widget.cpp:81
msgid "Show README"
msgstr "Показати README"
#: awesome-widget.cpp:84
msgid "Update text"
msgstr "Оновити текст"
#: configuration.cpp:362 po/rc.cpp:151 rc.cpp:151
msgid "Custom command"
msgstr "Своя команда"
#: configuration.cpp:392 po/rc.cpp:141 rc.cpp:141
msgid "Package manager"
msgstr "Пакетний менеджер"
#: configuration.cpp:393 po/rc.cpp:144 rc.cpp:144
msgid "Null lines"
msgstr "Кількість пустих рядків"
#: configuration.cpp:405
msgid "Widget"
msgstr "Віджет"
#: configuration.cpp:406
msgid "Advanced"
msgstr "Розширені"
#: configuration.cpp:407
msgid "Tooltip"
msgstr "Тултіп"
#: configuration.cpp:408
msgid "Appearance"
msgstr "Зовнішній вигляд"
#: configuration.cpp:409
msgid "DataEngine"
msgstr "DataEngine"
#: configuration.cpp:697 configuration.cpp:711
msgid "Remove"
msgstr "Видалити"
#: configuration.cpp:766
msgid "Select font"
msgstr ""
#: po/rc.cpp:3 rc.cpp:3
msgid "Enable background"
msgstr ""
#: po/rc.cpp:6 rc.cpp:6
msgid "Enable popup on mouse click"
msgstr "Включити спливаючі підказки при натисканні клавіші миші"
#: po/rc.cpp:9 rc.cpp:9
msgid "Custom time format"
msgstr "Свій формат часу"
#: po/rc.cpp:12 rc.cpp:12
msgid ""
"$dddd - long weekday\n"
"$ddd - short weekday\n"
"$dd - day\n"
"$d - day w\\o zero\n"
"$MMMM - long month\n"
"$MMM - short month\n"
"$MM - month\n"
"$M - month w\\o zero\n"
"$yyyy - year\n"
"$yy - short year\n"
"$hh - hours (24 only)\n"
"$h - hours w\\o zero (24 only)\n"
"$mm - minutes\n"
"$m - minutes w\\o zero\n"
"$ss - seconds\n"
"$s - seconds w\\o zero"
msgstr ""
"$dddd - день тижня (довгий)\n"
"$ddd - день тижня (короткий)\n"
"$dd - день\n"
"$d - день без нулів\n"
"$MMMM - місяць (довгий)\n"
"$MMM - місяць (короткий)\n"
"$MM - місяць\n"
"$M - місяць без нулів\n"
"$yyyy - рік\n"
"$yy - рук (короткий)\n"
"$hh - години (24)\n"
"$h - години без нулів (24)\n"
"$mm - хвилини\n"
"$m - хвилини без нулів\n"
"$ss - секунди\n"
"$s - секунди без нулів"
#: po/rc.cpp:30 rc.cpp:30
msgid "Custom uptime format"
msgstr "Свій формат аптайму (uptime)"
#: po/rc.cpp:33 rc.cpp:33
msgid ""
"$dd - uptime days\n"
"$d - uptime days without zero\n"
"$hh - uptime hours\n"
"$h - uptime hours without zero\n"
"$mm - uptime minutes\n"
"$m - uptime minutes without zero"
msgstr ""
"$dd - дні аптайму\n"
"$d - дні аптайму без нулів\n"
"$hh - години аптайму\n"
"$h - години аптайму без нулів\n"
"$mm - хвилини аптайму\n"
"$m - хвилини аптайму без нулів"
#: po/rc.cpp:41 rc.cpp:41
msgid "Temperature units"
msgstr "Одиниці виміру температури"
#: po/rc.cpp:44 rc.cpp:44
msgid "Temperature devices"
msgstr "Температурні пристрої"
#: po/rc.cpp:47 po/rc.cpp:53 po/rc.cpp:59 po/rc.cpp:65 po/rc.cpp:71 rc.cpp:47
#: rc.cpp:53 rc.cpp:59 rc.cpp:65 rc.cpp:71
msgid "Editable"
msgstr "Можна редагувати"
#: po/rc.cpp:50 rc.cpp:50
#, fuzzy
msgid "Fan devices"
msgstr "AC пристрій"
#: po/rc.cpp:56 rc.cpp:56
msgid "Mount points"
msgstr "Точки монтування"
#: po/rc.cpp:62 rc.cpp:62
msgid "HDD devices (speed)"
msgstr "HDD (швидкість)"
#: po/rc.cpp:68 rc.cpp:68
msgid "HDD devices (temp)"
msgstr "HDD (температура)"
#: po/rc.cpp:74 rc.cpp:74
msgid "Disable auto select device and set specified device"
msgstr "Відключити автоматичний вибір пристрою та використовувати вказаний"
#: po/rc.cpp:77 rc.cpp:77
msgid "Set network device"
msgstr "Оберіть мережевий пристрій"
#: po/rc.cpp:80 rc.cpp:80
msgid "AC online tag"
msgstr "AC підключений"
#: po/rc.cpp:83 rc.cpp:83
msgid "Line, which returns when AC is online"
msgstr "Рядок, що повертається при підключеному адаптері живлення"
#: po/rc.cpp:86 rc.cpp:86
msgid "AC offline tag"
msgstr "AC відключений"
#: po/rc.cpp:89 rc.cpp:89
msgid "Line, which returns when AC is offline"
msgstr "Рядок, що повертається при відключеному адаптері живлення"
#: po/rc.cpp:92 rc.cpp:92
msgid "Time interval"
msgstr "Інтервал оновлення"
#: po/rc.cpp:95 po/rc.cpp:196 rc.cpp:95 rc.cpp:196
msgid "Font"
msgstr "Шрифт"
#: po/rc.cpp:98 rc.cpp:98
msgid "Font size"
msgstr "Розмір шрифту"
#: po/rc.cpp:101 rc.cpp:101
msgid "Font color"
msgstr "Колір шрифту"
#: po/rc.cpp:104 rc.cpp:104
msgid "Font style"
msgstr "Стиль шрифту"
#: po/rc.cpp:107 rc.cpp:107
msgid "Font weight"
msgstr "Ширина шрифту"
#: po/rc.cpp:110 rc.cpp:110
msgid "HDD"
msgstr "HDD"
#: po/rc.cpp:113 rc.cpp:113
msgid "MPD port"
msgstr "Порт сервера MPD"
#: po/rc.cpp:116 rc.cpp:116
msgid "GPU device"
msgstr "Пристій GPU"
#: po/rc.cpp:119 rc.cpp:119
msgid "hddtemp cmd"
msgstr "Команда hddtemp"
#: po/rc.cpp:122 rc.cpp:122
msgid "Music player"
msgstr "Музичний плеєр"
#: po/rc.cpp:125 rc.cpp:125
msgid "MPD address"
msgstr "Адреса сервера MPD"
#: po/rc.cpp:128 rc.cpp:128
msgid "Desktop check cmd"
msgstr ""
#: po/rc.cpp:131 rc.cpp:131
msgid "<b>NOTE:</b> Player DBus interface should be an active"
msgstr ""
#: po/rc.cpp:134 rc.cpp:134
msgid "MPRIS player name"
msgstr ""
#: po/rc.cpp:137 po/rc.cpp:147 rc.cpp:137 rc.cpp:147
msgid ""
"Editable\n"
"del - remove item"
msgstr ""
"Можна редагувати\n"
"del - видалити рядок"
#: po/rc.cpp:154 rc.cpp:154
msgid "ACPI path"
msgstr ""
#: po/rc.cpp:157 rc.cpp:157
#, fuzzy
msgid "\"/sys/class/power_supply/\" by default"
msgstr "\"/sys/class/power_supply/AC/online\" за замовчуванням"
#: po/rc.cpp:160 rc.cpp:160
msgid ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
msgstr ""
"Поля \"CPU\", \"Частота CPU\", \"Пам’ятьґЄ, \"Swap\" та \"Мережа\" "
"підтримують графічний тултіп. Щоб їх задіяти, просто зробіть необхідні "
"чекбокси повністю чекнутими."
#: po/rc.cpp:163 rc.cpp:163
msgid "Number of values for tooltips"
msgstr "Кількість значень для тултіпа"
#: po/rc.cpp:166 rc.cpp:166
msgid "Background"
msgstr ""
#: po/rc.cpp:169 rc.cpp:169
msgid "CPU color"
msgstr "Колір CPU"
#: po/rc.cpp:172 rc.cpp:172
msgid "CPU clock color"
msgstr "Колір частоти CPU"
#: po/rc.cpp:175 rc.cpp:175
msgid "Memory color"
msgstr "Колір пам’яті"
#: po/rc.cpp:178 rc.cpp:178
msgid "Swap color"
msgstr "Колір swap"
#: po/rc.cpp:181 rc.cpp:181
msgid "Download speed color"
msgstr "Колір швидкості скачування"
#: po/rc.cpp:184 rc.cpp:184
msgid "Upload speed color"
msgstr "Колір швидкості віддачі"
#: po/rc.cpp:187 rc.cpp:187
msgid "Battery active color"
msgstr ""
#: po/rc.cpp:190 rc.cpp:190
#, fuzzy
msgid "Battery inactive color"
msgstr "Пристрій батареї"
#: po/rc.cpp:193 rc.cpp:193
msgid ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
msgstr ""
"Детальна інформація може бути знайдена на <a href=\"http://arcanis.name/"
"projects/awesome-widgets/\">домашній сторінці проекту</a>"
#: po/rc.cpp:199 rc.cpp:199
msgid "Ctrl+B"
msgstr "Ctrl+B"
#: po/rc.cpp:202 rc.cpp:202
msgid "Ctrl+I"
msgstr "Ctrl+I"
#: po/rc.cpp:205 rc.cpp:205
msgid "Ctrl+U"
msgstr "Ctrl+U"
#: po/rc.cpp:208 rc.cpp:208
msgid "Add"
msgstr "Добавити"
#: po/rc.cpp:209 rc.cpp:209
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "Slobodyan Victor"
#: po/rc.cpp:210 rc.cpp:210
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "sarumyan@i.ua"
#~ msgid "Battery device"
#~ msgstr "Пристрій батареї"
#~ msgid "\"/sys/class/power_supply/BAT0/capacity\" by default"
#~ msgstr "\"/sys/class/power_supply/BAT0/capacity\" за замовчуванням"
#~ msgid "Vertical layout"
#~ msgstr "Вертикальна розмітка"
#~ msgid "Add stretch to left/top of the layout"
#~ msgstr "Додати порожнє місце ліворуч/вгорі віджету"
#~ msgid "Add stretch to right/bottom of the layout"
#~ msgstr "Додати порожнє місце праворуч/внизу віджету"
#~ msgid "Form"
#~ msgstr "Form"
#~ msgid "Network directory"
#~ msgstr "Шлях до інтерфейсів"
#~ msgid "\"/sys/class/net\" by default"
#~ msgstr "\"/sys/class/net\" за замовчуванням"
#~ msgid "Custom command to run"
#~ msgstr "Виконання своєї команди"
#~ msgid "Time"
#~ msgstr "Час"
#~ msgid ""
#~ "$time - time in default format\n"
#~ "$isotime - time in ISO format\n"
#~ "$shorttime - time in short format\n"
#~ "$longtime - time in log format\n"
#~ "$custom - custom time format"
#~ msgstr ""
#~ "$time - час у стандартному форматі\n"
#~ "$isotime - час у форматі ISO\n"
#~ "$shorttime - час в короткому форматі\n"
#~ "$longtime - час у довгому форматі\n"
#~ "$custom - свій формат часу"
#~ msgid "Uptime"
#~ msgstr "Час роботи"
#~ msgid ""
#~ "$uptime - system uptime\n"
#~ "$custom - custom format"
#~ msgstr ""
#~ "$uptime - час роботи\n"
#~ "$custom - свій формат"
#~ msgid "CPU"
#~ msgstr "CPU"
#~ msgid ""
#~ "$cpu - total load CPU, %\n"
#~ "$cpu0 - load CPU for core 0, %\n"
#~ "...\n"
#~ "$cpu9 - load CPU for core 9, %\n"
#~ "...\n"
#~ "$cpuN - load CPU for core N, %"
#~ msgstr ""
#~ "$cpu - загальне завантаження CPU, %\n"
#~ "$cpu0 - завантаження CPU для ядра 0, %\n"
#~ "...\n"
#~ "$cpu9 - завантаження CPU для ядра 9, %\n"
#~ "...\n"
#~ "$cpuN - завантаження CPU для ядра N, %"
#~ msgid "CPU Clock"
#~ msgstr "Частота CPU"
#~ msgid ""
#~ "$cpucl - average CPU clock, MHz\n"
#~ "$cpucl0 - CPU clock for core 0, MHz\n"
#~ "...\n"
#~ "$cpucl9 - CPU clock for core 9, MHz\n"
#~ "...\n"
#~ "$cpuclN - CPU clock for core N, MHz"
#~ msgstr ""
#~ "$cpucl - середня частота CPU, MHz\n"
#~ "$cpucl0 - частота CPU для ядра 0, MHz\n"
#~ "...\n"
#~ "$cpucl9 - частота CPU для ядра 9, MHz\n"
#~ "...\n"
#~ "$cpuclN - частота CPU для ядра N, MHz"
#~ msgid "Temperature"
#~ msgstr "Температура"
#~ msgid "$tempN - physical temperature on device N (from 0). Example: $temp0"
#~ msgstr "$tempN - фізична температура на пристрої N (від 0). Приклад: $temp0"
#~ msgid "GPU"
#~ msgstr "GPU"
#~ msgid "$gpu - gpu usage, %"
#~ msgstr "$gpu - використання gpu, %"
#~ msgid "GPU Temp"
#~ msgstr "Температура GPU"
#~ msgid "$gputemp - physical temperature on GPU"
#~ msgstr "$gputemp - фізична температура на GPU"
#~ msgid "Memory"
#~ msgstr "Пам’ять"
#~ msgid ""
#~ "$mem - RAM usage, %\n"
#~ "$memmb - RAM usage, MB\n"
#~ "$memgb - RAM usage, GB\n"
#~ "$memtotmb - total RAM, MB\n"
#~ "$memtotgb - total RAM, GB"
#~ msgstr ""
#~ "$mem - використання RAM, %\n"
#~ "$memmb - використання RAM, MB\n"
#~ "$memgb - використання RAM, GB"
#~ msgid "Swap"
#~ msgstr "Swap"
#~ msgid ""
#~ "$swap - swap usage, %\n"
#~ "$swapmb - swap usage, MB\n"
#~ "$swapgb - swap usage, GB\n"
#~ "$swaptotmb - total swap, MB\n"
#~ "$swaptotgb - total swap, GB"
#~ msgstr ""
#~ "$swap - використання swap, %\n"
#~ "$swapmb - використання swap, MB\n"
#~ "$swapgb - використання swap, GB$swaptotmb - swap, MB\n"
#~ "$swaptotgb - swap, GB"
#~ msgid ""
#~ "$hddN - usage for mount point N (from 0), %. Example: $hdd0\n"
#~ "$hddmbN - usage for mount point N (from 0), MB. Example: $hddmb0\n"
#~ "$hddgbN - usage for mount point N (from 0), GB. Example: $hddgb0\n"
#~ "$hddtotmbN - total size of mount point N (from 0), MB. Example: "
#~ "$hddtotmb0\n"
#~ "$hddtotgbN - total size of mount point N (from 0), GB. Example: $hddtotgb0"
#~ msgstr ""
#~ "$hddN - використання точки монтування N (від 0), %. Приклад: $hdd0\n"
#~ "$hddmbN - використання точки монтування N (від 0), MB. Приклад: $hddmb0\n"
#~ "$hddgbN - використання точки монтування N (від 0), GB. Приклад: $hddgb0\n"
#~ "$hddtotmbN - розмір точки монтування N (від 0), MB. Приклад: $hddtotmb0\n"
#~ "$hddtotgbN - розмір точки монтування N (від 0), GB. Приклад: $hddtotgb0"
#~ msgid "HDD speed"
#~ msgstr "Швидкість HDD"
#~ msgid ""
#~ "$hddrN - read speed HDD N (from 0), KB/s. Example: $hddr0\n"
#~ "$hddwN - write speed HDD N (from 0), KB/s. Example: $hddw0"
#~ msgstr ""
#~ "$hddrN - швидкість читання HDD N (від 0), KB/s. Приклад: $hddr0\n"
#~ "$hddwN - швидкість запису HDD N (від 0), KB/s. Приклад: $hddw0"
#~ msgid "HDD temp"
#~ msgstr "Температура HDD"
#~ msgid ""
#~ "$hddtempN - physical temperature on device N (from 0). Example: $hddtemp0"
#~ msgstr ""
#~ "$hddtempN - фізична температура на пристрої N (від 0). Приклад: $hddtemp"
#~ msgid "Network"
#~ msgstr "Мережа"
#~ msgid ""
#~ "$down - download speed, KB/s\n"
#~ "$up - upload speed, KB/s\n"
#~ "$netdev - current network device"
#~ msgstr ""
#~ "$down - швидкість скачування, KB/s\n"
#~ "$up - швидкість віддачі, KB/s\n"
#~ "$netdev - поточний мережевий пристрій"
#~ msgid "Battery"
#~ msgstr "Батарея"
#~ msgid ""
#~ "$bat - battery charge, %\n"
#~ "$ac - AC status"
#~ msgstr ""
#~ "$bat - заряд батареї, %\n"
#~ "$ac - статус адаптера живлення"
#~ msgid ""
#~ "$album - song album\n"
#~ "$artist - song artist\n"
#~ "$progress - song progress\n"
#~ "$time - song duration\n"
#~ "$title - song title"
#~ msgstr ""
#~ "$album - альбом\n"
#~ "$artist - виконавець\n"
#~ "$progress - прогрес\n"
#~ "$time - тривалість\n"
#~ "$title - назва"
#~ msgid "Processes"
#~ msgstr "Процеси"
#~ msgid ""
#~ "$pscount - number of running processes\n"
#~ "$pstotal - total number of running processes\n"
#~ "$ps - list of running processes comma separated"
#~ msgstr ""
#~ "$pscount - кількість запущених процесів\n"
#~ "$pstotal - загальна кількість процесів\n"
#~ "$ps - перелік запущених процесів, розділених комами"
#~ msgid ""
#~ "$pkgcountN - number of packages which are available for updates, command "
#~ "N. For example $pkgcount0"
#~ msgstr ""
#~ "$pkgcountN - кількість пакетів, що доступні для оновлення, для команди N. "
#~ "Наприклад: $pkgcount0"
#~ msgid "Custom"
#~ msgstr "Своя команда"
#~ msgid ""
#~ "$customN - get output from custom command N (from N). Example `$custom0`"
#~ msgstr ""
#~ "$customN - отримати інформацію зі своєї команди N. Наприклад `$custom0`"
#~ msgid "Widget settings"
#~ msgstr "Налаштування віджету"

View File

@ -1,357 +0,0 @@
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Steve Lemuel <wlemuel@hotmail.com>, 2014.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/arcan1s/awesome-widgets/issues\n"
"POT-Creation-Date: 2014-09-21 20:18+0400\n"
"PO-Revision-Date: 2014-09-10 22:50+0800\n"
"Last-Translator: Steve Lemuel <wlemuel@hotmail.com>\n"
"Language-Team: American English <kde-i18n-doc@kde.org>\n"
"Language: en_US\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Lokalize 1.5\n"
#: awesome-widget.cpp:78
msgid "Run ksysguard"
msgstr "运行任务管理器"
#: awesome-widget.cpp:81
msgid "Show README"
msgstr "显示帮助文档"
#: awesome-widget.cpp:84
msgid "Update text"
msgstr "刷新文本"
#: configuration.cpp:362 po/rc.cpp:151 rc.cpp:151
msgid "Custom command"
msgstr "自定义命令"
#: configuration.cpp:392 po/rc.cpp:141 rc.cpp:141
msgid "Package manager"
msgstr "包管理器"
#: configuration.cpp:393 po/rc.cpp:144 rc.cpp:144
msgid "Null lines"
msgstr "空行"
#: configuration.cpp:405
msgid "Widget"
msgstr "窗口小部件"
#: configuration.cpp:406
msgid "Advanced"
msgstr "高级设置"
#: configuration.cpp:407
msgid "Tooltip"
msgstr "提示"
#: configuration.cpp:408
msgid "Appearance"
msgstr "外观"
#: configuration.cpp:409
msgid "DataEngine"
msgstr "数据引擎"
#: configuration.cpp:697 configuration.cpp:711
msgid "Remove"
msgstr "移除"
#: configuration.cpp:766
msgid "Select font"
msgstr "选择字体"
#: po/rc.cpp:3 rc.cpp:3
msgid "Enable background"
msgstr "启用背景"
#: po/rc.cpp:6 rc.cpp:6
msgid "Enable popup on mouse click"
msgstr "鼠标点击时弹出对话框"
#: po/rc.cpp:9 rc.cpp:9
msgid "Custom time format"
msgstr "自定义时间格式"
#: po/rc.cpp:12 rc.cpp:12
msgid ""
"$dddd - long weekday\n"
"$ddd - short weekday\n"
"$dd - day\n"
"$d - day w\\o zero\n"
"$MMMM - long month\n"
"$MMM - short month\n"
"$MM - month\n"
"$M - month w\\o zero\n"
"$yyyy - year\n"
"$yy - short year\n"
"$hh - hours (24 only)\n"
"$h - hours w\\o zero (24 only)\n"
"$mm - minutes\n"
"$m - minutes w\\o zero\n"
"$ss - seconds\n"
"$s - seconds w\\o zero"
msgstr ""
"$dddd - 详细工作日\n"
"$ddd - 简短工作日\n"
"$dd - 日\n"
"$d - 日 w\\o 零\n"
"$MMMM - 详细月份\n"
"$MMM - 简短月份\n"
"$MM - 月\n"
"$M - 月 w\\o 零\n"
"$yyyy - 年\n"
"$yy - 简短年份\n"
"$hh - 小时 (24 小时制)\n"
"$h - 小时 w\\o 零 (24 小时制)\n"
"$mm - 分\n"
"$m - 分 w\\o 零\n"
"$ss - 秒\n"
"$s - 秒 w\\o 零"
#: po/rc.cpp:30 rc.cpp:30
msgid "Custom uptime format"
msgstr "自定义启动时间显示格式"
#: po/rc.cpp:33 rc.cpp:33
msgid ""
"$dd - uptime days\n"
"$d - uptime days without zero\n"
"$hh - uptime hours\n"
"$h - uptime hours without zero\n"
"$mm - uptime minutes\n"
"$m - uptime minutes without zero"
msgstr ""
"$dd - 运行天数\n"
"$d - 运行天数不显示0\n"
"$hh - 运行小时数\n"
"$h - 运行小时数不显示0\n"
"$mm - 运行分钟数\n"
"$m - 运行分钟数不显示0"
#: po/rc.cpp:41 rc.cpp:41
msgid "Temperature units"
msgstr "温度单位"
#: po/rc.cpp:44 rc.cpp:44
msgid "Temperature devices"
msgstr "温度传感器"
#: po/rc.cpp:47 po/rc.cpp:53 po/rc.cpp:59 po/rc.cpp:65 po/rc.cpp:71 rc.cpp:47
#: rc.cpp:53 rc.cpp:59 rc.cpp:65 rc.cpp:71
msgid "Editable"
msgstr "可编辑的"
#: po/rc.cpp:50 rc.cpp:50
#, fuzzy
msgid "Fan devices"
msgstr "外界电源设备"
#: po/rc.cpp:56 rc.cpp:56
msgid "Mount points"
msgstr "挂载点"
#: po/rc.cpp:62 rc.cpp:62
msgid "HDD devices (speed)"
msgstr "硬盘(高速)"
#: po/rc.cpp:68 rc.cpp:68
msgid "HDD devices (temp)"
msgstr "硬盘(临时)"
#: po/rc.cpp:74 rc.cpp:74
msgid "Disable auto select device and set specified device"
msgstr "禁用自动选择设备和设置特殊设备"
#: po/rc.cpp:77 rc.cpp:77
msgid "Set network device"
msgstr "设置网络设备"
#: po/rc.cpp:80 rc.cpp:80
msgid "AC online tag"
msgstr "外接电源使用中标签"
#: po/rc.cpp:83 rc.cpp:83
msgid "Line, which returns when AC is online"
msgstr "外接电源使用时显示线条"
#: po/rc.cpp:86 rc.cpp:86
msgid "AC offline tag"
msgstr "外接电源未使用标签"
#: po/rc.cpp:89 rc.cpp:89
msgid "Line, which returns when AC is offline"
msgstr "外接电源未使用时显示线条"
#: po/rc.cpp:92 rc.cpp:92
msgid "Time interval"
msgstr "时间周期"
#: po/rc.cpp:95 po/rc.cpp:196 rc.cpp:95 rc.cpp:196
msgid "Font"
msgstr "字体"
#: po/rc.cpp:98 rc.cpp:98
msgid "Font size"
msgstr "字体大小"
#: po/rc.cpp:101 rc.cpp:101
msgid "Font color"
msgstr "字体颜色"
#: po/rc.cpp:104 rc.cpp:104
msgid "Font style"
msgstr "字体样式"
#: po/rc.cpp:107 rc.cpp:107
msgid "Font weight"
msgstr "字体宽度"
#: po/rc.cpp:110 rc.cpp:110
msgid "HDD"
msgstr "硬盘"
#: po/rc.cpp:113 rc.cpp:113
msgid "MPD port"
msgstr "MPD 端口"
#: po/rc.cpp:116 rc.cpp:116
msgid "GPU device"
msgstr "GPU 设备"
#: po/rc.cpp:119 rc.cpp:119
msgid "hddtemp cmd"
msgstr "硬盘温度显示命令"
#: po/rc.cpp:122 rc.cpp:122
msgid "Music player"
msgstr "音乐播放器"
#: po/rc.cpp:125 rc.cpp:125
msgid "MPD address"
msgstr "MPD 地址"
#: po/rc.cpp:128 rc.cpp:128
msgid "Desktop check cmd"
msgstr "检测桌面命令"
#: po/rc.cpp:131 rc.cpp:131
msgid "<b>NOTE:</b> Player DBus interface should be an active"
msgstr "<b>提示:</b> 播放器 DBus 应当处于激活状态"
#: po/rc.cpp:134 rc.cpp:134
msgid "MPRIS player name"
msgstr "MPRIS 播放器名"
#: po/rc.cpp:137 po/rc.cpp:147 rc.cpp:137 rc.cpp:147
msgid ""
"Editable\n"
"del - remove item"
msgstr ""
"可编辑的\n"
"del - 移除项目"
#: po/rc.cpp:154 rc.cpp:154
msgid "ACPI path"
msgstr ""
#: po/rc.cpp:157 rc.cpp:157
#, fuzzy
msgid "\"/sys/class/power_supply/\" by default"
msgstr "默认为 \"/sys/class/power_supply/AC/online\""
#: po/rc.cpp:160 rc.cpp:160
msgid ""
"CPU, CPU clock, memory, swap and network labels support graphical tooltip. "
"To enable them just make needed checkbox fully checked."
msgstr ""
"CPU CPU 时钟,内存,虚拟内存和网络连接标签均支持图形化提示显示。 请在相应复"
"选框中勾选以启用该功能。 "
#: po/rc.cpp:163 rc.cpp:163
msgid "Number of values for tooltips"
msgstr "提示的数值"
#: po/rc.cpp:166 rc.cpp:166
msgid "Background"
msgstr "背景"
#: po/rc.cpp:169 rc.cpp:169
msgid "CPU color"
msgstr "CPU 颜色"
#: po/rc.cpp:172 rc.cpp:172
msgid "CPU clock color"
msgstr "CPU 时钟颜色"
#: po/rc.cpp:175 rc.cpp:175
msgid "Memory color"
msgstr "内存显示颜色"
#: po/rc.cpp:178 rc.cpp:178
msgid "Swap color"
msgstr "虚拟内存颜色"
#: po/rc.cpp:181 rc.cpp:181
msgid "Download speed color"
msgstr "下载速度颜色"
#: po/rc.cpp:184 rc.cpp:184
msgid "Upload speed color"
msgstr "上传速度颜色"
#: po/rc.cpp:187 rc.cpp:187
msgid "Battery active color"
msgstr "电池使用状态提示颜色"
#: po/rc.cpp:190 rc.cpp:190
msgid "Battery inactive color"
msgstr "电池未使用状态提示颜色"
#: po/rc.cpp:193 rc.cpp:193
msgid ""
"Detailed information may be found on <a href=\"http://arcanis.name/projects/"
"awesome-widgets/\">project homepage</a>"
msgstr ""
"详情请参照 <a href=\"http://arcanis.name/projects/ awesome-widgets/\">项目主"
"页</a>"
#: po/rc.cpp:199 rc.cpp:199
msgid "Ctrl+B"
msgstr "Ctrl+B"
#: po/rc.cpp:202 rc.cpp:202
msgid "Ctrl+I"
msgstr "Ctrl+I"
#: po/rc.cpp:205 rc.cpp:205
msgid "Ctrl+U"
msgstr "Ctrl+U"
#: po/rc.cpp:208 rc.cpp:208
msgid "Add"
msgstr "添加"
#: po/rc.cpp:209 rc.cpp:209
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "用户名"
#: po/rc.cpp:210 rc.cpp:210
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "用户邮箱"
#~ msgid "Battery device"
#~ msgstr "电池设备"
#~ msgid "\"/sys/class/power_supply/BAT0/capacity\" by default"
#~ msgstr "默认为 \"/sys/class/power_supply/BAT0/capacity\""

View File

@ -1,162 +0,0 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "awesome-widget.h"
#include <KNotification>
#include <Plasma/ToolTipManager>
#include <QGraphicsGridLayout>
#include <QGraphicsView>
#include <math.h>
#include "customlabel.h"
#include <pdebug/pdebug.h>
void AwesomeWidget::reinit()
{
if (debug) qDebug() << PDEBUG;
if (configuration[QString("background")].toInt() == 0)
setBackgroundHints(NoBackground);
if (configuration[QString("popup")].toInt() == 0)
textLabel->setPopupEnabled(false);
else
textLabel->setPopupEnabled(true);
updateText(true);
textLabel->adjustSize();
mainLayout->itemAt(0, 0)->setGeometry(textLabel->geometry());
keys = getKeys();
foundKeys = findKeys();
updateNetworkDevice(false);
connectToEngine();
}
void AwesomeWidget::sendNotification(const QString eventId, const QString message)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Event" << eventId;
if (debug) qDebug() << PDEBUG << ":" << "Message" << message;
KNotification *notification = new KNotification(eventId);
notification->setComponentData(KComponentData("plasma_applet_awesome-widget"));
notification->setTitle(QString("Awesome Widget ::: ") + eventId);
notification->setText(message);
notification->sendEvent();
delete notification;
}
void AwesomeWidget::updateNetworkDevice(const bool delay)
{
if (debug) qDebug() << PDEBUG;
if (delay)
networkDeviceUpdate = 30;
else
values[QString("netdev")] = getNetworkDevice();
}
void AwesomeWidget::updateText(const bool clear)
{
if (debug) qDebug() << PDEBUG;
QString text = configuration[QString("text")];
if (!clear) {
text.replace(QString("$$"), QString("$\\$\\"));
for (int i=0; i<foundKeys.count(); i++)
text.replace(QString("$") + foundKeys[i], values[foundKeys[i]]);
text.replace(QString("$\\$\\"), QString("$$"));
}
textLabel->setText(formatLine[0] + text + formatLine[1]);
update();
}
void AwesomeWidget::updateTooltip()
{
if (debug) qDebug() << PDEBUG;
toolTipView->resize(100.0 * counts[QString("tooltip")], 105.0);
// boundaries
QMap<QString, float> boundaries;
boundaries[QString("cpu")] = 100.0;
boundaries[QString("cpucl")] = 4000.0;
boundaries[QString("mem")] = 100.0;
boundaries[QString("swap")] = 100.0;
boundaries[QString("down")] = 1.0;
if (configuration[QString("downTooltip")].toInt() == 2) {
for (int i=0; i<tooltipValues[QString("down")].count(); i++)
if (boundaries[QString("down")] < tooltipValues[QString("down")][i])
boundaries[QString("down")] = tooltipValues[QString("down")][i];
for (int i=0; i<tooltipValues[QString("up")].count(); i++)
if (boundaries[QString("down")] < tooltipValues[QString("up")][i])
boundaries[QString("down")] = tooltipValues[QString("up")][i];
boundaries[QString("down")] *= 1.2;
}
boundaries[QString("up")] = boundaries[QString("down")];
boundaries[QString("bat")] = 100.0;
// create image
toolTipScene->clear();
QPen pen = QPen();
if (configuration[QString("useTooltipBackground")].toInt() == 2)
toolTipScene->setBackgroundBrush(QColor(configuration[QString("tooltipBackground")]));
else
toolTipScene->setBackgroundBrush(QBrush(Qt::NoBrush));
bool down = false;
bool isBattery = false;
QStringList trueKeys;
if (tooltipValues.contains(QString("cpu"))) trueKeys.append(QString("cpu"));
if (tooltipValues.contains(QString("cpucl"))) trueKeys.append(QString("cpucl"));
if (tooltipValues.contains(QString("mem"))) trueKeys.append(QString("mem"));
if (tooltipValues.contains(QString("swap"))) trueKeys.append(QString("swap"));
if (tooltipValues.contains(QString("down"))) trueKeys.append(QString("down"));
if (tooltipValues.contains(QString("up"))) trueKeys.append(QString("up"));
if (tooltipValues.contains(QString("bat"))) trueKeys.append(QString("bat"));
for (int i=0; i<trueKeys.count(); i++) {
float normX = 100.0 / (tooltipValues[trueKeys[i]].count() + 0.0);
float normY = 100.0 / (1.5 * boundaries[trueKeys[i]]);
if (trueKeys[i] == QString("bat"))
isBattery = true;
else
isBattery = false;
if (!isBattery) pen.setColor(QColor(configuration[trueKeys[i] + QString("Color")]));
float shift = i * 100.0;
if (down) shift -= 100.0;
for (int j=0; j<tooltipValues[trueKeys[i]].count()-1; j++) {
float x1 = j * normX + shift;
float y1 = - fabs(tooltipValues[trueKeys[i]][j]) * normY + 5.0;
float x2 = (j + 1) * normX + shift;
float y2 = - fabs(tooltipValues[trueKeys[i]][j+1]) * normY + 5.0;
if (isBattery) {
if (tooltipValues[trueKeys[i]][j+1] > 0)
pen.setColor(QColor(configuration[QString("batteryColor")]));
else
pen.setColor(QColor(configuration[QString("batteryInColor")]));
}
toolTipScene->addLine(x1, y1, x2, y2, pen);
}
if (trueKeys[i] == QString("down")) down = true;
}
toolTip.setImage(QPixmap::grabWidget(toolTipView));
Plasma::ToolTipManager::self()->setContent(this, toolTip);
}

View File

@ -1,559 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TooltipWindow</class>
<widget class="QWidget" name="TooltipWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>594</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>700</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="windowTitle">
<string notr="true">Tooltip</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QLabel" name="label_tooltip">
<property name="text">
<string>CPU, CPU clock, memory, swap and network labels support graphical tooltip. To enable them just make needed checkbox fully checked.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QScrollArea" name="scrollArea_tooltip">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="contents_tooltip">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>684</width>
<height>542</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<layout class="QHBoxLayout" name="layout_tooltipNum">
<item>
<widget class="QLabel" name="label_tooltipNum">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Number of values for tooltips</string>
</property>
</widget>
</item>
<item>
<spacer name="spacer_tooltipNum">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>19</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBox_tooltipNum">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>50</number>
</property>
<property name="maximum">
<number>1000</number>
</property>
<property name="singleStep">
<number>25</number>
</property>
<property name="value">
<number>100</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_background">
<item>
<widget class="QCheckBox" name="checkBox_background">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Background</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="spacer_background">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="KColorCombo" name="kcolorcombo_background">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_cpuColor">
<item>
<widget class="QCheckBox" name="checkBox_cpu">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>CPU color</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="spacer_cpuColor">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="KColorCombo" name="kcolorcombo_cpu">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_cpuclockColor">
<item>
<widget class="QCheckBox" name="checkBox_cpuclock">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>CPU clock color</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="spacer_cpuclockColor">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="KColorCombo" name="kcolorcombo_cpuclock">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_memColor">
<item>
<widget class="QCheckBox" name="checkBox_mem">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Memory color</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="spacer_memColor">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="KColorCombo" name="kcolorcombo_mem">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_swapColor">
<item>
<widget class="QCheckBox" name="checkBox_swap">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Swap color</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="spacer_swapColor">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="KColorCombo" name="kcolorcombo_swap">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_downColor">
<item>
<widget class="QCheckBox" name="checkBox_down">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Download speed color</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="spacer_downColor">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="KColorCombo" name="kcolorcombo_down">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_upColor">
<item>
<spacer name="spacer_upColorLeft">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_up">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Upload speed color</string>
</property>
</widget>
</item>
<item>
<spacer name="spacer_upColor">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="KColorCombo" name="kcolorcombo_up">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_batteryColor">
<item>
<widget class="QCheckBox" name="checkBox_battery">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Battery active color</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="spacer_batteryColor">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="KColorCombo" name="kcolorcombo_battery">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_batteryInColor">
<item>
<spacer name="space_batteryIn">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_batteryIn">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Battery inactive color</string>
</property>
</widget>
</item>
<item>
<spacer name="spacer_batteryInColor">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="KColorCombo" name="kcolorcombo_batteryIn">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="spacer_tooltip">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>289</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KColorCombo</class>
<extends>QComboBox</extends>
<header>kcolorcombo.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -1,228 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ConfigWindow</class>
<widget class="QWidget" name="ConfigWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>600</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>700</width>
<height>600</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="windowTitle">
<string notr="true">Widget</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Detailed information may be found on &lt;a href=&quot;http://arcanis.name/projects/awesome-widgets/&quot;&gt;project homepage&lt;/a&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="layput_mainFormating">
<item>
<widget class="QPushButton" name="pushButton_font">
<property name="text">
<string>Font</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_br">
<property name="icon">
<iconset theme="stock_text_indent">
<normaloff/>
</iconset>
</property>
</widget>
</item>
<item>
<spacer name="spacer_mainFormatingCenter1">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_bold">
<property name="icon">
<iconset theme="format-text-bold">
<normaloff/>
</iconset>
</property>
<property name="shortcut">
<string>Ctrl+B</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_italic">
<property name="icon">
<iconset theme="format-text-italic">
<normaloff/>
</iconset>
</property>
<property name="shortcut">
<string>Ctrl+I</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_underline">
<property name="icon">
<iconset theme="format-text-underline">
<normaloff/>
</iconset>
</property>
<property name="shortcut">
<string>Ctrl+U</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_strike">
<property name="icon">
<iconset theme="format-text-strikethrough">
<normaloff/>
</iconset>
</property>
</widget>
</item>
<item>
<spacer name="spacer_mainFormatingCenter2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_left">
<property name="icon">
<iconset theme="format-justify-left">
<normaloff/>
</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_center">
<property name="icon">
<iconset theme="format-justify-center">
<normaloff/>
</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_right">
<property name="icon">
<iconset theme="format-justify-right">
<normaloff/>
</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_fill">
<property name="icon">
<iconset theme="format-justify-fill">
<normaloff/>
</iconset>
</property>
</widget>
</item>
<item>
<spacer name="spacer_mainFormatingCenter3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QComboBox" name="comboBox_tags">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_tags">
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTextEdit" name="textEdit_elements">
<property name="lineWrapMode">
<enum>QTextEdit::NoWrap</enum>
</property>
<property name="acceptRichText">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,3 @@
[Project]
Manager=KDevCMakeManager
Name=awesome-widgets

View File

@ -2,35 +2,18 @@
set (SUBPROJECT plasma_applet_desktop-panel)
message (STATUS "Subproject ${SUBPROJECT}")
# find required libaries
find_package (KDE4 REQUIRED)
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
add_subdirectory (po)
include (KDE4Defaults)
include_directories (${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${KDE4_INCLUDES}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../
${PROJECT_TRDPARTY_DIR})
# set sources
set (PLUGIN_NAME ${SUBPROJECT})
file (GLOB SUBPROJECT_DESKTOP_IN *.desktop)
file (RELATIVE_PATH SUBPROJECT_DESKTOP ${CMAKE_SOURCE_DIR} ${SUBPROJECT_DESKTOP_IN})
file (GLOB_RECURSE SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/fontdialog/*.cpp)
file (GLOB SUBPROJECT_UI *.ui)
# prepare
configure_file (${SUBPROJECT_DESKTOP_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP})
configure_file (metadata.desktop ${CMAKE_CURRENT_SOURCE_DIR}/package/metadata.desktop)
# make
kde4_add_ui_files (SUBPROJECT_SOURCE ${SUBPROJECT_UI})
kde4_add_plugin (${PLUGIN_NAME} ${SUBPROJECT_SOURCE})
target_link_libraries (${PLUGIN_NAME} ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS})
find_package (ECM 0.0.12 REQUIRED NO_MODULE)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
# install
install (TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGIN_INSTALL_DIR})
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP} DESTINATION ${SERVICES_INSTALL_DIR})
find_package (Qt5 REQUIRED COMPONENTS Core Qml)
find_package (KF5 REQUIRED COMPONENTS I18n Notifications Plasma Service WindowSystem)
include (KDEInstallDirs)
include (KDECMakeSettings)
include (KDECompilerSettings)
add_subdirectory (plugin)
plasma_install_package (package org.kde.plasma.desktoppanel)

View File

@ -1,653 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AppearanceWidget</class>
<widget class="QWidget" name="AppearanceWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>480</width>
<height>343</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>480</width>
<height>320</height>
</size>
</property>
<property name="windowTitle">
<string notr="true">Apearance</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab_active">
<attribute name="title">
<string>Active desktop</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollArea_active">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_active">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>448</width>
<height>289</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="layout_fontActive">
<item>
<widget class="QLabel" name="label_fontActive">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Font</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_fontActive">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QFontComboBox" name="fontComboBox_fontActive">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>180</width>
<height>23</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_fontSizeActive">
<item>
<widget class="QLabel" name="label_fontSizeActive">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Font size</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_fontSizeActive">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBox_fontSizeActive">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>7</number>
</property>
<property name="maximum">
<number>48</number>
</property>
<property name="value">
<number>12</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_fontColorActive">
<item>
<widget class="QLabel" name="label_fontColorActive">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Font color</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_fontColorActive">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="KColorCombo" name="kcolorcombo_fontColorActive">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_fontWeightActive">
<item>
<widget class="QLabel" name="label_fontWeightActive">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Font weight</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_fontWeightActive">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBox_fontWeightActive">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>100</number>
</property>
<property name="maximum">
<number>900</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>400</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_fontStyleActive">
<item>
<widget class="QLabel" name="label_fontStyleActive">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Font style</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_fontStyleActive">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QComboBox" name="comboBox_fontStyleActive">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<item>
<property name="text">
<string notr="true">normal</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">italic</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_active">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>119</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_inactive">
<attribute name="title">
<string>Inactive desktop</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollArea_inactive">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_inactive">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>406</width>
<height>167</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="layout_fontInactive">
<item>
<widget class="QLabel" name="label_fontInactive">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Font</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_fontInactive">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QFontComboBox" name="fontComboBox_fontInactive">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>180</width>
<height>23</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_fontSizeInactive">
<item>
<widget class="QLabel" name="label_fontSizeInactive">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Font size</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_fontSizeInactive">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBox_fontSizeInactive">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>7</number>
</property>
<property name="maximum">
<number>48</number>
</property>
<property name="value">
<number>12</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_fontColorInactive">
<item>
<widget class="QLabel" name="label_fontColorInactive">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Font color</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_fontColorInactive">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="KColorCombo" name="kcolorcombo_fontColorInactive">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_fontWeightInactive">
<item>
<widget class="QLabel" name="label_fontWeightInactive">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Font weight</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_fontWeightInactive">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBox_fontWeightInactive">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>100</number>
</property>
<property name="maximum">
<number>900</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>400</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_fontStyleInactive">
<item>
<widget class="QLabel" name="label_fontStyleInactive">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Font style</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_fontStyleInactive">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QComboBox" name="comboBox_fontStyleInactive">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<item>
<property name="text">
<string notr="true">normal</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">italic</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_inactive">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>119</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KColorCombo</class>
<extends>QComboBox</extends>
<header>kcolorcombo.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -1,547 +0,0 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "desktop-panel.h"
#include <KConfigDialog>
#include <KGlobal>
#include <KStandardDirs>
#include <KWindowSystem>
#include <Plasma/Containment>
#include <Plasma/Corona>
#include <Plasma/Theme>
#include <QDebug>
#include <QFile>
#include <QGraphicsGridLayout>
#include <QGraphicsProxyWidget>
#include <QGraphicsView>
#include <QMouseEvent>
#include <QProcessEnvironment>
#include <QTextCodec>
#include <fontdialog/fontdialog.h>
#include <pdebug/pdebug.h>
CustomPlasmaLabel::CustomPlasmaLabel(DesktopPanel *wid, const int num, const bool debugCmd)
: QLabel(0),
debug(debugCmd),
number(num),
widget(wid)
{
if (debug) qDebug() << PDEBUG << ":" << "Init label" << number;
}
CustomPlasmaLabel::~CustomPlasmaLabel()
{
}
int CustomPlasmaLabel::getNumber()
{
if (debug) qDebug() << PDEBUG;
return number;
}
void CustomPlasmaLabel::mousePressEvent(QMouseEvent *event)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Get signal" << event->button();
if (event->button() == Qt::LeftButton)
widget->setCurrentDesktop(number);
emit(QLabel::mousePressEvent(event));
}
DesktopPanel::DesktopPanel(QObject *parent, const QVariantList &args)
: Plasma::Applet(parent, args)
{
// debug
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
if (debugEnv == QString("yes"))
debug = true;
else
debug = false;
setBackgroundHints(DefaultBackground);
setAspectRatioMode(Plasma::IgnoreAspectRatio);
setHasConfigurationInterface(true);
// text format init
currentFormatLine.append(QString(""));
currentFormatLine.append(QString(""));
formatLine.append(QString(""));
formatLine.append(QString(""));
}
DesktopPanel::~DesktopPanel()
{
}
void DesktopPanel::init()
{
if (debug) qDebug() << PDEBUG;
extsysmonEngine = dataEngine(QString("ext-sysmon"));
layout = new QGraphicsGridLayout();
layout->setContentsMargins(1, 1, 1, 1);
setLayout(layout);
currentDesktop = 1;
// read variables
configChanged();
connect(this, SIGNAL(activate()), this, SLOT(changePanelsState()));
}
QList<Plasma::Containment *> DesktopPanel::getPanels()
{
if (debug) qDebug() << PDEBUG;
QList<Plasma::Containment *> panels;
for (int i=0; i<containment()->corona()->containments().count(); i++)
if (containment()->corona()->containments()[i]->containmentType() == Plasma::Containment::PanelContainment)
panels.append(containment()->corona()->containments()[i]);
return panels;
}
QString DesktopPanel::panelLocationToStr(Plasma::Location loc)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Location" << loc;
switch(loc) {
case Plasma::TopEdge:
return i18n("Top Edge");
case Plasma::BottomEdge:
return i18n("Bottom Edge");
case Plasma::LeftEdge:
return i18n("Left Edge");
case Plasma::RightEdge:
return i18n("Right Edge");
default:
return i18n("Unknown Position (%1)", loc);
}
}
QString DesktopPanel::parsePattern(const QString rawLine, const int num)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Raw line" << rawLine;
if (debug) qDebug() << PDEBUG << ":" << "Number" << num;
QString line, fullMark, mark;
line = rawLine;
if (currentDesktop == num + 1)
mark = configuration[QString("mark")];
else
mark = QString("");
fullMark = QString("%1").arg(mark, configuration[QString("mark")].count(), QLatin1Char(' '));
if (line.contains(QString("$fullmark")))
line.replace(QString("$fullmark"), fullMark);
if (line.contains(QString("$mark")))
line.replace(QString("$mark"), mark);
if (line.contains(QString("$name")))
line.replace(QString("$name"), desktopNames[num]);
if (line.contains(QString("$number")))
line.replace(QString("$number"), QString::number(num + 1));
if (line.contains(QString("$total")))
line.replace(QString("$total"), QString::number(desktopNames.count()));
return line;
}
void DesktopPanel::reinit()
{
if (debug) qDebug() << PDEBUG;
if (desktopNames.isEmpty()) return;
// clear
// labels
for (int i=0; i<proxyWidgets.count(); i++) {
layout->removeItem(proxyWidgets[i]);
proxyWidgets[i]->setWidget(0);
delete labels[i];
delete proxyWidgets[i];
}
labels.clear();
proxyWidgets.clear();
// add
// layout
if (configuration[QString("background")].toInt() == 0)
setBackgroundHints(NoBackground);
// labels
for (int i=0; i<desktopNames.count(); i++) {
proxyWidgets.append(new QGraphicsProxyWidget(this));
labels.append(new CustomPlasmaLabel(this, i, debug));
labels[i]->setWordWrap(false);
labels[i]->setAttribute(Qt::WA_TranslucentBackground, true);
proxyWidgets[i]->setWidget(labels[i]);
if (configuration[QString("layout")].toInt() == 0)
layout->addItem(proxyWidgets[i], 0, i);
else
layout->addItem(proxyWidgets[i], i, 0);
}
updateText(true);
for (int i=0; i<proxyWidgets.count(); i++) {
labels[i]->adjustSize();
proxyWidgets[i]->setGeometry(labels[i]->geometry());
}
}
void DesktopPanel::changePanelsState()
{
if (debug) qDebug() << PDEBUG;
QList<Plasma::Containment *> panels = getPanels();
for (int i=0; i<panels.count(); i++) {
if ((!configuration[QString("panels")].split(QChar(','))
.contains(QString::number(i))) &&
(configuration[QString("panels")] != QString("-1")))
continue;
bool wasVisible = panels[i]->view()->isVisible();
int winId = panels[i]->view()->winId();
if (wasVisible) {
if (debug) qDebug() << PDEBUG << ":" << "Hide panel";
KWindowInfo oldInfo = KWindowSystem::windowInfo(winId, NET::WMState);
oldState = oldInfo.state();
panels[i]->view()->setVisible(false);
} else {
if (debug) qDebug() << PDEBUG << ":" << "Show panel";
panels[i]->view()->setVisible(true);
KWindowSystem::clearState(winId, NET::KeepAbove);
KWindowSystem::setState(winId, oldState | NET::StaysOnTop);
KWindowSystem::setOnAllDesktops(winId, true);
}
}
}
void DesktopPanel::setCurrentDesktop(const int number)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Set desktop" << number + 1;
QString cmd = parsePattern(configuration[QString("desktopcmd")], number);
if (debug) qDebug() << PDEBUG << ":" << "Run cmd " << cmd;
QProcess command;
command.startDetached(cmd);
}
void DesktopPanel::updateText(const bool first)
{
if (debug) qDebug() << PDEBUG;
QString line, text;
for (int i=0; i<labels.count(); i++) {
if (debug) qDebug() << PDEBUG << ":" << "Label" << i;
if (first)
line = configuration[QString("pattern")];
else
line = parsePattern(configuration[QString("pattern")], i);
if (currentDesktop == i + 1)
text = currentFormatLine[0] + line + currentFormatLine[1];
else
text = formatLine[0] + line + formatLine[1];
labels[i]->setText(text);
}
update();
int height = 0;
int width = 0;
for (int i=0; i<proxyWidgets.count(); i++) {
labels[i]->adjustSize();
proxyWidgets[i]->setGeometry(labels[i]->geometry());
if (configuration[QString("layout")].toInt() == 0) {
width += proxyWidgets[i]->geometry().width();
if (height < proxyWidgets[i]->geometry().height())
height = proxyWidgets[i]->geometry().height();
} else {
height += proxyWidgets[i]->geometry().height();
if (width < proxyWidgets[i]->geometry().width())
width = proxyWidgets[i]->geometry().width();
}
}
layout->setMinimumSize(width, height);
}
// data engine interaction
void DesktopPanel::dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Source name" << sourceName;
if (data.keys().count() == 0)
return;
if (sourceName == QString("desktop")) {
currentDesktop = data[QString("currentNumber")].toInt();
if (desktopNames.isEmpty()) {
desktopNames = data[QString("list")].toString().split(QString(";;"));
reinit();
}
updateText();
}
}
// configuration interface
void DesktopPanel::createConfigurationInterface(KConfigDialog *parent)
{
if (debug) qDebug() << PDEBUG;
QWidget *appWidget = new QWidget;
uiAppConfig.setupUi(appWidget);
QWidget *configWidget = new QWidget;
uiWidConfig.setupUi(configWidget);
QWidget *toggleWidget = new QWidget;
uiToggleConfig.setupUi(toggleWidget);
uiWidConfig.textEdit_elements->setPlainText(configuration[QString("pattern")]);
if (configuration[QString("background")].toInt() == 0)
uiWidConfig.checkBox_background->setCheckState(Qt::Unchecked);
else
uiWidConfig.checkBox_background->setCheckState(Qt::Checked);
if (configuration[QString("layout")].toInt() == 0)
uiWidConfig.checkBox_layout->setCheckState(Qt::Unchecked);
else
uiWidConfig.checkBox_layout->setCheckState(Qt::Checked);
uiWidConfig.spinBox_interval->setValue(configuration[QString("interval")].toInt());
uiWidConfig.comboBox_mark->setItemText(uiWidConfig.comboBox_mark->count()-1, configuration[QString("mark")]);
uiWidConfig.comboBox_mark->setCurrentIndex(uiWidConfig.comboBox_mark->count()-1);
uiWidConfig.lineEdit_desktopcmd->setText(configuration[QString("desktopcmd")]);
KConfigGroup cg = config();
CFont font(cg.readEntry("currentFontFamily", "Terminus"));
font.setPointSize(cg.readEntry("currentFontSize", 10));
font.setCurrentColor(QColor(cg.readEntry("currentFontColor", "#ff0000")));
font.setHtmlWeight(cg.readEntry("currentFontWeight", 400));
font.setItalic(cg.readEntry("currentFontStyle", "normal") == QString("italic"));
uiAppConfig.fontComboBox_fontActive->setCurrentFont(font.toQFont());
uiAppConfig.spinBox_fontSizeActive->setValue(font.pointSize());
uiAppConfig.kcolorcombo_fontColorActive->setColor(font.color());
if (font.italic())
uiAppConfig.comboBox_fontStyleActive->setCurrentIndex(1);
else
uiAppConfig.comboBox_fontStyleActive->setCurrentIndex(0);
uiAppConfig.spinBox_fontWeightActive->setValue(font.htmlWeight());
font = CFont(cg.readEntry("fontFamily", "Terminus"));
font.setPointSize(cg.readEntry("fontSize", 10));
font.setCurrentColor(QColor(cg.readEntry("fontColor", "#000000")));
font.setHtmlWeight(cg.readEntry("fontWeight", 400));
font.setItalic(cg.readEntry("fontStyle", "normal") == QString("italic"));
uiAppConfig.fontComboBox_fontInactive->setCurrentFont(font.toQFont());
uiAppConfig.spinBox_fontSizeInactive->setValue(font.pointSize());
uiAppConfig.kcolorcombo_fontColorInactive->setColor(font.color());
if (font.italic())
uiAppConfig.comboBox_fontStyleInactive->setCurrentIndex(1);
else
uiAppConfig.comboBox_fontStyleInactive->setCurrentIndex(0);
uiAppConfig.spinBox_fontWeightInactive->setValue(font.htmlWeight());
uiToggleConfig.listWidget_list->clear();
QList<Plasma::Containment *> panels = getPanels();
for (int i=0; i<panels.count(); i++) {
QListWidgetItem *item = new QListWidgetItem(panelLocationToStr(panels[i]->location()), uiToggleConfig.listWidget_list);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
if ((configuration[QString("panels")].split(QChar(','))
.contains(QString::number(i))) ||
(configuration[QString("panels")] == QString("-1")))
item->setCheckState(Qt::Checked);
else
item->setCheckState(Qt::Unchecked);
}
parent->addPage(configWidget, i18n("Widget"), Applet::icon());
parent->addPage(appWidget, i18n("Appearance"), QString("preferences-desktop-theme"));
parent->addPage(toggleWidget, i18n("Toggle panels"), QString("plasma"));
connect(uiWidConfig.pushButton_tags, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(uiWidConfig.pushButton_br, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(uiWidConfig.pushButton_font, SIGNAL(clicked(bool)), this, SLOT(setFontFormating()));
connect(uiWidConfig.pushButton_bold, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(uiWidConfig.pushButton_italic, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(uiWidConfig.pushButton_underline, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(uiWidConfig.pushButton_strike, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(uiWidConfig.pushButton_left, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(uiWidConfig.pushButton_center, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(uiWidConfig.pushButton_right, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(uiWidConfig.pushButton_fill, SIGNAL(clicked(bool)), this, SLOT(setFormating()));
connect(parent, SIGNAL(okClicked()), this, SLOT(configAccepted()));
connect(parent, SIGNAL(applyClicked()), this, SLOT(configAccepted()));
}
void DesktopPanel::configAccepted()
{
if (debug) qDebug() << PDEBUG;
extsysmonEngine->disconnectSource(QString("desktop"), this);
KConfigGroup cg = config();
cg.writeEntry("pattern", uiWidConfig.textEdit_elements->toPlainText());
cg.writeEntry("background", QString::number(uiWidConfig.checkBox_background->checkState()));
cg.writeEntry("layout", QString::number(uiWidConfig.checkBox_layout->checkState()));
cg.writeEntry("interval", QString::number(uiWidConfig.spinBox_interval->value()));
cg.writeEntry("mark", uiWidConfig.comboBox_mark->currentText());
cg.writeEntry("desktopcmd", uiWidConfig.lineEdit_desktopcmd->text());
cg.writeEntry("currentFontFamily", uiAppConfig.fontComboBox_fontActive->currentFont().family());
cg.writeEntry("currentFontSize", uiAppConfig.spinBox_fontSizeActive->value());
cg.writeEntry("currentFontColor", uiAppConfig.kcolorcombo_fontColorActive->color().name());
cg.writeEntry("currentFontWeight", uiAppConfig.spinBox_fontWeightActive->value());
cg.writeEntry("currentFontStyle", uiAppConfig.comboBox_fontStyleActive->currentText());
cg.writeEntry("fontFamily", uiAppConfig.fontComboBox_fontInactive->currentFont().family());
cg.writeEntry("fontSize", uiAppConfig.spinBox_fontSizeInactive->value());
cg.writeEntry("fontColor", uiAppConfig.kcolorcombo_fontColorInactive->color().name());
cg.writeEntry("fontWeight", uiAppConfig.spinBox_fontWeightInactive->value());
cg.writeEntry("fontStyle", uiAppConfig.comboBox_fontStyleInactive->currentText());
QStringList indexes;
for (int i=0; i<uiToggleConfig.listWidget_list->count(); i++)
if (uiToggleConfig.listWidget_list->item(i)->checkState() == Qt::Checked)
indexes.append(QString::number(i));
if (indexes.count() == uiToggleConfig.listWidget_list->count())
cg.writeEntry("panels", QString("-1"));
else
cg.writeEntry("panels", indexes.join(QChar(',')));
}
void DesktopPanel::configChanged()
{
if (debug) qDebug() << PDEBUG;
KConfigGroup cg = config();
configuration[QString("pattern")] = cg.readEntry("pattern", "[$fullmark$number/$total: $name]");
configuration[QString("background")] = cg.readEntry("background", "2");
configuration[QString("desktopcmd")] = cg.readEntry("desktopcmd", "qdbus org.kde.kwin /KWin setCurrentDesktop $number");
configuration[QString("interval")] = cg.readEntry("interval", "1000");
configuration[QString("layout")] = cg.readEntry("layout", "0");
configuration[QString("mark")] = cg.readEntry("mark", "¤");
configuration[QString("panels")] = cg.readEntry("panels", "-1");
extsysmonEngine->connectSource(QString("desktop"), this, configuration[QString("interval")].toInt());
CFont font = CFont(cg.readEntry("currentFontFamily", "Terminus"));
font.setPointSize(cg.readEntry("currentFontSize", 10));
font.setCurrentColor(QColor(cg.readEntry("currentFontColor", "#ff0000")));
font.setHtmlWeight(cg.readEntry("currentFontWeight", 400));
font.setItalic(cg.readEntry("currentFontStyle", "normal") == QString("italic"));
QString fontStyle;
if (font.italic())
fontStyle = QString("italic");
else
fontStyle = QString("normal");
currentFormatLine[0] = QString("<html><head><style type=\"text/css\">p, li { white-space: pre-wrap; }</style>\
</head><body style=\"font-family:'%1'; font-size:%2pt; font-weight:%3; font-style:%4; color:%5;\">")
.arg(font.family())
.arg(font.pointSize())
.arg(font.htmlWeight())
.arg(fontStyle)
.arg(font.color().name());
currentFormatLine[1] = QString("</body></html>");
font = CFont(cg.readEntry("fontFamily", "Terminus"));
font.setPointSize(cg.readEntry("fontSize", 10));
font.setCurrentColor(QColor(cg.readEntry("fontColor", "#000000")));
font.setHtmlWeight(cg.readEntry("fontWeight", 400));
font.setItalic(cg.readEntry("fontStyle", "normal") == QString("italic"));
if (font.italic())
fontStyle = QString("italic");
else
fontStyle = QString("normal");
formatLine[0] = QString("<html><head><style type=\"text/css\">p, li { white-space: pre-wrap; }</style>\
</head><body style=\"font-family:'%1'; font-size:%2pt; font-weight:%3; font-style:%4; color:%5;\">")
.arg(font.family())
.arg(font.pointSize())
.arg(font.htmlWeight())
.arg(fontStyle)
.arg(font.color().name());
formatLine[1] = QString("</body></html>");
reinit();
}
void DesktopPanel::setFontFormating()
{
if (debug) qDebug() << PDEBUG;
CFont defaultFont = CFont(uiAppConfig.fontComboBox_fontInactive->currentFont().family(),
uiAppConfig.spinBox_fontSizeInactive->value(),
400, false, uiAppConfig.kcolorcombo_fontColorInactive->color());
CFont font = CFontDialog::getFont(i18n("Select font"), defaultFont,
false, false);
QString selectedText = uiWidConfig.textEdit_elements->textCursor().selectedText();
uiWidConfig.textEdit_elements->insertPlainText(QString("<span style=\"color:%1; font-family:'%2'; font-size:%3pt;\">")
.arg(font.color().name()).arg(font.family()).arg(font.pointSize()) +
selectedText + QString("</span>"));
}
void DesktopPanel::setFormating()
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Sender" << sender();
QString selectedText = uiWidConfig.textEdit_elements->textCursor().selectedText();
if (sender() == uiWidConfig.pushButton_tags)
uiWidConfig.textEdit_elements->insertPlainText(QString("$") + uiWidConfig.comboBox_tags->currentText());
else if (sender() == uiWidConfig.pushButton_br)
uiWidConfig.textEdit_elements->insertPlainText(QString("<br>\n"));
else if (sender() == uiWidConfig.pushButton_bold)
uiWidConfig.textEdit_elements->insertPlainText(QString("<b>") + selectedText + QString("</b>"));
else if (sender() == uiWidConfig.pushButton_italic)
uiWidConfig.textEdit_elements->insertPlainText(QString("<i>") + selectedText + QString("</i>"));
else if (sender() == uiWidConfig.pushButton_underline)
uiWidConfig.textEdit_elements->insertPlainText(QString("<u>") + selectedText + QString("</u>"));
else if (sender() == uiWidConfig.pushButton_strike)
uiWidConfig.textEdit_elements->insertPlainText(QString("<s>") + selectedText + QString("</s>"));
else if (sender() == uiWidConfig.pushButton_left)
uiWidConfig.textEdit_elements->insertPlainText(QString("<p align=\"left\">") + selectedText + QString("</p>"));
else if (sender() == uiWidConfig.pushButton_center)
uiWidConfig.textEdit_elements->insertPlainText(QString("<p align=\"center\">") + selectedText + QString("</p>"));
else if (sender() == uiWidConfig.pushButton_right)
uiWidConfig.textEdit_elements->insertPlainText(QString("<p align=\"right\">") + selectedText + QString("</p>"));
else if (sender() == uiWidConfig.pushButton_fill)
uiWidConfig.textEdit_elements->insertPlainText(QString("<p align=\"justify\">") + selectedText + QString("</p>"));
}
#include "desktop-panel.moc"

View File

@ -1,114 +0,0 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef DESKTOP_PANEL_H
#define DESKTOP_PANEL_H
#include <Plasma/Applet>
#include <Plasma/DataEngine>
#include <QLabel>
#include <ui_appearance.h>
#include <ui_toggle.h>
#include <ui_widget.h>
class QGraphicsGridLayout;
class QGraphicsProxyWidget;
class DesktopPanel;
class CustomPlasmaLabel : public QLabel
{
Q_OBJECT
public:
CustomPlasmaLabel(DesktopPanel *wid,
const int num,
const bool debugCmd = false);
~CustomPlasmaLabel();
int getNumber();
protected:
void mousePressEvent(QMouseEvent *event);
private:
// debug
bool debug;
// variables
int number;
DesktopPanel *widget;
};
class DesktopPanel : public Plasma::Applet
{
Q_OBJECT
public:
DesktopPanel(QObject *parent, const QVariantList &args);
~DesktopPanel();
void init();
QString parsePattern(const QString rawLine, const int num);
public slots:
// dataengine
void dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data);
// configuration interface
void configAccepted();
void configChanged();
// events
void changePanelsState();
void setCurrentDesktop(const int number);
private slots:
void reinit();
void setFontFormating();
void setFormating();
protected:
void createConfigurationInterface(KConfigDialog *parent);
private:
// functions
QList<Plasma::Containment *> getPanels();
QString panelLocationToStr(Plasma::Location loc);
void updateText(const bool first = false);
// ui
QGraphicsGridLayout *layout;
QList<QGraphicsProxyWidget *> proxyWidgets;
QList<CustomPlasmaLabel *> labels;
// debug
bool debug;
// data engine
int currentDesktop;
int oldState;
Plasma::DataEngine *extsysmonEngine;
// configuration interface
Ui::AppearanceWidget uiAppConfig;
Ui::ConfigWindow uiWidConfig;
Ui::ToggleWindow uiToggleConfig;
// configuration
QMap<QString, QString> configuration;
QStringList desktopNames, currentFormatLine, formatLine;
};
K_EXPORT_PLASMA_APPLET(desktop-panel, DesktopPanel)
#endif /* DESKTOP_PANEL_H */

View File

@ -12,11 +12,14 @@ X-KDE-ServiceTypes=Plasma/Applet
Type=Service
Icon=utilities-system-monitor
X-KDE-Library=plasma_applet_desktop-panel
X-KDE-ServiceTypes=Plasma/Applet
X-Plasma-API=declarativeappletscript
X-Plasma-MainScript=ui/main.qml
X-Plasma-RemoteLocation=
X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis
X-KDE-PluginInfo-Email=esalexeev@gmail.com
X-KDE-PluginInfo-Name=desktop-panel
X-KDE-PluginInfo-Name=org.kde.plasma.desktoppanel
X-KDE-PluginInfo-Version=@PROJECT_VERSION@
X-KDE-PluginInfo-Website=http://arcanis.name/projects/awesome-widgets/
X-KDE-PluginInfo-Category=System Information

View File

@ -0,0 +1,53 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import org.kde.plasma.configuration 2.0
ConfigModel {
ConfigCategory {
name: i18n("Widget")
icon: "utilities-system-monitor"
source: "widget.qml"
}
ConfigCategory {
name: i18n("Advanced")
icon: "system-run"
source: "advanced.qml"
}
ConfigCategory {
name: i18n("Active desktop")
icon: "preferences-desktop-theme"
source: "activeapp.qml"
}
ConfigCategory {
name: i18n("Inactive desktop")
icon: "preferences-desktop-theme"
source: "inactiveapp.qml"
}
ConfigCategory {
name: i18n("About")
icon: "help-about"
source: "about.qml"
}
}

View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name=""/>
<group name="Widget">
<!-- widget -->
<entry name="text" type="string">
<default>[$mark$number/$total: $name]</default>
</entry>
</group>
<group name="Advanced">
<!-- advanced -->
<entry name="height" type="int">
<default>0</default>
</entry>
<entry name="width" type="int">
<default>0</default>
</entry>
<entry name="tooltipType" type="string">
<default>windows</default>
</entry>
<entry name="tooltipWidth" type="int">
<default>200</default>
</entry>
<entry name="tooltipColor" type="string">
<default>#ffffff</default>
</entry>
<entry name="background" type="bool">
<default>true</default>
</entry>
<entry name="verticalLayout" type="bool">
<default>false</default>
</entry>
<entry name="mark" type="string">
<default>¤</default>
</entry>
<entry name="panels" type="int">
<default>-1</default>
</entry>
</group>
<group name="Appearance">
<!-- appearance -->
<entry name="textAlign" type="string">
<default>center</default>
</entry>
<entry name="fontFamily" type="string">
<default>Terminus</default>
</entry>
<entry name="fontSize" type="int">
<default>12</default>
</entry>
<entry name="fontColor" type="string">
<default>#000000</default>
</entry>
<entry name="fontWeight" type="string">
<default>normal</default>
</entry>
<entry name="fontStyle" type="string">
<default>normal</default>
</entry>
<!-- current -->
<entry name="currentTextAlign" type="string">
<default>center</default>
</entry>
<entry name="currentFontFamily" type="string">
<default>Terminus</default>
</entry>
<entry name="currentFontSize" type="int">
<default>12</default>
</entry>
<entry name="currentFontColor" type="string">
<default>#ff0000</default>
</entry>
<entry name="currentFontWeight" type="string">
<default>normal</default>
</entry>
<entry name="currentFontStyle" type="string">
<default>normal</default>
</entry>
</group>
</kcfg>

View File

@ -0,0 +1,111 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import QtQuick.Layouts 1.0 as QtLayouts
import org.kde.plasma.desktoppanel 1.0
Item {
id: aboutPage
width: childrenRect.width
height: childrenRect.height
implicitWidth: pageColumn.implicitWidth
implicitHeight: pageColumn.implicitHeight
property bool debug: DPAdds.isDebugEnabled()
Column {
id: pageColumn
anchors.fill: parent
QtControls.TabView {
height: parent.height
width: parent.width
QtControls.Tab {
title: i18n("About")
QtLayouts.ColumnLayout {
QtControls.Label {
QtLayouts.Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
text: DPAdds.getAboutText("header")
}
QtControls.Label {
QtLayouts.Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
text: DPAdds.getAboutText("version")
}
QtControls.Label {
QtLayouts.Layout.fillWidth: true
horizontalAlignment: Text.AlignJustify
text: DPAdds.getAboutText("description")
}
QtControls.Label {
QtLayouts.Layout.fillWidth: true
horizontalAlignment: Text.AlignLeft
textFormat: Text.RichText
text: DPAdds.getAboutText("links")
onLinkActivated: Qt.openUrlExternally(link);
}
QtControls.Label {
QtLayouts.Layout.fillHeight: true
QtLayouts.Layout.fillWidth: true
font.capitalization: Font.SmallCaps
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom
textFormat: Text.RichText
text: DPAdds.getAboutText("copy")
}
}
}
QtControls.Tab {
title: i18n("Acknowledgment")
QtLayouts.ColumnLayout {
QtControls.Label {
QtLayouts.Layout.fillWidth: true
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignJustify
text: DPAdds.getAboutText("translators")
}
QtControls.Label {
QtLayouts.Layout.fillHeight: true
QtLayouts.Layout.fillWidth: true
horizontalAlignment: Text.AlignJustify
verticalAlignment: Text.AlignTop
textFormat: Text.RichText
text: DPAdds.getAboutText("3rdparty")
onLinkActivated: Qt.openUrlExternally(link);
}
}
}
}
}
Component.onCompleted: {
if (debug) console.log("[about::onCompleted]")
}
}

View File

@ -0,0 +1,218 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import QtQuick.Controls.Styles 1.3 as QtStyles
import QtQuick.Dialogs 1.1 as QtDialogs
import org.kde.plasma.desktoppanel 1.0
Item {
id: activeAppearancePage
width: childrenRect.width
height: childrenRect.height
implicitWidth: pageColumn.implicitWidth
implicitHeight: pageColumn.implicitHeight
property bool debug: DPAdds.isDebugEnabled()
property variant weight: {
25: 0,
50: 1,
63: 3,
75: 4,
87: 5
}
property alias cfg_currentFontFamily: selectFont.text
property alias cfg_currentFontSize: fontSize.value
property string cfg_currentFontWeight: fontWeight.currentText
property string cfg_currentFontStyle: fontStyle.currentText
property alias cfg_currentFontColor: selectColor.text
Column {
id: pageColumn
anchors.fill: parent
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font")
}
QtControls.Button {
id: selectFont
width: parent.width * 2 / 3
text: plasmoid.configuration.currentFontFamily
onClicked: fontDialog.visible = true
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font size")
}
QtControls.SpinBox {
id: fontSize
width: parent.width * 2 / 3
minimumValue: 8
maximumValue: 32
stepSize: 1
value: plasmoid.configuration.currentFontSize
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font weight")
}
QtControls.ComboBox {
id: fontWeight
width: parent.width * 2 / 3
textRole: "label"
model: [
{
'label': i18n("light"),
'name': "light"
},
{
'label': i18n("normal"),
'name': "normal"
},
{
'label': i18n("demi bold"),
'name': "demibold"
},
{
'label': i18n("bold"),
'name': "bold"
},
{
'label': i18n("black"),
'name': "black"
}
]
onCurrentIndexChanged: cfg_currentFontWeight = model[currentIndex]["name"]
Component.onCompleted: {
for (var i = 0; i < model.length; i++) {
if (model[i]["name"] == plasmoid.configuration.currentFontWeight) {
fontWeight.currentIndex = i;
}
}
}
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font style")
}
QtControls.ComboBox {
id: fontStyle
width: parent.width * 2 / 3
textRole: "label"
model: [
{
'label': i18n("normal"),
'name': "normal"
},
{
'label': i18n("italic"),
'name': "italic"
}
]
onCurrentIndexChanged: cfg_currentFontStyle = model[currentIndex]["name"]
Component.onCompleted: {
for (var i = 0; i < model.length; i++) {
if (model[i]["name"] == plasmoid.configuration.currentFontStyle) {
fontStyle.currentIndex = i;
}
}
}
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font color")
}
QtControls.Button {
id: selectColor
width: parent.width * 2 / 3
style: QtStyles.ButtonStyle {
background: Rectangle {
color: plasmoid.configuration.currentFontColor
}
}
text: plasmoid.configuration.currentFontColor
onClicked: colorDialog.visible = true
}
}
}
QtDialogs.ColorDialog {
id: colorDialog
title: i18n("Select a color")
color: selectColor.text
onAccepted: selectColor.text = colorDialog.color
}
QtDialogs.FontDialog {
id: fontDialog
title: i18n("Select a font")
font: Qt.font({ family: selectFont.text, pointSize: fontSize.value, weight: Font.Normal })
onAccepted: {
selectFont.text = fontDialog.font.family
fontSize.value = fontDialog.font.pointSize
fontStyle.currentIndex = fontDialog.font.italic ? 1 : 0
fontWeight.currentIndex = weight[fontDialog.font.weight]
}
}
Component.onCompleted: {
if (debug) console.log("[activeapp::onCompleted]")
}
}

View File

@ -0,0 +1,255 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import QtQuick.Controls.Styles 1.3 as QtStyles
import QtQuick.Dialogs 1.1 as QtDialogs
import org.kde.plasma.desktoppanel 1.0
Item {
id: advancedPage
width: childrenRect.width
height: childrenRect.height
implicitWidth: pageColumn.implicitWidth
implicitHeight: pageColumn.implicitHeight
property bool debug: DPAdds.isDebugEnabled()
property alias cfg_height: widgetHeight.value
property alias cfg_width: widgetWidth.value
property string cfg_tooltipType: tooltipType.currentText
property alias cfg_tooltipWidth: tooltipWidth.value
property alias cfg_tooltipColor: tooltipColor.text
property alias cfg_background: background.checked
property alias cfg_verticalLayout: verticalLayout.checked
property string cfg_mark: mark.currentText
Column {
id: pageColumn
anchors.fill: parent
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Widget height, px")
}
QtControls.SpinBox {
id: widgetHeight
width: parent.width * 3 / 5
minimumValue: 0
maximumValue: 4096
stepSize: 50
value: plasmoid.configuration.height
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Widget width, px")
}
QtControls.SpinBox {
id: widgetWidth
width: parent.width * 3 / 5
minimumValue: 0
maximumValue: 4096
stepSize: 50
value: plasmoid.configuration.width
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Tooltip type")
}
QtControls.ComboBox {
id: tooltipType
width: parent.width * 3 / 5
textRole: "label"
model: [
{
'label': i18n("contours"),
'name': "contours"
},
{
'label': i18n("windows"),
'name': "windows"
},
{
'label': i18n("clean desktop"),
'name': "clean"
},
{
'label': i18n("names"),
'name': "names"
},
{
'label': i18n("none"),
'name': "none"
}
]
onCurrentIndexChanged: cfg_tooltipType = model[currentIndex]["name"]
Component.onCompleted: {
for (var i = 0; i < model.length; i++) {
if (model[i]["name"] == plasmoid.configuration.tooltipType) {
tooltipType.currentIndex = i;
}
}
}
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Tooltip width")
}
QtControls.SpinBox {
id: tooltipWidth
width: parent.width * 3 / 5
minimumValue: 100
maximumValue: 1000
stepSize: 50
value: plasmoid.configuration.tooltipWidth
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font color")
}
QtControls.Button {
id: tooltipColor
width: parent.width * 3 / 5
style: QtStyles.ButtonStyle {
background: Rectangle {
color: plasmoid.configuration.tooltipColor
}
}
text: plasmoid.configuration.tooltipColor
onClicked: colorDialog.visible = true
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.heigth
width: parent.width * 2 / 5
}
QtControls.CheckBox {
id: background
width: parent.width * 3 / 5
text: i18n("Enable background")
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.heigth
width: parent.width * 2 / 5
}
QtControls.CheckBox {
id: verticalLayout
width: parent.width * 3 / 5
text: i18n("Vertical layout")
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Mark")
}
QtControls.ComboBox {
id: mark
width: parent.width * 3 / 5
editable: true
model: ["#", "$", "%", "&", "*", "@", "¤", "¶", "·", "º",
plasmoid.configuration.mark]
currentIndex: model.length - 1
onCurrentIndexChanged: cfg_mark = currentText
}
}
// Row {
// height: implicitHeight
// width: parent.width
// QtControls.Label {
// height: parent.height
// width: parent.width * 2 / 5
// horizontalAlignment: Text.AlignRight
// verticalAlignment: Text.AlignVCenter
// text: i18n("Panels to be hidden")
// }
// QtControls.Button {
// width: parent.width * 3 / 5
// text: i18n("Edit panels")
// onClicked: cfg_panels = DPAdds.editPanelsToContol(plasmoid.configuration.panels)
// }
// }
}
QtDialogs.ColorDialog {
id: colorDialog
title: i18n("Select a color")
color: tooltipColor.text
onAccepted: tooltipColor.text = colorDialog.color
}
Component.onCompleted: {
if (debug) console.log("[advanced::onCompleted]")
}
}

View File

@ -0,0 +1,36 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
pragma Singleton
import QtQuick 2.0
QtObject {
property variant fontWeight: {
"light": Font.Light,
"normal": Font.Normal,
"demibold": Font.DemiBold,
"bold": Font.Bold,
"black": Font.Black
}
property variant align: {
"left": Text.AlignLeft,
"center": Text.AlignHCenter,
"right": Text.AlignRight,
"justify": Text.AlignJustify
}
}

View File

@ -0,0 +1,218 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import QtQuick.Controls.Styles 1.3 as QtStyles
import QtQuick.Dialogs 1.1 as QtDialogs
import org.kde.plasma.desktoppanel 1.0
Item {
id: inactiveAppearancePage
width: childrenRect.width
height: childrenRect.height
implicitWidth: pageColumn.implicitWidth
implicitHeight: pageColumn.implicitHeight
property bool debug: AWKeys.isDebugEnabled()
property variant weight: {
25: 0,
50: 1,
63: 3,
75: 4,
87: 5
}
property alias cfg_fontFamily: selectFont.text
property alias cfg_fontSize: fontSize.value
property string cfg_fontWeight: fontWeight.currentText
property string cfg_fontStyle: fontStyle.currentText
property alias cfg_fontColor: selectColor.text
Column {
id: pageColumn
anchors.fill: parent
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font")
}
QtControls.Button {
id: selectFont
width: parent.width * 2 / 3
text: plasmoid.configuration.fontFamily
onClicked: fontDialog.visible = true
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font size")
}
QtControls.SpinBox {
id: fontSize
width: parent.width * 2 / 3
minimumValue: 8
maximumValue: 32
stepSize: 1
value: plasmoid.configuration.fontSize
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font weight")
}
QtControls.ComboBox {
id: fontWeight
width: parent.width * 2 / 3
textRole: "label"
model: [
{
'label': i18n("light"),
'name': "light"
},
{
'label': i18n("normal"),
'name': "normal"
},
{
'label': i18n("demi bold"),
'name': "demibold"
},
{
'label': i18n("bold"),
'name': "bold"
},
{
'label': i18n("black"),
'name': "black"
}
]
onCurrentIndexChanged: cfg_fontWeight = model[currentIndex]["name"]
Component.onCompleted: {
for (var i = 0; i < model.length; i++) {
if (model[i]["name"] == plasmoid.configuration.fontWeight) {
fontWeight.currentIndex = i;
}
}
}
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font style")
}
QtControls.ComboBox {
id: fontStyle
width: parent.width * 2 / 3
textRole: "label"
model: [
{
'label': i18n("normal"),
'name': "normal"
},
{
'label': i18n("italic"),
'name': "italic"
}
]
onCurrentIndexChanged: cfg_fontStyle = model[currentIndex]["name"]
Component.onCompleted: {
for (var i = 0; i < model.length; i++) {
if (model[i]["name"] == plasmoid.configuration.fontStyle) {
fontStyle.currentIndex = i;
}
}
}
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width / 3
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Font color")
}
QtControls.Button {
id: selectColor
width: parent.width * 2 / 3
style: QtStyles.ButtonStyle {
background: Rectangle {
color: plasmoid.configuration.fontColor
}
}
text: plasmoid.configuration.fontColor
onClicked: colorDialog.visible = true
}
}
}
QtDialogs.ColorDialog {
id: colorDialog
title: i18n("Select a color")
color: selectColor.text
onAccepted: selectColor.text = colorDialog.color
}
QtDialogs.FontDialog {
id: fontDialog
title: i18n("Select a font")
font: Qt.font({ family: selectFont.text, pointSize: fontSize.value, weight: Font.Normal })
onAccepted: {
selectFont.text = fontDialog.font.family
fontSize.value = fontDialog.font.pointSize
fontStyle.currentIndex = fontDialog.font.italic ? 1 : 0
fontWeight.currentIndex = weight[fontDialog.font.weight]
}
}
Component.onCompleted: {
if (debug) console.log("[inactiveapp::onCompleted]")
}
}

View File

@ -0,0 +1,193 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.4
import QtQuick.Controls 1.3 as QtControls
import QtQuick.Layouts 1.1
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.desktoppanel 1.0
import "."
Item {
id: main
property bool debug: DPAdds.isDebugEnabled()
property variant tooltipSettings: {
"tooltipColor": plasmoid.configuration.tooltipColor,
"tooltipType": plasmoid.configuration.tooltipType,
"tooltipWidth": plasmoid.configuration.tooltipWidth
}
signal needUpdate
signal needTooltipUpdate
signal sizeUpdate
// init
Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation
Plasmoid.compactRepresentation: Plasmoid.fullRepresentation
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Plasmoid.icon: "utilities-system-monitor"
Plasmoid.backgroundHints: plasmoid.configuration.background ? "DefaultBackground" : "NoBackground"
// ui
GridLayout {
anchors.fill: parent
columns: plasmoid.configuration.verticalLayout ? 1 : DPAdds.numberOfDesktops()
rows: plasmoid.configuration.verticalLayout ? DPAdds.numberOfDesktops() : 1
Repeater {
id: repeater
Layout.columnSpan: 0
Layout.rowSpan: 0
model: DPAdds.numberOfDesktops()
Text {
id: text
height: contentHeight
width: contentWidth
textFormat: Text.RichText
wrapMode: Text.NoWrap
verticalAlignment: Text.AlignVCenter
text: DPAdds.parsePattern(plasmoid.configuration.text, index + 1)
property alias tooltip: tooltip
MouseArea {
hoverEnabled: true
anchors.fill: parent
onClicked: DPAdds.setCurrentDesktop(index + 1);
onEntered: needTooltipUpdate()
}
PlasmaCore.ToolTipArea {
height: tooltip.height
width: tooltip.width
mainItem: Text {
id: tooltip
height: contentHeight
width: contentWidth
textFormat: Text.RichText
}
}
}
}
}
Timer {
id: timer
interval: 1000
onTriggered: needUpdate()
}
onNeedUpdate: {
if (debug) console.log("[main::onNeedUpdate]")
for (var i=0; i<repeater.count; i++) {
if (!repeater.itemAt(i)) {
if (debug) console.log("[main::onNeedUpdate] : Nothing to do here " + i)
timer.start()
return
}
repeater.itemAt(i).text = DPAdds.parsePattern(plasmoid.configuration.text, i + 1)
if (DPAdds.currentDesktop() == i + 1) {
repeater.itemAt(i).color = plasmoid.configuration.currentFontColor
repeater.itemAt(i).font.family = plasmoid.configuration.currentFontFamily
repeater.itemAt(i).font.italic = plasmoid.configuration.currentFontStyle == "italic" ? true : false
repeater.itemAt(i).font.pointSize = plasmoid.configuration.currentFontSize
repeater.itemAt(i).font.weight = general.fontWeight[plasmoid.configuration.currentFontWeight]
} else {
repeater.itemAt(i).color = plasmoid.configuration.fontColor
repeater.itemAt(i).font.family = plasmoid.configuration.fontFamily
repeater.itemAt(i).font.italic = plasmoid.configuration.fontStyle == "italic" ? true : false
repeater.itemAt(i).font.pointSize = plasmoid.configuration.fontSize
repeater.itemAt(i).font.weight = general.fontWeight[plasmoid.configuration.fontWeight]
}
repeater.itemAt(i).update()
}
sizeUpdate()
needTooltipUpdate()
}
onNeedTooltipUpdate: {
if (debug) console.log("[main::onNeedTooltipUpdate]")
for (var i=0; i<repeater.count; i++) {
repeater.itemAt(i).tooltip.text = DPAdds.toolTipImage(i + 1)
}
}
onSizeUpdate: {
if (debug) console.log("[main::onSizeUpdate]")
if (plasmoid.configuration.height == 0) {
var newHeight = 0
for (var i=0; i<repeater.count; i++)
newHeight += repeater.itemAt(i).contentHeight
Layout.minimumHeight = newHeight
Layout.maximumHeight = -1
} else {
Layout.minimumHeight = plasmoid.configuration.height
Layout.maximumHeight = plasmoid.configuration.height
}
if (plasmoid.configuration.width == 0) {
var newWidth = 0
for (var i=0; i<repeater.count; i++)
newWidth += repeater.itemAt(i).contentWidth
Layout.minimumWidth = newWidth
Layout.maximumWidth = -1
} else {
Layout.minimumWidth = plasmoid.configuration.width
Layout.maximumWidth = plasmoid.configuration.width
}
}
Plasmoid.onActivated: {
if (debug) console.log("[main::onActivated]")
// DPAdds.changePanelsState()
}
Plasmoid.onUserConfiguringChanged: {
if (plasmoid.userConfiguring) return
if (debug) console.log("[main::onUserConfiguringChanged]")
DPAdds.setMark(plasmoid.configuration.mark)
DPAdds.setPanelsToControl(plasmoid.configuration.panels)
DPAdds.setToolTipData(tooltipSettings)
needUpdate()
}
Component.onCompleted: {
if (debug) console.log("[main::onCompleted]")
// init submodule
Plasmoid.userConfiguringChanged(false)
DPAdds.desktopChanged.connect(needUpdate)
DPAdds.windowListChanged.connect(needTooltipUpdate)
}
}

View File

@ -0,0 +1 @@
singleton general general.qml

View File

@ -0,0 +1,244 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import org.kde.plasma.desktoppanel 1.0
Item {
id: widgetPage
width: childrenRect.width
height: childrenRect.height
implicitWidth: pageColumn.implicitWidth
implicitHeight: pageColumn.implicitHeight
property bool debug: DPAdds.isDebugEnabled()
property alias cfg_text: textPattern.text
Column {
id: pageColumn
anchors.fill: parent
QtControls.Label {
width: parent.width
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
text: i18n("Detailed information may be found on <a href=\"http://arcanis.name/projects/awesome-widgets/\">project homepage</a>")
onLinkActivated: Qt.openUrlExternally(link);
}
Row {
height: implicitHeight
width: parent.width
QtControls.Button {
width: parent.width * 3 / 12
text: i18n("Font")
iconName: "font"
onClicked: {
if (debug) console.log("[widget::onClicked] : Font button")
var defaultFont = {
"color": plasmoid.configuration.fontColor,
"family": plasmoid.configuration.fontFamily,
"size": plasmoid.configuration.fontSize
}
var font = DPAdds.getFont(defaultFont)
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, "<span style=\"color:" + font.color +
"; font-family:'" + font.family +
"'; font-size:" + font.size + "pt;\">" +
selected + "</span>")
}
}
QtControls.Button {
width: parent.width / 12
iconName: "format-indent-more"
onClicked: {
if (debug) console.log("[widget::onClicked] : Indent button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, selected + "<br>\n")
}
}
QtControls.Button {
width: parent.width / 12
iconName: "format-text-bold"
onClicked: {
if (debug) console.log("[widget::onClicked] : Bold button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, "<b>" + selected + "</b>")
}
}
QtControls.Button {
width: parent.width / 12
iconName: "format-text-italic"
onClicked: {
if (debug) console.log("[widget::onClicked] : Italic button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, "<i>" + selected + "</i>")
}
}
QtControls.Button {
width: parent.width / 12
iconName: "format-text-underline"
onClicked: {
if (debug) console.log("[widget::onClicked] : Underline button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, "<u>" + selected + "</u>")
}
}
QtControls.Button {
width: parent.width / 12
iconName: "format-text-strikethrough"
onClicked: {
if (debug) console.log("[widget::onClicked] : Strike button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, "<s>" + selected + "</s>")
}
}
QtControls.Button {
width: parent.width / 12
iconName: "format-justify-left"
onClicked: {
if (debug) console.log("[widget::onClicked] : Left button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, "<p align=\"left\">" + selected + "</p>")
}
}
QtControls.Button {
width: parent.width / 12
iconName: "format-justify-center"
onClicked: {
if (debug) console.log("[widget::onClicked] : Center button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, "<p align=\"center\">" + selected + "</p>")
}
}
QtControls.Button {
width: parent.width / 12
iconName: "format-justify-right"
onClicked: {
if (debug) console.log("[widget::onClicked] : Right button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, "<p align=\"right\">" + selected + "</p>")
}
}
QtControls.Button {
width: parent.width / 12
iconName: "format-justify-fill"
onClicked: {
if (debug) console.log("[widget::onClicked] : Justify button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, "<p align=\"justify\">" + selected + "</p>")
}
}
}
Row {
height: implicitHeight
width: parent.width
QtControls.ComboBox {
id: tags
width: parent.width - addTagButton.width - showValueButton.width
model: DPAdds.dictKeys()
}
QtControls.Button {
id: addTagButton
text: i18n("Add")
onClicked: {
if (debug) console.log("[widget::onClicked] : Add tag button")
var pos = textPattern.cursorPosition
var selected = textPattern.selectedText
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
textPattern.insert(pos, selected + "$" + tags.currentText)
}
}
QtControls.Button {
id: showValueButton
text: i18n("Show value")
onClicked: {
if (debug) console.log("[widget::onClicked] : Show tag button")
var message = i18n("Tag: %1", tags.currentText)
message += "<br>"
message += i18n("Value: %1", DPAdds.valueByKey(tags.currentText))
DPAdds.sendNotification("tag", message)
}
}
}
QtControls.TextArea {
id: textPattern
width: parent.width
height: parent.height * 4 / 5
textFormat: TextEdit.PlainText
text: plasmoid.configuration.text
}
}
Component.onCompleted: {
if (debug) console.log("[widget::onCompleted]")
}
}

View File

@ -0,0 +1,28 @@
[Desktop Entry]
Encoding=UTF-8
Name=Desktop Panel
Comment=A minimalistic Plasmoid
Comment[en]=A minimalistic Plasmoid
Comment[es]=Un plasmoide minimalista
Comment[es]=Un script Plasmoïde minimaliste
Comment[pt_BR]=Um script Plasmoid
Comment[ru]=Минималистичный плазмоид
Comment[uk]=Мінімалістичний плазмоїд
X-KDE-ServiceTypes=Plasma/Applet
Type=Service
Icon=utilities-system-monitor
X-KDE-ServiceTypes=Plasma/Applet
X-Plasma-API=declarativeappletscript
X-Plasma-MainScript=ui/main.qml
X-Plasma-RemoteLocation=
X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis
X-KDE-PluginInfo-Email=esalexeev@gmail.com
X-KDE-PluginInfo-Name=org.kde.plasma.desktoppanel
X-KDE-PluginInfo-Version=2.3.2
X-KDE-PluginInfo-Website=http://arcanis.name/projects/awesome-widgets/
X-KDE-PluginInfo-Category=System Information
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPLv3
X-KDE-PluginInfo-EnabledByDefault=true

View File

@ -0,0 +1,33 @@
set (PLUGIN_NAME dpplugin)
add_definitions(-DTRANSLATION_DOMAIN=\"plasma_applet_org.kde.plasma.desktoppanel\")
add_definitions (${Qt5Core_DEFINITIONS})
set (Qt_INCLUDE ${Qt5Core_INCLUDE_DIRS}
${Qt5Qml_INCLUDE_DIRS})
set (Qt_LIBRARIES ${Qt5Core_LIBRARIES}
${Qt5Qml_LIBRARIES})
set (Kf5_INCLUDE ${I18n_INCLUDE_DIR}
${Notifications_INCLUDE_DIR}
${Plasma_INCLUDE_DIR})
set (Kf5_LIBRARIES KF5::I18n
KF5::Notifications
KF5::Plasma
KF5::WindowSystem)
include_directories (${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../
${PROJECT_TRDPARTY_DIR}
${Qt_INCLUDE}
${Kf5_INCLUDE})
file (GLOB_RECURSE SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/fontdialog/*.cpp)
file (GLOB SUBPROJECT_NOTIFY *.notifyrc)
add_library (${PLUGIN_NAME} SHARED ${SUBPROJECT_SOURCE})
target_link_libraries (${PLUGIN_NAME} ${Qt_LIBRARIES} ${Kf5_LIBRARIES})
install (TARGETS ${PLUGIN_NAME} DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/desktoppanel)
install (FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/desktoppanel)
install (FILES ${SUBPROJECT_NOTIFY} DESTINATION ${KNOTIFYRC_INSTALL_DIR})

View File

@ -0,0 +1,39 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "desktoppanel.h"
#include <QtQml>
#include "dpadds.h"
static QObject *dpadds_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine);
Q_UNUSED(scriptEngine);
return new DPAdds();
}
void DPPlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.plasma.desktoppanel"));
qmlRegisterSingletonType<DPAdds>(uri, 1, 0, "DPAdds", dpadds_singletontype_provider);
}

View File

@ -0,0 +1,35 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef DPPLUGIN_H
#define DPPLUGIN_H
#include <QQmlExtensionPlugin>
class DPPlugin : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
public:
void registerTypes(const char *uri);
};
#endif /* DPPLUGIN_H */

View File

@ -0,0 +1,487 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "dpadds.h"
#include <KI18n/KLocalizedString>
#include <KNotifications/KNotification>
#include <KWindowSystem/KWindowSystem>
#include <QBuffer>
#include <QDebug>
#include <QGraphicsPixmapItem>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QHBoxLayout>
#include <QListWidget>
#include <QMessageBox>
#include <QPixmap>
#include <QProcessEnvironment>
#include <QScreen>
#include <fontdialog/fontdialog.h>
#include <pdebug/pdebug.h>
#include "version.h"
DPAdds::DPAdds(QObject *parent)
: QObject(parent)
{
// debug
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
debug = (debugEnv == QString("yes"));
connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), this, SLOT(changeDesktop(int)));
connect(KWindowSystem::self(), SIGNAL(windowAdded(WId)), this, SLOT(changeWindowList(WId)));
connect(KWindowSystem::self(), SIGNAL(windowRemoved(WId)), this, SLOT(changeWindowList(WId)));
}
DPAdds::~DPAdds()
{
if (debug) qDebug() << PDEBUG;
}
bool DPAdds::isDebugEnabled()
{
if (debug) qDebug() << PDEBUG;
return debug;
}
int DPAdds::currentDesktop()
{
if (debug) qDebug() << PDEBUG;
return KWindowSystem::currentDesktop();
}
QStringList DPAdds::dictKeys()
{
if (debug) qDebug() << PDEBUG;
QStringList allKeys;
allKeys.append(QString("mark"));
allKeys.append(QString("name"));
allKeys.append(QString("number"));
allKeys.append(QString("total"));
return allKeys;
}
int DPAdds::numberOfDesktops()
{
if (debug) qDebug() << PDEBUG;
return KWindowSystem::numberOfDesktops();
}
QString DPAdds::toolTipImage(const int desktop)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Desktop" << desktop;
if (tooltipType == QString("none")) return QString();
// prepare
DesktopWindowsInfo info = getInfoByDesktop(desktop);
if (tooltipType == QString("names")) {
QStringList windowList;
for (int i=0; i<info.windowsData.count(); i++)
windowList.append(info.windowsData[i].name);
return QString("<ul><li>%1</li></ul>").arg(windowList.join(QString("</li><li>")));
}
// init
QGraphicsScene *toolTipScene = new QGraphicsScene();
QGraphicsView *toolTipView = new QGraphicsView(toolTipScene);
toolTipView->setStyleSheet(QString("background: transparent"));
toolTipView->setContentsMargins(0, 0, 0, 0);
toolTipView->setFrameShape(QFrame::NoFrame);
toolTipView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
toolTipView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
// update
float margin = 5.0 * info.desktop.width() / 400.0;
toolTipView->resize(info.desktop.width() + 2.0 * margin, info.desktop.height() + 2.0 * margin);
toolTipScene->clear();
toolTipScene->setBackgroundBrush(QBrush(Qt::NoBrush));
// borders
toolTipScene->addLine(0, 0, 0, info.desktop.height() + 2.0 * margin);
toolTipScene->addLine(0, info.desktop.height() + 2.0 * margin,
info.desktop.width() + 2.0 * margin, info.desktop.height() + 2.0 * margin);
toolTipScene->addLine(info.desktop.width() + 2.0 * margin, info.desktop.height() + 2.0 * margin,
info.desktop.width() + 2.0 * margin, 0);
toolTipScene->addLine(info.desktop.width() + 2.0 * margin, 0, 0, 0);
if (tooltipType == QString("contours")) {
QPen pen = QPen();
pen.setWidthF(2.0 * info.desktop.width() / 400.0);
pen.setColor(QColor(tooltipColor));
for (int i=0; i<info.windowsData.count(); i++) {
QRect rect = info.windowsData[i].rect;
toolTipScene->addLine(rect.left() + margin, rect.bottom() + margin,
rect.left() + margin, rect.top() + margin, pen);
toolTipScene->addLine(rect.left() + margin, rect.top() + margin,
rect.right() + margin, rect.top() + margin, pen);
toolTipScene->addLine(rect.right() + margin, rect.top() + margin,
rect.right() + margin, rect.bottom() + margin, pen);
toolTipScene->addLine(rect.right() + margin, rect.bottom() + margin,
rect.left() + margin, rect.bottom() + margin, pen);
}
} else if (tooltipType == QString("clean")) {
QScreen *screen = QGuiApplication::primaryScreen();
for (int i=0; i<info.desktopsData.count(); i++) {
QPixmap desktop = screen->grabWindow(info.desktopsData[i].id);
toolTipScene->addPixmap(desktop)
->setOffset(info.desktopsData[i].rect.left(), info.desktopsData[i].rect.top());
}
} else if (tooltipType == QString("windows")) {
QScreen *screen = QGuiApplication::primaryScreen();
for (int i=0; i<info.desktopsData.count(); i++) {
QPixmap desktop = screen->grabWindow(info.desktopsData[i].id);
toolTipScene->addPixmap(desktop)
->setOffset(info.desktopsData[i].rect.left(), info.desktopsData[i].rect.top());
}
for (int i=0; i<info.windowsData.count(); i++) {
QPixmap window = screen->grabWindow(info.windowsData[i].id);
toolTipScene->addPixmap(window)
->setOffset(info.windowsData[i].rect.left(), info.windowsData[i].rect.top());
}
}
QPixmap image = toolTipView->grab().scaledToWidth(tooltipWidth);
QByteArray byteArray;
QBuffer buffer(&byteArray);
image.save(&buffer, "PNG");
delete toolTipView;
delete toolTipScene;
return QString("<img src=\"data:image/png;base64,%1\"/>").arg(QString(byteArray.toBase64()));
}
QString DPAdds::parsePattern(const QString pattern, const int desktop)
{
if (debug) qDebug() << PDEBUG;
QString parsed = pattern;
QStringList keys = dictKeys();
parsed.replace(QString("$$"), QString("$\\$\\"));
for (int i=0; i<keys.count(); i++)
parsed.replace(QString("$%1").arg(keys[i]), valueByKey(keys[i], desktop));
parsed.replace(QString("$\\$\\"), QString("$$"));
return parsed;
}
void DPAdds::setMark(const QString newMark)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Mark" << newMark;
mark = newMark;
}
void DPAdds::setPanelsToControl(const QString newPanels)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Panels" << newPanels;
panelsToControl.clear();
if (newPanels == QString("-1")) {
int count = getPanels().count();
for (int i=0; i<count; i++)
panelsToControl.append(i);
} else
for (int i=0; i<newPanels.split(QChar(',')).count(); i++)
panelsToControl.append(newPanels.split(QChar(','))[i].toInt());
}
void DPAdds::setToolTipData(const QVariantMap tooltipData)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Data" << tooltipData;
tooltipColor = tooltipData[QString("tooltipColor")].toString();
tooltipType = tooltipData[QString("tooltipType")].toString();
tooltipWidth = tooltipData[QString("tooltipWidth")].toInt();
}
QString DPAdds::valueByKey(const QString key, int desktop)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Requested key" << key;
if (desktop == -1) desktop = currentDesktop();
QString currentMark = currentDesktop() == desktop ? mark : QString("");
if (key == QString("mark"))
return QString("%1").arg(currentMark, mark.count(), QLatin1Char(' '))
.replace(QString(" "), QString("&nbsp;"));
else if (key == QString("name"))
return KWindowSystem::desktopName(desktop).replace(QString(" "), QString("&nbsp;"));
else if (key == QString("number"))
return QString::number(desktop);
else if (key == QString("total"))
return QString::number(numberOfDesktops());
else
return QString();
}
QString DPAdds::editPanelsToContol(const QString current)
{
if (debug) qDebug() << PDEBUG;
// paint
QDialog *dialog = new QDialog(nullptr);
QListWidget *widget = new QListWidget(dialog);
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Open | QDialogButtonBox::Close,
Qt::Vertical, dialog);
QHBoxLayout *layout = new QHBoxLayout(dialog);
layout->addWidget(widget);
layout->addWidget(buttons);
dialog->setLayout(layout);
connect(buttons, SIGNAL(rejected()), dialog, SLOT(reject()));
connect(buttons, SIGNAL(accepted()), dialog, SLOT(accept()));
// fill
QList<Plasma::Containment *> panels = getPanels();
for (int i=0; i<panels.count(); i++) {
QListWidgetItem *item = new QListWidgetItem(panelLocationToStr(panels[i]->location()), widget);
if ((current.split(QChar(',')).contains(QString::number(i))) ||
(current == QString("-1")))
item->setCheckState(Qt::Checked);
else
item->setCheckState(Qt::Unchecked);
}
// exec
QString value;
QStringList indexes;
int ret = dialog->exec();
switch (ret) {
case QDialog::Accepted:
for (int i=0; i<widget->count(); i++)
if (widget->item(i)->checkState() == Qt::Checked)
indexes.append(QString::number(i));
if (indexes.count() == widget->count())
value = QString("-1");
else
value = indexes.join(QChar(','));
break;
default:
value = current;
break;
}
return value;
}
QString DPAdds::getAboutText(const QString type)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Type" << type;
QString text;
if (type == QString("header"))
text = QString(NAME);
else if (type == QString("version"))
text = i18n("Version %1 (build date %2)", QString(VERSION), QString(BUILD_DATE));
else if (type == QString("description"))
text = i18n("A set of minimalistic plasmoid widgets");
else if (type == QString("links"))
text = i18n("Links:") + QString("<br>") +
QString("<a href=\"%1\">%2</a><br>").arg(QString(HOMEPAGE)).arg(i18n("Homepage")) +
QString("<a href=\"%1\">%2</a><br>").arg(QString(REPOSITORY)).arg(i18n("Repository")) +
QString("<a href=\"%1\">%2</a><br>").arg(QString(BUGTRACKER)).arg(i18n("Bugtracker")) +
QString("<a href=\"%1\">%2</a><br>").arg(QString(TRANSLATION)).arg(i18n("Translation issue")) +
QString("<a href=\"%1\">%2</a><br>").arg(QString(AUR_PACKAGES)).arg(i18n("AUR packages")) +
QString("<a href=\"%1\">%2</a>").arg(QString(OPENSUSE_PACKAGES)).arg(i18n("openSUSE packages"));
else if (type == QString("copy"))
text = QString("<small>&copy; %1 <a href=\"mailto:%2\">%3</a><br>").arg(QString(DATE)).arg(QString(EMAIL)).arg(QString(AUTHOR)) +
i18n("This software is licensed under %1", QString(LICENSE)) + QString("</small>");
else if (type == QString("translators"))
text = i18n("Translators: %1", QString(TRANSLATORS));
else if (type == QString("3rdparty")) {
QStringList trdPartyList = QString(TRDPARTY_LICENSE).split(QChar(';'), QString::SkipEmptyParts);
for (int i=0; i<trdPartyList.count(); i++)
trdPartyList[i] = QString("<a href=\"%3\">%1</a> (%2 license)")
.arg(trdPartyList[i].split(QChar(','))[0])
.arg(trdPartyList[i].split(QChar(','))[1])
.arg(trdPartyList[i].split(QChar(','))[2]);
text = i18n("This software uses: %1", trdPartyList.join(QString(", ")));
}
return text;
}
QVariantMap DPAdds::getFont(const QVariantMap defaultFont)
{
if (debug) qDebug() << PDEBUG;
QVariantMap fontMap;
CFont defaultCFont = CFont(defaultFont[QString("family")].toString(),
defaultFont[QString("size")].toInt(),
400, false, defaultFont[QString("color")].toString());
CFont font = CFontDialog::getFont(i18n("Select font"), defaultCFont,
false, false);
fontMap[QString("color")] = font.color().name();
fontMap[QString("family")] = font.family();
fontMap[QString("size")] = font.pointSize();
return fontMap;
}
void DPAdds::changePanelsState()
{
if (debug) qDebug() << PDEBUG;
if (panelsToControl.isEmpty()) return;
// QList<Plasma::Containment *> panels = getPanels();
// for (int i=0; i<panels.count(); i++) {
// if (!panelsToControl.contains(i)) continue;
// bool wasVisible = panels[i]->view()->isVisible();
// int winId = panels[i]->view()->winId();
// if (wasVisible) {
// if (debug) qDebug() << PDEBUG << ":" << "Hide panel";
// KWindowInfo oldInfo = KWindowSystem::windowInfo(winId, NET::WMState);
// oldState = oldInfo.state();
// panels[i]->view()->setVisible(false);
// } else {
// if (debug) qDebug() << PDEBUG << ":" << "Show panel";
// panels[i]->view()->setVisible(true);
// KWindowSystem::clearState(winId, NET::KeepAbove);
// KWindowSystem::setState(winId, oldState | NET::StaysOnTop);
// KWindowSystem::setOnAllDesktops(winId, true);
// }
// }
// panels.clear();
}
void DPAdds::sendNotification(const QString eventId, const QString message)
{
KNotification *notification = KNotification::event(eventId, QString("Desktop Panel ::: %1").arg(eventId), message);
notification->setComponentName(QString("plasma-applet-org.kde.plasma.desktop-panel"));
}
void DPAdds::setCurrentDesktop(const int desktop)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Desktop" << desktop;
KWindowSystem::setCurrentDesktop(desktop);
}
void DPAdds::changeDesktop(const int desktop)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Desktop" << desktop;
emit(desktopChanged());
}
void DPAdds::changeWindowList(const WId window)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Window" << window;
emit(windowListChanged());
}
DPAdds::DesktopWindowsInfo DPAdds::getInfoByDesktop(const int desktop)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Desktop" << desktop;
DesktopWindowsInfo info;
info.desktop = KWindowSystem::workArea(desktop);
QList<WId> windows = KWindowSystem::windows();
for (int i=0; i<windows.count(); i++) {
KWindowInfo winInfo = KWindowInfo(windows[i],
NET::Property::WMDesktop | NET::Property::WMGeometry |
NET::Property::WMState | NET::Property::WMWindowType |
NET::Property::WMVisibleName);
if (!winInfo.isOnDesktop(desktop)) continue;
WindowData data;
data.id = windows[i];
data.name = winInfo.visibleName();
data.rect = winInfo.geometry();
if (winInfo.windowType(NET::WindowTypeMask::NormalMask) == NET::WindowType::Normal) {
if (winInfo.isMinimized()) continue;
info.windowsData.append(data);
} else if (winInfo.windowType(NET::WindowTypeMask::DesktopMask) == NET::WindowType::Desktop) {
info.desktopsData.append(data);
}
}
return info;
}
QList<Plasma::Containment *> DPAdds::getPanels()
{
if (debug) qDebug() << PDEBUG;
// Plasma::Corona *corona = new Plasma::Corona(this);
QList<Plasma::Containment *> panels;
// for (int i=0; i<corona->containments().count(); i++)
// if (corona->containments()[i]->containmentType() == Plasma::Types::ContainmentType::PanelContainment)
// panels.append(corona->containments()[i]);
// delete corona;
return panels;
}
QString DPAdds::panelLocationToStr(Plasma::Types::Location location)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Location" << location;
switch (location) {
case Plasma::Types::Location::TopEdge:
return i18n("Top Edge");
case Plasma::Types::Location::BottomEdge:
return i18n("Bottom Edge");
case Plasma::Types::Location::LeftEdge:
return i18n("Left Edge");
case Plasma::Types::Location::RightEdge:
return i18n("Right Edge");
default:
return i18n("Unknown location (%1)", location);
}
}

View File

@ -0,0 +1,92 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets 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 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets 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 awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef DPADDS_H
#define DPADDS_H
#include <Plasma/Containment>
#include <QMap>
#include <QObject>
#include <QVariant>
class DPAdds : public QObject
{
Q_OBJECT
typedef struct {
WId id;
QString name;
QRect rect;
} WindowData;
typedef struct {
QRect desktop;
QList<WindowData> desktopsData;
QList<WindowData> windowsData;
} DesktopWindowsInfo;
public:
DPAdds(QObject *parent = nullptr);
~DPAdds();
Q_INVOKABLE bool isDebugEnabled();
Q_INVOKABLE int currentDesktop();
Q_INVOKABLE QStringList dictKeys();
Q_INVOKABLE int numberOfDesktops();
Q_INVOKABLE QString toolTipImage(const int desktop);
Q_INVOKABLE QString parsePattern(const QString pattern, const int desktop);
// values
Q_INVOKABLE void setMark(const QString newMark);
Q_INVOKABLE void setPanelsToControl(const QString newPanels);
Q_INVOKABLE void setToolTipData(const QVariantMap tooltipData);
Q_INVOKABLE QString valueByKey(const QString key, int desktop = -1);
// configuration slots
Q_INVOKABLE QString editPanelsToContol(const QString current);
Q_INVOKABLE QString getAboutText(const QString type = "header");
Q_INVOKABLE QVariantMap getFont(const QVariantMap defaultFont);
signals:
void desktopChanged();
void windowListChanged();
public slots:
Q_INVOKABLE void changePanelsState();
Q_INVOKABLE static void sendNotification(const QString eventId, const QString message);
Q_INVOKABLE void setCurrentDesktop(const int desktop);
private slots:
void changeDesktop(const int desktop);
void changeWindowList(const WId window);
private:
DesktopWindowsInfo getInfoByDesktop(const int desktop);
QList<Plasma::Containment *> getPanels();
QString panelLocationToStr(Plasma::Types::Location location);
// variables
bool debug = false;
int oldState, tooltipWidth = 200;
QString mark = QString("*");
QString tooltipColor = QString("#000000");
QString tooltipType = QString("none");
QList<int> panelsToControl;
};
#endif /* DPADDS_H */

View File

@ -0,0 +1,24 @@
[Global]
IconName=system
Name=Desktop Panel
Comment=Desktop panel notifications
[info]
Name=Information
Comment=Information
Action=Popup
[Event/event]
Name=Event
Comment=Some event occurs
Action=Popup
[Event/system]
Name=System information
Comment=System information
Action=Popup
[Event/tag]
Name=Tag information
Comment=Tag information
Action=Popup

View File

@ -0,0 +1,3 @@
module org.kde.plasma.desktoppanel
plugin dpplugin

Some files were not shown because too many files have changed in this diff Show More