From a410c025ead2d092b407ca861bc81f62b07860f4 Mon Sep 17 00:00:00 2001 From: Nicolas Ternisien Date: Thu, 10 Apr 2008 23:08:34 +0000 Subject: [PATCH] Complete source rewrite/improvement of KInfocenter : - Complete port to KDE/Qt 4, no more use of QT3 Support - Simplify interface (remove multiple left tabs, add quick help in the top of the layout, use a KListWidgetSearchLine to filter by keywords and name) - Fix General Page (modules were not displayed), and allow user to select it from the left panel - Clean code and indentation structure - Remove big margins and useless layout/widgets to integrate KCMModule (request from Aaron Siego) - Memory module is now in a separate folder - Memory module has been rewritten, and the chart generation is now simpler. - Use color gradient and color scheme of System Monitor app (request from John Tapsell) - Use a default icon when the requested icon does not exist (request from David Jarvie) - Integrate patch from Konrad Rzepecki about improve PCI module by using libpci API. Add an optional dependency in CMake for this library FEATURE:88625 - The porting to KDE4 of all architecture may add some compilation errors (sorry, I have no AIX, HPUX, Solaris, SGI, FreeBSD, OpenBSD systems to test those source). However, some existing codes already did not compile. - Simplify source code by removing some part corresponding to the moment where KInfocenter and KControl were the same (it seems to). - Name and comments of each modules are now normalized. (even IOSlaves Info and Samba Status) CCMAIL:kde-core-devel@kde.org - Allow the future move of inner modules of kcm_info to a dedicated module (examples: Sound, X-Server, Partitions,...) TODO : - Improve Loading page layout - Port Partitions, Sound and Network Interfaces modules to Solid - Set my email as current maintainer svn path=/trunk/KDE/kdebase/apps/; revision=795596 --- CMakeLists.txt | 2 - cmake/modules/FindPCIUTILS.cmake | 20 + kinfocenter/CMakeLists.txt | 40 +- kinfocenter/about/kinfocenter.css | 6 - kinfocenter/about/main.html | 14 +- kinfocenter/aboutwidget.cpp | 247 +++--- kinfocenter/aboutwidget.h | 16 +- kinfocenter/base/CMakeLists.txt | 13 + .../{info => base}/config-infocenter.h.cmake | 0 kinfocenter/base/info_aix.cpp | 345 ++++++++ kinfocenter/{info => base}/info_fbsd.cpp | 323 +++---- kinfocenter/base/info_generic.cpp | 55 ++ kinfocenter/base/info_hpux.cpp | 560 ++++++++++++ kinfocenter/base/info_linux.cpp | 531 ++++++++++++ kinfocenter/{info => base}/info_netbsd.cpp | 270 +++--- kinfocenter/base/info_openbsd.cpp | 297 +++++++ kinfocenter/{info => base}/info_osx.cpp | 61 +- kinfocenter/base/info_sgi.cpp | 58 ++ kinfocenter/base/info_solaris.cpp | 718 ++++++++++++++++ kinfocenter/base/info_svr4.cpp | 112 +++ kinfocenter/base/os_base.h | 331 +++++++ kinfocenter/base/os_current.cpp | 28 + kinfocenter/base/os_current.h | 185 ++++ kinfocenter/dockcontainer.cpp | 333 +++----- kinfocenter/dockcontainer.h | 99 ++- kinfocenter/global.cpp | 124 +-- kinfocenter/global.h | 133 +-- kinfocenter/helpwidget.cpp | 89 -- kinfocenter/helpwidget.h | 46 - kinfocenter/indexwidget.cpp | 187 ++-- kinfocenter/indexwidget.h | 73 +- kinfocenter/info/CMakeLists.txt | 36 +- kinfocenter/info/info.cpp | 539 ++---------- kinfocenter/info/info.h | 27 +- kinfocenter/info/info_aix.cpp | 486 ----------- kinfocenter/info/info_generic.cpp | 81 -- kinfocenter/info/info_hpux.cpp | 785 ----------------- kinfocenter/info/info_linux.cpp | 541 ------------ kinfocenter/info/info_openbsd.cpp | 313 ------- kinfocenter/info/info_sgi.cpp | 82 -- kinfocenter/info/info_solaris.cpp | 707 --------------- kinfocenter/info/info_svr4.cpp | 132 --- kinfocenter/info/main.cpp | 27 +- kinfocenter/info/memory.cpp | 493 ----------- kinfocenter/info/memory.h | 61 -- kinfocenter/kcrootonly.cpp | 37 - kinfocenter/kcrootonly.h | 30 - kinfocenter/kinfocenterui.rc | 12 - kinfocenter/main.cpp | 142 ++- kinfocenter/main.h | 39 +- kinfocenter/memory/CMakeLists.txt | 14 + kinfocenter/memory/Messages.sh | 2 + kinfocenter/memory/base.h | 48 ++ kinfocenter/memory/chartWidget.cpp | 152 ++++ kinfocenter/memory/chartWidget.h | 65 ++ .../kcm_memory.desktop} | 7 +- kinfocenter/memory/memory.cpp | 326 +++++++ kinfocenter/memory/memory.h | 71 ++ kinfocenter/{info => memory}/memory_fbsd.cpp | 24 +- kinfocenter/{info => memory}/memory_hpux.cpp | 18 +- kinfocenter/{info => memory}/memory_linux.cpp | 16 +- .../{info => memory}/memory_netbsd.cpp | 46 +- kinfocenter/{info => memory}/memory_osx.cpp | 16 +- kinfocenter/{info => memory}/memory_sgi.cpp | 22 +- .../{info => memory}/memory_solaris.cpp | 16 +- kinfocenter/{info => memory}/memory_tru64.cpp | 18 +- kinfocenter/memory/physicalMemoryChart.cpp | 63 ++ kinfocenter/memory/physicalMemoryChart.h | 42 + kinfocenter/memory/swapMemoryChart.cpp | 51 ++ kinfocenter/memory/swapMemoryChart.h | 42 + kinfocenter/memory/totalMemoryChart.cpp | 53 ++ kinfocenter/memory/totalMemoryChart.h | 42 + kinfocenter/moduleIface.cpp | 58 -- kinfocenter/moduleIface.h | 53 -- kinfocenter/moduleiconview.cpp | 171 ---- kinfocenter/moduleiconview.h | 89 -- kinfocenter/modules.cpp | 348 ++------ kinfocenter/modules.h | 121 +-- kinfocenter/moduletreeview.cpp | 441 +++------- kinfocenter/moduletreeview.h | 110 +-- kinfocenter/nics/CMakeLists.txt | 2 +- kinfocenter/nics/nic.cpp | 401 +++++---- kinfocenter/opengl/CMakeLists.txt | 25 +- kinfocenter/opengl/opengl.desktop | 3 +- kinfocenter/pci/CMakeLists.txt | 37 + kinfocenter/pci/Messages.sh | 2 + kinfocenter/pci/kcm_pci.cpp | 90 ++ .../{info/pci.desktop => pci/kcm_pci.desktop} | 8 +- kinfocenter/pci/kcm_pci.h | 53 ++ kinfocenter/pci/pci.cpp | 808 ++++++++++++++++++ kinfocenter/pci/pci.h | 14 + kinfocenter/pci/pci_private.h | 783 +++++++++++++++++ kinfocenter/proxywidget.cpp | 319 +------ kinfocenter/proxywidget.h | 74 +- kinfocenter/quickhelp.cpp | 43 - kinfocenter/quickhelp.h | 35 - kinfocenter/searchwidget.cpp | 222 ----- kinfocenter/searchwidget.h | 76 -- kinfocenter/solidproc/kcmsolidproc.desktop | 2 + kinfocenter/toplevel.cpp | 555 ++++-------- kinfocenter/toplevel.h | 31 +- kinfocenter/usbview/CMakeLists.txt | 2 +- kinfocenter/usbview/kcmusb.cpp | 275 +++--- kinfocenter/usbview/kcmusb.desktop | 2 +- kinfocenter/usbview/kcmusb.h | 30 +- kinfocenter/usbview/usbdb.cpp | 174 ++-- kinfocenter/usbview/usbdb.h | 25 +- kinfocenter/usbview/usbdevices.cpp | 450 +++++----- kinfocenter/usbview/usbdevices.h | 73 +- kinfocenter/version.h | 5 - kinfocenter/view1394/CMakeLists.txt | 3 +- kinfocenter/view1394/view1394.cpp | 475 +++++----- kinfocenter/view1394/view1394.h | 67 +- kinfocenter/view1394/view1394widget.ui | 2 +- 114 files changed, 8578 insertions(+), 9019 deletions(-) create mode 100644 cmake/modules/FindPCIUTILS.cmake create mode 100644 kinfocenter/base/CMakeLists.txt rename kinfocenter/{info => base}/config-infocenter.h.cmake (100%) create mode 100644 kinfocenter/base/info_aix.cpp rename kinfocenter/{info => base}/info_fbsd.cpp (50%) create mode 100644 kinfocenter/base/info_generic.cpp create mode 100644 kinfocenter/base/info_hpux.cpp create mode 100644 kinfocenter/base/info_linux.cpp rename kinfocenter/{info => base}/info_netbsd.cpp (50%) create mode 100644 kinfocenter/base/info_openbsd.cpp rename kinfocenter/{info => base}/info_osx.cpp (73%) create mode 100644 kinfocenter/base/info_sgi.cpp create mode 100644 kinfocenter/base/info_solaris.cpp create mode 100644 kinfocenter/base/info_svr4.cpp create mode 100644 kinfocenter/base/os_base.h create mode 100644 kinfocenter/base/os_current.cpp create mode 100644 kinfocenter/base/os_current.h delete mode 100644 kinfocenter/helpwidget.cpp delete mode 100644 kinfocenter/helpwidget.h delete mode 100644 kinfocenter/info/info_aix.cpp delete mode 100644 kinfocenter/info/info_generic.cpp delete mode 100644 kinfocenter/info/info_hpux.cpp delete mode 100644 kinfocenter/info/info_linux.cpp delete mode 100644 kinfocenter/info/info_openbsd.cpp delete mode 100644 kinfocenter/info/info_sgi.cpp delete mode 100644 kinfocenter/info/info_solaris.cpp delete mode 100644 kinfocenter/info/info_svr4.cpp delete mode 100644 kinfocenter/info/memory.cpp delete mode 100644 kinfocenter/info/memory.h delete mode 100644 kinfocenter/kcrootonly.cpp delete mode 100644 kinfocenter/kcrootonly.h create mode 100644 kinfocenter/memory/CMakeLists.txt create mode 100644 kinfocenter/memory/Messages.sh create mode 100644 kinfocenter/memory/base.h create mode 100644 kinfocenter/memory/chartWidget.cpp create mode 100644 kinfocenter/memory/chartWidget.h rename kinfocenter/{info/memory.desktop => memory/kcm_memory.desktop} (99%) create mode 100644 kinfocenter/memory/memory.cpp create mode 100644 kinfocenter/memory/memory.h rename kinfocenter/{info => memory}/memory_fbsd.cpp (76%) rename kinfocenter/{info => memory}/memory_hpux.cpp (83%) rename kinfocenter/{info => memory}/memory_linux.cpp (62%) rename kinfocenter/{info => memory}/memory_netbsd.cpp (61%) rename kinfocenter/{info => memory}/memory_osx.cpp (86%) rename kinfocenter/{info => memory}/memory_sgi.cpp (68%) rename kinfocenter/{info => memory}/memory_solaris.cpp (80%) rename kinfocenter/{info => memory}/memory_tru64.cpp (81%) create mode 100644 kinfocenter/memory/physicalMemoryChart.cpp create mode 100644 kinfocenter/memory/physicalMemoryChart.h create mode 100644 kinfocenter/memory/swapMemoryChart.cpp create mode 100644 kinfocenter/memory/swapMemoryChart.h create mode 100644 kinfocenter/memory/totalMemoryChart.cpp create mode 100644 kinfocenter/memory/totalMemoryChart.h delete mode 100644 kinfocenter/moduleIface.cpp delete mode 100644 kinfocenter/moduleIface.h delete mode 100644 kinfocenter/moduleiconview.cpp delete mode 100644 kinfocenter/moduleiconview.h create mode 100644 kinfocenter/pci/CMakeLists.txt create mode 100644 kinfocenter/pci/Messages.sh create mode 100644 kinfocenter/pci/kcm_pci.cpp rename kinfocenter/{info/pci.desktop => pci/kcm_pci.desktop} (99%) create mode 100644 kinfocenter/pci/kcm_pci.h create mode 100644 kinfocenter/pci/pci.cpp create mode 100644 kinfocenter/pci/pci.h create mode 100644 kinfocenter/pci/pci_private.h delete mode 100644 kinfocenter/quickhelp.cpp delete mode 100644 kinfocenter/quickhelp.h delete mode 100644 kinfocenter/searchwidget.cpp delete mode 100644 kinfocenter/searchwidget.h delete mode 100644 kinfocenter/version.h diff --git a/CMakeLists.txt b/CMakeLists.txt index a9866cfaf1..0a97d7a3bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,6 @@ include (KDE4Defaults) include (MacroLibrary) include(MacroOptionalAddSubdirectory) -macro_optional_find_package(OpenGL) - include(ConfigureChecks.cmake) configure_file (config-apps.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-apps.h ) include_directories (${CMAKE_CURRENT_BINARY_DIR}) diff --git a/cmake/modules/FindPCIUTILS.cmake b/cmake/modules/FindPCIUTILS.cmake new file mode 100644 index 0000000000..298f95d8ed --- /dev/null +++ b/cmake/modules/FindPCIUTILS.cmake @@ -0,0 +1,20 @@ +# - Try to find the pciutils directory library +# Once done this will define +# +# PCIUTILS_FOUND - system has PCIUtils +# PCIUTILS_INCLUDE_DIR - the PCIUTILS include directory +# PCIUTILS_LIBRARIES - The libraries needed to use FAM + +if(PCIUTILS_INCLUDE_DIR AND PCIUTILS_LIBRARIES) + set(PCIUTILS_FIND_QUIETLY TRUE) +endif(PCIUTILS_INCLUDE_DIR AND PCIUTILS_LIBRARIES) + +FIND_PATH(PCIUTILS_INCLUDE_DIR pci/pci.h) + +FIND_LIBRARY(PCIUTILS_LIBRARIES NAMES pci ) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCIUTILS DEFAULT_MSG PCIUTILS_LIBRARIES PCIUTILS_INCLUDE_DIR) + +MARK_AS_ADVANCED(PCIUTILS_INCLUDE_DIR PCIUTILS_LIBRARIES) + diff --git a/kinfocenter/CMakeLists.txt b/kinfocenter/CMakeLists.txt index 3d70e4ff93..39e6f9cd0b 100644 --- a/kinfocenter/CMakeLists.txt +++ b/kinfocenter/CMakeLists.txt @@ -1,12 +1,32 @@ + +add_definitions( -DKDE_DEFAULT_DEBUG_AREA=1208 ) + add_subdirectory( about ) -add_definitions (-DQT3_SUPPORT -DQT3_SUPPORT_WARNINGS) - add_subdirectory( solidproc ) + add_subdirectory( info ) + add_subdirectory( nics ) add_subdirectory( usbview ) -add_subdirectory( opengl ) +add_subdirectory( memory ) + +macro_optional_find_package(OpenGL) +macro_log_feature(OPENGL_FOUND "OpenGL" "API for developing portable, interactive 2D and 3D graphics applications" "http://mesa3d.sourceforge.net" FALSE "" "View OpenGL details in kinfocenter.") + +if(OPENGL_FOUND AND OPENGL_GLU_FOUND) + add_subdirectory( opengl ) +else(OPENGL_FOUND AND OPENGL_GLU_FOUND) + MESSAGE(STATUS "OpenGL information module has been disabled.") +endif(OPENGL_FOUND AND OPENGL_GLU_FOUND) + + +macro_optional_find_package(PCIUTILS) +macro_log_feature(PCIUTILS_FOUND "PCIUTILS" "PciUtils is a library for direct access to PCI slots" "http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml" FALSE "" "View PCI details in kinfocenter.") + +if(NOT APPLE) + add_subdirectory( pci ) +endif(NOT APPLE) macro_optional_find_package(RAW1394) macro_log_feature(RAW1394_FOUND "RAW1394" "library for direct access to IEEE 1394 bus" "http://www.linux1394.org/" FALSE "" "View FireWire devices in kinfocenter.") @@ -19,25 +39,13 @@ set(kinfocenter_SRCS main.cpp toplevel.cpp indexwidget.cpp - helpwidget.cpp dockcontainer.cpp aboutwidget.cpp - quickhelp.cpp moduletreeview.cpp - moduleiconview.cpp - moduleIface.cpp global.cpp modules.cpp proxywidget.cpp - kcrootonly.cpp - searchwidget.cpp ) - -set(kinfocenter_adaptor ${KDEBASE_APPS_SOURCE_DIR}/kinfocenter/moduleIface.h) -set(kinfocenter_xml ${CMAKE_CURRENT_BINARY_DIR}/org.kde.Kinfocenter.xml) -ADD_CUSTOM_COMMAND(OUTPUT ${kinfocenter_xml} - COMMAND ${QT_DBUSCPP2XML_EXECUTABLE} ${kinfocenter_adaptor} > ${kinfocenter_xml} - DEPENDS ${kinfocenter_adaptor}) -QT4_ADD_DBUS_INTERFACE( kinfocenter_SRCS ${kinfocenter_xml} kinfocenter_interface ) +) set(kinfocenter_KDEINIT_SRCS ${kinfocenter_SRCS}) diff --git a/kinfocenter/about/kinfocenter.css b/kinfocenter/about/kinfocenter.css index 8c646676e5..084d941956 100644 --- a/kinfocenter/about/kinfocenter.css +++ b/kinfocenter/about/kinfocenter.css @@ -44,9 +44,3 @@ font-size: xx-small; } -.kcm_link { - color: #000; -} - -/* vim:set sw=2 et nocindent smartindent: */ - diff --git a/kinfocenter/about/main.html b/kinfocenter/about/main.html index bb9c73cb3d..57a23405bf 100644 --- a/kinfocenter/about/main.html +++ b/kinfocenter/about/main.html @@ -4,13 +4,10 @@ - -