One-Line Calculator

Plasma 4 Extensions

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
5.0

Description:
One-Line Calculator for KDE4 is my first plasma applet.

It's calculator, consisting of one lineedit widget: you enter expression, press enter and it calculates it.

Calculating implemented through QScriptEngine using ECMAScript.

You may find source code at github: http://github.com/alno/plasma-widget-onelinecalc/tree/master

PPA for Karmic available: https://launchpad.net/~alexey-noskov/+archive/kde
Last changelog:

0.3
* Fixed KDE 4.2 installation

0.2
* Configuration dialog added with ability to define an initialization script.

It's used to define following functions:
abs, acos, asin, atan, atan2, ceil, cos, exp, floor, log, max, min, pow, random, round, sin, sqrt, tan

But using configuration dialog, you may define your own set of functions, using ECMAScript.

For example, see definition of cool function in configuration dialog.


Ratings & Comments

14 Comments

Murz

Very useful widget, but not works on KDE 5.x, and there are no alternatives for string-like calcuator for Plasma 2! Can you please port this calculator plasmoid to kde 5.x? Thanks!

ShadowKyogre

On KDE 4.3, the inputbox appears to be extremely squished.

alno

Fixed, see 0.3 version.

lukeluke

Hello, i have Opensuse 11.0 con KDE 4.2, when i do: cmake .. -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` This is the output: -- Found Qt-Version 4.5.1 (using /usr/bin/qmake) -- Found X11: /usr/lib/libX11.so -- Phonon Version: 4.3.0 -- Found KDE 4.2 include dir: /usr/include -- Found KDE 4.2 library dir: /usr/lib -- Found the KDE4 kconfig_compiler preprocessor: /usr/bin/kconfig_compiler -- Found automoc4: /usr/bin/automoc4 CMake Error at /usr/share/kde4/apps/cmake/modules/FindPlasma.cmake:13 (message): FindPlasma.cmake is deprecated. Now with KDE 4.2 Plasma is part of kdelibs and automatically found using find_package(KDE4) instead. Replace the variables previously coming from FindPlasma.cmake as follows: PLASMA_OPENGL_FOUND -> KDE4_PLASMA_OPENGL_FOUND PLASMA_LIBS -> KDE4_PLASMA_LIBS PLASMA_INCLUDE_DIR -> KDE4_INCLUDE_DIR or KDE4_INCLUDES, should be already set anyway PLASMA_FOUND -> nothing, it's always there if KDE4, version 4.2 or newer has been found. If you see this error message in a module within KDE/, update it from svn, it has been fixed already. Call Stack (most recent call first): CMakeLists.txt:7 (find_package) WATH CAN I DO ??? I LOVE THIS APPLET!!! THANKS A LOT

alno

Fixed in 0.3

devel0per

Thank you, tool is very usefull. Ebuild for Gentoo users is here - http://sonylaptoptools.sourceforge.net/ebuilds/onelinecalc-0.1.ebuild alno, whats about some a bit difficult fuctions, such as - sqrt, pow, etc..

alno

Good idea! I try implement it very soon.

alno

I made it, you may try new version. And even more: now you can define your own functions in configuration dialog =)

devel0per

thank you mate! new ebuild is here - http://sonylaptoptools.sourceforge.net/ebuilds/onelinecalc-0.2.ebuild I'm fall in love because "random" function is build-in ! :))

devel0per

Ebuild with kde-4.2 build patch is pushed into gentoo overlay - kde-testing. http://git.overlays.gentoo.org/gitweb/?p=proj/kde.git;a=commitdiff;h=443a9e8a4ac9e6b917b6799840699da131abe711

destroyer661

I don't want to be negative about your app, because it may well be useful for some. I just want to know what separates (or makes it better/different) it from the qalculate plasmoid?

alno

Ok, good question. Some time before i tried to use a qualculate plasmoid. But i have some troubles: 1) I cann't select and copy result from Qalculate, because it draws result at background. 2) Big numbers are rendered in scientific notation, which isn't acceptable in some cases. For example, when i want to insert calculated number in code, or configuration file. 3) Big numbers are calculated not so preciously as i need. For example: try 12345678*12345 in Qalculate and my plasmoid. These problems i tried to solve with my plasmoid. And there is one another difference between Qualculate and One-Line Calculator: 4) One-Line Calculator is much simpler and doesn't depend on any third-party libraries.

destroyer661

Thanks for replying! Those are very good reasons for switching, I'll be using yours from now on.

Pling
0 Affiliates
Details
license
version 0.3
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 0

Other Plasma 4 Extensions:

Icon Tasks deb build
N00bun2
last update date: 13 years ago

Score 4.3

Prayer Times Plasmoid
riyad
last update date: 13 years ago

Score 5.2

KPrayertime4 Islamic Prayer Times
ahaq
last update date: 15 years ago

Score 4.4

Hostinfo
mgraesslin
last update date: 13 years ago

Score 4.7

Monitor QuadCore Russian
kuchumovn
last update date: 16 years ago

Score 5.0

blaKjaK
werevire
last update date: 15 years ago

Score 5.0