From 5b1fef5431ca493d5c807115270137cd49d08fbd Mon Sep 17 00:00:00 2001 From: mutantturkey Date: Fri, 13 Jul 2012 23:04:14 -0400 Subject: [PATCH] added cmake support and updated some hardcoded strings --- AUTHORS | 2 ++ CMakeLists.txt | 66 ++++++++++++++++++++++++++++++++++++ README | 5 +++ TODO | 4 +++ src/khdapsmonitorsystray.cpp | 4 +-- src/khdapsmonitorwidget.h | 8 ----- src/main.cpp | 7 ++-- 7 files changed, 83 insertions(+), 13 deletions(-) create mode 100644 AUTHORS create mode 100644 CMakeLists.txt create mode 100644 README create mode 100644 TODO diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..7b3b563 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,2 @@ +Roy Marples +Calvin Morrison diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..bb9163e --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,66 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +################################################# + +cmake_minimum_required( VERSION 2.8 ) + + +##### general package setup ##################### + +project( khdapsmonitor ) + +set( PACKAGE kdebase ) +set( VERSION "3.5.13" ) + + +##### include essential cmake modules ########### + +include( FindPkgConfig ) +include( CheckIncludeFile ) +include( CheckCSourceRuns ) +include( CheckCXXSourceCompiles ) +include( CheckLibraryExists ) +include( CheckFunctionExists ) +include( CheckStructHasMember ) + + +##### include our cmake modules ################# + +set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ) +include( TDEMacros ) + + +##### setup install paths ####################### + +include( TDESetupPaths ) +tde_setup_paths( ) + +find_package( TQt ) +find_package( TDE ) + +##### set PKG_CONFIG_PATH ####################### + +set( ENV{PKG_CONFIG_PATH} "${PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}:${LIB_INSTALL_DIR}/pkgconfig" ) + + +##### configure checks ########################## + +###### global compiler settings ################# + +set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" ) +set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" ) +set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" ) + + +##### kdebase directories ####################### + +add_subdirectory( src ) + +##### write configure files ##################### + +configure_file( config.h.cmake config.h @ONLY ) diff --git a/README b/README new file mode 100644 index 0000000..f95f9b1 --- /dev/null +++ b/README @@ -0,0 +1,5 @@ +KHDAPSMonitor is a TDE based monitor for laptops that support the IBM +Hard Drive Active Protection System (http://hdaps.sf.net) + +You'll need to be running the hdapsd daemon to get monitoring support. + diff --git a/TODO b/TODO new file mode 100644 index 0000000..2ec41a5 --- /dev/null +++ b/TODO @@ -0,0 +1,4 @@ +Documentation - lol +Better Polling +Configurable interval +Configurable readings (keyboard, mouse etc) diff --git a/src/khdapsmonitorsystray.cpp b/src/khdapsmonitorsystray.cpp index de150c4..61fe0d3 100644 --- a/src/khdapsmonitorsystray.cpp +++ b/src/khdapsmonitorsystray.cpp @@ -58,11 +58,11 @@ void KHDAPSMonitorSysTray::update() if (! sysFS.hasHDAPS()) { - newToolTip = I18N_NOOP("ERROR: Kernel does not support HDAPS"); + newToolTip = I18N_NOOP("error: Kernel does not support HDAPS or "); } else if (dList.count() == 0) { - newToolTip = I18N_NOOP("ERROR: No devices found that use HDAPS"); + newToolTip = I18N_NOOP("error: No devices found that use HDAPS"); } else diff --git a/src/khdapsmonitorwidget.h b/src/khdapsmonitorwidget.h index c0058fd..fdd4da9 100644 --- a/src/khdapsmonitorwidget.h +++ b/src/khdapsmonitorwidget.h @@ -38,14 +38,6 @@ public: public slots: void update(); - /*$PUBLIC_SLOTS$*/ - -protected: - /*$PROTECTED_FUNCTIONS$*/ - -protected slots: - /*$PROTECTED_SLOTS$*/ - private: SysFS sysFS; }; diff --git a/src/main.cpp b/src/main.cpp index 9de78d1..31db959 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -25,9 +25,9 @@ #include static const char description[] = - I18N_NOOP("HDAPS Monitor for KDE"); + I18N_NOOP("HDAPS Monitor for TDE"); -static const char version[] = "0.1"; +static const char version[] = "0.1.1"; static KCmdLineOptions options[] = { @@ -38,9 +38,10 @@ static KCmdLineOptions options[] = int main(int argc, char **argv) { KAboutData about("khdapsmonitor", I18N_NOOP("KHDAPSMonitor"), version, description, - KAboutData::License_GPL, "(C) 2006 Roy Marples", 0, "http://roy.marples.name", + KAboutData::License_GPL, "(C) 2006 Roy Marples (C) 2012 Calvin Morrison", 0, "http://roy.marples.name http://trinitydesktop.org", "bugs@marples.name"); about.addAuthor( "Roy Marples", 0, "roy@marples.name" ); + about.addAuthor( "Calvin Morrison", 0, "mutantturkey@gmail.com"); KCmdLineArgs::init(argc, argv, &about); KCmdLineArgs::addCmdLineOptions( options );