Adjustable Clock

Plasma 4 Extensions

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

28
8 .4
Description:

Plasmoid to show date and time in adjustable format using rich text.
Developed and tested on KDE 4.11 with Qt 4.8 (Kubuntu 13.10).

Source (main repository, with more frequent updates) is located at:
https://github.com/Emdek/plasmoid-adjustable-clock

Warning!
Version 4.0 (and newer) is not backwards compatible with 3.x, all custom formats need to be exported and manually converted.

QML themes support is currently considered as experimental, behavior and available API are not yet stable and most probably will be changed with next release.

Tips:
- to change tool tip text you need to set options toolTipExpressionMain and toolTipExpressionSub in applets configuration file (usually located at ~/.kde4/share/config/plasma-desktop-appletsrc), in group containing line plugin=adjustableclock;
- you can use advanced WebKit features (all of these that work with for example rekonq should work here too), for example use CSS to create reflections:

-webkit-box-reflect:below 5px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(0.5, transparent), to(white));

And much more. ;-)

If you created interesting theme and want to share it then post in comments!

Features:
- fully custom date and time using JavaScript API to obtain date and time components;
- multiple clock themes utilizing various designs;
- possibility to use rich text editor or edit source directly (HTML and CSS or QML) to adjust theme;
- context menu with actions to copy formatted (adjustable expressions) date and time to clipboard;
- fast copy to clipboard of adjustable date and time expression after middle mouse click on the clock or activation of keyboard shortcut;
- adjustable tool tip (hidden option, toolTipExpressionMain and toolTipExpressionSub keys);
- standard clock calendar.

If you have found bugs or have suggestions you can contact me via email, message or using comments, before you will vote bad. And remember that not everybody has enough time for fast replying. ;-)
Last changelog:

7 years ago

4.1.4 (01.11.2013):
- fixed week number not being updated;
- added missing title of "Insert Component" dialog.

4.1.3 (27.09.2013):
- ensure that component values are always up to date;
- adjust timestamp for time zone offset;
- do not allow for accidental nesting of components in editor;
- added option to hide date in Train Clock theme;
- added workaround to ensure that hands of SVG Clock have correct initial positions as soon as possible.

4.1.2 (01.06.2013):
- ensure that center of SVG Clock theme is always valid;
- improve resizing in vertical panels.

4.1.1 (25.05.2013):
- fixed WYSIWYG editor for HTML themes;
- fixed missing dialog for "Insert Component" actions.

4.1 (15.05.2013):
- added SVG Clock theme (analog clock that uses Plasma theme);
- added experimental support for QML themes (alpha state);
- added simple file templates for new themes;
- move theme editor to own dialog;
- move theme specific actions to context menu;
- added ability to install and export themes (Plasma Package ZIP);
- some other improvements and fixes.

C

Emdek

10 years ago

Well, I'm not sure if it's really much more complicated, it's simple CSS rule and as other appearance settings can be now set using markup. I'll add information about this feature to hints section.
Also according to guide applets should use background (only few formats are exception now).
http://community.kde.org/Plasma/PlasmoidGuidelines#What_These_Guidelines_Cover

You mean text color?
Is that default one for your Plasma theme?
Are you setting color using graphical editor or by modifying source directly?
Is it properly shown in graphical editor?
Can you paste somewhere source of that format and link here?

Report

9

janet

10 years ago

Plasma Theme color is white. I don't use any CSS - I just clicked on the black spot with the color, it changed to white and after saving back to black.

And believe me: it IS much more complicated. I know a lot of people whom you won't get to enter any CSS to configure something. They (and I) want to click at an option and there it is. No config files, no CSS code. That's fine vor advanced users who like to tweak everything to the highest point but it should also offer a simple way. Will tell my friends to stay with 2.2 for not to confuse them.

Report

C

Emdek

10 years ago

Unfortunately clearing is the best way to get rid of strange issues that rarely but happens with Plasma...

Report

C

Emdek

10 years ago

Could you paste somewhere source code of that format (for example here: http://pastebin.ca/)? This will greatly help in checking what's going on.

I really do not recommend doing so, there were many important improvements, especially important for users using graphical editor which is now much more reliable.
For sure there is no chance that this option could return in it's previous form, as additional check box. The only possible way which I can think about now it to add kind of switch button to graphical editor that would add or remove needed code (yes, it would still remain as CSS rule, but could be toggled using GUI). But this is only idea and I can't guarantee that it will be done (I don't have too much free time recently and I'm not sure if it's doable in at least clean way).

Report

9

janet

10 years ago

If you could add that background option for the graphical editor that would be great!

Changing the color does work now. I had a bad plasma crash and couldn't log into KDE anymore after that, so I deleted the whole kdecache - and now it's ok...

Report

ranmakuo

10 years ago

I got follow error messages in gentoo with KDE 4.4.5.Please help me to find out the problem, thank you so mush.

[100%] Building CXX object applet/CMakeFiles/plasma_applet_adjustableclock.dir/AdjustableClock.o
/var/tmp/portage/kde-misc/plasmoid-adjustableclock-2.6.1/work/adjustableclock-2.6.1/applet/AdjustableClock.cpp: In member function 'void AdjustableClock::selectColor()':
/var/tmp/portage/kde-misc/plasmoid-adjustableclock-2.6.1/work/adjustableclock-2.6.1/applet/AdjustableClock.cpp:533: error: 'class KColorDialog' has no member named 'setAlphaChannelEnabled'
make[2]: *** [applet/CMakeFiles/plasma_applet_adjustableclock.dir/AdjustableClock.o] Error 1
make[1]: *** [applet/CMakeFiles/plasma_applet_adjustableclock.dir/all] Error 2
make: *** [all] Error 2
emake failed

Report

C

Emdek

10 years ago

Applet was adapted to KDE 4.5 changes already, but you can try to modify it a bit and it should work with 4.4.
First remove that line which causes compilation fail:
/var/tmp/portage/kde-misc/plasmoid-adjustableclock-2.6.1/work/adjustableclock-2.6.1/applet/AdjustableClock.cpp:533
Now it should compile again but configuration dialog might not work (it will show up but saving settings will have no effect), to fix that you might need to revert this change:
http://websvn.kde.org/?view=revision&sortby=date&revision=1101251

Alternatively you can try old package but since it's release there were some more or less important changes:
http://kde-look.org/CONTENT/content-files/92825-adjustableclock-2.2.tar.bz2

Report

ranmakuo

10 years ago

Thank you for your reply. I can compile 2.5 and work in KDE 4.4.5 very well but cannot after version 2.6. Is version 2.6 must run after KDE 4.5?

Report

C

Emdek

10 years ago

There are another compilation errors for 2.5?
Qt 4.6 is also required.

Report

ranmakuo

10 years ago

No. Version 2.5 has no any compilation error on KDE 4.4.5. By the way, My QT is version 4.6.3.

Report

C

Emdek

10 years ago

Yes, that line:
[i]colorDialog.setAlphaChannelEnabled(true);/i]

Report

ranmakuo

10 years ago

Thanks, it works and looks has no any problem.

Report

C

Emdek

10 years ago

I've already wrote that you simply need to remove that line (533 in applet/AdjustableClock.cpp). ;-)

Report

ranmakuo

10 years ago

Remove this line?

====================================
void AdjustableClock::selectColor()
{
KColorDialog colorDialog;
--> colorDialog.setAlphaChannelEnabled(true);

Report

C

Emdek

10 years ago

Sorry, I mean 2.6.
Are there compilation errors or applet misbehaves?

Report

ranmakuo

10 years ago

Yes, version 2.6 has compilation error and the message as shown as follow..

=======================================
Nabiki adjustableclock-2.6 # ./install.sh
-- Found Qt-Version 4.6.3 (using /usr/bin/qmake)
-- Found X11: /usr/lib64/libX11.so
-- Phonon Version: 4.4.2
-- Found KDE 4.4 include dir: /usr/include
-- Found KDE 4.4 library dir: /usr/lib64
-- Found the KDE4 kconfig_compiler preprocessor: /usr/bin/kconfig_compiler
-- Found automoc4: /usr/bin/automoc4
-- <<< Gentoo configuration >>>
Build type
Install path /usr
Compiler flags:
C
C++
Linker flags:
Executable
Module
Shared

CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as

cmake_minimum_required(VERSION 2.8)

should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /var/tmp/portage/kde-misc/plasmoid-adjustableclock-2.6/work/adjustableclock-2.6/build
[ 0%] Built target plasma_applet_adjustableclock_automoc
[ 8%] Building CXX object applet/CMakeFiles/plasma_applet_adjustableclock.dir/AdjustableClock.o
/var/tmp/portage/kde-misc/plasmoid-adjustableclock-2.6/work/adjustableclock-2.6/applet/AdjustableClock.cpp: In member function 'void AdjustableClock::selectColor()':
/var/tmp/portage/kde-misc/plasmoid-adjustableclock-2.6/work/adjustableclock-2.6/applet/AdjustableClock.cpp:533: error: 'class KColorDialog' has no member named 'setAlphaChannelEnabled'
make[2]: *** [applet/CMakeFiles/plasma_applet_adjustableclock.dir/AdjustableClock.o] Error 1
make[1]: *** [applet/CMakeFiles/plasma_applet_adjustableclock.dir/all] Error 2
make: *** [all] Error 2

An error occured during compilation!
Check if you have installed all needed header files.
=====================================
It looks same as version 2.6.1.

Report

ranmakuo

10 years ago

Yes, version 2.6 has compilation error and the message as shown as follow..

=======================================
Nabiki adjustableclock-2.6 # ./install.sh
-- Found Qt-Version 4.6.3 (using /usr/bin/qmake)
-- Found X11: /usr/lib64/libX11.so
-- Phonon Version: 4.4.2
-- Found KDE 4.4 include dir: /usr/include
-- Found KDE 4.4 library dir: /usr/lib64
-- Found the KDE4 kconfig_compiler preprocessor: /usr/bin/kconfig_compiler
-- Found automoc4: /usr/bin/automoc4
-- <<< Gentoo configuration >>>
Build type
Install path /usr
Compiler flags:
C
C++
Linker flags:
Executable
Module
Shared

CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as

cmake_minimum_required(VERSION 2.8)

should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /var/tmp/portage/kde-misc/plasmoid-adjustableclock-2.6/work/adjustableclock-2.6/build
[ 0%] Built target plasma_applet_adjustableclock_automoc
[ 8%] Building CXX object applet/CMakeFiles/plasma_applet_adjustableclock.dir/AdjustableClock.o
/var/tmp/portage/kde-misc/plasmoid-adjustableclock-2.6/work/adjustableclock-2.6/applet/AdjustableClock.cpp: In member function 'void AdjustableClock::selectColor()':
/var/tmp/portage/kde-misc/plasmoid-adjustableclock-2.6/work/adjustableclock-2.6/applet/AdjustableClock.cpp:533: error: 'class KColorDialog' has no member named 'setAlphaChannelEnabled'
make[2]: *** [applet/CMakeFiles/plasma_applet_adjustableclock.dir/AdjustableClock.o] Error 1
make[1]: *** [applet/CMakeFiles/plasma_applet_adjustableclock.dir/all] Error 2
make: *** [all] Error 2

An error occured during compilation!
Check if you have installed all needed header files.
=====================================
It looks same as version 2.6.1.

Report

ranmakuo

10 years ago

Yes, version 2.6 has compilation error and the message as shown as follow..

=======================================
Nabiki adjustableclock-2.6 # ./install.sh
-- Found Qt-Version 4.6.3 (using /usr/bin/qmake)
-- Found X11: /usr/lib64/libX11.so
-- Phonon Version: 4.4.2
-- Found KDE 4.4 include dir: /usr/include
-- Found KDE 4.4 library dir: /usr/lib64
-- Found the KDE4 kconfig_compiler preprocessor: /usr/bin/kconfig_compiler
-- Found automoc4: /usr/bin/automoc4
-- <<< Gentoo configuration >>>
Build type
Install path /usr
Compiler flags:
C
C++
Linker flags:
Executable
Module
Shared

CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as

cmake_minimum_required(VERSION 2.8)

should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /var/tmp/portage/kde-misc/plasmoid-adjustableclock-2.6/work/adjustableclock-2.6/build
[ 0%] Built target plasma_applet_adjustableclock_automoc
[ 8%] Building CXX object applet/CMakeFiles/plasma_applet_adjustableclock.dir/AdjustableClock.o
/var/tmp/portage/kde-misc/plasmoid-adjustableclock-2.6/work/adjustableclock-2.6/applet/AdjustableClock.cpp: In member function 'void AdjustableClock::selectColor()':
/var/tmp/portage/kde-misc/plasmoid-adjustableclock-2.6/work/adjustableclock-2.6/applet/AdjustableClock.cpp:533: error: 'class KColorDialog' has no member named 'setAlphaChannelEnabled'
make[2]: *** [applet/CMakeFiles/plasma_applet_adjustableclock.dir/AdjustableClock.o] Error 1
make[1]: *** [applet/CMakeFiles/plasma_applet_adjustableclock.dir/all] Error 2
make: *** [all] Error 2

An error occured during compilation!
Check if you have installed all needed header files.
=====================================
It looks same as version 2.6.1.

Report

koso83

10 years ago

Hello,

anyone else experiencing problems with plasmoid width when placed on panel in kde 4.5 (plasmoid version 2.5)?

Normally, plasmoid should be as wide, as is needed by configuration. But in my case, plasmoid seems to have some fixed width when placed on panel (no problem when placed on desktop). Graphics/text inside plasmoid is resized, so that it fits into this smaller container.

Report

C

Emdek

10 years ago

If format contains strings with variable length (such as month names, weed day names etc.) then it tries to keep some extra space for their changes.
Could you show screenshot and paste format i comment? Also, which KDE and Qt versions on which distribution are you using?

Report

koso83

10 years ago

I'm using kubuntu maverick, kde 4.5, Qt 4.7 (git version).

I can reproduce it also with default formating in plasmoid. Here is a screenshot:

http://yfrog.com/nddesktop1ep

There are side-by-side two versions, on left side is v2.2 and on right is v2.5. You can see, that new version is narrower, than it should be, and fonts are resized, so that they can fit this size. I also tried changing font sizes, but with no effect on width. It only changed size ratio between lines ...

Report

C

Emdek

10 years ago

I think that it has something to do with always scale contents to fit...
Did you tried changing margins (also negative)?

Report

koso83

10 years ago

Just tried changing left/right margins. After that, fonts are larger, but plasmoid width is still the same => I can see only part of time, side parts are "trimmed".

Report

C

Emdek

10 years ago

Yeah, they can, but not everybody know that. ;-)

Report

C

Emdek

10 years ago

Should be fixed now, can you confirm if it's working correctly now?

I was thinking also about kind of question box shown when applying format which will ask what to do (scale, resize) if contents size is too big or too small, but that would be annoying. Additional checkbox like in the past is also bad (was removed during review), but current behavior should be enough, maximum space usage in panels and only scaling (with possibility to manually resize) on desktop.

Report

7 years ago

4.1.4 (01.11.2013):
- fixed week number not being updated;
- added missing title of "Insert Component" dialog.

4.1.3 (27.09.2013):
- ensure that component values are always up to date;
- adjust timestamp for time zone offset;
- do not allow for accidental nesting of components in editor;
- added option to hide date in Train Clock theme;
- added workaround to ensure that hands of SVG Clock have correct initial positions as soon as possible.

4.1.2 (01.06.2013):
- ensure that center of SVG Clock theme is always valid;
- improve resizing in vertical panels.

4.1.1 (25.05.2013):
- fixed WYSIWYG editor for HTML themes;
- fixed missing dialog for "Insert Component" actions.

4.1 (15.05.2013):
- added SVG Clock theme (analog clock that uses Plasma theme);
- added experimental support for QML themes (alpha state);
- added simple file templates for new themes;
- move theme editor to own dialog;
- move theme specific actions to context menu;
- added ability to install and export themes (Plasma Package ZIP);
- some other improvements and fixes.

12345678910
243
product-maker thevladsoft Aug 10 2015 9 excellent
product-maker vanguard7 Sep 01 2014 9 excellent
product-maker SicoBulo Jul 27 2014 3 bad
product-maker electron222 May 08 2014 9 excellent
product-maker janet Feb 22 2014 9 excellent
product-maker garthecho Feb 09 2014 9 excellent
product-maker renjooy Jan 24 2014 9 excellent
product-maker mixalns Nov 02 2013 9 excellent
product-maker MoonBlossom Oct 10 2013 9 excellent
product-maker vatsok Sep 29 2013 9 excellent
product-maker YAFU Sep 28 2013 9 excellent
product-maker fdservices Sep 27 2013 9 excellent
product-maker Omega9 May 16 2013 9 excellent
product-maker oOSplashOo May 15 2013 9 excellent
product-maker baltolkien May 04 2013 9 excellent
product-maker FraMari Apr 21 2013 9 excellent
product-maker monga Apr 21 2013 9 excellent
product-maker frag Apr 15 2013 9 excellent
product-maker SvenArcher Apr 14 2013 9 excellent
product-maker ArthurTaborda Apr 13 2013 9 excellent
product-maker ksolsim Apr 13 2013 9 excellent
product-maker migue Apr 13 2013 9 excellent
product-maker google01103 Apr 13 2013 9 excellent
product-maker evapor Apr 13 2013 9 excellent
product-maker unikum111 Apr 08 2013 9 excellent
product-maker tsujan Jan 06 2013 9 excellent
product-maker lionhater Oct 10 2012 9 excellent
product-maker quinnuendo Oct 03 2012 9 excellent
product-maker xMaki Oct 02 2012 9 excellent
product-maker CobraDOT Aug 13 2012 9 excellent
product-maker RAIDENSUB Jun 12 2012 9 excellent
product-maker remix Apr 03 2012 9 excellent
product-maker SeaJey Feb 15 2012 9 excellent
product-maker orivej Feb 13 2012 9 excellent
product-maker 5er Feb 07 2012 9 excellent
product-maker ZaWertun Feb 03 2012 9 excellent
product-maker cyberconan Jan 15 2012 9 excellent
product-maker CatchTime Dec 02 2011 9 excellent
product-maker paran0idx Dec 02 2011 9 excellent
product-maker deabru Dec 01 2011 9 excellent
product-maker vitoubien Dec 01 2011 9 excellent
product-maker e1nste1n Dec 01 2011 9 excellent
product-maker Pafrape Oct 12 2011 9 excellent
product-maker joseexposito89 Aug 30 2011 3 bad
product-maker ZXP6 Oct 15 2010 9 excellent
Be the first to comment
UnderTheGun
May 01 2014
quinnuendo
Mar 23 2014
BishopWolf
Jan 08 2014
MoonBlossom
Oct 10 2013
fdservices
Sep 27 2013
blue-dxca93
May 08 2013
baltolkien
May 04 2013
Maecla
May 04 2013
ArthurTaborda
Apr 13 2013
ksolsim
Apr 13 2013
migue
Apr 13 2013
elboulangero
Jan 07 2013
n-k
Jan 06 2013
xMaki
Oct 02 2012
CobraDOT
Aug 13 2012
Pafrape
Jun 15 2012
remix
Apr 03 2012
ZaWertun
Feb 03 2012
CatchTime
Dec 02 2011
paran0idx
Dec 02 2011
Bert
Aug 31 2010
olenz
May 11 2010
janet
Apr 30 2010
vazoline
Nov 02 2009
Pitmairen
Jul 02 2009
ahri
May 19 2009
deabru
Mar 27 2009
Sheridan
Mar 27 2009
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
4.1.4 "Hello QML"
updated Nov 01 2013
added Nov 08 2008
downloads 24h
0
mediaviews 24h 0
pageviews 24h 16