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

7 years ago

Sorry for delay, here is updated applet/Applet.cpp code:
http://pastebin.kde.org/pfugiqief
Just replace contents of that file and recompile.

It should create file adjustableclock.log in home directory and add some data each time timezone gets changed (manually, when reading configuration etc.).

When you will spot that error again then please attach all lines from that day (each has timestamp). If that file will grow too big then you can simply delete it, it should be recreated automatically.

If you have more instances of this applet then it will need small adjustment.

Report

9

fdservices

7 years ago

Thank you, will do.

The problem has not occurred since my last post, so may not be easy to find, or, indeed, may have been fixed in an update.

Andrew

Report

C

Emdek

7 years ago

It is a feature of libplasmaclock.
It is the main reason for allowing selection of multiple time zones, showing them in a tooltip is more like only additional use of them. ;-)
All of that are standard features of all Plasma based clocks.

If that conclusion will be confirmed then the only workaround would be to disable switching them by mouse wheel completely and such change will not be upstreamed.
Although it would be extremely easy to patch it each time (addition of ~5 lines of code in two files).

Report

9

fdservices

7 years ago

Never noticed it before, so it cannot be a problem.

Andrew

Report

C

Emdek

7 years ago

According to:

2013.11.14 09:30:57 - ChangeEngineTimezone called
(timezone: Europe/Paris, old: Local, new:
Europe/Paris)
2013.11.14 09:30:57 - ChangeEngineTimezone called
(timezone: Europe/London, old: Europe/Paris, new:
Europe/London)

Error seems to be generated somewhere in libplasmaclock, for some reason it send twice request to change time zone...
And as far I can see in sources of that library that request is generated only when it reads configuration or when there is wheelEvent.

Do you want to try version that will also log mouse wheel events to confirm or disprove this conclusion?
Maybe some kind of glitch generates it while cursor is located over clock.

Report

9

fdservices

7 years ago

Sure, whatever you think may help.

Looking at another answer below, if I touch the mousewheel over the applet the time changes. Is this a bug or a feature?

Andrew

Report

C

Emdek

7 years ago

I doubt that it got fixed in recent updates. ;-)
It could be more likely fixed by changes in KDE itself.

Report

C

Emdek

7 years ago

Here is modified version with added logging of wheel event, Applet.cpp and Applet.h:
http://pastebin.kde.org/pca9f10fb
http://pastebin.kde.org/p410a08f8

To produce standard version with disabled mouse wheel simply copy in appropriate places declaration and implementation of wheelEvent(QGraphicsSceneWheelEvent *event).
Implementation should contain only this line:
Q_UNUSED(event)
That should be sufficient to ignore them by libplasmaclock.

Report

C

Emdek

7 years ago

Thanks, I will analyze it further when I will have some free time (hopefully before end of the weekend) but it seems that it will give the answer. ;-)

Report

9

fdservices

7 years ago

OK, happened again after updating to latest Linux and rebooting. Log states:
2013.11.09 11:23:12 - Constructor called
2013.11.09 11:23:15 - Init called
2013.11.09 11:23:15 - ClockConfigChanged called (timezone: Local)
2013.11.14 09:30:57 - ChangeEngineTimezone called (timezone: Europe/Paris, old: Local, new: Europe/Paris)
2013.11.14 09:30:57 - ChangeEngineTimezone called (timezone: Europe/London, old: Europe/Paris, new: Europe/London)
2013.11.14 19:57:38 - Constructor called
2013.11.14 19:57:41 - Init called
2013.11.14 19:57:41 - ClockConfigChanged called (timezone: Europe/London)
2013.11.14 20:14:40 - Constructor called
2013.11.14 20:14:43 - Init called
2013.11.14 20:14:43 - ClockConfigChanged called (timezone: Europe/London)

Of course I have not changed the time zone, Paris is still the default, open adjustable clock settings and OK with no changes resets the time zone and time correctly.

Andrew

Report

9

fdservices

7 years ago

Fingers crossed ;)

Andrew

Report

9

fdservices

7 years ago

When you bring up the dialogue windows: Adjustable Clock Setting > Editor or Options, they put a grab on the window which means that it is not possible to do anything in the panel while that window is open. Is that intentional?

Andrew

Report

C

Emdek

7 years ago

The answer is yes, and no. ;-)
These dialogs should block configuration dialog only but since whole Plasma is a single application then setModal(true) block access to desktop (which is also a kind of window)...
But it seems that there might be a way to do it properly (lock configuration dialog only) by using setWindowModality(Qt::WindowModal).
I will try that out and if it will work as intended then it will land in repository to be included in next release.

Report

9

fdservices

7 years ago

A bit beyond me, but I am impressed anyway.

Thank you

Report

C

Emdek

7 years ago

I'm afraid that it has to stay as is for now, that alternative way does not lock configuration dialog at all...

Report

9

fdservices

7 years ago

Strange that some of the other windows do not perform the same grab e.g. Clipboard > Edit

It is no great problem, it would have been nice to lookup help on html code while editing

Andrew

Report

C

Emdek

7 years ago

Well, it is different scenario, these dialogs for sure will not mess one with another (except issues in case if too many of them will be opened simultaneously).
I will reevaluate that lock anyway, maybe there is a way to avoid it without introducing possible issues.


AFAIR alt_tab switcher will still work. :-)

Report

C

Emdek

7 years ago

Do you mean Klipper?
It is not a plasmoid, but a separate application.
If you know about a plasmoid that is able to do such a trick then I could check how they do that. :-)

Report

9

fdservices

7 years ago

No, I was looking at Adjustable Clock Settings > Clipboard Actions > Edit

Andrew

Report

9

ksolsim

7 years ago

hi, there's a little problem with "progress clock", seconds are cutted... here is an image:

http://postimg.org/image/ji09jr59f/

Report

C

Emdek

7 years ago

Well, in fact the true default there is Segoe WP (choice by submitter of this theme). ;-)
I will try to tweak it again when I will have some free time.

I cannot reproduce it using some random fonts, maybe that was some kind of random glitch, please report if it will hit you again.

Report

C

Emdek

7 years ago

Does it have font set to default one?
AFAIR there might be issues with some fonts which are hard to avoid...

Report

9

ksolsim

7 years ago

yes it was to default (DejaVu Sans), but after I changed it then with the same font has returned to work well....

Report

9

tsujan

7 years ago

In the method DataSource::dataUpdated(), instead of the signal componentChanged() being emitted conditionally for the minute and hour components, I added its emission for them just after the second component and the resume problem is fixed. No side effect as far as I know but you are the one who masters the code.

Report

C

Emdek

7 years ago

I've modified comparison code in master, could you please confirm that it solves that issue?

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 5