Initial import of kshutdown 1.0.4
commit
48a589b8c5
@ -0,0 +1,410 @@
|
||||
// svn log -r 347:HEAD|tac|xsel -i -b
|
||||
// See also: http://kshutdown.sourceforge.net/releases/
|
||||
|
||||
2009/01/15 1.0.4
|
||||
|
||||
* Fixed Restart/Turn Off Computer action in newer distributions
|
||||
* Removed deprecated entries and values from *.desktop files
|
||||
|
||||
|
||||
2008/05/26 1.0.3
|
||||
|
||||
* Updated Czech translation
|
||||
* Updated Italian translation
|
||||
* Updated Polish translation
|
||||
* Updated Slovak translation
|
||||
* Extras: Show icon of the selected action (thanks to Guillaume Millet)
|
||||
* Setup: Automatically create "configure" file if necessary
|
||||
* Source: Added RPM .spec file for SUSE
|
||||
|
||||
2007/11/25 1.0.2
|
||||
- Now the sound is disabled by default.
|
||||
You can re-enable sound notifications via menu -> Settings -> Configure Notifications...
|
||||
- Updated Italian translation (thanks to Andrea Florio)
|
||||
- Updated Turkish translation
|
||||
- Updated Polish translation
|
||||
- NEW: Added "extra" command line option. Run "kshutdown --help" for more info.
|
||||
- NEW: Remember recent "Extras" command
|
||||
|
||||
2007/07/08 1.0.1
|
||||
- NEW: Arabic translation. Thanks to Abdulaziz Alsharif and Youssef Chahibi.
|
||||
- NEW: Bulgarian translation. Thanks to Zlatko Popov
|
||||
- Updated Greek (el) translation
|
||||
- Minor fixes
|
||||
|
||||
2007/04/14 1.0
|
||||
- NEW: Added "Hibernate Computer" action (see Extras -> Select a command...)
|
||||
- NEW: Added action to mute and quit kdetv (see Extras -> Select a command...)
|
||||
- Fixed compilation problems
|
||||
- Fixed system tray icon size
|
||||
- Updated language translations (es, sk, tr)
|
||||
|
||||
2006/10/10 0.9.1 Beta
|
||||
- Updated German, Greek, Portuguese-Brazilian, and Spanish translations
|
||||
- NEW: French translation (thanks to Maxime Chéramy)
|
||||
- Fixed some DCOP functions
|
||||
- Fixed KShutDown autostart and session saving
|
||||
- NEW: Warning info in task bar title
|
||||
- Improved progress bar
|
||||
|
||||
2006/06/29 0.9 Beta
|
||||
- NEW: Progress bar
|
||||
- FIXED: Setup: Launch installer in existing Konsole window
|
||||
- FIXED: Fixed compilation errors (thanks to Ole)
|
||||
- NEW: Global keyboard shortcuts
|
||||
- NEW: Redesigned and improved KShutDown panel applet
|
||||
- NEW: DCOP: Added "makeInvisible()" function
|
||||
- Added missing "What's this?" texts
|
||||
- Action icons are now cached
|
||||
- Addded passive messages
|
||||
- NEW: Greek translation (thanks to Spiros Georgaras)
|
||||
- Patches from the FreeBSD (thanks to Markus Brueffer)
|
||||
- Simplified "link creator" in the "Settings" dialog
|
||||
- NEW: "Presets" menu in the "Custom Message" configuration
|
||||
- FIXED: "Test" button in the "Custom Message" configuration
|
||||
- Code cleanup
|
||||
- NEW: Redesigned the system tray context menu
|
||||
- Statistics: Changed the "Options" view
|
||||
- NEW: Statistics: Ctrl+R or F5 refreshes the view
|
||||
- NEW: Selected action/time in the confirmation dialog
|
||||
- NEW: Shortcut configuration (Settings -> Configure Shortcuts...)
|
||||
- NEW: "Actions" menu in the menu bar
|
||||
|
||||
2006/02/05 0.8.2
|
||||
- NEW: Turkish translation (thanks to Ahmet AYGÜN)
|
||||
- French desktop entry (e.g. in the "K" Menu)
|
||||
- Updated the "./admin" directory
|
||||
|
||||
2006/01/09 0.8.1
|
||||
- NEW: Chinese translation
|
||||
- NEW: German Handbook
|
||||
- Setup: Do not ask for root password
|
||||
if prefix directory exists and is writeable by the current user
|
||||
- Changed some GUI texts
|
||||
- Added generic name for "K" menu entry
|
||||
- Setup: Removed the "Changes" command (ChangeLog);
|
||||
added "What's new?" instead (NEWS)
|
||||
- Removed "Help" from the system tray context menu
|
||||
- API: public MiscUtils::playSound -> private MiscUtils::notifyUser
|
||||
- Action list: display "s" suffix for pause value
|
||||
- Action editor: display "No pause" instead of "0 second(s)"
|
||||
- Updated "kshutdown/templates" files
|
||||
- FIXED: Do not display popup message if "test mode" is already enabled/disabled
|
||||
- Setup: Removed confusing "root password" message
|
||||
- Setup: Fixed Polish encoding
|
||||
- Setup: Added support for "LANG=pl_PL.UTF-8"
|
||||
- Changed title time separator from " - " to " > "
|
||||
- FIXED: "dcop kshutdown KShutdownIface makeVisible"
|
||||
- Removed broken links from the About dialog
|
||||
- Removed unused "kshutdown/karamba/kshutdown-32x32.png" file
|
||||
- NEW: NEWS file with human readable list of changes
|
||||
- Updated German translation
|
||||
- Updated Czech translation
|
||||
|
||||
2005/11/27 0.8
|
||||
- NEW: Swedish translation (thanks to Daniel Nylander)
|
||||
- Minor bugfixes
|
||||
- Removed the Authors tab from the About dialog
|
||||
- Setup: Fast compilation is now enabled by default (--enable-final)
|
||||
- Updated documentation
|
||||
- Setup: "kdesu" instead of "su" (works on both Fedora and Kubuntu)
|
||||
|
||||
2005/10/18 0.7.1 Beta
|
||||
- NEW: Ability to execute a specified action when selected application exit
|
||||
- Removed "Download" menu item
|
||||
- FIXED: Captions in system tray menu
|
||||
- NEW: Changed default custom message command to:
|
||||
"kdialog --title \"%title\" --passivepopup \"%text\" 10"
|
||||
- NEW: System configuration checker (EXPERIMENTAL)
|
||||
- Updated Handbook
|
||||
- Removed obsolete FAQ
|
||||
- Removed "locolor" icon
|
||||
- RPM .spec: Removed "kdebase" dependency
|
||||
- Removed deprecated Wizard and Scheduler functions
|
||||
- NEW: "Shut Down" and "Reboot" commands are now disabled if KDM is not running.
|
||||
To enable these commands go to "Settings" -> "Configure KShutDown" -> "Actions",
|
||||
and set methods to "/sbin/...", "poweroff" or "reboot".
|
||||
- NEW: Balloon popup messages based on the "kdialog" program
|
||||
- QListView* -> KListView*
|
||||
- Improved and fixed KDE Kiosk support
|
||||
- FIXED: System tray icon hidding option
|
||||
- FIXED: Confirmation message box position
|
||||
- FIXED: Enter key now starts/stops the selected action
|
||||
- Removed the "Action" menu from the menu bar
|
||||
- FIXED: "Common Problems" buttons in the "Settings" dialog
|
||||
- FIXED: DCOP "cancel()" function now can cancel the warning message dialog
|
||||
- Misc. bugfixes
|
||||
- Updated the "admin" directory
|
||||
ACTION EDIT DIALOG:
|
||||
- Removed the "Help" button
|
||||
- "KDE" -> "KDE (default)"
|
||||
- Improved tip text
|
||||
- Changed the default external "Lock Session" command
|
||||
from "xlock" to "xscreensaver-command -lock"
|
||||
|
||||
2005/07/02 0.7.0 Beta
|
||||
NEW:
|
||||
- Redesigned the main window (thanks to Stephen)
|
||||
- Redesigned the settings dialog
|
||||
- Menu bar
|
||||
- Link to the "Download" page in the "File" menu
|
||||
- KShutDown Kicker Applet (based on the KDE Lock/Logout Applet)
|
||||
- New icons
|
||||
- System tray icon configuration
|
||||
- Redesigned "Statistics" dialog
|
||||
- Cool tray icon fade effects
|
||||
- Portuguese Brazilian language translation (also in version 0.6.1)
|
||||
- The "--confirm" command line option forces confirmation message box:
|
||||
EXAMPLE 1 - with confirmation:
|
||||
"kshutdown --confirm --shutdown"
|
||||
EXAMPLE 2 - without confirmation (default):
|
||||
"kshutdown --shutdown"
|
||||
IMPORTANT:
|
||||
- Since version 0.7.0 KShutDown requires KDE 3.3.x or newer
|
||||
- "K Menu" link is now placed in the "Accessories" menu.
|
||||
Old menu items (Utilities->KShutDown and Utilities->KShutDown Wizard)
|
||||
are now obsolete. You can remove these items manually.
|
||||
- Removed the Wizard dialog
|
||||
- Removed "Examples" directory from the "Extras" menu
|
||||
- Removed "Scheduler".
|
||||
"Scheduler" DCOP functions are now deprecated, and should not be used.
|
||||
- "-w" and "--wizard" command line arguments are now deprecated, and should not be used.
|
||||
IMPROVED:
|
||||
- Setup script
|
||||
- Usability
|
||||
- KShutDown is now smaller and faster
|
||||
- Link creator: confirmation messages, shut down, reboot, lock screen and logout links
|
||||
- Warning message
|
||||
- A confirmation message box
|
||||
- Visual and sound notifications
|
||||
UNDER CONSTRUCTION:
|
||||
- A new popup messages (based on the Kopete "balloon")
|
||||
- Action execution when a desired application exit
|
||||
- .spec file for Fedora Core
|
||||
- System configuration checker
|
||||
FIXED/MISC:
|
||||
- Fixed possible "make install" error (thanks to Gregorio)
|
||||
- Removed "build" info from the "About" dialog
|
||||
|
||||
2005/02/28 0.6.0
|
||||
- NEW: Settings: "Default" button in action edit dialog
|
||||
- NEW: DCOP functions: "configure" and "makeVisible"
|
||||
- REMOVED: Removed color configuration from the "Statistics" tab
|
||||
- FIXED: Text alignment in reversed layout
|
||||
- Cleaned up the settings dialog
|
||||
- Small fixes related to window management
|
||||
- Updated Italian translation
|
||||
|
||||
2005/02/12 0.5.1 Beta
|
||||
- NEW: Added options to execute a shell commad before
|
||||
shut down, reboot, logout or lock screen
|
||||
(Configure -> Actions & Extras Menu)
|
||||
- NEW: Added option to close the CD-ROM tray before logout
|
||||
(Configure -> Automation)
|
||||
- NEW: Changed window caption and system tray tool tip to be more usable
|
||||
- FIXED: Now the Wizard dialog window does not block the entire desktop
|
||||
- FIXED: Do not show minimized main window after Wizard cancel
|
||||
- Updated Manual and README
|
||||
- A shorter date/time format in window title
|
||||
- Minor fixes and improvements
|
||||
|
||||
2004/12/15 0.5.0 Beta
|
||||
- NEW: A custom message command
|
||||
- NEW: Selected time in the main window
|
||||
- NEW: Added support for AM/PM time format
|
||||
- NEW: Statistics: Added option to toggle the "from" (remote hostname) field
|
||||
- NEW: A new notifications configuration dialog
|
||||
- NEW: Last selected tab page is remembered
|
||||
- NEW: Last selected settings page is remembered
|
||||
- NEW: Warning 1 hour before action
|
||||
- FIXED: Fixed focus and default button in the Wizard
|
||||
- Added help button to the Wizard dialog
|
||||
- Info is displayed if "test" mode has been toggled
|
||||
- Now KShutDown should compile on KDE 3.1.1+
|
||||
- Cleaned up the source files
|
||||
- Updated API documentation
|
||||
- Added link to "xscreensaver-command" manual in action edit dialog
|
||||
- Link to the SuperKaramba home page in settings dialog
|
||||
- Smaller bugfixes and improvements
|
||||
- The source package is smaller
|
||||
|
||||
2004/11/13 0.4.0
|
||||
- NEW: Cancel button in passive message
|
||||
- NEW: Now the date/time editor will automatically advance focus
|
||||
to the next date/time section if a user has completed a section
|
||||
- Kiosk: Time selection is disabled in Wizard
|
||||
if "kshutdown_tab_time" is set to "false"
|
||||
- Updated translations
|
||||
|
||||
2004/10/23 0.3.2 Beta
|
||||
- NEW: Added Karamba info (click Configure button)
|
||||
- NEW: Standard KDE notifications
|
||||
(Control Center > Sound & Multimedia > System Notifications > KShutDown
|
||||
or
|
||||
KShutDown > Configure > Confirmations & Messages > Configure Notifications)
|
||||
- NEW: Added option to re-enable all messages which have been disabled with the
|
||||
"Do not show this message again" option
|
||||
- NEW: Changed Wizard image
|
||||
- NEW: Changed statistics default colors
|
||||
- NEW: Title in the system tray context menu
|
||||
- FIXED: Fixed amaroK "stop" function
|
||||
- FIXED: Wizard window is now centered on screen
|
||||
- FIXED: No confirmations if you execute a KShutDown action from the command
|
||||
line
|
||||
- SETUP: Added Polish language
|
||||
- SETUP: Added option "--enable-final" (press "F" to toggle)
|
||||
- SETUP: "Setup" is launched in a new Konsole window,
|
||||
so you can run it from a Konqueror (EXPERIMENTAL)
|
||||
- Improved and updated help
|
||||
- Bugfixes
|
||||
|
||||
2004/09/11 0.3.1 Beta
|
||||
- NEW: Russian translation
|
||||
- NEW: Simple Karamba themes
|
||||
(see /YOUR_INSTALL_PATH/share/apps/kshutdown/karamba)
|
||||
- CHANGE: Smaller Vorbis Ogg sound files
|
||||
- CHANGE: All KIOSK keys are now prefixed with "kshutdown_" string
|
||||
(see Handbook)
|
||||
- Updated translations
|
||||
|
||||
2004/08/30 0.3.0 Beta
|
||||
- NEW: Ability to run a command before shut down
|
||||
(click "Configure", "Automation")
|
||||
- NEW: Automatic screen locking after login (click "Configure", "Automation")
|
||||
- NEW: Reorganized and improved settings dialog
|
||||
- NEW: Colors in the "Setup" script
|
||||
- NEW: Added help buttons
|
||||
- NEW: Icons in tool tips
|
||||
- NEW: Italian translation
|
||||
- NEW: Links creator (click "Configure", "Links")
|
||||
- SYSTEM TRAY: Middle mouse button displays the actions menu
|
||||
- SYSTEM TRAY: Added confirmations
|
||||
- SYSTEM TRAY: Tear off handles in menus
|
||||
- FIXED: Source code and API cleanup
|
||||
- FIXED: Better usability
|
||||
- FIXED: Added "now" argument to the command line options
|
||||
- FIXED: Message window is now always on top
|
||||
- Added new items to the "Extras" menu
|
||||
|
||||
2004/07/19 0.2.0
|
||||
- Improved "Extras" menu
|
||||
- Better sounds quality; Vorbis Ogg format
|
||||
- Added Handbook (see Help menu)
|
||||
- Fixed documentation
|
||||
|
||||
2004/07/05 0.1.9 Beta
|
||||
- Changed DCOP API:
|
||||
changed "registerTask"
|
||||
removed "command"; use "activateAction" instead
|
||||
added "getStatusInfo"
|
||||
- Updated translations
|
||||
- Added .spec file
|
||||
- Changed Wizard "finish" button
|
||||
- Bugfixes
|
||||
|
||||
2004/06/13 0.1.8 Beta
|
||||
- NEW: New name - KShutDown
|
||||
- NEW: Wizard
|
||||
- NEW: Dutch translation
|
||||
- NEW: KDE Kiosk support. For example you can disable "Shut down" command,
|
||||
or the "Statistics" tab. See README for details.
|
||||
- NEW: "Extras" - user commands.
|
||||
Now you can add as many new commands as you want.
|
||||
- NEW: Options in the "Statistics" tab
|
||||
- NEW: Rewritten popup messages
|
||||
- NEW: Time argument in the command line. Examples:
|
||||
"kshutdown --your-option HH:MM" (absolute time),
|
||||
or "kshutdown --your-option MM" (time from now in minutes)
|
||||
- NEW: "--default" command line option disables test mode
|
||||
- FIXED: Sound configuration
|
||||
- IMPROVED: User interface
|
||||
- IMPROVED: "Setup" script
|
||||
- Updated translations
|
||||
- Bugfixes
|
||||
|
||||
2004/03/27 0.1.7 Beta
|
||||
- Slovak translation
|
||||
- German translation
|
||||
- Improved usability
|
||||
- Updated CVS...
|
||||
- More tool tips
|
||||
- Source files cleanup
|
||||
- Bugfixes
|
||||
|
||||
2004/03/11 0.1.6 Beta
|
||||
- Fixed "Statistics" tab
|
||||
- Command line option to display standard logout dialog (--standard)
|
||||
- Flat buttons
|
||||
- Removed "Options" tab
|
||||
- Settings dialog size is saved in the configuration file
|
||||
- "Remove All" button in the "Scheduler" tab
|
||||
- Czech translation and FAQ
|
||||
- Hungarian translation
|
||||
- Changed some icons
|
||||
- Bugfixes
|
||||
|
||||
2004/02/22 0.1.5 Beta
|
||||
- Bugfixes
|
||||
- Improved warning message box
|
||||
- Improved scheduler and DCOP server (still under construction)
|
||||
- Code cleanups
|
||||
- Fixed memory leaks
|
||||
- Added cancel option to the command line (-c and --cancel)
|
||||
|
||||
2004/02/07 0.1.4 Beta
|
||||
- Code cleanups
|
||||
- Fixed keyboard shortcuts
|
||||
- Fixed default window size
|
||||
- Added -s and --shutdown to the command line options
|
||||
- LED icon has been replaced with the system tray icon
|
||||
- Spanish translation by Quique
|
||||
- Test mode (kshutdown --test)
|
||||
- Error message if selected date/time is earlier than current date/time
|
||||
- Bugfixes
|
||||
|
||||
2004/01/17 0.1.3 Beta
|
||||
- "Exit" to the system tray
|
||||
- "Settings" command in the system tray context menu
|
||||
- Links to "man" manuals
|
||||
- Some tabs are initialized on demand (faster startup)
|
||||
- Tab icons
|
||||
- Statistics: colorized `w` output (logged-in users, uptime)
|
||||
- Scheduler: changed columns order, application icons
|
||||
- Bugfixes
|
||||
- System tray: caption
|
||||
|
||||
2003/12/08 0.1.2 Beta
|
||||
- ui improvements
|
||||
- system tray context menu
|
||||
- migration to KDevelop 3
|
||||
- user interface fixes
|
||||
- now you can directly specify delay in seconds, minutes, or hours
|
||||
- fixed "about" window
|
||||
- FAQ file
|
||||
- system tray icon is now always visible
|
||||
- changed default external commands to /sbin/reboot and /sbin/poweroff
|
||||
- experimental DCOP interface (will be useful in v0.2.0)
|
||||
- code and api cleanups + api docs
|
||||
- fixed settings saving
|
||||
- "embedded" tool tips
|
||||
- only 1 instance of kshutdown is now allowed
|
||||
- bugfixes
|
||||
- new icons (created with Sodipodi and GIMP)
|
||||
- warning is displayed 10 seconds before timeout
|
||||
|
||||
2003/11/09 0.1.1 Beta
|
||||
- polska jezyk, trudna jezyk ;-))) (pl.po)
|
||||
- standard gui items
|
||||
- passive popup warning messages (optional)
|
||||
- status info
|
||||
- install script
|
||||
- simple system tray configuration
|
||||
- support for /sbin/shutdown, xlock, and user commands
|
||||
- added command line options for lock screen (-k and --lock)
|
||||
- a new settings dialog
|
||||
- code and API clean-ups
|
||||
- different "cancel" button texts (Close/Cancel)
|
||||
- added "Whats This" texts
|
||||
|
||||
2003/10/27 0.1.0 Beta
|
||||
- first version
|
@ -0,0 +1,278 @@
|
||||
# Doxyfile 1.4.1-KDevelop
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
PROJECT_NAME = KShutDown
|
||||
PROJECT_NUMBER =
|
||||
OUTPUT_DIRECTORY =
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
USE_WINDOWS_ENCODING = NO
|
||||
BRIEF_MEMBER_DESC = NO
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF = "The $name class" \
|
||||
"The $name widget" \
|
||||
"The $name file" \
|
||||
is \
|
||||
provides \
|
||||
specifies \
|
||||
contains \
|
||||
represents \
|
||||
a \
|
||||
an \
|
||||
the
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = NO
|
||||
STRIP_FROM_PATH = /home/kdt/Documents/src/kshutdown/kshutdown/
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
DETAILS_AT_TOP = YES
|
||||
INHERIT_DOCS = YES
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
TAB_SIZE = 4
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
SUBGROUPING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
EXTRACT_ALL = NO
|
||||
EXTRACT_PRIVATE = NO
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_LOCAL_CLASSES = NO
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = YES
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SORT_BRIEF_DOCS = YES
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
GENERATE_TODOLIST = NO
|
||||
GENERATE_TESTLIST = NO
|
||||
GENERATE_BUGLIST = NO
|
||||
GENERATE_DEPRECATEDLIST= NO
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = YES
|
||||
SHOW_DIRECTORIES = YES
|
||||
FILE_VERSION_FILTER =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = /home/kdt/src/kshutdown
|
||||
FILE_PATTERNS = *.c \
|
||||
*.cc \
|
||||
*.cxx \
|
||||
*.cpp \
|
||||
*.c++ \
|
||||
*.java \
|
||||
*.ii \
|
||||
*.ixx \
|
||||
*.ipp \
|
||||
*.i++ \
|
||||
*.inl \
|
||||
*.h \
|
||||
*.hh \
|
||||
*.hxx \
|
||||
*.hpp \
|
||||
*.h++ \
|
||||
*.idl \
|
||||
*.odl \
|
||||
*.cs \
|
||||
*.php \
|
||||
*.php3 \
|
||||
*.inc \
|
||||
*.m \
|
||||
*.mm \
|
||||
*.dox \
|
||||
*.C \
|
||||
*.CC \
|
||||
*.C++ \
|
||||
*.II \
|
||||
*.I++ \
|
||||
*.H \
|
||||
*.HH \
|
||||
*.H++ \
|
||||
*.CS \
|
||||
*.PHP \
|
||||
*.PHP3 \
|
||||
*.M \
|
||||
*.MM \
|
||||
*.C \
|
||||
*.H \
|
||||
*.tlh \
|
||||
*.diff \
|
||||
*.patch \
|
||||
*.moc \
|
||||
*.xpm \
|
||||
*.dox
|
||||
RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS = *.moc.cpp \
|
||||
kshutdowniface_stub.h \
|
||||
kshutdowniface_stub.cpp \
|
||||
kshutdowniface_skel.cpp
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS = *
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = NO
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = YES
|
||||
REFERENCES_RELATION = YES
|
||||
VERBATIM_HEADERS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = YES
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = html
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = NO
|
||||
CHM_FILE =
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = NO
|
||||
TREEVIEW_WIDTH = 250
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = NO
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = YES
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = NO
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = YES
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED =
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE = kshutdown.tag
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = NO
|
||||
HIDE_UNDOC_RELATIONS = NO
|
||||
HAVE_DOT = NO
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = YES
|
||||
GROUP_GRAPHS = YES
|
||||
UML_LOOK = NO
|
||||
TEMPLATE_RELATIONS = NO
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
CALL_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DIRECTORY_GRAPH = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
MAX_DOT_GRAPH_WIDTH = 1024
|
||||
MAX_DOT_GRAPH_HEIGHT = 1024
|
||||
MAX_DOT_GRAPH_DEPTH = 1000
|
||||
DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = NO
|
@ -0,0 +1,180 @@
|
||||
|
||||
Cool Installation ;-)
|
||||
=====================
|
||||
|
||||
Run ./Setup
|
||||
|
||||
Gentoo ebuild installation (.ebuild file)
|
||||
=========================================
|
||||
|
||||
1. Be sure, $PORTDIR_OVERLAY is set in /etc/make.conf
|
||||
(usually, it's /usr/local/portage)
|
||||
2. Extract the content of the .tar.gz to $PORTDIR_OVERLAY
|
||||
3. Execute "emerge kshutdown" as root.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, a file
|
||||
`config.cache' that saves the results of its tests to speed up
|
||||
reconfiguring, and a file `config.log' containing compiler output
|
||||
(useful mainly for debugging `configure').
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If at some point `config.cache'
|
||||
contains results you don't want to keep, you may remove or edit it.
|
||||
|
||||
The file `configure.in' is used to create `configure' by a program
|
||||
called `autoconf'. You only need `configure.in' if you want to change
|
||||
it or regenerate `configure' using a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes a while. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
4. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. You can give `configure'
|
||||
initial values for variables by setting them in the environment. Using
|
||||
a Bourne-compatible shell, you can do that on the command line like
|
||||
this:
|
||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||
|
||||
Or on systems that have the `env' program, you can do it like this:
|
||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not supports the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a time
|
||||
in the source code directory. After you have installed the package for
|
||||
one architecture, use `make distclean' before reconfiguring for another
|
||||
architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' can not figure out
|
||||
automatically, but needs to determine by the type of host the package
|
||||
will run on. Usually `configure' can figure that out, but if it prints
|
||||
a message saying it can not guess the host type, give it the
|
||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name with three fields:
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the host type.
|
||||
|
||||
If you are building compiler tools for cross-compiling, you can also
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for and the `--build=TYPE' option to select the type of
|
||||
system on which you are compiling the package.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Operation Controls
|
||||
==================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Use and save the results of the tests in FILE instead of
|
||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||
debugging `configure'.
|
||||
|
||||
`--help'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made.
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--version'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options.
|
@ -0,0 +1,23 @@
|
||||
SUBDIRS = doc extras karamba kshutdown kshutdownlockout pics po sounds
|
||||
EXTRA_DIST = admin AUTHORS COPYING INSTALL README Setup TODO VERSION ChangeLog kshutdown.lsm NEWS
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs
|
||||
cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in
|
||||
|
||||
$(top_srcdir)/subdirs:
|
||||
cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs
|
||||
|
||||
$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in
|
||||
cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4
|
||||
|
||||
MAINTAINERCLEANFILES = acinclude.m4 configure.files configure.in subdirs
|
||||
|
||||
package-messages:
|
||||
$(MAKE) -f admin/Makefile.common package-messages
|
||||
$(MAKE) -C po merge
|
||||
|
||||
dist-hook:
|
||||
cd $(top_distdir) && perl admin/am_edit -padmin
|
||||
cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs
|
@ -0,0 +1,33 @@
|
||||
|
||||
KShutDown is an advanced shut down utility for KDE.
|
||||
|
||||
Odd numbers in version mean it's unstable/beta (e.g. 0.7.1, 0.9).
|
||||
Even numbers mean it's stable (e.g. 0.8, 0.10.5).
|
||||
|
||||
FEATURES
|
||||
--------
|
||||
- Turn Off Computer (logout and halt the system)
|
||||
- Restart Computer (logout and reboot the system)
|
||||
- Lock Session (lock the screen using a screen saver)
|
||||
- End Current Session (end the current KDE session and logout the user)
|
||||
- Extras (additional, user commands)
|
||||
- Time and delay options
|
||||
- Command line and DCOP support
|
||||
- System tray and panel applet
|
||||
- Visual and sound notifications
|
||||
- KDE Kiosk support
|
||||
- And more...
|
||||
|
||||
LINKS
|
||||
-----
|
||||
http://kshutdown.sourceforge.net (Home Page)
|
||||
http://sourceforge.net/projects/kshutdown (Project Page)
|
||||
http://freshmeat.net/projects/kshutdown (freshmeat.net Page)
|
||||
http://www.kde-apps.org/content/show.php?content=9754 (KDE-Apps.org Page)
|
||||
http://www.kde.org (KDE Home Page)
|
||||
|
||||
COPYRIGHT & LICENSE
|
||||
-------------------
|
||||
(C) Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
KShutDown is licensed under the GNU General Public License (GPL)
|
||||
(http://www.gnu.org/licenses/gpl.html)
|
@ -0,0 +1,266 @@
|
||||
#!/bin/bash
|
||||
|
||||
# TODO: 2.0: use kdialog
|
||||
|
||||
META_FULL_NAME="KShutDown"
|
||||
META_VERSION="`cat VERSION`"
|
||||
|
||||
#if [[ (("$TERM" == "dumb") || ("$TERM" == "xterm")) && ("${1}" != "--launch-in-konsole") ]]; then
|
||||
# echo
|
||||
# echo "Press Ctrl+C to exit $META_FULL_NAME installer"
|
||||
# konsole --notabbar --notoolbar --workdir `dirname "${0}"` -T "$META_FULL_NAME Installer" -e ${0} --launch-in-konsole
|
||||
# exit
|
||||
#fi
|
||||
|
||||
# installation dirs
|
||||
DEFAULT_DIR=`kde-config --prefix`
|
||||
if [ -z "$DEFAULT_DIR" ]; then
|
||||
DEFAULT_DIR="/usr"
|
||||
fi
|
||||
INSTALL_DIR="$DEFAULT_DIR"
|
||||
|
||||
# colors
|
||||
DEF_C="\E[37;40m"
|
||||
KEY_C="\E[31;40m"
|
||||
|
||||
# configure options
|
||||
CONFIGURE_OPTIONS=""
|
||||
FAST_COMPILATION="true"
|
||||
|
||||
# i18n
|
||||
# english
|
||||
I18N_TITLE_DOCS="Documentation and License"
|
||||
I18N_TITLE_SETUP="Compilation and Installation"
|
||||
I18N_CHANGE_DIR="Change installation directory (prefix)"
|
||||
I18N_DISABLE_FAST="Disable fast compilation"
|
||||
I18N_ENABLE_FAST="Enable fast compilation"
|
||||
I18N_INSTALL="Install"
|
||||
I18N_LICENSE="License"
|
||||
I18N_NEWS="What's new? (q - quit)"
|
||||
I18N_PRESS_ENTER="Press <Enter> to exit"
|
||||
I18N_QUIT="Quit"
|
||||
I18N_THANKS="Thank you for using"
|
||||
I18N_MENU="K Menu: Accessories -> KShutDown"
|
||||
I18N_CONF_WITH="Configuring with"
|
||||
I18N_INST_FAILED="Installation failed!"
|
||||
I18N_COMP_FAILED="Compilation failed!"
|
||||
I18N_CONF_FAILED="Configuration failed!"
|
||||
I18N_COMP_START="Compiling..."
|
||||
I18N_MINU=" This may take a few minutes."
|
||||
I18N_MISSING_DEPEN1="Make sure you have installed the 'kdelibs-devel' package"
|
||||
I18N_MISSING_DEPEN2=" which is required to compile any KDE application."
|
||||
I18N_ENTER_DIR="Enter a new prefix"
|
||||
I18N_SETUP="Setup"
|
||||
I18N_README="Readme"
|
||||
|
||||
# polish
|
||||
if [[ ("$LANG" == "pl_PL.UTF-8") || ("$LANG" == "pl_PL") || ("$LANG" == "pl") ]]; then
|
||||
I18N_TITLE_DOCS="Dokumentacja i licencja"
|
||||
I18N_TITLE_SETUP="Kompilacja i instalacja"
|
||||
I18N_CHANGE_DIR="Zmien katalog instalacji (prefix)"
|
||||
I18N_DISABLE_FAST="Wylacz szybka kompilacje"
|
||||
I18N_ENABLE_FAST="Wlacz szybka kompilacje"
|
||||
I18N_INSTALL="Instaluj"
|
||||
I18N_LICENSE="Licencja"
|
||||
I18N_NEWS="Co nowego? (q - wyjscie)"
|
||||
I18N_PRESS_ENTER="Nacisnij <Enter>, aby wyjsc"
|
||||
I18N_QUIT="Zakoncz"
|
||||
I18N_THANKS="Dziekujemy za uzycie"
|
||||
I18N_MENU="Menu K: Akcesoria -> KShutDown"
|
||||
I18N_CONF_WITH="Konfigurowanie z"
|
||||
I18N_INST_FAILED="Instalacja nie powiodla sie!"
|
||||
I18N_COMP_FAILED="Kompilacja nie powiodla sie!"
|
||||
I18N_CONF_FAILED="Konfiguracja nie powiodla sie!"
|
||||
I18N_COMP_START="Kompilowanie..."
|
||||
I18N_MINU=" To moze potrwac kilka minut."
|
||||
I18N_MISSING_DEPEN1="Upewnij sie, ze masz zainstalowana paczke 'kdelibs-devel',"
|
||||
I18N_MISSING_DEPEN2=" ktora jest wymagana do kompilacji jakiejkolwiek aplikacji KDE."
|
||||
I18N_ENTER_DIR="Wprowadz nowy prefix"
|
||||
I18N_SETUP="Instalator"
|
||||
I18N_README="Przeczytaj (readme)"
|
||||
fi
|
||||
|
||||
#italian
|
||||
if [[ ("$LANG" == "it_IT.UTF-8") || ("$LANG" == "it_IT") || ("$LANG" == "it") ]]; then
|
||||
I18N_TITLE_DOCS="Documentazione e Licenza"
|
||||
I18N_TITLE_SETUP="Compilazione ed Installazione"
|
||||
I18N_CHANGE_DIR="Cambia la cartella di destinazione (prefix)"
|
||||
I18N_DISABLE_FAST="Disabilita compilazione veloce"
|
||||
I18N_ENABLE_FAST="Abilita compilazione veloce"
|
||||
I18N_INSTALL="Installa"
|
||||
I18N_LICENSE="Licenza"
|
||||
I18N_NEWS="Cosa c'è di nuovo? (q - esci)"
|
||||
I18N_PRESS_ENTER="Premi <Enter> per uscire"
|
||||
I18N_QUIT="Esci"
|
||||
I18N_THANKS="Grazie di usare"
|
||||
I18N_MENU="Menu K: Accessori -> KShutDown"
|
||||
I18N_CONF_WITH="Configurazione con"
|
||||
I18N_INST_FAILED="Installazione fallita!"
|
||||
I18N_COMP_FAILED="Compilazione fallita!"
|
||||
I18N_CONF_FAILED="Configurazione fallita!"
|
||||
I18N_COMP_START="Compilazione..."
|
||||
I18N_MINU=" Per questo potrebbero volerci alcuni minuti."
|
||||
I18N_MISSING_DEPEN1="Assicurati di aver installato il pacchetto 'kdelibs-devel'"
|
||||
I18N_MISSING_DEPEN2=" che è necessario per compilare ogni applicazione KDE."
|
||||
I18N_ENTER_DIR="Inserisci una nuova destinazione"
|
||||
I18N_SETUP="Installazione"
|
||||
I18N_README="Leggimi"
|
||||
fi
|
||||
# internal functions
|
||||
|
||||
ks_kill()
|
||||
{
|
||||
echo
|
||||
echo
|
||||
echo "$I18N_SETUP: ${1}"
|
||||
echo
|
||||
echo "$I18N_PRESS_ENTER"
|
||||
read
|
||||
ks_quit 1
|
||||
}
|
||||
|
||||
ks_quit()
|
||||
{
|
||||
ks_reset
|
||||
exit ${1}
|
||||
}
|
||||
|
||||
ks_reset()
|
||||
{
|
||||
tput sgr0
|
||||
}
|
||||
|
||||
ks_show_finish_info()
|
||||
{
|
||||
echo
|
||||
echo "$I18N_THANKS $META_FULL_NAME!"
|
||||
echo " The $META_FULL_NAME Team"
|
||||
echo
|
||||
echo "HOW TO RUN?"
|
||||
echo
|
||||
echo "$I18N_MENU"
|
||||
echo "Command: kshutdown"
|
||||
echo "Command line options: kshutdown --help"
|
||||
echo
|
||||
echo -e "$I18N_PRESS_ENTER"
|
||||
read
|
||||
}
|
||||
|
||||
ks_show_menu()
|
||||
{
|
||||
echo -e "$DEF_C"
|
||||
clear
|
||||
echo
|
||||
echo
|
||||
echo " $I18N_SETUP"
|
||||
echo " $META_FULL_NAME $META_VERSION"
|
||||
echo
|
||||
echo
|
||||
echo -e " ${KEY_C}${I18N_TITLE_SETUP}${DEF_C}"
|
||||
echo -e " [${KEY_C}i${DEF_C}] $I18N_INSTALL (./configure --prefix=${INSTALL_DIR}, make, kdesu -c \"make install\")"
|
||||
echo -e " [${KEY_C}p${DEF_C}] $I18N_CHANGE_DIR"
|
||||
if [ -n "$FAST_COMPILATION" ]; then
|
||||
echo -e " [${KEY_C}f${DEF_C}] $I18N_DISABLE_FAST";
|
||||
else
|
||||
echo -e " [${KEY_C}f${DEF_C}] $I18N_ENABLE_FAST (--enable-final)";
|
||||
fi
|
||||
echo
|
||||
echo -e " ${KEY_C}${I18N_TITLE_DOCS}${DEF_C}"
|
||||
echo -e " [${KEY_C}n${DEF_C}] $I18N_NEWS"
|
||||
echo -e " [${KEY_C}l${DEF_C}] $I18N_LICENSE (GNU GPL)"
|
||||
echo -e " [${KEY_C}r${DEF_C}] $I18N_README"
|
||||
echo
|
||||
echo -e " [${KEY_C}q${DEF_C}] $I18N_QUIT"
|
||||
echo
|
||||
echo
|
||||
echo " http://kshutdown.sourceforge.net"
|
||||
}
|
||||
|
||||
while [ 1 ]; do
|
||||
ks_show_menu
|
||||
# wait for a single key
|
||||
read -n 1 -s
|
||||
|
||||
# install
|
||||
if [[ ("$REPLY" == "i") || ( "$REPLY" == "I" ) ]]; then
|
||||
if [ -n "$FAST_COMPILATION" ]; then
|
||||
CONFIGURE_OPTIONS="--prefix=${INSTALL_DIR} --enable-final";
|
||||
else
|
||||
CONFIGURE_OPTIONS="--prefix=${INSTALL_DIR}";
|
||||
fi
|
||||
echo
|
||||
echo "$I18N_SETUP: $I18N_CONF_WITH '$CONFIGURE_OPTIONS'..."
|
||||
echo
|
||||
# configure
|
||||
if ! [ -f ./configure ]; then
|
||||
make -f admin/Makefile.common cvs
|
||||
fi
|
||||
if ./configure $CONFIGURE_OPTIONS; then
|
||||
echo "$I18N_SETUP: $I18N_COMP_START"
|
||||
echo "$I18N_MINU"
|
||||
if make; then
|
||||
if [ -w "${INSTALL_DIR}" ]; then
|
||||
if make install; then
|
||||
ks_show_finish_info
|
||||
ks_quit
|
||||
else
|
||||
ks_kill "$I18N_INST_FAILED"
|
||||
fi
|
||||
else
|
||||
if kdesu -c "make install"; then
|
||||
ks_show_finish_info
|
||||
ks_quit
|
||||
else
|
||||
ks_kill "$I18N_INST_FAILED"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
ks_kill "$I18N_COMP_FAILED"
|
||||
fi
|
||||
else
|
||||
echo
|
||||
echo
|
||||
echo "$I18N_SETUP: $I18N_MISSING_DEPEN1"
|
||||
echo "$I18N_MISSING_DEPEN2"
|
||||
ks_kill "$I18N_CONF_FAILED"
|
||||
fi
|
||||
ks_quit
|
||||
|
||||
# prefix
|
||||
elif [[ ("$REPLY" == "p") || ( "$REPLY" == "P" ) ]]; then
|
||||
echo
|
||||
echo "$I18N_ENTER_DIR [${DEFAULT_DIR}]: "
|
||||
read -e
|
||||
if [ -z "$REPLY" ]; then
|
||||
REPLY="$DEFAULT_DIR"
|
||||
fi
|
||||
INSTALL_DIR="$REPLY"
|
||||
|
||||
# toggle fast compilation
|
||||
elif [[ ("$REPLY" == "f") || ( "$REPLY" == "F" ) ]]; then
|
||||
if [ -z "$FAST_COMPILATION" ]; then
|
||||
FAST_COMPILATION="true";
|
||||
else
|
||||
FAST_COMPILATION="";
|
||||
fi
|
||||
|
||||
# news
|
||||
elif [[ ("$REPLY" == "n") || ( "$REPLY" == "N" ) ]]; then
|
||||
less "NEWS"
|
||||
|
||||
# license
|
||||
elif [[ ("$REPLY" == "l") || ( "$REPLY" == "L" ) ]]; then
|
||||
less "COPYING"
|
||||
|
||||
# readme
|
||||
elif [[ ("$REPLY" == "r") || ( "$REPLY" == "R" ) ]]; then
|
||||
less "README"
|
||||
|
||||
# quit
|
||||
elif [[ ("$REPLY" == "q") || ( "$REPLY" == "Q" ) ]]; then
|
||||
ks_reset
|
||||
clear
|
||||
exit
|
||||
fi
|
||||
|
||||
done
|
@ -0,0 +1,55 @@
|
||||
|
||||
IDEAS FROM KDE-APPS.ORG (http://kde-apps.org/content/show.php?content=9754)
|
||||
-----------------------
|
||||
|
||||
- by MasterD on: 01/22/2006, 15:26
|
||||
"Maybe you could add under "Extras" an option called "Beep warning" or
|
||||
something like that. So there will be an loud beep at this time you had set.
|
||||
So if you work on your computer hard and you forget the time there will be
|
||||
an beep and then you know that you wanted to do something."
|
||||
|
||||
- by aaron-koensgen on: 05/08/2006, 14:55
|
||||
"(...) What about shutting down the computer when the CPU usage goes under
|
||||
a certain level? I know this function from a windows program which is similar
|
||||
to your application.
|
||||
(see http://us.jpa-software.de/cms/index.php?option=content&task=view&id=7&Itemid=26)
|
||||
|
||||
- "Reboot choice"
|
||||
https://sourceforge.net/tracker/?func=detail&atid=605273&aid=1484842&group_id=93707
|
||||
|
||||
- by DigitalCyanide on: 07/05/2004, 8:39
|
||||
"How about adding "Console Mode" to the options? Saw this in one of the
|
||||
Distro's a long time ago where the logout dialog had "End Session",
|
||||
"Console Mode", "Turn Off", and "Restart". Kinda miss just being able
|
||||
to go to init 3 without having end session, then going to another vc to
|
||||
issue the init 3 (when you want to be graceful about it). Could just
|
||||
have the ability to add it as a user command rather than just edit
|
||||
existing commands too."
|
||||
|
||||
- by Yaba on: 07/20/2004, 7:44
|
||||
"What would be really great would be an option to be able to tell grub
|
||||
which configuration to boot on the next boot."
|
||||
/* lilo too */
|
||||
|
||||
- by zero on: 12/02/2004, 1:35
|
||||
"(...)add that grayed-out background effect
|
||||
like when KDE logout is selected from the main menu(...)"
|
||||
|
||||
- by Superstoned on: 04/06/2005, 15:27
|
||||
"hey, someone asked for a way to auto-logout after a certain time of inactivity."
|
||||
|
||||
- by klj on: 11/13/2005, 16:40
|
||||
"(...) What I would really like to see was some kind of interaction with the bootloader, so it would be possible to reboot directy to windows/other distro without having to wait and choose it manually at boot."
|
||||
|
||||
MISC. TODOS
|
||||
-----------
|
||||
|
||||
- Grep for "FIXME" and "TODO" in *.cpp/*.h files
|
||||
- GDM/GNOME support
|
||||
- Add to KDE Extra Gear (KDE Base?)
|
||||
- "remote reboot and shutdown, maybe using ssh" (Giovanni Venturi)
|
||||
- Web interface? (probably via https)
|
||||
- System suspend (shutdown+z)
|
||||
- Shut down notification sent via KMail or IM/Kopete
|
||||
- Kopete plugin (shutdown via Jabber ;-)
|
||||
- Killing the specified application/process at the selected time
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,863 @@
|
||||
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
# 2005 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_AUTOMAKE_VERSION(VERSION)
|
||||
# ----------------------------
|
||||
# Automake X.Y traces this macro to ensure aclocal.m4 has been
|
||||
# generated from the m4 files accompanying Automake X.Y.
|
||||
AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
|
||||
|
||||
# AM_SET_CURRENT_AUTOMAKE_VERSION
|
||||
# -------------------------------
|
||||
# Call AM_AUTOMAKE_VERSION so it can be traced.
|
||||
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
|
||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||
[AM_AUTOMAKE_VERSION([1.9.6])])
|
||||
|
||||
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
|
||||
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
|
||||
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
|
||||
#
|
||||
# Of course, Automake must honor this variable whenever it calls a
|
||||
# tool from the auxiliary directory. The problem is that $srcdir (and
|
||||
# therefore $ac_aux_dir as well) can be either absolute or relative,
|
||||
# depending on how configure is run. This is pretty annoying, since
|
||||
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
|
||||
# source directory, any form will work fine, but in subdirectories a
|
||||
# relative path needs to be adjusted first.
|
||||
#
|
||||
# $ac_aux_dir/missing
|
||||
# fails when called from a subdirectory if $ac_aux_dir is relative
|
||||
# $top_srcdir/$ac_aux_dir/missing
|
||||
# fails if $ac_aux_dir is absolute,
|
||||
# fails when called from a subdirectory in a VPATH build with
|
||||
# a relative $ac_aux_dir
|
||||
#
|
||||
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
|
||||
# are both prefixed by $srcdir. In an in-source build this is usually
|
||||
# harmless because $srcdir is `.', but things will broke when you
|
||||
# start a VPATH build or use an absolute $srcdir.
|
||||
#
|
||||
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
|
||||
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
|
||||
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
|
||||
# and then we would define $MISSING as
|
||||
# MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# This will work as long as MISSING is not called from configure, because
|
||||
# unfortunately $(top_srcdir) has no meaning in configure.
|
||||
# However there are other variables, like CC, which are often used in
|
||||
# configure, and could therefore not use this "fixed" $ac_aux_dir.
|
||||
#
|
||||
# Another solution, used here, is to always expand $ac_aux_dir to an
|
||||
# absolute PATH. The drawback is that using absolute paths prevent a
|
||||
# configured tree to be moved without reconfiguration.
|
||||
|
||||
AC_DEFUN([AM_AUX_DIR_EXPAND],
|
||||
[dnl Rely on autoconf to set up CDPATH properly.
|
||||
AC_PREREQ([2.50])dnl
|
||||
# expand $ac_aux_dir to an absolute path
|
||||
am_aux_dir=`cd $ac_aux_dir && pwd`
|
||||
])
|
||||
|
||||
# AM_CONDITIONAL -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 7
|
||||
|
||||
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
|
||||
# -------------------------------------
|
||||
# Define a conditional.
|
||||
AC_DEFUN([AM_CONDITIONAL],
|
||||
[AC_PREREQ(2.52)dnl
|
||||
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
|
||||
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
|
||||
AC_SUBST([$1_TRUE])
|
||||
AC_SUBST([$1_FALSE])
|
||||
if $2; then
|
||||
$1_TRUE=
|
||||
$1_FALSE='#'
|
||||
else
|
||||
$1_TRUE='#'
|
||||
$1_FALSE=
|
||||
fi
|
||||
AC_CONFIG_COMMANDS_PRE(
|
||||
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
|
||||
AC_MSG_ERROR([[conditional "$1" was never defined.
|
||||
Usually this means the macro was only invoked conditionally.]])
|
||||
fi])])
|
||||
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 8
|
||||
|
||||
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
|
||||
# written in clear, in which case automake, when reading aclocal.m4,
|
||||
# will think it sees a *use*, and therefore will trigger all it's
|
||||
# C support machinery. Also note that it means that autoscan, seeing
|
||||
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
|
||||
|
||||
|
||||
# _AM_DEPENDENCIES(NAME)
|
||||
# ----------------------
|
||||
# See how the compiler implements dependency checking.
|
||||
# NAME is "CC", "CXX", "GCJ", or "OBJC".
|
||||
# We try a few techniques and use that to set a single cache variable.
|
||||
#
|
||||
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
|
||||
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
|
||||
# dependency, and given that the user is not expected to run this macro,
|
||||
# just rely on AC_PROG_CC.
|
||||
AC_DEFUN([_AM_DEPENDENCIES],
|
||||
[AC_REQUIRE([AM_SET_DEPDIR])dnl
|
||||
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
|
||||
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
|
||||
AC_REQUIRE([AM_DEP_TRACK])dnl
|
||||
|
||||
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
|
||||
[$1], CXX, [depcc="$CXX" am_compiler_list=],
|
||||
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
|
||||
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
|
||||
[depcc="$$1" am_compiler_list=])
|
||||
|
||||
AC_CACHE_CHECK([dependency style of $depcc],
|
||||
[am_cv_$1_dependencies_compiler_type],
|
||||
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
|
||||
# We make a subdir and do the tests there. Otherwise we can end up
|
||||
# making bogus files that we don't know about and never remove. For
|
||||
# instance it was reported that on HP-UX the gcc test will end up
|
||||
# making a dummy file named `D' -- because `-MD' means `put the output
|
||||
# in D'.
|
||||
mkdir conftest.dir
|
||||
# Copy depcomp to subdir because otherwise we won't find it if we're
|
||||
# using a relative directory.
|
||||
cp "$am_depcomp" conftest.dir
|
||||
cd conftest.dir
|
||||
# We will build objects and dependencies in a subdirectory because
|
||||
# it helps to detect inapplicable dependency modes. For instance
|
||||
# both Tru64's cc and ICC support -MD to output dependencies as a
|
||||
# side effect of compilation, but ICC will put the dependencies in
|
||||
# the current directory while Tru64 will put them in the object
|
||||
# directory.
|
||||
mkdir sub
|
||||
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
if test "$am_compiler_list" = ""; then
|
||||
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
|
||||
fi
|
||||
for depmode in $am_compiler_list; do
|
||||
# Setup a source with many dependencies, because some compilers
|
||||
# like to wrap large dependency lists on column 80 (with \), and
|
||||
# we should not choose a depcomp mode which is confused by this.
|
||||
#
|
||||
# We need to recreate these files for each test, as the compiler may
|
||||
# overwrite some of them when testing with obscure command lines.
|
||||
# This happens at least with the AIX C compiler.
|
||||
: > sub/conftest.c
|
||||
for i in 1 2 3 4 5 6; do
|
||||
echo '#include "conftst'$i'.h"' >> sub/conftest.c
|
||||
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
|
||||
# Solaris 8's {/usr,}/bin/sh.
|
||||
touch sub/conftst$i.h
|
||||
done
|
||||
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
|
||||
|
||||
case $depmode in
|
||||
nosideeffect)
|
||||
# after this tag, mechanisms are not by side-effect, so they'll
|
||||
# only be used when explicitly requested
|
||||
if test "x$enable_dependency_tracking" = xyes; then
|
||||
continue
|
||||
else
|
||||
break
|
||||
fi
|
||||
;;
|
||||
none) break ;;
|
||||
esac
|
||||
# We check with `-c' and `-o' for the sake of the "dashmstdout"
|
||||
# mode. It turns out that the SunPro C++ compiler does not properly
|
||||
# handle `-M -o', and we need to detect this.
|
||||
if depmode=$depmode \
|
||||
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
|
||||
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
|
||||
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
|
||||
>/dev/null 2>conftest.err &&
|
||||
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
|
||||
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
|
||||
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
|
||||
# icc doesn't choke on unknown options, it will just issue warnings
|
||||
# or remarks (even with -Werror). So we grep stderr for any message
|
||||
# that says an option was ignored or not supported.
|
||||
# When given -MP, icc 7.0 and 7.1 complain thusly:
|
||||
# icc: Command line warning: ignoring option '-M'; no argument required
|
||||
# The diagnosis changed in icc 8.0:
|
||||
# icc: Command line remark: option '-MP' not supported
|
||||
if (grep 'ignoring option' conftest.err ||
|
||||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
|
||||
am_cv_$1_dependencies_compiler_type=$depmode
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
cd ..
|
||||
rm -rf conftest.dir
|
||||
else
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
fi
|
||||
])
|
||||
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
|
||||
AM_CONDITIONAL([am__fastdep$1], [
|
||||
test "x$enable_dependency_tracking" != xno \
|
||||
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
|
||||
])
|
||||
|
||||
|
||||
# AM_SET_DEPDIR
|
||||
# -------------
|
||||
# Choose a directory name for dependency files.
|
||||
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
|
||||
AC_DEFUN([AM_SET_DEPDIR],
|
||||
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
|
||||
])
|
||||
|
||||
|
||||
# AM_DEP_TRACK
|
||||
# ------------
|
||||
AC_DEFUN([AM_DEP_TRACK],
|
||||
[AC_ARG_ENABLE(dependency-tracking,
|
||||
[ --disable-dependency-tracking speeds up one-time build
|
||||
--enable-dependency-tracking do not reject slow dependency extractors])
|
||||
if test "x$enable_dependency_tracking" != xno; then
|
||||
am_depcomp="$ac_aux_dir/depcomp"
|
||||
AMDEPBACKSLASH='\'
|
||||
fi
|
||||
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
|
||||
AC_SUBST([AMDEPBACKSLASH])
|
||||
])
|
||||
|
||||
# Generate code to set up dependency tracking. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
#serial 3
|
||||
|
||||
# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# ------------------------------
|
||||
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[for mf in $CONFIG_FILES; do
|
||||
# Strip MF so we end up with the name of the file.
|
||||
mf=`echo "$mf" | sed -e 's/:.*$//'`
|
||||
# Check whether this is an Automake generated Makefile or not.
|
||||
# We used to match only the files named `Makefile.in', but
|
||||
# some people rename them; so instead we look at the file content.
|
||||
# Grep'ing the first line is not enough: some people post-process
|
||||
# each Makefile.in and add a new line on top of each file to say so.
|
||||
# So let's grep whole file.
|
||||
if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
|
||||
dirpart=`AS_DIRNAME("$mf")`
|
||||
else
|
||||
continue
|
||||
fi
|
||||
# Extract the definition of DEPDIR, am__include, and am__quote
|
||||
# from the Makefile without running `make'.
|
||||
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
|
||||
test -z "$DEPDIR" && continue
|
||||
am__include=`sed -n 's/^am__include = //p' < "$mf"`
|
||||
test -z "am__include" && continue
|
||||
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
|
||||
# When using ansi2knr, U may be empty or an underscore; expand it
|
||||
U=`sed -n 's/^U = //p' < "$mf"`
|
||||
# Find all dependency output files, they are included files with
|
||||
# $(DEPDIR) in their names. We invoke sed twice because it is the
|
||||
# simplest approach to changing $(DEPDIR) to its actual value in the
|
||||
# expansion.
|
||||
for file in `sed -n "
|
||||
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
|
||||
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
|
||||
# Make sure the directory exists.
|
||||
test -f "$dirpart/$file" && continue
|
||||
fdir=`AS_DIRNAME(["$file"])`
|
||||
AS_MKDIR_P([$dirpart/$fdir])
|
||||
# echo "creating $dirpart/$file"
|
||||
echo '# dummy' > "$dirpart/$file"
|
||||
done
|
||||
done
|
||||
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
|
||||
|
||||
# AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# -----------------------------
|
||||
# This macro should only be invoked once -- use via AC_REQUIRE.
|
||||
#
|
||||
# This code is only required when automatic dependency tracking
|
||||
# is enabled. FIXME. This creates each `.P' file that we will
|
||||
# need in order to bootstrap the dependency handling code.
|
||||
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AC_CONFIG_COMMANDS([depfiles],
|
||||
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
|
||||
])
|
||||
|
||||
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 8
|
||||
|
||||
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
|
||||
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
|
||||
|
||||
# Do all the work for Automake. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 12
|
||||
|
||||
# This macro actually does too much. Some checks are only needed if
|
||||
# your package does certain things. But this isn't really a big deal.
|
||||
|
||||
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
|
||||
# AM_INIT_AUTOMAKE([OPTIONS])
|
||||
# -----------------------------------------------
|
||||
# The call with PACKAGE and VERSION arguments is the old style
|
||||
# call (pre autoconf-2.50), which is being phased out. PACKAGE
|
||||
# and VERSION should now be passed to AC_INIT and removed from
|
||||
# the call to AM_INIT_AUTOMAKE.
|
||||
# We support both call styles for the transition. After
|
||||
# the next Automake release, Autoconf can make the AC_INIT
|
||||
# arguments mandatory, and then we can depend on a new Autoconf
|
||||
# release and drop the old call support.
|
||||
AC_DEFUN([AM_INIT_AUTOMAKE],
|
||||
[AC_PREREQ([2.58])dnl
|
||||
dnl Autoconf wants to disallow AM_ names. We explicitly allow
|
||||
dnl the ones we care about.
|
||||
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
|
||||
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
|
||||
AC_REQUIRE([AC_PROG_INSTALL])dnl
|
||||
# test to see if srcdir already configured
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`" &&
|
||||
test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
|
||||
# test whether we have cygpath
|
||||
if test -z "$CYGPATH_W"; then
|
||||
if (cygpath --version) >/dev/null 2>/dev/null; then
|
||||
CYGPATH_W='cygpath -w'
|
||||
else
|
||||
CYGPATH_W=echo
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([CYGPATH_W])
|
||||
|
||||
# Define the identity of the package.
|
||||
dnl Distinguish between old-style and new-style calls.
|
||||
m4_ifval([$2],
|
||||
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
|
||||
AC_SUBST([PACKAGE], [$1])dnl
|
||||
AC_SUBST([VERSION], [$2])],
|
||||
[_AM_SET_OPTIONS([$1])dnl
|
||||
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
|
||||
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
|
||||
|
||||
_AM_IF_OPTION([no-define],,
|
||||
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
|
||||
|
||||
# Some tools Automake needs.
|
||||
AC_REQUIRE([AM_SANITY_CHECK])dnl
|
||||
AC_REQUIRE([AC_ARG_PROGRAM])dnl
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo)
|
||||
AM_PROG_INSTALL_SH
|
||||
AM_PROG_INSTALL_STRIP
|
||||
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
|
||||
# We need awk for the "check" target. The system "awk" is bad on
|
||||
# some platforms.
|
||||
AC_REQUIRE([AC_PROG_AWK])dnl
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
||||
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
|
||||
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
|
||||
[_AM_PROG_TAR([v7])])])
|
||||
_AM_IF_OPTION([no-dependencies],,
|
||||
[AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||
[_AM_DEPENDENCIES(CC)],
|
||||
[define([AC_PROG_CC],
|
||||
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[_AM_DEPENDENCIES(CXX)],
|
||||
[define([AC_PROG_CXX],
|
||||
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
# When config.status generates a header, we must update the stamp-h file.
|
||||
# This file resides in the same directory as the config header
|
||||
# that is generated. The stamp files are numbered to have different names.
|
||||
|
||||
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
|
||||
# loop where config.status creates the headers, so we can generate
|
||||
# our stamp files there.
|
||||
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
|
||||
[# Compute $1's index in $config_headers.
|
||||
_am_stamp_count=1
|
||||
for _am_header in $config_headers :; do
|
||||
case $_am_header in
|
||||
$1 | $1:* )
|
||||
break ;;
|
||||
* )
|
||||
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
|
||||
esac
|
||||
done
|
||||
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_INSTALL_SH
|
||||
# ------------------
|
||||
# Define $install_sh.
|
||||
AC_DEFUN([AM_PROG_INSTALL_SH],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
install_sh=${install_sh-"$am_aux_dir/install-sh"}
|
||||
AC_SUBST(install_sh)])
|
||||
|
||||
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
|
||||
# Check whether the underlying file-system supports filenames
|
||||
# with a leading dot. For instance MS-DOS doesn't.
|
||||
AC_DEFUN([AM_SET_LEADING_DOT],
|
||||
[rm -rf .tst 2>/dev/null
|
||||
mkdir .tst 2>/dev/null
|
||||
if test -d .tst; then
|
||||
am__leading_dot=.
|
||||
else
|
||||
am__leading_dot=_
|
||||
fi
|
||||
rmdir .tst 2>/dev/null
|
||||
AC_SUBST([am__leading_dot])])
|
||||
|
||||
# Check to see how 'make' treats includes. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 3
|
||||
|
||||
# AM_MAKE_INCLUDE()
|
||||
# -----------------
|
||||
# Check to see how make treats includes.
|
||||
AC_DEFUN([AM_MAKE_INCLUDE],
|
||||
[am_make=${MAKE-make}
|
||||
cat > confinc << 'END'
|
||||
am__doit:
|
||||
@echo done
|
||||
.PHONY: am__doit
|
||||
END
|
||||
# If we don't find an include directive, just comment out the code.
|
||||
AC_MSG_CHECKING([for style of include used by $am_make])
|
||||
am__include="#"
|
||||
am__quote=
|
||||
_am_result=none
|
||||
# First try GNU make style include.
|
||||
echo "include confinc" > confmf
|
||||
# We grep out `Entering directory' and `Leaving directory'
|
||||
# messages which can occur if `w' ends up in MAKEFLAGS.
|
||||
# In particular we don't look at `^make:' because GNU make might
|
||||
# be invoked under some other name (usually "gmake"), in which
|
||||
# case it prints its new name instead of `make'.
|
||||
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
|
||||
am__include=include
|
||||
am__quote=
|
||||
_am_result=GNU
|
||||
fi
|
||||
# Now try BSD make style include.
|
||||
if test "$am__include" = "#"; then
|
||||
echo '.include "confinc"' > confmf
|
||||
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
|
||||
am__include=.include
|
||||
am__quote="\""
|
||||
_am_result=BSD
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([am__include])
|
||||
AC_SUBST([am__quote])
|
||||
AC_MSG_RESULT([$_am_result])
|
||||
rm -f confinc confmf
|
||||
])
|
||||
|
||||
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 4
|
||||
|
||||
# AM_MISSING_PROG(NAME, PROGRAM)
|
||||
# ------------------------------
|
||||
AC_DEFUN([AM_MISSING_PROG],
|
||||
[AC_REQUIRE([AM_MISSING_HAS_RUN])
|
||||
$1=${$1-"${am_missing_run}$2"}
|
||||
AC_SUBST($1)])
|
||||
|
||||
|
||||
# AM_MISSING_HAS_RUN
|
||||
# ------------------
|
||||
# Define MISSING if not defined so far and test if it supports --run.
|
||||
# If it does, set am_missing_run to use it, otherwise, to nothing.
|
||||
AC_DEFUN([AM_MISSING_HAS_RUN],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# Use eval to expand $SHELL
|
||||
if eval "$MISSING --run true"; then
|
||||
am_missing_run="$MISSING --run "
|
||||
else
|
||||
am_missing_run=
|
||||
AC_MSG_WARN([`missing' script is too old or missing])
|
||||
fi
|
||||
])
|
||||
|
||||
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_MKDIR_P
|
||||
# ---------------
|
||||
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
|
||||
#
|
||||
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
|
||||
# created by `make install' are always world readable, even if the
|
||||
# installer happens to have an overly restrictive umask (e.g. 077).
|
||||
# This was a mistake. There are at least two reasons why we must not
|
||||
# use `-m 0755':
|
||||
# - it causes special bits like SGID to be ignored,
|
||||
# - it may be too restrictive (some setups expect 775 directories).
|
||||
#
|
||||
# Do not use -m 0755 and let people choose whatever they expect by
|
||||
# setting umask.
|
||||
#
|
||||
# We cannot accept any implementation of `mkdir' that recognizes `-p'.
|
||||
# Some implementations (such as Solaris 8's) are not thread-safe: if a
|
||||
# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
|
||||
# concurrently, both version can detect that a/ is missing, but only
|
||||
# one can create it and the other will error out. Consequently we
|
||||
# restrict ourselves to GNU make (using the --version option ensures
|
||||
# this.)
|
||||
AC_DEFUN([AM_PROG_MKDIR_P],
|
||||
[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
|
||||
# We used to keeping the `.' as first argument, in order to
|
||||
# allow $(mkdir_p) to be used without argument. As in
|
||||
# $(mkdir_p) $(somedir)
|
||||
# where $(somedir) is conditionally defined. However this is wrong
|
||||
# for two reasons:
|
||||
# 1. if the package is installed by a user who cannot write `.'
|
||||
# make install will fail,
|
||||
# 2. the above comment should most certainly read
|
||||
# $(mkdir_p) $(DESTDIR)$(somedir)
|
||||
# so it does not work when $(somedir) is undefined and
|
||||
# $(DESTDIR) is not.
|
||||
# To support the latter case, we have to write
|
||||
# test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
|
||||
# so the `.' trick is pointless.
|
||||
mkdir_p='mkdir -p --'
|
||||
else
|
||||
# On NextStep and OpenStep, the `mkdir' command does not
|
||||
# recognize any option. It will interpret all options as
|
||||
# directories to create, and then abort because `.' already
|
||||
# exists.
|
||||
for d in ./-p ./--version;
|
||||
do
|
||||
test -d $d && rmdir $d
|
||||
done
|
||||
# $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
|
||||
if test -f "$ac_aux_dir/mkinstalldirs"; then
|
||||
mkdir_p='$(mkinstalldirs)'
|
||||
else
|
||||
mkdir_p='$(install_sh) -d'
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([mkdir_p])])
|
||||
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 3
|
||||
|
||||
# _AM_MANGLE_OPTION(NAME)
|
||||
# -----------------------
|
||||
AC_DEFUN([_AM_MANGLE_OPTION],
|
||||
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
|
||||
|
||||
# _AM_SET_OPTION(NAME)
|
||||
# ------------------------------
|
||||
# Set option NAME. Presently that only means defining a flag for this option.
|
||||
AC_DEFUN([_AM_SET_OPTION],
|
||||
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
|
||||
|
||||
# _AM_SET_OPTIONS(OPTIONS)
|
||||
# ----------------------------------
|
||||
# OPTIONS is a space-separated list of Automake options.
|
||||
AC_DEFUN([_AM_SET_OPTIONS],
|
||||
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
|
||||
|
||||
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
|
||||
# -------------------------------------------
|
||||
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
||||
AC_DEFUN([_AM_IF_OPTION],
|
||||
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
|
||||
|
||||
# Check to make sure that the build environment is sane. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 4
|
||||
|
||||
# AM_SANITY_CHECK
|
||||
# ---------------
|
||||
AC_DEFUN([AM_SANITY_CHECK],
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftest.file
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
|
||||
if test "$[*]" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftest.file`
|
||||
fi
|
||||
rm -f conftest.file
|
||||
if test "$[*]" != "X $srcdir/configure conftest.file" \
|
||||
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "$[2]" = conftest.file
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_INSTALL_STRIP
|
||||
# ---------------------
|
||||
# One issue with vendor `install' (even GNU) is that you can't
|
||||
# specify the program used to strip binaries. This is especially
|
||||
# annoying in cross-compiling environments, where the build's strip
|
||||
# is unlikely to handle the host's binaries.
|
||||
# Fortunately install-sh will honor a STRIPPROG variable, so we
|
||||
# always use install-sh in `make install-strip', and initialize
|
||||
# STRIPPROG with the value of the STRIP variable (set by the user).
|
||||
AC_DEFUN([AM_PROG_INSTALL_STRIP],
|
||||
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
|
||||
# Installed binaries are usually stripped using `strip' when the user
|
||||
# run `make install-strip'. However `strip' might not be the right
|
||||
# tool to use in cross-compilation environments, therefore Automake
|
||||
# will honor the `STRIP' environment variable to overrule this program.
|
||||
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
|
||||
if test "$cross_compiling" != no; then
|
||||
AC_CHECK_TOOL([STRIP], [strip], :)
|
||||
fi
|
||||
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
|
||||
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
||||
|
||||
# Check how to create a tarball. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
|
||||
# _AM_PROG_TAR(FORMAT)
|
||||
# --------------------
|
||||
# Check how to create a tarball in format FORMAT.
|
||||
# FORMAT should be one of `v7', `ustar', or `pax'.
|
||||
#
|
||||
# Substitute a variable $(am__tar) that is a command
|
||||
# writing to stdout a FORMAT-tarball containing the directory
|
||||
# $tardir.
|
||||
# tardir=directory && $(am__tar) > result.tar
|
||||
#
|
||||
# Substitute a variable $(am__untar) that extract such
|
||||
# a tarball read from stdin.
|
||||
# $(am__untar) < result.tar
|
||||
AC_DEFUN([_AM_PROG_TAR],
|
||||
[# Always define AMTAR for backward compatibility.
|
||||
AM_MISSING_PROG([AMTAR], [tar])
|
||||
m4_if([$1], [v7],
|
||||
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
|
||||
[m4_case([$1], [ustar],, [pax],,
|
||||
[m4_fatal([Unknown tar format])])
|
||||
AC_MSG_CHECKING([how to create a $1 tar archive])
|
||||
# Loop over all known methods to create a tar archive until one works.
|
||||
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
|
||||
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
|
||||
# Do not fold the above two line into one, because Tru64 sh and
|
||||
# Solaris sh will not grok spaces in the rhs of `-'.
|
||||
for _am_tool in $_am_tools
|
||||
do
|
||||
case $_am_tool in
|
||||
gnutar)
|
||||
for _am_tar in tar gnutar gtar;
|
||||
do
|
||||
AM_RUN_LOG([$_am_tar --version]) && break
|
||||
done
|
||||
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
|
||||
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
|
||||
am__untar="$_am_tar -xf -"
|
||||
;;
|
||||
plaintar)
|
||||
# Must skip GNU tar: if it does not support --format= it doesn't create
|
||||
# ustar tarball either.
|
||||
(tar --version) >/dev/null 2>&1 && continue
|
||||
am__tar='tar chf - "$$tardir"'
|
||||
am__tar_='tar chf - "$tardir"'
|
||||
am__untar='tar xf -'
|
||||
;;
|
||||
pax)
|
||||
am__tar='pax -L -x $1 -w "$$tardir"'
|
||||
am__tar_='pax -L -x $1 -w "$tardir"'
|
||||
am__untar='pax -r'
|
||||
;;
|
||||
cpio)
|
||||
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
|
||||
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
|
||||
am__untar='cpio -i -H $1 -d'
|
||||
;;
|
||||
none)
|
||||
am__tar=false
|
||||
am__tar_=false
|
||||
am__untar=false
|
||||
;;
|
||||
esac
|
||||
|
||||
# If the value was cached, stop now. We just wanted to have am__tar
|
||||
# and am__untar set.
|
||||
test -n "${am_cv_prog_tar_$1}" && break
|
||||
|
||||
# tar/untar a dummy directory, and stop if the command works
|
||||
rm -rf conftest.dir
|
||||
mkdir conftest.dir
|
||||
echo GrepMe > conftest.dir/file
|
||||
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
|
||||
rm -rf conftest.dir
|
||||
if test -s conftest.tar; then
|
||||
AM_RUN_LOG([$am__untar <conftest.tar])
|
||||
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
|
||||
fi
|
||||
done
|
||||
rm -rf conftest.dir
|
||||
|
||||
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
|
||||
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
|
||||
AC_SUBST([am__tar])
|
||||
AC_SUBST([am__untar])
|
||||
]) # _AM_PROG_TAR
|
||||
|
||||
m4_include([acinclude.m4])
|
@ -0,0 +1,237 @@
|
||||
/* config.h.in. Generated from configure.in by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <Carbon/Carbon.h> header file. */
|
||||
#undef HAVE_CARBON_CARBON_H
|
||||
|
||||
/* Define if you have the CoreAudio API */
|
||||
#undef HAVE_COREAUDIO
|
||||
|
||||
/* Define to 1 if you have the <crt_externs.h> header file. */
|
||||
#undef HAVE_CRT_EXTERNS_H
|
||||
|
||||
/* Defines if your system has the crypt function */
|
||||
#undef HAVE_CRYPT
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define if you have libjpeg */
|
||||
#undef HAVE_LIBJPEG
|
||||
|
||||
/* Define if you have libpng */
|
||||
#undef HAVE_LIBPNG
|
||||
|
||||
/* Define if you have a working libpthread (will enable threaded code) */
|
||||
#undef HAVE_LIBPTHREAD
|
||||
|
||||
/* Define if you have libz */
|
||||
#undef HAVE_LIBZ
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define if your system needs _NSGetEnviron to set up the environment */
|
||||
#undef HAVE_NSGETENVIRON
|
||||
|
||||
/* Define if you have res_init */
|
||||
#undef HAVE_RES_INIT
|
||||
|
||||
/* Define if you have the res_init prototype */
|
||||
#undef HAVE_RES_INIT_PROTO
|
||||
|
||||
/* Define if you have a STL implementation by SGI */
|
||||
#undef HAVE_SGI_STL
|
||||
|
||||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#undef HAVE_SNPRINTF
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define if you have strlcat */
|
||||
#undef HAVE_STRLCAT
|
||||
|
||||
/* Define if you have the strlcat prototype */
|
||||
#undef HAVE_STRLCAT_PROTO
|
||||
|
||||
/* Define if you have strlcpy */
|
||||
#undef HAVE_STRLCPY
|
||||
|
||||
/* Define if you have the strlcpy prototype */
|
||||
#undef HAVE_STRLCPY_PROTO
|
||||
|
||||
/* Define to 1 if you have the <sys/bitypes.h> header file. */
|
||||
#undef HAVE_SYS_BITYPES_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if you have the `vsnprintf' function. */
|
||||
#undef HAVE_VSNPRINTF
|
||||
|
||||
/* Suffix for lib directories */
|
||||
#undef KDELIBSUFF
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* The size of `char *', as computed by sizeof. */
|
||||
#undef SIZEOF_CHAR_P
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#undef SIZEOF_INT
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG
|
||||
|
||||
/* The size of `short', as computed by sizeof. */
|
||||
#undef SIZEOF_SHORT
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#undef SIZEOF_SIZE_T
|
||||
|
||||
/* The size of `unsigned long', as computed by sizeof. */
|
||||
#undef SIZEOF_UNSIGNED_LONG
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Defined if compiling without arts */
|
||||
#undef WITHOUT_ARTS
|
||||
|
||||
/*
|
||||
* jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
|
||||
* headers and I'm too lazy to write a configure test as long as only
|
||||
* unixware is related
|
||||
*/
|
||||
#ifdef _UNIXWARE
|
||||
#define HAVE_BOOLEAN
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
|
||||
* that defines bzero.
|
||||
*/
|
||||
|
||||
#if defined(_AIX)
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
|
||||
# include <sys/time.h>
|
||||
# include <crt_externs.h>
|
||||
# define environ (*_NSGetEnviron())
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if !defined(HAVE_RES_INIT_PROTO)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
int res_init(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if !defined(HAVE_STRLCAT_PROTO)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
unsigned long strlcat(char*, const char*, unsigned long);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if !defined(HAVE_STRLCPY_PROTO)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
unsigned long strlcpy(char*, const char*, unsigned long);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* On HP-UX, the declaration of vsnprintf() is needed every time !
|
||||
*/
|
||||
|
||||
#if !defined(HAVE_VSNPRINTF) || defined(hpux)
|
||||
#if __STDC__
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
int snprintf(char *str, size_t n, char const *fmt, ...);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined(__SVR4) && !defined(__svr4__)
|
||||
#define __svr4__ 1
|
||||
#endif
|
||||
|
||||
|
||||
/* type to use in place of socklen_t if not defined */
|
||||
#undef kde_socklen_t
|
||||
|
||||
/* type to use in place of socklen_t if not defined (deprecated, use
|
||||
kde_socklen_t) */
|
||||
#undef ksize_t
|
@ -0,0 +1,2 @@
|
||||
./admin/configure.in.min
|
||||
configure.in.in
|
@ -0,0 +1,136 @@
|
||||
dnl =======================================================
|
||||
dnl FILE: ./admin/configure.in.min
|
||||
dnl =======================================================
|
||||
|
||||
dnl This file is part of the KDE libraries/packages
|
||||
dnl Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
|
||||
|
||||
dnl This file is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Library General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2 of the License, or (at your option) any later version.
|
||||
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Library General Public License for more details.
|
||||
|
||||
dnl You should have received a copy of the GNU Library General Public License
|
||||
dnl along with this library; see the file COPYING.LIB. If not, write to
|
||||
dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
dnl Boston, MA 02110-1301, USA.
|
||||
|
||||
# Original Author was Kalle@kde.org
|
||||
# I lifted it in some mater. (Stephan Kulow)
|
||||
# I used much code from Janos Farkas
|
||||
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT(acinclude.m4) dnl a source file from your sub dir
|
||||
|
||||
dnl This is so we can use kde-common
|
||||
AC_CONFIG_AUX_DIR(admin)
|
||||
|
||||
dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
|
||||
unset CDPATH
|
||||
|
||||
dnl Checking host/target/build systems, for make, install etc.
|
||||
AC_CANONICAL_SYSTEM
|
||||
dnl Perform program name transformation
|
||||
AC_ARG_PROGRAM
|
||||
|
||||
dnl Automake doc recommends to do this only here. (Janos)
|
||||
AM_INIT_AUTOMAKE(kshutdown, 1.0.4) dnl searches for some needed programs
|
||||
|
||||
KDE_SET_PREFIX
|
||||
|
||||
dnl generate the config header
|
||||
AM_CONFIG_HEADER(config.h) dnl at the distribution this done
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_CHECK_COMPILERS
|
||||
AC_ENABLE_SHARED(yes)
|
||||
AC_ENABLE_STATIC(no)
|
||||
KDE_PROG_LIBTOOL
|
||||
|
||||
dnl for NLS support. Call them in this order!
|
||||
dnl WITH_NLS is for the po files
|
||||
AM_KDE_WITH_NLS
|
||||
|
||||
KDE_USE_QT(3)
|
||||
AC_PATH_KDE
|
||||
dnl =======================================================
|
||||
dnl FILE: configure.in.in
|
||||
dnl =======================================================
|
||||
|
||||
#MIN_CONFIG(3)
|
||||
|
||||
dnl PACKAGE set before
|
||||
|
||||
dnl CXXFLAGS="$NOOPT_CXXFLAGS" dnl __kdevelop[noopt]__
|
||||
dnl CFLAGS="$NOOPT_CFLAGS" dnl __kdevelop[noopt]__
|
||||
dnl CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS" dnl __kdevelop[exc]__
|
||||
|
||||
dnl KDE_NEED_FLEX dnl __kdevelop__
|
||||
dnl AC_PROG_YACC dnl __kdevelop__
|
||||
KDE_CREATE_SUBDIRSLIST
|
||||
AC_CONFIG_FILES([ Makefile ])
|
||||
AC_CONFIG_FILES([ doc/Makefile ])
|
||||
AC_CONFIG_FILES([ doc/de/Makefile ])
|
||||
AC_CONFIG_FILES([ doc/kshutdown/Makefile ])
|
||||
AC_CONFIG_FILES([ extras/Makefile ])
|
||||
AC_CONFIG_FILES([ extras/multimedia/Makefile ])
|
||||
AC_CONFIG_FILES([ extras/shutdown/Makefile ])
|
||||
AC_CONFIG_FILES([ extras/system/Makefile ])
|
||||
AC_CONFIG_FILES([ karamba/Makefile ])
|
||||
AC_CONFIG_FILES([ kshutdown/Makefile ])
|
||||
AC_CONFIG_FILES([ kshutdownlockout/Makefile ])
|
||||
AC_CONFIG_FILES([ pics/Makefile ])
|
||||
AC_CONFIG_FILES([ po/Makefile ])
|
||||
AC_CONFIG_FILES([ sounds/Makefile ])
|
||||
AC_OUTPUT
|
||||
# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
|
||||
if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
|
||||
# And if so, warn when they don't match
|
||||
if test "$kde_libs_prefix" != "$given_prefix"; then
|
||||
# And if kde doesn't know about the prefix yet
|
||||
echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
|
||||
if test $? -ne 0; then
|
||||
echo ""
|
||||
echo "Warning: you chose to install this package in $given_prefix,"
|
||||
echo "but KDE was found in $kde_libs_prefix."
|
||||
echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
|
||||
echo "that KDEDIRS contains it, e.g. export KDEDIRS=$given_prefix:$kde_libs_prefix"
|
||||
echo "Then restart KDE."
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$GXX = "xyes" -a x$kde_have_gcc_visibility = "xyes" -a x$kde_cv_val_qt_gcc_visibility_patched = "xno"; then
|
||||
echo ""
|
||||
echo "Your GCC supports symbol visibility, but the patch for Qt supporting visibility"
|
||||
echo "was not included. Therefore, GCC symbol visibility support remains disabled."
|
||||
echo ""
|
||||
echo "For better performance, consider including the Qt visibility supporting patch"
|
||||
echo "located at:"
|
||||
echo ""
|
||||
echo "http://bugs.kde.org/show_bug.cgi?id=109386"
|
||||
echo ""
|
||||
echo "and recompile all of Qt and KDE. Note, this is entirely optional and"
|
||||
echo "everything will continue to work just fine without it."
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if test "$all_tests" = "bad"; then
|
||||
if test ! "$cache_file" = "/dev/null"; then
|
||||
echo ""
|
||||
echo "Please remove the file $cache_file after changing your setup"
|
||||
echo "so that configure will find the changes next time."
|
||||
echo ""
|
||||
fi
|
||||
else
|
||||
echo ""
|
||||
echo "Good - your configure finished. Start make now"
|
||||
echo ""
|
||||
fi
|
@ -0,0 +1,10 @@
|
||||
#MIN_CONFIG(3)
|
||||
|
||||
AM_INIT_AUTOMAKE(kshutdown,1.0.4)
|
||||
|
||||
dnl CXXFLAGS="$NOOPT_CXXFLAGS" dnl __kdevelop[noopt]__
|
||||
dnl CFLAGS="$NOOPT_CFLAGS" dnl __kdevelop[noopt]__
|
||||
dnl CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS" dnl __kdevelop[exc]__
|
||||
|
||||
dnl KDE_NEED_FLEX dnl __kdevelop__
|
||||
dnl AC_PROG_YACC dnl __kdevelop__
|
@ -0,0 +1 @@
|
||||
SUBDIRS = $(AUTODIRS)
|
@ -0,0 +1,2 @@
|
||||
KDE_DOCS = kshutdown
|
||||
KDE_LANG = de
|
@ -0,0 +1,269 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
|
||||
<!ENTITY kmyapplication "<application>KShutDown</application>">
|
||||
<!ENTITY kappname "&kmyapplication;">
|
||||
<!ENTITY package "kde-module">
|
||||
<!ENTITY % addindex "IGNORE">
|
||||
<!ENTITY % German "INCLUDE">
|
||||
]>
|
||||
|
||||
<book lang="&language;">
|
||||
|
||||
<bookinfo>
|
||||
<title>Das &kmyapplication; Handbuch</title>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<personname>
|
||||
<firstname>Konrad</firstname>
|
||||
<surname>Twardowski</surname>
|
||||
</personname>
|
||||
<email>kdtonline@poczta.onet.pl</email>
|
||||
</author>
|
||||
</authorgroup>
|
||||
<copyright>
|
||||
<year>2005</year>
|
||||
<holder>Konrad Twardowski</holder>
|
||||
</copyright>
|
||||
<legalnotice>&FDLNotice;</legalnotice>
|
||||
<date>2005-11-24</date>
|
||||
<releaseinfo>1.08.00</releaseinfo><!-- sync. with KShutDown version -->
|
||||
<abstract>
|
||||
<para>&kmyapplication; ist ein Programm zum erweiterten Herunterfahren in &kde;.</para>
|
||||
</abstract>
|
||||
<keywordset>
|
||||
<keyword>KDE</keyword>
|
||||
<keyword>kshutdown</keyword>
|
||||
<keyword>shutdown</keyword>
|
||||
<keyword>shut</keyword>
|
||||
<keyword>down</keyword>
|
||||
<keyword>poweroff</keyword>
|
||||
<keyword>reboot</keyword>
|
||||
<keyword>lock</keyword>
|
||||
<keyword>halt</keyword>
|
||||
<keyword>exit</keyword>
|
||||
<keyword>logout</keyword>
|
||||
</keywordset>
|
||||
</bookinfo>
|
||||
|
||||
<chapter id="introduction">
|
||||
<title>Einführung</title>
|
||||
<para>&kmyapplication; ist ein Programm zum erweiterten Herunterfahren in &kde;.</para>
|
||||
<para>
|
||||
Fähigkeiten:
|
||||
<itemizedlist>
|
||||
<listitem><para>Computer abschalten (ausloggen und anhalten des Systems)</para></listitem>
|
||||
<listitem><para>Computer Neustart (ausloggen und neu booten des Systems)</para></listitem>
|
||||
<listitem><para>Sitzung sperren (sperrt den Bildschirm mit dem Bildschirmschoner)</para></listitem>
|
||||
<listitem><para>Beendet aktive Sitzung (Beendet die aktive Sitzung in &kde; und loggt den Benutzer aus)</para></listitem>
|
||||
<listitem><para>Extras (zusätzliche, Benutzereingaben)</para></listitem>
|
||||
<listitem><para>Zeit und Verzögerungsoptionen</para></listitem>
|
||||
<listitem><para><link linkend="command-line">Kommandozeilen-</link> und <link linkend="dcop">DCOP-</link> Unterstützung</para></listitem>
|
||||
<listitem><para><link linkend="using-systray">System tray</link></para></listitem>
|
||||
<listitem><para>Visuelle und Klangbenachrichtigungen</para></listitem>
|
||||
<listitem><para><link linkend="kiosk">&kde; Kiosk Unterstützung</link></para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</chapter><!-- introduction -->
|
||||
|
||||
<chapter id="using-kapp">
|
||||
<title>Benutzen von &kmyapplication;</title>
|
||||
<sect1 id="using-mainwindow">
|
||||
<title>Hauptfenster</title>
|
||||
<itemizedlist>
|
||||
<listitem><para>Benutzen Sie das erste Aufklappmenü um eine Aktion auszuwählen (Computer ausschalten, Extras, usw).</para></listitem>
|
||||
<listitem><para>Benutzen Sie das zweite Aufklappmenü um die Verzögerung einzustellen (Keine, Zeit ab jetzt, usw).</para></listitem>
|
||||
<listitem><para>Klicken Sie den <guibutton>Start</guibutton> Knopf um eine ausgewählte Aktion zu aktivieren. Die Aktion wird zur angegebenen Zeit gestartet.</para></listitem>
|
||||
<listitem><para>Klicken Sie den <guibutton>Stop</guibutton> Knopf oder die <keycap>Esc</keycap> Taste um die Aktion zu stoppen.</para></listitem>
|
||||
</itemizedlist>
|
||||
<screenshot>
|
||||
<screeninfo>&kmyapplication; Hauptfenster</screeninfo>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="mainwindow.png" format="PNG"/>
|
||||
</imageobject>
|
||||
<textobject>
|
||||
<phrase>Hauptfenster</phrase>
|
||||
</textobject>
|
||||
</mediaobject>
|
||||
</screenshot>
|
||||
</sect1>
|
||||
<sect1 id="using-systray">
|
||||
<title>System Tray</title>
|
||||
<itemizedlist>
|
||||
<listitem><para>Linker Mausknopf - versteckt/zeigt Hauptfenster</para></listitem>
|
||||
<listitem><para>Mittlerer Mausknopf - zeigt das Menü mit den Aktionen (Keine Verzögerung!)</para></listitem>
|
||||
<listitem><para>Rechter Mausknopf - Zeigt das Kontextmenü</para></listitem>
|
||||
</itemizedlist>
|
||||
</sect1>
|
||||
</chapter><!-- using-kapp -->
|
||||
|
||||
<chapter id="command-line">
|
||||
<title>Kommandozeile</title>
|
||||
<!-- copied from the kshutdown command line help -->
|
||||
<programlisting>
|
||||
Anmerkung: Die Optionen werden in Englisch angezeigt!
|
||||
Auf der Kommandozeile kshutdown mit den gewünschten Optionen, ohne Klammern, angeben.
|
||||
|
||||
Benutzung: kshutdown [Qt-options] [KDE-options] [options] [time]
|
||||
|
||||
A Shut Down Utility for KDE
|
||||
|
||||
Generic options:
|
||||
--help Show help about options Hilfe Optionen
|
||||
--help-qt Show Qt specific options QT-spezifische Optionen
|
||||
--help-kde Show KDE specific options KDE-spezifische Optionen
|
||||
--help-all Show all options Alle Optionen
|
||||
--author Show author information Informationen über den Author
|
||||
-v, --version Show version information Versionsinformationen
|
||||
--license Show license information Lizenzinformationen
|
||||
-- End of options Ende der Optionen
|
||||
|
||||
Options:
|
||||
-s, --shutdown Turn off computer Computer abschalten
|
||||
-h, --halt Turn off computer " "
|
||||
-r, --reboot Restart computer Computer neu starten
|
||||
-k, --lock Lock session Sitzung sperren
|
||||
-l, --logout End current session Sitzung beenden
|
||||
--confirm Confirm command line action Bestätigung für Kommandozeilen Aktionen
|
||||
--standard Show standard logout dialog Zeigt Standard Abmelden Dialog
|
||||
-c, --cancel Cancel an active action Bricht eine aktive Aktion ab
|
||||
--init Don't show window at startup Zeigt kein Fenster beim Start
|
||||
--test Enable test mode Aktiviert Testmodus
|
||||
--default Disable test mode Deaktiviert Testmodus
|
||||
|
||||
Arguments:
|
||||
time Time; Examples: 01:30 - absolute time (HH:MM); 10 - number of minutes to wait from now
|
||||
</programlisting>
|
||||
</chapter><!-- command-line -->
|
||||
|
||||
<chapter id="kiosk">
|
||||
<title>Kiosk</title>
|
||||
<para>
|
||||
&kde; Kiosk erlaubt Ihnen die Kontrolle über sämtliche kritische Funktionen, wie zum Beispiel <guibutton>Computer Ausschalten</guibutton> oder <guibutton>Computer neu starten</guibutton>. Wollen Sie diese Restriktionen einschalten, können Sie eine globale Konfigurationsdatei namens <filename>kshutdownrc</filename> im allgemeinen &kde; Verzeichnis anlegen. Dieses liegt in (<filename>[prefix]/share/config</filename>).
|
||||
</para>
|
||||
<note>
|
||||
<para>In den meisten Fällen müssen Sie &kmyapplication; neu starten damit die neuen Einstellungen übernommen werden.</para>
|
||||
</note>
|
||||
<note>
|
||||
<para>Seit Version 0.3.1 Beta ist allen Schlüsseln eine "kshutdown_" Zeichenkette vorangestellt.</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>Beispiel kshutdownrc Datei mit den Einschränkungen</title>
|
||||
<programlisting>
|
||||
[KDE Aktionseinschränkungen][$i]
|
||||
# [$i] - Benutzer kann Gruppe nicht Überschreiben
|
||||
# false - Feature deaktiviert
|
||||
# true - Feature aktiviert
|
||||
# Standard ist angeschaltet
|
||||
Mit "false" verbieten, mit "true" erlauben.
|
||||
|
||||
# Deaktiviert die Aktion "Computer ausschalten"
|
||||
kshutdown_action_shutdown=false
|
||||
# kshutdown_action_shutdown=true <- "true" aktiviert diese Aktion
|
||||
|
||||
# Computer neu starten
|
||||
kshutdown_action_reboot=true
|
||||
|
||||
# Bilschirm sperren
|
||||
kshutdown_action_lockscreen=true
|
||||
|
||||
# Sitzung beenden
|
||||
kshutdown_action_logout=true
|
||||
|
||||
# "Extras" Aktionen
|
||||
kshutdown_action_extras=true
|
||||
|
||||
# Deaktiviert die Aktionen Seite in den Einstellungen
|
||||
kshutdown_settings_actions=true
|
||||
|
||||
# Deaktiviert "Zeit auswählen" Aufklappmenü und das Kommandozeilenargument dazu
|
||||
# and the command line "time" argument
|
||||
kshutdown_tab_time=true
|
||||
|
||||
# Deaktiviert den Statistik Dialog
|
||||
kshutdown_tab_stats=true
|
||||
</programlisting>
|
||||
</example>
|
||||
</chapter><!-- kiosk -->
|
||||
|
||||
<chapter id="dcop">
|
||||
<title>DCOP API (KShutdownIface)</title>
|
||||
<sect1 id="dcop-intro">
|
||||
<title>Einführung</title>
|
||||
<orderedlist>
|
||||
<listitem><para>Achten Sie darauf das &kmyapplication; gestartet ist.</para></listitem>
|
||||
<listitem><para>Tippen Sie <command>kshutdown --init</command> zum Starten von &kmyapplication; ohne Hauptfenster.</para></listitem>
|
||||
<listitem><para>Zum Auflisten aller DCOP Functionen, tippen Sie <command>dcop kshutdown KShutdownIface</command>.</para></listitem>
|
||||
<listitem><para>Mit <command>dcop kshutdown MMainWindow hide</command> verstecken Sie das Hauptfenster.</para></listitem>
|
||||
<listitem><para>Mit <command>dcop kshutdown MMainWindow show</command> machen Sie das Hauptfenster wieder sichtbar.</para></listitem>
|
||||
</orderedlist>
|
||||
</sect1>
|
||||
<sect1 id="dcop-func">
|
||||
<title>Funktionen</title>
|
||||
<sect2 id="dcop-func-cancel">
|
||||
<title>ASYNC cancel()</title>
|
||||
<para>Stoppt eine aktive Aktion.</para>
|
||||
</sect2>
|
||||
<sect2 id="dcop-func-shutdown">
|
||||
<title>bool shutDown(), bool shutdown()</title>
|
||||
<para>Fährt das System herunter.</para>
|
||||
</sect2>
|
||||
<sect2 id="dcop-func-reboot">
|
||||
<title>bool reboot()</title>
|
||||
<para>Startet den Rechner neu.</para>
|
||||
</sect2>
|
||||
<sect2 id="dcop-func-lock">
|
||||
<title>bool lockScreen()</title>
|
||||
<para>Sperrt den Bildschirm.</para>
|
||||
</sect2>
|
||||
<sect2 id="dcop-func-logout">
|
||||
<title>bool logout()</title>
|
||||
<para>Beendet die Sitzung und meldet den Benutzer ab.</para>
|
||||
</sect2>
|
||||
<sect2 id="dcop-func-config">
|
||||
<title>ASYNC configure()</title>
|
||||
<para>[Seit 0.6] Zeigt den Einstellungen Dialog.</para>
|
||||
</sect2>
|
||||
<sect2 id="dcop-func-status">
|
||||
<title>QString getStatusInfo()</title>
|
||||
<para>Zeigt &kmyapplication; Status Informationen.</para>
|
||||
</sect2>
|
||||
<sect2 id="dcop-func-makevisible">
|
||||
<title>ASYNC makeVisible()</title>
|
||||
<para>[Since 0.6] Macht das Hauptfenster auf der aktuellen Arbeitsfläche sichtbar.</para>
|
||||
</sect2>
|
||||
<sect2 id="dcop-func-test">
|
||||
<title>ASYNC setTestMode(bool yes)</title>
|
||||
<para>De-/aktiviert den Testmodus.</para>
|
||||
<example>
|
||||
<title>Aktiviert Testmodus</title>
|
||||
<programlisting>dcop kshutdown KShutdownIface setTestMode true</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Deaktiviert Testmodus</title>
|
||||
<programlisting>dcop kshutdown KShutdownIface setTestMode false</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
</sect1>
|
||||
</chapter><!-- dcop -->
|
||||
|
||||
<chapter id="credits">
|
||||
<title>Danksagung und Lizenz</title>
|
||||
<para>&kmyapplication;</para>
|
||||
<para>
|
||||
Program Copyright 2005 Konrad Twardowski
|
||||
<email>kdtonline@poczta.onet.pl</email>
|
||||
</para>
|
||||
<para>
|
||||
Documentation Copyright © 2005 Konrad Twardowski
|
||||
<email>kdtonline@poczta.onet.pl</email>
|
||||
</para>
|
||||
<para>Czech FAQ Copyright © Robert Kratky</para>
|
||||
<para>Siehe <guimenuitem>Hilfe | Über &kmyapplication;</guimenuitem> für mehr Informationen.</para>
|
||||
&underFDL;<!-- FDL: do not remove -->
|
||||
&underGPL;<!-- GPL License -->
|
||||
</chapter><!-- credits -->
|
||||
|
||||
&documentation.index;
|
||||
|
||||
</book>
|
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,2 @@
|
||||
KDE_DOCS = kshutdown
|
||||
KDE_LANG = en
|
@ -0,0 +1,270 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
|
||||
<!ENTITY kmyapplication "<application>KShutDown</application>">
|
||||
<!ENTITY kappname "&kmyapplication;">
|
||||
<!ENTITY package "kde-module">
|
||||
<!ENTITY % addindex "IGNORE">
|
||||
<!ENTITY % English "INCLUDE">
|
||||
]>
|
||||
|
||||
<book lang="&language;">
|
||||
|
||||
<bookinfo>
|
||||
<title>The &kmyapplication; Handbook</title>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<personname>
|
||||
<firstname>Konrad</firstname>
|
||||
<surname>Twardowski</surname>
|
||||
</personname>
|
||||
<email>kdtonline@poczta.onet.pl</email>
|
||||
</author>
|
||||
</authorgroup>
|
||||
<copyright>
|
||||
<year>2005</year>
|
||||
<holder>Konrad Twardowski</holder>
|
||||
</copyright>
|
||||
<legalnotice>&FDLNotice;</legalnotice>
|
||||
<date>2006-04-22</date>
|
||||
<releaseinfo>1.09.00</releaseinfo><!-- sync. with KShutDown version -->
|
||||
<abstract>
|
||||
<para>&kmyapplication; is an advanced shut down utility for &kde;.</para>
|
||||
</abstract>
|
||||
<keywordset>
|
||||
<keyword>KDE</keyword>
|
||||
<keyword>kshutdown</keyword>
|
||||
<keyword>shutdown</keyword>
|
||||
<keyword>shut</keyword>
|
||||
<keyword>down</keyword>
|
||||
<keyword>poweroff</keyword>
|
||||
<keyword>reboot</keyword>
|
||||
<keyword>lock</keyword>
|
||||
<keyword>halt</keyword>
|
||||
<keyword>exit</keyword>
|
||||
<keyword>logout</keyword>
|
||||
</keywordset>
|
||||
</bookinfo>
|
||||
|
||||
<chapter id="introduction">
|
||||
<title>Introduction</title>
|
||||
<para>&kmyapplication; is an advanced shut down utility for &kde;.</para>
|
||||
<para>
|
||||
Features:
|
||||
<itemizedlist>
|
||||
<listitem><para>Turn Off Computer (logout and halt the system)</para></listitem>
|
||||
<listitem><para>Restart Computer (logout and reboot the system)</para></listitem>
|
||||
<listitem><para>Lock Session (lock the screen using a screen saver)</para></listitem>
|
||||
<listitem><para>End Current Session (end the current &kde; session and logout the user)</para></listitem>
|
||||
<listitem><para>Extras (additional, user commands)</para></listitem>
|
||||
<listitem><para>Time and delay options</para></listitem>
|
||||
<listitem><para><link linkend="command-line">Command line</link> and <link linkend="dcop">DCOP</link> support</para></listitem>
|
||||
<listitem><para><link linkend="using-systray">System tray</link></para></listitem>
|
||||
<listitem><para>Visual and sound notifications</para></listitem>
|
||||
<listitem><para><link linkend="kiosk">&kde; Kiosk support</link></para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</chapter><!-- introduction -->
|
||||
|
||||
<chapter id="using-kapp">
|
||||
<title>Using &kmyapplication;</title>
|
||||
<sect1 id="using-mainwindow">
|
||||
<title>Main Window</title>
|
||||
<itemizedlist>
|
||||
<listitem><para>Use the first combo box to select an action (turn off computer, extras, etc).</para></listitem>
|
||||
<listitem><para>Use the second combo box to select a delay type (no delay, time from now, etc).</para></listitem>
|
||||
<listitem><para>Click the <guibutton>Start</guibutton> button to activate the selected action. The action will be executed at the selected time.</para></listitem>
|
||||
<listitem><para>Click the <guibutton>Stop</guibutton> button or press <keycap>Esc</keycap> key to cancel an active action.</para></listitem>
|
||||
</itemizedlist>
|
||||
<screenshot>
|
||||
<screeninfo>&kmyapplication; main window</screeninfo>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="mainwindow.png" format="PNG"/>
|
||||
</imageobject>
|
||||
<textobject>
|
||||
<phrase>Main window</phrase>
|
||||
</textobject>
|
||||
</mediaobject>
|
||||
</screenshot>
|
||||
</sect1>
|
||||
<sect1 id="using-systray">
|
||||
<title>System Tray</title>
|
||||
<itemizedlist>
|
||||
<listitem><para>Left mouse button - hide/show main window</para></listitem>
|
||||
<listitem><para>Middle mouse button - show menu with Actions (no delay!)</para></listitem>
|
||||
<listitem><para>Right mouse button - show context menu</para></listitem>
|
||||
</itemizedlist>
|
||||
</sect1>
|
||||
</chapter><!-- using-kapp -->
|
||||
|
||||
<chapter id="command-line">
|
||||
<title>Command Line</title>
|
||||
<!-- copied from the kshutdown command line help -->
|
||||
<programlisting>
|
||||
Usage: kshutdown [Qt-options] [KDE-options] [options] [time]
|
||||
|
||||
A Shut Down Utility for KDE
|
||||
|
||||
Generic options:
|
||||
--help Show help about options
|
||||
--help-qt Show Qt specific options
|
||||
--help-kde Show KDE specific options
|
||||
--help-all Show all options
|
||||
--author Show author information
|
||||
-v, --version Show version information
|
||||
--license Show license information
|
||||
-- End of options
|
||||
|
||||
Options:
|
||||
-s, --shutdown Turn off computer
|
||||
-h, --halt Turn off computer
|
||||
-r, --reboot Restart computer
|
||||
-k, --lock Lock session
|
||||
-l, --logout End current session
|
||||
-e, --extra <file> Execute "Extras" command (.desktop file)
|
||||
--confirm Confirm command line action
|
||||
--standard Show standard logout dialog
|
||||
-c, --cancel Cancel an active action
|
||||
--init Don't show window at startup
|
||||
--test Enable test mode
|
||||
--default Disable test mode
|
||||
|
||||
Arguments:
|
||||
time Time; Examples: 01:30 - absolute time (HH:MM); 10 - number of minutes to wait from now
|
||||
</programlisting>
|
||||
</chapter><!-- command-line -->
|
||||
|
||||
<chapter id="kiosk">
|
||||
<title>Kiosk</title>
|
||||
<para>
|
||||
&kde; Kiosk allows you to control some critical features, such as <guibutton>Turn Off Computer</guibutton> or <guibutton>Restart Computer</guibutton> commands. To enable restrictions, you need to create a global configuration file - <filename>kshutdownrc</filename> in your global &kde; directory (<filename>[prefix]/share/config</filename>).
|
||||
</para>
|
||||
<note>
|
||||
<para>In some cases you need to restart &kmyapplication; to see effects.</para>
|
||||
</note>
|
||||
<note>
|
||||
<para>Since version 0.3.1 Beta all Kiosk keys are prefixed with a "kshutdown_" string.</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>Example kshutdownrc file with restrictions</title>
|
||||
<programlisting>
|
||||
[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 the "Turn Off Computer" action
|
||||
kshutdown_action_shutdown=true
|
||||
# kshutdown_action_shutdown=false <- "false" will disable "Shut Down" action
|
||||
|
||||
# Disables the "Restart Computer" action
|
||||
kshutdown_action_reboot=true
|
||||
|
||||
# Disables the "Lock Session" action
|
||||
kshutdown_action_lockscreen=true
|
||||
|
||||
# Disables the "End Current Session" action
|
||||
kshutdown_action_logout=true
|
||||
|
||||
# Disables the "Extras" action
|
||||
kshutdown_action_extras=true
|
||||
|
||||
# Disables the "Actions" page in the "Settings" dialog
|
||||
kshutdown_settings_actions=true
|
||||
|
||||
# Disables the "Select a time" combo box,
|
||||
# and the command line "time" argument
|
||||
kshutdown_tab_time=true
|
||||
|
||||
# Disables the "Statistics" dialog
|
||||
kshutdown_tab_stats=true
|
||||
</programlisting>
|
||||
</example>
|
||||
</chapter><!-- kiosk -->
|
||||
|
||||
<chapter id="dcop">
|
||||
<title>DCOP API (KShutdownIface)</title>
|
||||
<sect1 id="dcop-intro">
|
||||
<title>Introduction</title>
|
||||
<orderedlist>
|
||||
<listitem><para>Make sure &kmyapplication; is running.</para></listitem>
|
||||
<listitem><para>Type <command>kshutdown --init</command> to start &kmyapplication; without displaying its main window.</para></listitem>
|
||||
<listitem><para>To display all DCOP functions, type <command>dcop kshutdown KShutdownIface</command>.</para></listitem>
|
||||
<listitem><para>Run <command>dcop kshutdown MMainWindow hide</command> to hide the main window.</para></listitem>
|
||||
<listitem><para>Run <command>dcop kshutdown MMainWindow show</command> to restore the main window.</para></listitem>
|
||||
</orderedlist>
|
||||
</sect1>
|
||||
<sect1 id="dcop-func">
|
||||
<title>Functions</title>
|
||||
<sect2 id="dcop-func-cancel">
|
||||
<title>ASYNC cancel()</title>
|
||||
<para>Cancels the active action.</para>
|
||||
</sect2>
|
||||
<sect2 id="dcop-func-shutdown">
|
||||
<title>bool shutDown(), bool shutdown()</title>
|
||||
<para>Shuts down the system.</para>
|
||||
</sect2>
|
||||
<sect2 id="dcop-func-reboot">
|
||||
<title>bool reboot()</title>
|
||||
<para>Reboots the system.</para>
|
||||
</sect2>
|
||||
<sect2 id="dcop-func-lock">
|
||||
<title>bool lockScreen()</title>
|
||||
<para>Locks the screen using a screen saver.</para>
|
||||
</sect2>
|
||||
<sect2 id="dcop-func-logout">
|
||||
<title>bool logout()</title>
|
||||
<para>Logouts the current user and ends the session.</para>
|
||||
</sect2>
|
||||
<sect2 id="dcop-func-config">
|
||||
<title>ASYNC configure()</title>
|
||||
<para>[Since 0.6] Shows the settings dialog.</para>
|
||||
</sect2>
|
||||
<sect2 id="dcop-func-status">
|
||||
<title>QString getStatusInfo()</title>
|
||||
<para>Returns a &kmyapplication; status information.</para>
|
||||
</sect2>
|
||||
<sect2 id="dcop-func-makeinvisible">
|
||||
<title>ASYNC makeInvisible()</title>
|
||||
<para>[Since 0.9 Beta] Hiddes the main window and its system tray icon.</para>
|
||||
</sect2>
|
||||
<sect2 id="dcop-func-makevisible">
|
||||
<title>ASYNC makeVisible()</title>
|
||||
<para>[Since 0.6] Shows and raises the main window. The window will be visible on the current desktop.</para>
|
||||
</sect2>
|
||||
<sect2 id="dcop-func-test">
|
||||
<title>ASYNC setTestMode(bool yes)</title>
|
||||
<para>Enables/disables the test mode.</para>
|
||||
<example>
|
||||
<title>Enable test mode</title>
|
||||
<programlisting>dcop kshutdown KShutdownIface setTestMode true</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Disable test mode</title>
|
||||
<programlisting>dcop kshutdown KShutdownIface setTestMode false</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
</sect1>
|
||||
</chapter><!-- dcop -->
|
||||
|
||||
<chapter id="credits">
|
||||
<title>Credits and License</title>
|
||||
<para>&kmyapplication;</para>
|
||||
<para>
|
||||
Program Copyright 2005 Konrad Twardowski
|
||||
<email>kdtonline@poczta.onet.pl</email>
|
||||
</para>
|
||||
<para>
|
||||
Documentation Copyright © 2005 Konrad Twardowski
|
||||
<email>kdtonline@poczta.onet.pl</email>
|
||||
</para>
|
||||
<para>Czech FAQ Copyright © Robert Kratky</para>
|
||||
<para>See <guimenuitem>Help | About &kmyapplication;</guimenuitem> for more credits.</para>
|
||||
&underFDL;<!-- FDL: do not remove -->
|
||||
&underGPL;<!-- GPL License -->
|
||||
</chapter><!-- credits -->
|
||||
|
||||
&documentation.index;
|
||||
|
||||
</book>
|
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
@ -0,0 +1,11 @@
|
||||
extrasdir = $(kde_datadir)/kshutdown/extras
|
||||
|
||||
extras_DATA = \
|
||||
hibernate.desktop
|
||||
|
||||
EXTRA_DIST = $(extras_DATA)
|
||||
|
||||
SUBDIRS = \
|
||||
multimedia \
|
||||
shutdown \
|
||||
system
|
@ -0,0 +1,17 @@
|
||||
[Desktop Entry]
|
||||
Comment=Hibernate Computer
|
||||
Comment[pl]=Hibernuj Komputer
|
||||
# Encoding: UTF-8
|
||||
Exec=dcop kdesktop KScreensaverIface lock; dbus-send --system --dest="org.freedesktop.Hal" "/org/freedesktop/Hal/devices/computer" "org.freedesktop.Hal.Device.SystemPowerManagement.Hibernate"
|
||||
Icon=hibernate
|
||||
MimeType=
|
||||
Name=requires DBus/HAL
|
||||
Name[pl]=wymaga DBus/HAL
|
||||
Path=
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Type=Application
|
||||
X-DCOP-ServiceType=
|
||||
X-KDE-SubstituteUID=false
|
||||
X-KDE-Username=
|
||||
X-Ubuntu-Gettext-Domain=desktop_kdebase
|
@ -0,0 +1,7 @@
|
||||
[Desktop Entry]
|
||||
# Encoding: UTF-8
|
||||
Type=Directory
|
||||
Icon=player_stop
|
||||
Comment=Multimedia
|
||||
Comment[pl]=Multimedia
|
||||
Comment[el]=Πολυμέσα
|
@ -0,0 +1,13 @@
|
||||
extrasdir = $(kde_datadir)/kshutdown/extras/multimedia
|
||||
|
||||
extras_DATA = \
|
||||
.directory \
|
||||
amarok.desktop \
|
||||
juk.desktop \
|
||||
kaffeine.desktop \
|
||||
kdetv.desktop \
|
||||
kscd.desktop \
|
||||
noatun.desktop \
|
||||
xmms.desktop
|
||||
|
||||
EXTRA_DIST = $(extras_DATA)
|
@ -0,0 +1,12 @@
|
||||
[Desktop Entry]
|
||||
# Encoding: UTF-8
|
||||
Comment=Stop Playback
|
||||
Comment[de]=Wiedergabe anhalten
|
||||
Comment[it]=Interrompi riproduzione
|
||||
Comment[pl]=Zatrzymaj odtwarzanie
|
||||
Comment[el]=Σταμάτημα αναπαραγωγής
|
||||
Exec=dcop amarok player stop
|
||||
Icon=amarok
|
||||
Name=Amarok
|
||||
StartupNotify=true
|
||||
Type=Application
|
@ -0,0 +1,19 @@
|
||||
[Desktop Entry]
|
||||
# Encoding: UTF-8
|
||||
Comment=Stop Playback
|
||||
Comment[de]=Wiedergabe anhalten
|
||||
Comment[it]=Interrompi riproduzione
|
||||
Comment[pl]=Zatrzymaj odtwarzanie
|
||||
Comment[el]=Σταμάτημα αναπαραγωγής
|
||||
Exec=dcop juk Player stop
|
||||
GenericName=
|
||||
Icon=juk
|
||||
MimeType=
|
||||
Name=JuK
|
||||
Path=
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Type=Application
|
||||
X-DCOP-ServiceType=
|
||||
X-KDE-SubstituteUID=false
|
||||
X-KDE-Username=
|
@ -0,0 +1,20 @@
|
||||
[Desktop Entry]
|
||||
# Encoding: UTF-8
|
||||
Comment=Stop Playback
|
||||
Comment[de]=Wiedergabe anhalten
|
||||
Comment[it]=Interrompi riproduzione
|
||||
Comment[pl]=Zatrzymaj odtwarzanie
|
||||
Comment[el]=Σταμάτημα αναπαραγωγής
|
||||
Exec=dcop kaffeine Kaffeine stop
|
||||
GenericName=
|
||||
GenericName[en_US]=
|
||||
Icon=kaffeine
|
||||
MimeType=
|
||||
Name=Kaffeine
|
||||
Path=
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Type=Application
|
||||
X-DCOP-ServiceType=
|
||||
X-KDE-SubstituteUID=false
|
||||
X-KDE-Username=
|
@ -0,0 +1,19 @@
|
||||
[Desktop Entry]
|
||||
# Encoding: UTF-8
|
||||
Comment=Mute and quit
|
||||
Comment[pl]=Wycisz i zakończ
|
||||
Comment[el]=Κλείσιμο ήχου και τερματισμός
|
||||
Exec=KDETV_PID=`pidof kdetv`; dcop "kdetv-$$KDETV_PID" KdetvIface toggleMute; dcop "kdetv-$$KDETV_PID" MainApplication-Interface quit
|
||||
Icon=kdetv
|
||||
MimeType=
|
||||
Name=kdetv
|
||||
Name[en_US]=kdetv
|
||||
Name[el]=kdetv
|
||||
Path=
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Type=Application
|
||||
X-DCOP-ServiceType=
|
||||
X-KDE-SubstituteUID=false
|
||||
X-KDE-Username=
|
||||
X-Ubuntu-Gettext-Domain=desktop_kdebase
|
@ -0,0 +1,20 @@
|
||||
[Desktop Entry]
|
||||
# Encoding: UTF-8
|
||||
Comment=Stop Playback
|
||||
Comment[de]=Wiedergabe anhalten
|
||||
Comment[it]=Interrompi riproduzione
|
||||
Comment[pl]=Zatrzymaj odtwarzanie
|
||||
Comment[el]=Σταμάτημα αναπαραγωγής
|
||||
Exec=dcop kscd CDPlayer stop
|
||||
GenericName=
|
||||
GenericName[pl]=
|
||||
Icon=kscd
|
||||
MimeType=
|
||||
Name=KsCD
|
||||
Path=
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Type=Application
|
||||
X-DCOP-ServiceType=
|
||||
X-KDE-SubstituteUID=false
|
||||
X-KDE-Username=
|
@ -0,0 +1,18 @@
|
||||
[Desktop Entry]
|
||||
# Encoding: UTF-8
|
||||
Comment=Stop Playback
|
||||
Comment[de]=Wiedergabe anhalten
|
||||
Comment[it]=Interrompi riproduzione
|
||||
Comment[pl]=Zatrzymaj odtwarzanie
|
||||
Comment[el]=Σταμάτημα αναπαραγωγής
|
||||
Exec=dcop noatun Noatun stop
|
||||
Icon=noatun
|
||||
MimeType=
|
||||
Name=Noatun
|
||||
Path=
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Type=Application
|
||||
X-DCOP-ServiceType=
|
||||
X-KDE-SubstituteUID=false
|
||||
X-KDE-Username=
|
@ -0,0 +1,12 @@
|
||||
[Desktop Entry]
|
||||
# Encoding: UTF-8
|
||||
Comment=Stop current song
|
||||
Comment[de]=Bei aktuellem Lied stoppen
|
||||
Comment[it]=Interrompi canzone corrente
|
||||
Comment[pl]=Zatrzymaj bieżący utwór
|
||||
Comment[el]=Σταμάτημα αναπαραγωγής του τρέχοντος τραγουδιού
|
||||
Exec=xmms --stop
|
||||
Icon=xmms
|
||||
Name=XMMS
|
||||
StartupNotify=true
|
||||
Type=Application
|
@ -0,0 +1,7 @@
|
||||
[Desktop Entry]
|
||||
# Encoding: UTF-8
|
||||
Type=Directory
|
||||
Icon=exit
|
||||
Comment=Shut Down
|
||||
Comment[pl]=Zamykanie Systemu
|
||||
Comment[el]=Τερματισμός
|
@ -0,0 +1,8 @@
|
||||
extrasdir = $(kde_datadir)/kshutdown/extras/shutdown
|
||||
|
||||
extras_DATA = \
|
||||
.directory \
|
||||
cancelshutdown.desktop \
|
||||
fsck.desktop
|
||||
|
||||
EXTRA_DIST = $(extras_DATA)
|
@ -0,0 +1,19 @@
|
||||
[Desktop Entry]
|
||||
# Encoding: UTF-8
|
||||
Comment=Cancel a running shutdown
|
||||
Comment[de]=Herunterfahren aufhalten
|
||||
Comment[it]=Annulla spegnimento programmato
|
||||
Comment[pl]=Anuluj zamykanie systemu
|
||||
Comment[el]=Ακύρωση τερματισμού
|
||||
Exec=/sbin/shutdown -c
|
||||
GenericName=
|
||||
GenericName[pl]=
|
||||
Icon=exit
|
||||
MimeType=
|
||||
Path=
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Type=Application
|
||||
X-DCOP-ServiceType=
|
||||
X-KDE-SubstituteUID=false
|
||||
X-KDE-Username=
|
@ -0,0 +1,19 @@
|
||||
[Desktop Entry]
|
||||
# Encoding: UTF-8
|
||||
Comment=Reboot and run `fsck'
|
||||
Comment[it]=Riavvia ed esegui `fsck'
|
||||
Comment[de]=Neustarten und `fsck` ausführen
|
||||
Comment[pl]=Zrestartuj i uruchom `fsck'
|
||||
Comment[el]=Επανεκκίνηση και εκτέλεση του `fsck'
|
||||
Exec=/sbin/shutdown -r -F 1
|
||||
GenericName=
|
||||
GenericName[pl]=
|
||||
Icon=exit
|
||||
MimeType=
|
||||
Path=
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Type=Application
|
||||
X-DCOP-ServiceType=
|
||||
X-KDE-SubstituteUID=false
|
||||
X-KDE-Username=
|
@ -0,0 +1,6 @@
|
||||
[Desktop Entry]
|
||||
# Encoding: UTF-8
|
||||
Type=Directory
|
||||
Icon=about_kde
|
||||
Comment=System
|
||||
Comment[pl]=Systemowe
|
@ -0,0 +1,9 @@
|
||||
extrasdir = $(kde_datadir)/kshutdown/extras/system
|
||||
|
||||
extras_DATA = \
|
||||
.directory \
|
||||
adsl-stop.desktop \
|
||||
kdeeject.desktop \
|
||||
kppp.desktop
|
||||
|
||||
EXTRA_DIST = $(extras_DATA)
|
@ -0,0 +1,20 @@
|
||||
[Desktop Entry]
|
||||
# Encoding: UTF-8
|
||||
Comment=Shut down a PPPoE link
|
||||
Comment[de]=Eine PPPoE Verbindung trennen
|
||||
Comment[it]=Disconnetti una connessione PPPoE
|
||||
Comment[pl]=Zakończ połączenie PPPoE
|
||||
Comment[el]=Τερματισμός μιας PPPoE σύνδεσης
|
||||
Exec=/usr/sbin/adsl-stop
|
||||
GenericName=
|
||||
GenericName[pl]=
|
||||
Icon=network_disconnected
|
||||
MimeType=
|
||||
Path=
|
||||
StartupNotify=true
|
||||
Terminal=true
|
||||
TerminalOptions=\s--noclose
|
||||
Type=Application
|
||||
X-DCOP-ServiceType=none
|
||||
X-KDE-SubstituteUID=false
|
||||
X-KDE-Username=
|
@ -0,0 +1,19 @@
|
||||
[Desktop Entry]
|
||||
# Encoding: UTF-8
|
||||
Comment=Eject CD
|
||||
Comment[de]=CD auswerfen
|
||||
Comment[it]=Espelli CD
|
||||
Comment[pl]=Wysuń CD
|
||||
Comment[el]=Εξαγωγή CD
|
||||
Exec=kdeeject /dev/cdrom
|
||||
GenericName=
|
||||
GenericName[en_US]=
|
||||
Icon=cdrom_unmount
|
||||
MimeType=
|
||||
Path=
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Type=Application
|
||||
X-DCOP-ServiceType=
|
||||
X-KDE-SubstituteUID=false
|
||||
X-KDE-Username=
|
@ -0,0 +1,19 @@
|
||||
[Desktop Entry]
|
||||
# Encoding: UTF-8
|
||||
Comment=Terminate an existing PPP connection
|
||||
Comment[it]=Termina una connessione PPP esistente
|
||||
Comment[de]=Eine bestehende PPP Verbindung trennen
|
||||
Comment[pl]=Przerwij trwające połączenie
|
||||
Comment[el]=Τερματισμός μιας υπάρχουσας PPP σύνδεσης
|
||||
Exec=kppp -k
|
||||
GenericName=
|
||||
GenericName[pl]=
|
||||
Icon=kppp
|
||||
MimeType=
|
||||
Path=
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Type=Application
|
||||
X-DCOP-ServiceType=
|
||||
X-KDE-SubstituteUID=false
|
||||
X-KDE-Username=
|
@ -0,0 +1,8 @@
|
||||
karambadir = $(kde_datadir)/kshutdown/karamba
|
||||
|
||||
karamba_DATA = \
|
||||
kshutdown-48x48.png \
|
||||
kshutdown-classic-notext.theme \
|
||||
kshutdown-classic-text.theme
|
||||
|
||||
EXTRA_DIST = $(karamba_DATA)
|
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
@ -0,0 +1,8 @@
|
||||
# KShutDown (no text)
|
||||
|
||||
karamba x=300 y=100 w=48 h=48 interval=10000000 locked=true
|
||||
|
||||
<group> x=0 y=0
|
||||
image x=0 y=0 path="kshutdown-48x48.png"
|
||||
clickarea x=0 y=0 w=48 h=48 onclick="kshutdown"
|
||||
</group>
|
@ -0,0 +1,11 @@
|
||||
# KShutDown (text)
|
||||
|
||||
karamba x=300 y=100 w=150 h=48 interval=10000000 locked=true
|
||||
|
||||
defaultfont fontsize=16 bgcolor=88,88,88 color=255,255,255 shadow=2
|
||||
|
||||
<group> x=0 y=0
|
||||
image x=0 y=0 path="kshutdown-48x48.png"
|
||||
text x=55 y=12 value="Turn Off..."
|
||||
clickarea x=0 y=0 w=150 h=48 onclick="kshutdown"
|
||||
</group>
|
@ -0,0 +1,86 @@
|
||||
Name: kshutdown
|
||||
Summary: An advanced shut down utility for KDE
|
||||
Version: 1.0.4
|
||||
Release: 1mdk
|
||||
License: GPL
|
||||
Group: Graphical desktop/KDE
|
||||
Source: %{name}-%{version}.tar.bz2
|
||||
BuildRoot: %{_tmppath}/build-root-%{name}
|
||||
Packager: Zdenko Podobny
|
||||
Distribution: mdk
|
||||
Prefix: /usr
|
||||
Url: http://kshutdown.sourceforge.net
|
||||
Provides: kshutdown
|
||||
Requires: kdelibs >= 3.3.0
|
||||
|
||||
%description
|
||||
KShutDown is an advanced shut down utility for KDE.
|
||||
Features:
|
||||
- Turn Off Computer (logout and halt the system)
|
||||
- Restart Computer (logout and reboot the system)
|
||||
- Lock Session (lock the screen using a screen saver)
|
||||
- End Current Session (end the current KDE session and logout the user)
|
||||
- Extras (additional, user commands)
|
||||
- Time and delay options
|
||||
- Command line and DCOP support
|
||||
- System tray and panel applet
|
||||
- Visual and sound notifications
|
||||
- KDE Kiosk support
|
||||
- And more...
|
||||
|
||||
%prep
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
mkdir $RPM_BUILD_ROOT
|
||||
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \
|
||||
./configure --prefix=%{prefix}
|
||||
make -j 2
|
||||
|
||||
%install
|
||||
make DESTDIR=$RPM_BUILD_ROOT install-strip
|
||||
|
||||
cd $RPM_BUILD_ROOT
|
||||
|
||||
find . -type d -fprint $RPM_BUILD_DIR/file.list.%{name}.dirs
|
||||
find . -type f -fprint $RPM_BUILD_DIR/file.list.%{name}.files.tmp
|
||||
sed '/\/man\//s/$/.gz/g' $RPM_BUILD_DIR/file.list.%{name}.files.tmp > $RPM_BUILD_DIR/file.list.%{name}.files
|
||||
find . -type l -fprint $RPM_BUILD_DIR/file.list.%{name}.libs
|
||||
sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' $RPM_BUILD_DIR/file.list.%{name}.dirs > $RPM_BUILD_DIR/file.list.%{name}
|
||||
sed 's,^\.,\%attr(-\,root\,root) ,' $RPM_BUILD_DIR/file.list.%{name}.files >> $RPM_BUILD_DIR/file.list.%{name}
|
||||
sed 's,^\.,\%attr(-\,root\,root) ,' $RPM_BUILD_DIR/file.list.%{name}.libs >> $RPM_BUILD_DIR/file.list.%{name}
|
||||
|
||||
install -d -m 0755 %buildroot/%_menudir
|
||||
cat > %buildroot/%_menudir/%{name} <<EOF
|
||||
?package(kshutdown): needs=x11 section="System/Other" longtitle="KShutDown - advanced shut down utility" title="KShutDown" command="kshutdown" icon="kshutdown.png"
|
||||
EOF
|
||||
|
||||
%post
|
||||
%update_menus
|
||||
|
||||
%postun
|
||||
%clean_menus
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
rm -rf $RPM_BUILD_DIR/file.list.%{name}
|
||||
rm -rf $RPM_BUILD_DIR/file.list.%{name}.libs
|
||||
rm -rf $RPM_BUILD_DIR/file.list.%{name}.files
|
||||
rm -rf $RPM_BUILD_DIR/file.list.%{name}.files.tmp
|
||||
rm -rf $RPM_BUILD_DIR/file.list.%{name}.dirs
|
||||
|
||||
%files -f ../file.list.%{name}
|
||||
%_menudir/*
|
||||
%defattr(-,root,root,0755)
|
||||
|
||||
%changelog
|
||||
* Sat Nov 26 2005 Konrad Twardowski
|
||||
- updated description
|
||||
|
||||
* Mon Aug 1 2005 Konrad Twardowski
|
||||
- removed "kdebase" from "Requires"
|
||||
|
||||
* Sat Jun 19 2004 Zdenko Podobný <zdpo@mailbox.sk> 0.1.8-1mdk
|
||||
- initial version
|
@ -0,0 +1,94 @@
|
||||
# norootforbuild
|
||||
|
||||
Name: kshutdown
|
||||
Summary: An advanced shut down utility for KDE
|
||||
Version: 1.0.2
|
||||
Release: 3.pm.1
|
||||
License: GPL
|
||||
Group: System/Management
|
||||
URL: http://kshutdown.sf.net/
|
||||
Source0: http://mesh.dl.sourceforge.net/sourceforge/kshutdown/kshutdown-%{version}.tar.bz2
|
||||
BuildRoot: %{_tmppath}/kshutdown-%{version}-%{release}-root
|
||||
Requires: kdelibs3 >= 3.3.0
|
||||
BuildRequires: kdelibs3-devel kdebase3-devel
|
||||
BuildRequires: gcc-c++ libstdc++ libstdc++-devel
|
||||
BuildRequires: autoconf automake libtool
|
||||
|
||||
|
||||
%description
|
||||
KShutDown is an advanced shut down utility for KDE.
|
||||
Features:
|
||||
- Turn Off Computer (logout and halt the system)
|
||||
- Restart Computer (logout and reboot the system)
|
||||
- Lock Session (lock the screen using a screen saver)
|
||||
- End Current Session (end the current KDE session and logout the user)
|
||||
- Extras (additional, user commands)
|
||||
- Time and delay options
|
||||
- Command line and DCOP support
|
||||
- System tray and panel applet
|
||||
- Visual and sound notifications
|
||||
- KDE Kiosk support
|
||||
- And more...
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%configure --enable-final
|
||||
|
||||
%build
|
||||
make
|
||||
|
||||
%install
|
||||
rm -fr %buildroot
|
||||
make install DESTDIR=%buildroot
|
||||
cd %buildroot
|
||||
find . -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > $RPM_BUILD_DIR/file.list.kshutdown
|
||||
find . -type f | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.kshutdown
|
||||
find . -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.kshutdown
|
||||
|
||||
%clean
|
||||
rm -fr %buildroot
|
||||
rm -fr $RPM_BUILD_DIR/kshutdown
|
||||
rm -fr ../file.list.kshutdown
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
|
||||
%postun
|
||||
/sbin/ldconfig
|
||||
|
||||
%files -f ../file.list.kshutdown
|
||||
|
||||
%changelog
|
||||
* Wed Dec 05 2007 Andrea Florio <andrea@links2linux.de>
|
||||
- update to version 1.0.2
|
||||
- patch remove, no more required
|
||||
Fixing and new on new version
|
||||
- NEW: Added "extra" command line option. Run "kshutdown --help" for more info.
|
||||
- NEW: Remember recent "Extras" command
|
||||
- Now the sound is disabled by default. You can re-enable sound notifications via menu -> Settings -> Configure Notifications...
|
||||
- Updated Italian translation
|
||||
- Updated Turkish translation
|
||||
- Updated Polish translation
|
||||
|
||||
|
||||
|
||||
* Sat Nov 24 2007 Andrea Florio <andrea@links2linux.de>
|
||||
- italian translation patch applied
|
||||
|
||||
* Sat Nov 24 2007 Andrea Florio <andrea@links2linux.de>
|
||||
- Packman porting
|
||||
|
||||
* Wed Apr 18 2007 Pascal Bleser <guru@unixtech.be> 1.0-1
|
||||
- new upstream version
|
||||
|
||||
* Sun Feb 18 2007 Pascal Bleser <guru@unixtech.be> 0.8.2-1
|
||||
- new package
|
||||
|
||||
* Sat Nov 26 2005 Konrad Twardowski
|
||||
- updated description
|
||||
|
||||
* Mon Aug 1 2005 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
- removed "kdebase" from "Requires"
|
||||
|
||||
* Mon Apr 4 2005 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
- Test RPM
|
@ -0,0 +1,321 @@
|
||||
<!DOCTYPE kdevelop>
|
||||
<kdevelop>
|
||||
<general>
|
||||
<author>Konrad Twardowski</author>
|
||||
<email>kdtonline@poczta.onet.pl</email>
|
||||
<projectmanagement>KDevKDEAutoProject</projectmanagement>
|
||||
<primarylanguage>C++</primarylanguage>
|
||||
<keywords>
|
||||
<keyword>KDE</keyword>
|
||||
<keyword>Qt</keyword>
|
||||
</keywords>
|
||||
<projectdirectory>.</projectdirectory>
|
||||
<absoluteprojectpath>false</absoluteprojectpath>
|
||||
<version>1.0.4</version>
|
||||
<description>An advanced shut down utility for KDE.</description>
|
||||
<ignoreparts>
|
||||
<part>kdevabbrev</part>
|
||||
<part>kdevkonsoleview</part>
|
||||
<part>kdevfilelist</part>
|
||||
<part>kdevfileview</part>
|
||||
<part>kdevdistpart</part>
|
||||
<part>kdevopenwith</part>
|
||||
<part>kdevpartexplorer</part>
|
||||
<part>kdevregexptest</part>
|
||||
<part>kdevreplace</part>
|
||||
<part>kdevscripting</part>
|
||||
<part>kdevfilter</part>
|
||||
<part>kdevastyle</part>
|
||||
<part>kdevtexttools</part>
|
||||
<part>kdevtools</part>
|
||||
</ignoreparts>
|
||||
<secondaryLanguages/>
|
||||
<versioncontrol>kdevsubversion</versioncontrol>
|
||||
<projectname>kshutdown</projectname>
|
||||
<defaultencoding></defaultencoding>
|
||||
</general>
|
||||
<kdevautoproject>
|
||||
<general>
|
||||
<mainprogram>kshutdown</mainprogram>
|
||||
<useconfiguration>default</useconfiguration>
|
||||
</general>
|
||||
<configure>
|
||||
<configargs/>
|
||||
</configure>
|
||||
<make>
|
||||
<abortonerror>true</abortonerror>
|
||||
<numberofjobs>1</numberofjobs>
|
||||
<dontact>false</dontact>
|
||||
<makebin></makebin>
|
||||
<envvars>
|
||||
<envvar value="1" name="WANT_AUTOCONF_2_5" />
|
||||
<envvar value="1" name="WANT_AUTOMAKE_1_6" />
|
||||
</envvars>
|
||||
<prio>0</prio>
|
||||
<runmultiplejobs>false</runmultiplejobs>
|
||||
</make>
|
||||
<compiler>
|
||||
<cflags/>
|
||||
<cxxflags>\s-O0 -g3 -Wall</cxxflags>
|
||||
</compiler>
|
||||
<run>
|
||||
<directoryradio>executable</directoryradio>
|
||||
<customdirectory>/</customdirectory>
|
||||
<mainprogram>/home/kdt/Documents/src/kshutdown/trunk/kshutdown/kshutdown/kshutdown</mainprogram>
|
||||
<programargs>--nofork --test</programargs>
|
||||
<terminal>false</terminal>
|
||||
<autocompile>true</autocompile>
|
||||
<envvars/>
|
||||
<globaldebugarguments></globaldebugarguments>
|
||||
<globalcwd>/home/kdt/Documents/src/kshutdown/trunk/kshutdown</globalcwd>
|
||||
<useglobalprogram>true</useglobalprogram>
|
||||
<autoinstall>false</autoinstall>
|
||||
<autokdesu>true</autokdesu>
|
||||
</run>
|
||||
<configurations>
|
||||
<default>
|
||||
<configargs>--prefix=`kde-config --prefix` --enable-debug=full</configargs>
|
||||
<builddir/>
|
||||
<topsourcedir/>
|
||||
<cppflags/>
|
||||
<ldflags/>
|
||||
<ccompiler>kdevgccoptions</ccompiler>
|
||||
<cxxcompiler>kdevgppoptions</cxxcompiler>
|
||||
<f77compiler>kdevpgf77options</f77compiler>
|
||||
<ccompilerbinary/>
|
||||
<cxxcompilerbinary/>
|
||||
<f77compilerbinary/>
|
||||
<cflags>-O0</cflags>
|
||||
<cxxflags>-O0</cxxflags>
|
||||
<f77flags/>
|
||||
<envvars/>
|
||||
</default>
|
||||
</configurations>
|
||||
</kdevautoproject>
|
||||
<kdevfileview>
|
||||
<groups>
|
||||
<group pattern="*.h" name="Headers" />
|
||||
<group pattern="*.cpp;*.c" name="Sources" />
|
||||
<group pattern="*.po" name="Translations" />
|
||||
<group pattern="AUTHORS;COPYING;ChangeLog;INSTALL;README;TODO;NEWS;VERSION" name="GNU" />
|
||||
<group pattern="*" name="Others" />
|
||||
<hidenonprojectfiles>false</hidenonprojectfiles>
|
||||
<hidenonlocation>false</hidenonlocation>
|
||||
</groups>
|
||||
<tree>
|
||||
<hidepatterns>*</hidepatterns>
|
||||
<showvcsfields>true</showvcsfields>
|
||||
<hidenonprojectfiles>true</hidenonprojectfiles>
|
||||
</tree>
|
||||
</kdevfileview>
|
||||
<kdevdoctreeview>
|
||||
<ignoretocs>
|
||||
<toc>gtk</toc>
|
||||
<toc>gnustep</toc>
|
||||
<toc>python</toc>
|
||||
<toc>php</toc>
|
||||
<toc>perl</toc>
|
||||
<toc>ada</toc>
|
||||
<toc>w3c-dom-level2-html</toc>
|
||||
<toc>gnome1</toc>
|
||||
<toc>haskell</toc>
|
||||
<toc>kde2book</toc>
|
||||
<toc>kdev3api</toc>
|
||||
<toc>opengl</toc>
|
||||
<toc>ruby</toc>
|
||||
<toc>w3c-svg</toc>
|
||||
<toc>sdl</toc>
|
||||
<toc>stl</toc>
|
||||
<toc>sw</toc>
|
||||
<toc>w3c-uaag10</toc>
|
||||
<toc>clanlib</toc>
|
||||
<toc>ada_bugs_gcc</toc>
|
||||
<toc>bash_bugs</toc>
|
||||
<toc>c++_bugs_gcc</toc>
|
||||
<toc>fortran_bugs_gcc</toc>
|
||||
<toc>gtk_bugs</toc>
|
||||
<toc>haskell_bugs_ghc</toc>
|
||||
<toc>java_bugs_gcc</toc>
|
||||
<toc>pascal_bugs_fp</toc>
|
||||
<toc>perl_bugs</toc>
|
||||
<toc>php_bugs</toc>
|
||||
<toc>python_bugs</toc>
|
||||
<toc>ruby_bugs</toc>
|
||||
<toc>wxwindows_bugs</toc>
|
||||
<toc>java_bugs_sun</toc>
|
||||
<toc>wxwidgets_bugs</toc>
|
||||
</ignoretocs>
|
||||
<projectdoc>
|
||||
<userdocDir>html/</userdocDir>
|
||||
<apidocDir>html/</apidocDir>
|
||||
</projectdoc>
|
||||
<ignoreqt_xml>
|
||||
<toc>Guide to the Qt Translation Tools</toc>
|
||||
<toc>qmake User Guide</toc>
|
||||
<toc>Qt Assistant Manual</toc>
|
||||
<toc>Qt Designer Manual</toc>
|
||||
</ignoreqt_xml>
|
||||
<ignoredoxygen/>
|
||||
<ignorekdocs/>
|
||||
<ignoredevhelp>
|
||||
<toc>gdk-pixbuf</toc>
|
||||
<toc>pango</toc>
|
||||
<toc>libbonoboui</toc>
|
||||
<toc>libbonobo</toc>
|
||||
<toc>gtk</toc>
|
||||
<toc>gobject</toc>
|
||||
<toc>gnome-vfs</toc>
|
||||
<toc>glib</toc>
|
||||
<toc>gdk</toc>
|
||||
<toc>bonobo-activation</toc>
|
||||
</ignoredevhelp>
|
||||
</kdevdoctreeview>
|
||||
<kdevdebugger>
|
||||
<general>
|
||||
<dbgshell>libtool</dbgshell>
|
||||
<programargs/>
|
||||
<gdbpath></gdbpath>
|
||||
<configGdbScript></configGdbScript>
|
||||
<runShellScript></runShellScript>
|
||||
<runGdbScript></runGdbScript>
|
||||
<breakonloadinglibs>true</breakonloadinglibs>
|
||||
<separatetty>false</separatetty>
|
||||
<floatingtoolbar>false</floatingtoolbar>
|
||||
</general>
|
||||
<display>
|
||||
<staticmembers>false</staticmembers>
|
||||
<demanglenames>true</demanglenames>
|
||||
<outputradix>10</outputradix>
|
||||
</display>
|
||||
</kdevdebugger>
|
||||
<kdevfilecreate>
|
||||
<filetypes/>
|
||||
<useglobaltypes>
|
||||
<type ext="cpp" />
|
||||
<type ext="c" />
|
||||
<type ext="h" />
|
||||
</useglobaltypes>
|
||||
</kdevfilecreate>
|
||||
<cppsupportpart>
|
||||
<filetemplates>
|
||||
<interfacesuffix>.h</interfacesuffix>
|
||||
<implementationsuffix>.cpp</implementationsuffix>
|
||||
</filetemplates>
|
||||
</cppsupportpart>
|
||||
<kdevcppsupport>
|
||||
<codecompletion>
|
||||
<includeGlobalFunctions>true</includeGlobalFunctions>
|
||||
<includeTypes>true</includeTypes>
|
||||
<includeEnums>true</includeEnums>
|
||||
<includeTypedefs>true</includeTypedefs>
|
||||
<automaticCodeCompletion>true</automaticCodeCompletion>
|
||||
<automaticArgumentsHint>true</automaticArgumentsHint>
|
||||
<automaticHeaderCompletion>true</automaticHeaderCompletion>
|
||||
<codeCompletionDelay>250</codeCompletionDelay>
|
||||
<argumentsHintDelay>400</argumentsHintDelay>
|
||||
<headerCompletionDelay>250</headerCompletionDelay>
|
||||
<showOnlyAccessibleItems>false</showOnlyAccessibleItems>
|
||||
<completionBoxItemOrder>0</completionBoxItemOrder>
|
||||
<howEvaluationContextMenu>true</howEvaluationContextMenu>
|
||||
<showCommentWithArgumentHint>true</showCommentWithArgumentHint>
|
||||
<statusBarTypeEvaluation>false</statusBarTypeEvaluation>
|
||||
<namespaceAliases>std=_GLIBCXX_STD;__gnu_cxx=std</namespaceAliases>
|
||||
<processPrimaryTypes>true</processPrimaryTypes>
|
||||
<processFunctionArguments>false</processFunctionArguments>
|
||||
<preProcessAllHeaders>false</preProcessAllHeaders>
|
||||
<parseMissingHeaders>false</parseMissingHeaders>
|
||||
<resolveIncludePaths>true</resolveIncludePaths>
|
||||
<alwaysParseInBackground>true</alwaysParseInBackground>
|
||||
<usePermanentCaching>true</usePermanentCaching>
|
||||
<alwaysIncludeNamespaces>false</alwaysIncludeNamespaces>
|
||||
<includePaths>.;</includePaths>
|
||||
</codecompletion>
|
||||
<references/>
|
||||
<creategettersetter>
|
||||
<prefixGet></prefixGet>
|
||||
<prefixSet>set</prefixSet>
|
||||
<prefixVariable>m_,_</prefixVariable>
|
||||
<parameterName>theValue</parameterName>
|
||||
<inlineGet>true</inlineGet>
|
||||
<inlineSet>true</inlineSet>
|
||||
</creategettersetter>
|
||||
<qt>
|
||||
<used>false</used>
|
||||
<version>3</version>
|
||||
<root>/usr/share/qt3</root>
|
||||
<includestyle>3</includestyle>
|
||||
<designerintegration>EmbeddedKDevDesigner</designerintegration>
|
||||
<qmake>/usr/bin/qmake-qt3</qmake>
|
||||
<designer></designer>
|
||||
<designerpluginpaths/>
|
||||
</qt>
|
||||
<splitheadersource>
|
||||
<enabled>false</enabled>
|
||||
<synchronize>true</synchronize>
|
||||
<orientation>Vertical</orientation>
|
||||
</splitheadersource>
|
||||
</kdevcppsupport>
|
||||
<kdevcvs>
|
||||
<cvsoptions>-f</cvsoptions>
|
||||
<commitoptions/>
|
||||
<addoptions/>
|
||||
<logoptions/>
|
||||
<updateoptions>-dP</updateoptions>
|
||||
<removeoptions>-f</removeoptions>
|
||||
<revertoptions>-C -d -P</revertoptions>
|
||||
<diffoptions>-u3 -p</diffoptions>
|
||||
<rshoptions/>
|
||||
</kdevcvs>
|
||||
<kdevcvsservice>
|
||||
<recursivewhenupdate>true</recursivewhenupdate>
|
||||
<prunedirswhenupdate>true</prunedirswhenupdate>
|
||||
<createdirswhenupdate>true</createdirswhenupdate>
|
||||
<recursivewhencommitremove>true</recursivewhencommitremove>
|
||||
<revertoptions>-C</revertoptions>
|
||||
</kdevcvsservice>
|
||||
<dist>
|
||||
<custom>false</custom>
|
||||
<bzip>false</bzip>
|
||||
<archname/>
|
||||
<appname/>
|
||||
<version/>
|
||||
<release/>
|
||||
<vendor/>
|
||||
<licence/>
|
||||
<summary/>
|
||||
<group/>
|
||||
<packager/>
|
||||
<description/>
|
||||
<changelog/>
|
||||
<devpackage>false</devpackage>
|
||||
<docspackage>false</docspackage>
|
||||
<appicon>false</appicon>
|
||||
<arch>0</arch>
|
||||
<genHTML>false</genHTML>
|
||||
<useRPM>false</useRPM>
|
||||
<ftpkde>false</ftpkde>
|
||||
<appskde>false</appskde>
|
||||
<url/>
|
||||
</dist>
|
||||
<kdevdocumentation>
|
||||
<projectdoc>
|
||||
<docsystem></docsystem>
|
||||
<docurl></docurl>
|
||||
<usermanualurl></usermanualurl>
|
||||
</projectdoc>
|
||||
</kdevdocumentation>
|
||||
<ctagspart>
|
||||
<customArguments></customArguments>
|
||||
<customTagfilePath>/home/kdt/Documents/src/kshutdown/trunk/kshutdown/tags</customTagfilePath>
|
||||
<activeTagsFiles/>
|
||||
</ctagspart>
|
||||
<kdevvisualadvance>
|
||||
<emulator>VisualBoyAdvance</emulator>
|
||||
<binary/>
|
||||
<addOptions/>
|
||||
<terminal>false</terminal>
|
||||
<fullscreen>false</fullscreen>
|
||||
<graphicFilter>-f0</graphicFilter>
|
||||
<scaling>-1</scaling>
|
||||
</kdevvisualadvance>
|
||||
</kdevelop>
|
@ -0,0 +1,12 @@
|
||||
Begin3
|
||||
Title: KShutDown
|
||||
Version: 1.0.4
|
||||
Entered-date: 2009/01/15
|
||||
Description: An Advanced Shut Down Utility for KDE
|
||||
Keywords: shut down shutdown halt reboot restart lock screen logout kde
|
||||
Author: kdtonline@poczta.onet.pl (Konrad Twardowski)
|
||||
Maintained-by: kdtonline@poczta.onet.pl (Konrad Twardowski)
|
||||
Home-page: http://kshutdown.sourceforge.net/
|
||||
Platforms: Linux/KDE 3.3
|
||||
Copying-policy: GNU Public License
|
||||
End
|
@ -0,0 +1,65 @@
|
||||
Name: kshutdown
|
||||
Summary: An advanced shut down utility for KDE
|
||||
Version: 1.0.4
|
||||
Release: 1.fc4
|
||||
License: GPL
|
||||
Group: Applications/System
|
||||
URL: http://kshutdown.sf.net/
|
||||
Packager: Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
Source0: kshutdown-%version.tar.bz2
|
||||
Buildroot: %_tmppath/kshutdown-%version-%release-root
|
||||
Requires: kdelibs >= 3.3.0
|
||||
BuildRequires: kdelibs-devel
|
||||
|
||||
%description
|
||||
KShutDown is an advanced shut down utility for KDE.
|
||||
Features:
|
||||
- Turn Off Computer (logout and halt the system)
|
||||
- Restart Computer (logout and reboot the system)
|
||||
- Lock Session (lock the screen using a screen saver)
|
||||
- End Current Session (end the current KDE session and logout the user)
|
||||
- Extras (additional, user commands)
|
||||
- Time and delay options
|
||||
- Command line and DCOP support
|
||||
- System tray and panel applet
|
||||
- Visual and sound notifications
|
||||
- KDE Kiosk support
|
||||
- And more...
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%configure --enable-final
|
||||
|
||||
%build
|
||||
make
|
||||
|
||||
%install
|
||||
rm -fr %buildroot
|
||||
make install DESTDIR=%buildroot
|
||||
cd %buildroot
|
||||
find . -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > $RPM_BUILD_DIR/file.list.kshutdown
|
||||
find . -type f | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.kshutdown
|
||||
find . -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.kshutdown
|
||||
|
||||
%clean
|
||||
rm -fr %buildroot
|
||||
rm -fr $RPM_BUILD_DIR/kshutdown
|
||||
rm -fr ../file.list.kshutdown
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
|
||||
%postun
|
||||
/sbin/ldconfig
|
||||
|
||||
%files -f ../file.list.kshutdown
|
||||
|
||||
%changelog
|
||||
* Sat Nov 26 2005 Konrad Twardowski
|
||||
- updated description
|
||||
|
||||
* Mon Aug 1 2005 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
- removed "kdebase" from "Requires"
|
||||
|
||||
* Mon Apr 4 2005 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
- Test RPM
|
@ -0,0 +1,44 @@
|
||||
bin_PROGRAMS = kshutdown
|
||||
|
||||
kshutdown_SOURCES = \
|
||||
actions.cpp \
|
||||
appobserver.cpp \
|
||||
configuration.cpp \
|
||||
confirmation.cpp \
|
||||
extras.cpp \
|
||||
kshutdowniface_skel.cpp \
|
||||
links.cpp \
|
||||
mactioneditdialog.cpp \
|
||||
main.cpp \
|
||||
miscutils.cpp \
|
||||
mmainwindow.cpp \
|
||||
mmessagedialog.cpp \
|
||||
msettingsdialog.cpp \
|
||||
mstatstab.cpp \
|
||||
msystemtray.cpp \
|
||||
mtip.cpp \
|
||||
progressbar.cpp \
|
||||
systemconfig.cpp
|
||||
|
||||
kshutdown_LDADD = $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KFILE) $(LIB_QT)
|
||||
kshutdown_LDFLAGS = $(all_libraries) $(KDE_RPATH)
|
||||
|
||||
EXTRA_DIST = \
|
||||
kshutdown.desktop \
|
||||
kshutdowniface.kidl \
|
||||
kshutdown.upd
|
||||
|
||||
appdir = $(prefix)/share/applications
|
||||
app_DATA = kshutdown.desktop
|
||||
|
||||
kconfdir = $(kde_datadir)/kconf_update
|
||||
kconf_DATA = kshutdown.upd
|
||||
|
||||
INCLUDES = $(all_includes)
|
||||
METASOURCES = AUTO
|
||||
|
||||
messages:
|
||||
LIST=`find ../kshutdown ../kshutdownlockout -name \*.h -o -name \*.cpp`; \
|
||||
if test -n "$$LIST"; then \
|
||||
$(XGETTEXT) $$LIST -o $(podir)/kshutdown.pot; \
|
||||
fi
|
@ -0,0 +1,455 @@
|
||||
/*
|
||||
actions.cpp - Actions
|
||||
Copyright (C) 2005 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "actions.h"
|
||||
#include "configuration.h"
|
||||
#include "confirmation.h"
|
||||
#include "extras.h"
|
||||
#include "miscutils.h"
|
||||
#include "mmainwindow.h"
|
||||
#include "msystemtray.h"
|
||||
#include "systemconfig.h"
|
||||
|
||||
#include <qimage.h>
|
||||
#include <qtimer.h>
|
||||
|
||||
#include <dcopclient.h>
|
||||
#include <kdebug.h>
|
||||
#include <kiconloader.h>
|
||||
#include <kimageeffect.h>
|
||||
#include <klocale.h>
|
||||
#include <kmessagebox.h>
|
||||
|
||||
Action *Action::_instance = 0;
|
||||
|
||||
Action::~Action()
|
||||
{
|
||||
}
|
||||
|
||||
QString Action::actionToConfigGroup(const Type action) const
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case ShutDown: return "Shut Down";
|
||||
case Reboot: return "Reboot";
|
||||
case LockScreen: return "Lock Screen";
|
||||
case Logout: return "Logout";
|
||||
default: return QString::null;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: 2.0: GDM support
|
||||
// TODO: 2.0: force application exit (without asking for data save)
|
||||
bool Action::endSession(const KApplication::ShutdownType type, const Type action)
|
||||
{
|
||||
_totalExit = false;
|
||||
|
||||
MiscUtils::passiveMessage(i18n("Please wait..."));
|
||||
|
||||
// test mode
|
||||
if (_testMode)
|
||||
{
|
||||
MiscUtils::showTestMessage(getName(action));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
_totalExit = true;
|
||||
if (
|
||||
!kapp->requestShutDown(
|
||||
KApplication::ShutdownConfirmNo,
|
||||
type,
|
||||
KApplication::ShutdownModeForceNow
|
||||
)
|
||||
)
|
||||
{
|
||||
KMessageBox::error(
|
||||
0,
|
||||
i18n(
|
||||
"Could not logout properly.\n" \
|
||||
"The session manager cannot be contacted."
|
||||
)
|
||||
);
|
||||
_totalExit = false;
|
||||
|
||||
return false; // error
|
||||
}
|
||||
|
||||
return true; // ok
|
||||
}
|
||||
|
||||
bool Action::exec(const Type action, const bool stopTimer)
|
||||
{
|
||||
if (stopTimer)
|
||||
ks_main->cancel();
|
||||
|
||||
_totalExit = false;
|
||||
|
||||
Method method = Method_KDE;
|
||||
QString command;
|
||||
|
||||
if (!isEnabled(action))
|
||||
return false; // error
|
||||
|
||||
// kdDebug() << "Action::exec: " << action << endl;
|
||||
|
||||
switch (action)
|
||||
{
|
||||
// nothing
|
||||
case Nothing:
|
||||
return false; // error
|
||||
|
||||
// shut down
|
||||
case ShutDown:
|
||||
_totalExit = true;
|
||||
MiscUtils::closeCDTray();
|
||||
getMethod(action, method, command);
|
||||
MiscUtils::runCommandBeforeAction("Shut Down");
|
||||
|
||||
if (method == Method_KDE)
|
||||
return endSession(KApplication::ShutdownTypeHalt, action);
|
||||
|
||||
break;
|
||||
|
||||
// reboot
|
||||
case Reboot:
|
||||
_totalExit = true;
|
||||
MiscUtils::closeCDTray();
|
||||
getMethod(action, method, command);
|
||||
MiscUtils::runCommandBeforeAction("Reboot");
|
||||
|
||||
if (method == Method_KDE)
|
||||
return endSession(KApplication::ShutdownTypeReboot, action);
|
||||
|
||||
break;
|
||||
|
||||
case LockScreen:
|
||||
return lockScreen();
|
||||
|
||||
// logout
|
||||
case Logout:
|
||||
_totalExit = true;
|
||||
MiscUtils::closeCDTray();
|
||||
getMethod(action, method, command);
|
||||
MiscUtils::runCommandBeforeAction("Logout");
|
||||
|
||||
if (method == Method_KDE)
|
||||
return endSession(KApplication::ShutdownTypeNone, action);
|
||||
|
||||
break;
|
||||
|
||||
// "extras" action
|
||||
case Extras:
|
||||
// test mode
|
||||
if (_testMode)
|
||||
{
|
||||
MiscUtils::showTestMessage(
|
||||
ks_extras->getActionDescription() + "\n" +
|
||||
ks_extras->fileToExecute()
|
||||
);
|
||||
|
||||
return true; // ok
|
||||
}
|
||||
|
||||
return ks_extras->execAction();
|
||||
}
|
||||
|
||||
// test mode
|
||||
if (_testMode)
|
||||
{
|
||||
MiscUtils::showTestMessage(i18n("Command: %1").arg(command));
|
||||
|
||||
return true; // ok
|
||||
}
|
||||
|
||||
// run default or user command
|
||||
// TODO: 2.0: add function to change /sbin/* permissions (e.g. /sbin/poweroff)
|
||||
// TODO: 2.0: save session before /sbin/* execution
|
||||
if (MiscUtils::runCommand(command))
|
||||
{
|
||||
// hide window
|
||||
if ((action == LockScreen) && (MSystemTray::mode() == MSystemTray::Always))
|
||||
ks_main->hide();
|
||||
|
||||
return true; // ok
|
||||
}
|
||||
|
||||
_totalExit = false;
|
||||
|
||||
return false; // error
|
||||
}
|
||||
|
||||
bool Action::execConfirm(const Type action, const QString &delay)
|
||||
{
|
||||
if (
|
||||
(action != LockScreen) && // no confirmation for "Lock Session"
|
||||
!Confirmation::confirm(action, delay.isNull() ? i18n("No Delay") : delay)
|
||||
)
|
||||
return false;
|
||||
|
||||
return exec(action, action != LockScreen);
|
||||
}
|
||||
|
||||
bool Action::execCurrent()
|
||||
{
|
||||
return exec(_current);
|
||||
}
|
||||
|
||||
QString Action::getCurrentName() const
|
||||
{
|
||||
return getName(_current);
|
||||
}
|
||||
|
||||
QPixmap Action::getIcon(const Type action) const
|
||||
{
|
||||
QMapIterator<Type, QPixmap> i = iconCache->find(action);
|
||||
|
||||
return (i == iconCache->end()) ? SmallIcon("misc") : i.data();
|
||||
}
|
||||
|
||||
QString Action::getIconName(const Type action) const
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case ShutDown: return "exit";
|
||||
case Reboot: return "reload";
|
||||
case LockScreen: return "lock";
|
||||
case Logout: return "undo";
|
||||
case Extras: return "bookmark";
|
||||
case Nothing:
|
||||
default:
|
||||
return "misc";
|
||||
}
|
||||
}
|
||||
|
||||
QString Action::getMethod(const Action::Type action, Method &method, QString &command)
|
||||
{
|
||||
QString group = actionToConfigGroup(action);
|
||||
|
||||
if (group.isNull())
|
||||
{
|
||||
// kdDebug() << "Action::getMethod: No group in config for action " << action << endl;
|
||||
|
||||
return QString::null;
|
||||
}
|
||||
|
||||
QString defaultCommand;
|
||||
switch (action)
|
||||
{
|
||||
case ShutDown:
|
||||
defaultCommand = DEFAULT_SHUT_DOWN_COMMAND;
|
||||
break;
|
||||
case Reboot:
|
||||
defaultCommand = DEFAULT_REBOOT_COMMAND;
|
||||
break;
|
||||
case LockScreen:
|
||||
defaultCommand = DEFAULT_LOCK_SCREEN_COMMAND;
|
||||
break;
|
||||
case Logout:
|
||||
defaultCommand = DEFAULT_LOGOUT_COMMAND;
|
||||
break;
|
||||
default:
|
||||
defaultCommand = QString::null;
|
||||
}
|
||||
|
||||
KConfig *conf = kshutdownrc->config();
|
||||
if (!conf->hasGroup(group))
|
||||
{
|
||||
method = Method_KDE;
|
||||
command = defaultCommand;
|
||||
// kdDebug() << "Action::getMethod: No group in config for action " << action << endl;
|
||||
|
||||
return defaultCommand;
|
||||
}
|
||||
|
||||
conf->setGroup(group);
|
||||
|
||||
// read method
|
||||
method = (Method)conf->readNumEntry("Method", Method_KDE);
|
||||
if ((method < Method_KDE) || (method > Method_UserCommand))
|
||||
method = Method_KDE;
|
||||
|
||||
switch (method)
|
||||
{
|
||||
case Method_KDE:
|
||||
command = conf->readEntry("Command", defaultCommand);
|
||||
break;
|
||||
case Method_DefaultCommand:
|
||||
command = defaultCommand;
|
||||
break;
|
||||
case Method_UserCommand:
|
||||
command = conf->readEntry("Command", defaultCommand);
|
||||
if (command.isEmpty())
|
||||
method = Method_KDE;
|
||||
break;
|
||||
}
|
||||
|
||||
return defaultCommand;
|
||||
}
|
||||
|
||||
void Action::setMethod(const QString &group, const Method method, const QString &command) const
|
||||
{
|
||||
KConfig *conf = kshutdownrc->config();
|
||||
conf->setGroup(group);
|
||||
if (method == Method_UserCommand)
|
||||
conf->writeEntry("Command", command);
|
||||
conf->writeEntry("Method", method);
|
||||
}
|
||||
|
||||
QString Action::getName(const Type action) const
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case Nothing: return i18n("Nothing");
|
||||
case ShutDown: return i18n("Turn Off Computer");
|
||||
case Reboot: return i18n("Restart Computer");
|
||||
case LockScreen: return i18n("Lock Session");
|
||||
case Logout: return i18n("End Current Session");
|
||||
case Extras: return ks_extras->getActionDescription();
|
||||
}
|
||||
|
||||
return i18n("Unknown");
|
||||
}
|
||||
|
||||
bool Action::isEnabled(const Type action)
|
||||
{
|
||||
Method m = Method_KDE;
|
||||
QString c = QString::null;
|
||||
switch (action)
|
||||
{
|
||||
case Nothing:
|
||||
return false;
|
||||
case ShutDown:
|
||||
getMethod(action, m, c);
|
||||
return
|
||||
!MiscUtils::isRestricted("action_shutdown") &&
|
||||
!((m == Method_KDE) && !SystemConfig::canShutDown());
|
||||
case Reboot:
|
||||
getMethod(action, m, c);
|
||||
return
|
||||
!MiscUtils::isRestricted("action_reboot") &&
|
||||
!((m == Method_KDE) && !SystemConfig::canShutDown());
|
||||
case LockScreen:
|
||||
return !MiscUtils::isRestricted("action_lockscreen");
|
||||
case Logout:
|
||||
return !MiscUtils::isRestricted("action_logout");
|
||||
case Extras:
|
||||
return !MiscUtils::isRestricted("action_extras");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Action::totalExec()
|
||||
{
|
||||
if (!execCurrent())
|
||||
KMessageBox::sorry(0, i18n("Action failed! (%1)").arg(_current));
|
||||
}
|
||||
|
||||
Action::Action()
|
||||
: QObject(ks_main),
|
||||
_active(false),
|
||||
_testMode(false),
|
||||
_totalExit(false),
|
||||
_current(Nothing)
|
||||
{
|
||||
// NOTE: compatible with the standard KDE logout dialog
|
||||
// NOTE: sync. with panel applet
|
||||
iconCache = new QMap<Type, QPixmap>();
|
||||
#define KS_ADD_ICON(action) \
|
||||
iconCache->insert(action, SmallIcon(getIconName(action)));
|
||||
KS_ADD_ICON(Nothing);
|
||||
KS_ADD_ICON(ShutDown);
|
||||
KS_ADD_ICON(Reboot);
|
||||
KS_ADD_ICON(LockScreen);
|
||||
KS_ADD_ICON(Logout);
|
||||
KS_ADD_ICON(Extras);
|
||||
}
|
||||
|
||||
bool Action::lockScreen() {
|
||||
Method method;
|
||||
QString command;
|
||||
getMethod(LockScreen, method, command);
|
||||
MiscUtils::runCommandBeforeAction("Lock Screen");
|
||||
if (method == Method_KDE) {
|
||||
// test mode
|
||||
if (_testMode) {
|
||||
MiscUtils::showTestMessage(getName(LockScreen));
|
||||
|
||||
return true; // ok
|
||||
}
|
||||
|
||||
// this is a modified "void Lockout::lock()"
|
||||
// from the "Lock/Logout Applet" (lockout.cpp [3.1.4])
|
||||
QCString kdesktop("kdesktop");
|
||||
int kshutdown_screen_number = qt_xscreen();
|
||||
if (kshutdown_screen_number)
|
||||
kdesktop.sprintf("kdesktop-screen-%d", kshutdown_screen_number);
|
||||
|
||||
if (!kapp->dcopClient()->send(kdesktop, "KScreensaverIface", "lock()", "")) {
|
||||
KMessageBox::error(0, i18n("kdesktop: DCOP call failed!"));
|
||||
|
||||
return false; // error
|
||||
}
|
||||
|
||||
// hide window
|
||||
if (MSystemTray::mode() == MSystemTray::Always)
|
||||
ks_main->hide();
|
||||
|
||||
return true; // ok
|
||||
}
|
||||
else {
|
||||
if (_testMode) {
|
||||
MiscUtils::showTestMessage(i18n("Command: %1").arg(command));
|
||||
|
||||
return true; // ok
|
||||
}
|
||||
else if (MiscUtils::runCommand(command)) {
|
||||
// hide window
|
||||
if (MSystemTray::mode() == MSystemTray::Always)
|
||||
ks_main->hide();
|
||||
|
||||
return true; // ok
|
||||
}
|
||||
}
|
||||
|
||||
return false; // error
|
||||
}
|
||||
|
||||
// public slots
|
||||
|
||||
void Action::slotLockScreen()
|
||||
{
|
||||
execConfirm(LockScreen);
|
||||
}
|
||||
|
||||
void Action::slotLogout()
|
||||
{
|
||||
execConfirm(Logout);
|
||||
}
|
||||
|
||||
void Action::slotReboot()
|
||||
{
|
||||
execConfirm(Reboot);
|
||||
}
|
||||
|
||||
void Action::slotShutDown()
|
||||
{
|
||||
execConfirm(ShutDown);
|
||||
}
|
@ -0,0 +1,217 @@
|
||||
/*
|
||||
actions.h - Actions
|
||||
Copyright (C) 2005 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __ACTIONS_H__
|
||||
#define __ACTIONS_H__
|
||||
|
||||
#include <kapplication.h>
|
||||
|
||||
// default external commands
|
||||
const QString
|
||||
DEFAULT_LOCK_SCREEN_COMMAND("xscreensaver-command -lock"),
|
||||
// TODO: 2.0: logout command for GNOME (gnome-session-save --kill?)
|
||||
DEFAULT_LOGOUT_COMMAND(""),
|
||||
DEFAULT_REBOOT_COMMAND("/sbin/reboot"),
|
||||
DEFAULT_SHUT_DOWN_COMMAND("/sbin/poweroff");
|
||||
|
||||
#define ks_actions Action::getInstance()
|
||||
|
||||
class QPixmap;
|
||||
|
||||
/** @short An action manager. */
|
||||
class Action: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
/**
|
||||
* Methods. Don't change these values!
|
||||
*/
|
||||
enum Method {
|
||||
Method_KDE = 0, /**< Standard KDE/KDM method. (default) */
|
||||
Method_DefaultCommand = 1, /**< Default external command. (e.g. /sbin/reboot) */
|
||||
Method_UserCommand = 2 /**< User command. Any command that can be executed by @c KRun::run. */
|
||||
};
|
||||
|
||||
/**
|
||||
* Actions.
|
||||
*/
|
||||
enum Type {
|
||||
Nothing = 0, /**< Nothing. */
|
||||
ShutDown = 1, /**< System shut down. */
|
||||
Reboot = 2, /**< System reboot. */
|
||||
LockScreen = 3, /**< Screen lock. */
|
||||
Logout = 4, /**< End current session. */
|
||||
Extras = 5 /**< Extras. Execute an item selected from the "Extras..." menu. */
|
||||
};
|
||||
|
||||
/** Destructor. */
|
||||
virtual ~Action();
|
||||
|
||||
/**
|
||||
* Converts @p action value to the configuration group name.
|
||||
*/
|
||||
QString actionToConfigGroup(const Type action) const;
|
||||
|
||||
/**
|
||||
* Returns @c true if the current action is active.
|
||||
*/
|
||||
inline bool active() const { return _active; }
|
||||
|
||||
/**
|
||||
* Activates the current action if @p yes is @c true.
|
||||
*/
|
||||
inline void setActive(const bool yes) { _active = yes; }
|
||||
|
||||
/** Returns the currently selected action. */
|
||||
inline Type current() const { return _current; }
|
||||
|
||||
/**
|
||||
* Sets current action to @p action.
|
||||
*/
|
||||
inline void setCurrent(const Type action) { _current = action; }
|
||||
|
||||
/**
|
||||
* Ends current session.
|
||||
* This function is a wrapper for the @c kapp->requestShutDown().
|
||||
* @param type A shut down type
|
||||
* @param action An action to execute
|
||||
* @return @c true if successful; otherwise @c false
|
||||
*/
|
||||
bool endSession(const KApplication::ShutdownType type, const Type action);
|
||||
|
||||
/**
|
||||
* Executes an action.
|
||||
* @param action An action to execute
|
||||
* @param stopTimer If @c true, the current active action and its timer are stopped
|
||||
* @return @c true if successful; otherwise @c false
|
||||
*/
|
||||
bool exec(const Type action, const bool stopTimer = true);
|
||||
|
||||
/**
|
||||
* Executes an action.
|
||||
* Displays confirmation message before execution.
|
||||
* @param action An action to execute
|
||||
* @param delay A selected delay
|
||||
*/
|
||||
bool execConfirm(const Type action, const QString &delay = QString::null);
|
||||
|
||||
/**
|
||||
* Executes the current action without confirmation.
|
||||
*/
|
||||
bool execCurrent();
|
||||
|
||||
/**
|
||||
* Returns the current action name as text.
|
||||
*/
|
||||
QString getCurrentName() const;
|
||||
|
||||
/**
|
||||
* Returns an icon for @p action.
|
||||
*/
|
||||
QPixmap getIcon(const Type action) const;
|
||||
|
||||
/**
|
||||
* Returns an icon name for @p action.
|
||||
*/
|
||||
QString getIconName(const Type action) const;
|
||||
|
||||
/**
|
||||
* Initializes and return singleton instance of the @c Action class.
|
||||
*/
|
||||
inline static Action *getInstance()
|
||||
{
|
||||
if (!_instance)
|
||||
_instance = new Action();
|
||||
|
||||
return _instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads method for action from the configuration file.
|
||||
* @param action An action
|
||||
* @retval method A method to use
|
||||
* @retval command A command to run
|
||||
* @return A default command
|
||||
*/
|
||||
QString getMethod(
|
||||
const Type action,
|
||||
Method &method,
|
||||
QString &command
|
||||
);
|
||||
|
||||
/**
|
||||
* Changes the action method.
|
||||
* @param group A configuration group (in @b kshutdownrc file)
|
||||
* @param method A new method
|
||||
* @param command A new command
|
||||
*/
|
||||
void setMethod(const QString &group, const Method method, const QString &command) const;
|
||||
|
||||
/**
|
||||
* Returns an action name as text.
|
||||
* @param action An action
|
||||
*/
|
||||
QString getName(const Type action) const;
|
||||
|
||||
/** Returns @c true if @p action is @b not disabled by KIOSK. */
|
||||
bool isEnabled(const Type action);
|
||||
|
||||
/** Returns @c true if test mode is enabled. */
|
||||
inline bool testMode() const { return _testMode; }
|
||||
|
||||
/**
|
||||
* Enables/disables the <b>test mode</b>.
|
||||
* @param yes @c true to enable test mode
|
||||
*/
|
||||
inline void setTestMode(const bool yes) { _testMode = yes; }
|
||||
|
||||
/**
|
||||
* Executes the current action,
|
||||
* and displays an error message if action failed.
|
||||
*/
|
||||
void totalExec();
|
||||
|
||||
/**
|
||||
* Returns @c true if application/system is shutting down.
|
||||
*/
|
||||
inline bool totalExit() const { return _totalExit; }
|
||||
|
||||
/**
|
||||
* Sets <b>total exit</b> info to @p yes.
|
||||
*/
|
||||
inline void setTotalExit(const bool yes) { _totalExit = yes; }
|
||||
private:
|
||||
static Action *_instance;
|
||||
bool
|
||||
_active,
|
||||
_testMode,
|
||||
_totalExit;
|
||||
QMap<Type, QPixmap> *iconCache;
|
||||
Type _current;
|
||||
Action();
|
||||
bool lockScreen();
|
||||
public slots:
|
||||
void slotLockScreen();
|
||||
void slotLogout();
|
||||
void slotReboot();
|
||||
void slotShutDown();
|
||||
};
|
||||
|
||||
#endif // __ACTIONS_H__
|
@ -0,0 +1,290 @@
|
||||
/*
|
||||
appobserver.cpp - An application observer/killer
|
||||
Copyright (C) 2005 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "appobserver.h"
|
||||
#include "miscutils.h"
|
||||
#include "mmainwindow.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <qcombobox.h>
|
||||
#include <qlistbox.h>
|
||||
#include <qprocess.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
#include <kdebug.h>
|
||||
#include <kiconloader.h>
|
||||
#include <klocale.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <kpushbutton.h>
|
||||
|
||||
// TODO: 2.0: bigger combo box list
|
||||
// http://ariya.blogspot.com/2006/03/resize-pop-up-list-of-combo-box_15.html
|
||||
|
||||
// public
|
||||
|
||||
AppObserver::AppObserver(QWidget *parent)
|
||||
: QHBox(parent),
|
||||
_processesMap(new QMap<int, Process>()),
|
||||
_process(0),
|
||||
_buf(QString::null)
|
||||
{
|
||||
setName("AppObserver");
|
||||
|
||||
// refresh button
|
||||
b_refresh = new KPushButton(this, "KPushButton::b_refresh");
|
||||
b_refresh->setIconSet(SmallIcon("reload"));
|
||||
b_refresh->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred));
|
||||
MiscUtils::setHint(b_refresh, i18n("Refresh the list of processes"));
|
||||
connect(b_refresh, SIGNAL(clicked()), SLOT(slotRefresh()));
|
||||
|
||||
// processes combo box
|
||||
cb_processes = new QComboBox(this, "QComboBox::cb_processes");
|
||||
cb_processes->setFocusPolicy(StrongFocus);
|
||||
MiscUtils::setHint(cb_processes, i18n("List of the running processes"));
|
||||
|
||||
// kill button
|
||||
b_kill = new KPushButton(SmallIcon("editdelete"), i18n("Kill"), this, "KPushButton::b_kill");
|
||||
b_kill->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred));
|
||||
MiscUtils::setHint(b_kill, i18n("Kill the selected process"));
|
||||
connect(b_kill, SIGNAL(clicked()), SLOT(slotKill()));
|
||||
}
|
||||
|
||||
QString AppObserver::getInfo() const
|
||||
{
|
||||
int index = cb_processes->currentItem();
|
||||
QMapIterator<int, Process> i = _processesMap->find(index);
|
||||
|
||||
if (i == _processesMap->end())
|
||||
return QString::null;
|
||||
|
||||
return i18n("Waiting for \"%1\"").arg(i.data().command);
|
||||
}
|
||||
|
||||
bool AppObserver::isSelectedProcessRunning() const
|
||||
{
|
||||
// TODO: 2.0: common code
|
||||
int index = cb_processes->currentItem();
|
||||
QMapIterator<int, Process> i = _processesMap->find(index);
|
||||
|
||||
if (i == _processesMap->end())
|
||||
return false;
|
||||
|
||||
if (::kill(i.data().pid, 0)) // check if process exists
|
||||
{
|
||||
switch (errno)
|
||||
{
|
||||
case EINVAL: return false;
|
||||
case ESRCH: return false;
|
||||
case EPERM: return true;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AppObserver::isValid() const
|
||||
{
|
||||
if (!isSelectedProcessRunning())
|
||||
{
|
||||
KMessageBox::error(
|
||||
ks_main,
|
||||
i18n("The selected process does not exist!")
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void AppObserver::refresh()
|
||||
{
|
||||
// kdDebug() << "AppObserver::refresh()" << endl;
|
||||
|
||||
b_refresh->setEnabled(false);
|
||||
cb_processes->setEnabled(false);
|
||||
b_kill->setEnabled(false);
|
||||
|
||||
_buf = QString::null;
|
||||
cb_processes->clear();
|
||||
_processesMap->clear();
|
||||
|
||||
if (!_process)
|
||||
{
|
||||
_process = new QProcess(this);
|
||||
connect(_process, SIGNAL(processExited()), SLOT(slotProcessExit()));
|
||||
connect(_process, SIGNAL(readyReadStdout()), SLOT(slotReadStdout()));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_process->isRunning())
|
||||
_process->kill();
|
||||
_process->clearArguments();
|
||||
}
|
||||
_process->addArgument("ps");
|
||||
// show all processes
|
||||
_process->addArgument("-A");
|
||||
// order: user pid command
|
||||
_process->addArgument("-o");
|
||||
_process->addArgument("user=");
|
||||
_process->addArgument("-o");
|
||||
_process->addArgument("pid=");
|
||||
_process->addArgument("-o");
|
||||
_process->addArgument("comm=");
|
||||
// sort by command
|
||||
_process->addArgument("--sort");
|
||||
_process->addArgument("comm");
|
||||
|
||||
// start process
|
||||
if (!_process->start())
|
||||
{
|
||||
// error
|
||||
KMessageBox::error(
|
||||
ks_main,
|
||||
MiscUtils::HTML(i18n("Could not execute command<br><br><b>%1</b>").arg(_process->arguments().join(" ")))
|
||||
);
|
||||
cb_processes->setEnabled(false);
|
||||
cb_processes->insertItem(SmallIcon("messagebox_warning"), i18n("Error"));
|
||||
b_kill->setEnabled(false);
|
||||
b_refresh->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void AppObserver::setWidgetsEnabled(const bool yes) const
|
||||
{
|
||||
b_refresh->setEnabled(yes);
|
||||
cb_processes->setEnabled(yes);
|
||||
b_kill->setEnabled(yes);
|
||||
}
|
||||
|
||||
// private slots
|
||||
|
||||
void AppObserver::slotKill()
|
||||
{
|
||||
int index = cb_processes->currentItem();
|
||||
QMapIterator<int, Process> i = _processesMap->find(index);
|
||||
// FIXME: 2.0: error message
|
||||
if (i != _processesMap->end())
|
||||
{
|
||||
if (KMessageBox::warningYesNo(
|
||||
ks_main,
|
||||
MiscUtils::HTML(i18n("Are you sure you want to KILL<br><b>%1</b>?<br><br>All unsaved data will be lost!").arg(cb_processes->currentText()))
|
||||
) != KMessageBox::Yes)
|
||||
return;
|
||||
|
||||
pid_t pid = i.data().pid;
|
||||
if (::kill(pid, SIGKILL))
|
||||
{
|
||||
switch (errno)
|
||||
{
|
||||
case EINVAL:
|
||||
// kdDebug() << "EINVAL" << endl;
|
||||
break;
|
||||
case ESRCH:
|
||||
KMessageBox::error(
|
||||
ks_main,
|
||||
MiscUtils::HTML(i18n("Process not found<br><b>%1</b>").arg(cb_processes->currentText()))
|
||||
);
|
||||
break;
|
||||
case EPERM:
|
||||
KMessageBox::error(
|
||||
ks_main,
|
||||
MiscUtils::HTML(i18n("No permissions to kill<br><b>%1</b>").arg(cb_processes->currentText()))
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cb_processes->changeItem(
|
||||
*cb_processes->pixmap(index),
|
||||
i18n("DEAD: %1").arg(cb_processes->text(index)),
|
||||
index
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AppObserver::slotProcessExit()
|
||||
{
|
||||
// kdDebug() << "AppObserver::slotProcessExit()" << endl;
|
||||
|
||||
int index = 0;
|
||||
int line = 0;
|
||||
Process p;
|
||||
QStringList list = QStringList::split(" ", _buf.simplifyWhiteSpace());
|
||||
for (QStringList::Iterator i = list.begin(); i != list.end(); ++i)
|
||||
{
|
||||
switch (line)
|
||||
{
|
||||
// user
|
||||
case 0:
|
||||
line++; // next is pid
|
||||
p = Process();
|
||||
p.user = *i;
|
||||
break;
|
||||
// pid
|
||||
case 1:
|
||||
line++; // next is command
|
||||
p.pid = (*i).toLong();
|
||||
break;
|
||||
// command
|
||||
case 2:
|
||||
line = 0; // next is user (wrap around)
|
||||
p.command = *i;
|
||||
_processesMap->insert(index, p);
|
||||
// kdDebug() << "USER=" << p.user << " PID=" << p.pid << " COMMAND=" << p.command << endl;
|
||||
QString text = QString("%1 (pid %2, %3)")
|
||||
.arg(p.command)
|
||||
.arg(p.pid)
|
||||
.arg(p.user);
|
||||
cb_processes->insertItem(SmallIcon(p.command), text);
|
||||
index++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (cb_processes->count() == 0)
|
||||
{
|
||||
cb_processes->setEnabled(false);
|
||||
cb_processes->insertItem(SmallIcon("messagebox_warning"), i18n("Error"));
|
||||
b_kill->setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
cb_processes->setEnabled(true);
|
||||
b_kill->setEnabled(true);
|
||||
}
|
||||
b_refresh->setEnabled(true);
|
||||
}
|
||||
|
||||
void AppObserver::slotReadStdout()
|
||||
{
|
||||
// kdDebug() << "AppObserver::slotReadStdout()" << endl;
|
||||
|
||||
_buf.append(_process->readStdout());
|
||||
}
|
||||
|
||||
void AppObserver::slotRefresh()
|
||||
{
|
||||
refresh();
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
/*
|
||||
appobserver.h - An application observer/killer
|
||||
Copyright (C) 2005 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __APPOBSERVER_H__
|
||||
#define __APPOBSERVER_H__
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <qhbox.h>
|
||||
|
||||
class QComboBox;
|
||||
class QProcess;
|
||||
|
||||
class KPushButton;
|
||||
|
||||
/**
|
||||
* A process info.
|
||||
*/
|
||||
class Process
|
||||
{
|
||||
private:
|
||||
friend class AppObserver;
|
||||
pid_t pid; /**< A process ID. */
|
||||
QString command; /**< A process command (e.g. "firefox"). */
|
||||
QString user; /**< An owner of the process (e.g. "root"). */
|
||||
};
|
||||
|
||||
/**
|
||||
* An application observer/killer (stupid name ;-).
|
||||
*/
|
||||
class AppObserver: public QHBox
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
* @param parent A parent widget
|
||||
*/
|
||||
AppObserver(QWidget *parent);
|
||||
|
||||
/**
|
||||
* Returns textual information about the current state,
|
||||
* or @c QString::null.
|
||||
*/
|
||||
QString getInfo() const;
|
||||
|
||||
/**
|
||||
* Returns @c true if selected process exists.
|
||||
*/
|
||||
bool isSelectedProcessRunning() const;
|
||||
|
||||
/**
|
||||
* Returns @c true if selected process exists;
|
||||
* otherwise displays an error message.
|
||||
*/
|
||||
bool isValid() const;
|
||||
|
||||
/**
|
||||
* Refreshes the list of processes.
|
||||
*/
|
||||
void refresh();
|
||||
|
||||
/**
|
||||
* Enables/disables related widgets.
|
||||
* @param yes @c true to enable widgets
|
||||
*/
|
||||
void setWidgetsEnabled(const bool yes) const;
|
||||
private:
|
||||
KPushButton
|
||||
*b_kill,
|
||||
*b_refresh;
|
||||
QComboBox *cb_processes;
|
||||
QMap<int, Process> *_processesMap;
|
||||
QProcess *_process;
|
||||
QString _buf;
|
||||
private slots:
|
||||
void slotKill();
|
||||
void slotProcessExit();
|
||||
void slotReadStdout();
|
||||
void slotRefresh();
|
||||
};
|
||||
|
||||
#endif // __APPOBSERVER_H__
|
@ -0,0 +1,80 @@
|
||||
/*
|
||||
configuration.cpp - A configuration
|
||||
Copyright (C) 2004 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "actions.h"
|
||||
#include "configuration.h"
|
||||
#include "mmainwindow.h"
|
||||
#include "msystemtray.h"
|
||||
|
||||
Config *Config::_instance = 0;
|
||||
|
||||
// public
|
||||
|
||||
Config::Config()
|
||||
{
|
||||
// automation
|
||||
setCurrentGroup("Automation");
|
||||
i_cdTrayClose = addItemBool("cd_tray_close", cdTrayClose, false, "CDTrayClose");
|
||||
#ifdef Q_OS_FREEBSD
|
||||
i_cdTrayCloseCommand = addItemString("cd_tray_close_command", cdTrayCloseCommand, "cdcontrol close", "CDTrayCloseCommand");
|
||||
#else
|
||||
i_cdTrayCloseCommand = addItemString("cd_tray_close_command", cdTrayCloseCommand, "eject -t", "CDTrayCloseCommand");
|
||||
#endif
|
||||
|
||||
// custom message
|
||||
setCurrentGroup("Custom Message");
|
||||
i_customMessageEnabled = addItemBool("custom_message_enabled", customMessageEnabled, true, "Enabled");
|
||||
i_customMessageCommand = addItemString("custom_message_command", customMessageCommand, KS_CONFIG_KDIALOG_MESSAGE);
|
||||
|
||||
// general
|
||||
setCurrentGroup("General");
|
||||
ItemInt *i;
|
||||
i = addItemInt("general_action", generalAction, Action::ShutDown, "Action");
|
||||
i->setMinValue(Action::ShutDown);
|
||||
i->setMaxValue(Action::Extras);
|
||||
i = addItemInt("general_delay_type", generalDelayType, MMainWindow::DelayType_TimeFromNow, "DelayType");
|
||||
i->setMinValue(MMainWindow::DelayType_Now);
|
||||
i->setMaxValue(MMainWindow::DelayType_OnAppExit);
|
||||
addItemDateTime("general_date_time", generalDateTime, QDateTime::currentDateTime(), "DelayTime");
|
||||
|
||||
// progress bar
|
||||
setCurrentGroup("Progress Bar");
|
||||
i_progressBarEnabled = addItemBool("progress_bar_enabled", progressBarEnabled, false, "Enabled");
|
||||
i_progressBarPosition = addItemInt("progress_bar_position", progressBarPosition, 0, "Position");
|
||||
|
||||
// statistics
|
||||
setCurrentGroup("Statistics");
|
||||
i_statsLongFormat = addItemBool("stats_long_format", statsLongFormat, false, "LongFormat");
|
||||
i_statsToggleFromField = addItemBool("stats_toggle_from_field", statsToggleFromField, false, "ToggleFromField");
|
||||
|
||||
// system tray
|
||||
setCurrentGroup("System Tray");
|
||||
i_systemTray = addItemInt("system_tray", systemTray, MSystemTray::Always, "Always");
|
||||
i_systemTray->setMinValue(MSystemTray::Always);
|
||||
i_systemTray->setMaxValue(MSystemTray::Never);
|
||||
|
||||
// warning message
|
||||
setCurrentGroup("Warning Message");
|
||||
i_warningMessageEnabled = addItemBool("warning_message_enabled", warningMessageEnabled, true, "Enabled");
|
||||
i_warningMessageDelay = addItemInt("warning_message_delay", warningMessageDelay, 2, "Delay");
|
||||
i_warningMessageDelay->setMinValue(1);
|
||||
i_warningMessageDelay->setMaxValue(60);
|
||||
|
||||
readConfig();
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
/*
|
||||
configuration.h - A configuration
|
||||
Copyright (C) 2004 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __CONFIGURATION_H__
|
||||
#define __CONFIGURATION_H__
|
||||
|
||||
#include <kconfigskeleton.h>
|
||||
|
||||
#define kshutdownrc Config::getInstance()->getInstance()
|
||||
|
||||
#define KS_CONFIG_AMOR_MESSAGE "dcop amor AmorIface showMessage \"%appname: %text\""
|
||||
#define KS_CONFIG_KDIALOG_MESSAGE "kdialog --title \"%title\" --passivepopup \"%text\" 10"
|
||||
|
||||
/**
|
||||
* @short A configuration reader/writer.
|
||||
* Use the @c kshutdownrc macro to access these members.
|
||||
*/
|
||||
class Config: public KConfigSkeleton
|
||||
{
|
||||
public:
|
||||
// automation
|
||||
bool cdTrayClose;
|
||||
ItemBool *i_cdTrayClose;
|
||||
QString cdTrayCloseCommand;
|
||||
ItemString *i_cdTrayCloseCommand;
|
||||
|
||||
// custom message
|
||||
bool customMessageEnabled;
|
||||
ItemBool *i_customMessageEnabled;
|
||||
QString customMessageCommand;
|
||||
ItemString *i_customMessageCommand;
|
||||
|
||||
// general
|
||||
int generalAction;
|
||||
int generalDelayType;
|
||||
QDateTime generalDateTime;
|
||||
|
||||
// progress bar
|
||||
bool progressBarEnabled;
|
||||
ItemBool *i_progressBarEnabled;
|
||||
int progressBarPosition;
|
||||
ItemInt *i_progressBarPosition;
|
||||
|
||||
// statistics
|
||||
bool statsLongFormat;
|
||||
ItemBool *i_statsLongFormat;
|
||||
bool statsToggleFromField;
|
||||
ItemBool *i_statsToggleFromField;
|
||||
|
||||
// system tray
|
||||
int systemTray;
|
||||
ItemInt *i_systemTray;
|
||||
|
||||
// warning message
|
||||
bool warningMessageEnabled;
|
||||
ItemBool *i_warningMessageEnabled;
|
||||
int warningMessageDelay;
|
||||
ItemInt *i_warningMessageDelay;
|
||||
|
||||
/**
|
||||
* Constructs and returns a singleton instance of the configuration.
|
||||
*/
|
||||
inline static Config *getInstance()
|
||||
{
|
||||
if (!_instance)
|
||||
_instance = new Config();
|
||||
|
||||
return _instance;
|
||||
}
|
||||
private:
|
||||
Config();
|
||||
static Config *_instance;
|
||||
};
|
||||
|
||||
#endif // __CONFIGURATION_H__
|
@ -0,0 +1,97 @@
|
||||
/*
|
||||
confirmation.cpp - A confirmation dialog
|
||||
Copyright (C) 2005 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "confirmation.h"
|
||||
#include "miscutils.h"
|
||||
#include "mmainwindow.h"
|
||||
#include "msystemtray.h"
|
||||
|
||||
#include <dcopclient.h>
|
||||
#include <kdialogbase.h>
|
||||
#include <kiconloader.h>
|
||||
#include <klocale.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <kwin.h>
|
||||
|
||||
// public
|
||||
|
||||
bool Confirmation::confirm(const Action::Type action, const QString &delay)
|
||||
{
|
||||
KWin::setOnDesktop(ks_main->winId(), KWin::currentDesktop());
|
||||
|
||||
QWidget *parent;
|
||||
if (ks_main->isVisible())
|
||||
parent = ks_main;
|
||||
else if (MSystemTray::isInstance() && ks_tray->isVisible())
|
||||
parent = ks_tray;
|
||||
else
|
||||
parent = 0;
|
||||
|
||||
/*
|
||||
QWidget *background = new QWidget(0, "QWidget::background", Qt::WType_Popup);
|
||||
background->setBackgroundMode(Qt::NoBackground);
|
||||
background->setGeometry(kapp->desktop()->geometry());
|
||||
// Take screenshot - based on the aKregator's TrayIcon::takeScreenshot() (trayicon.cpp)
|
||||
// and "ksmserver/shutdown.cpp".
|
||||
QPixmap shot = QPixmap::grabWindow(
|
||||
qt_xrootwin(),
|
||||
0, 0, // x, y
|
||||
kapp->desktop()->width(), kapp->desktop()->height()
|
||||
);
|
||||
QImage shotImage = shot.convertToImage();
|
||||
KImageEffect::flatten(shotImage, Qt::green, Qt::black);
|
||||
bitBlt(background, 0, 0, &shotImage);
|
||||
background->show();
|
||||
*/
|
||||
|
||||
KDialogBase *dialog = new KDialogBase(
|
||||
i18n("Confirm"), // caption
|
||||
KDialogBase::Yes | KDialogBase::No, // button mask
|
||||
KDialogBase::Yes, // default button
|
||||
KDialogBase::No, // escape button
|
||||
parent,
|
||||
"Action::confirm",
|
||||
true, // modal
|
||||
false, // separator
|
||||
KGuiItem(ks_actions->getName(action), ks_actions->getIcon(action)),
|
||||
KGuiItem(i18n("&Cancel"), SmallIcon("button_cancel"))
|
||||
);
|
||||
bool checkboxResultDummy = false;
|
||||
QString selectedTime = delay.isNull() ? i18n("Unknown") : delay;
|
||||
QString text =
|
||||
i18n("Are you sure?<br><br>Selected Action: <b>%1</b><br>Selected Time: <b>%2</b>")
|
||||
.arg(ks_actions->getName(action))
|
||||
.arg(selectedTime);
|
||||
|
||||
kapp->dcopClient()->suspend();
|
||||
|
||||
bool result = (KMessageBox::createKMessageBox(
|
||||
dialog,
|
||||
MainBarIcon(ks_actions->getIconName(action), 32),
|
||||
MiscUtils::HTML(text),
|
||||
QStringList(),
|
||||
QString::null,
|
||||
&checkboxResultDummy,
|
||||
KMessageBox::Notify
|
||||
) == KDialogBase::Yes);
|
||||
|
||||
kapp->dcopClient()->resume();
|
||||
|
||||
return result;
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
/*
|
||||
confirmation.h - A confirmation dialog
|
||||
Copyright (C) 2005 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __CONFIRMATION_H__
|
||||
#define __CONFIRMATION_H__
|
||||
|
||||
#include "actions.h"
|
||||
|
||||
/** @short A confirmation dialog. */
|
||||
class Confirmation
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Displays a confirmation message box.
|
||||
* @param action An action to confirm
|
||||
* @param delay A selected delay
|
||||
* @return @c true if action has been confirmed; otherwise @c false
|
||||
*/
|
||||
static bool confirm(const Action::Type action, const QString &delay);
|
||||
};
|
||||
|
||||
#endif // __CONFIRMATION_H__
|
@ -0,0 +1,309 @@
|
||||
/*
|
||||
extras.cpp - Extras
|
||||
Copyright (C) 2004 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "extras.h"
|
||||
#include "miscutils.h"
|
||||
#include "mmainwindow.h"
|
||||
|
||||
#include <qdir.h>
|
||||
|
||||
#include <kdebug.h>
|
||||
#include <kdesktopfile.h>
|
||||
#include <kiconloader.h>
|
||||
#include <klocale.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <kmimetype.h>
|
||||
#include <kpopupmenu.h>
|
||||
#include <kpushbutton.h>
|
||||
#include <krun.h>
|
||||
#include <kstandarddirs.h>
|
||||
#include <kstringhandler.h>
|
||||
|
||||
Extras *Extras::_instance = 0;
|
||||
|
||||
// public
|
||||
|
||||
Extras::~Extras()
|
||||
{
|
||||
if (_idToFileMap)
|
||||
delete _idToFileMap;
|
||||
if (_menu)
|
||||
delete _menu;
|
||||
}
|
||||
|
||||
void Extras::createButton(QWidget *parent)
|
||||
{
|
||||
_button = new KPushButton(parent, "KPushButton::_button");
|
||||
_button->hide();
|
||||
_button->setPopup(_menu);
|
||||
MiscUtils::setHint(_button, i18n("More actions..."));
|
||||
setAction(QString::null, QString::null); /* evil */
|
||||
}
|
||||
|
||||
bool Extras::execAction() const
|
||||
{
|
||||
if (_fileToExecute.isNull())
|
||||
return false; // error
|
||||
|
||||
if (!execFile())
|
||||
{
|
||||
MiscUtils::showRunErrorMessage(_fileToExecute);
|
||||
|
||||
return false; // error
|
||||
}
|
||||
|
||||
return true; // ok
|
||||
}
|
||||
|
||||
QString Extras::getActionDescription() const
|
||||
{
|
||||
return
|
||||
_description.isEmpty()
|
||||
? QString::null
|
||||
// "Substitute characters at the middle of a string by \"...\""
|
||||
: KStringHandler::csqueeze(_description, 100);
|
||||
}
|
||||
|
||||
void Extras::setAction(const QString &fileToExecute, const QString &description, QIconSet *icon)
|
||||
{
|
||||
_description = description;
|
||||
_fileToExecute = fileToExecute;
|
||||
if (_fileToExecute.isNull())
|
||||
{
|
||||
_button->setText(i18n("Select a command..."));
|
||||
_button->setIconSet(ks_actions->getIcon(Action::Extras));
|
||||
}
|
||||
else
|
||||
{
|
||||
_button->setText(getActionDescription());
|
||||
if (!icon)
|
||||
_button->setIconSet(ks_actions->getIcon(Action::Extras));
|
||||
else
|
||||
_button->setIconSet(*icon);
|
||||
}
|
||||
}
|
||||
|
||||
// private
|
||||
|
||||
Extras::Extras()
|
||||
: QObject(ks_main, "Extras"),
|
||||
_idToFileMap(0) // initialized in getIdToFileMap()
|
||||
{
|
||||
_menu = new KPopupMenu(0, "KPopupMenu::_menu");
|
||||
connect(_menu, SIGNAL(aboutToShow()), SLOT(slotShowMenu()));
|
||||
connect(_menu, SIGNAL(activated(int)), SLOT(slotActivated(int)));
|
||||
}
|
||||
|
||||
// TODO: 2.0: recent items
|
||||
void Extras::buildMenu(KPopupMenu *parentMenu, const QString &subdir)
|
||||
{
|
||||
int id;
|
||||
QDir d(subdir);
|
||||
QFileInfo fi;
|
||||
QString
|
||||
description,
|
||||
icon,
|
||||
mimeType,
|
||||
name,
|
||||
path;
|
||||
|
||||
QStringList list = d.entryList(QDir::DefaultFilter, QDir::Name | QDir::DirsFirst);
|
||||
list.remove(".");
|
||||
list.remove("..");
|
||||
|
||||
uint count = list.count();
|
||||
for (uint i = 0; i < count; i++)
|
||||
{
|
||||
fi.setFile(d, list[i]);
|
||||
path = fi.filePath();
|
||||
|
||||
// dir
|
||||
if (fi.isDir())
|
||||
{
|
||||
KPopupMenu *submenu = new KPopupMenu(parentMenu, "KPopupMenu::submenu");
|
||||
connect(submenu, SIGNAL(activated(int)), SLOT(slotActivated(int)));
|
||||
|
||||
KDesktopFile *desktopFile = new KDesktopFile(path + "/.directory", true);
|
||||
if (desktopFile->getConfigState() != KConfigBase::NoAccess)
|
||||
{
|
||||
icon = desktopFile->readIcon();
|
||||
if (icon.isEmpty())
|
||||
icon = "folder";
|
||||
name = desktopFile->readName();
|
||||
if (name.isEmpty())
|
||||
name = fi.baseName();
|
||||
description = desktopFile->readComment();
|
||||
// add item
|
||||
parentMenu->insertItem(
|
||||
SmallIcon(icon),
|
||||
description.isEmpty() ? name : description,
|
||||
submenu
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// add item
|
||||
parentMenu->insertItem(SmallIcon("folder"), fi.baseName(), submenu);
|
||||
}
|
||||
delete desktopFile;
|
||||
|
||||
// recurse
|
||||
buildMenu(submenu, fi.filePath());
|
||||
}
|
||||
// file
|
||||
else if (fi.isFile())
|
||||
{
|
||||
mimeType = KMimeType::findByPath(path)->name();
|
||||
|
||||
if (mimeType == "application/x-trash")
|
||||
continue;
|
||||
|
||||
if (mimeType != "application/x-desktop")
|
||||
{
|
||||
// add item
|
||||
id = parentMenu->insertItem(
|
||||
KMimeType::pixmapForURL(KURL::fromPathOrURL(path)),
|
||||
fi.baseName()
|
||||
);
|
||||
// map item
|
||||
getIdToFileMap()->insert(id, path);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// application/x-desktop
|
||||
KDesktopFile *desktopFile = new KDesktopFile(path, true);
|
||||
if (desktopFile->getConfigState() != KConfigBase::NoAccess)
|
||||
{
|
||||
name = desktopFile->readName();
|
||||
if (name.isEmpty())
|
||||
name = desktopFile->readEntry("Exec");
|
||||
description = desktopFile->readComment();
|
||||
// add item
|
||||
id = parentMenu->insertItem(
|
||||
SmallIcon(desktopFile->readIcon()),
|
||||
description.isEmpty()
|
||||
? name
|
||||
: (description + " (" + name + ")")
|
||||
);
|
||||
// map item
|
||||
getIdToFileMap()->insert(id, path);
|
||||
}
|
||||
delete desktopFile;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool Extras::execFile() const
|
||||
{
|
||||
if (_fileToExecute.isNull())
|
||||
{
|
||||
// kdDebug() << "Extras::execFile(): No file to execute" << endl;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// HACK: It seems that KRun::runURL sometimes does not work for hibernate :/ ?
|
||||
QFileInfo fi(_fileToExecute);
|
||||
if (fi.fileName() == "hibernate.desktop") {
|
||||
kdDebug() << "Extras::execFile(): Using hacked run..." << endl;
|
||||
|
||||
pid_t pid = KRun::runCommand("kfmclient exec \"" + _fileToExecute + "\"");
|
||||
|
||||
return pid;
|
||||
}
|
||||
else {
|
||||
pid_t pid = KRun::runURL(
|
||||
KURL::fromPathOrURL(_fileToExecute),
|
||||
KMimeType::findByPath(_fileToExecute)->name()
|
||||
);
|
||||
|
||||
return pid;
|
||||
}
|
||||
}
|
||||
|
||||
QMap<int, QString> *Extras::getIdToFileMap()
|
||||
{
|
||||
if (!_idToFileMap)
|
||||
_idToFileMap = new QMap<int, QString>;
|
||||
|
||||
return _idToFileMap;
|
||||
}
|
||||
|
||||
// public slots
|
||||
|
||||
void Extras::slotModify()
|
||||
{
|
||||
KMessageBox::information(
|
||||
0,
|
||||
MiscUtils::HTML(
|
||||
i18n("Use context menu to add/edit/remove links.") +
|
||||
"<ul>" +
|
||||
"<li>" + i18n("Use <b>Context Menu</b> to create a new link to application") + "</li>" +
|
||||
"<li>" + i18n("Use <b>Create New|Folder...</b> to create a new submenu") + "</li>" +
|
||||
"<li>" + i18n("Use <b>Properties</b> to change icon, name, or comment") + "</li>" +
|
||||
"</ul>"
|
||||
),
|
||||
i18n("Extras"), // title
|
||||
"ModifyExtras" // config key
|
||||
);
|
||||
|
||||
// launch Konqueror as an item editor
|
||||
MiscUtils::runCommand("konqueror \"" + KGlobal::dirs()->saveLocation("data", "kshutdown/extras") + "\"");
|
||||
}
|
||||
|
||||
// private slots
|
||||
|
||||
void Extras::slotActivated(int id)
|
||||
{
|
||||
QMap<int, QString>::iterator i = getIdToFileMap()->find(id);
|
||||
if (i == getIdToFileMap()->end())
|
||||
{
|
||||
setAction(QString::null, QString::null);
|
||||
KMessageBox::error(
|
||||
0,
|
||||
"Internal error!\nSelected menu item is broken.",
|
||||
i18n("Extras")
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
setAction(i.data(), _menu->text(id), _menu->iconSet(id));
|
||||
}
|
||||
}
|
||||
|
||||
void Extras::slotShowMenu()
|
||||
{
|
||||
setAction(QString::null, QString::null);
|
||||
_menu->clear(); // reset menu
|
||||
getIdToFileMap()->clear(); // reset map
|
||||
QStringList extrasDirs(KGlobal::dirs()->findDirs("data", "kshutdown/extras"));
|
||||
QStringList::ConstIterator
|
||||
begin = extrasDirs.begin(),
|
||||
end = extrasDirs.end();
|
||||
for (QStringList::ConstIterator it = begin; it != end; ++it)
|
||||
{
|
||||
if ((it != begin) && (_menu->count() > 0))
|
||||
_menu->insertSeparator();
|
||||
buildMenu(_menu, *it);
|
||||
}
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
/*
|
||||
extras.h - Extras
|
||||
Copyright (C) 2004 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __EXTRAS_H__
|
||||
#define __EXTRAS_H__
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qiconset.h>
|
||||
|
||||
class KPopupMenu;
|
||||
class KPushButton;
|
||||
|
||||
#define ks_extras Extras::getInstance()
|
||||
|
||||
/** @short Extras - user commands stored in "extras" directory. */
|
||||
class Extras: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
virtual ~Extras();
|
||||
|
||||
/**
|
||||
* Returns the @b Extras button.
|
||||
*/
|
||||
inline KPushButton *button() const { return _button; }
|
||||
|
||||
/**
|
||||
* Creates the @b Extras button.
|
||||
* @param parent A parent widget
|
||||
*/
|
||||
void createButton(QWidget *parent);
|
||||
|
||||
/**
|
||||
* Executes an "extras" action previously selected from the menu.
|
||||
* @return @c false if error; otherwise @c true
|
||||
*/
|
||||
bool execAction() const;
|
||||
|
||||
/**
|
||||
* Returns a file name which will be executed by @ref execAction.
|
||||
*/
|
||||
inline QString fileToExecute() const { return _fileToExecute; }
|
||||
|
||||
/**
|
||||
* Returns a full description of the action,
|
||||
* or @c QString::null if no action.
|
||||
*/
|
||||
QString getActionDescription() const;
|
||||
|
||||
/**
|
||||
* Initializes and returns the instance of the "extras" manager.
|
||||
*/
|
||||
inline static Extras *getInstance()
|
||||
{
|
||||
if (!_instance)
|
||||
_instance = new Extras();
|
||||
|
||||
return _instance;
|
||||
}
|
||||
|
||||
void setAction(const QString &fileToExecute, const QString &description, QIconSet *icon = 0);
|
||||
private:
|
||||
static Extras *_instance;
|
||||
KPopupMenu *_menu;
|
||||
KPushButton *_button;
|
||||
QMap<int, QString> *_idToFileMap;
|
||||
QString
|
||||
_description,
|
||||
_fileToExecute;
|
||||
Extras();
|
||||
|
||||
/**
|
||||
* Reads "extras" directory and creates menu items.
|
||||
* @param parentMenu A parent menu
|
||||
* @param subdir A subdirectory
|
||||
*/
|
||||
void buildMenu(KPopupMenu *parentMenu, const QString &subdir);
|
||||
|
||||
bool execFile() const;
|
||||
QMap<int, QString> *getIdToFileMap();
|
||||
public slots:
|
||||
/**
|
||||
* Opens the "extras" directory in the @b Konqueror.
|
||||
*/
|
||||
void slotModify();
|
||||
private slots:
|
||||
void slotActivated(int id);
|
||||
|
||||
/**
|
||||
* Called before the popup menu is displayed.
|
||||
* All the menu items are initialized here.
|
||||
*/
|
||||
void slotShowMenu();
|
||||
};
|
||||
|
||||
#endif // __EXTRAS_H__
|
@ -0,0 +1,10 @@
|
||||
Id=kshutdown051
|
||||
File=kshutdownrc
|
||||
Group=Automation,Shut Down
|
||||
Key=RunCommandBeforeShutDown,RunCommandBeforeAction
|
||||
Key=CommandBeforeShutDown,CommandBeforeAction
|
||||
Key=CommandPause,CommandBeforeActionPause
|
||||
Group=Automation
|
||||
RemoveKey=RunCommandBeforeShutDown
|
||||
RemoveKey=CommandBeforeShutDown
|
||||
RemoveKey=CommandPause
|
@ -0,0 +1,98 @@
|
||||
/*
|
||||
kshutdowniface.h - KShutdown DCOP interface
|
||||
Copyright (C) 2003 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __KSHUTDOWNIFACE_H__
|
||||
#define __KSHUTDOWNIFACE_H__
|
||||
|
||||
#include <dcopobject.h>
|
||||
|
||||
/**
|
||||
* @short KShutDown DCOP interface (KShutdownIface).
|
||||
* See the KShutDown Handbook (F1) for details.
|
||||
*/
|
||||
class KShutdownIface: virtual public DCOPObject
|
||||
{
|
||||
K_DCOP
|
||||
public:
|
||||
k_dcop:
|
||||
|
||||
// general actions
|
||||
|
||||
/**
|
||||
* Cancels the current action.
|
||||
*/
|
||||
virtual ASYNC cancel() = 0;
|
||||
|
||||
/**
|
||||
* Executes the <b>Shut Down</b> action.
|
||||
*/
|
||||
virtual bool shutDown() = 0;
|
||||
|
||||
/**
|
||||
* @see shutDown
|
||||
*/
|
||||
virtual bool shutdown() = 0;
|
||||
|
||||
/**
|
||||
* Executes the @b Reboot" action.
|
||||
*/
|
||||
virtual bool reboot() = 0;
|
||||
|
||||
/**
|
||||
* Executes the <b>Lock Screen</b> action.
|
||||
*/
|
||||
virtual bool lockScreen() = 0;
|
||||
|
||||
/**
|
||||
* Executes the @b Logout action.
|
||||
*/
|
||||
virtual bool logout() = 0;
|
||||
|
||||
// misc. functions
|
||||
|
||||
/**
|
||||
* Shows the settings dialog.
|
||||
*/
|
||||
virtual ASYNC configure() = 0;
|
||||
|
||||
/**
|
||||
* Returns a KShutDown status information as text
|
||||
* (e.g. "Idle", "Busy", "1 minute warning", etc).
|
||||
* Can be used in Karamba themes, for example.
|
||||
*/
|
||||
virtual QString getStatusInfo() = 0;
|
||||
|
||||
/**
|
||||
* Hides the main window and its system tray icon.
|
||||
*/
|
||||
virtual void makeInvisible() = 0;
|
||||
|
||||
/**
|
||||
* Shows and raises the main window.
|
||||
* The window will be visible on the current desktop.
|
||||
*/
|
||||
virtual ASYNC makeVisible() = 0;
|
||||
|
||||
/**
|
||||
* Sets test mode to @p yes.
|
||||
*/
|
||||
virtual ASYNC setTestMode(bool yes) = 0;
|
||||
};
|
||||
|
||||
#endif // __KSHUTDOWNIFACE_H__
|
@ -0,0 +1,53 @@
|
||||
<!DOCTYPE DCOP-IDL><DCOP-IDL>
|
||||
<SOURCE>kshutdowniface.h</SOURCE>
|
||||
<INCLUDE>dcopobject.h</INCLUDE>
|
||||
<CLASS>
|
||||
<NAME>KShutdownIface</NAME>
|
||||
<SUPER>DCOPObject</SUPER>
|
||||
<FUNC>
|
||||
<TYPE>ASYNC</TYPE>
|
||||
<NAME>cancel</NAME>
|
||||
</FUNC>
|
||||
<FUNC>
|
||||
<TYPE>bool</TYPE>
|
||||
<NAME>shutDown</NAME>
|
||||
</FUNC>
|
||||
<FUNC>
|
||||
<TYPE>bool</TYPE>
|
||||
<NAME>shutdown</NAME>
|
||||
</FUNC>
|
||||
<FUNC>
|
||||
<TYPE>bool</TYPE>
|
||||
<NAME>reboot</NAME>
|
||||
</FUNC>
|
||||
<FUNC>
|
||||
<TYPE>bool</TYPE>
|
||||
<NAME>lockScreen</NAME>
|
||||
</FUNC>
|
||||
<FUNC>
|
||||
<TYPE>bool</TYPE>
|
||||
<NAME>logout</NAME>
|
||||
</FUNC>
|
||||
<FUNC>
|
||||
<TYPE>ASYNC</TYPE>
|
||||
<NAME>configure</NAME>
|
||||
</FUNC>
|
||||
<FUNC>
|
||||
<TYPE>QString</TYPE>
|
||||
<NAME>getStatusInfo</NAME>
|
||||
</FUNC>
|
||||
<FUNC>
|
||||
<TYPE>void</TYPE>
|
||||
<NAME>makeInvisible</NAME>
|
||||
</FUNC>
|
||||
<FUNC>
|
||||
<TYPE>ASYNC</TYPE>
|
||||
<NAME>makeVisible</NAME>
|
||||
</FUNC>
|
||||
<FUNC>
|
||||
<TYPE>ASYNC</TYPE>
|
||||
<NAME>setTestMode</NAME>
|
||||
<ARG><TYPE>bool</TYPE><NAME>yes</NAME></ARG>
|
||||
</FUNC>
|
||||
</CLASS>
|
||||
</DCOP-IDL>
|
@ -0,0 +1,135 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** DCOP Skeleton generated by dcopidl2cpp from kshutdowniface.kidl
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
#include "kshutdowniface.h"
|
||||
|
||||
#include <kdatastream.h>
|
||||
#include <qasciidict.h>
|
||||
|
||||
|
||||
static const int KShutdownIface_fhash = 13;
|
||||
static const char* const KShutdownIface_ftable[12][3] = {
|
||||
{ "ASYNC", "cancel()", "cancel()" },
|
||||
{ "bool", "shutDown()", "shutDown()" },
|
||||
{ "bool", "shutdown()", "shutdown()" },
|
||||
{ "bool", "reboot()", "reboot()" },
|
||||
{ "bool", "lockScreen()", "lockScreen()" },
|
||||
{ "bool", "logout()", "logout()" },
|
||||
{ "ASYNC", "configure()", "configure()" },
|
||||
{ "QString", "getStatusInfo()", "getStatusInfo()" },
|
||||
{ "void", "makeInvisible()", "makeInvisible()" },
|
||||
{ "ASYNC", "makeVisible()", "makeVisible()" },
|
||||
{ "ASYNC", "setTestMode(bool)", "setTestMode(bool yes)" },
|
||||
{ 0, 0, 0 }
|
||||
};
|
||||
static const int KShutdownIface_ftable_hiddens[11] = {
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
};
|
||||
|
||||
bool KShutdownIface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
|
||||
{
|
||||
static QAsciiDict<int>* fdict = 0;
|
||||
if ( !fdict ) {
|
||||
fdict = new QAsciiDict<int>( KShutdownIface_fhash, true, false );
|
||||
for ( int i = 0; KShutdownIface_ftable[i][1]; i++ )
|
||||
fdict->insert( KShutdownIface_ftable[i][1], new int( i ) );
|
||||
}
|
||||
int* fp = fdict->find( fun );
|
||||
switch ( fp?*fp:-1) {
|
||||
case 0: { // void cancel()
|
||||
replyType = KShutdownIface_ftable[0][0];
|
||||
cancel( );
|
||||
} break;
|
||||
case 1: { // bool shutDown()
|
||||
replyType = KShutdownIface_ftable[1][0];
|
||||
QDataStream _replyStream( replyData, IO_WriteOnly );
|
||||
_replyStream << shutDown( );
|
||||
} break;
|
||||
case 2: { // bool shutdown()
|
||||
replyType = KShutdownIface_ftable[2][0];
|
||||
QDataStream _replyStream( replyData, IO_WriteOnly );
|
||||
_replyStream << shutdown( );
|
||||
} break;
|
||||
case 3: { // bool reboot()
|
||||
replyType = KShutdownIface_ftable[3][0];
|
||||
QDataStream _replyStream( replyData, IO_WriteOnly );
|
||||
_replyStream << reboot( );
|
||||
} break;
|
||||
case 4: { // bool lockScreen()
|
||||
replyType = KShutdownIface_ftable[4][0];
|
||||
QDataStream _replyStream( replyData, IO_WriteOnly );
|
||||
_replyStream << lockScreen( );
|
||||
} break;
|
||||
case 5: { // bool logout()
|
||||
replyType = KShutdownIface_ftable[5][0];
|
||||
QDataStream _replyStream( replyData, IO_WriteOnly );
|
||||
_replyStream << logout( );
|
||||
} break;
|
||||
case 6: { // void configure()
|
||||
replyType = KShutdownIface_ftable[6][0];
|
||||
configure( );
|
||||
} break;
|
||||
case 7: { // QString getStatusInfo()
|
||||
replyType = KShutdownIface_ftable[7][0];
|
||||
QDataStream _replyStream( replyData, IO_WriteOnly );
|
||||
_replyStream << getStatusInfo( );
|
||||
} break;
|
||||
case 8: { // void makeInvisible()
|
||||
replyType = KShutdownIface_ftable[8][0];
|
||||
makeInvisible( );
|
||||
} break;
|
||||
case 9: { // void makeVisible()
|
||||
replyType = KShutdownIface_ftable[9][0];
|
||||
makeVisible( );
|
||||
} break;
|
||||
case 10: { // void setTestMode(bool)
|
||||
bool arg0;
|
||||
QDataStream arg( data, IO_ReadOnly );
|
||||
if (arg.atEnd()) return false;
|
||||
arg >> arg0;
|
||||
replyType = KShutdownIface_ftable[10][0];
|
||||
setTestMode(arg0 );
|
||||
} break;
|
||||
default:
|
||||
return DCOPObject::process( fun, data, replyType, replyData );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
QCStringList KShutdownIface::interfaces()
|
||||
{
|
||||
QCStringList ifaces = DCOPObject::interfaces();
|
||||
ifaces += "KShutdownIface";
|
||||
return ifaces;
|
||||
}
|
||||
|
||||
QCStringList KShutdownIface::functions()
|
||||
{
|
||||
QCStringList funcs = DCOPObject::functions();
|
||||
for ( int i = 0; KShutdownIface_ftable[i][2]; i++ ) {
|
||||
if (KShutdownIface_ftable_hiddens[i])
|
||||
continue;
|
||||
QCString func = KShutdownIface_ftable[i][0];
|
||||
func += ' ';
|
||||
func += KShutdownIface_ftable[i][2];
|
||||
funcs << func;
|
||||
}
|
||||
return funcs;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,229 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** DCOP Stub Implementation created by dcopidl2cpp from kshutdowniface.kidl
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
#include "kshutdowniface_stub.h"
|
||||
#include <dcopclient.h>
|
||||
|
||||
#include <kdatastream.h>
|
||||
|
||||
|
||||
KShutdownIface_stub::KShutdownIface_stub( const QCString& app, const QCString& obj )
|
||||
: DCOPStub( app, obj )
|
||||
{
|
||||
}
|
||||
|
||||
KShutdownIface_stub::KShutdownIface_stub( DCOPClient* client, const QCString& app, const QCString& obj )
|
||||
: DCOPStub( client, app, obj )
|
||||
{
|
||||
}
|
||||
|
||||
KShutdownIface_stub::KShutdownIface_stub( const DCOPRef& ref )
|
||||
: DCOPStub( ref )
|
||||
{
|
||||
}
|
||||
|
||||
void KShutdownIface_stub::cancel()
|
||||
{
|
||||
if ( !dcopClient() ) {
|
||||
setStatus( CallFailed );
|
||||
return;
|
||||
}
|
||||
QByteArray data;
|
||||
dcopClient()->send( app(), obj(), "cancel()", data );
|
||||
setStatus( CallSucceeded );
|
||||
}
|
||||
|
||||
bool KShutdownIface_stub::shutDown()
|
||||
{
|
||||
bool result = false;
|
||||
if ( !dcopClient() ) {
|
||||
setStatus( CallFailed );
|
||||
return result;
|
||||
}
|
||||
QByteArray data, replyData;
|
||||
QCString replyType;
|
||||
if ( dcopClient()->call( app(), obj(), "shutDown()", data, replyType, replyData ) ) {
|
||||
if ( replyType == "bool" ) {
|
||||
QDataStream _reply_stream( replyData, IO_ReadOnly );
|
||||
_reply_stream >> result;
|
||||
setStatus( CallSucceeded );
|
||||
} else {
|
||||
callFailed();
|
||||
}
|
||||
} else {
|
||||
callFailed();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool KShutdownIface_stub::shutdown()
|
||||
{
|
||||
bool result = false;
|
||||
if ( !dcopClient() ) {
|
||||
setStatus( CallFailed );
|
||||
return result;
|
||||
}
|
||||
QByteArray data, replyData;
|
||||
QCString replyType;
|
||||
if ( dcopClient()->call( app(), obj(), "shutdown()", data, replyType, replyData ) ) {
|
||||
if ( replyType == "bool" ) {
|
||||
QDataStream _reply_stream( replyData, IO_ReadOnly );
|
||||
_reply_stream >> result;
|
||||
setStatus( CallSucceeded );
|
||||
} else {
|
||||
callFailed();
|
||||
}
|
||||
} else {
|
||||
callFailed();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool KShutdownIface_stub::reboot()
|
||||
{
|
||||
bool result = false;
|
||||
if ( !dcopClient() ) {
|
||||
setStatus( CallFailed );
|
||||
return result;
|
||||
}
|
||||
QByteArray data, replyData;
|
||||
QCString replyType;
|
||||
if ( dcopClient()->call( app(), obj(), "reboot()", data, replyType, replyData ) ) {
|
||||
if ( replyType == "bool" ) {
|
||||
QDataStream _reply_stream( replyData, IO_ReadOnly );
|
||||
_reply_stream >> result;
|
||||
setStatus( CallSucceeded );
|
||||
} else {
|
||||
callFailed();
|
||||
}
|
||||
} else {
|
||||
callFailed();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool KShutdownIface_stub::lockScreen()
|
||||
{
|
||||
bool result = false;
|
||||
if ( !dcopClient() ) {
|
||||
setStatus( CallFailed );
|
||||
return result;
|
||||
}
|
||||
QByteArray data, replyData;
|
||||
QCString replyType;
|
||||
if ( dcopClient()->call( app(), obj(), "lockScreen()", data, replyType, replyData ) ) {
|
||||
if ( replyType == "bool" ) {
|
||||
QDataStream _reply_stream( replyData, IO_ReadOnly );
|
||||
_reply_stream >> result;
|
||||
setStatus( CallSucceeded );
|
||||
} else {
|
||||
callFailed();
|
||||
}
|
||||
} else {
|
||||
callFailed();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool KShutdownIface_stub::logout()
|
||||
{
|
||||
bool result = false;
|
||||
if ( !dcopClient() ) {
|
||||
setStatus( CallFailed );
|
||||
return result;
|
||||
}
|
||||
QByteArray data, replyData;
|
||||
QCString replyType;
|
||||
if ( dcopClient()->call( app(), obj(), "logout()", data, replyType, replyData ) ) {
|
||||
if ( replyType == "bool" ) {
|
||||
QDataStream _reply_stream( replyData, IO_ReadOnly );
|
||||
_reply_stream >> result;
|
||||
setStatus( CallSucceeded );
|
||||
} else {
|
||||
callFailed();
|
||||
}
|
||||
} else {
|
||||
callFailed();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void KShutdownIface_stub::configure()
|
||||
{
|
||||
if ( !dcopClient() ) {
|
||||
setStatus( CallFailed );
|
||||
return;
|
||||
}
|
||||
QByteArray data;
|
||||
dcopClient()->send( app(), obj(), "configure()", data );
|
||||
setStatus( CallSucceeded );
|
||||
}
|
||||
|
||||
QString KShutdownIface_stub::getStatusInfo()
|
||||
{
|
||||
QString result;
|
||||
if ( !dcopClient() ) {
|
||||
setStatus( CallFailed );
|
||||
return result;
|
||||
}
|
||||
QByteArray data, replyData;
|
||||
QCString replyType;
|
||||
if ( dcopClient()->call( app(), obj(), "getStatusInfo()", data, replyType, replyData ) ) {
|
||||
if ( replyType == "QString" ) {
|
||||
QDataStream _reply_stream( replyData, IO_ReadOnly );
|
||||
_reply_stream >> result;
|
||||
setStatus( CallSucceeded );
|
||||
} else {
|
||||
callFailed();
|
||||
}
|
||||
} else {
|
||||
callFailed();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void KShutdownIface_stub::makeInvisible()
|
||||
{
|
||||
if ( !dcopClient() ) {
|
||||
setStatus( CallFailed );
|
||||
return;
|
||||
}
|
||||
QByteArray data, replyData;
|
||||
QCString replyType;
|
||||
if ( dcopClient()->call( app(), obj(), "makeInvisible()", data, replyType, replyData ) ) {
|
||||
setStatus( CallSucceeded );
|
||||
} else {
|
||||
callFailed();
|
||||
}
|
||||
}
|
||||
|
||||
void KShutdownIface_stub::makeVisible()
|
||||
{
|
||||
if ( !dcopClient() ) {
|
||||
setStatus( CallFailed );
|
||||
return;
|
||||
}
|
||||
QByteArray data;
|
||||
dcopClient()->send( app(), obj(), "makeVisible()", data );
|
||||
setStatus( CallSucceeded );
|
||||
}
|
||||
|
||||
void KShutdownIface_stub::setTestMode( bool arg0 )
|
||||
{
|
||||
if ( !dcopClient() ) {
|
||||
setStatus( CallFailed );
|
||||
return;
|
||||
}
|
||||
QByteArray data;
|
||||
QDataStream arg( data, IO_WriteOnly );
|
||||
arg << arg0;
|
||||
dcopClient()->send( app(), obj(), "setTestMode(bool)", data );
|
||||
setStatus( CallSucceeded );
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,38 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** DCOP Stub Definition created by dcopidl2cpp from kshutdowniface.kidl
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __KSHUTDOWNIFACE_STUB__
|
||||
#define __KSHUTDOWNIFACE_STUB__
|
||||
|
||||
#include <dcopstub.h>
|
||||
#include <dcopobject.h>
|
||||
|
||||
|
||||
class KShutdownIface_stub : virtual public DCOPStub
|
||||
{
|
||||
public:
|
||||
KShutdownIface_stub( const QCString& app, const QCString& id );
|
||||
KShutdownIface_stub( DCOPClient* client, const QCString& app, const QCString& id );
|
||||
explicit KShutdownIface_stub( const DCOPRef& ref );
|
||||
virtual ASYNC cancel();
|
||||
virtual bool shutDown();
|
||||
virtual bool shutdown();
|
||||
virtual bool reboot();
|
||||
virtual bool lockScreen();
|
||||
virtual bool logout();
|
||||
virtual ASYNC configure();
|
||||
virtual QString getStatusInfo();
|
||||
virtual void makeInvisible();
|
||||
virtual ASYNC makeVisible();
|
||||
virtual ASYNC setTestMode( bool yes );
|
||||
protected:
|
||||
KShutdownIface_stub() : DCOPStub( never_use ) {};
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@ -0,0 +1,210 @@
|
||||
/*
|
||||
links.cpp - A link creator/remover
|
||||
Copyright (C) 2004 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "actions.h"
|
||||
#include "links.h"
|
||||
#include "miscutils.h"
|
||||
|
||||
#include <qcombobox.h>
|
||||
#include <qfile.h>
|
||||
#include <qlabel.h>
|
||||
|
||||
#include <kapplication.h>
|
||||
#include <kdesktopfile.h>
|
||||
#include <kglobalsettings.h>
|
||||
#include <kiconloader.h>
|
||||
#include <klocale.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <kpushbutton.h>
|
||||
#include <kstandarddirs.h>
|
||||
|
||||
// public
|
||||
|
||||
Links::Links(QWidget *parent)
|
||||
: QVBox(parent, "Links")
|
||||
{
|
||||
setSpacing(5);
|
||||
int alignment = AlignVCenter;
|
||||
alignment |= kapp->reverseLayout() ? AlignLeft : AlignRight;
|
||||
|
||||
|
||||
// location
|
||||
QHBox *w_location = new QHBox(this);
|
||||
w_location->setSpacing(5);
|
||||
QLabel *l_location = new QLabel(i18n("Location where to create the link:"), w_location);
|
||||
l_location->setAlignment(alignment);
|
||||
cb_location = new QComboBox(w_location, "QComboBox::cb_location");
|
||||
cb_location->setFocusPolicy(StrongFocus);
|
||||
cb_location->insertItem(SmallIcon("desktop"), i18n("Desktop"));
|
||||
cb_location->insertItem(SmallIcon("kmenu"), i18n("K Menu"));
|
||||
l_location->setBuddy(cb_location);
|
||||
connect(cb_location, SIGNAL(activated(int)), SLOT(slotActivated(int)));
|
||||
|
||||
// type
|
||||
QHBox *w_type = new QHBox(this);
|
||||
w_type->setSpacing(5);
|
||||
QLabel *l_type = new QLabel(i18n("Type of the link:"), w_type);
|
||||
l_type->setAlignment(alignment);
|
||||
cb_type = new QComboBox(w_type, "QComboBox::cb_type");
|
||||
cb_type->setFocusPolicy(StrongFocus);
|
||||
cb_type->insertItem(kapp->miniIcon(), "KShutDown");
|
||||
|
||||
// NOTE: slotAddRemoveLink()
|
||||
cb_type->insertItem(SmallIcon("exit"), i18n("Standard Logout Dialog"));
|
||||
|
||||
cb_type->insertItem(ks_actions->getIcon(Action::ShutDown), ks_actions->getName(Action::ShutDown));
|
||||
cb_type->insertItem(ks_actions->getIcon(Action::Reboot), ks_actions->getName(Action::Reboot));
|
||||
cb_type->insertItem(ks_actions->getIcon(Action::LockScreen), ks_actions->getName(Action::LockScreen));
|
||||
cb_type->insertItem(ks_actions->getIcon(Action::Logout), ks_actions->getName(Action::Logout));
|
||||
l_type->setBuddy(cb_type);
|
||||
connect(cb_type, SIGNAL(activated(int)), SLOT(slotActivated(int)));
|
||||
|
||||
// add/remove link
|
||||
b_addRemoveLink = new KPushButton(this, "KPushButton::b_addRemoveLink");
|
||||
connect(b_addRemoveLink, SIGNAL(clicked()), SLOT(slotAddRemoveLink()));
|
||||
|
||||
updateAddRemoveButton();
|
||||
}
|
||||
|
||||
void Links::createLink(const QString &path, const QString &command, const QString &icon, const QString &name, const QString &comment)
|
||||
{
|
||||
if (path.isNull())
|
||||
return;
|
||||
|
||||
KDesktopFile *df = new KDesktopFile(path);
|
||||
df->setGroup("Desktop Entry");
|
||||
df->writeEntry("Comment", comment);
|
||||
df->writeEntry("Encoding", "UTF-8");
|
||||
df->writeEntry("Exec", command);
|
||||
df->writeEntry("GenericName", i18n("System Shut Down Utility"));
|
||||
df->writeEntry("Icon", icon);
|
||||
df->writeEntry("Name", name);
|
||||
df->writeEntry("StartupNotify", "false");
|
||||
df->writeEntry("Type", "Application");
|
||||
delete df;
|
||||
|
||||
if (!QFile::exists(path))
|
||||
{
|
||||
KMessageBox::error(
|
||||
0,
|
||||
MiscUtils::HTML(i18n("Could not create file <b>%1</b>!").arg(path))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void Links::removeLink(const QString &path)
|
||||
{
|
||||
if (QFile::exists(path) && !QFile::remove(path))
|
||||
{
|
||||
KMessageBox::error(
|
||||
0,
|
||||
MiscUtils::HTML(i18n("Could not remove file <b>%1</b>!").arg(path))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// private
|
||||
|
||||
QString Links::getCurrentLocationPath() const
|
||||
{
|
||||
QString path;
|
||||
switch (cb_location->currentItem())
|
||||
{
|
||||
case 0:
|
||||
path = KGlobalSettings::desktopPath() + "/";
|
||||
break;
|
||||
case 1:
|
||||
path = locateLocal("apps", "") + "/";
|
||||
break;
|
||||
default:
|
||||
return QString::null;
|
||||
}
|
||||
switch (cb_type->currentItem())
|
||||
{
|
||||
case 0: return path += "kshutdown-classic.desktop";
|
||||
case 1: return path += "kshutdown-standard.desktop";
|
||||
case 2: return path += "kshutdown-shutdown.desktop";
|
||||
case 3: return path += "kshutdown-reboot.desktop";
|
||||
case 4: return path += "kshutdown-lock.desktop";
|
||||
case 5: return path += "kshutdown-logout.desktop";
|
||||
default: return QString::null;
|
||||
}
|
||||
}
|
||||
|
||||
QString Links::getCurrentTypeCommand() const
|
||||
{
|
||||
switch (cb_type->currentItem())
|
||||
{
|
||||
case 0: return "kshutdown";
|
||||
case 1: return "kshutdown --standard";
|
||||
case 2: return "kshutdown --confirm --shutdown";
|
||||
case 3: return "kshutdown --confirm --reboot";
|
||||
case 4: return "kshutdown --confirm --lock";
|
||||
case 5: return "kshutdown --confirm --logout";
|
||||
default: return QString::null;
|
||||
}
|
||||
}
|
||||
|
||||
QString Links::getCurrentTypeIcon() const
|
||||
{
|
||||
switch (cb_type->currentItem())
|
||||
{
|
||||
case 0: return "kshutdown";
|
||||
case 1: return "exit";
|
||||
// sync. with Action::getIcon
|
||||
case 2: return "exit";
|
||||
case 3: return "reload";
|
||||
case 4: return "lock";
|
||||
case 5: return "undo";
|
||||
default: return QString::null;
|
||||
}
|
||||
}
|
||||
|
||||
void Links::updateAddRemoveButton() {
|
||||
if (QFile::exists(getCurrentLocationPath())) {
|
||||
b_addRemoveLink->setIconSet(SmallIcon("editdelete"));
|
||||
b_addRemoveLink->setText(i18n("Remove Link"));
|
||||
}
|
||||
else {
|
||||
b_addRemoveLink->setIconSet(SmallIcon("filenew"));
|
||||
b_addRemoveLink->setText(i18n("Add Link"));
|
||||
}
|
||||
}
|
||||
|
||||
// private slots
|
||||
|
||||
void Links::slotActivated(int/* index*/) {
|
||||
updateAddRemoveButton();
|
||||
}
|
||||
|
||||
void Links::slotAddRemoveLink() {
|
||||
if (QFile::exists(getCurrentLocationPath())) {
|
||||
removeLink(getCurrentLocationPath());
|
||||
}
|
||||
else {
|
||||
createLink(
|
||||
getCurrentLocationPath(),
|
||||
getCurrentTypeCommand(),
|
||||
getCurrentTypeIcon(),
|
||||
(cb_type->currentItem() == 1) ? i18n("Logout") : cb_type->currentText(),
|
||||
cb_type->currentText()
|
||||
);
|
||||
}
|
||||
updateAddRemoveButton();
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
/*
|
||||
links.h - A link creator/remover
|
||||
Copyright (C) 2004 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __LINKS_H__
|
||||
#define __LINKS_H__
|
||||
|
||||
#include <qvbox.h>
|
||||
|
||||
class KPushButton;
|
||||
class QComboBox;
|
||||
|
||||
/** @short A link creator/remover. */
|
||||
class Links: public QVBox
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
* @param parent A parent widget
|
||||
*/
|
||||
Links(QWidget *parent);
|
||||
|
||||
/**
|
||||
* Creates a new <b>.desktop</b> file.
|
||||
* @param path A path to the <b>.desktop</b> file
|
||||
* @param command A command to execute
|
||||
* @param icon An icon name
|
||||
* @param name A link name
|
||||
* @param comment A comment
|
||||
*/
|
||||
static void createLink(
|
||||
const QString &path,
|
||||
const QString &command,
|
||||
const QString &icon,
|
||||
const QString &name,
|
||||
const QString &comment
|
||||
);
|
||||
|
||||
/**
|
||||
* Removes a <b>.desktop</b> file.
|
||||
* @param path A <b>.desktop</b> file to remove
|
||||
*/
|
||||
static void removeLink(const QString &path);
|
||||
private:
|
||||
KPushButton *b_addRemoveLink;
|
||||
QComboBox
|
||||
*cb_location,
|
||||
*cb_type;
|
||||
QString getCurrentLocationPath() const;
|
||||
QString getCurrentTypeCommand() const;
|
||||
QString getCurrentTypeIcon() const;
|
||||
void updateAddRemoveButton();
|
||||
private slots:
|
||||
void slotActivated(int index);
|
||||
void slotAddRemoveLink();
|
||||
};
|
||||
|
||||
#endif // __LINKS_H__
|
@ -0,0 +1,225 @@
|
||||
/*
|
||||
mactioneditsdialog.cpp - An action editor
|
||||
Copyright (C) 2003 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "configuration.h"
|
||||
#include "mactioneditdialog.h"
|
||||
#include "miscutils.h"
|
||||
#include "mtip.h"
|
||||
|
||||
#include <qcheckbox.h>
|
||||
#include <qcombobox.h>
|
||||
#include <qhbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlayout.h>
|
||||
#include <qvbox.h>
|
||||
#include <qvgroupbox.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
#include <klineedit.h>
|
||||
#include <klocale.h>
|
||||
#include <knuminput.h>
|
||||
#include <kpushbutton.h>
|
||||
|
||||
MActionEditDialog::MActionEditDialog(QWidget *parent, Action::Type action)
|
||||
: KDialogBase(
|
||||
parent,
|
||||
"MActionEditDialog",
|
||||
true,
|
||||
"",
|
||||
Default | Ok | Cancel,
|
||||
Ok, // default button
|
||||
true
|
||||
),
|
||||
_action(action),
|
||||
_userCommand("")
|
||||
{
|
||||
QVBox *main = new QVBox(this);
|
||||
setMainWidget(main);
|
||||
|
||||
// title
|
||||
l_title = new QLabel(main);
|
||||
QFont f = QFont(l_title->font());
|
||||
f.setPointSize(16);
|
||||
l_title->setFont(f);
|
||||
l_title->setMargin(10);
|
||||
|
||||
QHBox *gb_south = new QHBox(main);
|
||||
gb_south->setSpacing(5);
|
||||
|
||||
QVBox *gb_widgets = new QVBox(gb_south);
|
||||
|
||||
QVGroupBox *gb_method = new QVGroupBox(i18n("Method"), gb_widgets);
|
||||
|
||||
// method label
|
||||
QLabel *l_method = new QLabel(i18n("Select a method:"), gb_method);
|
||||
|
||||
// method combo box
|
||||
_methods = new QComboBox(gb_method, "QComboBox::_methods");
|
||||
_methods->setFocusPolicy(StrongFocus);
|
||||
_methods->insertItem(i18n("KDE (default)"));
|
||||
l_method->setBuddy(_methods);
|
||||
connect(_methods, SIGNAL(activated(int)), SLOT(slotMethodChange(int)));
|
||||
|
||||
// command label
|
||||
l_command = new QLabel(i18n("Enter a custom command:"), gb_method);
|
||||
|
||||
// command edit line
|
||||
in_command = new KLineEdit(gb_method, "KLineEdit::in_command");
|
||||
l_command->setBuddy(in_command);
|
||||
|
||||
QVGroupBox *gb_commandBeforeAction = new QVGroupBox(i18n("Command before action"), gb_widgets);
|
||||
c_runCommandBeforeAction = new QCheckBox(i18n("Run command"), gb_commandBeforeAction);
|
||||
i_commandBeforeAction = new KLineEdit(gb_commandBeforeAction, "KLineEdit::i_commandBeforeAction");
|
||||
i_commandBeforeActionPause = new KIntNumInput(gb_commandBeforeAction, "KIntNumInput::i_commandBeforeActionPause");
|
||||
i_commandBeforeActionPause->setLabel(i18n("Pause after run command:"));
|
||||
i_commandBeforeActionPause->setRange(0, 300, 1, true);
|
||||
i_commandBeforeActionPause->setSpecialValueText(i18n("No pause"));
|
||||
i_commandBeforeActionPause->setSuffix(" " + i18n("second(s)"));
|
||||
b_testCommandBeforeAction = new KPushButton(KStdGuiItem::test(), gb_commandBeforeAction, "KPushButton::b_testCommandBeforeAction");
|
||||
connect(b_testCommandBeforeAction, SIGNAL(clicked()), SLOT(slotTestCommandBeforeAction()));
|
||||
connect(
|
||||
c_runCommandBeforeAction, SIGNAL(toggled(bool)),
|
||||
i_commandBeforeAction, SLOT(setEnabled(bool)));
|
||||
connect(
|
||||
c_runCommandBeforeAction, SIGNAL(toggled(bool)),
|
||||
i_commandBeforeActionPause, SLOT(setEnabled(bool)));
|
||||
connect(
|
||||
c_runCommandBeforeAction, SIGNAL(toggled(bool)),
|
||||
b_testCommandBeforeAction, SLOT(setEnabled(bool)));
|
||||
|
||||
MTip *t_progs = new MTip(MTip::Warning, gb_south);
|
||||
t_progs->setTipText(
|
||||
MiscUtils::HTML(
|
||||
i18n("In most cases you need privileges to shut down system (e.g. run /sbin/shutdown)") + "<br>" \
|
||||
"<ul>" \
|
||||
"<li>" + i18n("If you are using <b>KDE</b> and <b>KDM</b> (KDE Display Manager), then set all methods to <i>KDE</i>") + "</li>" \
|
||||
"<li>" + i18n("If you are using <b>KDE</b> and display manager different than <b>KDM</b>, then set <i>Turn Off Computer</i> and <i>Restart Computer</i> methods to <i>/sbin/...</i>") + "</li>" \
|
||||
"</ul>" +
|
||||
i18n("Manuals:") +
|
||||
"<ul>" \
|
||||
"<li><a href=\"man:/halt\">halt, poweroff, reboot</a></li>" \
|
||||
"<li><a href=\"man:/shutdown\">shutdown</a></li>" \
|
||||
"<li><a href=\"man:/xlock\">xlock</a></li>" \
|
||||
"<li><a href=\"man:/xscreensaver-command\">xscreensaver-command</a></li>" \
|
||||
"</ul>" \
|
||||
)
|
||||
);
|
||||
|
||||
connect(this, SIGNAL(okClicked()), SLOT(slotOKClicked()));
|
||||
|
||||
Action::Method m = Action::Method_KDE;
|
||||
QString c;
|
||||
QString group = ks_actions->actionToConfigGroup(_action);
|
||||
_methods->insertItem(ks_actions->getMethod(_action, m, c));
|
||||
|
||||
QString s = ks_actions->getName(_action);
|
||||
l_title->setText(s);
|
||||
setCaption(s);
|
||||
|
||||
_methods->insertItem(i18n("User Command"));
|
||||
|
||||
// method
|
||||
_userCommand = c;
|
||||
setMethod(m);
|
||||
|
||||
// command before action
|
||||
KConfig *conf = kshutdownrc->config();
|
||||
conf->setGroup(group);
|
||||
c_runCommandBeforeAction->setChecked(conf->readBoolEntry("RunCommandBeforeAction", false));
|
||||
i_commandBeforeAction->setText(conf->readEntry("CommandBeforeAction", ""));
|
||||
i_commandBeforeActionPause->setValue(conf->readNumEntry("CommandBeforeActionPause", 10));
|
||||
|
||||
bool runCommand = c_runCommandBeforeAction->isChecked();
|
||||
i_commandBeforeAction->setEnabled(runCommand);
|
||||
i_commandBeforeActionPause->setEnabled(runCommand);
|
||||
b_testCommandBeforeAction->setEnabled(runCommand);
|
||||
_methods->setFocus();
|
||||
|
||||
adjustSize();
|
||||
disableResize();
|
||||
}
|
||||
|
||||
MActionEditDialog::~MActionEditDialog()
|
||||
{
|
||||
}
|
||||
|
||||
void MActionEditDialog::setMethod(const Action::Method method) const
|
||||
{
|
||||
_methods->setCurrentItem(method);
|
||||
l_command->setEnabled(method == Action::Method_UserCommand);
|
||||
in_command->setEnabled(method == Action::Method_UserCommand);
|
||||
switch (method)
|
||||
{
|
||||
case Action::Method_KDE:
|
||||
in_command->setText("");
|
||||
break;
|
||||
case Action::Method_DefaultCommand:
|
||||
in_command->setText(_methods->text(Action::Method_DefaultCommand));
|
||||
break;
|
||||
case Action::Method_UserCommand:
|
||||
in_command->setText(_userCommand);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void MActionEditDialog::slotDefault()
|
||||
{
|
||||
setMethod(Action::Method_KDE);
|
||||
c_runCommandBeforeAction->setChecked(false);
|
||||
i_commandBeforeAction->clear();
|
||||
i_commandBeforeActionPause->setValue(10);
|
||||
}
|
||||
|
||||
void MActionEditDialog::slotMethodChange(int index)
|
||||
{
|
||||
if (in_command->isEnabled())
|
||||
_userCommand = in_command->text();
|
||||
setMethod((Action::Method)index);
|
||||
}
|
||||
|
||||
void MActionEditDialog::slotOKClicked()
|
||||
{
|
||||
Action::Method m;
|
||||
QString c;
|
||||
QString group = ks_actions->actionToConfigGroup(_action);
|
||||
|
||||
// method
|
||||
m = (Action::Method)_methods->currentItem();
|
||||
if (m == Action::Method_UserCommand)
|
||||
c = in_command->text();
|
||||
else
|
||||
c = "";
|
||||
ks_actions->setMethod(group, m, c);
|
||||
|
||||
// command before action
|
||||
KConfig *conf = kshutdownrc->config();
|
||||
conf->setGroup(group);
|
||||
conf->writeEntry("RunCommandBeforeAction", c_runCommandBeforeAction->isChecked());
|
||||
conf->writeEntry("CommandBeforeAction", i_commandBeforeAction->text());
|
||||
conf->writeEntry("CommandBeforeActionPause", i_commandBeforeActionPause->value());
|
||||
}
|
||||
|
||||
void MActionEditDialog::slotTestCommandBeforeAction()
|
||||
{
|
||||
MiscUtils::runShellCommand(
|
||||
i_commandBeforeAction->text(),
|
||||
KProcess::DontCare,
|
||||
i_commandBeforeActionPause->value()
|
||||
);
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
/*
|
||||
mactioneditsdialog.h - An action editor
|
||||
Copyright (C) 2003 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __MACTIONEDITDIALOG_H__
|
||||
#define __MACTIONEDITDIALOG_H__
|
||||
|
||||
#include "actions.h"
|
||||
|
||||
#include <kdialogbase.h>
|
||||
|
||||
class QCheckBox;
|
||||
class QComboBox;
|
||||
|
||||
class KIntNumInput;
|
||||
class KLineEdit;
|
||||
class KPushButton;
|
||||
|
||||
/**
|
||||
* @short An action editor.
|
||||
* Used in @ref MSettingsDialog.
|
||||
*/
|
||||
class MActionEditDialog: public KDialogBase
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
* @param parent A parent widget
|
||||
* @param action An action type to edit
|
||||
*/
|
||||
MActionEditDialog(QWidget *parent, const Action::Type action);
|
||||
|
||||
/** Destructor. */
|
||||
virtual ~MActionEditDialog();
|
||||
private:
|
||||
Action::Type _action;
|
||||
QComboBox *_methods;
|
||||
QLabel
|
||||
*l_command,
|
||||
*l_title;
|
||||
QString _userCommand;
|
||||
KLineEdit *in_command;
|
||||
// command before action
|
||||
QCheckBox *c_runCommandBeforeAction;
|
||||
KLineEdit *i_commandBeforeAction;
|
||||
KIntNumInput *i_commandBeforeActionPause;
|
||||
KPushButton *b_testCommandBeforeAction;
|
||||
void setMethod(const Action::Method method) const;
|
||||
protected slots:
|
||||
/**
|
||||
* Sets default values.
|
||||
*/
|
||||
virtual void slotDefault();
|
||||
private slots:
|
||||
void slotMethodChange(int index);
|
||||
void slotOKClicked();
|
||||
void slotTestCommandBeforeAction();
|
||||
};
|
||||
|
||||
#endif // __MACTIONEDITDIALOG_H__
|
@ -0,0 +1,393 @@
|
||||
/*
|
||||
main.cpp - KShutDown
|
||||
Copyright (C) 2003 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "actions.h"
|
||||
#include "configuration.h"
|
||||
#include "extras.h"
|
||||
#include "miscutils.h"
|
||||
#include "mmainwindow.h"
|
||||
#include "msystemtray.h"
|
||||
|
||||
#include <qfileinfo.h>
|
||||
|
||||
#include <kaboutdata.h>
|
||||
#include <kcmdlineargs.h>
|
||||
#include <klocale.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <kuniqueapplication.h>
|
||||
|
||||
// 0.1.x, 0.3.x, etc - Unstable, Beta
|
||||
// 0.2.x, 0.4.x, etc - Stable
|
||||
QString version = "1.0.4";
|
||||
|
||||
KAboutData aboutData(
|
||||
"kshutdown", // internal name
|
||||
"KShutDown", // full name
|
||||
version,
|
||||
I18N_NOOP("A Shut Down Utility for KDE"), // description
|
||||
KAboutData::License_GPL_V2, // license
|
||||
"(C) 2003-3000 Konrad Twardowski", // copyright
|
||||
"", // text
|
||||
"http://kshutdown.sourceforge.net/", // project page
|
||||
"kdtonline@poczta.onet.pl" // bugs
|
||||
);
|
||||
|
||||
static KCmdLineOptions options[] =
|
||||
{
|
||||
{ "s", 0, 0 },
|
||||
{ "shutdown", I18N_NOOP("Turn off computer"), 0 },
|
||||
{ "h", 0, 0 },
|
||||
{ "halt", I18N_NOOP("Turn off computer"), 0 },
|
||||
{ "r", 0, 0 },
|
||||
{ "reboot", I18N_NOOP("Restart computer"), 0 },
|
||||
{ "k", 0, 0 },
|
||||
{ "lock", I18N_NOOP("Lock session"), 0 },
|
||||
{ "l", 0, 0 },
|
||||
{ "logout", I18N_NOOP("End current session"), 0 },
|
||||
{ "e", 0, 0 },
|
||||
{ "extra <file>", I18N_NOOP("Execute \"Extras\" command (.desktop file)"), 0 },
|
||||
{ "confirm", I18N_NOOP("Confirm command line action"), 0 },
|
||||
{ "standard", I18N_NOOP("Show standard logout dialog"), 0 },
|
||||
{ "c", 0, 0 },
|
||||
{ "cancel", I18N_NOOP("Cancel an active action"), 0 },
|
||||
{ "init", I18N_NOOP("Don't show window at startup"), 0 },
|
||||
{ "test", I18N_NOOP("Enable test mode"), 0 },
|
||||
{ "default", I18N_NOOP("Disable test mode"), 0 },
|
||||
{ "+[time]", I18N_NOOP("Time; Examples: 01:30 - absolute time (HH:MM); " \
|
||||
"10 - number of minutes to wait from now"), 0 },
|
||||
KCmdLineLastOption
|
||||
};
|
||||
|
||||
/** @short KShutDown application. */
|
||||
class KShutDownApplication: public KUniqueApplication
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
KShutDownApplication()
|
||||
: KUniqueApplication(),
|
||||
_confirm(false),
|
||||
isTimeArg(false),
|
||||
now(false),
|
||||
timeArgIsValid(false),
|
||||
timeArg()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the main window, and checks command line arguments.
|
||||
*/
|
||||
virtual int newInstance();
|
||||
private:
|
||||
enum Mode {
|
||||
Mode_Visible = -1, // show the main window at startup
|
||||
Mode_Hidden = -2, // hide the main window at startup
|
||||
Mode_Ok = 0, // success
|
||||
Mode_Error = 1 // misc. failure
|
||||
};
|
||||
bool
|
||||
_confirm,
|
||||
isTimeArg,
|
||||
now,
|
||||
timeArgIsValid;
|
||||
QString timeArg;
|
||||
int doExecAction(const Action::Type action);
|
||||
int doProcessArgs(const KCmdLineArgs *args);
|
||||
};
|
||||
|
||||
// public
|
||||
|
||||
int KShutDownApplication::newInstance()
|
||||
{
|
||||
// autostart
|
||||
if (kapp->isRestored()) {
|
||||
KConfig *config = kapp->config();
|
||||
config->setGroup("KShutDown");
|
||||
if (!config->readBoolEntry("Autostart", false)) {
|
||||
quit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static bool doShow = false;
|
||||
bool doRaise = ks_main;
|
||||
|
||||
// create main window (only one)
|
||||
if (!ks_main) {
|
||||
(void)new MMainWindow();
|
||||
kapp->setMainWidget(ks_main);
|
||||
connect(
|
||||
this, SIGNAL(aboutToQuit()),
|
||||
ks_main, SLOT(deleteLater()));
|
||||
}
|
||||
|
||||
// check command line args
|
||||
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
|
||||
int retval = doProcessArgs(args);
|
||||
args->clear();
|
||||
|
||||
if (MSystemTray::mode() != MSystemTray::Always) {
|
||||
ks_main->show();
|
||||
if (doRaise)
|
||||
ks_main->makeVisible();
|
||||
doShow = true;
|
||||
|
||||
return Mode_Ok;
|
||||
}
|
||||
|
||||
// gui mode
|
||||
if ((retval == Mode_Visible) || (retval == Mode_Hidden)) {
|
||||
if ((retval == Mode_Visible) && (!kapp->isRestored() || doShow)) {
|
||||
ks_main->show();
|
||||
if (doRaise)
|
||||
ks_main->makeVisible();
|
||||
}
|
||||
doShow = true;
|
||||
|
||||
return Mode_Ok;
|
||||
}
|
||||
|
||||
return retval; // command line exit code
|
||||
}
|
||||
|
||||
// private
|
||||
|
||||
int KShutDownApplication::doExecAction(const Action::Type action) {
|
||||
if (!ks_main)
|
||||
return Mode_Error;
|
||||
|
||||
// use time arg.
|
||||
if (timeArgIsValid) {
|
||||
ks_main->cancel(); // cancel action (if any)
|
||||
if (!now) {
|
||||
ks_main->setAction(action);
|
||||
ks_main->start(_confirm);
|
||||
|
||||
return Mode_Ok;
|
||||
}
|
||||
}
|
||||
|
||||
if (_confirm) {
|
||||
if (ks_actions->execConfirm(action))
|
||||
return Mode_Ok;
|
||||
}
|
||||
else {
|
||||
if (ks_actions->exec(action, action != Action::LockScreen))
|
||||
return Mode_Ok;
|
||||
}
|
||||
MSystemTray::setMode((MSystemTray::Mode)kshutdownrc->systemTray);
|
||||
|
||||
return Mode_Error;
|
||||
}
|
||||
|
||||
int KShutDownApplication::doProcessArgs(const KCmdLineArgs *args) {
|
||||
if (!ks_main)
|
||||
return Mode_Error;
|
||||
|
||||
_confirm = args->isSet("confirm");
|
||||
isTimeArg = false;
|
||||
now = false;
|
||||
timeArg = "";
|
||||
timeArgIsValid = false;
|
||||
|
||||
// read time arg.
|
||||
bool absoluteTime = false;
|
||||
int minutes = 0;
|
||||
QDateTime dt = QDateTime::currentDateTime();
|
||||
if (args->count()) {
|
||||
timeArg = args->arg(0); // first arg. is a "time" arg.
|
||||
if (!timeArg.isEmpty()) {
|
||||
isTimeArg = true;
|
||||
|
||||
if (timeArg.upper() == "NOW") {
|
||||
now = true;
|
||||
timeArgIsValid = true;
|
||||
}
|
||||
else {
|
||||
bool ok = false;
|
||||
minutes = timeArg.toInt(&ok); // MM?
|
||||
if (ok) {
|
||||
if (minutes == 0) {
|
||||
now = true;
|
||||
timeArgIsValid = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
absoluteTime = true;
|
||||
// FIXME: 2.0: AM/PM
|
||||
QTime t = QTime::fromString(timeArg);
|
||||
if (t.isValid() && !t.isNull()) { // HH:MM[:SS]?
|
||||
ok = true;
|
||||
dt.setTime(t);
|
||||
}
|
||||
}
|
||||
if (!ok || !dt.isValid() || dt.isNull()) {
|
||||
KMessageBox::error(
|
||||
0,
|
||||
MiscUtils::HTML(i18n("Invalid time: <b>%1</b>").arg(timeArg))
|
||||
);
|
||||
}
|
||||
else {
|
||||
timeArgIsValid = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// test mode
|
||||
if (args->isSet("test"))
|
||||
ks_main->setTestMode(true);
|
||||
|
||||
// normal mode
|
||||
if (args->isSet("default"))
|
||||
ks_main->setTestMode(false);
|
||||
|
||||
// cancel
|
||||
if (args->isSet("cancel")) {
|
||||
ks_main->cancel();
|
||||
|
||||
return Mode_Ok;
|
||||
}
|
||||
|
||||
// standard logout dialog
|
||||
if (args->isSet("standard")) {
|
||||
kapp->requestShutDown(
|
||||
KApplication::ShutdownConfirmYes,
|
||||
KApplication::ShutdownTypeDefault,
|
||||
KApplication::ShutdownModeDefault
|
||||
);
|
||||
|
||||
return Mode_Ok;
|
||||
}
|
||||
|
||||
// do nothing ..
|
||||
if (isTimeArg && !timeArgIsValid)
|
||||
return Mode_Error;
|
||||
|
||||
// setup main window
|
||||
if (timeArgIsValid) {
|
||||
if (!now) {
|
||||
if (MiscUtils::isRestricted("tab_time"))
|
||||
return Mode_Error;
|
||||
|
||||
ks_main->cancel(); // cancel action before "setDelayType"
|
||||
if (absoluteTime)
|
||||
{
|
||||
ks_main->setDelayType(MMainWindow::DelayType_DateTime);
|
||||
ks_main->setDate(dt.date());
|
||||
ks_main->setTime(dt.time());
|
||||
}
|
||||
else
|
||||
{
|
||||
ks_main->setDelayType(MMainWindow::DelayType_TimeFromNow);
|
||||
ks_main->setTime(QTime().addSecs(minutes * 60));
|
||||
}
|
||||
}
|
||||
ks_main->makeVisible();
|
||||
|
||||
// exec action below ..
|
||||
}
|
||||
|
||||
// extra
|
||||
if (args->isSet("extra")) {
|
||||
QString extrasCommand = args->getOption("extra");
|
||||
if (!extrasCommand.isEmpty()) {
|
||||
QFileInfo extra(extrasCommand);
|
||||
if (extra.exists()) {
|
||||
ks_extras->setAction(extra.filePath(), extra.baseName());
|
||||
|
||||
return doExecAction(Action::Extras);
|
||||
}
|
||||
else {
|
||||
qWarning("ERROR: File \"%s\" does not exist", extrasCommand.latin1());
|
||||
}
|
||||
}
|
||||
|
||||
return Mode_Error;
|
||||
}
|
||||
|
||||
// halt
|
||||
if (args->isSet("shutdown") || args->isSet("halt"))
|
||||
return doExecAction(Action::ShutDown);
|
||||
|
||||
// reboot
|
||||
if (args->isSet("reboot"))
|
||||
return doExecAction(Action::Reboot);
|
||||
|
||||
// lock
|
||||
if (args->isSet("lock"))
|
||||
return doExecAction(Action::LockScreen);
|
||||
|
||||
// logout
|
||||
if (args->isSet("logout"))
|
||||
return doExecAction(Action::Logout);
|
||||
|
||||
if (args->isSet("init"))
|
||||
return Mode_Hidden; // init window, but don't show it
|
||||
|
||||
return Mode_Visible; // gui mode
|
||||
}
|
||||
|
||||
// main
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
// TODO: 2.0: init on demand?
|
||||
aboutData.addCredit("Konrad Twardowski", "Author, Maintainer", "kdtonline@poczta.onet.pl", "http://www.kdtonline.prv.pl/");
|
||||
aboutData.addCredit("Caryn \"Hellchick\" Law", "Female Quake III Arena Announcer Voice Files", "hellchick ( at ) planetquake.com", "http://www.planetquake.com/voxfeminae/");
|
||||
aboutData.addCredit("Arend van Beelen jr.", "Ideas", "", "http://www.liacs.nl/~dvbeelen");
|
||||
aboutData.addCredit("Bram Schoenmakers", "Dutch translation", "bram_s ( at ) softhome.net");
|
||||
aboutData.addCredit("Charles Barcza", "Hungarian translation, blackPanther-Linux RPM", "kbarcza ( at ) blackpanther.hu", "http://www.blackpanther.hu/");
|
||||
aboutData.addCredit("Daniel Nylander", "Swedish translation");
|
||||
aboutData.addCredit("Elias Probst", "Gentoo ebuilds, German translation", "elias.probst ( at ) gmx.de");
|
||||
aboutData.addCredit("Giovanni Venturi", "Italian translation", "jumpyj ( at ) tiscali.it");
|
||||
aboutData.addCredit("Gregorio Guidi", "Patches");
|
||||
aboutData.addCredit("Guido Tack", "Ideas", "", "http://www.ps.uni-sb.de/~tack");
|
||||
aboutData.addCredit("Jozef Riha", "Slovak translation", "zefo ( at ) seznam.cz");
|
||||
aboutData.addCredit("Karol Adamczyk [rampage]", "Gentoo ebuild");
|
||||
aboutData.addCredit("Matrix", "SuSE RPM", "matrix ( at ) ehelp.pl");
|
||||
aboutData.addCredit("Michael Goettsche", "Bug reports");
|
||||
aboutData.addCredit("Paulo Zambon", "Portuguese Brazil translation", "pzambon ( at ) astornet.com.br");
|
||||
aboutData.addCredit("Philipp Weissenbacher");
|
||||
aboutData.addCredit("Piotr Budny");
|
||||
aboutData.addCredit("Quique", "Spanish translation", "quique ( at ) sindominio.net");
|
||||
aboutData.addCredit("Robert Kratky", "Czech translation", "kratky ( at ) rob.cz");
|
||||
aboutData.addCredit("Romain Beauxis", "Debian Package", "", "http://www.cti.ecp.fr/~beauxir5/debian/");
|
||||
aboutData.addCredit("Spider (ALT Linux)", "Russian translation");
|
||||
aboutData.addCredit("Stephen Ellwood", "Panel Applet, User Interface");
|
||||
aboutData.addCredit("Zdenko Podobny", "Slovak translation, Mandrake RPM", "zdpo ( at ) mailbox.sk");
|
||||
aboutData.addCredit("KDE-APPS.org", "", "", "http://www.kde-apps.org/");
|
||||
aboutData.addCredit("Lock/Logout Applet Team");
|
||||
aboutData.addCredit("SourceForge.net", "", "", "http://www.sourceforge.net/");
|
||||
|
||||
// init command line
|
||||
KCmdLineArgs::init(argc, argv, &aboutData);
|
||||
KCmdLineArgs::addCmdLineOptions(options);
|
||||
|
||||
if (!KUniqueApplication::start())
|
||||
return 0;
|
||||
|
||||
// init application
|
||||
KShutDownApplication software;
|
||||
|
||||
// main loop
|
||||
return software.exec();
|
||||
}
|
@ -0,0 +1,244 @@
|
||||
/*
|
||||
miscutils.cpp - Misc functions
|
||||
Copyright (C) 2004 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "configuration.h"
|
||||
#include "miscutils.h"
|
||||
#include "mmainwindow.h"
|
||||
#include "msystemtray.h"
|
||||
|
||||
#include <qlayout.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
#include <kaction.h>
|
||||
#include <kdebug.h>
|
||||
#include <kiconloader.h>
|
||||
#include <klocale.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <knotifyclient.h>
|
||||
#include <kpassivepopup.h>
|
||||
#include <kpushbutton.h>
|
||||
#include <krun.h>
|
||||
#include <kwindowinfo.h>
|
||||
|
||||
// public
|
||||
|
||||
void MiscUtils::closeCDTray()
|
||||
{
|
||||
if (kshutdownrc->cdTrayClose)
|
||||
runShellCommand(kshutdownrc->cdTrayCloseCommand, KProcess::Block);
|
||||
}
|
||||
|
||||
void MiscUtils::customMessage(const QString &text, const QString &testCommand)
|
||||
{
|
||||
QString c;
|
||||
if (testCommand.isNull())
|
||||
c = kshutdownrc->customMessageCommand;
|
||||
else
|
||||
c = testCommand;
|
||||
|
||||
if (kshutdownrc->customMessageEnabled)
|
||||
{
|
||||
c.replace("%appname", "KShutDown");
|
||||
c.replace("%text", text);
|
||||
c.replace("%title", ks_main->caption());
|
||||
runShellCommand(c);
|
||||
}
|
||||
}
|
||||
|
||||
QString MiscUtils::formatDateTime(const int secs, const QString &format)
|
||||
{
|
||||
if ((secs >= 86400) || (secs < 0)) // 24h
|
||||
return ">24";
|
||||
|
||||
int h = secs / 3600;
|
||||
int m = (secs / 60) % 60;
|
||||
int s = secs % 60;
|
||||
QTime t(h, m, s);
|
||||
|
||||
if (format.isNull())
|
||||
return t.toString();
|
||||
|
||||
return t.toString(format);
|
||||
}
|
||||
|
||||
QString MiscUtils::formatDateTime(const QDateTime &dt)
|
||||
{
|
||||
QDateTime now = QDateTime::currentDateTime();
|
||||
|
||||
return
|
||||
dt.toString(
|
||||
KGlobal::locale()->use12Clock()
|
||||
? "hh:mm ap, dddd"
|
||||
: "hh:mm, dddd"
|
||||
) +
|
||||
" (+" + formatDateTime(now.secsTo(dt), "hh:mm") + ")";
|
||||
}
|
||||
|
||||
bool MiscUtils::isRestricted(const QString &key)
|
||||
{
|
||||
return !kapp->authorize("kshutdown_" + key);
|
||||
}
|
||||
|
||||
void MiscUtils::notifyUser(const int secs)
|
||||
{
|
||||
if ((secs < 60) && (secs % 3 == 0)) {
|
||||
KWindowInfo::showMessage(ks_main, i18n("Warning"), SmallIcon("messagebox_warning"), 1000);
|
||||
}
|
||||
|
||||
switch (secs)
|
||||
{
|
||||
case 3600: // 1 hour
|
||||
customMessage(i18n("1 hour warning"));
|
||||
break;
|
||||
case 300: // 5 minutes
|
||||
notifyUser("kshutdown-5m", i18n("5 minutes warning"));
|
||||
customMessage(i18n("5 minutes warning"));
|
||||
break;
|
||||
case 60: // 1 minute
|
||||
notifyUser("kshutdown-1m", i18n("1 minute warning"));
|
||||
customMessage(i18n("1 minute warning"));
|
||||
break;
|
||||
case 10: // 10 seconds
|
||||
customMessage(i18n("10 seconds warning"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void MiscUtils::passiveMessage(const QString &text, QWidget *parent) {
|
||||
KPassivePopup *popup = KPassivePopup::message(
|
||||
"KShutDown",
|
||||
text,
|
||||
SmallIcon("kshutdown"),
|
||||
parent
|
||||
);
|
||||
if (parent == 0)
|
||||
popup->move(0, 0);
|
||||
}
|
||||
|
||||
void MiscUtils::plug(const KAction *action, KPushButton *pushButton) {
|
||||
pushButton->disconnect(); // disconnect all
|
||||
pushButton->connect(pushButton, SIGNAL(clicked()), action, SLOT(activate()));
|
||||
pushButton->setIconSet(action->iconSet());
|
||||
QString text = action->text();
|
||||
if (text.contains("%1"))
|
||||
text = text.arg(action->shortcutText());
|
||||
pushButton->setText(text);
|
||||
}
|
||||
|
||||
bool MiscUtils::runCommand(const QString &command)
|
||||
{
|
||||
pid_t pid = KRun::run(command, KURL::List());
|
||||
|
||||
if (pid)
|
||||
return true; // ok
|
||||
|
||||
showRunErrorMessage(command);
|
||||
|
||||
return false; // error
|
||||
}
|
||||
|
||||
void MiscUtils::runCommandBeforeAction(const QString &configEntry)
|
||||
{
|
||||
KConfig *conf = kshutdownrc->config();
|
||||
|
||||
if (!conf->hasGroup(configEntry))
|
||||
return;
|
||||
|
||||
conf->setGroup(configEntry);
|
||||
|
||||
if (!conf->readBoolEntry("RunCommandBeforeAction", false))
|
||||
return;
|
||||
|
||||
QString command = conf->readEntry("CommandBeforeAction", "");
|
||||
int pause = conf->readNumEntry("CommandBeforeActionPause", 10);
|
||||
if ((pause < 0) || (pause > 300))
|
||||
pause = 10;
|
||||
runShellCommand(command, KProcess::DontCare, pause);
|
||||
}
|
||||
|
||||
bool MiscUtils::runShellCommand(const QString &command, const KProcess::RunMode mode, const int pause)
|
||||
{
|
||||
if (command.isEmpty())
|
||||
return false;
|
||||
|
||||
KProcess *p = new KProcess();
|
||||
if (!p)
|
||||
{
|
||||
showRunErrorMessage(command);
|
||||
|
||||
return false; // error
|
||||
}
|
||||
|
||||
bool retVal = true; // assume ok
|
||||
|
||||
p->setUseShell(true);
|
||||
*p << command;
|
||||
if (!p->start(mode))
|
||||
{
|
||||
showRunErrorMessage(command);
|
||||
|
||||
retVal = false; // error
|
||||
}
|
||||
else
|
||||
{
|
||||
// pause
|
||||
if (pause > 0)
|
||||
p->wait(pause);
|
||||
}
|
||||
delete p;
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
void MiscUtils::setAutostart(const bool yes) {
|
||||
KConfig *config = kapp->config();
|
||||
config->setGroup("KShutDown");
|
||||
config->writeEntry("Autostart", yes);
|
||||
}
|
||||
|
||||
void MiscUtils::setHint(QWidget *widget, const QString &value)
|
||||
{
|
||||
QToolTip::add(widget, value);
|
||||
QWhatsThis::add(widget, value);
|
||||
}
|
||||
|
||||
void MiscUtils::showRunErrorMessage(const QString &command)
|
||||
{
|
||||
notifyUser("kshutdown-runerror", i18n("Could not run \"%1\"!").arg(command));
|
||||
}
|
||||
|
||||
void MiscUtils::showTestMessage(const QString &message)
|
||||
{
|
||||
KMessageBox::information(0, message, i18n("Test"));
|
||||
}
|
||||
|
||||
// private
|
||||
|
||||
void MiscUtils::notifyUser(const QString &name, const QString &text)
|
||||
{
|
||||
WId id;
|
||||
if (MSystemTray::isInstance())
|
||||
id = ks_tray->winId();
|
||||
else
|
||||
id = ks_main->winId();
|
||||
KNotifyClient::event(id, name, text);
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
/*
|
||||
miscutils.h - Misc functions
|
||||
Copyright (C) 2004 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __MISCUTILS_H__
|
||||
#define __MISCUTILS_H__
|
||||
|
||||
#include <qdatetime.h>
|
||||
|
||||
#include <kprocess.h>
|
||||
|
||||
class KAction;
|
||||
class KPushButton;
|
||||
|
||||
/** @short Misc functions. */
|
||||
class MiscUtils
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Closes the CD-ROM tray (if this option is enabled).
|
||||
*/
|
||||
static void closeCDTray();
|
||||
|
||||
/**
|
||||
* Displays a custom message.
|
||||
* @param text A text to display
|
||||
* @param testCommand A command to execute (used internally in settings dialog to test entered command)
|
||||
*/
|
||||
static void customMessage(const QString &text, const QString &testCommand = QString::null);
|
||||
|
||||
/**
|
||||
* Converts seconds to time string.
|
||||
* @param secs A number of seconds to convert
|
||||
* @param format A date/time format
|
||||
* @return Converted seconds or ">24", if @p secs >= 86400
|
||||
*/
|
||||
static QString formatDateTime(const int secs, const QString &format = QString::null);
|
||||
|
||||
/**
|
||||
* Converts seconds to time string.
|
||||
* @param dt A date/time to convert
|
||||
* @return Converted seconds or ">24", if @p secs >= 86400
|
||||
*/
|
||||
static QString formatDateTime(const QDateTime &dt);
|
||||
|
||||
inline static QString HTML(const QString &text) {
|
||||
return ("<qt>" + text + "</qt>");
|
||||
}
|
||||
|
||||
inline static QString HTML(QString &text) {
|
||||
text.prepend("<qt>");
|
||||
text.append("</qt>");
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns @c true if function (@p key) is restricted (KDE Kiosk).
|
||||
* The key value is read from the configuration file
|
||||
* (usually /usr/share/config/kshutdownrc).
|
||||
* See Handbook (F1) for details.
|
||||
*/
|
||||
static bool isRestricted(const QString &key);
|
||||
|
||||
/**
|
||||
* Visual and sound notifications.
|
||||
* @param secs A number of seconds to action
|
||||
*/
|
||||
static void notifyUser(const int secs);
|
||||
|
||||
static void passiveMessage(const QString &text, QWidget *parent = 0);
|
||||
|
||||
static void plug(const KAction *action, KPushButton *pushButton);
|
||||
|
||||
/**
|
||||
* Executes a command.
|
||||
* @param command A command to execute
|
||||
* @return @c true if successfull; otherwise @c false
|
||||
*/
|
||||
static bool runCommand(const QString &command);
|
||||
|
||||
/**
|
||||
* Executes a shell command before the specified action.
|
||||
* @param configEntry A configuration entry (e.g. <i>"Shut Down"</i>)
|
||||
*/
|
||||
static void runCommandBeforeAction(const QString &configEntry);
|
||||
|
||||
/**
|
||||
* Executes a shell command.
|
||||
* @param command A shell command to execute
|
||||
* @param mode A run mode (@c KProcess::DontCare by default)
|
||||
* @param pause A timeout in seconds (no timeout by default)
|
||||
* @return @c true if successfull; otherwise @c false
|
||||
*/
|
||||
static bool runShellCommand(const QString &command, const KProcess::RunMode mode = KProcess::DontCare, const int pause = -1);
|
||||
|
||||
static void setAutostart(const bool yes);
|
||||
|
||||
/**
|
||||
* Sets "tool tip text" and "what's this text" of @p widget to @p value.
|
||||
*/
|
||||
static void setHint(QWidget *widget, const QString &value);
|
||||
|
||||
/**
|
||||
* Displays a "KRun" error message in a passive message.
|
||||
* @param command A command that failed
|
||||
*/
|
||||
static void showRunErrorMessage(const QString &command);
|
||||
|
||||
/**
|
||||
* Displays an information if KShutDown is in the <b>Test Mode</b>.
|
||||
* @param message A message to display
|
||||
*/
|
||||
static void showTestMessage(const QString &message);
|
||||
|
||||
private:
|
||||
static void notifyUser(const QString &name, const QString &text);
|
||||
};
|
||||
|
||||
#endif // __MISCUTILS_H__
|
@ -0,0 +1,954 @@
|
||||
/*
|
||||
mmainwindow.cpp - The main window
|
||||
Copyright (C) 2003 Konrad Twardowski <kdtonline@poczta.onet.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "appobserver.h"
|
||||
#include "configuration.h"
|
||||
#include "confirmation.h"
|
||||
#include "extras.h"
|
||||
#include "miscutils.h"
|
||||
#include "mmainwindow.h"
|
||||
#include "mmessagedialog.h"
|
||||
#include "msettingsdialog.h"
|
||||
#include "mstatstab.h"
|
||||
#include "msystemtray.h"
|
||||
#include "progressbar.h"
|
||||
#include "systemconfig.h"
|
||||
|
||||
#include <qdatetimeedit.h>
|
||||
#include <qfile.h>
|
||||
#include <qhbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlayout.h>
|
||||
#include <qtimer.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qvgroupbox.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
#include <dcopclient.h>
|
||||
#include <kaction.h>
|
||||
#include <kdebug.h>
|
||||
#include <kiconloader.h>
|
||||
#include <kglobalaccel.h>
|
||||
#include <kkeydialog.h>
|
||||
#include <klocale.h>
|
||||
#include <kmenubar.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <knotifydialog.h>
|
||||
#include <kpopupmenu.h>
|
||||
#include <kpushbutton.h>
|
||||
#include <kwin.h>
|
||||
#include <kdesktopfile.h>
|
||||
#include <kmimetype.h>
|
||||
|
||||
MMainWindow *MMainWindow::_instance = 0;
|
||||
|
||||
MMainWindow::MMainWindow()
|
||||
// Iface
|
||||
: DCOPObject("KShutdownIface"),
|
||||
KMainWindow(0, "MMainWindow", WStyle_ContextHelp),
|
||||
_showMinimizeInfo(true),
|
||||
_oldSec(-1),
|
||||
_delayType(DelayType_Now)
|
||||
{
|
||||
_instance = this;
|
||||
connect(kapp, SIGNAL(aboutToQuit()), SLOT(slotAboutToQuit()));
|
||||
|
||||
// init date/time
|
||||
dt_end = QDateTime();
|
||||
dt_start = QDateTime();
|
||||
|
||||
// action timeout timer
|
||||
_timer = new QTimer(this);
|
||||
connect(_timer, SIGNAL(timeout()), SLOT(slotCheckTime()));
|
||||
|
||||
// init widgets
|
||||
setCentralWidget(initWidgets());
|
||||
initActions();
|
||||
initMainMenu();
|
||||
|
||||
// init DCOP
|
||||
DCOPClient *client = kapp->dcopClient();
|
||||
client->registerAs(kapp->name(), false);
|
||||
client->setDefaultObject(objId()); // KShutdownIface
|
||||
|
||||
KConfig *config = kapp->config();
|
||||
config->setGroup("Extras");
|
||||
QString extrasCommand = config->readEntry("Command", QString::null);
|
||||
QString extrasDescription = config->readEntry("Description", QString::null);
|
||||
if (!extrasCommand.isEmpty() || QFile::exists(extrasCommand)) {
|
||||
setAction(Action::Extras);
|
||||
|
||||
QIconSet extrasIcon;
|
||||
QString mimeType;
|
||||
mimeType = KMimeType::findByPath(extrasCommand)->name();
|
||||
if (mimeType != "application/x-desktop")
|
||||
extrasIcon = QIconSet(KMimeType::pixmapForURL(KURL::fromPathOrURL(extrasCommand)));
|
||||
else {
|
||||
// application/x-desktop
|
||||
KDesktopFile *desktopFile = new KDesktopFile(extrasCommand, true);
|
||||
if (desktopFile->getConfigState() != KConfigBase::NoAccess)
|
||||
extrasIcon = QIconSet(SmallIcon(desktopFile->readIcon()));
|
||||
delete desktopFile;
|
||||
}
|
||||
ks_extras->setAction(extrasCommand, extrasDescription, &extrasIcon);
|
||||
}
|
||||
else {
|
||||
setAction((Action::Type)kshutdownrc->generalAction);
|
||||
}
|
||||
setDelayType((DelayType)kshutdownrc->generalDelayType);
|
||||
|
||||
MSystemTray::setMode((MSystemTray::Mode)kshutdownrc->systemTray);
|
||||
|
||||
setCaptions();
|
||||
slotUpdateTimeInfo();
|
||||
|
||||
setFixedHeight(layout()->minimumSize().height());
|
||||
}
|
||||
|
||||
MMainWindow::~MMainWindow()
|
||||
{
|
||||
KConfig *config = kapp->config();
|
||||
config->setGroup("Extras");
|
||||
config->writeEntry("Command", ks_extras->fileToExecute());
|
||||
config->writeEntry("Description", ks_extras->getActionDescription());
|
||||
|
||||
// TODO: 2.0: remember/restore time
|
||||
kshutdownrc->generalAction = ks_actions->current();
|
||||
kshutdownrc->generalDelayType = cb_delayTypes->currentItem();
|
||||
kshutdownrc->writeConfig();
|
||||
}
|
||||
|
||||
void MMainWindow::setDelayType(const DelayType value)
|
||||
{
|
||||
// kdDebug() << "MMainWindow::setDelayType: " << value << endl;
|
||||
|
||||
if (MiscUtils::isRestricted("tab_time"))
|
||||
{
|
||||
_delayType = DelayType_Now;
|
||||
cb_delayTypes->setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
_delayType = value;
|
||||
cb_delayTypes->setEnabled(true);
|
||||
}
|
||||
|
||||
cb_delayTypes->setCurrentItem(_delayType);
|
||||
|
||||
switch (_delayType)
|
||||
{
|
||||
case DelayType_Now:
|
||||
_dateTimeEdit->dateEdit()->setEnabled(false);
|
||||
_dateTimeEdit->timeEdit()->setEnabled(false);
|
||||
_dateTimeEdit->show();
|
||||
_appObserver->hide();
|
||||
l_statusLine->hide();
|
||||
break;
|
||||
case DelayType_TimeFromNow:
|
||||
QWhatsThis::add(_dateTimeEdit, i18n("Enter hour and minute."));
|
||||
_dateTimeEdit->dateEdit()->setEnabled(false);
|
||||
_dateTimeEdit->timeEdit()->setEnabled(true);
|
||||
_dateTimeEdit->timeEdit()->setDisplay(QTimeEdit::Hours | QTimeEdit::Minutes);
|
||||
_dateTimeEdit->timeEdit()->setTime(QTime());
|
||||
_dateTimeEdit->show();
|
||||
_appObserver->hide();
|
||||
l_statusLine->show();
|
||||
break;
|
||||
case DelayType_DateTime:
|
||||
QWhatsThis::add(_dateTimeEdit, i18n("Enter date and time."));
|
||||
_dateTimeEdit->dateEdit()->setEnabled(true);
|
||||
_dateTimeEdit->timeEdit()->setEnabled(true);
|
||||
_dateTimeEdit->timeEdit()->setDisplay(
|
||||
KGlobal::locale()->use12Clock()
|
||||
? (QTimeEdit::Hours | QTimeEdit::Minutes | QTimeEdit::AMPM)
|
||||
: (QTimeEdit::Hours | QTimeEdit::Minutes)
|
||||
);
|
||||
_dateTimeEdit->dateEdit()->setDate(QDate::currentDate());
|
||||
_dateTimeEdit->timeEdit()->setTime(QTime::currentTime());
|
||||
_dateTimeEdit->show();
|
||||
_appObserver->hide();
|
||||
l_statusLine->show();
|
||||
break;
|
||||
case DelayType_OnAppExit:
|
||||
_dateTimeEdit->hide();
|
||||
_appObserver->show();
|
||||
_appObserver->refresh();
|
||||
l_statusLine->hide();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void MMainWindow::setTime(const QTime &time)
|
||||
{
|
||||
_dateTimeEdit->timeEdit()->setTime(QTime(time.hour(), time.minute(), 0));
|
||||
}
|
||||
|
||||
void MMainWindow::setAction(const Action::Type action)
|
||||
{
|
||||
// kdDebug() << "MMainWindow::setAction: " << ks_actions->getName(action) << endl;
|
||||
|
||||
if (!ks_actions->isEnabled(action))
|
||||
{
|
||||
// FIXME: 2.0: "Start" button incorectly disabled/enabled after config change
|
||||
// FIXME: 2.0: confusing
|
||||
_startAction->setEnabled(false);
|
||||
|
||||
return;
|
||||
}
|
||||
_startAction->setEnabled(true);
|
||||
|
||||
ks_actions->setCurrent(action);
|
||||
cb_actions->setCurrentItem(action - 1);
|
||||
switch (action)
|
||||
{
|
||||
case Action::Nothing:
|
||||
case Action::ShutDown:
|
||||
case Action::Reboot:
|
||||
case Action::LockScreen:
|
||||
case Action::Logout:
|
||||
ks_extras->button()->hide();
|
||||
break;
|
||||
case Action::Extras:
|
||||
ks_extras->button()->show();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void MMainWindow::setDate(const QDate &date)
|
||||
{
|
||||
_dateTimeEdit->dateEdit()->setDate(date);
|
||||
}
|
||||
|
||||
void MMainWindow::start(const bool confirmation) {
|
||||
if (ks_actions->active())
|
||||
return;
|
||||
|
||||
// kdDebug() << "MMainWindow::start" << endl;
|
||||
|
||||
// check if selected process still exists
|
||||
if ((_delayType == DelayType_OnAppExit) && !_appObserver->isValid())
|
||||