
Overview
========

KShutDown is an advanced shut down utility for KDE.

Features:

- Shut Down (logout and halt the system)
- Reboot (logout and reboot the system)
- Lock Screen (lock the screen using a screen saver)
- Logout (end the session and logout the user)
- Extras (user commands)
- Wizard
- Time and delay options
- Command line and DCOP support
- System tray
- Sounds
- Kiosk support
- And more...


Problems?
=========

- Read the FAQ file!
- Email me <kdtonline@poczta.onet.pl>


The Internet
============
http://sourceforge.net/projects/kshutdown
http://kshutdown.sourceforge.net


KDE Kiosk support
=================

Kiosk allows you to control some critical features,
such as "Shut Down" or "Reboot" commands.
To enable restrictions, you need to create
a global configuration file - "kshutdownrc" in
your global KDE directory ([prefix]/share/config).

Note: In some cases you need to restart KShutDown
to see effects.

# EXAMPLE FILE

[KDE Action Restrictions][$i]
# [$i] - user cannot override this group
# false - feature is disabled
# true - feature is enabled
# by default all features are enabled

# Disables "Shut Down" action
action_shutdown=true
# action_shutdown=false <- "false" will disable "Shut Down" action

# Disables "Reboot" action
action_reboot=true

# Disables "Lock Screen" action
action_lockscreen=true

# Disables "Logout" action
action_logout=true

# Disables the "Wizard"
action_wizard=true

# Disables "Extras" action
action_extras=true

# Disables "Actions" page in the "Settings" dialog
settings_actions=true

# Disables "Time" tab, and the command line "time" argument
tab_time=true

# Disables "Statistics" tab
tab_stats=true

# Disables "Scheduler" tab and KShutdownIface (DCOP server)
kshutdown_sched=true

# END OF EXAMPLE FILE


KShutdownIface API Overview (DCOP)
==================================

1. Make sure "kshutdown" is running.
2. Type "kshutdown --init" to start KShutDown without displaying its main window.
3. To display all DCOP functions, type the following command:
dcop kshutdown KShutdownIface


ASYNC cancel()
--------------
Cancels current action.


bool shutDown()
bool shutdown()
---------------
Shuts down the system.


bool reboot()
-------------
Reboots the system.


bool lockScreen()
-----------------
Locks the screen using the screen saver.


bool logout()
-------------
Logouts current user and ends the session.


QString getStatusInfo()
-----------------------
Returns a KShutDown status information.
NOTE: At this time it returns the main window caption text!
Can be used in Karamba themes.


ASYNC setTestMode(bool yes)
---------------------------
Enables/disables test mode.

EXAMPLE 1: Enable test mode
dcop kshutdown KShutdownIface setTestMode true

EXAMPLE 2: Disable test mode
dcop kshutdown KShutdownIface setTestMode false


ASYNC wizard()
--------------
Launches the Wizard.


"Scheduler" API
---------------
External applications can use KShutDown "Scheduler"
to shut down or reboot system without conflicts with
other applications that use "Scheduler" too.

General informations:
- The new task will appear in the "Scheduler" tab.
- User can delete any registered task by clicking on "Remove" or "Remove All" button.
- User can disable Scheduler.
  Disabled Scheduler discards "activateAction", "registerTask" and "unregisterTask" command.

General usage:
ON INIT: $ID = registerTask "appName" "taskTescription" ACTION_TO_EXECUTE
..
APP WORK
..
AFTER APP WORK: activateAction $ID
..
ON EXIT: unregisterTask $ID


int registerTask(QString name, QString description, int action)
---------------------------------------------------------------
Registers a new KShutDown task.
name - This should be "kapp->dcopClient()->appId()".
description - A description of the task. EXAMPLE: "Shut down after download."
action - An action to execute by "activateAction(int id)" (see below).
	Possible actions are:
	1 - shut down
	2 - reboot
	3 - RESERVED/NOT USED
	4 - logout

This function returns an unique ID that is required,
if you want to use "activateAction" or "unregisterTask" function.
Returns an unique ID number if successful; otherwise "0".


bool activateAction(int id)
---------------------------
Executes a KShutDown action.
id - A task ID returned by the "registerTask" function.
- "activateAction" will automatically unregister the task!
- "Lock screen" action is not supported here!
Returns "1" (TRUE) if successful; otherwise "0" (FALSE).


bool unregisterTask(int id)
---------------------------
Unregisters the task previously registered by "registerTask".
id - A task ID to unregister.
Returns "1" (TRUE) if successful; otherwise "0" (FALSE).

See "kshutdowndcopapi.cpp" and "mmainwindow.cpp" to see how to call these functions.
