One-Line Calculator
KDE4 Extensions
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:

7 years ago

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.

ShadowKyogre

7 years ago

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

Report

alno

7 years ago

Fixed, see 0.3 version.

Report

lukeluke

8 years ago

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

Report

alno

7 years ago

Fixed in 0.3

Report

devel0per

8 years ago

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..

Report

alno

8 years ago

Good idea! I try implement it very soon.

Report

alno

8 years ago

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

Report

devel0per

8 years ago

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 ! :))

Report

devel0per

8 years ago

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

Report

destroyer661

8 years ago

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?

Report

alno

8 years ago

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.

Report

destroyer661

8 years ago

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

Report

matteo81

7 years ago

Actually the Qalculate plasmoid yields exactly the same result if you switch to 'combined' or 'fractional' number format in the settings

Report

7 years ago

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.

File (click to download) Version Description Filetype Packagetype License Downloads Date Filesize OCS-Install
Score 75%
75.00 Likes
25 Dislikes
Details
version
0.3
updated Dec 28 2009
added Sep 17 2008
downloads
page views 509