• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeutils API Reference
  • KDE Home
  • Contact Us
 

superkaramba

  • sources
  • kde-4.12
  • kdeutils
  • superkaramba
  • src
  • python
Functions
config.cpp File Reference
#include "python/config.h"
#include <Python.h>
#include <QObject>
#include <kconfig.h>
#include "meters/meter.h"
#include "python/meter.h"
#include <kconfiggroup.h>
#include "../karamba.h"
Include dependency graph for config.cpp:

Go to the source code of this file.

Functions

long addMenuConfigOption (long widget, QString key, QString name)
 
PyObject * py_add_menu_config_option (PyObject *, PyObject *args)
 
PyObject * py_read_config_entry (PyObject *, PyObject *args)
 
PyObject * py_read_menu_config_option (PyObject *, PyObject *args)
 
PyObject * py_set_menu_config_option (PyObject *, PyObject *args)
 
PyObject * py_write_config_entry (PyObject *, PyObject *args)
 
QString readConfigEntry (long widget, QString key)
 
long readMenuConfigOption (long widget, QString key)
 
long setMenuConfigOption (long widget, QString key, bool value)
 
long writeConfigEntry (long widget, QString key, QString value)
 

Function Documentation

long addMenuConfigOption ( long  widget,
QString  key,
QString  name 
)

Definition at line 46 of file config.cpp.

PyObject* py_add_menu_config_option ( PyObject *  self,
PyObject *  args 
)

Config/addMenuConfigOption.

SYNOPSIS long addMenuConfigOption(widget, key, name) DESCRIPTION SuperKaramba supports a simplistic configuration pop-up menu. This menu appears when you right-click on a widget and choose Configure Theme. Basically, it allows you to have check-able entries in the menu to allow the user to enable or disable features in your theme.

Before you use any configuration menu stuff, you NEED to add a new callback to your script:

def menuOptionChanged(widget, key, value):

This will get called whenever a config menu option is changed. Now you can add items to the config menu:

addMenuConfigOption(widget, String key, String name)

Key is the name of a key value where the value will be saved automatically into the widget's config file. Name is the actual text that will show up in the config menu.

For example, I could allow the user to enable or disable a clock showing up in my theme:

karamba.addMenuConfigOption(widget, "showclock", "Display a clock") ARGUMENTS

  • long widget – karamba
  • string key – key for menu item
  • string name – name of the graph to get RETURN VALUE 1 if successful

Definition at line 55 of file config.cpp.

PyObject* py_read_config_entry ( PyObject *  self,
PyObject *  args 
)

Config/readConfigEntry.

SYNOPSIS string|long readConfigEntry(widget, key, value) DESCRIPTION This function reads an entry from the config file with the given key. ARGUMENTS

  • long widget – karamba
  • string key – key for config item RETURN VALUE config value for key

Definition at line 155 of file config.cpp.

PyObject* py_read_menu_config_option ( PyObject *  self,
PyObject *  args 
)

Config/readMenuConfigOption.

SYNOPSIS long readMenuConfigOption(widget, key) DESCRIPTION This returns whether or not the given option is checked in the theme's Configure Theme menu.

See addMenuConfigOption for a more detailed explanation. ARGUMENTS

  • long widget – karamba
  • string key – key for menu item RETURN VALUE 0 is returned if it is not checked and 1 is returned if it is.

Definition at line 104 of file config.cpp.

PyObject* py_set_menu_config_option ( PyObject *  self,
PyObject *  args 
)

Config/setMenuConfigOption.

SYNOPSIS long setMenuConfigOption(widget, key, value) DESCRIPTION This sets whether or not the given option is checked in the theme's Configure Theme menu. Value should be 0 if key should not be checked and 1 if key should be checked.

See addMenuConfigOption for a more detailed explanation. ARGUMENTS

  • long widget – karamba
  • string key – key for menu item
  • int value – 1 if checked RETURN VALUE 1 if successful

Definition at line 80 of file config.cpp.

PyObject* py_write_config_entry ( PyObject *  self,
PyObject *  args 
)

Config/writeConfigEntry.

SYNOPSIS long writeConfigEntry(widget, key, value) DESCRIPTION SuperKaramba automatically supports configuration files for each theme. These files will be saved in /your/home/dir/.superkaramba/ and will be named themenamerc where themename is the name of the theme.

This function writes an entry into the config file with the given key and value.

For example, to save my favorite color, I would do karamba.writeConfigEntry(widget, "FavColor", "Red") ARGUMENTS

  • long widget – karamba
  • string key – key for config item
  • string value – config value RETURN VALUE 1 if successful

Definition at line 130 of file config.cpp.

QString readConfigEntry ( long  widget,
QString  key 
)

Definition at line 148 of file config.cpp.

long readMenuConfigOption ( long  widget,
QString  key 
)

Definition at line 97 of file config.cpp.

long setMenuConfigOption ( long  widget,
QString  key,
bool  value 
)

Definition at line 73 of file config.cpp.

long writeConfigEntry ( long  widget,
QString  key,
QString  value 
)

Definition at line 121 of file config.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:07:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

superkaramba

Skip menu "superkaramba"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • kremotecontrol
  • ktimer
  • kwallet
  • superkaramba
  • sweeper

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal