From 49874b56c97595bda75a2b4445bffab66a8f7463 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Sat, 30 Mar 2019 16:53:18 -0500 Subject: [PATCH] Lubuntuify the package. --- .clang-format | 2 - .translation-update | 1 - CHANGELOG | 92 - CMakeLists.txt | 52 - COPYING | 280 --- LICENSE.QPL | 103 - Qt5TranslationLoader.cpp.in | 33 - README.md | 17 - cmake/Qt5PatchedLinguistToolsMacros.cmake | 112 - debian/changelog | 8 +- debian/control | 22 +- icon/icon-small.xpm | 196 -- icon/icon.xpm | 57 - icon/letters.png | Bin 720 -> 0 bytes icon/letters.xcf | Bin 9159 -> 0 bytes icon/letters.xpm | 19 - icon/pause.png | Bin 502 -> 0 bytes icon/qps.png | Bin 623 -> 0 bytes icon/rec.png | Bin 686 -> 0 bytes icon/superman.png | Bin 4497 -> 0 bytes icon/vcross.png | Bin 656 -> 0 bytes icon/vista.png | Bin 3178 -> 0 bytes icon/vpointer.png | Bin 660 -> 0 bytes icon/vpointer.xpm | 25 - icon/warn.xpm | 46 - icon/x1.xpm | 98 - icon/x2.xpm | 49 - qps.1 | 317 --- qps.desktop.in | 21 - qps.qrc | 10 - src/CMakeLists.txt | 111 - src/checkboxdelegate.cpp | 110 - src/checkboxdelegate.h | 46 - src/command.cpp | 309 --- src/command.h | 61 - src/commanddialog.cpp | 273 --- src/commanddialog.h | 63 - src/commandmodel.cpp | 63 - src/commandmodel.h | 38 - src/commandutils.cpp | 91 - src/commandutils.h | 34 - src/config.h | 37 - src/details.cpp | 757 ------- src/details.h | 245 -- src/dialogs.cpp | 415 ---- src/dialogs.h | 123 - src/execwindow.cpp | 124 -- src/execwindow.h | 54 - src/fieldsel.cpp | 123 - src/fieldsel.h | 66 - src/global.h | 42 - src/htable.cpp | 1288 ----------- src/htable.h | 379 ---- src/htable2.cpp | 232 -- src/htable2.h | 207 -- src/infobar.cpp | 1380 ------------ src/infobar.h | 232 -- src/listmodel.cpp | 122 - src/listmodel.h | 53 - src/lookup.cpp | 284 --- src/lookup.h | 105 - src/message.ui | 37 - src/misc.cpp | 1233 ---------- src/misc.h | 317 --- src/prefs.cpp | 420 ---- src/prefs.h | 54 - src/proc.cpp | 2237 ------------------- src/proc.h | 889 -------- src/proc_common.cpp | 1120 ---------- src/proc_linux.cpp | 2271 ------------------- src/proc_mosix.cpp | 2480 --------------------- src/proc_solaris.cpp | 1344 ----------- src/pstable.cpp | 603 ----- src/pstable.h | 81 - src/pstable2.cpp | 513 ----- src/pstable2.h | 93 - src/qps.cpp | 2473 -------------------- src/qps.h | 338 --- src/qpsapp.cpp | 80 - src/qpsapp.h | 48 - src/qttableview.cpp | 1819 --------------- src/qttableview.h | 240 -- src/screenshot.cpp | 448 ---- src/screenshot.h | 133 -- src/stable.h | 112 - src/svec.cpp | 162 -- src/svec.h | 155 -- src/tablefield.h | 37 - src/translations/qps.ts | 1772 --------------- src/translations/qps_ca.ts | 1791 --------------- src/translations/qps_cs.ts | 1792 --------------- src/translations/qps_cy.ts | 1772 --------------- src/translations/qps_da.ts | 1792 --------------- src/translations/qps_de.ts | 1792 --------------- src/translations/qps_el.ts | 1772 --------------- src/translations/qps_es.ts | 1792 --------------- src/translations/qps_fr.ts | 1789 --------------- src/translations/qps_gl.ts | 1792 --------------- src/translations/qps_he.ts | 1786 --------------- src/translations/qps_id.ts | 1791 --------------- src/translations/qps_lt.ts | 1792 --------------- src/translations/qps_nb_NO.ts | 1792 --------------- src/translations/qps_pl.ts | 1773 --------------- src/translations/qps_pt.ts | 1778 --------------- src/translations/qps_pt_BR.ts | 1791 --------------- src/translations/qps_ru.ts | 1792 --------------- src/translations/qps_ru_RU.ts | 1772 --------------- src/trayicon.cpp | 263 --- src/trayicon.h | 101 - src/ttystr.cpp | 228 -- src/ttystr.h | 52 - src/uidstr.cpp | 78 - src/uidstr.h | 40 - src/watchcond.cpp | 92 - src/watchcond.h | 66 - src/watchdog.ui | 458 ---- src/watchdogdialog.cpp | 255 --- src/watchdogdialog.h | 65 - src/wchan.cpp | 202 -- src/wchan.h | 48 - 120 files changed, 18 insertions(+), 64617 deletions(-) delete mode 100644 .clang-format delete mode 100644 .translation-update delete mode 100644 CHANGELOG delete mode 100644 CMakeLists.txt delete mode 100644 COPYING delete mode 100644 LICENSE.QPL delete mode 100644 Qt5TranslationLoader.cpp.in delete mode 100644 README.md delete mode 100644 cmake/Qt5PatchedLinguistToolsMacros.cmake delete mode 100644 icon/icon-small.xpm delete mode 100644 icon/icon.xpm delete mode 100644 icon/letters.png delete mode 100644 icon/letters.xcf delete mode 100644 icon/letters.xpm delete mode 100644 icon/pause.png delete mode 100644 icon/qps.png delete mode 100644 icon/rec.png delete mode 100644 icon/superman.png delete mode 100644 icon/vcross.png delete mode 100644 icon/vista.png delete mode 100644 icon/vpointer.png delete mode 100644 icon/vpointer.xpm delete mode 100644 icon/warn.xpm delete mode 100644 icon/x1.xpm delete mode 100644 icon/x2.xpm delete mode 100644 qps.1 delete mode 100644 qps.desktop.in delete mode 100644 qps.qrc delete mode 100644 src/CMakeLists.txt delete mode 100644 src/checkboxdelegate.cpp delete mode 100644 src/checkboxdelegate.h delete mode 100644 src/command.cpp delete mode 100644 src/command.h delete mode 100644 src/commanddialog.cpp delete mode 100644 src/commanddialog.h delete mode 100644 src/commandmodel.cpp delete mode 100644 src/commandmodel.h delete mode 100644 src/commandutils.cpp delete mode 100644 src/commandutils.h delete mode 100644 src/config.h delete mode 100644 src/details.cpp delete mode 100644 src/details.h delete mode 100644 src/dialogs.cpp delete mode 100644 src/dialogs.h delete mode 100644 src/execwindow.cpp delete mode 100644 src/execwindow.h delete mode 100644 src/fieldsel.cpp delete mode 100644 src/fieldsel.h delete mode 100644 src/global.h delete mode 100644 src/htable.cpp delete mode 100644 src/htable.h delete mode 100644 src/htable2.cpp delete mode 100644 src/htable2.h delete mode 100644 src/infobar.cpp delete mode 100644 src/infobar.h delete mode 100644 src/listmodel.cpp delete mode 100644 src/listmodel.h delete mode 100644 src/lookup.cpp delete mode 100644 src/lookup.h delete mode 100644 src/message.ui delete mode 100644 src/misc.cpp delete mode 100644 src/misc.h delete mode 100644 src/prefs.cpp delete mode 100644 src/prefs.h delete mode 100644 src/proc.cpp delete mode 100644 src/proc.h delete mode 100644 src/proc_common.cpp delete mode 100644 src/proc_linux.cpp delete mode 100644 src/proc_mosix.cpp delete mode 100644 src/proc_solaris.cpp delete mode 100644 src/pstable.cpp delete mode 100644 src/pstable.h delete mode 100644 src/pstable2.cpp delete mode 100644 src/pstable2.h delete mode 100644 src/qps.cpp delete mode 100644 src/qps.h delete mode 100644 src/qpsapp.cpp delete mode 100644 src/qpsapp.h delete mode 100644 src/qttableview.cpp delete mode 100644 src/qttableview.h delete mode 100644 src/screenshot.cpp delete mode 100644 src/screenshot.h delete mode 100644 src/stable.h delete mode 100644 src/svec.cpp delete mode 100644 src/svec.h delete mode 100644 src/tablefield.h delete mode 100644 src/translations/qps.ts delete mode 100644 src/translations/qps_ca.ts delete mode 100644 src/translations/qps_cs.ts delete mode 100644 src/translations/qps_cy.ts delete mode 100644 src/translations/qps_da.ts delete mode 100644 src/translations/qps_de.ts delete mode 100644 src/translations/qps_el.ts delete mode 100644 src/translations/qps_es.ts delete mode 100644 src/translations/qps_fr.ts delete mode 100644 src/translations/qps_gl.ts delete mode 100644 src/translations/qps_he.ts delete mode 100644 src/translations/qps_id.ts delete mode 100644 src/translations/qps_lt.ts delete mode 100644 src/translations/qps_nb_NO.ts delete mode 100644 src/translations/qps_pl.ts delete mode 100644 src/translations/qps_pt.ts delete mode 100644 src/translations/qps_pt_BR.ts delete mode 100644 src/translations/qps_ru.ts delete mode 100644 src/translations/qps_ru_RU.ts delete mode 100644 src/trayicon.cpp delete mode 100644 src/trayicon.h delete mode 100644 src/ttystr.cpp delete mode 100644 src/ttystr.h delete mode 100644 src/uidstr.cpp delete mode 100644 src/uidstr.h delete mode 100644 src/watchcond.cpp delete mode 100644 src/watchcond.h delete mode 100644 src/watchdog.ui delete mode 100644 src/watchdogdialog.cpp delete mode 100644 src/watchdogdialog.h delete mode 100644 src/wchan.cpp delete mode 100644 src/wchan.h diff --git a/.clang-format b/.clang-format deleted file mode 100644 index 1e70b4d..0000000 --- a/.clang-format +++ /dev/null @@ -1,2 +0,0 @@ -BreakBeforeBraces: Allman -IndentWidth: 4 diff --git a/.translation-update b/.translation-update deleted file mode 100644 index f25285c..0000000 --- a/.translation-update +++ /dev/null @@ -1 +0,0 @@ -translations='./src' diff --git a/CHANGELOG b/CHANGELOG deleted file mode 100644 index d3466ea..0000000 --- a/CHANGELOG +++ /dev/null @@ -1,92 +0,0 @@ -qps-1.10.20 / 2019-02-25 -======================== - - * Bumped version to 1.10.20 - * Only translations was changed. - -qps-1.10.19 / 2019-01-25 -======================== - - * Bumped version to 1.10.19 - * Improved cmake scripting - - set cmake_minimum_required to 3.1.0 - - removed locale compile definitons, use lxqt-build-tools instead - - use lxqt-build-tools translation scripts - * Added translation support and fixed some source strings - * Translations updated - * Added translation promo to README.md - -qps-1.10.18 / 2018-05-21 -======================== - - * Bumped patch version to 18 (#45) - * Update from Weblate. (#41) - * Added transltion state to README.md - * Add da translation - * translation update - * Added translation using Weblate (German) - * Create qps_da.ts - * Update qps.desktop.in - * i18n: Update Polish translation - * Drop Qt foreach - * Fix links QtDesktop --> lxqt - -1.10.17 / 2017-09-22 -==================== - - * Release 1.10.17: Update changelog - * some whitespaces fixed - * l10n: Polish translation - * Remove obsolete cpack - * Removed not needed ressource file - * some small fixes - * Fixed About page - * Fixed outdated FSF address in license headers - * Removed: It may be used, distributed and modified without limitation. - not exactly true. - * Added license headers - * Fix typo - * Fix license headers for files with clearly known authorship - * remove some empty files - * fixed encoding and added a proper GPL2 file header - * Renamed LICENSE -> COPYING - * Another set of licenseheader fixes - * Fixed some typos in comments (CMakeLists.txt) Fixed licenseheader: src/wchan.cpp UTF-8 and filename Fixed licenseheader: src/watchdogdialog.* filetype and UTF-8 Fixed licenseheader: src/watchcond.* UTF-8 Fixed licenseheader: src/ttystr.cpp filentype and UTF-8 - * Work around grep 2.23 new behaviour - * Removes not needed file - * Fixes CPack package version - * Fixes misnaming of binary qps - * Use CMAKE PROJECT_NAME instead of PROJECT - * Removes Icon related commented code - * Removes the custom QtIconLoader - * Use QIcon::fromTheme() instead of the internal QtIconLoader - * Adds the resources as an target dependency - * Puts TableField sctruct on it's own file - * Puts the QpsApp in it's own file - * Splits the command file into several files - * Puts Command utilities into it's own file - * Updates translations sources - * Removes toolTip, statusTip, whatsThis and accesibleName from watchdog.ui - * Removes stylesheets commented stuff - * Include a copy of the license - * Install application icon - * Updates translation sources - * Adds desktop entry file - * Adds application internationalization / localization - * Set the minimum required CMake version to 3.0.2 - * Add install instruction in CMakeLists.txt - * Add clang-format file and format all files - -v1.10.16 / 2015-06-14 -===================== - - * Ported to Qt5 and fixed all warnings - * Added .gitignore - * remove - * fix - * fix - * fix - * hashstr length up to 128*8 - * added - * fixed - * added source files - * commit diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index eb10866..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) -# CMP0000: Call the cmake_minimum_required() command at the beginning of the top-level -# CMakeLists.txt file even before calling the project() command. -# The cmake_minimum_required(VERSION) command implicitly invokes the cmake_policy(VERSION) -# command to specify that the current project code is written for the given range of CMake -# versions. -Project(qps) - -option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF) - -set(MAJOR_VERSION 1) -set(MINOR_VERSION 10) -set(PATCH_VERSION 20) -set(QPS_VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}) -add_definitions( - -DQPS_VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}" -) - -# Minimum Versions -set(LXQTBT_MINIMUM_VERSION "0.6.0") -set(QT_MINIMUM_VERSION "5.7.1") -find_package(Qt5 ${QT_MINIMUM_VERSION} REQUIRED COMPONENTS Widgets X11Extras DBus LinguistTools) -find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED) - -include(GNUInstallDirs) -include(LXQtPreventInSourceBuilds) -include(LXQtCompilerSettings) -include(LXQtTranslateTs) -include(LXQtTranslateDesktop) -include(Qt5TranslationLoader) - -# Must be defined after including GNUInstallDirs. Move with care. -set(QPS_TRANSLATIONS_DIR - "${CMAKE_INSTALL_FULL_DATAROOTDIR}/${PROJECT_NAME}/translations" -) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTOUIC ON) -set(CMAKE_AUTORCC ON) - -add_subdirectory(src) - -# install the man page -install(FILES qps.1 DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/man/man1") - -# install the app icon -install(FILES - icon/qps.png - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps" -) diff --git a/COPYING b/COPYING deleted file mode 100644 index d8cf7d4..0000000 --- a/COPYING +++ /dev/null @@ -1,280 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/LICENSE.QPL b/LICENSE.QPL deleted file mode 100644 index 4ae0c73..0000000 --- a/LICENSE.QPL +++ /dev/null @@ -1,103 +0,0 @@ - THE Q PUBLIC LICENSE - version 1.0 - - Copyright (C) 1999-2006 Trolltech AS, Norway. - Everyone is permitted to copy and - distribute this license document. - -The intent of this license is to establish freedom to share and change the -software regulated by this license under the open source model. - -This license applies to any software containing a notice placed by the -copyright holder saying that it may be distributed under the terms of -the Q Public License version 1.0. Such software is herein referred to as -the Software. This license covers modification and distribution of the -Software, use of third-party application programs based on the Software, -and development of free software which uses the Software. - - Granted Rights - -1. You are granted the non-exclusive rights set forth in this license - provided you agree to and comply with any and all conditions in this - license. Whole or partial distribution of the Software, or software - items that link with the Software, in any form signifies acceptance of - this license. - -2. You may copy and distribute the Software in unmodified form provided - that the entire package, including - but not restricted to - copyright, - trademark notices and disclaimers, as released by the initial developer - of the Software, is distributed. - -3. You may make modifications to the Software and distribute your - modifications, in a form that is separate from the Software, such as - patches. The following restrictions apply to modifications: - - a. Modifications must not alter or remove any copyright notices in - the Software. - - b. When modifications to the Software are released under this - license, a non-exclusive royalty-free right is granted to the - initial developer of the Software to distribute your modification - in future versions of the Software provided such versions remain - available under these terms in addition to any other license(s) of - the initial developer. - -4. You may distribute machine-executable forms of the Software or - machine-executable forms of modified versions of the Software, provided - that you meet these restrictions: - - a. You must include this license document in the distribution. - - b. You must ensure that all recipients of the machine-executable forms - are also able to receive the complete machine-readable source code - to the distributed Software, including all modifications, without - any charge beyond the costs of data transfer, and place prominent - notices in the distribution explaining this. - - c. You must ensure that all modifications included in the - machine-executable forms are available under the terms of this - license. - -5. You may use the original or modified versions of the Software to - compile, link and run application programs legally developed by you - or by others. - -6. You may develop application programs, reusable components and other - software items that link with the original or modified versions of the - Software. These items, when distributed, are subject to the following - requirements: - - a. You must ensure that all recipients of machine-executable forms of - these items are also able to receive and use the complete - machine-readable source code to the items without any charge - beyond the costs of data transfer. - - b. You must explicitly license all recipients of your items to use - and re-distribute original and modified versions of the items in - both machine-executable and source code forms. The recipients must - be able to do so without any charges whatsoever, and they must be - able to re-distribute to anyone they choose. - - - c. If the items are not available to the general public, and the - initial developer of the Software requests a copy of the items, - then you must supply one. - - Limitations of Liability - -In no event shall the initial developers or copyright holders be liable -for any damages whatsoever, including - but not restricted to - lost -revenue or profits or other direct, indirect, special, incidental or -consequential damages, even if they have been advised of the possibility -of such damages, except to the extent invariable law, if any, provides -otherwise. - - No Warranty - -The Software and this license document are provided AS IS with NO WARRANTY -OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE. - Choice of Law - -This license is governed by the Laws of Norway. Disputes shall be settled -by Oslo City Court. diff --git a/Qt5TranslationLoader.cpp.in b/Qt5TranslationLoader.cpp.in deleted file mode 100644 index ffdfcb4..0000000 --- a/Qt5TranslationLoader.cpp.in +++ /dev/null @@ -1,33 +0,0 @@ -/* This file has been generated by the CMake qt_translation_loader(). - * It loads Qt application translations. - * - * Attention: All changes will be overwritten!!! - */ - -#include -#include -#include -#include - -static void loadQtTranslation() -{ - QString locale = QLocale::system().name(); - QTranslator *qtTranslator = new QTranslator(qApp); - - if (qtTranslator->load("qt_" + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) { - qApp->installTranslator(qtTranslator); - } else { - delete qtTranslator; - } - - QTranslator *appTranslator = new QTranslator(qApp); - if (appTranslator->load(QString("@translations_dir@/@catalog_name@_%1.qm").arg(locale))) { - QCoreApplication::installTranslator(appTranslator); - } else if (locale == QLatin1String("C") || - locale.startsWith(QLatin1String("en"))) { - // English is the default. It's translated anyway. - delete appTranslator; - } -} - -Q_COREAPP_STARTUP_FUNCTION(loadQtTranslation) diff --git a/README.md b/README.md deleted file mode 100644 index d2a66b4..0000000 --- a/README.md +++ /dev/null @@ -1,17 +0,0 @@ -## Qt Process Manager - -### Building - -* Requires Qt 5 - -### License - -Qps is licensed under the terms of the -[GPLv2](http://choosealicense.com/licenses/gpl-2.0/) or any later version. - - -### Translation (Weblate) - - -Translation status - diff --git a/cmake/Qt5PatchedLinguistToolsMacros.cmake b/cmake/Qt5PatchedLinguistToolsMacros.cmake deleted file mode 100644 index e5c2f5c..0000000 --- a/cmake/Qt5PatchedLinguistToolsMacros.cmake +++ /dev/null @@ -1,112 +0,0 @@ -#============================================================================= -# Copyright 2005-2011 Kitware, Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# * Neither the name of Kitware, Inc. nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#============================================================================= - -include(CMakeParseArguments) - -function(QT5_PATCHED_CREATE_TRANSLATION _qm_files) - set(options) - set(oneValueArgs) - set(multiValueArgs OPTIONS) - - cmake_parse_arguments(_LUPDATE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - set(_lupdate_files ${_LUPDATE_UNPARSED_ARGUMENTS}) - set(_lupdate_options ${_LUPDATE_OPTIONS}) - - set(_my_sources) - set(_my_tsfiles) - foreach(_file ${_lupdate_files}) - get_filename_component(_ext ${_file} EXT) - get_filename_component(_abs_FILE ${_file} ABSOLUTE) - if(_ext MATCHES "ts") - list(APPEND _my_tsfiles ${_abs_FILE}) - else() - list(APPEND _my_sources ${_abs_FILE}) - endif() - endforeach() - foreach(_ts_file ${_my_tsfiles}) - if(_my_sources) - # make a list file to call lupdate on, so we don't make our commands too - # long for some systems -# get_filename_component(_ts_name ${_ts_file} NAME_WE) - - get_filename_component(_name ${_ts_file} NAME) - string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _ts_name ${_name}) - - set(_ts_lst_file "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_ts_name}_lst_file") - set(_lst_file_srcs) - foreach(_lst_file_src ${_my_sources}) - set(_lst_file_srcs "${_lst_file_src}\n${_lst_file_srcs}") - endforeach() - - get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES) - foreach(_pro_include ${_inc_DIRS}) - get_filename_component(_abs_include "${_pro_include}" ABSOLUTE) - set(_lst_file_srcs "-I${_pro_include}\n${_lst_file_srcs}") - endforeach() - - file(WRITE ${_ts_lst_file} "${_lst_file_srcs}") - endif() - add_custom_command(OUTPUT ${_ts_file} - COMMAND ${Qt5_LUPDATE_EXECUTABLE} - ARGS ${_lupdate_options} "@${_ts_lst_file}" -ts ${_ts_file} - DEPENDS ${_my_sources} ${_ts_lst_file} VERBATIM) - endforeach() - qt5_patched_add_translation(${_qm_files} ${_my_tsfiles}) - set(${_qm_files} ${${_qm_files}} PARENT_SCOPE) -endfunction() - - -function(QT5_PATCHED_ADD_TRANSLATION _qm_files) - foreach(_current_FILE ${ARGN}) - get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE) -# get_filename_component(qm ${_abs_FILE} NAME_WE) - - get_filename_component(_name ${_abs_FILE} NAME) - string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" qm ${_name}) - - get_source_file_property(output_location ${_abs_FILE} OUTPUT_LOCATION) - if(output_location) - file(MAKE_DIRECTORY "${output_location}") - set(qm "${output_location}/${qm}.qm") - else() - set(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm") - endif() - - add_custom_command(OUTPUT ${qm} - COMMAND ${Qt5_LRELEASE_EXECUTABLE} - ARGS ${_abs_FILE} -qm ${qm} - DEPENDS ${_abs_FILE} VERBATIM - ) - list(APPEND ${_qm_files} ${qm}) - endforeach() - set(${_qm_files} ${${_qm_files}} PARENT_SCOPE) -endfunction() diff --git a/debian/changelog b/debian/changelog index 12b87de..5ec7960 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,12 @@ +qps (1.10.20-1ubuntu1) disco; urgency=medium + + * Lubuntuify the package. + + -- Simon Quigley Sat, 09 Mar 2019 12:16:07 -0600 + qps (1.10.20-1) unstable; urgency=medium - * Cherry-picking upstream-version 1.10.20. + * Cherry-picking upstream-version 1.10.20. -- Alf Gaida Mon, 25 Feb 2019 23:41:57 +0100 diff --git a/debian/control b/debian/control index f249022..056b642 100644 --- a/debian/control +++ b/debian/control @@ -1,25 +1,25 @@ Source: qps -Maintainer: LXQt Packaging Team -Uploaders: Alf Gaida , - ChangZhuo Chen (陳昌倬) , - Andrew Lee (李健秋) +Maintainer: Lubuntu Developers +XSBC-Original-Maintainer: LXQt Packaging Team +Uploaders: Simon Quigley Section: x11 Priority: optional -Build-Depends: debhelper-compat (= 12), - cmake, - libxrender-dev, +Build-Depends: cmake, + debhelper-compat (= 12), libqt5x11extras5-dev, + libxrender-dev, lxqt-build-tools (>= 0.6.0~), qttools5-dev, qttools5-dev-tools Standards-Version: 4.3.0 -Vcs-Browser: https://salsa.debian.org/lxqt-team/qps -Vcs-Git: https://salsa.debian.org/lxqt-team/qps.git +Vcs-Browser: https://phab.lubuntu.me/source/qps/ +Vcs-Git: https://phab.lubuntu.me/source/qps.git +XS-Debian-Vcs-Browser: https://salsa.debian.org/lxqt-team/qps +XS-Debian-Vcs-Git: https://salsa.debian.org/lxqt-team/qps.git Homepage: https://github.com/lxqt/qps Package: qps Architecture: linux-any -Depends: ${shlibs:Depends}, - ${misc:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} Description: Qt process manager Qt process manager ported to Qt5 diff --git a/icon/icon-small.xpm b/icon/icon-small.xpm deleted file mode 100644 index 4488ef9..0000000 --- a/icon/icon-small.xpm +++ /dev/null @@ -1,196 +0,0 @@ -/* XPM */ -static char * icon_small_xpm[] = { -"25 25 168 2", -" c None", -". c #181918", -"+ c #3F413F", -"@ c #242524", -"# c #008600", -"$ c #008000", -"% c #000300", -"& c #002000", -"* c #00AF00", -"= c #000000", -"- c #004500", -"; c #010101", -"> c #2D2E2D", -", c #139F13", -"' c #000400", -") c #007200", -"! c #005800", -"~ c #131313", -"{ c #2CAB2C", -"] c #033803", -"^ c #001800", -"/ c #00B200", -"( c #030303", -"_ c #2C2D2C", -": c #039603", -"< c #000700", -"[ c #007100", -"} c #005900", -"| c #005000", -"1 c #007A00", -"2 c #001300", -"3 c #333433", -"4 c #020202", -"5 c #006C00", -"6 c #001900", -"7 c #008800", -"8 c #016101", -"9 c #2B2C2B", -"0 c #9A9A9A", -"a c #494A49", -"b c #001500", -"c c #008900", -"d c #033703", -"e c #25CA25", -"f c #9E9D9E", -"g c #9E9A9E", -"h c #828282", -"i c #404240", -"j c #007000", -"k c #004200", -"l c #040404", -"m c #232423", -"n c #9E9E9E", -"o c #9B989B", -"p c #7A7A7A", -"q c #4F514F", -"r c #3F423F", -"s c #00B700", -"t c #232323", -"u c #9A979A", -"v c #3F3F3F", -"w c #8F8C8F", -"x c #5C5B5C", -"y c #696B69", -"z c #484948", -"A c #008500", -"B c #9D999D", -"C c #676567", -"D c #3D3E3D", -"E c #4E4C4E", -"F c #2A292A", -"G c #323132", -"H c #666466", -"I c #999699", -"J c #535253", -"K c #004A00", -"L c #010401", -"M c #252625", -"N c #484748", -"O c #4C4A4C", -"P c #979597", -"Q c #949294", -"R c #949394", -"S c #A1A3A1", -"T c #000500", -"U c #004800", -"V c #2B6E2B", -"W c #6D6A6D", -"X c #545254", -"Y c #9C989C", -"Z c #272627", -"` c #726F72", -" . c #929192", -".. c #BFC1BF", -"+. c #A1C2A1", -"@. c #003D00", -"#. c #00C200", -"$. c #1C1D1C", -"%. c #8B8B8B", -"&. c #878487", -"*. c #373637", -"=. c #9B979B", -"-. c #787578", -";. c #716E71", -">. c #919091", -",. c #BEC0BE", -"'. c #9C9D9C", -"). c #494949", -"!. c #292929", -"~. c #8B8E8B", -"{. c #7D7E7D", -"]. c #7E7B7E", -"^. c #2E2C2E", -"/. c #908F90", -"(. c #BCBEBC", -"_. c #999A99", -":. c #4F4F4F", -"<. c #001400", -"[. c #00B600", -"}. c #060606", -"|. c #1D1D1D", -"1. c #6B6F6B", -"2. c #787978", -"3. c #444244", -"4. c #686668", -"5. c #8F8F8F", -"6. c #BABCBA", -"7. c #969796", -"8. c #555555", -"9. c #004700", -"0. c #151615", -"a. c #8F8E8F", -"b. c #B8BAB8", -"c. c #949494", -"d. c #5A5A5A", -"e. c #001000", -"f. c #6C6F6C", -"g. c #8D8D8D", -"h. c #B3B5B3", -"i. c #929292", -"j. c #608660", -"k. c #001A00", -"l. c #00B000", -"m. c #141514", -"n. c #6F726F", -"o. c #8D8E8D", -"p. c #646464", -"q. c #007E00", -"r. c #004C00", -"s. c #153215", -"t. c #656565", -"u. c #005400", -"v. c #007600", -"w. c #000900", -"x. c #009800", -"y. c #004000", -"z. c #004100", -"A. c #038603", -"B. c #03A003", -"C. c #2C4D2C", -"D. c #00AD00", -"E. c #002800", -"F. c #008700", -"G. c #139113", -"H. c #002500", -"I. c #00BB00", -"J. c #00A100", -"K. c #007C00", -" ", -" . + @ # $ % & * = = - = = = = = = = = = @ + . ", -" + ; > , ' = = ) ! = - = = = = = = = = ~ > ; + ", -" @ > { ] = = = ^ / = - = = = = = = = = ( _ > @ ", -" = ~ : < = = = = [ } - = = = = = = = = = ( ~ = ", -" = | 1 = = = = = 2 [ - = 3 4 = = = = = = = = = ", -" = 5 6 = = = = = = 7 8 9 0 a ( = = = = = = = = ", -" b c = = = = = = = d e f g h i ( = = = = = = = ", -" j k = = = = = = l m n g o p q r ( = = = = = = ", -" s 2 = = = = = l t n g u v w x y z ( = = = = = ", -" A = = = = = ( m n B C D E F G H I J = = = = = ", -" K % % % % L M n g I F N O P Q g R S % % % % T ", -" U k k k k V f g W X Y Z ` g g ...+.@.@.@.@.#. ", -" = = = = = $.%.&.*.=.-.Y ;.g >.,.'.).= = = = A ", -" = = = = = !.~.{.Z ].^.g g /.(._.:.= = = = <.[. ", -" = = = = = }.|.1.2.3.4.g 5.6.7.8.= = = = = 9.j ", -" = = = = = = = 0.1.%.g a.b.c.d.= = = = = = 7 e. ", -" = = = = = = = = 0.f.g.h.i.j.= = = = = = k.l.= ", -" = = = = = = = = = m.n.o.p.j <.= = = = = q.r.= ", -" = = = = = = = = = = s.t.= u.v.= = = = w.x.= = ", -" = ~ ( = = = = = = = y.= = = l.k.= = = z.A.~ = ", -" @ > _ ( = = = = = = y.= = = u.v.= = < B.C.> @ ", -" + ; > ~ = = = = = = y.= = = = D.E.T F.G.> ; + ", -" . + @ = = = = = = = y.= = = = H.I.J.K.= @ + . ", -" "}; diff --git a/icon/icon.xpm b/icon/icon.xpm deleted file mode 100644 index 29a3bcb..0000000 --- a/icon/icon.xpm +++ /dev/null @@ -1,57 +0,0 @@ -/* XPM */ -static const char *icon_xpm[] = { -"48 48 6 1", -" c None", -". c #000000", -"X c #00FF00", -"o c #7A7E7A", -"O c #FFFFFF", -"+ c #9E9A9E", -" ", -" .......XX..XX............................. ", -" ..oo...XX....XX.....X...................oo.. ", -" ..o..o.XX......X........................o..o.. ", -" .o....oX.......XX....X.................o....o. ", -" .o....oX........X......................o....o. ", -" ..o..oX.........XX...X..................o..o.. ", -" ...ooXX..........X.......................oo... ", -" .....X...........XX..X........................ ", -" .....X............X........................... ", -" ....XX............X..X........................ ", -" ....X..............X....Oo.................... ", -" ....X..............X.X..o+o................... ", -" ...X...............XX.Oo+++o.................. ", -" ...X................XXo++++oo................. ", -" ..XX................Oo++++o.oo................ ", -" ..X.................o++++++o.oo............... ", -" ..X...............Oo++++o+++o.oo.............. ", -" .XX...............o+++++..+++.o+o............. ", -" .X..............Oo++++oo+..++..++o............ ", -" .X..............o++++....+....+++++........... ", -" XX............Oo++++..++.++oo++++oO........... ", -" X.............o++++++....++++++++oO........... ", -" XX.X.X.X.X.XOo++++++++..+++++++oOoOX.X.X.X.XXX ", -" ............o++++...+++..++++++oOoO.........X. ", -" ............o+++..++++++.++++oOoO.O.........X. ", -" ............oo++.++++.+++++++oOoO...........X. ", -" ............ooo+..+++.+++++oOoO.O..........XX. ", -" ............Oooo+..+..+++++oOoO............X.. ", -" ..............ooo+...++++oOoO.O............X.. ", -" ...............ooo+++++++oOoO.............XX.. ", -" ................ooo++++oOoO.O.............X... ", -" .................ooo+++oOoO...............X... ", -" ..................ooo+OoO.O..............XX... ", -" ...................oooOoO.X..............X.... ", -" ....................ooO.O..X............XX.... ", -" .....................oO....X............X..... ", -" ......................O....XX...........X..... ", -" .....................X......X..........XX..... ", -" ............................XX.........X...... ", -" ...oo................X.......X........XX.oo... ", -" ..o..o.......................XX.......X.o..o.. ", -" .o....o..............X........X......XXo....o. ", -" .o....o.......................XX....XX.o....o. ", -" ..o..o...............X.........XX..XX...o..o.. ", -" ..oo...........................XXXX.....oo.. ", -" ...................X...................... ", -" "}; diff --git a/icon/letters.png b/icon/letters.png deleted file mode 100644 index 060124531850d61ef7795198047a905d1e65795e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 720 zcmV;>0x$iEP)Px#5>QN3MF0Q*07pImeQ{CjxBvhD0Hct^`Bt<50004WQchCe8{l_bjU~AH zG|TQG9#|ewvzP;jK|N;dTy4n`r?p~7G;`KW^#dFJ@GlV(14aQ^0s#>?_LDyK7U`F@ z8HdSLoKq&2mG6_)c2xWjbXD|I{w;vybiB)E;I@k%fe+Z@5s=i7^Wy|Fu?O8J33Kcq zBot4#;h{F)*V-ep`HSI*Z}W!Jow?HE9RG@j`;O?rkHlzCZ^GXb!zuC`d{lo6KCy!U z*-(TX*z%E`LQt>RasAP-8|)Oh<>9W_!CWXLO#m_Xb6QsZJv$Trx9kl313RPGKqbJ0 z^rC9x-v>P_-?l54oKI_0790c>hq53(XLCsln3b{wRbm!P8XQ$wHS|YGROT6{L{?%8 za9w&)665re1WN+!*~MOcEwh$ASu%nz%JpTVO~mLrzJ52};mfKpDGRNr)Y(?jFdb0XJz^Eo#!k3**n7MS%1}& z%%8%GpeALdgSEcXdKPJ6Q`55cENgs4VwR-AeTks0p^2Tp2<+i_KliM?KW?qZVXX}x z>NfDb;?tUFkrNGkugw>05&T8*DV%%OtwBHZ-_Cy*mRPmjb_2Np0000 diff --git a/icon/letters.xcf b/icon/letters.xcf deleted file mode 100644 index 4e9fc3e09082ca5eff4f651bb2e651b26e652bb0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9159 zcmc&)&yQU<6}GSECSgiT5iLThs*W;UB%q+A5-PBmNt#6$tPqu0bWx?#nPEhmgv@}_ z1u9ZET>-0hg@n{KVnIb0-SyAthDFPQb`Vk0%&+(6UB2&}V_*9|zc(oq@!t5_K0db3 z@%fH@eBW$ty>@fy_S(kMuP$D^6`X-|xE4z59C* zzK-O{@(rXj&w<2*&tpgnNIyklcb3WbII^daKe~xYFKoSbZFBv?=B=$)Kw`T;b8dU* z^;g%Iwyy82-`ZYZ+u6Etef#|4xsA=W8?WBDwRBFh3%533zP5DnyBFnCDO|Fq^XU3= zrE6?onq6Sm+uJv`x0XKp<6FCbcyIUZ_sB$}@k4`g)jOm!R;C4LSkn1f zM2h8yvhr86^21sAYbbN9_&JS2>>n*oe)}{pX(0zx^Cq+bTFyR&^c|#UOP=O05d9g5 z`JrwW8z46rOX%w3lq48)lqb9 zC^B?v3p<%kG{>H3)2L4JEEeEM&9vgKxTf=Np_{laqz6g9TR;Z888u%qqNLL{1vzA4g^9C@zDq* z(He7r;?ToWa)+ar0-<-2i9ZpE{6?G>wL8S96C@`-Ef^B-fAIP3ZQ|KXS?wd1 zRThM1-C~B$Mmmzq$W73T;yUQuOAq0-0nGYi# zEbR^w&cwMc&!y!RagBoMmj)*3ip$Eua%7IKyu3r z^roYC#!nSRHwh@b--m8I;6>n4u98@)rkoYk%1$<5Nj!NZvqKAIjuABUhC4=-ipFHx zVEUR(QTyENCc)1NP@snr=8Pxl@JJOePzRVBBbKnO)(R}2=(5!zj984+2ji5zP$X4Y zpd0vZ%mCp()})yDf2D#bl2sBO$(0JHrk;GJCK)E9 zmBU~q?V>D>i)$(jHKyYt3o%wAvG-hKVF%fc5b|Gv(S32{%<*>&ROg2-+%^Nwp+&{% zthodB_$O_trRsKruu`L5?>I{Foj=NcVir9LZym@kRaJn1_pW|-6nBi$)b<9WF`&=B z^To`^8H_#9peA%Cc^N=F$KaTDH`_)N69sTXX03n$1{WWI;^O115<+;NP@rzAM%YE7 zg4F_N;1hRPyxAegBxlnBKLwUiLLamd*HT7~j&g~UjxiV~16jGTsPN1rUdQ>Z(jGE6 zkmhs+S5}RXGiB@rSCl~I)=4=LB@l6#$9n+FrU-86COQ;QZPKyJ{!wV{g4L;w124n- z1h!4gDQS*94TpID7cU$dCAup#=ZlD$U@$~rVTzmU{MSQOH>?u#UBDQ4LCyc{vWnFd zs(8ZC2l`VqKuio8<%LCxODpL~_D_;q>3r&Bc16|s(&VM|B6hwFQDRu2IAO~!)mqS3 zK`?7K60PGgX{TsZgE?=ls|b1)y>H=LcrnW~ZX52iD8>XbFFI)U{$ue7fwRB_z$div za)Y=;M_mVKPhhukmbFDyg5SST~LWYGSUr+LFqgp3>)-=xM2*bN-;71 z2=9af)j&CT9Qf#f*TAiBM>19jkOuh0fG7mM`LRiSI7L#N>>kfE5tTwxt$_DcCfAgj zGHmP$v?ReGC)bhhd)P^foL;C{XcV!(K?Ygfu!>_Xz7tWH;qXp}98GC8@8pH)e-XM> z(Nl4rDqoeDK~+(fOWtq(QnIj9$~@5+iq3iCTAi;XX0v18nt6vVJ5_7NNc}#b{!-{c zxsyTIo?=n_AVDh&VhKYS8t9>WMZW?-!x%q?5OUx{2FGg!S_?p;^`JZ57uOTVOP4X3ePpu?m!V#2F#tye`$YT8Nd97`KWXq)|KA#15nASy^~Gh~o;x zn;5fV#1lptj9e4H-xi|$+}MUXh!d~4A0TR?LE%k2m^8CmBmxBpzPQ)(eLC(2eW=JY zB~L^SF_wNCB$&!L3N`h!g>b~a%E5x)!$XGS6cUQzh>))h0W_+M%kO|hr?Pu^k;Z>= zeUY~*a3bi24TR^;X^adP!(_o9^4yV8Yg6zC9+L{ME3-oj@?jD=?`B9RuQ&DGmK3qF zL00yVkv2CE_*hy=`>6=ST4amB?)$JuZ@#IL?&NA!;xNTURcM#Q8U`!d_}o~|?ldWu z>oGM5;?zk@0F^h%`XDi!dRCg}iv({qJr{6}$QULtPec7Nq+d&l%>V!JPvQ}O+y5=f zK)!sQ#}gov&$8vn(r^3--`%6deLZ@Z?FT(OWNbe&3 z8R>(PXZb2vgBmD;HcjSMgxy;nf%3t6;=MDdlI+K4~o6lSGBJxE< J^Iyyc{{}Ff+J*oC diff --git a/icon/letters.xpm b/icon/letters.xpm deleted file mode 100644 index cd7459a..0000000 --- a/icon/letters.xpm +++ /dev/null @@ -1,19 +0,0 @@ -/* XPM */ -static char * letters_xpm[] = { -"570 9 7 1", -" c None", -". c #000000", -"+ c #00473E", -"@ c #007D71", -"# c #51ECB7", -"$ c #FFFFFF", -"% c #00A390", -" ", -" +++ @###@ @###@ @###@ @### @@ +++ +#@ ### ### @ +@+ +++ +++ +++ +++ ### +%+ @###@ @###@ @+++@ @###@ @###@ @###@ @###@ @###@ +++ @###@ @###@ @###@ @###@ @###@ @###@ ### ###% +###@ @### @###@ @###@ @###@ @+++@ +#+ +++@ @+++@ @+++ # # #### @###@ ####@ @###@ %### @###@ @###@ %+++% %+++% %+++% @+++@ %+++% @###@ @##+ +++ +++ ### +++ +++ +++ %+++ +++ +++% @###@ @###@ ###@ @+++@ + + @+++@ %+++@ %+++ +++ +++ +++ @###@ @###@ #### ###@ %###% %+++% %+++% @+++% %+++% %+++% @###@ +++ +%+ +++ +++ ", -" + + # @ # + + # # # @# # + + + @%+ # # # # + # + + + + + + + + # # # + # + + # + # # # # + # + + # # # # # + # + # # # # # # # # # # # # # # # # # + # # # + # + # + # # + # + + # # # # + ## ## # # # # # # # # # # # + + # + # # # # # # # # # # + # # + # + + + % % + + + + + + # + + + + # # + # + # + # # + + + # # # # + + + + + + + # # # # # # # + + # + # # # # # # # # # # + # + + + # + + + + +", -" + + # @ # + + # # # + # + + + + # # #%# + # + + + + + + + + #+ # ## + # + + # + # # # # + # + + # # # # # + @ + + # + # + # + # + # # # # # # # # + # # # + # + # + # # + # + + # # #+ # + # # # # # # # # # # # # # # + + # + # # # # # # +# #+ #+ +# + #+ # + +# + + + # # + + + + + % # + + + + # # + # + # + # # + # + + # # #+ # + + + + + + + # # # # # # # + + # + # # # # # # +# #+ #+ +# + #+ + + + # + + + + +", -" +++ @###@ @###@ ###@ ### # +++ +++ %#% ##@## +++ ##@## +++ +%+ %+#+% +%+ @###@ ###@ @###@ @###@ @###@ +++@ @###@ @###@ +++ +@#@ +@#@ +@#@ +@#@ +@#@ @+##@ %###% %### @+++ @+++@ @### @### @+##@ @###@ +@+ +++@ @##+ @+++ @+++@ @+++@ @+++@ %###@ @#++@ ###% @###@ +@+ @+++@ @+++@ @+++@ # ### +#+ @+++ +%+ @+++@ +++ +++ +++ #### %###+ @###@ @###@ @###@ @###@ % ##@ @###@ +++ +++@ @##+@ @+++ %#+#% ##%+ ### @###@ @#++@ #### ### +@+ @+++@ @+++@ @+++@ # ### +#+ +++ + + +++ +++ ", -" + + @ # # # + # # # # + + + + # # #%# + # + + + + + + + +# + ## # + # + # + + # + # + # # # + # # # + # + @ + + # + + # + + # + + # + + # + # ##+ # # # # # + # # # + # + # # # # + # + + # # #+ # + # # # # # # # + # # # # # + # + # + # # # # # # # +# #+ + # + +# + # + + #+ + + + + + + + + # # # # # + # # # + # + # # # # + # + + # # ##+ # + # # # # #+ # # # + # # # # # + # + # + # # # # # # # +# #+ + # + +# + + + + # + + + + +", -" + + @ # # # + # # # # #@ + + + + # # # # + # + + @ + + + + + # + # # + # + # + + # + # + # # # + # # # + # + # + + + + + + + + + + + # + # # # # # + # # # + # + # # # # + # + + # # # # + # # # # # # # + # ## # # + # + # + # # +# #+ ## ## # # + # + # + # + + # + + + + + + + + # # # # # + # # # + # + # # # # + # + + # # # # + # # # # #+ # # # + # ## # # + # + # + # # +# #+ ## ## # # + # + # + + + + # + + + + +", -" +++ %###@ @###@ ###@ @###@ @@ +++ +++ ### ### @ +@+ @#+ +++ +#+ +++ ### +#+ @###@ @###@ +++@ @###@ @###@ +++@ @###@ @###@ +++ +#+ +#+ +#+ +#+ +#+ @###@ %+++% ###% +###@ #### @###@ #+++ @###@ @+++@ +#+ @###@ @+++@ @###+ %+++% #+++# @###@ %+++ @###@ %+++% @###@ +%+ ### # #+ +# %+++% +#+ %###@ @##+ +++ +++ +++ @###@ @###@ @###% %### @###@ +#### @###@ #+++ ###% @+++@ +#+ @###@ %+++@ @###+ # % # #++# ### %+++ @###@ %+++% %### +%+ +###+ # #+++# %+++% #+ @###@ +++ +%+ +++ +++ ", -" # "}; diff --git a/icon/pause.png b/icon/pause.png deleted file mode 100644 index 9b5dc47b63a28075c2e28e5985de028bd938c07b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 502 zcmVPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FZT01FZU(%pXi00007bV*G`2iOP% z03rjk5dZD~00DMML_t(Y$L&>3Pr^VDeKT!sVX3w_!7KP{EIP%zCsLIs%5<|vg)i3#2T07Mv%$6(q{Gnm0l$Y!&t z6fiSK%#1>z0K+gg<9C*2f{1s;5-9kGW4w0{nECC%IQsL2S}Yb7gBg}(fO)Hq8{4)K zMPp2-v%j4p0Epvw)Ah7!IF6H^fQUfE$Zb!eKR1`~8pjw61}PN~@G=?!L_5iu04JAA zub|s~1RDnKJDoMZ>$;ci_U+EtuTia5*B-lN9{}Ka-b1ZcivT=-%Si?iQ6fUic2Pu% slgY#u5fTw=X+;sqh{*ZrhdW+;0FC&7eq0c$4*&oF07*qoM6N<$f?~eMBme*a diff --git a/icon/qps.png b/icon/qps.png deleted file mode 100644 index e7c509b9b430f022e5e8168a75a843efad33d3e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 623 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDB3?!H8JlO)ISkfJR9T^xl_H+M9WCijSl0AZa z85pY67#JE_7#My5g&JNkFq8r{zDi(Vu$sZZAYL$MSD+10LMXr|#1%+`z<-9Sx~l*G z|IeE>?`z&08K4MbNswPKgTu2MX&_FLx4R2Vf5y!~Acwug)7O>#J_kFyzQQ`SN+zJR zucwP+h{fsBDGv(|EAY6@^?Sg7=6_ciW0!4*e(L{FtwzT~z6C<_zgBeoP?`4hZ3RO| zjc;;l1CRSB#@-4xZaL3olV_e^SX!x4v1+yE;|WaZJ#030PZ}p**dtPOd!p|o#RptR zIVBS&n>?`EAziDL=)Iot=W~`{T!q$NRjhZyHE%LpXXN&u&m-}F`;J^%_couP` zYt$z5c(gLJUOy(Xfng3u(dq}yy9(MiKMDHASK`g^UqeCizWd6ZmitZ@|5MPOY5a2%ITrA_G;*;i$j@p#?a+AMtsp?bOFZqt z=X~)UKX@GOm9JIdw&4zcdzNAM%4?iCJEA`Ftq3pM)3~i_cA)feiLb9$nDKp|8mQ7K z9h=SLDdc|roTtp!b-u?|EO(F1y7}eU1M?6Ab1M^bD`O)d+seRThr>G~6b-rgDVb@NxHX)V S4eJAHVDNPHb6Mw<&;$UmZQ+9e diff --git a/icon/rec.png b/icon/rec.png deleted file mode 100644 index 6ef3a55ae1d20fd95c8b724cdea19173b133afd1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 686 zcmV;f0#W^mP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXB1 z4lf5v843CT000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}0006BNkl$4hER7ILO)#bQ)L>ML8_>0~vCV zhM6#+aiZ=-7UhlP`(}Uz(;HPNYIg=0k4vKz^|_nOw$50&rG(x-l+UMh3(mNxt-JC6 za7vS4Q3L4q5V}>dsUi3}0N^JjnNMrd&@i+FtLmK?!y4zYVAC+`tZ|$-j<()M4eJ%% z{oZgW%aRRq$^Y3HOp`2=hNp&Q!*UGdK-BLOwBi|W1TO?H4IczQ2hlz%XvWOEGF))A zodu_}5%$EzFdi?5c^u$farH32B6u$N;$o)WFOyRHy3218)w_}Y`g;8nAOFnr8~s65 Uk2y6tTL1t607*qoM6N<$f+b`hH~;_u diff --git a/icon/superman.png b/icon/superman.png deleted file mode 100644 index 60609886c11ef1c3701737e305945c5247a62f08..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4497 zcmV;C5pM2@P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iOZ0 z3l|6_qd^-001**ML_t(&-tC%cbY0bT$AA0W`|g|cG+CBqW9A_kY``R8urZd6EZZ1R za16AeO*6G!NjjwoX~PO_7fplB5C|sIN{ClNnxPqhW&jF~0S^qtHXaykELol?UvZhbvkxZ9drfd~;20 zh+_m5PywTFZ$djVqY9uHfw4n~zH?=)T8f2)J@;du`PQt@+|+&409bzE)aj;c$LhIF z#dJC&h|$+d{Wh8^V2R!zncWR;#2_?sJses2Koy}bE? z(u>bLJg1>hmqPG|fiRld0uF)|5E-i>s0tzxP>LXcsz%q!#0sbg4vIw(6cwTJ8loCm znFxwjp2?`v(bH(`5lu`|AZgi@%RGAW=Wbnc-d}t&`;Gzl@%2j<99;XGpIh1;G`fMi?c85=cQRvC~ zoIGPPr(b*=lizzB<4t``S)Ap58rgqp~Gq)do#kHfYnD_ujtZic>CK zIQTmO_~A8+TKYDwe)zK5At!<2_d$D7*k<74-^!q*Sn;V|PK^oElOg_qQW{nWVOu86 z*8VaVeq;(4TsM{UxC}_F(w#_gF;O4&d=*325L8h@&;Ydo2ex&w?mO$*`kQv@Ydz*v z8It)TUJYcE4!_y0EIh@bt`Jh}x7hL_jRqSGGWSyic<$j?vsk{Vy^qVP6EXj($9^}lpVT$8Z8iXLPh=rY*B-`V0 z{_N|`)J`5ZM)4R@0RV9U7Zp?Sf~Mj~6wwF-B>-y?>jORzuxZ)^O}}v92mn^JwKNxA zdT!P1>H$&;em`_3U@P#EZ^WpoPV(JP4Kukcoa2W0{f3}y!GfQ1c{p(S%bzTudO|H2 z4^m7AfZoJb2S8UVdy3ZA~7jToDr! ztgl#G8Azk}A}Fg;!rpx_>qOzy95~fVIj(F>I?ALJ z$kZ!yJ^`ycm7OUFvqG#0=jC@yU-`*vA0OP^UJYRGyJk^y|EA|w&7_~S1wX6oO~Ph{ zk1vOsCfN6aWz(-hX4Qh9Q*5yk>qQYGBghb=JY>!%l;%&s6MK|hDX>EZw*>Fm z`{MNfzJBrj16}*ZIrAE7A3C?Uy`heXU<_u2rwYnPz6P}uBZu{?+muN~nB*&d5!4=< z&-I|HDb5S~1J0Ox3dX6dpm8Gw#X}^9iVMa?#Etv`E>dxf5tWhXDl&3cSy79qjVO;o zx-QOvZ9R1E%pxB2iO^@1K0~Do2OVL+f%88ooID-EPx&gUH&nvgH&=xgk!m zz^eOq(!DcF7y`y4=EV`mLyU`<7-B}Yfg4$daS(A(aX<_rQdtHCwWvf_sn8<92UV&k zCE34ofLvXITz#BeeT;m4jC`F#u3pI3!U-3^sqZzQ%J!$gbi>r75ayJ;h3;t={nJ(V zJ$SDG{KMk5$&;RY;@K7*oS5N&nqL5gjx2PWC(G}BDY!o0|a1svb`Z(3&lZ-p9hNjc2 zscm$DB4`n80kitP&X4(Cy(pqaM_ge~O!|JB@-1oQ7zVzYOM1j9+ z`@k8;Z+v{!TpgH{j)7AH>qR)>1Hzi`Djz^8+aq%z8FOP?a3VJlZErWyO-;12@)nXE z6-J4Sh(OGt5KoZ{m4R%DzMLUfmm+ggHD}M8z$q8j;F=;z9tn#mxe6#b9=RvSu7{MC z1_=6~Sc26Pr~G2~oGU(b+p=3rNAQ5Zzw(MxPI!LJZ)Y=jVloD9Ej*Kh-Gi_=t%Uwq z_Vxy;*7221KeK&%|FpRaR`zxsxN2fptTtsh zp;{O~s7?u{cu3DT?3Mg})K854?)9F%Ua#y7wO}hf^dT%NS1*vm!kbhIDWRPs1rPuWcJxj7GiCYe-uz2j)E`n7Zt$>Yu zuR2l{6RaNo4o5y4^X}nYN8YgzhEOVl9|&6-PkUi+%hgvbU3Sav-@7LGxwb3jHLZX0 z=jVmljOReC%CNBnUHz6YgmlKCx++eU8miPM8IO^OIT#C0Xfc5WKY%bq)gIagjtgE4 zbzDLt5jUtf3sI1YR;KKO?_aeVAn8(zC58H?FkVuMi9r~I1XY24V54W z&``1VkUtS~C=x_rRB#|89WpkgF)5@5e9A#sVT&WA3SOCT^7cLRubsd2)@7YX zwJaX_g!!{4ZeI7$Sz#_|#Nt&s>>Zcn%CF9(W?~J3hnfV6M^HAD@`7Jf{IbOl4ETnS zsOTxi#kdAH5yOkeFs@=;qB6PqXiz3774QoM3WLK89_Zu1<}NxncC&v|FK10o&^TD6 z97x3#Djf|czOrlKwR3K}?Y4bK{aj$AeSTr{`EFW^ zM8HeA^fslDh9m=92bkzWZ6bzKEMbcQfm*~E+(eRm%%RV>j9+vftv9q{Tp4p%U{Q@q zVrYn{PdT6G)t#@>zIGQcJ+=$F^PCn}%6&e5Xi;Ea-ElAOn19`6cYgINUB~QX=tvM+ zmo#jB`lqLrvmk<(a`BT6@j;(b7)E)Gyv_`jIA&_%m`l%O+LCkeivj*{iNaux;hrIe z59S%@%2IqaOVFDqQ3}bJfNJAV$`&byGI}o2RX3?~=e!SIa>w%J``(Ej?-&4p8x~!D z{e+EAt~fEs#Z(kW$K(ofMARPzKqcY?wkAO#Uq&2*>$=2Z4qnXQs^S&{f?|nM5N!_C zhzBrol%_&=UE?e5t=G)IbNM|xkNMf)8?}GFe8H8C8(075@nJ4An#AbnLXRzNj2>h# za>650G5yyHGJ29!8EEu`Nu)x2l-}ybt?di{r0w>*@9ub44oBat-PAgJM*Y?ek4+AT zk|PRRsl;;Ln7QfLqNpA+n!}m45y7IE%7JQ6U1NJk%eAeyf9;-*-&c0$XaMkJ`>s7R zE}r#F>ENp$t_jPi2nI;k$1znNaRd$Y2qZ?plFF8em~&Jli@AbV7bl+fkYY$sL8!N8 z{OJ**lIABYT7L1^{=@^~9a^{kW1UblOLrR5!uoPlP{v+TBu4hQ39MW|$c5dt? z*I8y-+F>|b0-&#I-0p32u9|ztcUH6?O?i(x001}6Z~0K;=5^nnWb=+uaMLc?<5FCG z*V&}&6H%E=%@_xHs1~^4f&D!Gl@6vR4a0*zR$#Dt+<|SEw#~i$-g{p@+Oj&w0)W-+ z9b3-5_>y+IyROPeU_xI>6$74M*U#y*tMC$0ekX(|enfnv%!UW{@%WvcOiLPu27N#n z$c%fnedhdmx2^czi^oFNV*&uc+K$dG(`Q`LPEU7RHNFV~NELiGJ~hDUm!^ru6~RX| z1S#|UFMC*d`yQsH3`2tfDlkx8*Y(Q9t#fX@??*2jD>;uD003(`I=7rNYj%(6>RMQB zePaV5nfKZB>=36nd$^tje6~E&%VW27F)ihg8w?Q<2GVs0Ixko_bJ-7n^vbc6@t6Vt zuy)7J_2>$$;Fq{nmA)Bu0*?z&iSxbNX zla6C8-!TUu0-@vC^Jce{W&fVJRfIyI#Bw3)SLfOMP@ZXVhg>#9f#Fn5cl-NW<}Uro z&$hiAvb`$+0DSBVUtGJhKYP$Quy1~qhK4{$lr7^8l!h%>HfC`^UmcDvEA5w(ePx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iOS( z3?3P=N66X$00Iz6L_t(I%e9kDXcJKsg}<3;{v}D69Z)^CT%q!r8HKv(4Z}D z?9PQC1>F@Fg4j)KmFPw{ZgeApo8m%SBP~Ti1YLBYLdeDxETN@QCX}@KnasG!=!gmd z@xtXjc<-KjIrkj+UlDCAO0E18O{b9-0JT_h0)jcSevdWl_gGE!Z9jlwnb}(O<;@1r z2kbU?(fu9?Ai8);aCN0ffy`L-%`}w(aUCLDTef zxsm|(1DY{{pzFv7&ZoCs48Zpf6P3gdHJR6SaO9+<K1^!pv$w6fOXAOU1DlH`JlIDK+AA9|y+06Q?^*-n;y^e}1|Oi~$`c z?tWg3h~(Els)C>uqG1_$quhV?bt4pzOKz71C^lDo@VCzW3o~l+@zr-g5Eus%=J%A% z5*oRCsStU6XGd__Mu9`WOkl6pwPL6HFc1QEfLCUK`D#7C(X+4JR;gK>gS}qBLsR4C q=xZu*4fyakpEdoG1GfIzwci04lcjiM*vpjw0000Px#24YJ`L;xfJBmgANML1Rf000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iOc9 z3MB}>g^Qv9000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000ZcNklXO*xwdondo=MjPsfnY(-wIF4_}Xsh36XLPFKf^-{<(W_{}nAnMw}Whon07Vcp}c z+yKrC$EM5+WNcpdjcaRVcsw@^rSIYx)2_c|`|7iEX`ZL>8oADA-)~k9MxDbk1(&$? zFvR6FCWq^~JnX^|ou8W{Gv&1p#}vlBAHF;w;swL2&lP2`=y*Oqy#w)_WdFs1IOFUx zLttzkP+PK*i2^w>@;N8=DY4h4#&yg+NN6dy;A@*Nha=|5W@aAa<+;?T15jeJ+~;jU z0MC=jvek4?*!vJYc5XTyVIR_WSTA_xHaNXPI9+H#VoX?$IATjhKGwwC5J*7rRe5H? z%RFHj))-bLBr0&@spWlPaC0-j16KBPU5vQbEzzf~YVK@~aA5QS%tkcE7ThEZ#pXH_ zpJOfQ7>PP%SQqmlKJwr^Jw=N177QbSM7a{h$AXvTq0+7Lecgx7I`OOthT-E><)mvv z4$Q6aNjCIZMiVnI906e%?DvcXlZ}IdVHEGh1I#=o1|Sx+UwhfqWiEPnla$798IuXF zak|}6c7S=~w2L!&xN8#UdX6_KmdziOl0FV90`n2DQlW+&JIgL{`-oaNcm~;Io=A6X zpG!F4z>zcJ@n4|mqD2qudKpBRP+2^e^hk%j`+U zf*FL=j>BUQ&LsPJaibHrYa=rZur~IDhI@(1mpIJ`d0xyNpnaS?;rhUAblRsg1%APu zHw>NJt#SA<0qbm`NfYe%!B5;XiGSz&=X!cw<=ntHF$e2xf=A^^2ie8VWuHco3t5>E z>=#mEH#hx(tlEnwdhx4|N4m4)i1Iv+^s1dGK6Oo(A_B;|kVfR0>Y3!@9ac{oX$J?l z^CTqJDfOhJfl103M$JJE{-OkFzZ7znJY--oCAZgLb!03fkB4SyV-tp>vPmX`Zxxq{ z^C{cu?w(G9LjxBnR|RjH0RtE|UgSIq}%=gK^IX)urjc3!~}>fAbUl1QyuiA45~^A>z? zGFVgTS2kOS6)!QQW!L(QH~E_+Oh5mnq#-x)S25&gFg*zzp8^<%meY2;-{cF2WwY&P zP3xW!f0{XDQ{NmRueb^FR1J0Jl^x)m07SSL)5LSLUsBMCcW)Z>?^N%4pQmW`9uwy@ z@EGr@cQx^S*=AY*Wkgpflc)F(rqks7`fm%tys2ermk@H8_^GNLMM+T+N{O%( zlTNEXuqR-Qy!FFrA-ZnUQR{BTE_1`25jdsz`jmf z2+odKg4Wa8@`8u4Rx{+x9x}p+Z4{H`+e^W z%9Eq`A%H3L2yrKmis<2`Qp!JTf2o*$hRQ{|%Cs2u?KdTX!2r7|SXI)5*~03GLxB_C z)yTD05fgeBE`0rw$*MV5=?ztvkL*Kr{XXEGZ8-5ug>R;Mc48^_X{4x_=d@&_tKy36rtcP)PPDZeFu#y*yNw_@0yQN%Cv?=Z+& zcgI51OH)@socQ+q1%Z_CwI#$U7n2;JMt6_Uy^BPknXUb-gkQwS-`GejQ~@U;#$zoD zxUvAP(+H1N#jV* z8Cj}&thD!$hk1{&6~hbn#4u7a?o_L*cCE9=X2zlsM|~7DR^}dS@(b9|#8%bgz45+6 zhrkVHMg8mO$i&`!y4lx*R3;V&S#;|Tp$e`3l|~>Qoj8rb8|!V9kWKn1_CFtm5;xrW z{vddvc)Ae8fKV3}+}CjMFXN6h-AWd#z%MClDuy$0RH5-Gx@5CSZnRdZ5T~|2m#(Ij zT^4I7Z`!|y?Ly{cMH7W74ns4H0$WQU;LF-<1MG_flcA~T_hAp3THsZk+~Qi4!GEY; zp5~-Bm3;8cn^L7ml1DS+**KsS53W^*Jp>-P7sX5cA zs_*-^4#7+xvv`9;eN>Hw%@y!)FdiK2B$51%)Q{S)IeHi*a>d@XXzAUDDSPm_7(F(Y z?vwjq-$<6KX&s^_;KA%Ad8HJF0wPw0@~%QA^rYiBImw=MHhJ)fAq!=ssVD~f@>?fx z*@}&)X!pTIsI_;&8h5FS^=8h>VZ%WkC^M<}X|KX|R`2+fWQz`2y|V=gtLc3x<6vR7eI3~uEz8KO!&*WFY;^E8hGu8c zE_*`NOiZyg%dcycp4mM{2_YkWJi3D!Ir`{ZJnAXb60;PPApMVS%{jD3A>gh_W^Y)v z(FrOz^&nO)s@jWZ>mBT<%9Wl`{7!g96_Dt>!pLCF=#4kuo7Q1+W3r|~NM#||OrL`N?WO8unar!nKwWpurzSnmMZowSn%?9u;Vw~AT;`?kF=cW78J6x;kcWMcc zHb-p-hg3|<{>S$m{2bFc%Hlm(ki~-^DCB(jX!7<-YqQtBF}~HUCS~*{U7P%*?5oyY zvuToU;HvPqnSELVjisqX4E?|j>rrBbG*gJaG48c@5$Rd=@qi20Drj2r>|Q=5V^a!# z5m0LO;gSWMO5~`(W`6?8AzM%IQRK_iQF)ACNhAAv2c--ayAB?)@+6}hGqmH_ME!$) za|a!svC4B7GOt~Q?HV2Wiydh40t@A^ohcm$l~+gesPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iOM? z6BrX5Mvz2Av zzVE#EM)1cZJLUmeM+ z@a*XW2i4G_qa*RW8Hwjj<<8A(z#!1?$gM&@Eu9o&vg^d)fOGbinoS^|xoQF=DwDh| zt24LIEsjs0JM8!E*IFy9P-pN)W?0?b0QBmU$yXm9Rc76PD&`az$E;FLN0>uOh!dog z&fo769ZmtNR4V1Q*11lnlXK$%Hcw7G9M@W_fl_I&#qP5tvBmThkc^Fu6Reh>OfZkTZ@Z}UsqOE7y`C* zj1a;L!|>;BDez*0F-8CczDGW%Xti2Pz$VZYsXZv!4HTz(bDw?XF?`|P#X_M_d~?4% zZ48WFd3wE8t39*we*haY)x0*a3Uq}KtoOF4*X!>*&r1?x$oU>&7{0cZBVgV3;xFq1 zjsU~JX}5{hYV{Uy+{TLO(W?wW5BLrg?05lax7#1>BigW)&Ho6Tq&6T&ug+c$f}r>* uirxZiR=!RX2>xv%)zo!cS=-a3fxiKcl*Y~(?DT&C0000 c #040404", -", c #060606", -"' c #0E0E0E", -") c #101810", -"! c #163C15", -"~ c #040E04", -"{ c #535653", -"] c #123711", -"^ c #4BEF47", -"/ c #1E5F1C", -"( c #040C04", -"_ c #020602", -": c #010101", -"< c #133C12", -"[ c #4EF94B", -"} c #133D12", -"| c #2E2E2E", -"1 c #030A03", -"2 c #10350F", -"3 c #43D840", -"4 c #0D2A0C", -"5 c #051105", -"6 c #010501", -"7 c #0B260B", -"8 c #44E444", -"9 c #123E12", -"0 c #000000", -"a c #343434", -"b c #48F548", -"c c #061606", -"d c #0C290C", -"e c #45E645", -"f c #051305", -"g c #0A0A0A", -"h c #323232", -"i c #313131", -"j c #4AFC4A", -"k c #091F09", -"l c #0C0C0C", -"m c #2D2D2D", -"n c #071907", -"o c #4AFA4A", -"p c #030D03", -"q c #363636", -"r c #061506", -"s c #4CFE4C", -"t c #051405", -"u c #3FD23F", -"v c #081D08", -"w c #383838", -"x c #103810", -"y c #46EB46", -"z c #144314", -"A c #164715", -"B c #4CFD4C", -"C c #010401", -"D c #0C280C", -"E c #4FFC4B", -"F c #164714", -"G c #4D4D4D", -"H c #113A11", -"I c #154514", -"J c #020402", -"K c #525252", -"L c #464646", -"M c #202020", -"N c #2A2A2A", -"O c #242424", -"P c #282828", -"Q c #272727", -"R c #515151", -" .+@#+$$#%& ", -"*=-;>,'')!~{", -"$]^/(_::<[}|", -"%1234567890a", -"%065bcdef0gh", -"i0065jbk60lh", -"m000noj7p6>q", -"h00rs6tuv56w", -"%0xyr065uz_w", -"%AB7000CDEFw", -"G;H000000IJK", -" LMNOPQQQ|R "}; diff --git a/icon/x2.xpm b/icon/x2.xpm deleted file mode 100644 index 73c2f8a..0000000 --- a/icon/x2.xpm +++ /dev/null @@ -1,49 +0,0 @@ -/* XPM */ -static const char * x2_xpm[] = { -"12 12 34 1", -" c None", -". c #565656", -"+ c #353535", -"@ c #3E3E3E", -"# c #373737", -"$ c #333333", -"% c #303030", -"& c #555555", -"* c #595959", -"= c #030303", -"- c #010101", -"; c #050505", -"> c #060606", -", c #0E0E0E", -"' c #000000", -") c #545454", -"! c #313131", -"~ c #383838", -"{ c #363636", -"] c #0C0C0C", -"^ c #323232", -"/ c #2D2D2D", -"( c #040404", -"_ c #4D4D4D", -": c #020202", -"< c #525252", -"[ c #464646", -"} c #202020", -"| c #2A2A2A", -"1 c #242424", -"2 c #282828", -"3 c #272727", -"4 c #2E2E2E", -"5 c #515151", -" .+@#$%%#+& ", -"*=-=;>,,,>')", -"!---------'~", -"{'''''''''-#", -"+''''''''']^", -"!''''''''']^", -"/'''''''''({", -"^''''''''''~", -"+'''''''''-~", -"+'''''''''-~", -"_:'''''''':<", -" [}|1233345 "}; diff --git a/qps.1 b/qps.1 deleted file mode 100644 index 4e87253..0000000 --- a/qps.1 +++ /dev/null @@ -1,317 +0,0 @@ -.\" -*-nroff-*- -.TH QPS 1 "Sept 30 1999" -.UC 4 -.SH NAME -qps \- Visual Process Manager -.SH SYNOPSIS -.B qps -[ -.I options -] -.SH DESCRIPTION -.PP -.B qps -is a monitor that displays the status of the processes currently in existence, -much like top(1) or ps(1). -The user interface uses the Qt toolkit, and most operations should be -fairly intuitive. -.PP -The process list is sorted by the highlighted field. Click on another -title to change; click again to reverse the sorting order. Rearrange the -columns by dragging the titles. -.PP -Left-clicking on a process selects or deselects it. Shift-click to select -multiple processes. The PIDs of selected processes can be pasted into other -applications (this option can be disabled). -.PP -The right mouse button pops up a context menu, which duplicates some -functions from the main menu for convenience. It works both on processes and -on the column headings. -.PP -Control-clicking in the process table selects all processes with the same -displayed value in the particular column clicked in. For instance, to select -all processes owned by "joshua", keep Control pressed while clicking on -"joshua". Shift and Control together produces the expected result. -.PP -In Tree mode, the parent-child relations between processes is shown in a -more obvious way. Click on the triangles to show or hide an entire subtree. -Sorting only affects siblings; the tree structure imposes the global order. -.PP -To change the time-sharing priority of the selected processes, type the new -priority in the -.I Renice... -dialog. The new nice value should be in the range -20 to 20; 0 is the -default. A larger number means that the process gets less CPU time. -Only the super-user may decrease the nice value. -.PP -The -.I Change Scheduling... -dialog allows the super-user to change the scheduling policy of the -selected processes (using Posix.1b scheduling control). -Normal processes are set to SCHED_OTHER and have static priority 0; -(soft) real-time processes have the policy SCHED_FIFO or SCHED_RR and -a static priority in the range of 1 to 99. (See -sched_setscheduler(2).) Solaris has additional scheduling policies, -but right now qps doesn't allow setting these. -.PP -By default, the process display updates every 5 seconds. To change, type the -new update period in the -.I Update Period... -dialog. The units min, s and ms may be used (if none, seconds are -assumed). You can force an update by pressing the space bar or -clicking the -.I Update -button. qps will consume a lot of CPU time if the update period is -short or zero. If iconified, however, qps will use very little CPU. -.PP -The USER field shows the real user ID. If the effective user ID of a -process is different from its real user ID, a plus sign (+) is appended to -the user name; if it is the super-user, an asterisk (*) is appended. -.PP -The load, CPU, memory and swap displays in the status bar can be -toggled between graphic and text representations by clicking on them, -or by settings in the -.I Preferences... -dialog. The load numbers shown are the number of jobs in the run queue -averaged over 1, 5 and 15 minutes. -.PP -The swap bar will turn red if free swap space falls below a certain value, -which can be changed in the -.I Preferences... -dialog. The number can be entered in K, M (megabytes) or % (percent of total -swap space). The default is 10%. -.PP -On SMP (multi-CPU) machines running Solaris 2.6 or Linux 2.1.x or -later, the CPU stats will be shown for each processor in vertical -mode, and the average of all CPUs in horizontal mode. -.PP -For displaying the WCHAN field as symbols, the kernel symbol file -System.map is needed. qps will search for it in the following -locations: -.PP -.nf - /boot/System.map-\c -.I RELEASE - /boot/System.map - /lib/modules/\c -.I RELEASE\c -/System.map - /usr/src/linux-\c -.I RELEASE\c -/System.map - /usr/src/linux/System.map - /usr/local/src/linux-\c -.I RELEASE\c -/System.map - /usr/local/src/linux/System.map -.fi -.PP -where -.I RELEASE -is the kernel release number, for instance "2.0.29". If the -System.map file isn't found or unreadable, hexadecimal addresses will be -displayed instead. The prefixes "sys_" and "do_" are stripped from the -symbols before they are displayed. -Under Solaris, symbolic names are currently not supported and hexadecimal -addresses will always be shown. -.PP -The -.I View Details -menu item opens a window that shows different aspects of the selected -processes. Double-clicking on a process has the same effect. All -information is only available to the owner of the process (and to the -super-user). -.PP -The -.I Sockets -table (Linux only) shows the currently used TCP and UDP sockets. If -.I Host Name Lookup -is checked in the -.I Preferences -dialog, a host name lookup will be done for each IP address. This is -done by a background process but can take a while for difficult cases -(but once looked up, addresses are cached). -.PP -The -.I Memory Maps -table shows the process's memory mappings. In Linux 2.0.x and Solaris, -the file names are not given. Anonymous mappings (allocated memory not -bound to a file or device) are marked (anonymous). -.PP -The -.I Files -table shows the process's open files. In Linux 2.0.x, the files -are given on the form [\c -.I AABB\c -]:\c -.I inode, -where -.I AA -and -.I BB -are the device major/minor numbers in hexadecimal. -.PP -The -.I Environment -table shows the process's environment variables. Note that this is the -environment with which the process was started, not necessarily -incorporating later changes. Some processes that modify their command -line, notably sendmail(8) and ftpd(8), may use the environment space -for this, showing nonsense in this table. Clicking on the field -headings changes sorting order as usual. (On Solaris, only the first -8K of the environment are shown. It will be fixed if it turns out to -be a limitation.) -.PP -.I Find Parent -and -.I Find Children -will select the parent/children of the selected processes, and center the -table on the first of them. -.I Find Descendants -will select the tree of all children of the selected processes. -.PP -If -.I Include Child Times -is selected in the -.I Options -menu, the TIME field will show the sum of the CPU times used by the process -and all of its children. -.PP -You can specify commands to be run on the selected processes by bringing -up the -.I Edit Commands... -dialog. The "Description" of each command is what appears in the menu; -the "Command Line" is a shell command (executed with /bin/sh). Before the -command is passed to the shell, the following substitutions are made: -.TP -.B %p -with the PID (Process ID) of the selected process -.TP -.B %c -with the short command name of the process -.TP -.B %C -with the complete command line of the process -.TP -.B %u -with the name of the (real) owner of the process -.TP -.B %% -with a literal '%'. -.PP -Any other % + letter combination is removed. The command line will be run -once for each selected process (in unspecified order). -.PP -.SH KEYBOARD ACCELERATORS -(valid in most contexts) -.TP -.B "Meta-W" -Close the active window (except the main window) -.TP -.B "Q, Meta-Q" -Quit qps. -.TP -.B "Space" -Force an update of the displayed tables. -.TP -.B "Control-Z" -Iconify qps. -.SH OPTIONS -.TP -.RI \-display \ display -sets the X display (default is $DISPLAY) -.TP -.RI \-geometry \ geometry -sets the geometry of the main window of qps -.TP -.RI \-background \ color -sets the default background color and an application palette (light and dark -shades are calculated). This doesn't work very well at the moment. -.TP -.RI \-foreground \ color -sets the default foreground color. This has limited use as well. -.TP -.RI \-title \ title -sets the application title (caption). -.TP -.RI \-style \ style -sets the application GUI style. Possible styles are -.I motif -and -.I windows. -(If you are using Qt 2.x, the styles -.I cde -and -.I platinum -are also available.) -.TP -.RI \-font \ font -sets the application font -.TP -.RI \-iconic -starts the application iconified. -.TP -.RI \-version -prints the version of qps and the Qt library, and exits. -.TP -.RI \-help -prints a summary of command-line options and exits. -.PP -.SH ENVIRONMENT -QPS_COLORS contains color specifications of comma-separated -.I name\c -:\c -.I value -pairs, where -.I name -is one of the following: -.PP -cpu-user, cpu-nice (Linux), cpu-sys, cpu-wait (Solaris), cpu-idle, -mem-used, mem-buff, mem-cache, mem-free, -swap-used, swap-free, swap-warn, -load-bg, load-fg, load-lines, -selection-bg, selection-fg -.PP -.I value -is an X11 color name, either a symbolic name like "salmon" or an RGB color -like #c5b769. -.PP -.SH FILES -.br -.DT -.ta \w'$HOME/.qps-settings\ \ \ 'u -/proc kernel information pseudo-filesystem -.br -$HOME/.qps-settings saved settings between invocations -.br -/etc/services port number to service name mapping (Linux) -.br -System.map kernel symbol map for WCHAN (Linux) -.br -.SH SEE ALSO -ps(1), top(1), kill(1), free(1), renice(8), proc(5), sched_setscheduler(2) -.SH AUTHOR -.PP -Mattias Engdegard (f91-men@nada.kth.se) -.SH LICENSE -qps is free software and may be redistributed under certain -conditions. See the GNU General Public License for details. -.PP -.SH BUGS -qps is too big and too slow. - -The %CPU number isn't accurate at very short update intervals due to -timer granularity. - -The %WCPU field isn't recalculated when qps is iconified, so it might take -a while to readjust when the window is deiconified again. - -The WCHAN field doesn't show a function name if a process sleeps in a -location outside those in System.map (for instance, in a kernel -module), but a hex address instead. The function name can then be -found in /proc/ksyms but has to be found by hand right now. - -The CPU indicator in the status bar will display nonsense in SMP systems -running Linux 2.0.x due to a kernel bug. - -Adding/removing CPUs at runtime will probably confuse qps. diff --git a/qps.desktop.in b/qps.desktop.in deleted file mode 100644 index 8398900..0000000 --- a/qps.desktop.in +++ /dev/null @@ -1,21 +0,0 @@ -[Desktop Entry] -Type=Application -Name=qps -GenericName=Qt process manager -GenericName[ca]=Gestor de processos Qt -GenericName[da]=Qt-proceshåndtering -GenericName[lt]=Qt procesų tvarkytuvė -GenericName[pl]=Menedżer procesów Qt -Comment=Qt application to display and manage running processes -Comment[ca]=Aplicació Qt per visualitzar i gestionar els processos en execució -Comment[da]=Qt-program til at vise og håndtere kørende processer -Comment[lt]=Qt programa, skirta rodyti ir tvarkyti vykdomus procesus -Comment[pl]=Aplikacja Qt do wyświetlania i zarządzania uruchomionymi procesami -Icon=qps -Categories=System; -TryExec=qps -Exec=qps -Terminal=false -StartupNotify=false - -#TRANSLATIONS_DIR=src/translations diff --git a/qps.qrc b/qps.qrc deleted file mode 100644 index 01c161c..0000000 --- a/qps.qrc +++ /dev/null @@ -1,10 +0,0 @@ - - - icon/letters.png - icon/vista.png - icon/vpointer.png - icon/vcross.png - icon/pause.png - icon/superman.png - - diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index f7b8d15..0000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,111 +0,0 @@ -set(SOURCES - proc.cpp - qpsapp.cpp - qps.cpp - screenshot.cpp - pstable.cpp - uidstr.cpp - ttystr.cpp - dialogs.cpp - infobar.cpp - fieldsel.cpp - wchan.cpp - prefs.cpp - lookup.cpp - details.cpp - command.cpp - commandutils.cpp - commandmodel.cpp - commanddialog.cpp - checkboxdelegate.cpp - execwindow.cpp - watchcond.cpp - listmodel.cpp - watchdogdialog.cpp - misc.cpp - trayicon.cpp - htable.cpp - # htable2.cpp - # pstable2.cpp - qttableview.cpp -) - -SET(HEADERS - qpsapp.h - qps.h - screenshot.h - pstable.h - dialogs.h - fieldsel.h - prefs.h - infobar.h - lookup.h - details.h - tablefield.h - command.h - commandutils.h - commandmodel.h - commanddialog.h - checkboxdelegate.h - execwindow.h - watchcond.h - listmodel.h - watchdogdialog.h - misc.h - trayicon.h - htable.h - # htable2.h - # pstable2.h - qttableview.h -) - -set(UIS - watchdog.ui - message.ui -) - -set(RESOURCES "../qps.qrc") -#----------------------------------------------------------------------------- -# Translations -#----------------------------------------------------------------------------- -lxqt_translate_ts(QM_FILES - UPDATE_TRANSLATIONS ${UPDATE_TRANSLATIONS} - SOURCES ${SOURCES} ${HEADERS} ${UIS} - INSTALL_DIR "${QPS_TRANSLATIONS_DIR}" -) - -qt5_translation_loader( - QM_LOADER - "${QPS_TRANSLATIONS_DIR}" - ${PROJECT_NAME} -) - -lxqt_translate_desktop(DESKTOP_FILES - SOURCES "${CMAKE_SOURCE_DIR}/qps.desktop.in" -) -#----------------------------------------------------------------------------- -# End of translations -#----------------------------------------------------------------------------- - - -add_executable(${PROJECT_NAME} - ${SOURCES} - ${HEADERS} - ${UIS} - ${QM_FILES} - ${QM_LOADER} - ${DESKTOP_FILES} - ${RESOURCES} -) - -target_link_libraries(${PROJECT_NAME} - Qt5::Widgets - Qt5::X11Extras - Qt5::DBus -) - -install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) -install(FILES - ${DESKTOP_FILES} - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications" -) diff --git a/src/checkboxdelegate.cpp b/src/checkboxdelegate.cpp deleted file mode 100644 index 3258fad..0000000 --- a/src/checkboxdelegate.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - * checkboxdelegate.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include "checkboxdelegate.h" -#include - -checkBoxDelegate::checkBoxDelegate(QObject *parent) : QItemDelegate(parent) {} -//! [0] - -//! [1] -QWidget *checkBoxDelegate::createEditor(QWidget *parent, - const QStyleOptionViewItem &option, - const QModelIndex &index) const -{ - printf("createEditor\n"); - // return 0; - if (index.column() == 1) - { - QSpinBox *editor = new QSpinBox(parent); - editor->setMinimum(0); - editor->setMaximum(100); - return editor; - } - return QItemDelegate::createEditor(parent, option, index); - return 0; -} -//! [1] - -//! [2] -void checkBoxDelegate::setEditorData(QWidget *editor, - const QModelIndex &index) const -{ - printf("setEditorData\n"); - return; - // if(index - if (index.column() == 1) - { - int value = index.model()->data(index, Qt::EditRole).toInt(); - // int value=0; - QSpinBox *spinBox = static_cast(editor); - spinBox->setValue(value); - } -} -//! [2] - -//! [3] -void checkBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, - const QModelIndex &index) const -{ - printf("setModelData\n"); - return; - if (index.column() == 1) - { - QSpinBox *spinBox = static_cast(editor); - spinBox->interpretText(); - int value = spinBox->value(); - model->setData(index, value, Qt::EditRole); - } -} -//! [3] - -//! [4] -void checkBoxDelegate::updateEditorGeometry(QWidget *editor, - const QStyleOptionViewItem &option, - const QModelIndex &index) const -{ - printf("updateEditorGeometry\n"); - // if(index.column()==1) - editor->setGeometry(option.rect); -} -//! [4] - -void checkBoxDelegate::paint(QPainter *painter, - const QStyleOptionViewItem &option, - const QModelIndex &index) const -{ - printf("paint\n"); - if (index.column() == 1) - { - QVariant value = 0; // index.model()->data(index, Qt::UserRole); - /* if (!isSupportedType(value.type())) { - QStyleOptionViewItem myOption = option; - myOption.state &= ~QStyle::State_Enabled; - QItemDelegate::paint(painter, myOption, index); - return; - } */ - } - QItemDelegate::paint(painter, option, index); -} -// QSize QAbstractItemDelegate::sizeHint ( const QStyleOptionViewItem & option, -// const QModelIndex & index ) const [pure virtual] diff --git a/src/checkboxdelegate.h b/src/checkboxdelegate.h deleted file mode 100644 index 6989c21..0000000 --- a/src/checkboxdelegate.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * checkboxdelegate.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef CHECKBOXDELEGATE_H -#define CHECKBOXDELEGATE_H - -#include -class checkBoxDelegate : public QItemDelegate -// class checkBoxDelegate : public QAbstractItemDelegate -{ - Q_OBJECT - public: - checkBoxDelegate(QObject *parent = 0); - QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const; - void setEditorData(QWidget *editor, const QModelIndex &index) const; - void setModelData(QWidget *editor, QAbstractItemModel *model, - const QModelIndex &index) const; - void updateEditorGeometry(QWidget *editor, - const QStyleOptionViewItem &option, - const QModelIndex &index) const; - - void paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const; -}; - -#endif // CHECKBOXDELEGATE_H diff --git a/src/command.cpp b/src/command.cpp deleted file mode 100644 index ca418e0..0000000 --- a/src/command.cpp +++ /dev/null @@ -1,309 +0,0 @@ -/* - * command.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include -#include -#include - -#include - -#include "command.h" -#include "commandutils.h" -#include "checkboxdelegate.h" -#include "watchcond.h" -#include "execwindow.h" -#include "listmodel.h" -#include "watchdogdialog.h" -#include "qps.h" -#include "proc.h" -#include "uidstr.h" -#include "dialogs.h" - -extern Qps *qps; -extern ControlBar *controlbar; -extern QList commands; - -Command::Command(QString n, QString cmd, bool flag) -{ - // printf("Command init\n"); - name = n; - cmdline = cmd; - toolbar = false; - popup = false; - - // toolbutton=new CommandButton(controlbar,name); - // toolbutton->hide(); - - ////toolbutton->setTextLabel (name) ; - ////toolbutton->setUsesTextLabel ( true ); - /// toolbutton->setAutoRaise(true); - // QObject::connect(toolbutton, SIGNAL(clicked()),toolbutton, - // SLOT(exec_command())); -} - -Command::~Command() -{ - // toolbutton->hide(); - // delete toolbutton; -} - -QString Command::getString() -{ - QString str; - str.append(name); - str.append(","); - str.append(cmdline); - return str; -} - -void Command::putString(QString str) -{ - int idx = str.indexOf(","); - // idx=str.indexOf(",",idx); - name = str.mid(0, idx); - cmdline = str.mid(idx + 1, str.size()); -} - -// dirty code... -// Description : this command need "select process" -bool Command::IsNeedProc() -{ - int i, len; - len = cmdline.length(); - - for (i = 0; i < len;) - { - int v = cmdline.indexOf('%', i); - if (v < 0) - break; - if (++v >= len) - break; - - char c = cmdline[v].cell(); //.toLatin1().data(); - switch (c) - { - case 'p': - case 'c': - case 'C': - case 'u': - if (cmdline.indexOf("update", v) == v) - { - v += 5; - break; - } - // printf("true\n"); - return true; - default: - ; - } - i = v + 1; - } - return false; -} - -QString substString(QString str, Procinfo *p) -{ - QString s; - int len = str.length(); - for (int i = 0;;) - { - int v = str.indexOf('%', i); - if (v < 0) - { - s.append(str.right(len - i)); - break; - } - else - { - s.append(str.mid(i, v - i)); - if (++v >= len) - break; - QString subst; - // need change to LOCALE(by fasthyun@magicn.com) - char c = str[v].cell(); - switch (c) - { - case 'p': - subst.setNum(p->pid); - break; - case 'c': - subst = p->command; - break; - case 'C': - subst = p->cmdline; - break; - case 'u': - subst = Uidstr::userName(p->uid); - break; - case '%': - subst = "%"; - break; - } - s.append(subst); - i = v + 1; - } - } - return s; -} - -// execute command -void Command::call(Procinfo *p) -{ - QString s; - QString msg; - - printf("called !\n"); - int len = cmdline.length(); - - if (p == NULL) - { - if (cmdline == "%update") - { - qps->refresh(); - return; - } - - s = cmdline; - } - else - s = substString(cmdline, p); - - int ret = system(s.toLatin1().data()); /// - /* - pr=new QProcess; // leak? - if(!wc->command.isEmpty()) //conflict pid's command - { - pr->start(wc->command); // thread run, if - null then - segfault occurs. ? - } - - connect(pr, SIGNAL(started()), this, SLOT(cmd_started())); - connect(pr, SIGNAL(finished ( int , QProcess::ExitStatus - )),this,SLOT(cmd_finished ( int , QProcess::ExitStatus ))); - connect(pr, SIGNAL(error ( QProcess::ProcessError )),this, - SLOT(cmd_error(QProcess::ProcessError))); - */ - - if (ret) - { - msg = tr( "The command:\n\n" ); - msg.append(s); - if (ret == -1) - { - msg.append( tr( "\n\nfailed with the error:\n\n" ) ); - const char *e = static_cast< const char * >( 0 ); - msg.append( ( errno == EAGAIN ) - ? tr( "Too many processes" ) - : ( ( e = strerror( errno ) ) ) - ? QString::fromLocal8Bit( e ) - : tr( "Unknown error" ) ); - } - else if (ret & 0xff) - { - msg.append("\n\nwas terminated by signal "); - msg.append(QString().setNum(ret & 0xff)); - msg.append("."); - } - else if (ret == 0x7f00) - { - msg.append( tr( "\n\ncould not be executed because it was not " - "found,\nor you did not have execute permission." ) ); - } - else - { - msg.append( tr( "\n\nexited with status " ) ); - msg.append(QString().setNum(ret >> 8)); - msg.append("."); - } - QMessageBox::warning(0, tr( "Command Failed" ), msg); - } -} - -//---------------------------------------------------------------- -QList watchlist; - -extern WatchdogDialog *watchdogDialog; - -// except threads, already running process -void watchdog_check_if_start(QString cmd, Procinfo *pi) -{ - /// printf("cmd=%s\n", cmd.toLatin1().data()); - for (int i = 0; i < watchlist.size(); ++i) - { - watchCond *wc = watchlist.at(i); - if (wc->enable == false) - continue; - if (wc->cond == WATCH_PROCESS_START) - if (wc->procname == cmd) - { - // printf("Watchdog: start\n"); - if (!pi->isThread()) - // ExecWindow *mw=new - // ExecWindow(wc->message,wc->command,pi->pid,pi->command); - // // leak - ExecWindow *mw = - new ExecWindow(wc, pi->pid, pi->command); // leak - - // note : - // 1.system("./loop"); //block !! - // 2.pr.setEnvironment(QProcess::systemEnvironment - //()); - } - } -} - -void watchdog_check_if_finish(QString cmd, Procinfo *pi) -{ - for (int i = 0; i < watchlist.size(); ++i) - { - watchCond *w = watchlist.at(i); - if (w->enable == false) - continue; - if (w->cond == WATCH_PROCESS_FINISH) - { - if (w->procname == cmd) - { - // printf("Watchdog: finish\n"); - if (!pi->isThread()) - // if(pi->pid==pi->tgid) // not a thread - // ! - ExecWindow *mw = - new ExecWindow(w, pi->pid, pi->command); // leak - // ExecWindow *mw=new - // ExecWindow(w->message,w->command,pi->pid,pi->command); - } - } - } -} - -// NOTYET -void watchdog_syscpu(int cpu) -{ - // printf("Watchdog: watchdog_syscpu\n"); - // if(watchdogDialog->flag_ifsyscpu) - { - // if(cpu> watchdogDialog->syscpu_over) - // printf("Watchdog: event %d%\n",cpu); - // QMessageBox::warning(0, "Watchdog", "aaaaa"); //blocking - } -} diff --git a/src/command.h b/src/command.h deleted file mode 100644 index 88653ea..0000000 --- a/src/command.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * command.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef COMMAND_H -#define COMMAND_H - -#ifndef USING_PCH -#include -#include -#include -#include -#include -#include -#endif - -#include "proc.h" -#include "misc.h" - -class ListModel; - -class Command -{ - Q_DECLARE_TR_FUNCTIONS(Command) - public: - Command(){}; - Command(QString n, QString cmd, bool toolbar = false); - ~Command(); - void call(Procinfo *p); - bool IsNeedProc(); - QString getString(); - void putString(QString str); - - // CommandButton *toolbutton; - - QString name; // appears in the menu - QString cmdline; // may contain variables (%p etc) - int menu; // index in menu - bool toolbar; - bool popup; -}; - -#endif // COMMAND_H diff --git a/src/commanddialog.cpp b/src/commanddialog.cpp deleted file mode 100644 index e221f85..0000000 --- a/src/commanddialog.cpp +++ /dev/null @@ -1,273 +0,0 @@ -/* - * commanddialog.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include "commanddialog.h" - -#include "qps.h" -#include "command.h" -#include "commandutils.h" -#include "commandmodel.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -extern QList commands; - -CommandDialog::CommandDialog() -{ - setWindowTitle( tr( "Edit Commands 0.1 alpha" ) ); - // setWindowFlags(Qt::WindowStaysOnTopHint); - - QHBoxLayout *hbox = new QHBoxLayout(this); // TOP - CommandModel *cmdModel = new CommandModel(this); - // item list - listview = new QListView(this); - listview->setModel(cmdModel); - listview->setFixedWidth(fontMetrics().width("0") * 16); - hbox->addWidget(listview); - - QVBoxLayout *vbox = new QVBoxLayout; // TOP-> RIGHT - hbox->addLayout(vbox); - - QHBoxLayout *h1 = new QHBoxLayout; - vbox->addLayout(h1); - QLabel *l1 = new QLabel( tr( "Name:" ), this); - h1->addWidget(l1); - name = new QLineEdit(this); - name->setMinimumWidth(170); - name->setText(""); - h1->addWidget(name); - - QHBoxLayout *hbox2 = new QHBoxLayout; - vbox->addLayout(hbox2); - // qcheck1 = new QCheckBox (this); - // qcheck1->setText("Toolbar"); - // qcheck1->setEnabled(false); - // hbox2->addWidget(qcheck1); - if (0) - { - qcheck2 = new QCheckBox(this); - qcheck2->setText( tr( "Popup" ) ); - qcheck2->setEnabled(false); - hbox2->addWidget(qcheck2); - } - - QLabel *l2 = new QLabel( tr( "Command Line:" ), this); - l2->setFixedHeight(l2->sizeHint().height()); - l2->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); - vbox->addWidget(l2); - - cmdline = new QLineEdit(this); - cmdline->setFixedHeight(cmdline->sizeHint().height()); - cmdline->setMinimumWidth(250); - cmdline->setText(""); - vbox->addWidget(cmdline); - - QLabel *l3 = new QLabel( tr( "Substitutions:\n" - "%p\tPID\n" - "%c\tCOMMAND\n%C\tCMDLINE\n%u\tUSER\n" - "%%\t%\n" - "\n" ), - this); - - l3->setFrameStyle(QFrame::Panel); - l3->setFrameShadow(QFrame::Sunken); - l3->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); // | Qt::ExpandTabs); - vbox->addWidget(l3); - - QHBoxLayout *hl = new QHBoxLayout; - vbox->addLayout(hl); - new0 = new QPushButton( tr( "New..." ), this); - hl->addWidget(new0); - add = new QPushButton( tr( "Add..." ), this); - hl->addWidget(add); - del = new QPushButton( tr( "Delete" ), this); - hl->addWidget(del); - button_ok = new QPushButton( tr( "Close" ), this); - hl->addWidget(button_ok); - - connect(listview, SIGNAL(clicked(const QModelIndex &)), - SLOT(set_select(const QModelIndex &))); - connect(new0, SIGNAL(clicked()), SLOT(new_cmd())); - connect(add, SIGNAL(clicked()), SLOT(add_new())); - connect(del, SIGNAL(clicked()), SLOT(del_current())); - connect(button_ok, SIGNAL(clicked()), SLOT(close())); - connect(name, SIGNAL(textChanged(const QString &)), - SLOT(event_name_midified(const QString &))); - connect(cmdline, SIGNAL(textChanged(const QString &)), - SLOT(event_cmd_modified())); - // connect(qcheck1, SIGNAL(toggled ( bool ) ), - // SLOT(event_toolbar_checked(bool - // ))); - - TBloon *bloon = new TBloon(this); - /// for(int i = 0; i < commands.size(); i++) - /// listview->insertItem(commands[i]->name); - /// listview->addItem(commands[i]->name); - /// vbox->freeze(); -} - -// DEL -void CommandDialog::event_toolbar_checked(bool on) -{ - // name->text(); - int idx = find_command(name->text()); - if (idx >= 0) - commands[idx]->toolbar = on; - - /// controlbar->update_bar(); -} - -void CommandDialog::event_name_midified(const QString &new_name) -{ - int idx; - FUNC_START; - // printf("debug:changed_description() start \n"); - idx = find_command(new_name); - if (idx == -1) - { - add->setEnabled(1); - } - else - add->setEnabled(0); - - // printf("debug:changed_description() end \n"); -} - -// if modified then call this function -void CommandDialog::event_cmd_modified() -{ - int idx; - // if(name->text()=="") return; - if (find_command(name->text()) < 0) - return; - - idx = find_command(name->text()); - - commands[idx]->name = name->text(); - commands[idx]->cmdline = cmdline->text(); - emit command_change(); -} - -// set the description,cmdline from current selected QListBox item -void CommandDialog::set_buttons(int index) -{ - if (index < 0) - { - new_cmd(); - return; - } - /* - //bool sel = (lb->currentRow() >= 0); - Command *c ; - if(sel) - //c = commands[find_command(lb->currentText())]; - c = commands[find_command(lb->currentText())]; - else - c = commands[find_command(lb->text(index))]; - name->setText(c->name); - cmdline->setText(c->cmdline); - del->setEnabled(sel); - */ -} - -// called when clicked ! -void CommandDialog::set_select(const QModelIndex &index) -{ - Command *c = - static_cast(index.internalPointer()); // never Null ? - /* - if (item==NULL) return; // important - Command *c = commands[find_command(item->text())]; - */ - name->setText(c->name); - cmdline->setText(c->cmdline); - // DEL qcheck1->setChecked(c->toolbar); - // qcheck2->setChecked(c->popup); - - // bool sel = (listview->currentItem() >= 0); - if (c->name == "Update") - del->setEnabled(false); - else - del->setEnabled(true); -} - -void CommandDialog::reset() -{ - listview->reset(); - name->setText(""); - cmdline->setText(""); - add->setText( tr( "Add..." ) ); - add->setEnabled(0); - button_ok->setEnabled(1); - listview->clearSelection(); -} - -void CommandDialog::new_cmd() -{ - reset(); - add->setEnabled(1); - name->setFocus(); -} - -void CommandDialog::add_new() -{ - if (name->text() == "") - return; - - // commands.add(new Command(name->text(), - // cmdline->text(),qcheck1->isChecked - // () )); - commands.append(new Command(name->text(), cmdline->text(), false)); - check_commandAll(); // TEMP - - listview->reset(); - add->setEnabled(0); - del->setEnabled(0); - button_ok->setEnabled(1); - - emit command_change(); // notice to refresh Qps::make_command_menu() - // control_bar->update_bar(); // ** important -} - -void CommandDialog::del_current() -{ - int idx = find_command(name->text()); - if (idx >= 0) - { - // printf("del\n"); - commands.removeAt(idx); - listview->reset(); // listview->reset(); - // control_bar->update_bar(); - emit command_change(); // notice to refresh menu_commands - } -} diff --git a/src/commanddialog.h b/src/commanddialog.h deleted file mode 100644 index 0e460b1..0000000 --- a/src/commanddialog.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * commanddialog.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef COMMANDDIALOG_H -#define COMMANDDIALOG_H - -#include - -class QListView; -class QPushButton; -class QLineEdit; -class QCheckBox; -class QModelIndex; - -// class CommandDialog : public QWidget -class CommandDialog : public QDialog -{ - Q_OBJECT - public: - CommandDialog(); - -signals: - void command_change(); - - protected slots: - void new_cmd(); - void add_new(); - void del_current(); - void set_buttons(int); - void reset(); - void set_select(const QModelIndex &); - void event_name_midified(const QString &new_name); - void event_cmd_modified(); - void event_toolbar_checked(bool); - - private: - QListView *listview; - QPushButton *new0, *add, *del, *edit, *button_ok; - QLineEdit *name, *cmdline; - QCheckBox *qcheck1; - QCheckBox *qcheck2; -}; - -#endif // COMMANDDIALOG_H diff --git a/src/commandmodel.cpp b/src/commandmodel.cpp deleted file mode 100644 index e055a72..0000000 --- a/src/commandmodel.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * commandmodel.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include "commandmodel.h" -#include "command.h" - -extern QList commands; - -CommandModel::CommandModel(QObject *parent) {} -CommandModel::~CommandModel() {} - -QModelIndex CommandModel::index(int row, int column, - const QModelIndex &parent) const -{ - if (row >= 0 and column >= 0 and row < commands.size() and column < 1) - { - Command *cmd = commands[row]; - return createIndex(row, column, cmd); - } - else - return QModelIndex(); -} -QModelIndex CommandModel::parent(const QModelIndex &child) const -{ - return QModelIndex(); -} -int CommandModel::rowCount(const QModelIndex &parent) const -{ - return commands.size(); -} -// int CommandModel::columnCount(const QModelIndex &parent) const{return 1;}; -QVariant CommandModel::data(const QModelIndex &index, int role) const -{ - if (role == Qt::DisplayRole) - { - Command *cmd = static_cast(index.internalPointer()); - return cmd->name; - } - if (role == Qt::DecorationRole) - { - } - return QVariant(); -} -void CommandModel::update() {} // TEMP diff --git a/src/commandmodel.h b/src/commandmodel.h deleted file mode 100644 index db1c728..0000000 --- a/src/commandmodel.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * commandmodel.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include - -class CommandModel : public QAbstractItemModel -{ - Q_OBJECT - public: - CommandModel(QObject *parent = 0); - ~CommandModel(); - QModelIndex index(int row, int column, const QModelIndex &parent) const; - QModelIndex parent(const QModelIndex &child) const; - int rowCount(const QModelIndex &parent) const; - int columnCount(const QModelIndex &parent) const { return 1; }; - QVariant data(const QModelIndex &index, int role) const; - // Qt::ItemFlags flags(const QModelIndex &index) const; - void update(); // TEMP -}; diff --git a/src/commandutils.cpp b/src/commandutils.cpp deleted file mode 100644 index 48e1d7b..0000000 --- a/src/commandutils.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * commandutils.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include "commandutils.h" -#include - -extern QList commands; - -int find_command(QString s) -{ - for (int i = 0; i < commands.size(); i++) - if (s == commands[i]->name) - return i; - return -1; -} - -// DEL has "&" end of the string ? -bool hasAmpersand(QString cmdline) -{ - QString str; - int len; - str = cmdline.simplified(); - - if (str == "%update") - return true; // internal command - - len = str.length(); - if (str[len - 1] == '&') - return true; - else - return false; -} - -void check_command(int idx) {} - -// -void check_commandAll() -{ - int i, idx; - - return; - for (int i = 0; i < commands.size(); i++) - { - if (hasAmpersand(commands[i]->cmdline) == false) - commands[i]->cmdline.append("&"); - } -} - -// after read ~/.qpsrc -void add_default_command() -{ - - int idx; - - /* - idx=find_command("Update"); - if (idx>=0) - commands[idx]->cmdline="%update"; - else - commands.add(new Command("Update","%update",true)); - */ - - /* - * PAUSED - idx=find_command("Quit"); - if (idx>=0) - commands[idx]->cmdline="killall qps"; - else commands.add(new Command("Quit","killall qps",false)); - */ - - // check_commandAll(); DEL? -} diff --git a/src/commandutils.h b/src/commandutils.h deleted file mode 100644 index c27c442..0000000 --- a/src/commandutils.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * commandutils.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef COMMANDUTILS_H -#define COMMANDUTILS_H - -#include - -int find_command(QString s); -bool hasAmpersand(QString cmdline); -void check_command(int idx); -void check_commandAll(); -void add_default_command(); - -#endif // COMMANDUTILS_H diff --git a/src/config.h b/src/config.h deleted file mode 100644 index 7e908bf..0000000 --- a/src/config.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * config.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef CONFIG_H -#define CONFIG_H - -#if defined(__linux__) -#define LINUX - -#elif defined(sun) && defined(__SVR4) -#define SOLARIS - -#else -#error Only Linux >= 2.0 and Solaris >= 2.6 supported, sorry - -#endif - -#endif // CONFIG_H diff --git a/src/details.cpp b/src/details.cpp deleted file mode 100644 index fce97d1..0000000 --- a/src/details.cpp +++ /dev/null @@ -1,757 +0,0 @@ -/* - * details.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include -#include -#include - -#include "details.h" -//#include "proc.h" // static flag -#include "qps.h" // static flag -Details::Details(Procinfo *p, Proc *proc) : QWidget(0) -{ - pi = p; - pi->detail = this; - pr = proc; - // printf("pi=%x\n",pi); - setWindowTitle( tr( "Process %1 ( %2 ) - details" ).arg( pi->pid ) - .arg( pi->command ) ); - - tbar = new QTabWidget(this); - // tbar->setMargin(5); - - // if(pi->fd_files) //if(pi->fd_files->size()) - if (pi->read_fds()) - { - tbar->addTab(new Files(this), tr( "Files" ) ); - -// if(pi->read_fds()) // create sock_inodes -#ifdef LINUX - // printf(" pi->socks.size=%d\n", p->sock_inodes->size() ); - // this means if a process dont have socket then - // no socket pane show in Detail dialog. - // Procinfo::read_sockets(); - if (pi->sock_inodes.size() != 0) - tbar->addTab(new Sockets(this), tr( "Sockets" ) ); -#endif - } - - if (pi->read_maps()) - tbar->addTab(new Maps(this), tr( "Memory Maps" ) ); - if (pi->read_environ()) - tbar->addTab(new Environ(this), tr( "Environment" ) ); - tbar->addTab(new AllFields(this), tr( "All Fields" ) ); - - tbar->adjustSize(); - QSize s0 = tbar->sizeHint(); - if (s0.width() > 800) - s0.setWidth(800); - resize(s0); -} - -Details::~Details() -{ - // printf("~Details()\n"); - if (pi) - pi->detail = 0; - int i; - /// for(i=0;icount();i++) delete tbar->page(i); - delete tbar; -} - -void Details::set_procinfo(Procinfo *p) -{ - // printf("p=%x, pi=%x\n",p,pi); -} -void Details::refresh() -{ - printf("Details::refresh()\n"); - QWidget *w = NULL; // tbar->currentPage (); - // QWidget *w= tbar->currentPage (); - if (w != NULL) - { - /// printf("refresh()\n"); - ((SimpleTable *)w)->refresh(); - } -} - -void Details::process_gone() -{ - /// printf("process_gone() *******************************\n"); - pi = 0; - // for now, we just close the window. Another possibility would be - // to leave it with a "process terminated" note. - close(); -} - -// slot: react to changes in preferences -void Details::config_change() { return; } - -void Details::resizeEvent(QResizeEvent *s) -{ - tbar->resize(s->size()); //** - QWidget::resizeEvent(s); -} - -// user closed the window (via window manager) -void Details::closeEvent(QCloseEvent *) { emit closed(this); } - -SimpleTable::SimpleTable(QWidget *parent, int nfields, TableField *f, - int options) - : HeadedTable(parent, options), fields(f) -{ - detail = (Details *)parent; - setNumCols(nfields); -} - -QSize SimpleTable::sizeHint() const -{ - /// return QSize(tableWidth(), 300); - return QSize(480, 300); -} - -QString SimpleTable::title(int col) { return fields[col].name; } - -int SimpleTable::colWidth(int col) { return fields[col].width; } - -inline int SimpleTable::alignment(int col) { return fields[col].align; } - -int SimpleTable::leftGap(int col) { return fields[col].gap; } - -QString SimpleTable::tipText(int col) { return fields[col].tooltip; } - -#ifdef LINUX - -// declaration of static members -bool Sockets::have_services = false; -QHash Sockets::servdict; -Lookup *Sockets::lookup = 0; - -TableField *Sockets::fields() -{ - static QVector< TableField > fields( { { tr( "Fd" ), 5, 8, Qt::AlignRight, tr( "File descriptor" ) } - , { tr( "Proto" ), 4, 8, Qt::AlignLeft, tr( "Protocol (TCP or UDP)" ) } - , { tr( "Recv-Q" ), 9, 8, Qt::AlignRight, tr( "Bytes in receive queue" ) } - , { tr( "Send-Q" ), 9, 8, Qt::AlignRight, tr( "Bytes in send queue" ) } - , { tr( "Local Addr" ), -1, 8, Qt::AlignLeft, tr( "Local IP address" ) } - , { tr( "Port" ), 6, 8, Qt::AlignLeft, tr( "Local port" ) } - , { tr( "Remote Addr" ), -1, 8, Qt::AlignLeft, tr( "Remote IP address" ) } - , { tr( "Port" ), 6, 8, Qt::AlignLeft, tr( "Remote port" ) } - , { tr( "State" ), 18, 8, Qt::AlignLeft, tr( "Connection state" ) } } ); - return fields.data(); -} - -Sockets::Sockets(QWidget *parent) : SimpleTable(parent, SOCKFIELDS, fields() ) -{ - if (!lookup) - lookup = new Lookup(); - connect(lookup, SIGNAL(resolved(unsigned)), - SLOT(update_hostname(unsigned))); - doing_lookup = Qps::hostname_lookup; - refresh(); - // compute total width = window width - int totw = 400; - // for(int i = 0; i < SOCKFIELDS; i++) - // totw += actualColWidth(i); - resize(totw, 200); -} - -Sockets::~Sockets() -{ - // why seg? - // if(lookup) delete lookup; -} - -static const char *tcp_states[] = { - "ESTABLISHED", // 1 - "SYN_SENT", "SYN_RECV", "FIN_WAIT1", "FIN_WAIT2", "TIME_WAIT", - "CLOSE", "CLOSE_WAIT", "LAST_ACK", "LISTEN", - "CLOSING" // 11 -}; - -static inline const char *tcp_state_name(int st) -{ - return (st < 1 || st > 11) ? "UNKNOWN" : tcp_states[st - 1]; -} - -QString Sockets::text(int row, int col) -{ - Procinfo *p = procinfo(); - if (p->sock_inodes.size() == 0) - refresh_sockets(); - SockInode *sock_ino = p->sock_inodes[row]; - // SockInode *sock_ino = p->sock_inodes[row]; - Sockinfo *si = p->proc->socks.value(sock_ino->inode, NULL); - if (!si) - return ""; // process gone, return empty string - - QString s; - switch (col) - { - case FD: - s.setNum(sock_ino->fd); - break; - - case PROTO: - s = (si->proto == Sockinfo::TCP) ? "tcp" : "udp"; - break; - - case RECVQ: - s.setNum(si->rx_queue); - break; - - case SENDQ: - s.setNum(si->tx_queue); - break; - - case LOCALADDR: - s = ipAddr(si->local_addr); - break; - - case LOCALPORT: - if (Qps::service_lookup) - { - const char *serv = servname(si->local_port); - if (serv) - { - s = serv; - break; - } - } - s.setNum(si->local_port); - break; - - case REMOTEADDR: - s = ipAddr(si->rem_addr); - break; - - case REMOTEPORT: - if (Qps::service_lookup) - { - const char *serv = servname(si->rem_port); - if (serv) - { - s = serv; - break; - } - } - s.setNum(si->rem_port); - break; - - case STATE: - s = tcp_state_name(si->st); - break; - } - return s; -} - -QString Sockets::ipAddr(unsigned addr) -{ - unsigned a = htonl(addr); - QString s; - if (doing_lookup) - { - s = lookup->hostname(addr); - if (s.isNull()) - { - s.sprintf("(%d.%d.%d.%d)", (a >> 24) & 0xff, (a >> 16) & 0xff, - (a >> 8) & 0xff, a & 0xff); - } - } - else - { - if (a == 0) - s = "*"; - else - s.sprintf("%d.%d.%d.%d", (a >> 24) & 0xff, (a >> 16) & 0xff, - (a >> 8) & 0xff, a & 0xff); - } - return s; -} - -void Sockets::refresh_window() -{ - Procinfo *p = procinfo(); - if (!p) - return; - int rows = p->sock_inodes.size(); - /// resetWidths(); - setNumRows(rows); - setNumCols(SOCKFIELDS); - /// repaint_changed(); - repaintAll(); -} - -void Sockets::refresh() -{ - if (refresh_sockets()) - refresh_window(); -} - -// return true if sockets could be read successfully, false otherwise -bool Sockets::refresh_sockets() -{ - // Procinfo::read_sockets(); - return procinfo()->read_fds(); -} - -// react to changes in preferences -void Sockets::config_change() -{ - if (doing_lookup != Qps::hostname_lookup) - { - doing_lookup = Qps::hostname_lookup; - ////setNumCols(SOCKFIELDS); - // for(int col = 0; col < SOCKFIELDS; col++) - // widthChanged(col); - ////updateTableSize(); - ////repaintAll(); - } -} - -// slot: called when a host name has been looked up -void Sockets::update_hostname(unsigned addr) -{ - // if(widthChanged(REMOTEADDR) || widthChanged(LOCALADDR)) { - if (1) - { - //// updateTableSize(); - /// repaintAll(); - } - else - { - // just repaint some rows - Procinfo *p = procinfo(); - if (!p->sock_inodes.size()) - { - /// Procinfo::read_sockets(); - p->read_fds(); - } - int rows = p->sock_inodes.size(); - for (int i = 0; i < rows; i++) - { - int inode = p->sock_inodes[i]->inode; - /// Sockinfo *si = Procinfo::socks[inode]; - /// if(si->local_addr == addr) updateCell(i, LOCALADDR); - /// if(si->rem_addr == addr) updateCell(i, - /// REMOTEADDR); - } - } -} - -const char *Sockets::servname(unsigned port) -{ - if (!have_services) - { - have_services = true; - // fill servdict from /etc/services (just try once) - setservent(1); - struct servent *s; - while ((s = getservent()) != 0) - { - unsigned short hport = ntohs((unsigned short)s->s_port); - if (!servdict.value(hport, NULL)) - { - servdict.insert(hport, strdup(s->s_name)); - } - } - endservent(); - } - return servdict.value(port, NULL); -} - -#endif // LINUX - -#ifdef SOLARIS - -// Stupid code to make up for moc:s inability to grok preprocessor conditionals -void Sockets::refresh() {} -QString Sockets::text(int, int) { return 0; } -void Sockets::config_change() {} -Sockets::~Sockets() {} -void Sockets::update_hostname(unsigned int) {} - -#endif -TableField *Maps::fields() -{ - static QVector< TableField > fields( { { tr( "Address Range" ), -1, 8, Qt::AlignLeft, tr( "Mapped addresses (hex) )" ) } - , { tr( "Size" ), 8, 8, Qt::AlignRight, tr( "Kbytes mapped (dec)" ) } - , { tr( "Perm" ), 5, 8, Qt::AlignLeft, tr( "Permission flags" ) } - , { tr( "Offset" ), -1, 8, Qt::AlignRight, tr( "File offset at start of mapping (hex)" ) } - , { tr( "Device" ), 8, 8, Qt::AlignLeft, tr( "Major,Minor device numbers (dec)" ) } - , { tr( "Inode" ), 10, 8, Qt::AlignRight, tr( "Inode number (dec)" ) } - , { tr( "File" ), -9, 8, Qt::AlignLeft, tr( "File name (if available)" ) } } ); - return fields.data(); -} - -// memory leak -Maps::Maps(QWidget *parent) : SimpleTable(parent, MAPSFIELDS, fields() ) -{ - // monospaced font looks best in the table body since it contains - // hex numerals and flag fields. Pick Courier (why not) - body->setFont(QFont("Courier", font().pointSize())); - bool mono = true; - QFont f = font(); - if (f.rawMode()) - { - /* see if the font is monospaced enough for our needs */ - QFontMetrics fm(f); - int zw = fm.width('0'); - const char *test = "abcdef"; - for (const char *p = test; *p; p++) - if (fm.width(*p) != zw) - { - mono = false; - break; - } - } - else - mono = f.fixedPitch(); - if (mono) - { - ////setBodyFont(f); - } - else - { - int ps = f.pointSize(); - /// setBodyFont(QFont("Courier", ps ? ps : 10)); - } - - refresh(); - // compute total width = window width - int totw = 300; - // for(int i = 0; i < MAPSFIELDS; i++) totw += actualColWidth(i); - resize(totw + 20, 200); -} - -Maps::~Maps() -{ - // if(maps) - // maps->clear(); -} - -QString Maps::text(int row, int col) -{ - Procinfo *p = procinfo(); - if (p->maps.size() == 0) - { - refresh_maps(); - if (p->maps.size() == 0) - return ""; - } - Mapsinfo *mi = p->maps[row]; - - QString s; - char buf[80]; - switch (col) - { - case ADDRESS: - sprintf(buf, (sizeof(void *) == 4) ? "%08lx-%08lx" : "%016lx-%016lx", - mi->from, mi->to); - s = buf; - break; - case SIZE: - s.setNum((mi->to - mi->from) >> 10); - s += "kb"; - break; - case PERM: - s = " "; - for (int i = 0; i < 4; i++) - s[i] = mi->perm[i]; - break; - case OFFSET: - sprintf(buf, (sizeof(void *) == 4) ? "%08lx" : "%016lx", mi->offset); - s = buf; - break; - case DEVICE: - s.sprintf("%2u,%2u", mi->major, mi->minor); - break; - case INODE: - s.setNum(mi->inode); - break; - case FILENAME: - s = mi->filename; - if (!Qps::show_file_path) - { - int i = s.lastIndexOf('/'); - if (i >= 0) - s.remove(0, i + 1); - } - break; - } - return s; -} - -void Maps::refresh_window() -{ - if (!procinfo()) - return; - int rows = procinfo()->maps.size(); - ////resetWidths(); - setNumRows(rows); - setNumCols(MAPSFIELDS); - repaintAll(); -} - -void Maps::refresh() -{ - if (refresh_maps()) - refresh_window(); -} - -bool Maps::refresh_maps() { return procinfo()->read_maps(); } - -TableField *Files::fields() -{ - static QVector< TableField > fields( { { tr( "Fd" ), 5, 8, Qt::AlignRight, tr( "File descriptor" ) } -#ifdef LINUX - , { tr( "Mode" ), 3, 8, Qt::AlignLeft, tr( "Open mode" ) } -#endif - , { tr( "Name" ), -1, 8, Qt::AlignLeft, tr( "File name (if available)" )} } ); - return fields.data(); -} - -Files::Files(QWidget *parent) : SimpleTable(parent, FILEFIELDS, fields() ) -{ - // compute total width = window width - refresh_window(); -} - -Files::~Files() {} - -void Files::refresh() -{ - printf("Files::refresh()\n"); - // return true if fds could be read successfully, false otherwise - if (procinfo()->read_fds()) - refresh_window(); -} - -bool Files::refresh_fds() { return false; } - -void Files::refresh_window() -{ - Procinfo *p = procinfo(); - if (!p) - return; - - // if(p->fd_files==NULL) printf("qps :dddds\n"); - - int rows = p->fd_files.size(); - - resetWidths(); - // printf("size=%d\n",rows); - setNumRows(rows); - setNumCols(FILEFIELDS); - repaintAll(); // useless ? -} - -QString Files::text(int row, int col) -{ - Procinfo *p = procinfo(); // alot!! - if (p == 0) - return "zero"; - // printf("p=%x px=%x\n",p,px); - if (p->fd_files.size() == 0) - { //???????????/////// - refresh_fds(); - if (p->fd_files.size() == 0) - return ""; - } - if (row >= p->fd_files.size()) - return ""; - - Fileinfo *fi = p->fd_files[row]; - QString s; - switch (col) - { - case FILEDESC: - s.setNum(fi->fd); - break; - -#ifdef LINUX - case FILEMODE: - if (fi->mode & OPEN_READ) - s.append("R"); - if (fi->mode & OPEN_WRITE) - s.append("W"); - break; -#endif - - case FILENAME: - s = fi->filename; - break; - } - return s; -} - -TableField *Environ::fields() -{ - static QVector< TableField > fields( { { tr( "Variable" ), -1, 8, Qt::AlignLeft, tr( "Variable name" ) } - , { tr( "Value" ), -1, 8, Qt::AlignLeft, tr( "Variable value" ) } } ); - return fields.data(); -} - -Environ *Environ::static_env = 0; -Environ::Environ(QWidget *parent) - : SimpleTable(parent, ENVFIELDS, fields() ), rev(false) -{ - connect(this, SIGNAL(titleClicked(int)), SLOT(sort_change(int))); - refresh(); -} - -Environ::~Environ() {} - -QString Environ::text(int row, int col) -{ - Procinfo *p = procinfo(); // if dead process then - if (row >= p->environ.size()) - printf("size dddd=row=%d\n", row); - NameValue nv = p->environ[row]; // Segfault !! - return (col == ENVNAME) ? nv.name : nv.value; -} - -void Environ::refresh_window() -{ - if (!procinfo()) - return; - /// resetWidths(); - int rows = procinfo()->environ.size(); - setNumRows(rows); - setNumCols(ENVFIELDS); - repaintAll(); -} - -void Environ::refresh() -{ - if (procinfo()->read_environ()) - { - // sort(); - refresh_window(); - } -} - -void Environ::sort_change(int col) -{ - Procinfo *p = procinfo(); - /* - if(!p->environ) { - refresh_environ(); - if(!p->environ) - return; - }*/ - ////rev = (col == sortedCol()) ? !rev : false; - setSortedCol(col); - sort(); - refresh_window(); -} - -// sort table according to current settings -void Environ::sort() -{ - /////if(sortedCol() >= 0) - { - static_env = this; - // if(procinfo()->environ==NULL) - // printf("qps : Environ::sort() error ???\n"); - // else - // procinfo()->environ.sort(compare); - } -} - -int Environ::compare(const NameValue *a, const NameValue *b) -{ - Environ *e = Environ::static_env; - int r; - /* - if(e->sortedCol() == ENVNAME) - r = strcmp(a->name, b->name); - else - r = strcmp(a->value, b->value); SimpleTable(QWidget *parent, - int - nfields, TableField *f, int options = 0); - */ - return e->rev ? -r : r; -} - -TableField *AllFields::fields() -{ - static QVector< TableField > fields( { { tr( "Field" ), -1, 8, Qt::AlignLeft, tr( "Field name" ) } - , { tr( "Description" ), -1, 8, Qt::AlignLeft, tr( "Field description" ) } - , { tr( "Value" ), -1, 8, Qt::AlignLeft, tr( "Field value" ) } } ); - return fields.data(); -} - - -AllFields::AllFields(QWidget *parent) - : SimpleTable(parent, FIELDSFIELDS, fields() ) -{ - refresh(); - // compute total width = window width - int totw = 0; - // for(int i = 0; i < FIELDSFIELDS; i++) totw += actualColWidth(i); - resize(totw + 20, 200); -} - -AllFields::~AllFields() {} - -// Proc not changed ? -QString AllFields::text(int row, int col) -{ - QString s; - // printf("text start r=%d , c=%d\n",row,col); - // if( ((Details *)parent())->proc()==NULL) - // printf("size=%d\n", ((Details *)parent())->proc()->allcats.size() ); - // printf("size=%d\n", proc()->allcats.size() ); - - Category *cat = proc()->categories.values()[row]; - // Category *cat = proc()->allcats[row]; - switch (col) - { - case FIELDNAME: - s = cat->name; - break; - case FIELDDESC: - s = cat->help; - break; - case FIELDVALUE: - s = cat->string(procinfo()); - break; - } - // printf("text end\n"); - return s; -} - -// parent will be tbar(TabWidget) !!! -void AllFields::refresh_window() -{ - // printf("refresh_window\n"); - if (!procinfo()) - return; - setNumRows(proc()->categories.size()); - setNumCols(FIELDSFIELDS); - // DEL resetWidths(); - // repaint_changed(); - repaintAll(); -} - -void AllFields::refresh() { refresh_window(); } diff --git a/src/details.h b/src/details.h deleted file mode 100644 index 0bd1960..0000000 --- a/src/details.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * details.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef DETAILS_H -#define DETAILS_H - -#ifndef USING_PCH -#include -#include -#include -#include -#include -#include -#endif - -#include "proc.h" -#include "lookup.h" -#include "tablefield.h" - -class Details : public QWidget -{ - Q_OBJECT - public: - Details(Procinfo *p, Proc *proc); - ~Details(); - - void refresh(); - void config_change(); - void process_gone(); - Procinfo *get_procinfo() { return pi; } - Proc *proc() { return pr; } - void set_procinfo(Procinfo *p); - -signals: - void closed(Details *); - - protected: - virtual void resizeEvent(QResizeEvent *); - virtual void closeEvent(QCloseEvent *); - - private: - QTabWidget *tbar; - Procinfo *pi; - Proc *pr; -}; - -// SimpleTable: a HeadedTable with fixed number of columns -#include "htable.h" -class SimpleTable : public HeadedTable -{ - Q_OBJECT - public: - SimpleTable(QWidget *parent, int nfields, TableField *f, int options = 0); - QSize sizeHint() const; - virtual void refresh(){}; - - protected: - virtual QString title(int col); - virtual QString text(int row, int col) = 0; - virtual int colWidth(int col); - virtual int alignment(int col); - virtual int leftGap(int col); - virtual QString tipText(int col); - // Procinfo *procinfo() { return ((Details - // *)parentWidget())->procinfo(); } - Procinfo *procinfo() { return detail->get_procinfo(); } - Proc *proc() { return detail->proc(); } - - private: - const TableField *fields; - Details *detail; -}; - -class Sockets : public SimpleTable -{ - Q_OBJECT - public: - Sockets(QWidget *parent); - ~Sockets(); - - void refresh(); - void refresh_window(); - bool refresh_sockets(); - const char *servname(unsigned port); - QString ipAddr(unsigned addr); - QString hostname(unsigned addr); - void config_change(); - - public slots: - void update_hostname(unsigned addr); - - protected: - virtual QString text(int row, int col); - - private: - enum - { - FD, - PROTO, - RECVQ, - SENDQ, - LOCALADDR, - LOCALPORT, - REMOTEADDR, - REMOTEPORT, - STATE, - SOCKFIELDS - }; - static TableField *fields(); - - bool doing_lookup; // if table painted with host lookup - - static Lookup *lookup; - static bool have_services; // true if we have tried reading services - static QHash servdict; -}; - -class Maps : public SimpleTable -{ - public: - Maps(QWidget *parent); - ~Maps(); - - void refresh(); - void refresh_window(); - bool refresh_maps(); - - protected: - virtual QString text(int row, int col); - - private: - enum - { - ADDRESS, - SIZE, - PERM, - OFFSET, - DEVICE, - INODE, - FILENAME, - MAPSFIELDS - }; - static TableField *fields(); -}; - -class Files : public SimpleTable -{ - public: - Files(QWidget *parent); - ~Files(); - - void refresh(); - void refresh_window(); - bool refresh_fds(); - - protected: - virtual QString text(int row, int col); - - private: - enum - { - FILEDESC, -#ifdef LINUX - FILEMODE, -#endif - FILENAME, - FILEFIELDS - }; - static TableField *fields(); -}; - -class Environ : public SimpleTable -{ - Q_OBJECT - public: - Environ(QWidget *parent); - ~Environ(); - - void refresh(); - void refresh_window(); - - public slots: - void sort_change(int); - - protected: - virtual QString text(int row, int col); - - void sort(); - static int compare(const NameValue *a, const NameValue *b); - - private: - enum - { - ENVNAME, - ENVVALUE, - ENVFIELDS - }; - bool rev; // sorting reversed - static Environ *static_env; // for sorting, must have static pointer - static TableField *fields(); -}; - -class AllFields : public SimpleTable -{ - public: - AllFields(QWidget *parent); - ~AllFields(); - - void refresh(); - void refresh_window(); - - protected: - virtual QString text(int row, int col); - - private: - enum - { - FIELDNAME, - FIELDDESC, - FIELDVALUE, - FIELDSFIELDS - }; - static TableField *fields(); -}; - -#endif // DETAILS_H diff --git a/src/dialogs.cpp b/src/dialogs.cpp deleted file mode 100644 index ddccd34..0000000 --- a/src/dialogs.cpp +++ /dev/null @@ -1,415 +0,0 @@ -/* - * dialogs.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include "qps.h" -#include "dialogs.h" -#include - -extern Qps *qps; - -// center window a with respect to main application window -static void center_window(QWidget *a) -{ - QWidget *b = QApplication::activeWindow(); - // QWidget *b = qApp->mainWidget(); - a->move(b->x() + (b->width() - a->width()) / 2, - b->y() + (b->height() - a->height()) / 2); -} - -static void move_mouse_window(QWidget *a) -{ - // QWidget *b = qApp->mainWidget(); - QWidget *b = QApplication::activeWindow(); - a->move(b->x() + (b->width() - a->width()) / 2, - b->y() + (b->height() - a->height()) / 2); -} - -static void fix_size(QWidget *w) { w->setFixedSize(w->sizeHint()); } - -// Modal dialog -IntervalDialog::IntervalDialog(const char *ed_txt, bool enabled) : QDialog() -{ - setWindowTitle( tr( "Change Update Period" ) ); - QVBoxLayout *tl = new QVBoxLayout; - QHBoxLayout *h1 = new QHBoxLayout; - setLayout(tl); - tl->addLayout(h1); - - QLabel *label1 = new QLabel( tr( "New Update Period" ), this); - h1->addWidget(label1); - h1->addStretch(1); - - lined = new QLineEdit(this); - QFont f = font(); - lined->setMaxLength(7); - lined->setText(ed_txt); - if (enabled) - { - lined->selectAll(); - lined->setFocus(); - } - // lined->setEnabled(enabled); - lined->setEnabled(true); - fix_size(lined); - lined->setFixedWidth(64); - h1->addWidget(lined); - - label = new QLabel(this); - label->setFrameStyle(QFrame::Panel); - label->setFrameShadow(QFrame::Sunken); - label->setText(""); - label->setAlignment(Qt::AlignRight); - tl->addWidget(label); - - /* - toggle = new CrossBox("Dynamic Update (under devel)", this); - fix_size(toggle); - toggle->setChecked(enabled); - //toggle->setChecked(false); - toggle->setChecked(true); - toggle->setEnabled(false); - tl->addWidget(toggle); - */ - QHBoxLayout *h2 = new QHBoxLayout; - // h2->addStretch(1); - cancel = new QPushButton( tr( "Cancel" ), this); - h2->addWidget(cancel); - ok = new QPushButton( tr( "OK" ), this); - // ok->setFocus(); - h2->addWidget(ok); - tl->addLayout(h2); - - connect(ok, SIGNAL(clicked()), SLOT(done_dialog())); - connect(cancel, SIGNAL(clicked()), SLOT(reject())); - connect(lined, SIGNAL(returnPressed()), SLOT(done_dialog())); - connect(lined, SIGNAL(textChanged(const QString &)), - SLOT(event_label_changed())); - // connect(toggle, SIGNAL(toggled(bool)), lined, - // SLOT(setEnabled(bool))); - - ok->setDefault(true); - - /// Q3Accel *acc = new Q3Accel(this); - /// acc->connectItem(acc->insertItem(Qt::Key_Escape), this, - /// SLOT(reject())); - // tl->setSizeConstraint(QLayout::SetFixedSize); - // center_window(this); -} - -void IntervalDialog::event_label_changed() -{ - QString txt; - int i = 0; - ed_result = lined->text(); - ed_result = ed_result.simplified(); - - // if(toggle->isChecked()) - - QString s = ed_result; - if (s.length() == 0) - { - label->setText( tr( "No UPDATE" ) ); - return; - } - - while ((s[i] >= '0' && s[i] <= '9') || s[i] == '.') - i++; - - float period = (i > 0) ? s.left(i).toFloat() : -1; - - s = s.mid(i, 3).simplified(); - if (s.length() == 0 || s == "s") - period *= 1000; - else if (s == "min") - period *= 60000; - else if (s != "ms") - period = -1; - if (period <= 0) - { - label->setText( tr( "Invalid value" ) ); - return; - } - - txt.sprintf("%d ms", (int)period); - label->setText(txt); -} - -void IntervalDialog::done_dialog() -{ - int i = 0; - - ed_result = lined->text(); - ed_result = ed_result.simplified(); - - // if(toggle->isChecked()) - QString s = ed_result; - while ((s[i] >= '0' && s[i] <= '9') || s[i] == '.') - i++; - - float period = (i > 0) ? s.left(i).toFloat() : -1; - - s = s.mid(i, 3).simplified(); - if (s.length() == 0 || s == "s") - period *= 1000; - else if (s == "min") - period *= 60000; - else if (s != "ms") - period = -1; - if (period < 0) - return; - - qps->set_update_period((int)period); - qps->update_timer(); - - accept(); -} - -SliderDialog::SliderDialog(int defaultval, int minval, int maxval) : QDialog() -{ - setWindowTitle( tr( "Renice Process" ) ); - QVBoxLayout *tl = new QVBoxLayout; - QHBoxLayout *h1 = new QHBoxLayout; - setLayout(tl); - tl->addLayout(h1); - - label = new QLabel( tr( "New nice value:" ), this); - h1->addWidget(label); - - h1->addStretch(1); - - lined = new QLineEdit(this); - lined->setMaxLength(3); - lined->setText(QString::number(defaultval)); - lined->setFocus(); - lined->setFixedWidth(64); - h1->addWidget(lined); - - slider = new QSlider(Qt::Horizontal, this); - slider->setMaximum(maxval); - slider->setMinimum(minval); - slider->setTickInterval(10); - slider->setTickPosition(QSlider::TicksBelow); - slider->setValue(defaultval); - tl->addWidget(slider); - - QHBoxLayout *h2 = new QHBoxLayout; - tl->addLayout(h2); - - // decorate slider - QLabel *left = new QLabel(this); - QLabel *mid = new QLabel(this); - QLabel *right = new QLabel(this); - left->setNum(minval); - mid->setNum((minval + maxval) / 2); - right->setNum(maxval); - h2->addWidget(left); - h2->addStretch(1); - h2->addWidget(mid); - h2->addStretch(1); - h2->addWidget(right); - - QHBoxLayout *h3 = new QHBoxLayout; - tl->addLayout(h3); - - h3->addStretch(1); - cancel = new QPushButton( tr( "Cancel" ), this); - // fix_size(cancel); - h3->addWidget(cancel); - - ok = new QPushButton( tr( "OK" ), this); - ok->setFixedSize(cancel->sizeHint()); - h3->addWidget(ok); - - connect(ok, SIGNAL(clicked()), SLOT(done_dialog())); - ok->setDefault(true); - connect(cancel, SIGNAL(clicked()), SLOT(reject())); - connect(lined, SIGNAL(returnPressed()), SLOT(done_dialog())); - connect(slider, SIGNAL(valueChanged(int)), this, SLOT(slider_change(int))); - // Q3Accel *acc = new Q3Accel(this); - // acc->connectItem(acc->insertItem(Qt::Key_Escape), this, - // SLOT(reject())); - // tl->freeze(); - - center_window(this); -} - -void SliderDialog::done_dialog() -{ - ed_result = lined->text(); - ed_result = ed_result.simplified(); - accept(); -} - -void SliderDialog::slider_change(int val) -{ - QString s; - s.setNum(val); - lined->setText(s); - lined->selectAll(); -} - -// DRAFT CODE, -PermissionDialog::PermissionDialog(QString msg, QString passwd) : QDialog() -{ - setWindowTitle( tr( "Permission" ) ); - QVBoxLayout *vbox = new QVBoxLayout; - label = new QLabel(msg, this); - vbox->addWidget(label); - - setLayout(vbox); - - QHBoxLayout *hbox = new QHBoxLayout; - vbox->addLayout(hbox); - label = new QLabel( tr( "Root password" ), this); - hbox->addWidget(label); - lined = new QLineEdit(this); - hbox->addWidget(lined); - - hbox = new QHBoxLayout; - vbox->addLayout(hbox); - QPushButton *cancel = new QPushButton( tr( "Cancel" ), this); - hbox->addWidget(cancel); - - QPushButton *ok = new QPushButton( tr( "OK" ), this); - hbox->addWidget(ok); - - connect(ok, SIGNAL(clicked()), SLOT(accept())); - connect(cancel, SIGNAL(clicked()), SLOT(reject())); -} - -SchedDialog::SchedDialog(int policy, int prio) : QDialog() -{ - setWindowTitle( tr( "Change scheduling" ) ); - QVBoxLayout *vl = new QVBoxLayout; - setLayout(vl); - - bgrp = new QGroupBox( tr( "Scheduling Policy" ), this); - vl->addWidget(bgrp); // bgrp->setCheckable(1); - rb_other = new QRadioButton( tr( "SCHED_OTHER (time-sharing)" ), bgrp); - rb_fifo = new QRadioButton( tr( "SCHED_FIFO (real-time)" ), bgrp); - rb_rr = new QRadioButton( tr( "SCHED_RR (real-time)" ), bgrp); - - QVBoxLayout *vbox = new QVBoxLayout; - vbox->addWidget(rb_other); - vbox->addWidget(rb_fifo); - vbox->addWidget(rb_rr); - bgrp->setLayout(vbox); - - connect(rb_other, SIGNAL(clicked(bool)), SLOT(button_clicked(bool))); - connect(rb_fifo, SIGNAL(clicked(bool)), SLOT(button_clicked(bool))); - connect(rb_rr, SIGNAL(clicked(bool)), SLOT(button_clicked(bool))); - - QHBoxLayout *hbox1 = new QHBoxLayout; - QPushButton *ok, *cancel; - ok = new QPushButton( tr( "OK" ), this); - ok->setDefault(true); - cancel = new QPushButton( tr( "Cancel" ), this); - hbox1->addWidget(ok); - hbox1->addWidget(cancel); - vl->addLayout(hbox1); - - connect(ok, SIGNAL(clicked()), SLOT(done_dialog())); - connect(cancel, SIGNAL(clicked()), SLOT(reject())); - - int active = 0; - QRadioButton *rb; - switch (policy) - { - case SCHED_OTHER: - active = 0; - rb = rb_other; - break; - case SCHED_FIFO: - active = 1; - rb = rb_fifo; - break; - case SCHED_RR: - active = 2; - rb = rb_rr; - break; - } - rb->setChecked(true); - out_policy = policy; - out_prio = prio; - - QHBoxLayout *hbox = new QHBoxLayout; - lbl = new QLabel( tr( "Priority (1-99):" ), this); - lined = new QLineEdit(this); - hbox->addWidget(lbl); - hbox->addWidget(lined); - vbox->addLayout(hbox); - QFont f = font(); - f.setBold(false); - lined->setFont(f); - lined->resize(60, lined->sizeHint().height()); - lined->setMaxLength(4); - QString s; - s.setNum(prio); - lined->setText(s); - button_clicked(active); - - // make sure return and escape work as accelerators - connect(lined, SIGNAL(returnPressed()), SLOT(done_dialog())); -} - -void SchedDialog::done_dialog() -{ - if (rb_rr->isChecked()) - out_policy = SCHED_RR; - else if (rb_fifo->isChecked()) - out_policy = SCHED_FIFO; - else - out_policy = SCHED_OTHER; - QString s(lined->text()); - bool ok; - out_prio = s.toInt(&ok); - if (out_policy != SCHED_OTHER && (!ok || out_prio < 1 || out_prio > 99)) - { - QMessageBox::warning( this - , tr( "Invalid Input" ) - , tr( "The priority must be in the range 1..99" ) ); - } - else - accept(); -} - -void SchedDialog::button_clicked(bool val) -{ - // printf("SchedDialog::checked()\n"); - if (rb_other->isChecked()) - { - lbl->setEnabled(false); - lined->setEnabled(false); - } - else - { - QString s(lined->text()); - bool ok; - int n = s.toInt(&ok); - if (ok && n == 0) - lined->setText("1"); - lbl->setEnabled(true); - lined->setEnabled(true); - lined->setFocus(); - lined->selectAll(); - } -} diff --git a/src/dialogs.h b/src/dialogs.h deleted file mode 100644 index f11650f..0000000 --- a/src/dialogs.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * dialogs.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - - -// misc. handy dialogs for use everywhere - -#ifndef DIALOGS_H -#define DIALOGS_H - -#ifndef USING_PCH -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#endif - -#include "misc.h" - -class IntervalDialog : public QDialog -{ - Q_OBJECT - public: - IntervalDialog(const char *ed_txt, bool toggle_state); - - protected slots: - void done_dialog(); - void event_label_changed(); - - public: - QString ed_result; - CrossBox *toggle; - - protected: - QPushButton *ok, *cancel; - QLabel *label; - QLineEdit *lined; -}; - -class SliderDialog : public QDialog -{ - Q_OBJECT - public: - SliderDialog(int defaultval, int minval, int maxval); - - QString ed_result; - - protected slots: - void slider_change(int val); - void done_dialog(); - - protected: - QPushButton *ok, *cancel; - QLabel *label; - QLineEdit *lined; - QSlider *slider; -}; - -class PermissionDialog : public QDialog -{ - Q_OBJECT - public: - PermissionDialog(QString msg, QString passwd); - QLineEdit *lined; - QLabel *label; - - // protected slots: - // void slider_change(int val); - // void done_dialog(); - /* - protected: - QPushButton *ok, *cancel; - QLabel *label; - QSlider *slider; */ -}; - -class SchedDialog : public QDialog -{ - Q_OBJECT - public: - SchedDialog(int policy, int prio); - - int out_prio; - int out_policy; - - protected slots: - void done_dialog(); - void button_clicked(bool); - - private: - QGroupBox *bgrp; - QRadioButton *rb_other, *rb_fifo, *rb_rr; - QLabel *lbl; - QLineEdit *lined; -}; -#endif // DIALOGS_H diff --git a/src/execwindow.cpp b/src/execwindow.cpp deleted file mode 100644 index fd85694..0000000 --- a/src/execwindow.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/* - * execwindow.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include "execwindow.h" -#include "watchcond.h" - -QList execlist; - -// ExecWindow -ExecWindow::ExecWindow() -{ - setupUi(this); - // connect(okButton, SIGNAL(clicked()), this, SLOT(close())); - // show(); -} - -ExecWindow::~ExecWindow() {} - -// eventcat_id; -ExecWindow::ExecWindow(watchCond *wc, int pid, QString cmd) -{ - setupUi(this); - setWindowTitle( tr( "Qps Watchdog" ) ); - - wcond = wc; - - QString str; - - if (wc->cond == WATCH_PROCESS_START) - { - textEdit->append(cmd + "(" + QString::number(pid) + ")" + " start"); - } - if (wc->cond == WATCH_PROCESS_FINISH) - textEdit->append(cmd + "(" + QString::number(pid) + ")" + " finished"); - - flag_started = false; - - pr = new QProcess; // leak? - if (!wc->command.isEmpty()) // conflict pid's command - { - pr->start(wc->command); // thread run, if null then segfault occurs. ? - } - - connect(okButton, SIGNAL(clicked()), this, SLOT(cmd_ok())); - - connect(pr, SIGNAL(started()), this, SLOT(cmd_started())); - connect(pr, SIGNAL(finished(int, QProcess::ExitStatus)), this, - SLOT(cmd_finished(int, QProcess::ExitStatus))); - connect(pr, SIGNAL(error(QProcess::ProcessError)), this, - SLOT(cmd_error(QProcess::ProcessError))); - - show(); - - execlist.append(this); -} - -ExecWindow::ExecWindow(QString str, QString exec_cmd, int pid, QString cmd) -{ - setupUi(this); - // -} - -// QProcess: Destroyed while process is still running.(Segmentation fault) -void ExecWindow::cmd_ok() -{ - if (pr->state() == QProcess::Running) - { - // pr->kill(); - pr->terminate(); - return; - } - close(); // Qt::WA_DeleteOnClose -} - -// slot : catch terminate signal. -void ExecWindow::cmd_finished(int exitCode, QProcess::ExitStatus exitStatus) -{ - textEdit->append( tr( "%1 exit with code %2" ).arg( wcond->command ) - .arg( exitStatus ) ); - okButton->setText( tr( "Close" ) ); - delete pr; -} - -void ExecWindow::cmd_started() -{ - textEdit->append( tr( "%1 [running]" ).arg( wcond->command ) ); - okButton->setText( tr( "terminate command" ) ); - flag_started = true; -} - -void ExecWindow::cmd_error(QProcess::ProcessError e) -{ - // not found command - // Error ? : - if (e == QProcess::FailedToStart) - textEdit->append( tr( "Error %1 : [%2] Maybe command not found" ).arg( e ) - .arg( wcond->command ) ); - delete pr; -} - -void ExecWindow::setText(QString str) -{ - textEdit->append(str); - // label->setText(str); -} diff --git a/src/execwindow.h b/src/execwindow.h deleted file mode 100644 index 969c32c..0000000 --- a/src/execwindow.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * execwindow.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef EXECWINDOW_H -#define EXECWINDOW_H - -#include -#include - -#include "ui_message.h" - -class watchCond; - -class ExecWindow : public QWidget, private Ui_ExecWindow -{ - Q_OBJECT - public: - ExecWindow(); - ExecWindow(QString str, QString exec_cmd, int pid = 0, QString cmd = ""); - ExecWindow(watchCond *wc, int pid = 0, QString cmd = ""); - ~ExecWindow(); - void setText(QString str); - QProcess *pr; - // QProcess proc; - QString execmd; - int flag_started; - watchCond *wcond; - protected slots: - void cmd_started(); - void cmd_finished(int exitCode, QProcess::ExitStatus exitStatus); - void cmd_error(QProcess::ProcessError error); - void cmd_ok(); -}; - -#endif // EXECWINDOW_H diff --git a/src/fieldsel.cpp b/src/fieldsel.cpp deleted file mode 100644 index d2b53a2..0000000 --- a/src/fieldsel.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* - * fieldsel.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include "fieldsel.h" - -FieldSelect::FieldSelect(Procview *pv) -{ - nbuttons = pv->categories.size(); - disp_fields.resize(64); - procview = pv; - - int half = (nbuttons + 1) / 2; - updating = false; - - setWindowTitle(tr( "Select Custom Fields " ) ); - QBoxLayout *v_layout = new QVBoxLayout; - setLayout(v_layout); - - QGridLayout *grid = new QGridLayout; - grid->setSpacing(0); - grid->setColumnMinimumWidth(2, 17); - v_layout->addLayout(grid); - - buts = new QCheckBox *[nbuttons]; - - QList keys = pv->categories.keys(); - - for (int i = 0; i < nbuttons; i++) - { - Category *cat = pv->categories[keys.takeFirst()]; // fieldlist - - QCheckBox *but = new QCheckBox(cat->name, this); - QLabel *desc = new QLabel(cat->help, this); - if (i < half) - { - grid->addWidget(but, i, 0); - grid->addWidget(desc, i, 1); - } - else - { - grid->addWidget(but, i - half, 3); - grid->addWidget(desc, i - half, 4); - } - buts[i] = but; - connect(but, SIGNAL(toggled(bool)), this, SLOT(field_toggled(bool))); - } - update_boxes(); - - QPushButton *closebut = new QPushButton( tr( "Close" ), this); - connect(closebut, SIGNAL(clicked()), SLOT(closed())); - closebut->setFocus(); - - v_layout->addWidget(closebut); - // v_layout->freeze(); ///!!! -} - -// CALLBACK : one of the fields was toggled (we don't know which one yet) -void FieldSelect::field_toggled(bool) -{ - if (updating) - return; - set_disp_fields(); - - for (int i = 0; i < nbuttons; i++) - { - Category *cat = procview->cat_by_name(buts[i]->text()); - - if (buts[i]->isChecked() != disp_fields.testBit(cat->id)) - { - if (buts[i]->isChecked()) - emit added_field(cat->id); // send cat_index - else - emit removed_field(cat->id); - } - } -} - -void FieldSelect::closed() { hide(); } - -void FieldSelect::closeEvent(QCloseEvent *) { closed(); } - -void FieldSelect::set_disp_fields() -{ - disp_fields.fill(false); - int n = procview->cats.size(); - for (int i = 0; i < n; i++) - disp_fields.setBit(procview->cats[i]->id); -} - -void FieldSelect::showEvent(QShowEvent *) { update_boxes(); } - -// init check button ? -void FieldSelect::update_boxes() -{ - set_disp_fields(); - - updating = true; - for (int i = 0; i < nbuttons; i++) - { - Category *cat = procview->cat_by_name(buts[i]->text()); - buts[i]->setChecked(disp_fields.testBit(cat->id)); - } - updating = false; -} diff --git a/src/fieldsel.h b/src/fieldsel.h deleted file mode 100644 index 55e2906..0000000 --- a/src/fieldsel.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * fieldsel.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef FIELDSEL_H -#define FIELDSEL_H - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "proc.h" - -class FieldSelect : public QDialog -{ - Q_OBJECT - public: - FieldSelect(Procview *pv); - - void update_boxes(); - - public slots: - void field_toggled(bool); - void closed(); - -signals: - void added_field(int); - void removed_field(int); - - protected: - QCheckBox **buts; - int nbuttons; - QBitArray disp_fields; - bool updating; - Procview *procview; - - void set_disp_fields(); - void closeEvent(QCloseEvent *); - virtual void showEvent(QShowEvent *); -}; - -#endif // FIELDSEL_H diff --git a/src/global.h b/src/global.h deleted file mode 100644 index 6f0d194..0000000 --- a/src/global.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * stable.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 2014 dae hyun, yang - * Copyright 2015 Paulo Lieuthier - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef GLOBAL_H -#define GLOBAL_H - -#include "qps.h" -#include "misc.h" - -extern QList commands; -extern ControlBar *controlbar; -extern int default_font_height; -extern bool flag_show_thread; -extern int flag_thread_ok; -extern bool previous_flag_show_thread; -extern int num_opened_files; - -extern Qps *qps; -extern SearchBox *search_box; -extern TFrame *infobox; - -#endif // GLOBAL_H diff --git a/src/htable.cpp b/src/htable.cpp deleted file mode 100644 index 4e3ed4c..0000000 --- a/src/htable.cpp +++ /dev/null @@ -1,1288 +0,0 @@ -/* - * htable.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - - -// very dirty and complex code ( fasthyun@magicn.com) -// Disaster !! - -// TODO: -// * autoscroll speed proportional to distance from edge -// * interface to add/remove rows (for disclosure triangles) -// * interface to display pixmaps in cells (for disclosure triangles etc) -// * include sorting functionality here for more generality - -#include "htable.h" -#include -#include -#include -#include - -#define DEBUG qDebug -//#define DEBUG -VPointer *vp = NULL; // Temporary - -VPointer::VPointer(QWidget *parent) : QWidget(parent) -{ - pix = new QPixmap(":/icon/vpointer.png"); - pix_vcross = new QPixmap(":/icon/vcross.png"); - int w = pix->width(); - bool flag_movable = true; - setGeometry(0, 0, w, w); -} - -void VPointer::paintEvent(QPaintEvent *event) -{ - QPainter p(this); - p.setClipping(false); // not work - if (flag_movable) - p.drawPixmap(0, 0, *pix); - else - p.drawPixmap(0, 0, *pix_vcross); -} - -FloatingHead::FloatingHead(QWidget *parent) : QWidget(parent) {} - -void FloatingHead::setTitle(QString str, int w, int h) -{ - title = str; - resize(w, h); -} -void FloatingHead::paintEvent(QPaintEvent *event) -{ - QPainter p(this); - QStyleOptionHeader opt; - p.setOpacity(0.7); - opt.rect = rect(); - opt.text = title; - opt.state = QStyle::State_Enabled; - // if(htable->sortedCol()==col) opt.state= opt.state | - // QStyle::State_Sunken; - // CE_Header, CE_HeaderSection, CE_HeaderLabel - style()->drawControl(QStyle::CE_Header, &opt, &p, this); - return; -} - -// TableHead: the horizontally scrollable table head -TableHead::TableHead(HeadedTable *parent) - : QtTableView(parent), htable(parent), dragging(false) -{ - setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); - // setSizePolicy(QSizePolicy - // (QSizePolicy::Minimum,QSizePolicy::Expanding)); - // setTableFlags(Tbl_smoothHScrolling | Tbl_scrollLastHCell); - setTableFlags(Tbl_scrollLastHCell); // ? - setNumRows(1); - - setMouseTracking(true); // for tooltip - - floatHead = new FloatingHead(parent); // tiny memory leak! don't care. - floatHead->hide(); - // setMinimumHeight(20);//cellHeight()); //ZERO!! fault -} - -// Description : draw a field name of table when DRAG !! -// called by paintHeading() -// called by QtTableView::repaint() -void TableHead::paintCell(QPainter *p, int row, int col, bool use_cache) -{ - static int count = 0; - /// printf(" paintcell %d,%d\n",row,col); - int w = htable->max_widths[col]; - - // if( isCellChanged (row,col,true)==false) - { - // printf(" paintcell %d,%d\n",row,col); - // if(use_cache==true) // check cached value - { - // return; - } - } - - // if( col ==11 ) printf("head: %d (%d) \n",col,count++); - // w = cellUpdateR.width(); - { - QStyleOptionHeader opt; - QRect rectR(0, 0, w, height()); - opt.rect = rectR; - opt.text = htable->title(col); - opt.state = QStyle::State_Enabled; - if (htable->sortedCol() == col) - opt.state = opt.state | QStyle::State_Sunken; - // CE_Header, CE_HeaderSection, CE_HeaderLabel - style()->drawControl(QStyle::CE_Header, &opt, p, this); - } -} - -// works -void TableHead::eraseRight(QPainter *p, QRect &r) -{ - QStyleOptionHeader opt; - // printf("widt=%d \n",r.width()); - opt.rect = r; - opt.text = ""; - style()->drawControl(QStyle::CE_Header, &opt, p, this); -} - -// virtual ! -int TableHead::cellWidth(int col) { return htable->max_widths[col]; } - -// -void TableHead::scrollSideways(int val) { setXOffset(val); } - -void TableHead::mousePressEvent(QMouseEvent *e) -{ - int col = findCol(e->x()); - // printf("col=%d\n",col); - if (col == -1) - return; - click_col = col; - - if (e->button() == Qt::RightButton) - // && htable->options & HTBL_HEADING_CONTEXT_MENU) - { - emit rightClicked(e->globalPos(), col); - return; - } - - if (e->button() == Qt::LeftButton) - { - press = e->pos(); - } -} - -void TableHead::dragEnterEvent(QDragEnterEvent *event) -{ - printf("dragEnterEvent()\n"); -} -void TableHead::dragLeaveEvent(QDragLeaveEvent *event) -{ - printf("dragLeaveEvent()\n"); -} - -void TableHead::mouseMoveEvent(QMouseEvent *e) -{ - // printf("mouseMoveEvent()\n"); - int col = findCol(e->x()); - if (col < 0) - { - emit htable->outOfHCell(); - return; - } - // if( !dragging) return; - emit htable->flyOnHCell(col); - - int thold = abs(press.x() - e->pos().x()); - - if (e->buttons() == Qt::LeftButton // Button state - and htable->options & HTBL_REORDER_COLS) - { - { - - if (!dragging and thold > 5) - { - dragging = true; - drag_offset = - press.x() - htable->colOffset(click_col) + xOffset(); - floatHead->setTitle(htable->title(click_col), - cellWidth(click_col), height()); - floatHead->show(); - // vp->show(); - } - - if (dragging) - { - // htable->body->drawGhostCol(drag_pos - - // drag_offset, w); - floatHead->move(e->x() - drag_offset, 0); - - int vcol = findColNoMinus(e->x() - drag_offset); - int vcol_offx = htable->colOffset(vcol); - static int old_pos = -1; - // printf("vcol=%d\n",vcol); - - // virtual Pointer move! - if (old_pos != vcol_offx) - { - QWidget *p = parentWidget(); // htable - // vp->setMovable(htable->columnMovable(htable->columnMovable(vcol) - // and htable->columnMovable(click_col) - // )); - // vp->move(vcol_offx - - // p->geometry().x() - //,p->geometry().y() - - // 13); - // vp->move(e->x() ,10); - old_pos = vcol_offx; - } - drag_pos = e->x(); // save old pos - - return; - } - } - } - - if (col != -1) // ToolTip - { - // for(int i=0;i<1024*1024;i++) htable->tipText(col); - //// memory leak - // test - QString s = htable->tipText(col); - - if (!s.isEmpty()) - QToolTip::showText(e->globalPos(), s); - } -} - -void TableHead::mouseReleaseEvent(QMouseEvent *e) -{ - if (e->button() == Qt::LeftButton) // Returns the button that caused the - // event. - { - int col = findCol(e->x()); - if (col < 0) - col = (e->x() < 0) ? 0 : htable->ncols - 1; // good! - - if (!dragging and col == click_col) - { - // htable->emit_click_signal(col); // just click no drag - emit htable->titleClicked(col); - } - - if (dragging) - { - int vcol = findColNoMinus(e->x() - drag_offset); - if (click_col >= 0) - { - htable->moveCol(click_col, vcol); // call - // Pstable::moveCol(int - // col, int place) - // should emit !! - // emit colMoved(click_col, vcol); - } - /// printf(" vcol2=%d \n",vcol); - } - dragging = false; - floatHead->hide(); - // vp->hide(); - } -} - -#include - -// TableBody: the table body, scrollable in all ways -TableBody::TableBody(HeadedTable *parent) : QtTableView(parent), htable(parent) -{ - - // setTableFlags(Tbl_autoScrollBars | Tbl_smoothScrolling); - setTableFlags(Tbl_snapToVGrid); // works - setTableFlags(Tbl_hScrollBar | Tbl_vScrollBar); - first_drag_row = prev_drag_row = -1; - autoscrolling = false; - gadget_click = false; - setMouseTracking(true); - - QStyle *s = QStyleFactory::create("windows"); - if (s) - setStyle(s); -} - -// virtual from QtTableView -void TableBody::scrollTrigger(int rx, int ry) -{ - if (ry == 0) - return; - int n = ry / cellHeight(); - /// printf("ry=%d n=%d\n",ry,n); - if (ry > 0) - tablecache.cutDown(n); // error? - else - tablecache.cutUp(-n); - // printf("ry=%d cellheight=%d n=%d\n",ry,cellHeight(),n); -} - -// new, possible COMMON? -bool TableBody::isCellChanged(int row, int col) -{ - QString str; - int xpos; - int fold, dep; - bool selected; - bool sorted; - int lc; - int width; - - { - str = htable->text(row, col); - xpos = htable->colXPos(col); - selected = htable->isSelected(row); - sorted = (htable->sortedCol() == col); - width = htable->max_widths[col]; - } - - // int left = leftCell(), top = topCell(); - CellAttribute *attr = tablecache.value(row - topCell(), col - leftCell()); - - if (attr == NULL) // never NULL - { - return true; - } - else - { - bool result = false; - if (attr->text == str and attr->selected == selected and - attr->sorted == sorted and attr->xpos == xpos and attr->w == width - // and attr->size==tmp_size - and - (attr->size.height() >= tmp_size.height()) - // and (attr->size.width()>=tmp_size.width()) - ) - { - result = false; - } - else - { - // attr->text=str; - // attr->selected=selected; - // attr->sorted=sorted; - // attr->xpos=xpos; - // attr->size=tmp_size; - // attr->w=width; - - // if (row==29 and col==0) - // printf("(%d %d) xpos=%d %d sorted=%d %d sel=%d - //%d str=%s - //%s\n",attr->size.height(),tmp_size.height(), - // attr->xpos,xpos,attr->sorted,sorted,attr->selected,selected - // ,qPrintable(attr->text),qPrintable(str)); - // printf("true (%d - //%d)\n",row-topCell(),col-leftCell()); - return true; - } - - if (col == 0) - { - dep = htable->rowDepth(row); // folding_level - fold = htable->folded(row); - lc = htable->lastChild(row); - - if (attr->depth == dep /* Uninitial*/ - and attr->folded == fold and attr->lastchild == lc) - { - // false - } - else - { - // attr->depth=dep; - // attr->folded=fold; - result = true; - // printf("true (%d - //%d)\n",row-topCell(),col-leftCell()); - } - } - return result; - } -} - -bool TableHead::isCellChanged(int row, int col) -{ - int xpos; - int ypos; - int w; - int fold, dep; - QString str; - bool sorted = (htable->sortedCol() == col); - - w = htable->max_widths[col]; - xpos = htable->colXPos(col); - - { - str = htable->title(col); - } - // int left = leftCell(); - // int top = topCell(); - CellAttribute *attr = tablecache.value(row - topCell(), col - leftCell()); - - if (attr == NULL) // Uninitialed? - { - return true; - } - else - { - bool result = false; - if (attr->text == str and attr->sorted == sorted and - attr->size == tmp_size and attr->xpos == xpos - // and attr->w==w - ) - { - return false; - } - else - { - attr->text = str; - attr->sorted = sorted; - attr->xpos = xpos; - // attr->w=w; - attr->size = tmp_size; - // if(head) printf("head - // true"); - return true; - } - // printf("return %s x=%d\n",str.toAscii().data(),xpos); - } -} - -#include - -// DRAFT CODE !! BOTTLENECK !!! -// Description : draw a cell of table -// 1. draw the background of a cell -// 2. draw the text of a cell -// -// called by -// 1.QtTableView::paintEvent() -void TableBody::paintCell(QPainter *p, int row, int col, bool use_cache) -{ - // *** sequence important !!! - // if(isCellChanged(row,col)==false) { - // if(use_cache==true) return; - //} - - CellAttribute *attr = - tablecache.value(row - topCell(), col - leftCell()); // save cache - // isCellChanged(row,col); - - bool sort; - int h = cellHeight(); - int w = htable->max_widths[col]; - attr->w = w; // - - QColor baseColor = palette().brush(QPalette::Base).color(); - sort = (col == htable->sorted_col); - attr->sorted = sort; - - // gridline - QColor lineColor, textColor; - QColor altColor = palette().brush(QPalette::AlternateBase).color(); - lineColor.setRgb((baseColor.red() * 0.5 + altColor.red() * 0.5), - (baseColor.green() * 0.4 + altColor.green() * 0.6), - (baseColor.blue() * 0.4 + altColor.blue() * 0.6)); - - // QStyleOption opt; - // opt.rect=QRect(0,0,w,h-1); - // opt.state = QStyle::State_Active; //? - // QStyle::SH_ItemView_PaintAlternatingRowColorsForEmptyArea - // const int gridHint = - // style()->styleHint(QStyle::SH_Table_GridLineColor, - // &opt, this); - - p->setPen(lineColor); - p->drawLine(0, h - 1, w, h - 1); - - // background - if (htable->isSelected(row)) - { - p->fillRect(0, 0, w, h - 1, palette().brush(QPalette::Highlight)); - p->setPen(palette().brush(QPalette::HighlightedText).color()); // text - attr->selected = true; - } - else - { - attr->selected = false; - if (sort) - { - p->fillRect(0, 0, w, h - 1, lineColor.dark(101)); - } - else - { - p->fillRect(0, 0, w, h - 1, baseColor); - } - // style()->drawPrimitive(QStyle::PE_FrameFocusRect, &opt, p, - // this); - p->setPen(palette().brush(QPalette::Text).color()); // text - } - - // tree gadget , treestep=height - int gap = h / 4; - int testFlag = 0; - if (col == 0 and htable->treemode == true) - { - QStyleOption opt; - int d = htable->rowDepth(row); - attr->depth = d; //** - int treestep = htable->treestep; - if (true /*lines*/) - { - /// int dx = folding ? gadget_space : 6; - for (int level = d, prow = row; level >= 0 and prow >= 0; - level--, prow = htable->parentRow(prow)) - { - if (level == d) - continue; - int x = gap + level * treestep; - QRect branchR(x, 0, treestep, h); - opt.rect = branchR; - - if (htable->lastChild(prow) == false) - { - if (testFlag) - { - p->drawLine(x + treestep / 2, 0, x + treestep / 2, h); - } - else - { - opt.state = QStyle::State_Sibling; // | vertical - // line - style()->drawPrimitive(QStyle::PE_IndicatorBranch, &opt, - p, this); - } - } - } - - QRect branchR(gap + d * treestep, 0, treestep, h); - opt.rect = branchR; - if (testFlag) - { - int x = gap + d * treestep + treestep / 2; - - p->drawLine(x, h / 2, x + treestep / 2, h / 2); - if (!htable->lastChild(row)) - { - p->drawLine(x, 0, x, h); - } - else - { - p->drawLine(x, 0, x, h / 2); - } - } - else - { - opt.state = QStyle::State_Item; //? - if (!htable->lastChild(row)) - opt.state = opt.state | QStyle::State_Sibling; // | - } - attr->lastchild = htable->lastChild(row); - } - - if (true /*folding*/) - { - HeadedTable::NodeState fs = htable->folded(row); - attr->folded = fs; //** - if (fs != HeadedTable::Leaf) - { - opt.state = opt.state | QStyle::State_Children; - if (fs != HeadedTable::Closed) - opt.state = opt.state | QStyle::State_Open; - } - p->save(); // temp , save pencolor - style()->drawPrimitive(QStyle::PE_IndicatorBranch, &opt, p, this); - p->restore(); - } - gap = htable->gadget_space + d * treestep + 1; - } - - // virtual int Pstable::alignment(int col) - if (htable->alignment_col[col] == Qt::AlignRight) // using cache - { - w -= gap; - gap = 0; - } - // Qt::IncludeTrailingSpaces - // p->drawText(gap, 0, w , h, Qt::TextIncludeTrailingSpace | - // Qt::IncludeTrailingSpaces | Qt::AlignVCenter | - // htable->alignment_col[col],htable->text(row,col)); - // p->drawText(gap, 0, w , h, Qt::TextIncludeTrailingSpace | - // Qt::AlignVCenter - // | htable->alignment_col[col],htable->text(row,col)); - p->drawText(gap, 0, w, h, Qt::AlignVCenter | htable->alignment_col[col], - htable->text(row, col)); - - htable->overpaintCell(p, row, col, gap); - - // cache write! - // attr->xpos=tmp_x ; - attr->text = htable->text(row, col); - attr->xpos = htable->colXPos(col); - attr->size = tmp_size; -} - -// DEL , Home key -void TableBody::jumpTop() { setYOffset(0); } - -// DEL, End Key -void TableBody::jumpBottom() { setYOffset(maxYOffset()); } - -/// !!!! -void TableBody::centerVertically(int row) -{ - int topcell = row - viewHeight() / (cellHeight() * 2); - setTopCell(qMax(topcell, 0)); - update(); -} - -//?? -void TableBody::showRange(int from, int to) -{ - int h = viewHeight() / cellHeight(); - if (to >= topCell() + h) - setTopCell(qMax(0, qMin(from, to - h + 1))); -} - -// virtual -// called by -// 1. -int TableBody::cellWidth(int col) { return htable->max_widths[col]; } - -// **** fix !! -void TableBody::updateRow(int row) -{ - // ?? - // for(int col = 0; col < htable->ncols; col++) - // updateCell(row, col,false); updateCell(row, col); -} - -void TableBody::mousePressEvent(QMouseEvent *e) -{ - if (numRows() == 0) - return; // *** prevent out of range - - // printf("mousePressEvent() 1\n"); - static int last_row = -1; - - int row = findRow(e->y()); - if (row == -1) - { - // printf("mousePressEvent\n"); - htable->clearAllSelections(); - if (e->y() >= 0) - row = numRows(); // if SHIFT+click outside ~ - first_drag_row = prev_drag_row = row; - return; - } - - if (!(htable->options & HTBL_ROW_SELECTION)) - return; - - if (e->button() == Qt::LeftButton) - { - // folding - if (htable->treemode && htable->folding && - e->x() < htable->gadget_space + - htable->treestep * htable->rowDepth(row) && - htable->folded(row) != HeadedTable::Leaf) - { - emit htable->foldSubTree(row); - gadget_click = true; - last_row = row; - // clearCache(); // dont use cache - return; - } - - if (e->modifiers() & Qt::ShiftModifier) - { - if (row < last_row) - for (int i = row; i < last_row; i++) - htable->setSelected(i, true); // virtual - else - for (int i = last_row; i <= row; i++) - htable->setSelected(i, true); // virtual - } - else if (e->modifiers() & Qt::ControlModifier) - { - htable->setSelected(row, !htable->isSelected(row)); - } - else - htable->selectOnlyOne(row); - - first_drag_row = prev_drag_row = row; - - emit htable->selectionChanged(); - } - - else if (e->button() == Qt::RightButton) - { - if (!htable->isSelected(row)) - htable->selectOnlyOne(row); - emit htable->selectionChanged(); - // better? emit htable->rightClicked(e->globalPos()); - } - last_row = row; - // htable->repaint_changed(); - repaintChanged(); // repaint - // view->update(); // fast but use more CPU -} - -void TableBody::mouseReleaseEvent(QMouseEvent *e) -{ - gadget_click = false; - - if (e->button() == Qt::LeftButton) - { - if (autoscrolling) - { - ////killTimers(); // no more autoscrolling - first_drag_row = prev_drag_row = -1; - autoscrolling = false; - } - } - else if (e->button() == Qt::RightButton) - { - QPoint p(6, 3); - p += e->globalPos(); - emit htable->rightClicked(p); - } -} - -void TableBody::mouseDoubleClickEvent(QMouseEvent *e) -{ - if (e->button() == Qt::LeftButton) - { - int row = findRow(e->y()); - if (row != -1) - { - if (htable->options & HTBL_ROW_SELECTION && - !htable->isSelected(row)) - htable->selectOnlyOne(row); - // htable->selectionNotify(); - emit htable->selectionChanged(); - // htable->emit_double_click_signal(row); - emit htable->doubleClicked(row); - } - } -} - -// Bottle Neck ? no -void TableBody::leaveEvent(QEvent *) { emit htable->outOfCell(); } - -void TableBody::mouseMoveEvent(QMouseEvent *e) -{ - if (numRows() == 0) - return; // *** prevent out of range - - // DRAFT CODE ! - // Signal : find row, col(field name) emit flyOnEvent Signal - int row = findRow(e->y()); - int col = findCol(e->x()); - - if (row < 0 or col < 0) - { - emit htable->outOfCell(); // if... - return; - } - - emit htable->flyOnCell(row, col); - - if (e->buttons() == Qt::NoButton) - return; - if (e->buttons() == Qt::RightButton) - return; - - if (e->buttons() & Qt::ControlModifier || gadget_click) - return; - - if (row != prev_drag_row) - { - if (row == -1) - { - if (!autoscrolling) - { - // dragging outside table, cause scrolling - scrolldir = (e->y() < 0) ? UP : DOWN; - // killTimers(); - // startTimer(scroll_delay); - autoscrolling = true; - } - } - else - { - ////killTimers(); - autoscrolling = false; - dragSelectTo(row); - } - } - // repaintRow(row); - // view->update(); - repaintChanged(); -} - -void TableBody::timerEvent(QTimerEvent *) -{ - // timer not proved ! - return; - // printf("timer\n"); - if (!autoscrolling) - return; - ////killTimers(); - if (scrolldir == UP) - { - int top = topCell(); - setTopCell((top > 1) ? top - 1 : 0); - dragSelectTo(topCell()); - } - else - { - setTopCell(topCell() + 1); - int bottom = lastRowVisible(); - dragSelectTo((bottom < numRows()) ? bottom : numRows() - 1); - } - startTimer(scroll_delay); -} - -// change drag selection point from previous drag position to row -void TableBody::dragSelectTo(int row) -{ - int dir = (row > prev_drag_row) ? 1 : -1; - if ((prev_drag_row - first_drag_row) * dir >= 0) - { - // moving away from start point - for (int i = prev_drag_row + dir; i - dir != row; i += dir) - htable->setSelected(i, true); - } - else - { - // moving towards start point - for (int i = prev_drag_row; i != row; i += dir) - htable->setSelected(i, false); - } - prev_drag_row = row; - // htable->selectionNotify(); - emit htable->selectionChanged(); -} - -// heuristic for determining a good XOR color: This is in general a hard -// problem but since we know (most of) the background and the foreground, -// we can try. Note that this function might not return an allocated QColor, -// so it is only useful for XOR drawing. - -QColor TableBody::getXorColor() -{ - QColor fg = palette().brush(QPalette::Base).color(); - - return fg; /// QColor(0, fg.pixel() ^ backgroundColor().pixel()); -} - -void TableBody::drawGhostCol(int x, int w) -{ - static QColor xorcol = getXorColor(); - - QPainter p(this); - - p.setPen(xorcol); - // p.setRasterOp(XorROP); - /// p.drawLine(x, 0, x, height()); - ////p.drawLine(x + w, 0, x + w, height()); -} - -// HeadedTable: the actually useable class -HeadedTable::HeadedTable(QWidget *parent, int opts) : QWidget(parent) -{ - // meaningless? - options = HTBL_ROW_CONTEXT_MENU | HTBL_ROW_SELECTION | - HTBL_ROW_DOUBLE_CLICK | HTBL_HEADING_TOOLTIPS | - HTBL_HEADING_CONTEXT_MENU | HTBL_HEADING_CLICK | - HTBL_REORDER_COLS; - - head = new TableHead(this); - body = new TableBody(this); - head->setObjectName("head"); - body->setObjectName("body"); - - sorted_col = -1; - treemode = false; - treestep = 0; - lines = true; - folding = true; - gadget_space = 0; - nrows = ncols = 0; // hmm... - - // printf("style name=%s \n",qPrintable(style()->objectName())); - // QApplication::setStyle(new QWindowsStyle); - head->setFrameShape(QFrame::NoFrame); - if (style()->objectName().contains("oxygen")) - ; - else - { - body->setFrameShape(QFrame::NoFrame); - } - - QVBoxLayout *vlayout = new QVBoxLayout; - vlayout->setSpacing(0); // distance between Widget and Widget - -#if QT_VERSION < 0x040300 - vlayout->setMargin(0); // qt-4.2 -#else - vlayout->setContentsMargins(0, 0, 0, 0); // qt-4.3 -#endif - - // vlayout->setSizeConstraint ( SizeConstraint ) - vlayout->addWidget(head); - vlayout->addWidget(body); - setLayout(vlayout); - - // connect keyboard shortcuts - QShortcut *c; - c = new QShortcut(Qt::CTRL + Qt::Key_A, this, SLOT(selectAll())); - // synchronize horizontal scrolling of head and body - connect(body->horizontalScrollBar(), SIGNAL(valueChanged(int)), head, - SLOT(scrollSideways(int))); - fontChange(font()); // *** need for init - // vp=new VPointer((QWidget *)QObject::parent()); - // vp->hide(); //memory leak!! -} - -HeadedTable::~HeadedTable() {} - -// ok : move to Qttableview -void HeadedTable::fontChange(const QFont &oldFont) -{ - // DEBUG("fontChange()\n"); - int fontHeight = fontMetrics().height() + 1; - // printf("cell height =%d \n", cellH); - if (fontHeight % 2 != 0) - fontHeight++; // for pretty fold-lines - head->setCellHeight(fontHeight + 5); - head->setMaximumHeight(head->cellHeight()); - body->setCellHeight(fontHeight); - treestep = fontHeight; - gadget_space = folding ? fontHeight + (fontHeight / 2) : 0; - // QWidget::fontChange ( oldFont ); -} - -// DRAFT virtual ! -void HeadedTable::moveCol(int col, int place) -{ - // go to void Procview::moveColumn(int col, int place) -} - -// distance (in table coords) from left table edge of physical column -int HeadedTable::colOffset(int col) -{ - int x = 0; - for (int c = 0; c < col; c++) - x += max_widths[c]; - // x += body->cellWidth(c); - return x; -} - -// OPTIZ -inline int HeadedTable::colXPos(int col) -{ - int x = 0; // + coloffset - for (int c = 0; c < col; c++) - x += max_widths[c]; - return x; -} - -// repaint columns from col0 to col1. If col1 is -1, repaint all -// the way to the right edge of the table. -// called by -// 1.void Qps::update_table(int col) -void HeadedTable::repaintColumns(int col0, int col1) -{ - QRect bvr = body->viewRect(); - QRect hvr = head->viewRect(); - int x0 = colOffset(col0) - body->xOffset(); - if (x0 > hvr.width()) - return; - if (x0 < 0) - x0 = 0; - bvr.setLeft(x0); - hvr.setLeft(x0); - if (col1 >= 0) - { - int x1 = colOffset(col1) + max_widths[col1] - body->xOffset(); - if (x1 < hvr.width()) - { - hvr.setRight(x1); - bvr.setRight(x1); - } - } - head->repaint(hvr); - body->repaint(bvr); -} - -// DEL -> virtual -// called by Pstable::setTreeMode(bool) -void HeadedTable::setTreeMode(bool tm) -{ - treemode = tm; - head->clearCache(); - body->clearCache(); -} - -// update table Head !! -void HeadedTable::setSortedCol(int col) -{ - { - int old_sorted = sorted_col; - sorted_col = col; - // printf("old_sorted=%d\n",old_sorted); - // printf("sorted_col=%d\n",sorted_col); - if (old_sorted != -1 && old_sorted < ncols) // ncols bug - updateHeading(old_sorted); - if (col != -1 && col < ncols) - updateHeading(col); - } -} - -// should be virtual. why? -void HeadedTable::clearAllSelections() -{ - for (int row = 0; row < nrows; row++) - setSelected(row, false); - body->view->update(); - // update(); // not work why? -} - -// BottleNeck ? -void HeadedTable::selectOnlyOne(int row) -{ - // this apply to the current list only! - for (int r = 0; r < nrows; r++) - setSelected(r, r == row); -} - -void HeadedTable::selectAll() -{ - for (int r = 0; r < nrows; r++) - setSelected(r, true); - emit selectionChanged(); // notwork? -} - -// default implementation returns a null string (no tip d) -QString HeadedTable::tipText(int) { return ""; } -char *HeadedTable::total_selectedRow(int col) { return 0; } - -void HeadedTable::setNumRows(int rows) -{ - nrows = rows; - head->setNumRows(1); - body->setNumRows(rows); -} - -void TableCache::setRow(int row) -{ - if (row < 0) - return; - - int i, size = rows.size(); - if (row >= size) - { - // rows.append(new TableRow); - } - - if (row < nrow) - { - // printf("row=%d,nrow=%d \n",row,nrow); - if (size < nrow) - nrow = size; - for (i = row; i < nrow; i++) - { - for (int j = 0; j < 48; j++) - rows[i]->cells[j].text = ""; - } - } - nrow = row; -} - -void TableCache::setCol(int col) -{ - if (col < 0) - return; - if (col < ncol) - { - // printf("clear cache\n"); - int i, size = rows.size(); - for (i = 0; i < size; i++) - for (int j = col; j < ncol; j++) - rows[i]->cells[j].text = ""; - } - ncol = col; -} - -// TEST -void TableHead::checkProfile() -{ - QRect viewR = viewRect(); - // if(viewR.y()!=0) printf(" qps: ooooohss....\n"); - int maxViewCol = findCol(viewR.width()); - if (maxViewCol < 0) - maxViewCol = numCols(); - tablecache.setCol(maxViewCol); - tablecache.setRow(1); -} - -// TESt -void TableBody::checkProfile() -{ - htable->checkTableModel(); // important - - QRect viewR = viewRect(); - if (viewR.y() != 0) - printf(" qps: ooooophss....\n"); - int maxViewRow = findRow(viewR.height()); - if (maxViewRow < 0) - maxViewRow = numRows(); - int maxViewCol = findCol(viewR.width()); - if (maxViewCol < 0) - maxViewCol = numCols(); - tablecache.setCol(maxViewCol); - tablecache.setRow(maxViewRow); -} - -void HeadedTable::setNumCols(int cols) -{ - // printf("cols=%d\n",cols); - - ncols = cols; - // resetWidths(); - for (int i = 0; i < cols; i++) - { - alignment_col[i] = alignment(i); - updateColWidth(i); - } - // printf("ncols=%d\n",ncols); - head->setNumCols(ncols); - body->setNumCols(ncols); -} - -/* -//virtual -int HeadedTable::colWidth(int col) -{ - int r = numRows(); - for(int i=0;i w) - w = sw; - } - - if (treecol) - { - w += gadget_space; - } - } - // don't forget the width of the heading - hw = fontMetrics().width(title(col)) + 12; - // return 0; - if (hw > w) - w = hw; - - // sw=fontmetric.width("0") * colWidth(col); - // if(sw>w) w=sw; - - max_widths[col] = w; - return 0; -} - -void HeadedTable::resetWidths() -{ - for (int i = 0; i < numCols() + 1; i++) - max_widths[i] = 0; -} - -// called by ? -void HeadedTable::repaintAll() // -> repaint() -{ - int count = 0, trow = 0; - for (int row = 0; row < nrows; row++) - if (isSelected(row)) - { - count++; - trow = row; - } - // body->view->update(); - // update(); // not work why? - - // printf("Qps debug: repaintAll()\n"); - // head->clearCache(); - // body->clearCache(); - // update(); - body->view->update(); - head->view->update(); - if (count == 1) - centerVertically(trow); -} - -// PROBLEM : update() + repaint() call = draw twice !!! -// called by pstable::refresh() -// DEL if (render_area smaller than full_arear ) then force draw -void HeadedTable::repaint_changed() -{ - // printf("repaint_changed()\n"); - // body->setUpdatesEnabled(true); - head->repaintChanged(); - body->repaintChanged(); -} - -void HeadedTable::hideEvent(QHideEvent *event) {} - -void HeadedTable::paintEvent(QPaintEvent *e) -{ - static int c = 0; - // printf("HeadedTable paintEvent %d\n",c++); //works ? - // QWidget::paintEvent(e); - // body->clearCache(); - // head->update(); -} - -void HeadedTable::showEvent(QShowEvent *) -{ - // printf("HeadedTable showEvent\n"); // works - // before paintEvent call - head->clearCache(); - body->clearCache(); -} - -void HeadedTable::resizeEvent(QResizeEvent *e) -{ - // DEBUG("resizeEvent() HeadedTable %d\n",head->cellHeight()); - //// head->repaintRow(0); - QWidget::resizeEvent(e); - head->clearCache(); - body->clearCache(); -} diff --git a/src/htable.h b/src/htable.h deleted file mode 100644 index 2a2d358..0000000 --- a/src/htable.h +++ /dev/null @@ -1,379 +0,0 @@ -/* - * htable.h - * - * Copyright 1997-1999 Mattias Engdegård - * This file is part of qps -- Qt-based visual process status monitor - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -// This file defines the HeadedTable class. -// A HeadedTable is a QTableView with one line of headers over each column. - -#ifndef HTABLE_H -#define HTABLE_H - -#include "qttableview.h" - -#ifndef USING_PCH -#include -#include -#include -#endif - -// table options (bits to be ORed together) -#define HTBL_ROW_SELECTION 1 // rows are selectable -#define HTBL_ROW_DOUBLE_CLICK 2 // rows can be double-clicked -#define HTBL_ROW_CONTEXT_MENU 4 // right button menu on rows -#define HTBL_HEADING_TOOLTIPS 8 // tooltips on headings -#define HTBL_HEADING_CONTEXT_MENU 16 // right button menu on headings -#define HTBL_HEADING_CLICK 32 // able to click on heading (change sort order) -#define HTBL_REORDER_COLS 64 // able to reorder columns - -class HeadedTable; - -class CellAttribute -{ - public: - QString text; - bool selected; - bool sorted; - QSize size; - QColor backColor; // table share - QColor foreColor; // rows share - int xpos; // cols share - int ypos; // rows share - int w; // cols share - int depth; // rows share - int folded; // - int lastchild; // - CellAttribute() - { - text = ""; - sorted = selected = false; - xpos = -1, ypos = -1, w = 0, depth = -1, folded = -1; - lastchild = 0; - } -}; - -struct TableRow -{ - public: - CellAttribute cells[64]; // enough -}; - -class TableCache -{ - int nrow, ncol; - QList rows; - - public: - TableCache() - { - // for(int i=0;i<1;i++) // tmp - rows.append(new TableRow); - nrow = 0; - ncol = 0; - } - - void reset() {} // clear cache - void setSize(int row, int col); - void setRow(int row); - void setCol(int col); - - CellAttribute *value(int row, int col) - { - if (row < 0) - qFatal("Qps: Error ! TableCache() under size !! row=%d \n", row); - - if (row >= rows.size()) - { - row = rows.size(); - rows.append(new TableRow); - } - // if(row<0 or row>rows.size()) - return &(rows[row]->cells[col]); - } - - void cutUp(int n) - { - for (int i = 0; i < n; i++) - { - rows.append(rows.takeFirst()); - } - } - void cutDown(int n) - { - for (int i = 0; i < n; i++) - { - TableRow *row = rows.takeLast(); - rows.prepend(row); - } - } -}; - -class VPointer : public QWidget -{ - Q_OBJECT - public: - VPointer(QWidget *parent); - QPixmap *pix; - QPixmap *pix_vcross; - void setMovable(bool b) { flag_movable = b; } - bool flag_movable; - protected slots: - // void event_cursor_moved(QMouseEvent *e); - protected: - // virtual void drawButton 3( QPainter * ) ; - virtual void paintEvent(QPaintEvent *event); - // void resizeEvent(QResizeEvent *p); -}; - -class FloatingHead : public QWidget -{ - Q_OBJECT - public: - FloatingHead(QWidget *parent); - QPixmap *pix; - void setTitle(QString str, int w, int h); - QString title; - protected slots: - protected: - virtual void paintEvent(QPaintEvent *event); -}; - -class TableHead : public QtTableView -{ - Q_OBJECT - public: - TableCache tablecache; - TableHead(HeadedTable *parent = 0); - virtual bool isCellChanged(int row, int col); - virtual void checkProfile(); - - protected slots: - void scrollSideways(int); - - protected: - virtual void paintCell(QPainter *p, int row, int col, bool update); - virtual int cellWidth(int col); - virtual void mousePressEvent(QMouseEvent *e); - virtual void mouseReleaseEvent(QMouseEvent *e); - virtual void mouseMoveEvent(QMouseEvent *e); - virtual void eraseRight(QPainter *, QRect &r); - - virtual void dragEnterEvent(QDragEnterEvent *event); - virtual void dragLeaveEvent(QDragLeaveEvent *event); - - FloatingHead *floatHead; - - HeadedTable *htable; // to access parent class - QPoint press; - int click_col; // physical column clicked in - bool dragging; - int drag_pos; // previous dragging position - int drag_offset; -signals: - void rightClicked(QPoint where, int col); - void toolTip(QPoint where, int col); - - friend class HeadedTable; -}; - -class TableBody : public QtTableView -{ - Q_OBJECT - public: - TableCache tablecache; - TableBody(HeadedTable *parent = 0); - void drawGhostCol(int x, int w); - // int zerowidth; // width of the digit 0 - - virtual bool isCellChanged(int row, int col); - virtual void checkProfile(); - protected slots: - // for keyboard accelerators - void jumpTop(); - void jumpBottom(); - void centerVertically(int row); - void showRange(int from, int to); - - protected: - virtual void scrollTrigger(int x, int y); // tmp - - virtual void paintCell(QPainter *p, int row, int col, bool forced); - virtual int cellWidth(int col); - void mousePressEvent(QMouseEvent *e); - void mouseDoubleClickEvent(QMouseEvent *e); - void mouseMoveEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *); - void leaveEvent(QEvent *); - - void timerEvent(QTimerEvent *); - void updateRow(int row); - void dragSelectTo(int row); - QColor getXorColor(); - HeadedTable *htable; // to access parent class - int first_drag_row; // row where drag started - int prev_drag_row; // row where drag was at last event - bool autoscrolling; // true if we are autoscrolling right now - enum - { - UP, - DOWN - } scrolldir; - static const int scroll_delay = 10; // time delay when autoscrolling, in ms - bool gadget_click; // whether mouse press was on folding gadget - private: - QColor background; - QColor color_text; - friend class HeadedTable; -}; - -class HeadedTable : public QWidget -{ - Q_OBJECT - public: - HeadedTable(QWidget *parent, int opts = 0); - ~HeadedTable(); - TableHead *header() { return head; } // interface - - TableHead *head; - TableBody *body; - - CellAttribute *attr; // DEL temporarily buffer - enum NodeState - { - Leaf, - Open, - Closed - }; - - void repaint_changed(); - int updateColWidth(int col); - - void resetWidths(); - void resetWidth(int col) { max_widths[col] = -1; } // dont use ? - void setProxy(QWidget *w) { body->setFocusProxy(w); } - void setSortedCol(int col); - int sortedCol() { return sorted_col; } - int numRows() { return nrows; } - int numCols() { return ncols; } - void setNumRows(int rows); - void setNumCols(int cols); - int clickedColumn() { return head->click_col; } - void deleteCol(int col, bool update = true); - int leftCell() { return body->leftCell(); }; - int lastColVisible() { return body->lastColVisible(); }; - int topCell() { return body->topCell(); }; - int lastRowVisible() { return body->lastRowVisible(); }; - void updateCell(int row, int col, bool erase = false); - void updateHeading(int col){/* head->updateCell(0, col); */}; - void setAutoUpdate(bool update) - { - head->setAutoUpdate(update); - body->setAutoUpdate(update); - }; - void centerVertically(int row) { body->centerVertically(row); }; - void showRange(int from, int to) { body->showRange(from, to); }; - void repaintColumns(int col0, int col1 = -1); - void setTreeMode(bool tm); - bool treeMode() { return treemode; }; - int tableWidth() const - { - return body->totalWidth() + body->verticalScrollBar()->width(); - } - - void selectOnlyOne(int row); - int numSelected() { return 0; } - void clearAllSelections(); - - virtual void setSelected(int row, bool sel){}; - virtual bool isSelected(int row) { return false; } - virtual void checkTableModel(){}; -signals: - void titleClicked(int col); - void selectionChanged(); - void doubleClicked(int row); - void rightClicked(QPoint where); - void foldSubTree(int row); - void colMoved(int col, int place); - void flyOnCell(int row, int col); - void flyOnHCell(int col); - void outOfCell(); - void outOfHCell(); - - public slots: - void selectAll(); - void repaintAll(); - - protected: - void fontChange(const QFont &oldFont); - // These must be implemented in subclasses - virtual QString title(int col) = 0; - virtual QString text(int row, int col) = 0; - virtual char *total_selectedRow(int col); - // colWidth returns width in digit units; negative means variable width. - virtual int colWidth(int col) = 0; // head_width - virtual int alignment(int col) { return 0; } - virtual int sizeHintForColumn(int col) const { return -1; } - virtual void paintEvent(QPaintEvent *); - virtual void hideEvent(QHideEvent *event); - virtual void showEvent(QShowEvent *event); - - // may be reimplemented (default exists) - virtual void moveCol(int col, int place); - - virtual QString tipText(int col); - virtual int rowDepth(int row) { return 0; }; - virtual NodeState folded(int row) { return Leaf; }; - virtual int parentRow(int row) { return 0; }; - virtual bool lastChild(int row) { return false; }; - virtual bool columnMovable(int col) { return true; }; - // virtual bool modified(int row){return true;}; - virtual void overpaintCell(QPainter *p, int row, int col, int xpos){}; - - void resizeEvent(QResizeEvent *); - - bool treemode; - int treestep; // indentation for each tree level - - private: - inline int computedWidth(int col); - int colOffset(int col); - inline int colXPos(int col); - void updateCols(int deltacols, int place, bool update); - - int alignment_col[64]; - int headwidth_col[64]; - int max_widths[64]; // row widths, indexed by columns - // Svec widths; // row widths, indexed by columns - - int sorted_col; // column to emphasize - int reversed_sort; // true if sorting backwards - int options; - int nrows; - int ncols; - - // text cache is in logical columns (reorder causes no flush) - bool folding; // true if folding gadgets are used - bool lines; // true if tree lines are drawn - int gadget_space; // horizontal space for show/hide tree gadget - - friend class TableHead; - friend class TableBody; -}; -#endif // HTABLE_H diff --git a/src/htable2.cpp b/src/htable2.cpp deleted file mode 100644 index b2c4768..0000000 --- a/src/htable2.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/* - * htable2.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 2014 dae hyun, yang - * Copyright 2015 Paulo Lieuthier - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include "htable2.h" -HtableModel::HtableModel(QObject *parent) : QAbstractItemModel(parent) -{ - htable = (HeadedTable2 *)parent; -} - -QModelIndex HtableModel::index(int row, int column, - const QModelIndex &parent) const -{ - // printf("index %d %d\n",row,column); - if (row >= 0 and column >= 0 and row < htable->nrows) - { - // if( column <2) - { - // watchCond *item=watchlist[row]; - return createIndex(row, column, NULL); - } - } - return QModelIndex(); -} - -// Pure Virtual -QModelIndex HtableModel::parent(const QModelIndex &child) const -{ - int row, col; - row = child.row(); - col = child.column(); - if (row >= 0 and col >= 0 and row < htable->nrows) - return createIndex(htable->parentRow(row), col, NULL); - return QModelIndex(); // no parent! -} - -// return chilren count -int HtableModel::rowCount(const QModelIndex &parent) const -{ - return htable->nrows; -} -// why segfault? -int HtableModel::columnCount(const QModelIndex &parent) const -{ - return htable->ncols; -}; - -QVariant HtableModel::headerData(int section, Qt::Orientation orientation, - int role) const -{ - - // printf("headerData\n"); - if (role == Qt::DisplayRole) - { - return htable->title(section); - } - else - - if (role == Qt::TextAlignmentRole) - return htable->alignment(section); - // return Qt::AlignCenter; - else if (role == Qt::ToolTipRole) - return htable->tipText(section); - else - /* - if (role == Qt::FontRole) - { - QFont f=QFont(); - f.setBold(false); - return f; - } */ - if (role == Qt::SizeHintRole) - { - // return QSize(18,18); - } - return QVariant(); -} - -QVariant HtableModel::data(const QModelIndex &index, int role) const -{ - // printf("data\n"); - // watchCond *item= - // static_cast(index.internalPointer()); - if (role == Qt::DisplayRole) - { - return htable->text(index.row(), index.column()); - } - else if (role == Qt::DecorationRole) - { - } - if (role == Qt::EditRole) - { - } - if (role == Qt::CheckStateRole) - { - // if(item->enable) - // return Qt::Checked; - // else - // return Qt::Unchecked; - } - if (role == Qt::TextAlignmentRole) - return Qt::AlignRight; - if (role == Qt::EditRole) - { - } - if (role == Qt::SizeHintRole) - { - // return QSize(18,18); - } - return QVariant(); -} - -Qt::ItemFlags HtableModel::flags(const QModelIndex &index) const -{ - return Qt::ItemIsEnabled | Qt::ItemIsSelectable; -} - -// HtableHeader ////////////////////////// - -HtableHeader::HtableHeader(QWidget *parent) - : QHeaderView(Qt::Horizontal, parent) -{ - htable = (HeadedTable2 *)parent; - setMovable(true); -} - -void HtableHeader::mousePressEvent(QMouseEvent *e) -{ - QHeaderView::mousePressEvent(e); - int col = logicalIndexAt(e->pos()); - // printf("col=%d\n",col); - if (e->button() == Qt::RightButton) - { - // printf("pressed col=%d\n",col); //ok - emit rightClicked(e->globalPos(), col); - return; - } -} - -HeadedTable2::HeadedTable2(QWidget *parent, int opts) : QTreeView(parent) -// :QTreeWidget(parent) -{ - nrows = ncols = 0; - model = new HtableModel(this); - HtableHeader *header = new HtableHeader(this); - setHeader(header); - setModel(model); - // setEditTriggers (QAbstractItemView::SelectedClicked ); - // tableView->setItemDelegateForColumn(1,&delegate); - // tableView->setItemDelegate(&delegate); - setSelectionBehavior(QAbstractItemView::SelectRows); - setSelectionMode(QAbstractItemView::SingleSelection); - // setSelectionMode (QAbstractItemView::ExtendedSelection); - // setSelectionMode (QAbstractItemView::MultiSelection); - - setUniformRowHeights(true); - setAllColumnsShowFocus(true); - setFrameShape(QFrame::NoFrame); - setAlternatingRowColors(true); - - // v->setResizeMode (0,QHeaderView::Stretch); - // QHeaderView *h=header (); - header->setResizeMode( - QHeaderView::ResizeToContents); // use sizeHintForColumn() - header->setClickable(true); - // header->setVisible(false); -} - -void HeadedTable2::setTreeMode(bool mode) {} - -void HeadedTable2::setSortedCol(int c) {} - -void HeadedTable2::setNumCols(int c) { ncols = c; } -void HeadedTable2::setNumRows(int row) { nrows = row; } -void HeadedTable2::selectAll() {} -void HeadedTable2::repaintAll() {} -void HeadedTable2::repaint_changed() {} - -extern int flag_x; -void HeadedTable2::mousePressEvent(QMouseEvent *e) -{ - printf("mousePressEvent() \n"); - QTreeView::mousePressEvent(e); - // falg_x=1; - flag_x = !flag_x; - if (e->button() == Qt::RightButton) - { - emit rightClicked(e->globalPos()); - return; - } -} - -// TEST & DRAFT: loop .. -void HeadedTable2::modelIterate(const QModelIndex &parent) -{ - int rows = model->rowCount(parent); - // printf("rows=%d\n",rows); - // expand(parent); - setExpanded(parent, true); // expand(ci); - for (int i = 0; i < rows; i++) - { - QModelIndex ci = model->index(i, 0, parent); - // Procinfo *pi= static_cast(ci.internalPointer()); - // if(!pi->hidekids)// setExpanded(ci,true); // - // expand(ci); - // if(!pi->hidekids and !isExpanded(ci)) expand(ci); - // if(!folded(ci) and !isExpanded(ci)) expand(ci); - // if(!folded(ci) and !isExpanded(ci)) - - if (model->rowCount(ci) > 0) - modelIterate(ci); - } -} diff --git a/src/htable2.h b/src/htable2.h deleted file mode 100644 index c111a71..0000000 --- a/src/htable2.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - * htable2.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 2014 dae hyun, yang - * Copyright 2015 Paulo Lieuthier - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include -#include -#include -#include -#include - -class HeadedTable2; -class CellAttribute2 -{ - public: - QString text; - bool selected; - bool sorted; - - QColor backColor; // table share - QColor foreColor; // rows share - int xpos; // cols share - int ypos; // rows share - int w; // cols share - int depth; // rows share - int folded; // -}; - -class HtableModel : public QAbstractItemModel -// class HtableModel : public QAbstractTableModel -{ - Q_OBJECT - public: - HtableModel(QObject *parent = 0); - ~HtableModel(){}; - virtual QModelIndex - index(int row, int column, - const QModelIndex &parent = QModelIndex()) const; // pure - virtual QModelIndex parent(const QModelIndex &child) const; // pure virtual - virtual int rowCount(const QModelIndex &parent) const; - virtual QVariant data(const QModelIndex &index, int role) const; - int columnCount(const QModelIndex &parent) const; - QVariant headerData(int section, Qt::Orientation o, int role) const; - virtual Qt::ItemFlags flags(const QModelIndex &index) const; - // Qt::ItemFlags flags(const QModelIndex &index) const; - // QMap itemData ( const QModelIndex & index ) const - //; - // void update(){ reset();} - void update() { emit layoutChanged(); } - // void update(const QModelIndex &idx); - // void update(int row); - // void update(); //TEMP - HeadedTable2 *htable; -}; - -class HtableHeader : public QHeaderView -// QHeaderView ( Qt::Orientation orientation, QWidget * parent = 0 ) -{ - Q_OBJECT - public: - HtableHeader(QWidget *parent = 0); - ~HtableHeader(){}; - - protected: - virtual void mousePressEvent(QMouseEvent *e); -signals: - void rightClicked(QPoint where, int col); - void toolTip(QPoint where, int col); - - private: - HeadedTable2 *htable; -}; - -class HeadedTable2 : public QTreeView -// class HeadedTable2 : public QTreeWidget -{ - Q_OBJECT - public: - HeadedTable2(QWidget *parent, int opts = 0); - ~HeadedTable2(){}; - - friend class HtableModel; - HtableModel *model; - - enum NodeState - { - Leaf, - Open, - Closed - }; - void repaint_changed(); - int clickedColumn() { return 0; }; // need imp - int sortedCol() { return sorted_col; } // ok - - /* - void deleteCol(int col, bool update = TRUE); - void topAndRepaint(); - int lastRowVisible() { return body->lastRowVisible(); }; - void updateCell(int row, int col, bool erase=false); - void updateHeading(int col) { }; - void selectionNotify(); - void repaintColumns(int col0, int col1 = -1); - bool treeMode() { return treemode; }; - int tableWidth() const { return body->totalWidth()+ - body->verticalScrollBar()->width(); } - bool isCellContentsChanged(int row,int col,bool head); - - - void selectOnly(int row); - void clearAllSelections(); - */ - - int numRows() { return nrows; } - int numCols() { return ncols; } - int numSelected() { return 0; } - void setTreeMode(bool mode); - void setSortedCol(int col); - void setNumRows(int rows); - void setNumCols(int cols); - virtual bool isSelected(int row) { return false; } - virtual void setSelected(int row, bool sel){}; - void modelIterate(const QModelIndex &idx); -signals: - void titleClicked(int col); - void doubleClicked(int row); - void rightClicked(QPoint where); - void foldSubTree(int row); - void colMoved(int col, int place); - - public slots: - void selectAll(); - void repaintAll(); - - protected: - virtual void mousePressEvent(QMouseEvent *e); - virtual int rowDepth(int row) { return 0; }; - virtual NodeState folded(int row) { return Leaf; }; - virtual bool folded(QModelIndex &idx) { return false; }; - virtual int parentRow(int row) { return 0; }; - virtual bool lastChild(int row) { return false; }; - virtual bool columnMovable(int col) { return true; }; - virtual int colWidth(int col) = 0; // head_width - virtual void moveCol(int col, int place){}; - virtual QString title(int col) = 0; - virtual QString text(int row, int col) = 0; - - virtual QString tipText(int col) { return ""; }; - virtual int alignment(int col) { return 0; }; - - /* - virtual char *total_selectedRow(int col); - virtual int sizeHintForColumn(int col) const; - virtual void hideEvent ( QHideEvent * event ); - virtual void showEvent ( QShowEvent * event ); - virtual void resizeEvent(QResizeEvent *); - */ - // colWidth returns width in digit units; negative means variable width. - - // virtual void drawCellContents(int row, int col, int w, int - // h, - // QPainter *painter); - // virtual bool modified(int row){return true;}; - bool treemode; - - private: - // to make signals originate from the right object - /* void emit_click_signal(int col); - void emit_double_click_signal(int row); - void emit_right_click_signal(QPoint where); - void emit_fold(int row); - - inline int computedWidth(int col); - int colOffset(int col); - inline int colXPos(int col); - void updateCols(int deltacols, int place, bool update); - */ - int sorted_col; // column to emphasize - int reversed_sort; // true if sorting backwards - int options; - - int nrows; - int ncols; - - // text cache is in logical columns (reorder causes no flush) - QHash - cached_attr; // indexed by (row << 16) + log_col - QHash - cached_attr_h; // indexed by (row << 16) + log_col -}; diff --git a/src/infobar.cpp b/src/infobar.cpp deleted file mode 100644 index aba3b4b..0000000 --- a/src/infobar.cpp +++ /dev/null @@ -1,1380 +0,0 @@ -/* - * infobar.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include -#include -#include - -#include "infobar.h" -#include "proc.h" -#include "qps.h" -#include "misc.h" -#include - -extern ControlBar *controlbar; -extern TFrame *infobox; // testing -extern Qps *qps; // testing - -int history_start_idx = 0; // testing - -float cpu_total = 0; -float cpu_idle = 0; -float cpu_used = 0; - -QMenu *m_popup; -subcpuRack *cpubar = 0; // DEL extra CPU_window - -// ============================ -gwidget *x_cpu; -gwidget *x_mem; -gwidget *x_swap; -gwidget *x_utime; -gwidget *x_load_avg; - -class VCursor -{ - public: - int px; - int py; - int idx; - bool enable; -}; -VCursor vcursor; - -// DEL -void Infobar::hideEvent(QHideEvent *event) -{ - // printf("Infobar::hideEvent()\n"); - // cpubar->hide(); -} - -// return true if the swap meter is redlined -bool Infobar::swaplim_exceeded() -{ - /* - if(Qps::swaplim_percent) { - if(procview->swap_total > 0) { - int free_p = 100 * procview->swap_free / - procview->swap_total; - return free_p < Qps::swaplimit; - } else - return false; - } else { - return procview->swap_free < Qps::swaplimit; - } */ - return false; -} - -char rotate_str[] = "|/-\\|/-\\"; -int rotate_idx = 0; -char rotate_char = '|'; - -// who call ? -// DEL -void Infobar::refresh() -{ - QString s; - - if (rotate_str[++rotate_idx] == 0) - rotate_idx = 0; - rotate_char = rotate_str[rotate_idx]; - - if (Qps::show_load_graph) - update(); -} - -// DEL -// public : add point,, update Pixmap(graph) -// called by Qps::refresh() -void Infobar::update_load() -{ - // add_history_point2(cpu_used); - // NEED SOLUTION!!!!!!!! draw graph before exposed - if (isVisible()) - drawGraphOnPixmap(); - // MouseCurosrCheck -} - -void Infobar::drawGraphOnPixmap() -{ - // if(isVisible()==false) return; - if (size() != pixmap.size()) - { - /// printf("icon_pm changed!!\n"); - pixmap = QPixmap(size()); // resize(w, h); - pixmap.setMask(QBitmap()); // clear the mask for drawing - } - - QPainter p(&pixmap); - p.fillRect(rect(), QBrush(Qt::black)); // p.fill(Qt::black); - - for (int i = 0; i < wlist.size(); i++) - wlist[i]->draw(&p); - - make_graph(width(), height(), &p); -} - -// if p, then show A and hide B; otherwise do the opposite -// DEL? -void Infobar::showup() -{ - // if(cpubar->isVisible()) cpubar->raise(); -} - -// DEL? -void Infobar::show_and_hide(bool p, QWidget *a, QWidget *b) -{ - if (!p) - { - QWidget *c = a; - a = b; - b = c; - } - if (!a->isVisible()) - { - b->hide(); - a->show(); - } -} - -#define TOTAL_BAR 30 -QColor total_color; -QColor part1_color; -QColor part2_color; -QColor part3_color; -// DRAFT CODE : DRAFT CODE !! -// return width -int drawSPECTRUM(QPainter *p, int x, int y, const char *name, int total, - int part1, int part2 = 0, int part3 = 0, int h = 0) -{ - int total_width; - // bluelay 0,180,255 - // Move to Infor::Inforbar() - total_color.setRgb(0, 65, 55); - part1_color.setRgb(0, 255, 210); - part2_color.setRgb(0, 185, 150); - part3_color.setRgb(0, 160, 120); - - int i, w; - int tx, ty, bar_xoffset, bar_h; - int bar; - - char buff[32] = "NO"; - - if (total == 0) - { - name = strcat(buff, name); - } - - if (h == 0) - h = pf_char_height(); - - w = 2 + pf_write(p, x + 2, y + 2, name) + 3; - bar_xoffset = x + w; - - if (total == 0) - return w; //** - - // draw total_dark_null line - bar_h = h - 1; - ty = y + 2; - tx = 0; - p->setPen(total_color); - for (i = 0; i < TOTAL_BAR; i++) - { - p->drawLine(bar_xoffset + tx, ty, bar_xoffset + tx, ty + bar_h); - tx++; - tx++; - } - total_width = w + tx; - - if (total == 0) - total = 1; - tx = 0; - // draw part1 - p->setPen(part1_color); - bar = part1 * TOTAL_BAR / total; - if (bar == 0 and part1 != 0) - bar = 1; - for (i = 0; i < bar; i++) - { - p->drawLine(bar_xoffset + tx, ty, bar_xoffset + tx, ty + bar_h); - tx += 2; - // tx++; - } - - if (part2 >= 0) - { - p->setPen(part2_color); - bar = part2 * TOTAL_BAR / total; - if (bar == 0 and part2 != 0) - bar = 1; - for (i = 0; i < bar; i++) - { - p->drawLine(bar_xoffset + tx, ty, bar_xoffset + tx, ty + bar_h); - tx += 2; - // tx++; - } - } - if (part3 >= 0) - { - p->setPen(part3_color); - bar = part3 * (TOTAL_BAR) / total; - for (i = 0; i < bar; i++) - { - p->drawLine(bar_xoffset + tx, ty, bar_xoffset + tx, ty + bar_h); - tx += 2; - } - } - // this occured by reporter. - // if(tx>TOTAL_BAR*2 ) printf("Error: %s total =%d, part1=%d, part2=%d - // part3=%d\n",name,total,part1,part2,part3); - return total_width; -} - -int drawSPECTRUM2(QPainter *p, int x, int y, char *name, int total, int part1, - int part2 = 0, int part3 = 0, int bar_h = 9, - int bar_w = TOTAL_BAR) -{ - // Notice: - // total=1, part1=1 occurs - - int total_width; - // bluelay 0,180,255 - // Move to Infor::Inforbar() - total_color.setRgb(0, 67, 75); // dark - part1_color.setRgb(0, 255, 210); - part2_color.setRgb(0, 220, 175); - part3_color.setRgb(0, 180, 150); - - int i, w; - int tx, ty, bar_xoffset; - int bar; - - char buff[32] = "NO"; - - if (total == 0) - { - // printf("total=0\n") ; //occur - name = strcat(buff, name); - } - - w = 2 + pf_write(p, x + 2, y + 2, name) + 2; - bar_xoffset = x + w; - - if (total == 0) - return w; //** - - // draw total_dark_null line - bar_h = bar_h - 1; // if(h==0) h=pf_char_height(); //9 - - ty = y + 2; - tx = 0; - // draw Total_dark_bar - p->setPen(total_color); - for (i = 0; i < bar_w; i++) - { - p->drawLine(bar_xoffset + tx, ty, bar_xoffset + tx, ty + bar_h); - tx += 2; - } - total_width = w + tx; - - if (total == 0) - total = 1; // safer divide error. - - tx = 0; - // draw part1 - p->setPen(part1_color); - bar = part1 * bar_w / total; - if (bar == 0 and part1 != 0) - bar = 1; - for (i = 0; i < bar; i++) - { - p->drawLine(bar_xoffset + tx, ty, bar_xoffset + tx, ty + bar_h); - tx += 2; - // tx++; - } - - if (part2 >= 0) - { - p->setPen(part2_color); - bar = part2 * bar_w / total; - if (bar == 0 and part2 != 0) - bar = 1; - for (i = 0; i < bar; i++) - { - p->drawLine(bar_xoffset + tx, ty, bar_xoffset + tx, ty + bar_h); - tx += 2; - // tx++; - } - } - if (part3 >= 0) - { - p->setPen(part3_color); - bar = part3 * (bar_w) / total; - for (i = 0; i < bar; i++) - { - p->drawLine(bar_xoffset + tx, ty, bar_xoffset + tx, ty + bar_h); - tx += 2; - } - } - // this occured by reporter. - if (tx > TOTAL_BAR * 2) - { - printf("Error: TOTAL_BAR*2=%d, name= %s total =%d, part1=%d, " - "part2=%d " - "part3=%d\n", - TOTAL_BAR * 2, name, total, part1, part2, part3); - return -1; - } - // if(part1<0){ printf("total=%d part1=%d - // part2=%d\n",total,part1,part2); - // return -1;} - // printf("%s total =%d, part1=%d, part2=%d - // part3=%d\n",name,total,part1,part2,part3); - return total_width; -} - -char str_buff[512]; -#define TIMEDIFF(kind) \ - procview->cpu_times(cpu_id, Proc::kind) - \ - procview->old_cpu_times(cpu_id, Proc::kind) -class w_cpu : public gwidget -{ - private: - int cpu_n; - long total, user, system, idle, nice, wait; - - public: - virtual void draw(QPainter *p) - { - x = 0; - char buff[32]; - int cpu_id; - int cpu_n; - int gheight = 10; - int w; - int mw; - - user = 0, system = 0, idle = 0, nice = 0, wait = 0; - - cpu_n = procview->num_cpus; - - width = 0; - - // if(cpubar->isVisible() and cpu_n>3) - if (true) - { - // show Total CPU - cpu_id = cpu_n; - user = TIMEDIFF(CPUTIME_USER); -#ifdef LINUX - nice = TIMEDIFF(CPUTIME_NICE); -#endif - system = TIMEDIFF(CPUTIME_SYSTEM); -#ifdef SOLARIS - wait = TIMEDIFF(CPUTIME_WAIT); -#endif - idle = TIMEDIFF(CPUTIME_IDLE); - total = user + system + wait + nice + idle; - width = drawSPECTRUM(p, 0, 0, "CPU", total, user, system, nice, - gheight - 1); - // width+=5; - } - - for (cpu_id = 0; cpu_id < cpu_n; cpu_id++) - { - - // if(procview->num_cpus == procview->old_num_cpus) - user = TIMEDIFF(CPUTIME_USER); - idle = TIMEDIFF(CPUTIME_IDLE); - system = TIMEDIFF(CPUTIME_SYSTEM); -#ifdef LINUX - nice = TIMEDIFF(CPUTIME_NICE); -#endif -#ifdef SOLARIS - wait = TIMEDIFF(CPUTIME_WAIT); -#endif - -#ifdef LINUX - total = user + system + nice + idle; -#endif -#ifdef SOLARIS - total = user + system + wait + idle; -#endif - - if (cpu_n > 1 and cpu_n < 129) // 9~16 - { - int bar_w = 0; - if (cpu_n <= 2) - bar_w = TOTAL_BAR; // default - else if (cpu_n < 9) - bar_w = TOTAL_BAR / 2; - else // if(cpu_n<17) - bar_w = TOTAL_BAR / 3; - // else bar_w=13; - - int r, c; - c = cpu_id / 2; - r = cpu_id % 2; - sprintf(buff, "%d", cpu_id); - mw = 4 * 3 + (bar_w * 2 + 8 * 2 - 1) * c; - if (c >= 1) - mw -= 6; - if (c >= 2) - mw -= 6; - - if (0) - { - printf("cpuid %d , user %d , %d \n", 1, - procview->cpu_times(1, Proc::CPUTIME_USER), - procview->old_cpu_times(0, Proc::CPUTIME_USER)); - } - -#ifdef LINUX - int z = drawSPECTRUM2(p, mw, gheight + 1 + r * (gheight - 1), - buff, total, user, system, nice, - gheight - 2, bar_w); -#endif - -#ifdef SOLARIS - int z = drawSPECTRUM2(p, mw, gheight + 1 + r * (gheight - 1), - buff, total, user, system, wait, - gheight - 2, bar_w); -// drawSPECTRUM(p,0,cpu_id*10,buff,total,user,system,wait); -#endif - } - } - p->fillRect(0, gheight + 2, 50 + mw + 100, gheight * 4, - QColor(0, 0, 0, 130)); - height = gheight * 1; - } - - virtual char *info() - { - char str[80]; - float f_user, f_nice, f_system, f_wait; - - f_user = (float)user / total * 100; - f_nice = (float)nice / total * 100; - f_wait = (float)wait / total * 100; - f_system = (float)system / total * 100; -#ifdef LINUX - sprintf(str_buff, "user: %1.1f%% system:%1.1f%% nice:%1.1f%% ", - f_user, f_system, f_nice); -#endif - -#ifdef SOLARIS - sprintf(str_buff, "user: %1.1f%% system:%1.1f%% nice:%1.1f%% ", - f_user, f_system, f_wait); -#endif - return str_buff; - }; -}; - -class w_mem : public gwidget -{ - private: - int used; - - public: - virtual void draw(QPainter *p) - { - height = pf_char_height() + 4; - x = x_cpu->xpluswidth() + 10; -#ifdef LINUX - used = procview->mem_total - procview->mem_free - - procview->mem_buffers - procview->mem_cached; - width = drawSPECTRUM(p, x, 0, "MEM", procview->mem_total, used, - procview->mem_cached, procview->mem_buffers); -#endif - -#ifdef SOLARIS - used = procview->mem_total - procview->mem_free; - width = drawSPECTRUM(p, x, 0, "MEM", procview->mem_total, used); -#endif - } - virtual char *info() - { - char str[80]; - - strcpy(str_buff, "Total: "); - mem_string(procview->mem_total, str); - strcat(str_buff, str); - - strcat(str_buff, " used: "); - mem_string(used, str); - strcat(str_buff, str); - -#ifdef LINUX - strcat(str_buff, " cached: "); - mem_string(procview->mem_cached, str); - strcat(str_buff, str); - strcat(str_buff, " buffer: "); - mem_string(procview->mem_buffers, str); - strcat(str_buff, str); -#endif - - // sprintf(str_buff,"Total: %dKb , cache: %dKb , buffer: - //%dKb", - // procview->mem_total,procview->mem_cached,procview->mem_buffers); - return str_buff; - }; -}; - -class w_swap : public gwidget -{ - private: - int used; - - public: - virtual void draw(QPainter *p) - { - x = x_mem->xpluswidth() + 10; - used = procview->swap_total - procview->swap_free; - width = drawSPECTRUM(p, x, 0, "SWAP", procview->swap_total, used); - height = pf_char_height() + 4; - } - virtual char *info() - { - char str[80]; - - strcpy(str_buff, "Total: "); - mem_string(procview->swap_total, str); - strcat(str_buff, str); - strcat(str_buff, " Free: "); - mem_string(procview->swap_free, str); - strcat(str_buff, str); - strcat(str_buff, " Used: "); - mem_string(used, str); - strcat(str_buff, str); - - // sprintf(str_buff,"Total: %d Kbyte , used %d Kbyte", - // procview->swap_total,procview->swap_free); - return str_buff; - }; -}; - -// DRAFT CODE !! -int drawUTIME(QPainter *p, int x, int y, long boot_time) -{ - char buff[1024]; - // printf("size of long=%d, size of time_t=%d - // \n",sizeof(long),sizeof(time_t)); - long u = (long)time(NULL) - (long)boot_time; - int up_days = u / (3600 * 24); - u %= (3600 * 24); - int up_hrs = u / 3600; - u %= 3600; - int up_mins = u / 60; - int sec = u % 60; - if (up_days == 0) - { - if (up_hrs == 0) - sprintf(buff, "UPTIME %d:%02d", up_mins, sec); - else - sprintf(buff, "UPTIME %d:%02d:%02d", up_hrs, up_mins, sec); - } - else - sprintf(buff, "UPTIME %dDAY%s,%d:%02d:%02d", up_days, - (up_days == 1) ? "" : "s", up_hrs, up_mins, sec); - return pf_write(p, x, y, buff); -} - -class w_utime : public gwidget -{ - public: - virtual void draw(QPainter *p) - { - height = pf_char_height() + 4; - x = x_swap->xpluswidth() + 10; - width = drawUTIME(p, x, 2, procview->boot_time); - } - virtual const char *info() { return "passed time after system booting"; }; -}; - -class w_load_avg : public gwidget -{ - virtual void draw(QPainter *p) - { - char buff[64]; - // printf("w_load_avg\n"); - // sprintf(buff,"QPS %3.02f%%", Procinfo::loadQps); - sprintf(buff, " 1m:%1.02f 5m:%1.02f 15m:%1.02f", procview->loadavg[0], - procview->loadavg[1], procview->loadavg[2]); - - width = pf_str_width(buff); - - x = parent->width() - width - 6; - - int w = x_utime->xpluswidth() + 15; - if (x < w) - x = w; - - pf_write(p, x, 2, buff); - - // - x = parent->width() - 8; - y = parent->height() - 9; - - char str[2] = {0, 0}; - str[0] = rotate_char; - pf_write(p, x, y, str); - } - virtual const char *info() - { - return "Average CPU%% each 1, 5 ,15 minutes"; - }; -}; - -GraphBase::GraphBase(QWidget *parent, Procview *pv) -{ - procview = pv; - // setCursor ( QCursor(Qt::CrossCursor) ) ; - npoints = 0, peak = 0, h_index = 0, dirty = true; - official_height = 39; - - hist_size = 1280; - history = new float[hist_size]; - - setMinimumHeight(24); - - QWidget::setMouseTracking(true); -} - -IO_Graph::IO_Graph(QWidget *parent, Procview *pv) : GraphBase(parent, pv) -{ - setMinimumHeight(22); -} - -void GraphBase::make_graph(int w, int h, QPainter *p) -{ - float ratio = h; - - int hsize = procview->history.size(); - int start = hsize - w; - - if (start < 0) - start = 0; - - QPolygon pa(hsize - start); // QVector pa(npts); - - int idx = 0; - for (int i = start; i < procview->history.size(); i++, idx++) - { - SysHistory *hist = procview->history[i]; - // printf("[%d] hist =%f\n",i,hist->load_cpu); - pa[idx] = QPoint(idx, h - 1 - (int)(hist->load_cpu * ratio)); - } - - if (h == official_height) - { - history_start_idx = start; // for MousePointer!! - npoints = idx; // printf("x npoints=%d \n",npoints); - } - - // draw scale lines - p->setPen(QColor(0, 210, 100)); // p.setPen(QColor(0,70,54)); - p->drawPolyline(pa); - - dirty = false; -} - -void IO_Graph::make_graph(int w, int h, QPainter *p) -{ - // p->fillRect(0,0,w,h,QBrush(Qt::black)); - // p->fill(Qt::black); - float ratio = 1.3; // test - - int hsize = procview->history.size(); - int start = hsize - w; - - if (start < 0) - start = 0; - - p->setPen(QColor(80, 90, 254)); // BLUE color - - int idx = 0; - for (int i = start; i < procview->history.size(); i++, idx++) - { - SysHistory *hist = procview->history[i]; - // printf("[%d] hist =%f\n",i,hist->load_cpu); - p->drawLine(idx, h - 1, idx, h - 1 - (int)(hist->load_io * ratio)); - } - - // if(h==official_height) // jump not init!!! - { - history_start_idx = start; // for MousePointer!! - npoints = idx; // printf("x npoints=%d \n",npoints); - } -} - -void GraphBase::drawGraphOnPixmap() -{ - // - if (rotate_str[++rotate_idx] == 0) - rotate_idx = 0; - rotate_char = rotate_str[rotate_idx]; - - // if(isVisible()==false) return; - if (size() != pixmap.size()) - { - /// printf("icon_pm changed!!\n"); - pixmap = QPixmap(size()); // resize(w, h); - pixmap.setMask(QBitmap()); // clear the mask for drawing - } - - QPainter p(&pixmap); - p.fillRect(rect(), QBrush(Qt::black)); // p.fill(Qt::black); - - make_graph(width(), height(), &p); -} - -// DRAFT CODE !!! -void Infobar::paintEvent(QPaintEvent *e) -{ - // printf("Infobar()::paintEvent\n"); - QRect ur = e->rect(); // update rectangle - QPainter p(this); - - // full re-draw! by update(); ??? - // if( ur.width()==width() and ur.height()==height() ) - { - /// drawGraphOnPixmap(); - } - - p.drawPixmap(ur, pixmap, ur); - - return; - // drww VCursor - if (vcursor.enable) - { - int px = vcursor.px; - /// p.setPen(QColor(80,195,80)); - /// p.drawLine (px,0,px,height()); - } -} - -void GraphBase::paintEvent(QPaintEvent *e) -{ - QRect ur = e->rect(); // update rectangle - QPainter p(this); - - // full re-draw! by update(); - if (ur.width() == width() and ur.height() == height()) - { - drawGraphOnPixmap(); - } - - p.drawPixmap(ur, pixmap, ur); - - return; - - // if(vcursor.enable); - // ------- Cursor testing --------- - p.setPen(QColor(250, 159, 5)); - int rel_x = x(); - p.drawLine(vcursor.px - rel_x, 0, vcursor.px - rel_x, height()); -} - -/* DEL -void IO_Graph::paintEvent ( QPaintEvent *e ) -{ - GraphBase::paintEvent (e); -} */ - -// TODO: 1.sort 2. time(?) -QString doHistory(SysHistory *sysh) -{ - QString str; - int max = 0; - - char buf[128]; - // sprintf(buf,"miniHistory /* %.02f%%",sysh->load_cpu*100); - sprintf(buf, "miniHistory CPU"); - str += QString::fromLatin1(buf); - - // void linearize_tree(QVector *ps, int level, int prow, - // bool - // hide) - // qsort(ps->data(), ps->size(), sizeof(Procinfo *),(compare_func) - // compare_backwards); - - for (const auto *p : qAsConst(sysh->procs)) - { - if (p->pcpu == 0) - continue; - sprintf(buf, " (%.01f%%)", p->pcpu); - str += "\n" + p->command + QString::fromLatin1(buf); - } - - return str; -} - -// TODO: name change! -QString GraphBase::doHistoryTXT(SysHistory *sysh) -{ - QString str; - int max = 0; - - char buf[128]; - // sprintf(buf,"miniHistory /* %.02f%%",sysh->load_cpu*100); - sprintf(buf, "%%CPU miniHistory test"); - str += QString::fromLatin1(buf); - for (const auto *p : qAsConst(sysh->procs)) - { - if (p->pcpu == 0) - continue; - sprintf(buf, " (%.02f%%)", p->pcpu); - str += "\n" + p->command + QString::fromLatin1(buf); - } - return str; -} - -void GraphBase::mouseMoveEvent(QMouseEvent *e) -{ - int x = 0, y = 0; - int half_height = height() / 2; - int dy; - int gap; - - px = e->pos().x(); // x in Infobar - py = e->pos().y(); // y in Infobar - - dy = py - half_height; // - dy /= 2; - - // printf("px=%d py=%d y=%d h=%d , dy=%d\n",px,py,y,height(),dy); - // gap=infobox->width() + px - width(); - - int i; - int setinfo = 0; - - // printf("procview npoints=%d px=%d\n",npoints,px); - QString text; - int idx = px + history_start_idx; - // if(pxhistory.size() and idx >= 0) - { - // printf("procview idx=%d px=%d\n",idx,px); - text += doHistoryTXT(procview->history[idx]); - } - else - { - // text ="xxx"; - } - - if (setinfo == 0) - infobox->setText(text); - - QPoint p = mapTo(qps, e->pos()); //?? - - // infobox->move(a.x()+16,a.y()+4); - // infobox->setPos(p.x()+16,p.y()+4); - infobox->setPos(); - - // PROBLEM : leaving old vcursor ... - vcursor.px = p.x(); - vcursor.py = p.y(); - int rel_x = GraphBase::x(); - update(p.x() - 5 - rel_x, 0, p.x() + 5 - rel_x, - height()); // only Vcursor update -} - -// TODO: 1.sort 2. time -QString IO_Graph::doHistoryTXT(SysHistory *sysh) -{ - QString str; - int max = 0; - - char buf[64], mem_str[64]; - // sprintf(buf,"miniHistory /* %.02f%%",sysh->load_cpu*100); - sprintf(buf, "miniHistory IO"); - str += QString::fromLatin1(buf); - - for (const auto *p : qAsConst(sysh->procs)) - { - if (p->io_read_KBps == 0 and p->io_write_KBps == 0) - continue; - buf[0] = 0; - - str += "\n" + p->command; - // str+="\n"+ p->command + QString::fromLatin1(buf); - str += " ("; - - if (p->io_read_KBps) - { - mem_string_k(p->io_read_KBps, mem_str); - sprintf(buf, "%s/s read", mem_str); - str += QString::fromLatin1(buf); - } - - if (p->io_write_KBps) - { - mem_string_k(p->io_write_KBps, mem_str); - sprintf(buf, " %s/s write", mem_str); - str += QString::fromLatin1(buf); - } - str += ")"; - } - return str; -} - -void GraphBase::leaveEvent(QEvent *) { infobox->hide(); } - -/* -void IO_Graph::mouseMoveEvent ( QMouseEvent *e ) { - GraphBase::mouseMoveEvent(e); -} */ - -void GraphBase::mousePressEvent(QMouseEvent *e) {} - -Infobar::Infobar(QWidget *parent, Procview *pv) : QFrame(parent) -{ - procview = pv; - official_height = 32; - - // setCursor ( QCursor(Qt::CrossCursor) ) ; - { - npoints = 0, peak = 0, h_index = 0, dirty = true; // - - hist_size = 1280; - history = new float[hist_size]; - - // setBackgroundRole (QPalette::WindowText); - setAutoFillBackground(false); - ////check setAttribute(Qt::WA_OpaquePaintEvent); - // setFrameShape(QFrame::Panel); - setFrameShadow(QFrame::Sunken); - setMinimumHeight(official_height); - // setSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Fixed); - // setStyleSheet("QFrame { background-color: yellow }"); - x_cpu = new w_cpu(); - x_cpu->setParent(this, pv); - x_mem = new w_mem(); - x_mem->setParent(this, pv); - x_swap = new w_swap(); - x_swap->setParent(this, pv); - x_utime = new w_utime(); - x_utime->setParent(this, pv); - x_load_avg = new w_load_avg(); - x_load_avg->setParent(this, pv); - - wlist.append(x_cpu); - wlist.append(x_mem); - wlist.append(x_swap); - wlist.append(x_utime); - wlist.append(x_load_avg); - - QWidget::setMouseTracking(true); - } // - - int i = 0; - // is_vertical = Qps::vertical_cpu_bar; //DEL - - // cpubar=new subcpuRack(parent,pv); - - /* m_popup = new QMenu("popup",this); - QAction *act=new QAction("Under Development",this); - act->setDisabled(true); - m_popup->addAction(act); - */ -} - -Infobar::~Infobar() { delete[] history; } - -// a System's Info bar -Infobar2::Infobar2(QWidget *parent, Procview *pv) -{ - // procview=pv; //*** - official_height = 35; - // setAutoFillBackground ( false ); - // setAttribute(Qt::WA_OpaquePaintEvent); - // setFrameShape(QFrame::Panel); - setFrameShadow(QFrame::Sunken); - // setMinimumHeight(official_height); - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - - // if(layout()) delete layout(); - - QBoxLayout *layout = new QHBoxLayout(); - - setLayout(layout); - - layout->setSpacing(1); // betweeen gap - layout->setMargin(0); - - // BasicInfo *basic=new BasicInfo(this,pv); - // layout->addWidget(basic); - - QVBoxLayout *vlayout = new QVBoxLayout(); - vlayout->setSpacing(1); // betweeen gap - vlayout->setMargin(0); - - layout->addLayout(vlayout); - // layout->setContentsMargins (1,1,1,1); - // layout->setContentsMargins ( int left, int top, int right, int bottom - // ); - - // GraphBase *gp=new GraphBase(this,pv); // %CPU - basic = new Infobar(this, pv); - vlayout->addWidget(basic); - - // IO_Graph - io_graph = new IO_Graph(this, pv); // %IO - vlayout->addWidget(io_graph); - // basic-hide(); - // io_graph->hide(); - m_popup = new QMenu("popup", this); - QAction *act = new QAction("Under Development", this); - act->setDisabled(true); - m_popup->addAction(act); -} - -void Infobar2::updatePixmap() -{ - // NEED SOLUTION!!!!!!!! draw graph before exposed? - if (isVisible()) - { - basic->drawGraphOnPixmap(); - io_graph->drawGraphOnPixmap(); - } -} - -// old style : relative method -// add value to the history, updating peak. -// USING -void Infobar::add_history_point(unsigned int value) -{ - // simul circular buffer - history[h_index++] = value; // float - if (h_index >= hist_size) - h_index = 0; - if (npoints < hist_size) - npoints++; -} - -// BACKUP: add value to the history, updating peak. -void Infobar::add_history_point2(float value) -{ - static float v[3] = {0, 0, 0}; - static float last_val = 0; - - float f; - f = last_val - value; - // if (f > 0) - // value+=f/1.15; // slow up ,slow down - // else - value += f / 1.5; // slow up ,slow down - history[h_index++] = value; - if (h_index >= hist_size) - h_index = 0; - if (npoints < hist_size) - npoints++; - if (value > peak) - peak = value; - else - { - peak = 0; // no negative values - for (int i = 0; i < npoints; i++) - if (history[i] > peak) - peak = history[i]; - } - // printf("hist_size=%d h_index=%d val=%f\n",hist_size,h_index,value); - - last_val = value; -} - -// return updated pixmap for use as an icon -QPixmap *Infobar::make_icon(int w, int h) -{ - if (w != icon_pm.width() or h != icon_pm.height()) - { - /// printf("icon_pm changed!!!!!!!!!!!!!!!!!!11\n"); - icon_pm = QPixmap(w, h); // pm.resize(w, h); - icon_pm.setMask(QBitmap()); // remove the mask for drawing - } - QPainter pt(&icon_pm); - pt.fillRect(0, 0, w, h, QBrush(Qt::black)); - - if (0) - { - /* int thick=h/10; - int bottom=h/4; - - pt.setClipRect(); - pt.translate(); */ - } - - make_graph(w, h, &pt, true); - return &icon_pm; -} - -void Infobar::mousePressEvent(QMouseEvent *e) -{ - emit clicked(); - if (e->button() == Qt::LeftButton) - { - vcursor.enable = true; - return; - } - - if (e->button() == Qt::RightButton) - m_popup->popup(e->globalPos()); -} - -// only works if mouse cursor in this area -void Infobar::mouseMoveEvent(QMouseEvent *e) -{ - int x = 0, y = 0; - int half_height = height() / 2; - int dy; - int gap; - - px = e->pos().x(); // x in Infobar - py = e->pos().y(); // y in Infobar - - dy = py - half_height; // - dy /= 2; - - // printf("px=%d py=%d y=%d h=%d , dy=%d\n",px,py,y,height(),dy); - // gap=infobox->width() + px - width(); - - int i; - int setinfo = 0; - for (i = 0; i < wlist.size(); i++) - if (wlist[i]->intersect(px, py)) - { - setinfo = 1; - infobox->setText(wlist[i]->info()); - break; - } - - // printf("procview npoints=%d px=%d\n",npoints,px); - QString text; - int idx = px + history_start_idx; - // if(pxhistory.size() and idx >= 0) - { - // printf("procview idx=%d px=%d\n",idx,px); - text += doHistory(procview->history[idx]); - } - else - { - text = ""; - } - - if (setinfo == 0) - infobox->setText(text); - - QPoint p = mapTo(qps, e->pos()); //?? - - // infobox->move(a.x()+16,a.y()+4); - // infobox->setPos(p.x()+16,p.y()+4); - infobox->setPos(); - - // vcursor.px=p.x(); - // update(p.x()-5,0,p.x()+5,height()); -} - -void Infobar::enterEvent(QEvent *) -{ - // infobox->hide(); -} - -void Infobar::leaveEvent(QEvent *) -{ - - infobox->hide(); - - return; - /* - if(controlbar and controlbar->isHidden()) - { - // controlbar->show(); - setMinimumHeight(official_height); - } */ -} - -// DRAFT CODE -// draw the load graph on the internal pixmap, if needed -// called by -// 1.make_icon(int w, int h) -// 2.paintEvent() -// 3.update_load() -void Infobar::make_graph(int w, int h, QPainter *p, bool test) -{ - // QPainter p(this); - // p.setBackgroundMode (Qt::OpaqueMode); - // p.setBackground(QBrush(Qt::black)); - // p->fillRect(0,0,w,h,QBrush(Qt::black)); - // p->fill(Qt::black); - float ratio = h; - int idx = 0; - - if (h == official_height) // tmp - { - ratio = h - 11; - } - - int hsize = procview->history.size(); - int start = hsize - w; - - if (start < 0) - start = 0; - p->setPen(QColor(0, 210, 100)); // p.setPen(QColor(0,70,54)); - - if (test == false) - { - QPolygon pa(hsize - start); // QVector pa(npts); - // QPolygon point_array_io(hsize-start); - - for (int i = start; i < procview->history.size(); i++, idx++) - { - SysHistory *hist = procview->history[i]; - // printf("[%d] hist =%f\n",i,hist->load_cpu); - pa[idx] = QPoint(idx, h - 1 - (int)(hist->load_cpu * ratio)); - /// point_array_io[idx] = QPoint(idx, h - 1 - - ///(int)(hist->load_io * - /// ratio)); - } - // p->setPen(QColor(100,100,250)); - ////p.setPen(QColor(0,70,54)); - // p->drawPolyline(point_array_io); - - // draw scale lines - p->drawPolyline(pa); - } - else - { - int idx = 0; - for (int i = start; i < procview->history.size(); i++, idx++) - { - SysHistory *hist = procview->history[i]; - p->drawLine(idx, h - 1, idx, h - 1 - (int)(hist->load_cpu * ratio)); - } - } - - // if(h==official_height) - { - history_start_idx = start; // for MousePointer!! - npoints = idx; // printf("x npoints=%d \n",npoints); - } - - dirty = false; -} - -void Infobar::resizeEvent(QResizeEvent *e) -{ - // static int first=0; if(first==0){ drawPixmap(); first=1;} - drawGraphOnPixmap(); -} -subcpuRack::subcpuRack(QWidget *p, Procview *pv) : QWidget(p) -{ - parent = p; - procview = pv; - // setWindowFlags(Qt::FramelessWindowHint | Qt::ToolTip); - // setWindowFlags(Qt::FramelessWindowHint |Qt::Tool ); - setAttribute(Qt::WA_OpaquePaintEvent); - QPalette pal; - pal.setColor(QPalette::Window, QColor(0, 0, 0)); - setPalette(pal); - QWidget::setMouseTracking(true); - setMinimumHeight(12); -} - -void subcpuRack::refresh() {} - -void subcpuRack::mousePressEvent(QMouseEvent *e) -{ - m_popup->popup(e->globalPos()); - // hide(); -} - -// DRAFT CODE !!! -void subcpuRack::paintEvent(QPaintEvent *e) -{ - - // static QPaint *p=// QPainter *p=new QPainter(this); - QPainter p(this); - char buff[128]; - int w; - int width; - int x, y; - int i; - // QRect cr = contentsRect(); - // QRect cr = p->viewport(); - QRect cr = p.window(); // rect. - - p.fillRect(rect(), QBrush(Qt::black)); - - // p->setPen(lineColor); - p.setPen(QColor(50, 50, 50)); - p.drawLine(0, 0, QWidget::width(), 0); - // p.fillRect(cr,QBrush(QColor(255,255,255,50))); - - unsigned long total = 0, user = 0, system = 0, idle = 0, nice = 0, wait = 0; - // if(procview->num_cpus>=4) // temporaly... - // else - int cpu_n = procview->num_cpus; - w = 2 + pf_write(&p, 2, 2, "SUB CPU"); - width = w; -} - -// GraphDisplay, miniDisplay - -PDisplay::PDisplay(QWidget *parent) : QWidget(parent) -{ - QVBoxLayout *vlayout = new QVBoxLayout; - vlayout->setMargin(0); - vlayout->setSpacing(1); - setLayout(vlayout); - - // return; - // ** setBackgroundColor(color); ** - QPalette pal; - pal = palette(); - setAutoFillBackground(true); - // setBackgroundRole (QPalette::WindowText); - pal.setColor(backgroundRole(), QColor(80, 80, 80)); - // palette.setColor(QPalette::Window, QColor(0,0,100)); - setPalette(pal); -} -// a BAR in a RACK -// - -Infobar2 *PDisplay::addSystem(Procview *pv) -{ - // Infobar* bar= new Infobar(this,pv); - Infobar2 *bar2 = new Infobar2(this, pv); - layout()->addWidget(bar2); - - /// pv->read_system(); // - - if (0 and pv->num_cpus > 9) - { - QWidget *rack; - rack = new subcpuRack(this, pv); - layout()->addWidget(rack); - } - return bar2; //->basic; -} diff --git a/src/infobar.h b/src/infobar.h deleted file mode 100644 index 102b80d..0000000 --- a/src/infobar.h +++ /dev/null @@ -1,232 +0,0 @@ -/* - * infobar.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef INFOBAR_H -#define INFOBAR_H - -#include "proc.h" - -#ifndef USING_PCH -#include -#include -#include -#include -#include -#include -#endif - -class subcpuRack : public QWidget -{ - Q_OBJECT - public: - subcpuRack(QWidget *parent, Procview *p); - void refresh(); - // void update_load(); - // void show_and_hide(bool, QWidget *, QWidget *); - // signals: void config_change(); - protected: - void paintEvent(QPaintEvent *); - void mousePressEvent(QMouseEvent *); - - private: - // List wlist; - QWidget *parent; - Procview *procview; // temp - bool is_vertical; -}; - -class gwidget -{ - public: - gwidget() { x = 0, y = 0, width = 0, height = 0; }; - gwidget(QWidget *p) { parent = p; }; - virtual void draw(QPainter *p) { printf("gwidget\n"); }; - virtual void setPosition(int parent_width, int parent_height){}; - virtual const char *info() { return NULL; }; - void setParent(QWidget *p, Procview *procv) - { - parent = p; - procview = procv; - }; - void resize(int x_, int y_, int w, int h) - { - x = x_; - y = y_; - width = w; - height = h; - }; - bool intersect(int cx, int cy) - { - cx = cx - x; - cy = cy - y; - if (cx > 0 and cx < width) - if (cy > 0 and cy < height) - return true; - return false; - } - - int xpluswidth() { return x + width; }; - Procview *procview; // temp - - protected: - int x; - int y; - int width; - int height; - QRect rect; - QWidget *parent; -}; - -class Infobar : public QFrame -{ - Q_OBJECT - public: - Infobar(){}; - - Infobar(QWidget *parent, Procview *); - ~Infobar(); - - void configure(); // respond to configuration change - - QPixmap *make_icon(int w, int h); - // DEL QPixmap *load_icon(int w, int h) { return make_icon(w, h); } - void refresh(); // update(); - void update_load(); - void drawGraphOnPixmap(); - bool swaplim_exceeded(); - void show_and_hide(bool, QWidget *, QWidget *); - void showup(); -signals: - void clicked(); - void config_change(); - - protected: - void paintEvent(QPaintEvent *); - void mousePressEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); - void leaveEvent(QEvent *); - virtual void enterEvent(QEvent *event); - void hideEvent(QHideEvent *event); - void resizeEvent(QResizeEvent *e); - - void add_history_point(unsigned value); - void add_history_point2(float value); - void make_graph(int w, int h, QPainter *p, bool test = false); - Procview *procview; - - private: - // history points are stored in fixed point, scaled by history_scale - static const unsigned int history_scale = 256; - static const int time_dist = 60; // time between vertical lines (seconds) - - QList wlist; - int hist_size; // history buffer size DEL - int npoints; // nr of history points currently remembered - float *history; // (circular) history buffer DEL - int h_index; // next history index to use - float peak; // largest value in history - - bool dirty; // history changed since pixmap was drawn - QPixmap pixmap; - QPixmap icon_pm; - - int px, py; // pointer position - - bool is_vertical; - int official_height; -}; - -class GraphBase : public QWidget -{ - Q_OBJECT - public: - GraphBase(QWidget *parent, Procview *); - void drawGraphOnPixmap(); - - protected: - void paintEvent(QPaintEvent *); - virtual void mousePressEvent(QMouseEvent *); - virtual void mouseMoveEvent(QMouseEvent *); - virtual void leaveEvent(QEvent *); - // virtual void enterEvent ( QEvent * event ) ; - // void resizeEvent ( QResizeEvent * e ); - - virtual void make_graph(int w, int h, QPainter *p); - virtual QString doHistoryTXT(SysHistory *sysh); - - Procview *procview; - int official_height; - int npoints; // nr of history points currently remembered - private: - // history points are stored in fixed point, scaled by history_scale - static const unsigned int history_scale = 256; - - int hist_size; // history buffer size DEL - float *history; // (circular) history buffer DEL - int h_index; // next history index to use - float peak; // largest value in history - - bool dirty; // history changed since pixmap was drawn - QPixmap pixmap; - QPixmap icon_pm; - - int px, py; // pointer position -}; - -class IO_Graph : public GraphBase -{ - Q_OBJECT - public: - IO_Graph(QWidget *parent, Procview *); - - protected: - void make_graph(int w, int h, QPainter *p); - QString doHistoryTXT(SysHistory *sysh); - - private: -}; - -// class Infobar2 : public Infobar -class Infobar2 : public QFrame -{ - Q_OBJECT - public: - Infobar2(QWidget *parent, Procview *); - void updatePixmap(); // TEMP - QPixmap *load_icon(int w, int h) { return basic->make_icon(w, h); } - void refresh(); // update(); - Infobar *basic; - IO_Graph *io_graph; - - private: - int official_height; -}; - -class PDisplay : public QWidget -{ - Q_OBJECT - public: - PDisplay(QWidget *parent); - Infobar2 *addSystem(Procview *p); -}; - -#endif // INFOBAR_H diff --git a/src/listmodel.cpp b/src/listmodel.cpp deleted file mode 100644 index 986846b..0000000 --- a/src/listmodel.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - * listmodel.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include "listmodel.h" -#include "watchcond.h" - -extern QList watchlist; - -QModelIndex ListModel::index(int row, int column, - const QModelIndex &parent) const -{ - // printf("index %d %d\n",row,column); - if (row >= 0 and column >= 0 and row < watchlist.size()) - { - if (column < 2) - { - watchCond *item = watchlist[row]; - return createIndex(row, column, item); - } - } - return QModelIndex(); -} - -void ListModel::update(int row) -{ - emit dataChanged(index(row, 0), index(row, 1)); -} - -void ListModel::update(const QModelIndex &idx) { emit dataChanged(idx, idx); } - -// Pure Virtual -QModelIndex ListModel::parent(const QModelIndex &child) const -{ - return QModelIndex(); // no parent! -} -int ListModel::rowCount(const QModelIndex &parent) const -{ - return watchlist.size(); -} -QVariant ListModel::headerData(int section, Qt::Orientation orientation, - int role) const -{ - // printf("headerData\n"); - if (role == Qt::DisplayRole) - { - if (section == 0) - return QString(tr( "Event Category" ) ); - if (section == 1) - return QString( tr( "Enable" ) ); - } - /* - if (role == Qt::FontRole) - { - QFont f=QFont(); - f.setBold(false); - return f; - } */ - if (role == Qt::SizeHintRole) - { - // return QSize(18,18); - } - return QVariant(); -} - -QVariant ListModel::data(const QModelIndex &index, int role) const -{ - // printf("data\n"); - watchCond *item = static_cast(index.internalPointer()); - if (index.column() == 0) - { - if (role == Qt::DisplayRole) - { - return QString(item->getstring()); - } - if (role == Qt::DecorationRole) - { - } - if (role == Qt::EditRole) - { - } - } - - if (index.column() == 1) - { - if (role == Qt::CheckStateRole) - { - if (item->enable) - return Qt::Checked; - else - return Qt::Unchecked; - } - if (role == Qt::TextAlignmentRole) - return Qt::AlignRight; - if (role == Qt::EditRole) - { - } - } - if (role == Qt::SizeHintRole) - { - // return QSize(18,18); - } - return QVariant(); -} diff --git a/src/listmodel.h b/src/listmodel.h deleted file mode 100644 index 745416d..0000000 --- a/src/listmodel.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * listmodel.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef LISTMODEL_H -#define LISTMODEL_H - -#include -// class ListModel : public QAbstractItemModel -class ListModel : public QAbstractTableModel -// class ListModel : public QStandardItemModel -{ - Q_OBJECT - public: - ListModel(QObject *parent = 0){}; - ~ListModel(){}; - QModelIndex index(int row, int column, - const QModelIndex &parent = QModelIndex()) const; // pure - QModelIndex parent(const QModelIndex &child) const; // pure virtual - int rowCount(const QModelIndex &parent) const; - int columnCount(const QModelIndex &parent) const { return 2; }; - QVariant data(const QModelIndex &index, int role) const; - QVariant headerData(int section, Qt::Orientation o, int role) const; - // QMap itemData ( const QModelIndex & index ) const - //; - void update() - { // reset(); - } - void update(const QModelIndex &idx); - void update(int row); - // Qt::ItemFlags flags(const QModelIndex &index) const; - // void update(); //TEMP -}; - -#endif // LISTMODEL_H diff --git a/src/lookup.cpp b/src/lookup.cpp deleted file mode 100644 index eef7111..0000000 --- a/src/lookup.cpp +++ /dev/null @@ -1,284 +0,0 @@ -/* - * lookup.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -// This module implements asynchronous address->hostname lookup. - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "lookup.h" -#include "svec.cpp" - -// declarations of static members -char *Lookup::argv0; -int Lookup::maxtitlelen; - -UintQueue::UintQueue() { first = last = 0; }; - -void UintQueue::enqueue(unsigned x) -{ - if (last < 0) - { - // make room for inserting more elements - int step = qMax(first + 1, 8); - queue.setSize(first + step + 1); - for (int i = first; i > last; i--) - queue[i + step] = queue[i]; - first += step; - last += step; - } - queue.set(last--, x); -} - -unsigned UintQueue::dequeue() -{ - if (isEmpty()) - fatal("UintQueue: queue empty"); - return queue[first--]; -} - -// constructor for node head -Hostnode::Hostnode() : next(this), prev(this) {} - -// create a new cache node, initialized with null string -Hostnode::Hostnode(unsigned addr) : ipaddr(addr), next(0), prev(0) {} - -// must be called on the head of the list -void Hostnode::moveToFront(Hostnode *node) -{ - if (next != node) - { - Hostnode *p = node->prev, *n = node->next; - p->next = n; - n->prev = p; - node->next = next; - node->prev = this; - next->prev = node; - next = node; - } -} - -// must be called on the head of the list -void Hostnode::deleteLast() -{ - Hostnode *nuke = prev; - prev = nuke->prev; - prev->next = this; - delete nuke; -} - -// must be called on the head of the list -void Hostnode::insertFirst(Hostnode *node) -{ - node->prev = this; - node->next = next; - next->prev = node; - next = node; -} - -Lookup::Lookup() // : hostdict(17) -{ - sockfd = -1; // no lookup helper is running - readsn = writesn = 0; - outstanding = 0; -} - -// empty destructor, workaround for gcc bug -Lookup::~Lookup() {} - -// look up host name (addr is in host byte order) -// a null name means it is been looked up (signal will be sent when done) -QString Lookup::hostname(unsigned addr) -{ - // first look in our cache - Hostnode *hn = hostdict.value(addr, NULL); - if (hn) - { - hostlru.moveToFront(hn); - } - else - { - hn = new Hostnode(addr); - if (hostdict.count() >= hostname_cache_size) - { - // remove least recently used item - hostdict.remove(hostlru.last()->ipaddr); - hostlru.deleteLast(); - } - hostlru.insertFirst(hn); - hostdict.insert(addr, hn); - // if(hostdict.count() > hostdict.size() * 3) - // hostdict.resize(hostdict.count()); - if (addr == 0) - hn->name = "*"; - else - request(addr); - } - return hn->name; -} - -void Lookup::request(unsigned addr) -{ - addrqueue.enqueue(addr); - if (sockfd < 0) - { - int socks[2]; - socketpair(AF_UNIX, SOCK_STREAM, 0, socks); - // launch a new helper - signal(SIGCHLD, SIG_IGN); // Linux does automatic child reaping, nice - switch (fork()) - { - case -1: // error - return; // don't bother, we'll try again next time - case 0: // child - close(socks[0]); - do_child(socks[1]); - break; - default: // parent - close(socks[1]); - sockfd = socks[0]; - readsn = new QSocketNotifier(sockfd, QSocketNotifier::Read, this); - connect(readsn, SIGNAL(activated(int)), SLOT(receive_result(int))); - writesn = new QSocketNotifier(sockfd, QSocketNotifier::Write, this); - connect(writesn, SIGNAL(activated(int)), SLOT(send_request(int))); - break; - } - } - writesn->setEnabled(true); -} - -// the child helper process loop -void Lookup::do_child(int fd) -{ - setproctitle("qps-dns-helper"); - // close unused fds - for (int i = 0; i < fd; i++) - close(i); - for (;;) - { - unsigned addr; - int ret = read(fd, &addr, sizeof(addr)); - if (ret <= 0) - { - _exit(0); // connection closed - } - struct hostent *h = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET); - char buf[256]; - if (!h) - { - unsigned a = htonl(addr); - sprintf(buf, "%d.%d.%d.%d", (a >> 24) & 0xff, (a >> 16) & 0xff, - (a >> 8) & 0xff, a & 0xff); - } - else - { - strncpy(buf, h->h_name, sizeof(buf)); - } - // if parent died, we'll get SIGPIPE here and terminate - // automatically - write(fd, &addr, sizeof(addr)); - int len = strlen(buf); - write(fd, &len, sizeof(len)); - write(fd, buf, len); - } -} - -// slot: receive result from helper -void Lookup::receive_result(int) -{ - unsigned addr; - int len; - char buf[256]; - - if (read(sockfd, &addr, sizeof(addr)) <= 0 || - read(sockfd, &len, sizeof(len)) <= 0 || read(sockfd, buf, len) <= 0) - { - // helper has died - delete readsn; - delete writesn; - close(sockfd); - sockfd = -1; - return; - } - buf[len] = '\0'; - Hostnode *hn = hostdict.value(addr, NULL); - if (!hn) - return; // gone from cache - hn->name = buf; - emit resolved(addr); - - outstanding--; - // if there is nothing more in the queue, kill the helper - if (addrqueue.isEmpty() && outstanding == 0) - { - close(sockfd); - sockfd = -1; - delete readsn; - delete writesn; - } -} - -// slot: send request to the helper -void Lookup::send_request(int) -{ - if (addrqueue.isEmpty()) - { - writesn->setEnabled(false); - return; - } - - unsigned addr = addrqueue.dequeue(); - if (write(sockfd, &addr, sizeof(addr)) < 0) - { - // This shouldn't happen, try to repair it anyway - addrqueue.enqueue(addr); - delete readsn; - delete writesn; - close(sockfd); - sockfd = -1; - return; - } - outstanding++; -} - -// register and measure the space for modifying the visible command line -void Lookup::initproctitle(char **argv, char **envp) -{ - argv0 = argv[0]; - while (*envp) - envp++; - maxtitlelen = envp[-1] + strlen(envp[-1]) - argv0 - 2; -} - -// set the process title (idea snarfed from sysvinit (thanks Miquel) and -// refined by peeking into wu-ftpd) -void Lookup::setproctitle(const char *txt) -{ - memset(argv0, 0, maxtitlelen); - strncpy(argv0, txt, maxtitlelen - 1); -} diff --git a/src/lookup.h b/src/lookup.h deleted file mode 100644 index 9cb8d0a..0000000 --- a/src/lookup.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * lookup.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef LOOKUP_H -#define LOOKUP_H - -#include -#include -#include "svec.h" -#include - -// queue (fifo) of unsigned ints (inet addresses) -class UintQueue -{ - public: - UintQueue(); - - bool isEmpty() { return first == last; }; - void enqueue(unsigned x); - unsigned dequeue(); - - private: - Svec queue; - int first; // index of first item in queue - int last; // index where next item will be put (< first) -}; - -// list node for LRU cache of hostnames: -// This list is doubly-linked circular (to reduce the amount of special cases), -// with a head node that carries no data. In addition, each node is -// entered into a hash table for rapid lookup -class Hostnode -{ - public: - Hostnode(); - Hostnode(unsigned addr); - - // these must be called on the head of the list - void moveToFront(Hostnode *node); - void deleteLast(); - void insertFirst(Hostnode *node); - Hostnode *last() { return prev; }; - - QString name; - unsigned ipaddr; // hash key - Hostnode *next, *prev; -}; - -class Lookup : public QObject -{ - Q_OBJECT - public: - Lookup(); - ~Lookup(); - QString hostname(unsigned addr); - - static void initproctitle(char **argv, char **envp); - -signals: - void resolved(unsigned addr); - - protected slots: - void receive_result(int); - void send_request(int); - - protected: - void request(unsigned addr); - void do_child(int fd); - - static void setproctitle(const char *txt); - - static char *argv0; - static int maxtitlelen; - - QHash hostdict; - Hostnode hostlru; // head of circular list - UintQueue addrqueue; // queue of addresses to lookup - int outstanding; // number of outstanding requests - int sockfd; // -1 if no helper process is running - - QSocketNotifier *readsn, *writesn; - - static const unsigned hostname_cache_size = 400; // max names to cache -}; - -#endif // LOOKUP_H diff --git a/src/message.ui b/src/message.ui deleted file mode 100644 index d3c5583..0000000 --- a/src/message.ui +++ /dev/null @@ -1,37 +0,0 @@ - - ExecWindow - - - - 0 - 0 - 309 - 162 - - - - Qps - - - - - - - - - - - - - - Ok - - - - - - - - - - diff --git a/src/misc.cpp b/src/misc.cpp deleted file mode 100644 index 9dc63c4..0000000 --- a/src/misc.cpp +++ /dev/null @@ -1,1233 +0,0 @@ -/* - * misc.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 2014 dae hyun, yang - * Copyright 2015 Paulo Lieuthier - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - - -#include "misc.h" -#include "proc.h" - -extern SearchBox *search_box; -extern bool flag_show_thread; -extern int flag_thread_ok; -extern bool flag_devel; - -#include "../icon/x1.xpm" -#include "../icon/x2.xpm" - -#include -#include -#include - -// 300% faster than glibc (by fasthyun@magicn.com) -int x_atoi(const char *sstr) -{ - const char *str = sstr; - int val = 0; - while (*str) - { - val *= 10; - val += *str - 48; - str++; - } - return val; -} - -#include -QWidget *getQpsWidget() -{ - QWidgetList list = QApplication::topLevelWidgets(); - for (int i = 0; i < list.size(); ++i) - { - QWidget *w = list.at(i); - if (w->objectName() == "qps") - return w; - } - return 0; -} - -#include -#include -/* - ver 0.2 - A simplified vsscanf implementation from Internet - - %S can read char_string_has_spaces. - ex. "(%S)" == (foo bar) or (foo bar ) - - - %s %d %ld %u %x? %lu %*s %f - %S: (%S) - - Only recognizes %s %f,%d, %u, %ld, %lu, %lg and whitespace. ...terminates - scanning. - space* same tab* - - */ - -// Description: -// mini_sscanf() == strstr() + sscanf() + %S -// -// there is test_sample_code in init_misc() -// fixed : invalid conversion from ‘const char*’ to ‘char*’ -// -// TOO COMPLEX !!!!!! -> simple code -char *strchar(const char *s, int k); -int mini_sscanf(const char *s1, const char *fmt, ...) -{ - - va_list va; - va_start(va, fmt); - char *s = (char *)s1; // *** for gcc 4.4 - char *p; - int k = 0; // count - while (*fmt and *s) // if (*fmt==0 or *s==0) break; - { - if (*fmt == '%') - { - int n; - if (fmt[1] == 'S') - { - // if(fmt[2]!=0) - p = strchr(s, fmt[2]); // get the token - int len = p - s; - p = va_arg(va, char *); - strncpy(p, s, len); - p[len] = 0; - s += len + 1; - fmt += 3; - k++; - } - else if (fmt[1] == 's') // extract string - { - // printf("%s : %%s =%s \n",__FUNCTION__,s); - k += sscanf(s, "%s%n", va_arg(va, char *), &n); - s += n; - fmt += 2; - } - else if (fmt[1] == '*' && fmt[2] == 's') // skip - { - p = strchr(s, ' '); // 0x20,0x00,0x0A, 123 435 54054 - if (p == 0) - { - // printf("%s : %c [%s] - //\n",__FUNCTION__,fmt[1],s); - break; - } - s = p; - fmt += 3; - } - else if (fmt[1] == 'c') - { - p = va_arg(va, char *); - // printf("%s : %c [%c] - //\n",__FUNCTION__,fmt[1],*s); - *p = *s; - s++; - k++; - fmt += 2; - } - else if (fmt[1] == 'f') - { - k += sscanf(s, "%f%n", va_arg(va, float *), &n); - s += n; - fmt += 2; - } - else if (fmt[1] == 'd') - { - k += sscanf(s, "%d%n", va_arg(va, int *), &n); - s += n; - fmt += 2; - } - else if (fmt[1] == 'u') - { - k += sscanf(s, "%u%n", va_arg(va, int *), &n); - s += n; - fmt += 2; - } - else if (fmt[1] == 'l' && fmt[2] == 'd') - { - k += sscanf(s, "%ld%n", va_arg(va, long *), &n); - s += n; - fmt += 3; - } - else if (fmt[1] == 'l' && fmt[2] == 'u') - { - k += sscanf(s, "%lu%n", va_arg(va, long *), &n); - s += n; - fmt += 3; - } - else if (fmt[1] == 'l' && fmt[2] == 'g') - { - k += sscanf(s, "%lg%n", va_arg(va, double *), &n); - s += n; - fmt += 3; - } - else - { - printf("%s: unsupported" - " format '%c'", - __FUNCTION__, fmt[1]); - break; - } - } - else - { - if (isspace(*fmt)) // isblank - { - while (isspace(*s)) - s++; - fmt++; - } - else - { - char sstr[32]; - int n = strcspn(fmt, " %\n"); // find delimiters noSEGFAULT - strncpy(sstr, fmt, n); - sstr[n] = 0; - p = strstr(s, sstr); - if (p == 0) - { - if (0 and flag_devel) - printf("%s : can't found [%s] " - "in %s\n", - __FUNCTION__, sstr, s); - break; - } - s = p + n; - fmt += n; - // ddd at %s, at%s - // printf("opp_vsscanf: unexpected ""char in - // format '%s'",fmt); - // break; - // return k; - } - } - - if (*fmt == '\0' || *fmt == '#' or *s == 0) - break; - } - va_end(va); - return k; -} - -#include -#include -#include -#include - -// return /proc/* file size -int fsize(char *fname) -{ - int size = 0; - if (0) - { - // !!! important !! not works with [/proc] , because [/proc/*] - // always zero - int fd = open(fname, O_RDONLY); - if (fd < 0) - return -1; - size = lseek(fd, 0, SEEK_END); - printf("size=%d\n", size); - close(fd); - return size; - } - - int buf[1024]; - int r; - int fd = open(fname, O_RDONLY); - if (fd < 0) - return -1; - do - { - r = read(fd, buf, 1024); - size += r; - // printf("r_size=%d\n",size); - } while (r); - // printf("size=%d\n",size); - close(fd); - return size; -} - -// sleep for mili seconds -void msleep(long msec) -{ -#ifdef LINUX - timespec req, remain; - timeval tv; - req.tv_sec = 0; - req.tv_nsec = msec * 1000000; - // int nanosleep(const struct timespec *req, struct timespec - // *remain) - /*while (nanosleep(&req, &req)) - { - if (errno != EINTR) - break; - } */ - - tv.tv_sec = 0; - tv.tv_usec = msec * 1000; - select(0, NULL, NULL, NULL, &tv); - return; -#endif -} - -void mem_string_k(int kbytes, char *buf) -{ - if (kbytes >= 1024) - { - int mb = kbytes >> 10; - if (mb >= 1024 * 100) - sprintf(buf, "%uGB", mb >> 10); - else - sprintf(buf, "%uMB", mb); - } - else - sprintf(buf, "%uKB", kbytes); -} -void mem_string(int kbytes, char *buf) -{ - if (kbytes >= 1024) - { - int meg = kbytes >> 10; - if (meg >= 1024 * 100) - sprintf(buf, "%uGb", meg >> 10); - else - sprintf(buf, "%uMb", meg); - } - else - sprintf(buf, "%uKb", kbytes); -} - -// DEL -CheckMenu::CheckMenu(QWidget *parent) : QMenu(parent) {} - -// ??? -CrossBox::CrossBox(const char *text, QWidget *parent) : QCheckBox(text, parent) -{ -} - -void CrossBox::drawButton(QPainter *p) -{ - ///// QCheckBox::drawButton(p); -} - -TBloon::TBloon(QWidget *parent) : QLabel(parent) -{ - - return; - paren = parent; - setStyleSheet("QLabel { " - //"border-width: 1px; border-style: solid; border-color: - // rgb(150,45,100); border-radius: 5px ;" - "border-width: 1px; border-style: solid; border-color: " - "rgb(150,180,180); border-radius: 5px ;" - "background-color : rgba(0,0,0,48%); padding: 3px; color: " - "rgb(255,120,60); }"); - // COLOR orange FF5d00 - - setText( tr( " This is unstable Alpha feature\n You maybe see a SEGFAULT..." ) ); - resize(sizeHint()); - // parent->installEventFilter(this); - // parent->setMouseTracking(true); - hide(); - - // Construct a 1-second timeline with a frame range of 0 - 100 - timeLine = new QTimeLine(100000, this); - timeLine->setFrameRange(0, 20000); - timeLine->setCurveShape(QTimeLine::EaseOutCurve); - // timeLine->set(0, 20000); - connect(timeLine, SIGNAL(frameChanged(int)), this, SLOT(update(int))); -} - -/* -void TBloon::start_ani() -{ - -} */ - -void TBloon::update(int val) -{ - //`QPoint p=QCursor::pos(); - // qDebug("pos %d %d", p.x(),p.y()); - QPoint p2 = paren->mapFromGlobal(QCursor::pos()); - - // qDebug("wpos %d %d", p2.x(),p2.y()); - int tx = p2.x(); - int ty = p2.y(); - int sx = pos().x(); - int sy = pos().y(); - float dx = tx - sx; - float dy = ty - sy; - dx = dx / 1.35; - dy = dy / 1.35; - move(tx + dx + 8, ty + dy + 14); -} - -bool TBloon::eventFilter(QObject *obj, QEvent *event) -{ - if (event->type() == QEvent::Enter) - { - QPoint p = paren->mapFromGlobal(QCursor::pos()); - move(p); - // qDebug("Enter parent"); - timeLine->start(); - show(); - return true; - } - else if (event->type() == QEvent::Leave) - { - // qDebug("Leave parent"); - timeLine->stop(); - hide(); - return true; - } - else if (event->type() == QEvent::MouseMove) - { - QMouseEvent *me = static_cast(event); - // qDebug("Ate key press %d %d", me->x(),me->y()); - // move(me->x()+5,me->y()+4); - return false; - } - else - { - // standard event processing - return QObject::eventFilter(obj, event); - } -} - -/* -void TBloon::paintEvent( QPaintEvent * event ) -{ - QLabel::paintEvent(event); -} */ - -TFrame::TFrame(QWidget *parent) : QLabel(parent) -// TFrame::TFrame(QWidget *parent):QFrame(parent) -{ - text = tr( "this is Tframe widget" ); - // setAutoFillBackground(false); - // setGeometry(50,50,100,100); - // setAttribute(Qt::WA_OpaquePaintEvent); - // setFrameShape(QFrame::StyledPanel); - // setFrameShadow(QFrame::Sunken); - // setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred); - // setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum); - // setSizePolicy(QSizePolicy::Maximum,QSizePolicy::Maximum); - // setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); - - //"border-width: 1px; border-style: solid; border-color: - // rgb(150,45,100); - // border-radius: 5px ;" - setStyleSheet("QLabel { " - "border-width: 1px; border-style: solid; border-color: " - "rgb(210,50,130); border-radius: 5px ;" - "background-color : rgba(0,0,0,69%); padding: 3px; color: " - "rgb(0,255,150); }"); - // setStyleSheet( "QLabel { " "border-width: 1px; border-style: - // solid; - // border-radius: 5px ; padding: 3px; }"); - hide(); - - timeLine = new QTimeLine(2000, this); - timeLine->setFrameRange(0, 100); - connect(timeLine, SIGNAL(frameChanged(int)), this, SLOT(setValue(int))); -} - -/* -void TFrame::showText(QPoint glob_pos,QString str) -{ - - -} - - -void TFrame::move(int x,int y) -{ - - -} */ - -// QToolTip::showText(e->globalPos(), s); -void TFrame::showText(QPoint glob_pos, QString str) {} - -void TFrame::setText(QString str) -{ - text = str; - - QLabel::setText(str); - - // resize(minimumSizeHint()); - resize(sizeHint()); // **** before show !! ***** - - if (str.size() == 0) - { - hide(); - return; - } - show(); -} - -// to avoid ~ -void TFrame::draw(QPainter &p) -{ - // if(!isVisible()) return; - return; - int h = fontMetrics().height() + 3; - int w = fontMetrics().width(text) + 9; - setFixedSize(w, h); - // QFont font("Adobe Helvetica"); // helvetica & No-Antialias - // font.setPixelSize(10); - // setFont(font); - // p.drawRoundRect(rect(),10,10); - // p.fillRect ( cr,QColor(0,0,0)); - QColor bg = QColor(0, 0, 0, 120); -#if QT_VERSION < 0x040400 - p.fillRect(rect(), QColor(0, 0, 0, 120)); -#else - // p.fillRect(rect(),QColor(0,0,0,90)); - - // p.setPen(QColor(0,255,155)); // less visually obtrusive than - // black - // p.setBrush(QBrush(bg)); - // p.drawRoundedRect(0,0,w,h, 4, 4); - p.fillRect(rect(), bg); - -#endif - - p.setPen(QColor(0, 255, 155)); // less visually obtrusive than black - p.drawText(0, 0, w, h, Qt::AlignVCenter | Qt::AlignHCenter, text); -} - -void TFrame::setPos() -{ - QWidget *parent = QWidget::parentWidget(); - - QPoint p = parent->mapFromGlobal(QCursor::pos()); - - setPos(p.x(), p.y()); -} - -void TFrame::setPos(int x, int y) -{ - QWidget *parent = QWidget::parentWidget(); - int pwidth = parent->width(); - - if (width() + x > pwidth) - { - x = pwidth - width(); - } - move(x + 16, y + 4); -} - -void TFrame::moveEvent(QMoveEvent *e) -{ - // int x=e->pos().x(); - // printf("pos (%d %d) \n",e->pos().x(),e->pos().y()); - // event->oldPos(); -} - -void TFrame::setValue(int val) -{ - opacity += ((float)val / 100); - update(); -} - -void TFrame::showEvent(QShowEvent *event) -{ - opacity = 0.2; - // timeLine->start(); -} - -// Maybe SEGFAULT -void setPaletteBlend(QPalette &p) -{ - for (int i = 0; i < (QPalette::NoRole); i++) - { - QColor c = p.color(QPalette::ColorRole(i)); - c.alpha(); - } -} - -void TFrame::paintEvent(QPaintEvent *event) -{ - QLabel::paintEvent(event); - return; - - QCursor::pos(); - // if(x()+width() > ) ; - QPalette np = palette(); - setPaletteBlend(np); - - QPainter p(this); // why? - - // if(opacity>1) timeLine->stop(); // - // p.setOpacity(opacity); - // p.setOpacity(0.01); - // setWindowOpacity (0.1 ); - // QFrame::paintEvent(event); - // p.scale(0.5,0.5); - - // draw(p); - // p.setBackgroundMode (Qt::TransparentMode); - // p.setRenderHint(QPainter::Antialiasing); - // painter.translate(width() / 2, height() / 2); -} - -UFrame::UFrame(QWidget *parent) : QFrame(parent) -// TFrame::TFrame(QWidget *parent):QFrame(parent) -{ - // setAttribute(Qt::WA_OpaquePaintEvent); - // setFrameShape(QFrame::StyledPanel); - // setFrameShadow(QFrame::Sunken); - // setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred); - - //"border-width: 1px; border-style: solid; border-color: - // rgb(150,45,100); - // border-radius: 5px ;" - - // setStyleSheet( "QLabel { " "border-width: 1px; border-style: - // solid; - // border-color: rgb(210,50,130); border-radius: 5px ;" - // "background-color : - // rgba(0,0,0,70%); padding: 3px; color: rgb(0,255,150); }"); - hide(); - - QVBoxLayout *vlayout = new QVBoxLayout; - QLabel *label = new QLabel( tr( "title" ) ); - vlayout->addWidget(label); - - setLayout(vlayout); - QWidget *qps = getQpsWidget(); - if (qps) - { - int w = qps->width(); - int h = qps->height(); - printf("qps w=%d h=%d\n", qps->width(), qps->height()); - move(w / 2, h / 2); - } -} - -FaderWidget::FaderWidget(QWidget *parent) : QWidget(parent) -{ - if (parent) - startBrush = parent->palette().window(); - else - startBrush = Qt::white; - - timeLine = new QTimeLine(333, this); - timeLine->setFrameRange(1000, 0); - connect(timeLine, SIGNAL(frameChanged(int)), this, SLOT(update())); - - setAttribute(Qt::WA_DeleteOnClose); - resize(parent->size()); -} - -void FaderWidget::start() -{ - timeLine->start(); - show(); -} - -void FaderWidget::paintEvent(QPaintEvent * /* event */) -{ - QPainter painter(this); - qreal frame = timeLine->currentFrame(); - painter.setOpacity(frame / 1000.); - painter.fillRect(rect(), startBrush); - - if (frame <= 0.) - close(); -} - -void UFrame::setTitle(QString str) -{ - // QLabel::setText(str); - title = str; -} - -void UFrame::paintEvent(QPaintEvent *event) {} -/* -//void SearchBox::event_cursor_moved(QMouseEvent *e) -{ - move(e->x(),e->y()); - //printf("xxxxxxxxxxxxxk\n"); -} - -*/ - -QPixmap *letters; -int pf_height = 9; -int pf_width = 6; - -void init_xpm() -{ - letters = new QPixmap(":/icon/letters.png"); - pf_height = 9; - pf_width = 6; -} - -#ifdef LINUX -#include -#include -char strong_buff[128]; -class MyThread : public QThread -{ - public: - void run() - { - prctl(PR_SET_NAME, "thread_test123456789"); - - while (true) - { - int m = 0; - for (int i = 0; i < 20000; i++) - { - int p = rand() % 120; - strong_buff[p] = p; - } - msleep(40); - } - exec(); - } -}; -class MyThread2 : public QThread -{ - public: - void run() - { - prctl(PR_SET_NAME, "thread_test987654321"); - - while (true) - { - int m = 0; - int i; - for (i = 0; i < 100000; i++) - { - int p = rand() % 120; - // strong_buff[p]=p; - m = i * p; - } - m += i; - msleep(60); - } - exec(); - } -}; -#endif - -int pf_str_width(char *str) -{ - int len; - len = strlen(str) * pf_width; - return len; -} -int pf_char_height() { return pf_height; } - -int pf_write(QPainter *p, int x, int y, const char *str) -{ - int i, len, n; - int ch; - int sx, sy; - int x0 = x; - len = strlen(str); - for (i = 0; i < len; i++) - { - ch = str[i]; - - if (ch == '\n') - { - // y+=pf_height; - continue; - } - // if(ch>96) ch-=(97-65); - n = ch - 32; - p->drawPixmap(x, y, *letters, n * pf_width, 0, pf_width + 1, pf_height); - x += pf_width; - } - return x - x0; -} - -QPixmap *x1, *x2; -XButton::XButton(QWidget *parent) : QAbstractButton(parent) -{ - setFocusPolicy(Qt::NoFocus); - x1 = new QPixmap((const char **)x1_xpm); - x2 = new QPixmap((const char **)x2_xpm); - int w = x1->width(); - setGeometry(0, 0, w, w); -} - -void XButton::resizeEvent(QResizeEvent *p) -{ - int i, h; - i = height() % 2; - - if (i != 0) - h = height() + 1; - else - h = height(); - setFixedSize(h, h); -} - -void XButton::paintEvent(QPaintEvent *event) -{ - QPainter p(this); - int w, h, m; - - if (isDown()) - p.drawPixmap(0, 0, *x2); - else - p.drawPixmap(0, 0, *x1); - - return; -} - -SearchBox::SearchBox(QWidget *parent) : QLineEdit(parent) -{ - setToolTip( tr( "PID,COMMAND,USER..." ) ); - left_time = 0; - setMaximumWidth(300); - setMinimumWidth(20); - - // setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred); - // setContentsMargins(0,3,1,0); - // setLineWidth( 1 ); - // setMargin(2); - - /// xb=new XButton(this); - /// connect(xb, SIGNAL(clicked()), SLOT(event_xbutton_clicked())); - setFocus(Qt::ActiveWindowFocusReason); // good -} - -void SearchBox::event_cursor_moved(QMouseEvent *e) { move(e->x(), e->y()); } - -void SearchBox::resizeEvent(QResizeEvent *p) -{ - int w, h, margin; - // setMinimumHeight(height()-4); - // setMaximumHeight(p->size().height()-1); - // setFixedHeight(p->size().height()-5); - // setMaximumHeight(height()-2); - w = width(); - h = height(); - /// margin=(h - xb->width())/2; - /// xb->move(w-h+margin-1,margin); - return; -} - -void SearchBox::event_xbutton_clicked() -{ - QKeyEvent ke(QEvent::KeyPress, Qt::Key_Escape, 0); // temp.. - keyPressEvent(&ke); -} - -// public -/*void SearchBox::keyPress( QKeyEvent * e ) -{ - -} */ - -void SearchBox::timerEvent(QTimerEvent *e) -{ - // qDebug( "timer event, id %d", e->timerId() ); -} - -LogBox::LogBox(QWidget *p) : QLabel(p) -{ - text = new QTextEdit(p); - text->setFocusPolicy(Qt::NoFocus); -} - -// Location: bottom -StatusBar::StatusBar(QWidget *parent) : QStatusBar(parent) -{ - setSizeGripEnabled(true); - // QWidget *le = new QLabel(this);//QButton *button = new - // QButton(this); - // QLineEdit *le=new QLineEdit(this); - - // showMessage ( const QString & message, int timeout = 0 ) - // showMessage("aaaaaa"); - label = new QLabel(this); // QButton *button = new QButton(this); - // label->setText ("") ; - label->setFrameShape(QFrame::NoFrame); - // label->setFrameShape (QFrame::StyledPanel); - // label->setFrameShape (QFrame::Panel); - // label->setFrameShape (QFrame::WinPanel); - // label->setFrameShadow(QFrame::Sunken); - // button2 = new QToolButton(this);//QButton *button = new - // QButton(this); - // button2->setTextLabel ("") ; - // button2->setUsesTextLabel ( true ); - // button2->setAutoRaise(true); - // button3 = new QLabel(this);//QButton *button = new - // QButton(this); - // button3->setText ("") ; - // addPermanentWidget(label); - addWidget(label); - // addPermanentWidget(le,1); -} - -void StatusBar::refresh() {} - -extern int num_opened_files; -void StatusBar::update(int total_n) -{ - label->setText(tr( "Process count: %1" ).arg( total_n ) ); - // button2->setTextLabel ("Network Process(testing): "+ - // str.setNum(Procinfo::num_network_process)); - // button3->setText ("Opened files : "+ - // str.setNum(num_opened_files)); -} - -#include - -// Pstable or Procview -// Location : -QSpacerItem *stretch; -ControlBar::ControlBar(QWidget *parent) : QFrame(parent) -{ - int h; - // setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding); - setFrameStyle(QFrame::NoFrame); - // setFrameStyle(Panel | Raised);//bad - // setFrameStyle(Panel ); //bad - layout = new QHBoxLayout(this); - layout->addSpacing(4); // left gap - layout->setMargin(0); - - // setStyleSheet(" QFrame,QCheckBox,QRadioButton { color: rgb(244, 244, 244);\ - border-image: url(:/icon/vista.png); } "); - /* Frame { background-color: yellow } - * border: 2px solid #8f8f91; - min-width: 80px; */ - /* image: url(:/icon/vista.png);*/ - - b_linear = new QRadioButton(tr( "Linear" ), this); - b_linear->setFocusPolicy(Qt::NoFocus); - - b_tree = new QRadioButton( tr( "Tree" ), this); - b_tree->setFocusPolicy(Qt::NoFocus); - - search_box = new SearchBox(this); - connect(b_linear, SIGNAL(clicked()), SLOT(linear_clicked())); - connect(b_tree, SIGNAL(clicked()), SLOT(tree_clicked())); - connect(search_box, SIGNAL(textChanged(const QString &)), - SLOT(event_search_box_changed())); - // search_box->setFocusPolicy(Qt::NoFocus); - // search_box->setFocus (Qt::ActiveWindowFocusReason); - // search_box->setFocusProxy ( parent ); - - if (flag_thread_ok) - { - check_thread = new QCheckBox( ( "Thread" ), this); - check_thread->setFocusPolicy(Qt::NoFocus); - connect(check_thread, SIGNAL(clicked()), SLOT(show_thread_clicked())); - check_thread->setChecked(flag_show_thread); - } - - view = new QComboBox(this); - view->insertItem(0, tr( "All Processes" ), Procview::ALL); - view->insertItem(1, tr( "Your Processes" ), Procview::OWNED); - view->insertItem(2, tr( "Non-Root Processes" ), Procview::NROOT); - view->insertItem(3, tr( "Running Processes" ), Procview::RUNNING); - connect(view, SIGNAL(activated(int)), SLOT(view_changed(int))); - view->setFocusPolicy(Qt::NoFocus); - // PAUSED view->insertItem("Hidden Processes", Procview::HIDDEN); - - layout->addWidget(b_linear); - layout->addWidget(b_tree); - if (flag_thread_ok) - layout->addWidget(check_thread); - layout->addWidget(search_box); - layout->addWidget(view); - - // stretch=new QSpacerItem(0,0,QSizePolicy::Expanding); - // layout->addItem(stretch); - layout->addStretch(); - - /* - QPushButton *mb=new QPushButton; - mb->setContentsMargins(0,0,0,0); - //mb->setDown(true); - mb->setCheckable(true); - mb->setText("pause"); - mb->setFixedWidth(32); - mb->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum); - layout->addWidget(mb); - */ - - pauseButton = new QToolButton; - // QPushButton *pauseButton = new QPushButton; - pauseButton->setCheckable(true); - pauseButton->setIcon(QIcon(":/icon/pause.png")); - pauseButton->setIconSize(QSize(19, 19)); - pauseButton->setToolTip(tr("Pause (Ctrl+Space)")); - pauseButton->setFocusPolicy(Qt::NoFocus); - // pauseButton->setFlat(true); - pauseButton->setAutoRaise(true); - connect(pauseButton, SIGNAL(clicked(bool)), SLOT(setPaused(bool))); - - layout->addWidget(pauseButton); - - setLayout(layout); -} - -void PSTABLE_SETTREEMODE(bool mode); -void ControlBar::setMode(bool treemode) // just.. interface function -{ - b_linear->setChecked(!treemode); - b_tree->setChecked(treemode); - - PSTABLE_SETTREEMODE(treemode); // pstable->setTreeMode(treemode); -} - -#include -void ControlBar::view_changed(int idx) -{ - QAction act(this); - act.setData(QVariant(idx)); - emit viewChange(&act); -} - -extern bool flag_refresh; -void ControlBar::setPaused(bool b) -{ - flag_refresh = !b; - // if(!pauseButton->isDown()) pauseButton->setDown(true); -} - -void ControlBar::linear_clicked() -{ - setMode(false); - // emit modeChange(FALSE); -} - -void ControlBar::tree_clicked() -{ - setMode(true); - // emit modeChange(TRUE); -} - -void ControlBar::show_thread_clicked() -{ - flag_show_thread = check_thread->isChecked(); - emit need_refresh(); -} - -void ControlBar::event_search_box_changed() -{ - // printf("search_box changed!\n"); -} - -void ControlBar::event_command_pressed() -{ - // printf("command!\n"); -} - -// not used -void ControlBar::update_bar() // trick for Command -{ -} - -// called after resize() -// simplified by fasthyun@magicn.com - -extern bool flag_smallscreen; - -void ControlBar::resizeEvent(QResizeEvent *e) -{ - return; - // QLayoutItem *item=layout->takeAt (layout->count()-1); - // return; - if (flag_smallscreen) - { - search_box->hide(); - pauseButton->hide(); - } - else - { - search_box->show(); - pauseButton->show(); - } - - // printf("size=%d\n",stretch->geometry().width()); - // printf("hsize=%d\n",stretch->sizeHint().height()); - // QSize s=e->size(); - return; - /* - if(stretch->geometry().width()==0) - search_box->hide(); - else - search_box->show(); - */ - - /* setMaximumHeight (b_tree->sizeHint().height()+2); - search_box->setMaximumHeight(height()-4); - //search_box->setMinimumHeight(height()-5); - - for(i=0;i< commands.size();i++) - { - QToolButton *b; - b=commands[i]->toolbutton; - if(commands[i]->toolbar==true) - { - if (layout->findWidget(b)<0) - layout->addWidget(b); - b->show(); - } - else - if(b!=NULL) - b->hide(); - } */ -} - -void ServerAdaptor::accelerate() {} - -//#include -//#include -//#include -#include -// ServerAdaptor::ServerAdaptor(){ } -// ServerAdaptor::~ServerAdaptor(){} - -#define SERVICE_NAME "com.trolltech.qps" -void dbus_register_server() -{ - ServerAdaptor *sv = new ServerAdaptor(); - QDBusConnection connection = QDBusConnection::sessionBus(); // user only?? - // QDBusConnection connection = QDBusConnection::systemBus(); //user - // only?? - connection.registerObject("/QPS_OBJ", sv); - connection.registerService(SERVICE_NAME); // -} - -#include -void qdbus_client() -{ - // connection.connect ( SERVICE_NAME,"path", "interface","name", - // QObject * - // receiver, const char * slot ); - - // QDBusConnection conn = - // QDBusConnection::connectToBus(SERVICE_NAME,"hyun"); - - QDBusConnection conn = QDBusConnection::sessionBus(); // owner-user - // only, hang.. - // blocked !!! - - QDBusReply reply = conn.interface()->registeredServiceNames(); - - if (!reply.isValid()) - { - qDebug() << "qdbus_client Error:" << reply.error().message(); - // exit(1); - } - - /* - foreach (QString name, reply.value()) - { - qDebug() << name; - //printf("name %s, value %s \n",qPrintable(name), - } */ - - if (conn.interface()->isServiceRegistered(SERVICE_NAME)) - { - printf("Qps: Already another QPS is running...\n"); - exit(1); - } -} - -void check_qps_running() -{ - // QDBusServer *server=QDBusServer("xaddr"); //peer2peer mode - // service,path,interface,name - // connect(server, SIGNAL(clicked()), SLOT(event_xbutton_clicked())); - // SIGNAL(newConnection ( const QDBusConnection & connection )) - // QDBusConnection::connectToBus ("xaddr", "name" ); - - // glib_dbus_getlist(); - // glib_dbus_server(); - - qdbus_client(); // hang... on root-user - // printf("D1-1-3\n"); - dbus_register_server(); - // printf("D1-1-6\n"); -} - -char *read_proc_file(const char *fname, int pid = -1, int tgid = -1); // Temp -void init_misc(QWidget *main) -{ - - init_xpm(); // xpm image file load - - if (true) // TESTING - { - } - -#ifdef LINUX - if (false or flag_devel) // thread's Name Change test - { - QThread *task = new MyThread(); - task->start(); - task = new MyThread2(); - task->start(); - } -#endif - - if (false) // test mini_sscanf() - { - char *buf; - int val; - char sstr[32] = "pu%s"; - char buffer[128]; - - if ((buf = read_proc_file("stat", 1)) == 0) - { - printf("cant open [%s]\n", "sss"); - } - if (mini_sscanf(buf, sstr, &val) != 0) - printf("found [%s] val=%d \n", sstr, val); - if (mini_sscanf(buf, "(%s)", &buffer) != 0) - printf("found str=%s \n", buffer); - - abort(); - } -} - -QTabWidgetX::QTabWidgetX(QWidget *parent) {} - -void QTabWidgetX::showTab(bool flag) -{ - - QTabBar *tb = tabBar(); - // tb->setDrawBase(false); //?? - - if (flag) - tb->show(); - else - tb->hide(); -// if flag_useTabView == false -#if QT_VERSION > 0x040500 -// setDocumentMode (true); // QT 4.5 -#endif -} diff --git a/src/misc.h b/src/misc.h deleted file mode 100644 index aea90f6..0000000 --- a/src/misc.h +++ /dev/null @@ -1,317 +0,0 @@ -/* - * misc.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 2014 dae hyun, yang - * Copyright 2015 Paulo Lieuthier - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef MISC_H -#define MISC_H - -#ifndef USING_PCH -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif - -char *userName(int uid, int euid); -char *groupName(int gid, int egid); - -void setQpsTheme(); - -int fsize(char *fname); -void msleep(long msec); -void mem_string(int kbytes, char *buf); -void mem_string_k(int kbytes, char *buf); - -void init_xpm(); -void init_misc(QWidget *main); -int pf_write(QPainter *p, int x, int y, const char *str); -int pf_str_width(char *str); -int pf_char_height(); -void check_qps_running(); - -int QPS_PROCVIEW_CPU_NUM(); -void AddLog(QString str); - -class CrossBox : public QCheckBox -{ - public: - CrossBox(const char *text, QWidget *parent); - - protected: - virtual void drawButton(QPainter *paint); -}; - -class CheckMenu : public QMenu -{ - public: - CheckMenu(QWidget *parent = 0); -}; - -class TFrame : public QLabel -{ - Q_OBJECT - public: - TFrame(QWidget *parent); - void setText(QString str); - void draw(QPainter &p); - void showText(QPoint pos, QString str); - void setPos(int x, int y); - void setPos(); - - protected slots: - // void refresh(); - // void update(int n); - // QToolButton *button,*button2,*button3; - // void event_cursor_moved(QMouseEvent *e); - void setValue(int val); - - protected: - virtual void paintEvent(QPaintEvent *event); - virtual void moveEvent(QMoveEvent *event); - virtual void showEvent(QShowEvent *event); - - private: - QString text; - QTimeLine *timeLine; - float opacity; -}; - -class TBloon : public QLabel -{ - Q_OBJECT - public: - TBloon(QWidget *parent); - // void setText(QString str); - // void draw( QPainter &p ); - // void showText(QPoint pos,QString str); - - virtual bool eventFilter(QObject *watched, QEvent *event); - protected slots: - void update(int val); - // void refresh(); - // void update(int n); - // QToolButton *button,*button2,*button3; - // void event_cursor_moved(QMouseEvent *e); - protected: - // virtual void paintEvent( QPaintEvent * event ); - // virtual void moveEvent (QMoveEvent * event ); - private: - QWidget *paren; - QString text; - QTimeLine *timeLine; -}; - -class FaderWidget : public QWidget -{ - Q_OBJECT - Q_PROPERTY(QBrush fadeBrush READ fadeBrush WRITE setFadeBrush) - Q_PROPERTY(int fadeDuration READ fadeDuration WRITE setFadeDuration) - public: - FaderWidget(QWidget *parent); - - QBrush fadeBrush() const { return startBrush; } - void setFadeBrush(const QBrush &newColor) { startBrush = newColor; } - - int fadeDuration() const { return timeLine->duration(); } - void setFadeDuration(int milliseconds) - { - timeLine->setDuration(milliseconds); - } - - void start(); - - protected: - void paintEvent(QPaintEvent *event); - - private: - QTimeLine *timeLine; - QBrush startBrush; -}; - -class UFrame : public QFrame -{ - Q_OBJECT - public: - UFrame(QWidget *parent); - void setTitle(QString str); - protected slots: - // void refresh(); - // void update(int n); - // QToolButton *button,*button2,*button3; - // void event_cursor_moved(QMouseEvent *e); - protected: - virtual void paintEvent(QPaintEvent *event); - - private: - QString title; - QString stylesheet; -}; - -class XButton : public QAbstractButton -{ - Q_OBJECT - public: - XButton(QWidget *parent); - protected slots: - // void refresh(); - // void update(int n); - // QToolButton *button,*button2,*button3; - // void event_cursor_moved(QMouseEvent *e); - protected: - // virtual void drawButton 3( QPainter * ) ; - virtual void paintEvent(QPaintEvent *event); - void resizeEvent(QResizeEvent *p); -}; - -class SearchBox : public QLineEdit -{ - Q_OBJECT - public: - SearchBox(QWidget *parent); - void event_cursor_moved(QMouseEvent *e); - void keyPressEvent(QKeyEvent *e); - protected slots: - void event_xbutton_clicked(); - // void refresh(); - // void update(int n); - // QToolButton *button,*button2,*button3; - protected: - void resizeEvent(QResizeEvent *); - void timerEvent(QTimerEvent *); - int left_time; - // XButton *xb; -}; - -class LogBox : public QLabel -{ - Q_OBJECT - public: - LogBox(QWidget *w); - QTextEdit *text; - // QLabel *label,*label2,*label3; -}; - -class StatusBar : public QStatusBar -{ - Q_OBJECT - public: - StatusBar(QWidget *parent); - void refresh(); - void update(int n); - QLabel *label, *label2, *label3; -}; - -class ControlBar : public QFrame -{ - Q_OBJECT - public: - QComboBox *view; - ControlBar(QWidget *parent); - void setMode(bool treemode); - void update_bar(); - QToolButton *pauseButton; - -signals: - void modeChange(bool treemode); - void viewChange(QAction *); - void need_refresh(); - - public slots: - void linear_clicked(); - void view_changed(int idx); - void tree_clicked(); - void show_thread_clicked(); - void event_search_box_changed(); - void event_command_pressed(); - void setPaused(bool); - - protected: - void resizeEvent(QResizeEvent *); - - private: - QRadioButton *b_tree, *b_linear, *b_treeT; - QCheckBox *check_thread; - QBoxLayout *layout; -}; - -#include - -class QTabWidgetX : public QTabWidget -{ - Q_OBJECT - public: - QTabWidgetX(QWidget *parent); - void showTab(bool); -}; - -#include -#include - -// class ServerAdaptor: public QDBusAbstractAdaptor -class ServerAdaptor : public QObject -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "com.trolltech.Examples.CarInterface") - Q_CLASSINFO("D-Bus Introspection", - "" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - "") - public: - // ServerAdaptor(QObject *parent); - ServerAdaptor(){}; - virtual ~ServerAdaptor(){}; - - public: // PROPERTIES - public Q_SLOTS: // METHODS - void accelerate(); -Q_SIGNALS: // SIGNALS - void crashed(); -}; - -#endif // MISC_H diff --git a/src/prefs.cpp b/src/prefs.cpp deleted file mode 100644 index e873907..0000000 --- a/src/prefs.cpp +++ /dev/null @@ -1,420 +0,0 @@ -/* - * prefs.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include "prefs.h" -#include "proc.h" -#include "qps.h" -#include -#include -#include -#include -#include -#include -#include - -//#include -#include "qps.h" -extern Qps *qps; - -extern QFontComboBox *font_cb; -// class that validates input for the "swap warning limit" field -class Swapvalid : public QValidator -{ - public: - Swapvalid(QWidget *parent) : QValidator(parent) {} - virtual State validate(QString &s, int &) const; -}; - -struct Boxvar -{ -Q_DECLARE_TR_FUNCTIONS(Boxvar) -public: - const QString text; - bool *variable; - // CrossBox *cb; - QCheckBox *cb; - - Boxvar() : text( QString() ), variable( static_cast< bool * >( 0 ) ), cb( static_cast< QCheckBox *>( 0 ) ) {} - Boxvar( const QString t, bool *v, QCheckBox *c ) : text( t ), variable( v ), cb( c ) {} - - static QVector< Boxvar > *general_boxes() - { - static QVector< Boxvar > boxes( { { tr( "Exit On Close Button" ), &Qps::flag_exit, 0} -// , { tr( "Graphic Load Display" ), &Qps::show_load_graph, 0 } -// , { tr( "Graphic CPU Display" ), &Qps::show_cpu_bar, 0} -// , { tr( "Minimized on Close Button" ), &Qps::flag_systray, 0} -// TEMPO -// , { tr( "Use Tab-View" ), &Qps::flag_useTabView, 0} -// , { tr( "Hide qps in Linear mode" ), &Qps::flag_qps_hide, 0} -// , { tr( "Load Graph in Icon" ), &Qps::load_in_icon, 0} -// , { tr( "Selection: Copy PIDs to Clipboard" ), &Qps::pids_to_selection, 0} -// , { tr( "show underdevelopment" ), &Qps::flag_devel, 0} -// , { tr( "Vertical CPU Bar (under development)" ), &Qps::vertical_cpu_bar, 0} - } ); - return &boxes; - } - -//#ifdef LINUX - static QVector< Boxvar > *sockinfo_boxes() - { - static QVector< Boxvar > boxes( { { tr( "Host Name Lookup" ), &Qps::hostname_lookup, 0} - , { tr( "Service Name Lookup" ), &Qps::service_lookup, 0} } ); - return &boxes; - } -//#endif - static QVector< Boxvar > *tree_boxes() - { - static QVector< Boxvar > boxes( { { tr( "Disclosure Triangles" ), &Qps::tree_gadgets, 0} - , { tr( "Branch Lines" ), &Qps::tree_lines, 0} } ); - return &boxes; - } - - static QVector< Boxvar > *misc_boxes() - { - static QVector< Boxvar > boxes( { { tr( "Auto Save Settings on Exit" ), &Qps::auto_save_options, 0} - , { tr( "Selection: Copy PIDs to Clipboard" ), &Qps::pids_to_selection, 0} -#ifdef SOLARIS - , { tr( "Normalize NICE" ), &Qps::normalize_nice, 0} - , { tr( "Use pmap for Map Names" ), &Qps::use_pmap, 0} -#endif - } ); - return &boxes; - } - -}; - -struct Cbgroup -{ -Q_DECLARE_TR_FUNCTIONS(Cbgroup) -public: - const QString caption; - QVector< Boxvar > *boxvar; - - Cbgroup() : caption( QString() ), boxvar( static_cast< QVector< Boxvar > * >( 0 ) ) {} - Cbgroup( const QString c, QVector< Boxvar > *b ) : caption( c ), boxvar( b ) {} - - static QVector< Cbgroup > &groups() - { - static QVector< Cbgroup > groups( { { tr( "General" ), Boxvar::general_boxes() } -#ifdef LINUX -// , { tr( "Socket Info Window" ), Boxvar::sockinfo_boxes() } -#endif -// , { tr( "Tree View" ), Boxvar::tree_boxes() } -// , { tr( "Miscellaneous" ), Boxvar::misc_boxes() } - } ); - return groups; - } - -}; - - -void find_fontsets(); -// dual use function: both validate and apply changes -QValidator::State Swapvalid::validate(QString &s, int &) const -{ - // only accept /^[0-9]*[%kKmM]?$/ - int len = s.length(); - int i = 0; - while (i < len && s[i] >= '0' && s[i] <= '9') - i++; - if ((i < len && QString("kKmM%").contains(s[i]) == 0) || i < len - 1) - return Invalid; - if (s[i] == 'k') - s[i] = 'K'; - if (s[i] == 'm') - s[i] = 'M'; - // int val = atoi((const char *)s); - int val = s.toInt(); - bool percent; - if (s[i] == '%') - { - percent = true; - } - else - { - percent = false; - if (s[i] == 'M') - val <<= 10; - } - Qps::swaplimit = val; - Qps::swaplim_percent = percent; - return Acceptable; -} - -Preferences::Preferences() : QDialog() -{ - int flag_test = 0; - setWindowTitle( tr( "Preferences" ) ); - QVBoxLayout *v_layout = new QVBoxLayout; - - if (flag_test) - { - QTabWidget *tbar = new QTabWidget(this); - QWidget *w = new QWidget(this); - tbar->addTab(w, tr( "Setting" ) ); - w->setLayout(v_layout); - } - else - setLayout(v_layout); - - v_layout->setSpacing(1); - // v_layout->setSpacing(1); - const int border_x = 10; - int min_x = 0; - - QVector< Cbgroup >::iterator endItG = Cbgroup::groups().end(); - for( QVector< Cbgroup >::iterator itG = Cbgroup::groups().begin(); itG != endItG; ++ itG ) - { - QGroupBox *grp = new QGroupBox( itG->caption, this ); - QVBoxLayout *vbox = new QVBoxLayout; - if ( itG->boxvar ) - { - QVector< Boxvar >::iterator endItB = itG->boxvar->end(); - for( QVector< Boxvar >::iterator itB = itG->boxvar->begin(); itB != endItB; ++ itB ) - { - itB->cb = new QCheckBox( itB->text, grp ); - vbox->addWidget( itB->cb ); - connect( itB->cb, SIGNAL(clicked()), SLOT(update_reality())); - // -> EMIT prefs_change() - } - } - grp->setLayout(vbox); - v_layout->addWidget(grp); - } - - update_boxes(); - - /* - QGroupBox *wgrp = new QGroupBox("Swap Warning", this); - QHBoxLayout *hl = new QHBoxLayout; - wgrp->setLayout(hl); - QLabel *lbl = new QLabel("Warn when free swap below", wgrp); - QLineEdit *swaped = new QLineEdit(wgrp); - hl->addWidget(lbl); - hl->addWidget(swaped); - //swaped->setAlignment ( Qt::AlignRight ); - QString s; - if(Qps::swaplim_percent) { - s.sprintf("%d%%", Qps::swaplimit); - } else { - if(Qps::swaplimit >= 1024 && (Qps::swaplimit & 0x7ff) == 0) - s.sprintf("%dM", Qps::swaplimit >> 10); - else - s.sprintf("%dK", Qps::swaplimit); - } - swaped->setText(s); - swaped->setValidator(new Swapvalid(this)); - connect(swaped, SIGNAL(textChanged(const QString &)), - SIGNAL(prefs_change())); - v_layout->addWidget(wgrp); - */ - - rb_totalcpu = NULL; // tmp - - if (QPS_PROCVIEW_CPU_NUM() > 1) - { - QGroupBox *grp_cpu = new QGroupBox( tr( "%CPU divided by" ), this); - QVBoxLayout *vboxlayout = new QVBoxLayout; - QHBoxLayout *hbox = new QHBoxLayout; - vboxlayout->addLayout(hbox); - - // num_cpus - - rb_totalcpu = new QRadioButton( tr( "Total cpu: %1" ).arg( QPS_PROCVIEW_CPU_NUM() ), grp_cpu); - QRadioButton *rb2 = new QRadioButton( tr( "Single cpu: 1" ), grp_cpu); - if (!Procview::flag_pcpu_single) - rb_totalcpu->setChecked(true); - else - rb2->setChecked(true); - - rb_totalcpu->setToolTip( tr( "default" ) ); - rb2->setToolTip( tr( "for developer" ) ); - hbox->addWidget(rb_totalcpu); - hbox->addWidget(rb2); - grp_cpu->setLayout(vboxlayout); - v_layout->addWidget(grp_cpu); - - connect(rb_totalcpu, SIGNAL(clicked()), this, SLOT(update_config())); - connect(rb2, SIGNAL(clicked()), this, SLOT(update_config())); - } - - // Appearance ==================================== - if (font_cb == NULL) - { - font_cb = new QFontComboBox(this); // preload - font_cb->setWritingSystem(QFontDatabase::Latin); - font_cb->setCurrentFont(QApplication::font()); - - // remove Some Ugly Font : hershey... - // printf("size=%d\n",font_cb->count()); - for (int i = 0; i < font_cb->count();) - { - QString name = font_cb->itemText(i); - if (name.contains("hershey", Qt::CaseInsensitive) == true) - { - // printf("%s\n",qPrintable(name)); - font_cb->removeItem(i); - } - else - i++; - } - } - - if (font_cb) - { - font_cb->show(); - - QGroupBox *gbox = new QGroupBox( tr( "Appearance" ), this); - QVBoxLayout *vbox = new QVBoxLayout; - QHBoxLayout *hbox = new QHBoxLayout(); - - psizecombo = new QComboBox(this); - hbox->addWidget(font_cb); - hbox->addWidget(psizecombo); - vbox->addLayout(hbox); - gbox->setLayout(vbox); - v_layout->addWidget(gbox); - - // connect(font_cb, SIGNAL(activated( int)),this, - // SLOT(font_changed(int))); - connect(font_cb, SIGNAL(activated(int)), this, SLOT(font_changed(int))); - connect(psizecombo, SIGNAL(activated(int)), SLOT(font_changed(int))); - - // add to font size - init_font_size(); - } - - /* - // Style, Themes ================================== - QLabel *label3 = new QLabel("Themes", font_grp); - QComboBox *theme_combo = new QComboBox(font_grp); - - QStringList styles = QStyleFactory::keys(); - styles.sort(); - theme_combo->insertStringList(styles); - - QString currentstyle; - currentstyle = QApplication::style().className(); - */ - - QPushButton *saveButton = new QPushButton("OK", this); - // saveButton->setFocusPolicy(QWidget::NoFocus); - saveButton->setFocus(); - saveButton->setDefault(true); - v_layout->addWidget(saveButton); - // v_layout->freeze(); - - connect(saveButton, SIGNAL(clicked()), SLOT(closed())); -} - -// -void Preferences::init_font_size() -{ - // QFontDatabase db; - // QStringList families ( WritingSystem writingSystem = Any ) const - // QStringList families = db.families(QFontDatabase::Latin); - // QStringList extra; - psizecombo->clear(); - int i, idx = 0; - for (i = 5; i < 24; i++) - psizecombo->insertItem(idx++, QString::number(i)); - - // find current font size - i = 0; - for (int psize = QApplication::font().pointSize(); i < psizecombo->count(); - ++i) - { - const int sz = psizecombo->itemText(i).toInt(); - if (sz == psize) - { - psizecombo->setCurrentIndex(i); - break; - } - } -} - -// slot: update check boxes to reflect current status -void Preferences::update_boxes() -{ - QVector< Cbgroup >::iterator endItG = Cbgroup::groups().end(); - for( QVector< Cbgroup >::iterator itG = Cbgroup::groups().begin(); itG != endItG; ++ itG ) - { - if ( ! itG->boxvar ) - { - continue; - } - QVector< Boxvar >::iterator endItB = itG->boxvar->end(); - for( QVector< Boxvar >::iterator itB = itG->boxvar->begin(); itB != endItB; ++ itB ) - { - itB->cb->setChecked( *( itB->variable ) ); - } - } -} - -// slot: update flags and repaint to reflect state of check boxes -void Preferences::update_reality() -{ - QVector< Cbgroup >::iterator endItG = Cbgroup::groups().end(); - for( QVector< Cbgroup >::iterator itG = Cbgroup::groups().begin(); itG != endItG; ++ itG ) - { - if ( ! itG->boxvar ) - { - continue; - } - QVector< Boxvar >::iterator endItB = itG->boxvar->end(); - for( QVector< Boxvar >::iterator itB = itG->boxvar->begin(); itB != endItB; ++ itB ) - { - *( itB->variable ) = itB->cb->isChecked(); - } - } - emit prefs_change(); -} - -void Preferences::update_config() -{ - if (rb_totalcpu and rb_totalcpu->isChecked() == true) - Procview::flag_pcpu_single = false; - else - Procview::flag_pcpu_single = true; -} - -void Preferences::closed() -{ - // delete font_cb; font_cb==NULL; - // font_cb->clear(); - update_config(); - hide(); - emit prefs_change(); -} - -// work -void Preferences::font_changed(int i) -{ - int size = psizecombo->currentText().toInt(); - QFont font = font_cb->currentFont(); - font.setPointSize(size); - - QApplication::setFont(font); -} - -// DRAFT CODE: -void Preferences::fontset_changed(int i) {} diff --git a/src/prefs.h b/src/prefs.h deleted file mode 100644 index eafdd3b..0000000 --- a/src/prefs.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * prefs.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef PREFS_H -#define PREFS_H - -#include -#include -#include -//#include -#include -#include "misc.h" - -class Preferences : public QDialog -{ - Q_OBJECT - public: - Preferences(); - QComboBox *psizecombo; - // QFontComboBox *font_cb; - QRadioButton *rb_totalcpu; - void init_font_size(); - - public slots: - void update_boxes(); - void update_reality(); - void update_config(); - void closed(); - void font_changed(int); - void fontset_changed(int); -signals: - void prefs_change(); -}; - -#endif // PREFS_H diff --git a/src/proc.cpp b/src/proc.cpp deleted file mode 100644 index ea09307..0000000 --- a/src/proc.cpp +++ /dev/null @@ -1,2237 +0,0 @@ -/* - * proc.cpp for Linux - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * Copyright Olivier Daudel - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -/* - LWP (Light Weight Process): just thread, mainly used in Solaris - Task : thread and process in Linux - NPTL(Native POSIX Thread Library) - TGID thread group leader's pid -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include // sched_rr_get_interval(pid, &ts); -#include // basename() -#include // sysconf() POSIX.1-2001 - -#include -//#include //HZ defined, no more used. -//#include "misc.h" // x_atoi() , userName() ,groupname() - -#include "proc.h" -#include "uidstr.h" -#include "ttystr.h" -#include "wchan.h" - -#ifdef GTK -#include "detail_gtk.h" -#else -#include "details.h" //qt -#endif - -#include "proc_common.cpp" // COMMON code !!!! - -#define PROCDIR "/proc" // hmmm - -bool flag_SMPsim = false; // SMP simulation - -extern int flag_thread_ok; -extern bool flag_schedstat; -extern bool flag_show_thread; -extern bool flag_devel; - -int pagesize; -int Proc::update_msec = 1024; - -// socket states, from and touched to avoid name collisions -enum -{ - SSFREE = 0, /* not allocated */ - SSUNCONNECTED, /* unconnected to any socket */ - SSCONNECTING, /* in process of connecting */ - SSCONNECTED, /* connected to socket */ - SSDISCONNECTING /* in process of disconnecting */ -}; - -#define QPS_SCHED_AFFINITY ok - -#ifdef QPS_SCHED_AFFINITY -#ifndef SYS_sched_setaffinity -#define SYS_sched_setaffinity 241 -#endif -#ifndef SYS_sched_getaffinity -#define SYS_sched_getaffinity 242 -#endif - -// Needed for some glibc -int qps_sched_setaffinity(pid_t pid, unsigned int len, unsigned long *mask) -{ - return syscall(SYS_sched_setaffinity, pid, len, mask); -}; -int qps_sched_getaffinity(pid_t pid, unsigned int len, unsigned long *mask) -{ - return syscall(SYS_sched_getaffinity, pid, len, mask); -}; -#endif - -/* - Thread Problems. - pthread_exit() - */ - -struct proc_info_ -{ - int proc_id; - char flag; - char type; - int files; -} proc_info; // TESTING - -struct list_files_ -{ - int proc_id; - int flag; - char *filename; // path + filename -} list_files; // TESTING - -// read() the number of bytes read is returned (zero indicates end of file) -// return the number of bytes read if ok, -1 if failed -inline int read_file(char *name, char *buf, int max) -{ - int fd = open(name, O_RDONLY); - if (fd < 0) - return -1; - int r = read(fd, buf, max); - close(fd); - // buf[r]=0; - return r; -} - -// Description : read proc files -// return 0 : if error occurs. -char buffer_proc[1024 * 4]; // enough..maybe -char *read_proc_file(const char *fname, int pid = -1, int tgid = -1, - int *size = NULL) -{ - static int max_size = 0; - char path[256]; - int r; - - if (pid < 0) - sprintf(path, "/proc/%s", fname); - else - { - if (tgid > 0) - sprintf(path, "/proc/%d/task/%d/%s", tgid, pid, fname); - else - sprintf(path, "/proc/%d/%s", pid, fname); - } - - if (strcmp(fname, "exe") == 0) - { - if ((r = readlink(path, buffer_proc, sizeof(buffer_proc) - 1)) >= 0) - { - buffer_proc[r] = 0; // safer - return buffer_proc; - } - else - return 0; - } - - int fd = open(path, O_RDONLY); - if (fd < 0) - return 0; - r = read(fd, buffer_proc, sizeof(buffer_proc) - 1); // return 0 , -1 , - if (r < 0) - return 0; - - if (max_size < r) - max_size = r; - - if (size != 0) - *size = r; - - buffer_proc[r] = 0; // safer - - return buffer_proc; - // note: not work fgets(sbuf, sizeof(64), fp) why??? -} - -char *read_proc_file2(char *r_path, const char *fname, int *size = NULL) -{ - static int max_size = 0; - char path[256]; - int r; - - // strcpy(path,r_path); - - sprintf(path, "%s/%s", r_path, fname); - - if (strcmp(fname, "exe") == 0) - { - if ((r = readlink(path, buffer_proc, sizeof(buffer_proc) - 1)) >= 0) - { - buffer_proc[r] = 0; // safer - return buffer_proc; - } - else - return 0; - } - - int fd = open(path, O_RDONLY); - if (fd < 0) - return 0; - r = read(fd, buffer_proc, - sizeof(buffer_proc) - 1); // return 0 , -1 , read_count - if (r < 0) - return 0; - - if (max_size < r) - max_size = r; - - if (size != 0) - *size = r; - - buffer_proc[r] = 0; // safer - close(fd); - - return buffer_proc; - // note: not work fgets(sbuf, sizeof(64), fp) why??? -} - -// TEST CODE , Bottleneck -// Description: read /proc/PID/fd/* check opened file, count opened files -// this fuction will be called when every update. -// Return Value : -int proc_pid_fd(const int pid) -{ - char path[256]; - char buffer[256], fname[256]; - DIR *d; - int fdnum; - int len, path_len; - - sprintf(path, "/proc/%d/fd", pid); - - path_len = strlen(path); - d = opendir(path); - - if (!d) - { - // this happend when the process died already or Zombie process - // printf("Qps : read fail !! /proc/%d/fd !!! kernel bug ? - // \n",pid); - return false; - } - - struct dirent *e; - while ((e = readdir(d)) != 0) - { - if (e->d_name[0] == '.') - continue; // skip "." and ".." - - path[path_len] = '/'; - path[path_len + 1] = 0; - strcat(path, e->d_name); - - len = readlink(path, fname, sizeof(fname) - 1); - if (len > 0) - { - fname[len] = 0; - // printf("DEBUG: %s[%s]\n",path,fname); - // if (strcmp(fname,"/dev/null")==0 ) continue; - } - - /// num_opened_files++; - // strcpy(p, e->d_name); - // fdnum = atoi(p); - // read_fd(fdnum, path); - } - closedir(d); - return true; -} - -// new process created -Procinfo::Procinfo(Proc *system_proc, int process_id, int thread_id) : refcnt(1) -{ - first_run = true; - clone = false; - - proc = system_proc; - - if (thread_id < 0) // - { - pid = process_id; - tgid = process_id; // thread group leader's id - } - else - { - pid = thread_id; - tgid = process_id; // thread group leader's id - } - - ppid = 0; // no parent - selected = false; - hidekids = false; - envblock = 0; //!! - - table_child_seq = -1; - child_seq_prev = -1; - - lastchild = 0; - generation = -1; - detail = 0; - - /// per_cpu_times = 0; not yet - - size = 0; - resident = 0; - trs = 0; - drs = 0; - stack = 0; - share = 0; - mem = 0; - - io_read_prev = 0; // ** - io_write_prev = 0; - io_read = 0; // ** - io_write = 0; // ** - - // tgid=0; - pcpu = 0; - pmem = 0; - - old_utime = 0; // this must be current utime ! - old_wcpu = 0; - - command = "noname"; - tty = 0; - nice = 0; - starttime = 0; - state = 'Z'; - cutime = utime = 0; - - nthreads = 0; /* number of threads */ - - hashstr[0] = 0; - hashlen = 0; -} - -Procinfo::~Procinfo() -{ - if (!clone) - { - void watchdog_check_if_finish(QString cmd, Procinfo * p); - watchdog_check_if_finish(command, this); - - if (detail) - { - // printf("~Procinfo() : pid=%d\n",pid); - detail->process_gone(); - detail = 0; - } - - // if(environ) delete environ; - if (envblock) - free(envblock); /// double free , SEGFAULT - } - - // fd_files.squeeze(); - // maps.squeeze(); - /* - if(maps) { - maps->purge(); - delete maps; - } - if(fd_files) { - fd_files->purge(); - delete fd_files; - } - */ - - // if(children) - // { children->clear(); delete children; } - /// delete[] per_cpu_times; -} - -// miscellaneous static initializations -void Proc::init_static() -{ - - // socks.setAutoDelete(true); - /// usocks.setAutoDelete(true); - - pagesize = sysconf(_SC_PAGESIZE); // same getpagesize() in - // printf("pagesize=%d, %d\n",getpagesize(), - // sysconf(_SC_PAGESIZE)); //4027 -} - -// tricky function...(by fasthyun@magicn.com) -// Description : -// let's deal thread as normal process! -// read /proc/PID/task/* and add to Proc::procs[] -int Proc::read_pid_tasks(int pid) -{ - char path[256]; - struct dirent *e; - int thread_pid; - int thread_n = 0; - Procinfo *pi = 0; - - sprintf(path, "/proc/%d/task", pid); - - DIR *d = opendir(path); - if (!d) - return -1; // process dead already! - - while ((e = readdir(d)) != 0) - { - if (e->d_name[0] == '.') - continue; // skip "." , ".." - - thread_pid = atoi(e->d_name); - if (pid == thread_pid) - continue; // skip - - pi = procs.value(thread_pid, NULL); - - if (pi == NULL) - { - pi = new Procinfo(this, pid, thread_pid); - procs.insert(thread_pid, pi); - } - if (pi->readproc() >= 0) - { - pi->generation = current_gen; - // if(pid!=thread_pid) - // pi->cmdline="(thread)"; - } - thread_n++; - } - closedir(d); - return thread_n; -} - -// update wcpu,%cpu field -void Procinfo::calculate_cpu() // -{ -} - -// using cache for Speed up -int Procinfo::hashcmp(char *sbuf) -{ - int statlen; - - statlen = strlen(sbuf); - if (statlen > sizeof(hashstr)) - { - // some user reported 265byte. - printf("Qps BUG: hashstr shortage statlen(%d) > hashstr(%lu), " - "report this " - "message to fasthyun@magicn.com \n", - statlen, sizeof(hashstr)); - abort(); - } - else if (statlen == hashlen) - { - if (memcmp(hashstr, sbuf, statlen) == 0) - { - pcpu = 0; - // 1. I am a sleeping process - // printf("[%d] sleep process \n",pid); - return 1; - } - } - memcpy(hashstr, sbuf, statlen); // to back - hashlen = statlen; - return 0; -} - -int mini_sscanf(const char *s, const char *fmt, ...); - -// Description : read /proc/PID/* or read /proc/PID/task/* -// be called every refresh() time. -// return -1 means the process already dead ! -int Procinfo::readproc() -{ - char cmdbuf[MAX_CMD_LEN]; - char path[64]; - int len; - char *sbuf; // should be enough to acommodate /proc/PID/stat - char *buf; - - int x_pid; // just pid - int i_tty; // - long stime, cstime; - - // Note : /proc/PID/* is not same /proc/task/PID/* - if (isThread()) // flag_thread_ok - { - sprintf(path, "/proc/%d/task/%d", tgid, pid); - } - else - sprintf(path, "/proc/%d", pid); - - if (first_run) - { - // Note: COMMAND(?) , TGID, UID , COMMAND_LINE never - // change ! - old_wcpu = wcpu = pcpu = 0.0; - - // read /proc/PID/status - if ((buf = read_proc_file2(path, "status")) == 0) - return -1; - - // Note: Process_name from - // 1.status (15 chars-name) - // 2.stat (15 chars-name, pass) - // 3.cmdline : full name (sometimes have null, Thread - // can't use - // cmdline) - // 4.exe : full name (frequently this does not exist, - // thread can't use - // exe) - // 5.comm : 15 chars ? - // - // Note: - // 1. thread's name_max is 15 chars - - if (mini_sscanf(buf, "Name: %S\n", cmdbuf) == 0) - return -1; - else - { - command = cmdbuf; - if (command.contains("kthread")) - hidekids = true; // kthread, kthreadd , - // ///Procinfo::qps_pid=pid; - } - - if (mini_sscanf(buf, "Tgid: %d ", &tgid) == 0) - return -1; - if (mini_sscanf(buf, "Uid: %d %d %d %d", &uid, &euid, &suid, &fsuid) != - 4) - return -1; - if (mini_sscanf(buf, "Gid: %d %d %d %d", &gid, &egid, &sgid, &fsgid) != - 4) - return -1; - - username = userName(uid, euid); - groupname = groupName(gid, egid); - - int bug = 0; - char cmdline_cmd[4096]; // some cmdline very large! ex)chrome - // read /proc/pid/cmdline - int size; - cmdline_cmd[0] = 0; - - // anyone can read [cmdline] - if ((buf = read_proc_file2(path, "cmdline", &size)) == 0) - return -1; - else - { - // printf("DEBUG: size=%d \n",size); - int cmdlen = strlen(buf); - - if (cmdlen == 0) - { - // 1. kthread - // printf("Qps:debug no_cmdline pid=%d\n",pid ); - cmdline = ""; - } - // for non-ascii locale language - // cmdline = codec->toUnicode(cmdbuf,strlen(cmdbuf)); - else - { - - // change 0x00,0xA to ' ' - for (int i = 0; i < size - 1; i++) // OVERFLOW - if (buf[i] == 0 or buf[i] == 0x0A) - buf[i] = ' '; - cmdline = buf; - strcpy(cmdline_cmd, buf); - } - } - - // VERY COMPLEX CODE - // because Command's MAX_length is only 15, so sometimes - // cmd_name truncated, - // we should guess ... - // - // The solution is... - // 1.check [exe] file ( only owner can read it) - // 2.check [cmdline] ( anyone can read it ) - // 3.check [comm] - // - if (command.size() == 15) - { - // only root & owner can read [exe] link - /* - if((buf= read_proc_file2(path,"exe")) !=0 ) - { - // printf("Qps:debug %s\n",buf ); - if(strlen(basename(buf))>15 and - strncmp(qPrintable(command),basename(buf),15)==0 - ) - command=basename(buf); // no - memory leak ! - else ;// just use command - //printf("Qps:debug %s\n",buf ); - } */ - - if (true) // guess the full name of the command - { - // Use /proc/PID/cmdline, comm, status - // ex) - // /usr/lib/chromium/chromium --option1 - // --option2 - // python /usr/lib/system-service-d - // pam: gdm-password - // hald-addon-input: Listing On /dev~ - // - char *p; - p = strstr(cmdline_cmd, ": "); // cut the options ! - if (p != 0) - *p = 0; - p = strchr(cmdline_cmd, ' '); // cut the options ! - if (p != 0) - *p = 0; - - // printf("Qps:debug %s\n",cmdline_cmd ); - char *pstart = strstr(basename(cmdline_cmd), cmdbuf); - if (pstart != 0) - { - command = pstart; // copy - /// printf("Qps:debug2 - /// %s\n",basename(cmdline_cmd)); - } - } - } - - if (isThread()) - cmdline = command + " (thread)"; - - if (flag_devel and bug) - { - // command.append("^"); - cmdline += " ^ Qps: may be a wrong commandline "; - } - - void watchdog_check_if_start(QString cmd, Procinfo * ps); - watchdog_check_if_start(command, this); // segfault possible. - - first_run = false; - } - - if (flag_schedstat == true) - { - // if no change then return. twice faster ! - // MAX_256 bytes check...? - // 2.6.9 upper only and some system no has - if ((sbuf = read_proc_file2(path, "schedstat")) == 0) - return -1; - - if (hashcmp(sbuf)) - return 1; // no change - } - // read /proc/PID/stat - if ((sbuf = read_proc_file2(path, "stat")) == 0) - return -1; - - if (flag_schedstat == false) // if no change then return. twice faster ! - { - if (hashcmp(sbuf)) - return 1; - } - - /// if (proc_pid_fd(pid)== true) ; // bottleneck !! - - /* - Not all values from /proc/#/stat are interesting; the ones left - out - have been retained in comments to see where they should go, in - case - they are needed again. - - Notes : - 1. man -S 5 proc - 2. man -S 2 times - 3. ppid can be changed when parent dead ! - 4. initial utime maybe 0, so %CPU field NotAnumber !! - utime: user time - stime: kernel mode tick - cutime : The number of jiffies that this process's waited-for - children have been scheduled in user mode. - - #jiffies == tick - */ - unsigned int guest_utime, cguest_utime; -#if 1 - char *p, *p1; - // in odd cases the name can contain spaces and '(' or ')' and numbers, - // so - // this makes - // parsing more difficult. We scan for the outermost '(' ')' to find the - // name. - p = strchr(sbuf, '('); - p1 = strrchr(sbuf, ')'); - if (p == 0 || p1 == 0) - return -1; - p1++; - // we can safely use sscanf() on the rest of the string - sscanf(p1, - " %c %d %d %d %d %d" - " %lu %lu %lu %lu %lu " - "%ld %ld %ld %ld %d %d %d %*s %lu %*s %*s %*s %*s %*s %*s %*s %*s " - "%*s %*s %*s %*s %lu %*s %*s %*s %u %*s %*s %*s %u %u", -#else - // some errors will occur ! - mini_sscanf( - sbuf, - "%d (%S) %c %d %d %d %d %d" - "%lu %lu %lu %lu %lu " - "%ld %ld %ld %ld %d %d %d %*s %lu %*s %*s %*s %*s %*s %*s %*s %*s " - "%*s %*s %*s %*s %lu %*s %*s %*s %u %*s %*s %*s %u %u", - &x_pid, &cmdbuf[0], -#endif - &state, &ppid, &pgrp, &session, &i_tty, &tpgid, &flags, &minflt, - &cminflt, &majflt, &cmajflt, &utime, &stime, &cutime, &cstime, - &priority, &nice, &nthreads /* number of threads v2.6 */, - /* itrealvalue */ - &starttime, /* start time(static) */ // jiffes - /* vsize */ - /* rss */ - /* rlim, startcode, endcode, startstack kstkesp kstkeip, - signal, blocked, sigignore, sigcatch */ - &wchan, - /* 0L, 0L, exit_signal */ - &which_cpu - /* rt_priority, policy, delayacct_blkio_ticks */ - , - &guest_utime, &cguest_utime); - - starttime = proc->boot_time /* secs */ + (starttime / proc->clk_tick); - - tty = (dev_t)i_tty; // hmmm - // if(tty!=0) printf("pid=%d tty =%d\n",pid,tty); - - // if(guest_utime>0 or cguest_utime>0) - // printf("cmd [%s] guest_utime=%d cguest_utime - //=%d\n",qPrintable(command),guest_utime,cguest_utime); - - utime += stime; // we make no user/system time distinction - cutime += cstime; - - if (old_utime > 0) // check.. - { - int dcpu; - dcpu = utime - old_utime; // user_time from proc - if (dcpu < 0) - { - // why.. this occurs ? - // Qps exception:[3230,firefox] dcpu=-22 utime=39268 - // old_utime=39290 why - // occur? - if (flag_devel) - printf("Qps :[%d,%s] dcpu=%d utime=%ld " - "old_utime=%ld why occurs?\n", - pid, qPrintable(command), dcpu, utime, old_utime); - return 1; - } - - // gettimeofday(&tv, 0); //sys/time - if (proc->dt_total > 0) // move to Proc ?? - { - pcpu = 100.0 * dcpu / proc->dt_total; - if (Procview::flag_pcpu_single == true) - pcpu *= proc->num_cpus; // - } - // else too fast read again - // printf("Qps exception: dt_total=%d report to - // fasthyun@magicn.com - // \n",Proc::dt_total); - - if (flag_devel and pcpu > 100) // DEBUG CODE - { - printf("Qps pcpu error: %0.0f%% [%d,%s] dt_total=%ld " - "dcpu=%d utime=%ld " - "old_utime=%ld \n", - pcpu, pid, qPrintable(command), proc->dt_total, dcpu, utime, - old_utime); - pcpu = 99.99; - } - - const float a = Procview::avg_factor; - wcpu = a * old_wcpu + (1 - a) * pcpu; - } - old_tv = tv; - old_wcpu = wcpu; - old_utime = utime; // **** - - // read /proc/%PID/statm - memory usage - if (1) - { - if ((buf = read_proc_file2(path, "statm")) == 0) - return -1; // kernel 2.2 ? - sscanf(buf, "%lu %lu %lu %lu %lu %lu %lu", &size, &resident, &share, - &trs, &lrs, &drs, &dt); - size *= pagesize / 1024; // total memory in kByte - resident *= pagesize / 1024; - share *= pagesize / 1024; // share - // trs ; // text(code) - // lrs ; // zero : lib, awlays zero in - // Kernel 2.6 - // drs ; // data: wrong in kernel 2.6 - // dt ; // zero : in Kernel 2.6 - mem = resident - share; - // pmem = 100.0 * resident / proc->mem_total; - pmem = 100.0 * mem / proc->mem_total; - } - - // read /proc/PID/status check !! - if ((buf = read_proc_file2(path, "status")) == 0) - return -1; - else - { - // slpavg : not supported in kernel 2.4; default value of -1 - if (mini_sscanf(buf, "SleepAVG:%d", &slpavg) == 0) - slpavg = -1; - - if (strstr(buf, "VmSize:")) - { - // mini_sscanf(p, "VmSize: %d",&size); // XXX - // mini_sscanf(p, "VmRSS: %d",&resident); - // mini_sscanf(sbuf, "VmLib: %d",&share); - mini_sscanf(buf, "VmData: %d", &drs); // data in kByte - mini_sscanf(buf, "VmStk: %d", &stack); // stack in kByte - mini_sscanf(buf, "VmExe: %d", &trs); // text - } - } - - /* - generally - shared = RSS - ( CODE + DATA + STACK ) - share= resident - trs -drs -stack; - - // Defines from task_mmu.c of kernel source - total_vm==size - data = mm->total_vm - mm->shared_vm - mm->stack_vm; - swap = p->size - p->resident ; - */ - - // read /proc/PID/file_io - // NOTE: 2.6.11 dont have IO file - // COMPLEX_CODE - if ((buf = read_proc_file2(path, "io")) != 0) - { - // rchar = ... not file maybe sockread - // - mini_sscanf(buf, "read_bytes:%d", &io_read); - mini_sscanf(buf, "write_bytes:%d", &io_write); - - // if(io_read_prev!=0) - { - if (io_read_prev == 0) - io_read_prev = io_read; - if (io_write_prev == 0) - io_write_prev = io_write; - - // NOTE: Kbps right???? - io_read_KBps = (io_read - io_read_prev) / - proc->update_msec; // not accurate.... - io_write_KBps = (io_write - io_write_prev) / proc->update_msec; - - proc->io_byte += io_read_KBps; // test - proc->io_byte += io_write_KBps; - } - - io_read_prev = io_read; - io_write_prev = io_write; - - // io_read>>=10; // divide by 1024 - // io_write>>=10; // divide by 1024 - } - // per_cpu_times = 0; // not yet - - if ((buf = read_proc_file2(path, "wchan")) != 0) - { - wchan_str = buf; - } - - policy = -1; // will get it when needed - rtprio = -1; // ditto - tms = -1; // ditto - - // useless ? if(detail) detail->set_procinfo(this); // BAD !!! - return 2; // return ok. -} - -// just grab the load averages -// called by -void Proc::read_loadavg() -{ - char path[80]; - char buf[512]; - int n; - strcpy(path, "/proc/loadavg"); - if ((n = read_file(path, buf, sizeof(buf) - 1)) <= 0) - { - fprintf(stderr, "qps: Cannot open /proc/loadavg (make sure " - "/proc is mounted)\n"); - exit(1); - } - buf[n] = '\0'; - sscanf(buf, "%f %f %f", &loadavg[0], &loadavg[1], &loadavg[2]); -} - -int Proc::countCpu() -{ - static bool first_run = true; - char path[80]; - char buf[1024 * 8]; // for SMP - - int num_cpus = 0, n; - // read system status /proc/stat - strcpy(path, "/proc/stat"); - // if((buf= read_proc_file("stat:)) ==0 ) return -1; - if ((n = read_file(path, buf, sizeof(buf) - 1)) <= 0) - { - printf("Qps Error: /proc/stat can't be read ! check it and " - "report to " - "fasthyun@magicn.com\n"); - abort(); // return 0; - } - buf[n] = '\0'; - - // count (current) cpu of system - char *p; - p = strstr(buf, "cpu"); - while (p < buf + sizeof(buf) - 4 && strncmp(p, "cpu", 3) == 0) - { - num_cpus++; - if (strncmp(p, "cpu0", 4) == 0) - Proc::num_cpus--; - p = strchr(p, '\n'); - if (p) - p++; - } - - if (flag_devel and flag_SMPsim) - { - // num_cpus=64; - int vals[] = {2, 4, 8, 16, 32}; - int r = rand() % 5; - num_cpus = vals[r]; - } - return num_cpus; -} - -// LINUX -// Description: read common information for all processes -// return value -// -1 : too fast refresh ! -int Proc::read_system() // -{ - static bool first_run = true; - char path[80]; - char buf[1024 * 8]; // for SMP - - char *p; - int n; - - if (first_run) - { - /* Version 2.4.x ? */ - strcpy(path, "/proc/vmstat"); - if (!stat(path, (struct stat *)buf)) - flag_24_ok = false; - else - flag_24_ok = true; - - /* NPTL(Native POSIX Thread Library) */ - strcpy(path, "/proc/1/task"); - if (!stat(path, (struct stat *)buf)) - flag_thread_ok = true; - else - flag_thread_ok = false; - - /* check schedstat */ - strcpy(path, "/proc/1/schedstat"); // some system doesn't have - if (!stat(path, (struct stat *)buf)) - flag_schedstat = true; - else - flag_schedstat = false; - - strcpy(path, "/proc/stat"); - if ((n = read_file(path, buf, sizeof(buf) - 1)) <= 0) - return 0; - buf[n] = '\0'; - p = strstr(buf, "btime"); - if (p == NULL) - { - // used - printf("Qps: A bug occurs ! [boot_time] \n"); - // boot_time= current time - } - else - { - p += 6; - // sscanf(p, "%d", &Proc::boot_time); //???? why - // segfault??? - sscanf(p, "%d", &boot_time); - } - - // Max SMP 1024 cpus, MOVETO: COMMON - int max_cpus = 512; - cpu_times_vec = new unsigned[CPUTIMES * max_cpus]; //??? +2 - old_cpu_times_vec = new unsigned[CPUTIMES * max_cpus]; - - // init - for (int cpu = 0; cpu < max_cpus; cpu++) - for (int i = 0; i < CPUTIMES; i++) - { - cpu_times(cpu, i) = 0; - old_cpu_times(cpu, i) = 0; - } - - // first_run=false; // not yet , at the bottom of this function - } - - // read system status /proc/stat - strcpy(path, "/proc/stat"); - // if((buf= read_proc_file("stat:)) ==0 ) return -1; - if ((n = read_file(path, buf, sizeof(buf) - 1)) <= 0) - { - printf("Qps Error: /proc/stat can't be read ! check it and " - "report to " - "fasthyun@magicn.com\n"); - abort(); // return 0; - } - buf[n] = '\0'; - - if (true) - { - // count (current) cpu of system - char *p; - p = strstr(buf, "cpu"); - num_cpus = 0; - while (p < buf + sizeof(buf) - 4 && strncmp(p, "cpu", 3) == 0) - { - num_cpus++; - if (strncmp(p, "cpu0", 4) == 0) - Proc::num_cpus--; - p = strchr(p, '\n'); - if (p) - p++; - } - - if (flag_SMPsim) - { - int vals[] = {2, 4, 8, 16, 32}; - int r = rand() % 5; - num_cpus = vals[r]; - num_cpus = 8; - } - - // Hotplugging Detection : save total_cpu - if (Proc::num_cpus != Proc::old_num_cpus) - { - // for(int i = 0; i < CPUTIMES; i++) - // cpu_times(num_cpus, i) = - // cpu_times(Proc::old_num_cpus, - // i); - - Proc::old_num_cpus = Proc::num_cpus; - } - } - - // backup old values : important******* - for (int cpu = 0; cpu < Proc::num_cpus + 1; cpu++) - { - for (int i = 0; i < CPUTIMES; i++) - old_cpu_times(cpu, i) = cpu_times(cpu, i); - } - - /* - /proc/stat - cpu# user nice system idle iowait(2.6) - irq(2.6) sft(2.6) steal(2.6.11) guest(2.6.24) - cpu0 3350 9 535 160879 - 1929 105 326 5 - 1200 - - Q1: kernel 2.4 cpu0 exist ? - */ - - // Total_cpu - int total_cpu = Proc::num_cpus; - unsigned user, nice, system, idle, iowait, irq, sftirq, steal, guest, nflds; - nflds = sscanf(buf, "cpu %u %u %u %u %u %u %u %u %u", &user, &nice, &system, - &idle, &iowait, &irq, &sftirq, &steal, &guest); - if (nflds > 4) - { - // kernel 2.6.x - system += (irq + sftirq); - idle += iowait; - } - if (nflds == 9) - { - system += steal; - system += guest; - } - cpu_times(Proc::num_cpus, CPUTIME_USER) = user; - cpu_times(Proc::num_cpus, CPUTIME_NICE) = nice; - cpu_times(Proc::num_cpus, CPUTIME_SYSTEM) = system; - cpu_times(Proc::num_cpus, CPUTIME_IDLE) = idle; - - // DRAFT! - // num_cpus == total_cpu - // - // dt_total= user + system + nice + idle - // dt_used= user + system; - Proc::dt_used = - user - old_cpu_times(Proc::num_cpus, - CPUTIME_USER); // infobar uses this value - Proc::dt_used += system - old_cpu_times(Proc::num_cpus, CPUTIME_SYSTEM); - Proc::dt_total = dt_used + nice - - old_cpu_times(Proc::num_cpus, CPUTIME_NICE) + idle - - old_cpu_times(Proc::num_cpus, CPUTIME_IDLE); - - load_cpu = (float)Proc::dt_used / Proc::dt_total; // COMMON - - if (first_run) - { - // printf("\n==================== tooo fast - //=================================\n"); - // printf("DEBUG:dt_total=%d - // dt_used=%d\n",Proc::dt_total,Proc::dt_used); - // return -1; // too early refresh again !! - } - if (Proc::dt_total == 0) - { - //????? - printf("Error: dt_total=0 , dt_used=%ld(%u) report to " - "fasthyun@magicn.com\n", - Proc::dt_used, old_cpu_times(Proc::num_cpus, CPUTIME_IDLE)); - dt_total = 500; // more tolerable? - // abort(); // stdlib.h - } - - // void watchdog_syscpu(int ); - // watchdog_syscpu((user-old_cpu_times(num_cpus,CPUTIME_USER))*100/dt_total); - //// test - - // if(flag_devel and flag_SMPsim ) - if (flag_SMPsim) - { - // for Developer only !!! - // printf("user%d nuce%d system%d - // idle%d\n",user,nice,system,idle); - for (int cpu = 0; cpu < num_cpus; cpu++) - { - // stdlib.h, int rand(); - if (dt_used != 0) - cpu_times(cpu, CPUTIME_USER) = - old_cpu_times(cpu, CPUTIME_USER) + rand() % dt_used; - else - cpu_times(cpu, CPUTIME_USER) = 0; - cpu_times(cpu, CPUTIME_NICE) = nice; - cpu_times(cpu, CPUTIME_SYSTEM) = system; - cpu_times(cpu, CPUTIME_IDLE) = idle; - } - } - else - { - // Single-CPU and SMP(Multi-CPU) - for (int cpu = 0; cpu < num_cpus; cpu++) - { - char cpu_buf[10]; - sprintf(cpu_buf, "cpu%d", cpu); - if ((p = strstr(buf, cpu_buf)) != 0) - { - nflds = sscanf(p, "%*s %u %u %u %u %u %u %u %u %u", - &cpu_times(cpu, CPUTIME_USER), - &cpu_times(cpu, CPUTIME_NICE), - &cpu_times(cpu, CPUTIME_SYSTEM), - &cpu_times(cpu, CPUTIME_IDLE), &iowait, &irq, - &sftirq, &steal, &guest); - // cpu_times(cpu, CPUTIME_USER),cpu_times(cpu, - // CPUTIME_NICE), - if (nflds > 4) - { - // kernel 2.6.x - cpu_times(cpu, CPUTIME_SYSTEM) += (irq + sftirq); - cpu_times(cpu, CPUTIME_IDLE) += iowait; - } - if (nflds == 9) - { - cpu_times(cpu, CPUTIME_SYSTEM) += (steal + guest); - } - - // 2.4.27-SMP bug ? - } - else - { - fprintf(stderr, "Qps: Error reading info for " - "cpu%d (/proc/stat)\n", - cpu); - abort(); - } - } - } - - // read memory info - strcpy(path, PROCDIR); - strcat(path, "/meminfo"); - if ((n = read_file(path, buf, sizeof(buf) - 1)) <= 0) - return 0; - buf[n] = '\0'; - - // Skip the old /meminfo cruft, making this work in post-2.1.42 kernels - // as well. (values are now in kB) - if ((p = strstr(buf, "MemTotal:"))) - sscanf(p, "MemTotal: %d kB\n", &mem_total); - if ((p = strstr(buf, "MemFree:")) != NULL) - sscanf(p, "MemFree: %d kB\n", &mem_free); - if ((p = strstr(buf, "Buffers:")) != NULL) - sscanf(p, "Buffers: %d kB\n", &mem_buffers); - if ((p = strstr(buf, "Cached:")) != NULL) - sscanf(p, "Cached: %d kB\n", &mem_cached); - - p = strstr(buf, "SwapTotal:"); - sscanf(p, "SwapTotal: %d kB\nSwapFree: %d kB\n", &swap_total, &swap_free); - - first_run = false; - return 0; -} - -int Procinfo::get_policy() -{ - if (policy == -1) - policy = sched_getscheduler(pid); - return policy; -} - -int Procinfo::get_rtprio() -{ - if (rtprio == -1) - { - struct sched_param p; - if (sched_getparam(pid, &p) == 0) - rtprio = p.sched_priority; - } - return rtprio; -} - -double Procinfo::get_tms() -{ - struct timespec ts; - if (sched_rr_get_interval(pid, &ts) == -1) // POSIX - tms = -1; // should not be possible - else - { - tms = ts.tv_nsec; // nano seconds - tms /= 1000000; // mili seconds - tms += ts.tv_sec * 1000; - } - return tms; -} - -unsigned long Procinfo::get_affcpu() -{ -#ifdef QPS_SCHED_AFFINITY - if (qps_sched_getaffinity(pid, sizeof(unsigned long), &affcpu) == -1) - affcpu = (unsigned long)0; -#else - if (sched_getaffinity(pid, sizeof(unsigned long), (cpu_set_t *)&affcpu) == - -1) - affcpu = (unsigned long)0; -#endif - return affcpu; -} - -// Description : read /proc/PID/fd/* (SYMBOLIC LINK NAME) -/* We need to implement support for IPV6 and sctp ? */ -void Procinfo::read_fd(int fdnum, char *path) -{ - int len; - char buf[128]; - struct stat sb; - - // The fd mode is contained in the link permission bits - if (lstat(path, &sb) < 0) - return; - int mode = 0; - if (sb.st_mode & 0400) - mode |= OPEN_READ; - if (sb.st_mode & 0200) - mode |= OPEN_WRITE; - - if ((len = readlink(path, buf, sizeof(buf) - 1)) > 0) - { - buf[len] = '\0'; - unsigned long dev, ino; - - // check socket_fd - if ((buf[0] == '[' and sscanf(buf, "[%lx]:%lu", &dev, &ino) == 2 and - dev == 0) // Linux 2.0 style - || - sscanf(buf, "socket:[%lu]", &ino) > 0) // Linux 2.1 upper - { - Sockinfo *si = NULL; - si = proc->socks.value(ino, NULL); // sock - char buf[80]; - if (si) - { - printf("sock ino=%lu\n", ino); - si->pid = pid; - // a TCP or UDP socket - sock_inodes.append(new SockInode(fdnum, ino)); - sprintf(buf, "%s socket %lu", - si->proto == Sockinfo::TCP ? "TCP" : "UDP", ino); - fd_files.append(new Fileinfo(fdnum, buf, mode)); - return; - } - else - { - // maybe a unix domain socket? - // read_usockets(); - UnixSocket *us = NULL; - - us = proc->usocks.value(ino, NULL); - if (us) - { - const char *tp = "?", *st = "?"; - switch (us->type) - { - case SOCK_STREAM: - tp = "stream"; - break; - case SOCK_DGRAM: - tp = "dgram"; - break; - } - switch (us->state) - { - case SSFREE: - st = "free"; - break; - case SSUNCONNECTED: - st = "unconn"; - break; - case SSCONNECTING: - st = "connecting"; - break; - case SSCONNECTED: - st = "connected"; - break; - case SSDISCONNECTING: - st = "disconn"; - break; - } - sprintf(buf, "UNIX domain socket %lu (%s, %s) ", ino, tp, - st); - QString s = buf; - s.append(us->name); - fd_files.append(new Fileinfo(fdnum, s, mode)); - return; - } - } - } - // normal filess - // assume fds will be read in increasing order - fd_files.append(new Fileinfo(fdnum, buf, mode)); - } -} - -// Description : -// read /PID/fd opened files -// return true if /proc/PID/fd could be read, false otherwise -// store fileinfo, and also socket inodes separately -// -// called by Detail() -bool Procinfo::read_fds() -{ - char path[128], *p; - if (flag_thread_ok && flag_show_thread) - sprintf(path, "/proc/%d/task/%d/fd", pid, pid); - else - sprintf(path, "/proc/%d/fd", pid); - - DIR *d = opendir(path); - if (!d) - return false; - - /* - if(!sock_inodes) sock_inodes = new Svec(4); - else sock_inodes->purge(); */ - - strcat(path, "/"); - - fd_files.clear(); // - struct dirent *e; - while ((e = readdir(d)) != 0) - { - char str[128]; - if (e->d_name[0] == '.') - continue; // skip . and .. - int fdnum = atoi(e->d_name); - strcpy(str, path); - strcat(str, e->d_name); - // printf("str=%s\n",str); - read_fd(fdnum, str); - } - // printf("end str=\n"); - closedir(d); - return true; -} - -// tcp, udp -bool Proc::read_socket_list(Sockinfo::proto_t proto, const char *filename) -{ - char path[80]; - sprintf(path, "/proc/net/%s", filename); - FILE *f = fopen(path, "r"); - if (!f) - return false; - - char buf[128 * 3]; - // Header - // sl local_addr rem_addr st tx_queue rx_queue tr tm->when retrnsmt - // uid - // timeout inode - - Sockinfo si; - - printf("read_socket_list()\n"); - fgets(buf, sizeof(buf), f); // skip header - while (fgets(buf, sizeof(buf), f) != 0) - { - // Sockinfo *si = new Sockinfo; - si.pid = -1; - si.proto = proto; - unsigned local_port, rem_port, st, tr; - sscanf(buf + 6, "%x:%x %x:%x %x %x:%x %x:%x %x %d %d %d", - &si.local_addr, &local_port, &si.rem_addr, &rem_port, &st, - &si.tx_queue, &si.rx_queue, &tr, &si.tm_when, &si.rexmits, - &si.uid, &si.timeout, &si.inode); - // fix fields that aren't sizeof(int) - si.local_port = local_port; - si.rem_port = rem_port; - si.st = st; - si.tr = tr; - - Sockinfo *psi; - psi = socks.value(si.inode, NULL); - if (psi == NULL) - { - printf("inode =%d \n", si.inode); - psi = new Sockinfo; - *psi = si; - socks.insert(si.inode, psi); - } - else - *psi = si; - - // linear_socks.add(si); - } - fclose(f); - return true; -} - -bool Proc::read_usocket_list() -{ - char path[80]; - strcpy(path, PROCDIR); - strcat(path, "/net/unix"); - FILE *f = fopen(path, "r"); - if (!f) - return false; - - char buf[256]; - fgets(buf, sizeof(buf), f); // skip header - while (fgets(buf, sizeof(buf), f)) - { - if (buf[0]) - buf[strlen(buf) - 1] = '\0'; // chomp newline - // UnixSocket *us = new UnixSocket; - UnixSocket us; - - unsigned q; - unsigned type, state; - int n; - sscanf(buf, "%x: %x %x %x %x %x %ld %n", - // Num refcount protocol flags type state indoe path - &q, &q, &q /*protocol*/, &us.flags, &type, &state, &us.inode, - &n); - us.name = buf + n; - us.type = type; - us.state = state; - - UnixSocket *pus; - pus = usocks.value(us.inode, NULL); - if (pus == NULL) - { - printf("inode =%lu \n", us.inode); - - pus = new UnixSocket; - *pus = us; - usocks.insert(us.inode, pus); - } - else - *pus = us; - } - fclose(f); - return true; -} - -void Proc::read_sockets() -{ - // socks.clear(); - - // memory leak !! - if (!read_socket_list(Sockinfo::TCP, "tcp") || - !read_socket_list(Sockinfo::UDP, "udp")) - return; - // remove no more socket ino - read_usocket_list(); - - socks_current = true; -} - -void Proc::read_usockets() -{ - if (usocks_current) - return; - - usocks.clear(); - if (!read_usocket_list()) - return; - - usocks_current = true; -} - -void Proc::invalidate_sockets() { socks_current = usocks_current = false; } - -// return true if /proc/XX/maps could be read, false otherwise -bool Procinfo::read_maps() -{ - // idea: here we could readlink /proc/XX/exe to identify the executable - // when running 2.0.x - char name[80]; - - if (flag_thread_ok && flag_show_thread) - sprintf(name, "/proc/%d/task/%d/maps", pid, pid); - else - sprintf(name, "/proc/%d/maps", pid); - - FILE *f = fopen(name, "r"); - if (!f) - return false; - - char line[1024]; // lines can be longer , SEGFAULT - - while (fgets(line, sizeof(line), f)) - { - Mapsinfo *mi = new Mapsinfo; - int n; - sscanf(line, "%lx-%lx %4c %lx %x:%x %lu%n", - // sscanf(line, "%lx-%lx %4c %lx %x:%x %n", - &mi->from, &mi->to, mi->perm, &mi->offset, &mi->major, - &mi->minor, &mi->inode, &n); - if (line[n] != '\n') - { - int len = strlen(line); - if (line[len - 1] == '\n') - line[len - 1] = '\0'; - while (line[n] == ' ' && line[n]) - n++; - mi->filename = line + n; - } - else if ((mi->major | mi->minor | mi->inode) == 0) - mi->filename = "(anonymous)"; - maps.append(mi); - } - fclose(f); - if (maps.size() == 0) - return false; - - return true; -} - -// DRAFT CODE: -// return true if /proc/777/environ could be read, false otherwise -int fsize(char *fname); -bool Procinfo::read_environ() -{ - int file_size = 0; - int size; - char path[256]; - - environ.clear(); // - if (flag_thread_ok && flag_show_thread) - sprintf(path, "/proc/%d/task/%d/environ", pid, pid); - else - sprintf(path, "/proc/%d/environ", pid); - - file_size = fsize(path); - if (file_size <= 0) - return false; - - envblock = (char *)malloc(file_size + 1); - size = read_file(path, envblock, file_size + 1); - if (size <= 0) - return false; - - // kernel 2.6.x has a bug - if (envblock[size - 2] == 0) // how to check the bug. - { - char buf[128]; - sprintf(buf, "Kernel Bug= wrong environments ! please, check " - "/proc/%d/environ !", - pid); - size = strlen(buf) + 1; - if (file_size > size) - strcpy(envblock, buf); - } - - int i = 0, n = 0, v = 0; - char ch; - - for (i = 0; i < size; i++) - { - ch = envblock[i]; - if (ch == '=') - { - envblock[i] = 0; - v = i + 1; - } - if (ch == 0) - { - NameValue nv(&envblock[n], &envblock[v]); - environ.append(nv); - // printf("%s %s\n",&envblock[n],&envblock[v]); - n = i + 1; - } - } - if (envblock) - { - free(envblock); // refresh() // INVALID VALGRIND - envblock = 0; - } - return true; -} - -// CWD,ROOT only so... -Cat_dir::Cat_dir(const QString &heading, const QString &explain, const char *dirname, - QString Procinfo::*member) - : Cat_string(heading, explain), dir(dirname), cache(member) -{ -} - -QString Cat_dir::string(Procinfo *p) -{ - if ((p->*cache).isNull()) - { - char path[128], buf[512]; - - if (flag_thread_ok && flag_show_thread) - sprintf(path, "/proc/%d/task/%d/%s", p->pid, p->pid, dir); - else - sprintf(path, "/proc/%d/%s", p->pid, dir); - - int n = readlink(path, buf, sizeof(buf) - 1); - if (n < 0) - { - // Either a kernel process, or access denied. - // A hyphen is visually least disturbing here. - p->*cache = "-"; - return p->*cache; - } - else if (buf[0] != '[') - { - // linux >= 2.1.x: path name directly in link - buf[n] = '\0'; - p->*cache = buf; - return p->*cache; - } - - // Either a Linux 2.0 link in [device]:inode form, or a Solaris - // link. - // To resolve it, we just chdir() to it and see where we end up. - // Perhaps we should change back later? - if (chdir(path) < 0) - { - p->*cache = "-"; // Most likely access denied - } - else - { - // getcwd() is fairly expensive, but this is cached - // anyway - if (!getcwd(buf, sizeof(buf))) - { - p->*cache = "(deleted)"; - } - else - p->*cache = buf; - } - } - return p->*cache; -} - -Cat_state::Cat_state(const QString &heading, const QString &explain) - : Category(heading, explain) -{ -} - -QString Cat_state::string(Procinfo *p) -{ - QString s(" "); - int ni = p->nice; - - s[0] = p->state; - s[1] = (p->resident == 0 && p->state != 'Z') ? 'W' : ' '; - s[2] = (ni > 0) ? 'N' : ((ni < 0) ? '<' : ' '); - return s; -} - -// LINUX -Cat_policy::Cat_policy(const QString &heading, const QString &explain) - : Category(heading, explain) -{ -} - -QString Cat_policy::string(Procinfo *p) -{ - QString s; - switch (p->get_policy()) - { - case SCHED_FIFO: - s = "FI"; - break; // first in, first out - case SCHED_RR: - s = "RR"; - break; // round-robin - case SCHED_OTHER: - s = "TS"; - break; // time-sharing - default: - s = "??"; - break; - } - return s; -} - -int Cat_policy::compare(Procinfo *a, Procinfo *b) -{ - return b->get_policy() - a->get_policy(); -} - -Cat_rtprio::Cat_rtprio(const QString &heading, const QString &explain) - : Category(heading, explain) -{ -} - -QString Cat_rtprio::string(Procinfo *p) -{ - QString s; - s.setNum(p->get_rtprio()); - return s; -} - -int Cat_rtprio::compare(Procinfo *a, Procinfo *b) -{ - return b->get_rtprio() - a->get_rtprio(); -} - -// maybe tms COMMON -Cat_tms::Cat_tms(const QString &heading, const QString &explain) - : Category(heading, explain) -{ -} - -QString Cat_tms::string(Procinfo *p) -{ - QString s; - p->tms = p->get_tms(); - s.sprintf("%.3f", p->tms); - // s.sprintf("%d",p->tms); - return s; -} - -int Cat_tms::compare(Procinfo *a, Procinfo *b) -{ - return (int)((b->get_tms() - a->get_tms()) * 1000); -} - -Cat_affcpu::Cat_affcpu(const QString &heading, const QString &explain) - : Category(heading, explain) -{ -} - -QString Cat_affcpu::string(Procinfo *p) -{ - QString s; - p->affcpu = p->get_affcpu(); - s.sprintf("%lx", p->affcpu); - return s; -} -/* - int Cat_affcpu::compare(Procinfo *a, Procinfo *b) - { - return (int)(b->affcpu - a->affcpu); - } - */ - -// LINUX or COMMON? -Cat_time::Cat_time(const QString &heading, const QString &explain) - : Category(heading, explain) -{ -} - -QString Cat_time::string(Procinfo *p) -{ - QString s; - char buff[64]; - int ticks = p->utime; - int ms; - - int proctick = p->proc->clk_tick; - - if (Procview::flag_cumulative) - ticks += p->cutime; - - int t = ticks / p->proc->clk_tick; // seconds - // COMPLEX CODE - if (t < 10) - { // ex. 9.23s - ms = ticks / (p->proc->clk_tick / 100) % 100; // Need FIX - sprintf(buff, "%1d.%02ds", t, ms); - } - else if (t < 60) - { // ex. 48s - sprintf(buff, "%5ds", t); - } - else if (t < 60 * 10) - { // ex. 8.9m, 9.0m - sprintf(buff, "%2d.%1dm", t / 60, (t % 60) / 6); - } - else if (t < 60 * 60) - { // 58m - sprintf(buff, "%5dm", t / 60); - } - else if (t < 24 * 3600) - { // - int h = t / 3600; // 1hour = 3600 = 60m*60s - t %= 3600; - sprintf(buff, "%2d:%02d", h, t / 60); - } - else if (t < 10 * 24 * 3600) - { // - int d = t / 86400; // 1 day = 24* 3600s - t %= 86400; - sprintf(buff, "%2d.%1dd", d, (t * 10 / (3600 * 24))); - } - else - { - int d = t / 86400; // 1 day = 24* 3600s - sprintf(buff, "%5dd", d); - } - s = buff; - return s; -} - -int Cat_time::compare(Procinfo *a, Procinfo *b) -{ - int at = a->utime, bt = b->utime; - if (Procview::flag_cumulative) - { - at += a->cutime; - bt += b->cutime; - } - return bt - at; -} - -// LINUX ? -Cat_tty::Cat_tty(const QString &heading, const QString &explain) - : Cat_string(heading, explain) -{ -} - -QString Cat_tty::string(Procinfo *p) { return Ttystr::name(p->tty); } - -Proc::Proc() -{ - // Note: - categories.insert( F_PID - , new Cat_int( tr( "PID" ), tr( "Process ID" ), 6, &Procinfo::pid) ); - categories.insert( F_TGID - , new Cat_int( tr( "TGID" ), tr( "Task group ID ( parent of threads )" ),6, &Procinfo::tgid)); - categories.insert( F_PPID - , new Cat_int( tr( "PPID" ), tr( "Parent process ID" ), 6, &Procinfo::ppid)); - categories.insert( F_PGID - , new Cat_int( tr( "PGID" ), tr( "Process group ID" ), 6, &Procinfo::pgrp)); - categories.insert( F_SID - , new Cat_int( tr( "SID" ), tr( "Session ID" ), 6, &Procinfo::session)); - categories.insert( F_TTY - , new Cat_tty( tr( "TTY" ), tr( "Terminal") ) ); - categories.insert( F_TPGID - , new Cat_int( tr( "TPGID" ), tr( "Process group ID of tty owner" ), 6, &Procinfo::tpgid)); - categories.insert( F_USER - , new Cat_string( tr( "USER" ), tr( "Owner (*=suid root, +=suid a user)" ),&Procinfo::username)); - categories.insert( F_GROUP - , new Cat_string( tr( "GROUP" ), tr( "Group name (*=sgid other)" ),&Procinfo::groupname)); - categories.insert( F_UID - , new Cat_int( tr( "UID" ), tr( "Real user ID" ), 6, &Procinfo::uid)); - categories.insert( F_EUID - , new Cat_int( tr( "EUID" ), tr( "Effective user ID" ), 6, &Procinfo::euid)); - categories.insert( F_SUID - , new Cat_int( tr( "SUID" ), tr( "Saved user ID (Posix)" ), 6,&Procinfo::suid)); - categories.insert( F_FSUID - , new Cat_int( tr( "FSUID" ), tr( "File system user ID" ), 6,&Procinfo::fsuid)); - categories.insert( F_GID - , new Cat_int( tr( "GID" ), tr( "Real group ID" ), 6, &Procinfo::gid)); - categories.insert( F_EGID - , new Cat_int( tr( "EGID" ), tr( "Effective group ID" ), 6, &Procinfo::egid)); - categories.insert( F_SGID - , new Cat_int( tr( "SGID" ), tr( "Saved group ID (Posix)" ), 6,&Procinfo::sgid)); - categories.insert( F_FSGID - , new Cat_int( tr( "FSGID" ), tr( "File system group ID" ), 6,&Procinfo::fsgid)); - categories.insert( F_PRI - , new Cat_int( tr( "PRI" ), tr( "Dynamic priority" ), 4, &Procinfo::priority)); - categories.insert( F_NICE - , new Cat_int( tr( "NICE" ), tr( "Scheduling favour (higher -> less cpu time)" ), 4, &Procinfo::nice)); - categories.insert( F_NLWP - , new Cat_int( tr( "NLWP" ), tr( "Number of tasks(threads) in task group" ), 5, &Procinfo::nthreads)); - categories.insert( F_PLCY - , new Cat_policy( tr( "PLCY" ), tr( "Scheduling policy" ) ) ); - categories.insert( F_RPRI - , new Cat_rtprio( tr( "RPRI" ), tr( "Realtime priority (0-99, more is better)" ) ) ); - categories.insert( F_TMS - , new Cat_tms( tr( "TMS" ), tr( "Time slice in milliseconds" ) ) ); - categories.insert( F_SLPAVG - , new Cat_int( tr( "%SAVG" ), tr( "Percentage average sleep time (-1 -> N/A)" ), 4, &Procinfo::slpavg)); - categories.insert( F_AFFCPU - , new Cat_affcpu( tr( "CPUSET" ), tr( "Affinity CPU mask (0 -> API not supported)" ) ) ); // ??? - categories.insert( F_MAJFLT - , new Cat_uintl( tr( "MAJFLT" ), tr( "Number of major faults (disk access)" ), 8, &Procinfo::majflt)); - categories.insert( F_MINFLT - , new Cat_uintl( tr( "MINFLT" ), tr( "Number of minor faults (no disk access)" ), 8, &Procinfo::minflt)); - // Memory - categories.insert( F_SIZE - , new Cat_memory( tr( "VSIZE" ), tr( "Virtual image size of process" ), 8, &Procinfo::size)); - categories.insert( F_RSS - , new Cat_memory( tr( "RSS" ), tr( "Resident set size" ), 8, &Procinfo::resident)); - categories.insert( F_MEM - , new Cat_memory( tr( "MEM" ), tr( "memory usage (RSS-SHARE)" ), 8, &Procinfo::mem)); - categories.insert( F_TRS - , new Cat_memory( tr( "TRS" ), tr( "Text(code) resident set size" ), 8, &Procinfo::trs)); - categories.insert( F_DRS - , new Cat_memory( tr( "DRS" ), tr( "Data resident set size(malloc+global variable)" ), 8, &Procinfo::drs)); - categories.insert( F_STACK - , new Cat_memory( tr( "STACK" ), tr( "Stack size" ), 8, &Procinfo::stack)); - categories.insert( F_SHARE - , new Cat_memory( tr( "SHARE" ), tr( "Shared memory with other libs" ), 8, &Procinfo::share)); - categories.insert( F_SWAP - , new Cat_swap( tr( "SWAP" ), tr( "Kbytes on swap device" ) ) ); - categories.insert( F_IOR - , new Cat_memory( tr( "IO_R" ), tr( "io read (file)" ), 8, &Procinfo::io_read)); - categories.insert( F_IOW - , new Cat_memory( tr( "IO_W" ), tr( "io write (file)" ), 8, &Procinfo::io_write)); - categories.insert( F_DT - , new Cat_uintl( tr( "DT" ), tr( "Number of dirty (non-written) pages" ), 7, &Procinfo::dt)); - categories.insert( F_STAT - , new Cat_state( tr( "STAT" ), tr( "State of the process " ) ) ); - categories.insert( F_FLAGS - , new Cat_hex( tr( "FLAGS" ), tr( "Process flags (hex)" ), 9, &Procinfo::flags)); - categories.insert( F_WCHAN - , new Cat_wchan( tr( "WCHAN" ), tr( "Kernel function where process is sleeping" ) ) ); - categories.insert( F_WCPU - , new Cat_percent( tr( "%WCPU" ), tr( "Weighted percentage of CPU (30 s average)" ), 6, &Procinfo::wcpu)); - categories.insert( F_CPU - , new Cat_percent( tr( "%CPU" ), tr( "Percentage of CPU used since last update" ), 6, &Procinfo::pcpu)); - categories.insert( F_PMEM - , new Cat_percent( tr( "%MEM" ), tr( "Percentage of memory used (RSS/total mem)" ), 6, &Procinfo::pmem)); - categories.insert( F_START - , new Cat_start( tr( "START" ), tr( "Time process started" ) ) ); - categories.insert( F_TIME, - new Cat_time( tr( "TIME" ), tr( "Total CPU time used since start" ) ) ); - categories.insert( F_CPUNUM - , new Cat_int( tr( "CPU" ), tr( "CPU the process is executing on (SMP system)" ), 3, &Procinfo::which_cpu)); - categories.insert( F_CMD - , new Cat_string( tr( "Process Name" ), tr( "the process name" ), &Procinfo::command)); -// categories.insert( F_PROCESSNAME -// , new Cat_string( tr( "Process Name " ),tr( "the process name" ), &Procinfo::command)); - categories.insert( F_CWD - , new Cat_dir( tr( "CWD" ), tr( "Current working directory" ), "cwd", &Procinfo::cwd)); - categories.insert( F_ROOT, new Cat_dir( tr( "ROOT" ), tr( "Root directory of process" ), "root", &Procinfo::root)); - // command_line="COMMAND_LINE"; //reference to /proc/1234/cmdline - categories.insert( F_CMDLINE, - new Cat_cmdline( tr( "COMMAND_LINE" ), tr( "Command line that started the process") ) ); - - commonPostInit(); - - socks_current = false; - usocks_current = false; - - Proc::init_static(); -} - -Proc::~Proc() -{ - // killall procinfos -} - -// COMMON for LINUX,SOLARIS -// Polling /proc/PID/* -void Proc::read_proc_all() -{ - DIR *d = opendir("/proc"); - struct dirent *e; - - while ((e = readdir(d)) != 0) - { - if (e->d_name[0] >= '0' and e->d_name[0] <= '9') - { // good idea ! - int pid; - Procinfo *pi = NULL; - - // inline int x_atoi(const char *sstr); - // pid=x_atoi(e->d_name); //if(pid<100) continue; - pid = atoi(e->d_name); - - pi = procs.value(pid, NULL); - - if (pi == NULL) // new process - { - pi = new Procinfo(this, pid); - procs.insert(pid, pi); - /* - Procinfo *parent; - parent =procs[pi->ppid]; - if(parent) - parent->children->add(pi); - printf("Qps : parent null - pid[%d]\n",pi->pid); } - */ - } - int ret = pi->readproc(); - if (ret > 0) - { - pi->generation = current_gen; // this process is alive - // printf(" [%s] %d - // %d\n",pi->command.toAscii().data(),pi->generation,current_gen); - - if (flag_show_thread and flag_thread_ok) - read_pid_tasks(pid); // for threads - - // add to History expect thread - if (ret == 2) - { - Procinfo *p = new Procinfo(*pi); // copy - p->clone = true; - hprocs->insert(pid, p); - } - } - else - { - // already gone. /proc/PID dead! - // later remove this process ! not yet - } - } - } - closedir(d); -} - -// COMMON , redesign -Proclist Proc::getHistory(int pos) -{ - Proclist l; - if (pos <= 0) - { - return l; - } - int size = history.size(); - if (size > pos) - l = history[size - pos]->procs; - return l; -} - -void Proc::setHistory(int tick) -{ - return; - if (tick <= 0) - { - mprocs = 0; - return; - } - int size = history.size(); - if (size > tick) - mprocs = &history[size - tick]->procs; - else - mprocs = 0; -} - -bool Procinfo::isThread() -{ - return pid != tgid; // how to check -} - -// LINUX size=64 -int Procview::custom_fields[] = {F_PID, F_TTY, F_USER, F_NICE, - F_SIZE, F_MEM, F_STAT, F_CPU, - F_START, F_TIME, F_CMDLINE, F_END}; - -// COMMON: basic field -int Procview::basic_fields[] = {F_PID, F_TTY, F_USER, F_CPUNUM, - F_STAT, F_MEM, F_CPU, F_START, - F_TIME, F_CMDLINE, F_END}; - -int Procview::jobs_fields[] = {F_PID, F_TGID, F_PPID, F_PGID, - F_SID, F_TPGID, F_STAT, F_UID, - F_TIME, F_CMDLINE, F_END}; - -int Procview::mem_fields[] = {F_PID, F_TTY, F_MAJFLT, F_MINFLT, F_SIZE, - F_RSS, F_TRS, F_DRS, F_STACK, F_SHARE, - // F_DT, - F_CMDLINE, F_END}; - -int Procview::sched_fields[] = {F_PID, F_TGID, F_NLWP, F_STAT, F_FLAGS, - F_PLCY, F_PRI, F_NICE, F_TMS, F_SLPAVG, - F_RPRI, F_AFFCPU, F_CPU, F_START, F_TIME, - F_CMDLINE, F_END}; - -void Procview::set_fields() -{ - switch (viewfields) - { - case USER: // BASIC FIELD - set_fields_list(basic_fields); - break; - case JOBS: - set_fields_list(jobs_fields); - break; - case MEM: - set_fields_list(mem_fields); - break; - case SCHED: - set_fields_list(sched_fields); - break; - case CUSTOM: - set_fields_list(custom_fields); - break; - default: - printf("Error ? set_fields_list \n"); - } - fieldArrange(); -} - -// LINUX: -// deduce whether the currently selected fields correspond to a field list -void Procview::deduce_fields() -{ - return; // under development (by fasthyun@magicn.com) 2006/05/24 - - if (viewfields != CUSTOM) - return; - - Procview::fieldstates tags[4] = {USER, JOBS, MEM, SCHED}; - int *lists[4] = {basic_fields, jobs_fields, mem_fields, sched_fields}; - for (int i = 0; i < 4; i++) - { - int *l = lists[i]; - int j; - for (j = 0; l[j] != F_END; j++) - if (findCol(l[j]) < 0) - break; - if (l[j] == F_END && j == cats.size()) - { - viewfields = tags[i]; - return; - } - } -} - -// move to Proc.cpp -#include // uname() -int get_kernel_version() -{ - int version = 0; - char *p; - struct utsname uname_info; - if (uname(&uname_info) == 0) // man -S 2 uname - { - // printf("sysname =%s \n",uname_info.sysname); - if (strcasecmp(uname_info.sysname, "linux") == 0) - { - Q_UNUSED(uname_info.release[0]); - } - p = uname_info.release; - char str[32]; - int major, minor, patch; - int result; - - result = sscanf(p, "%d.%d.%d", &major, &minor, &patch); - if (result == 2) - { - // only read two value - patch = 0; // ex) 3.0-ARCH - } - else if (result < 3) - { - fprintf(stderr, "Qps: can't determine version, read %s \n", p); - fprintf(stderr, "please report this bug.\n"); - exit(1); - } - version = major * 10000 + minor * 100 + patch; - // ex) 2.6.17 == 20617 , 2.4.8 == 20408 - printf("DEBUG: version = %d\n", version); - } - else - { - fprintf(stderr, "Qps: uname() failed. (%d) \n", version); - fprintf(stderr, "please report this bug.\n"); - exit(1); - } - return version; -} - -void check_system_requirement() -{ - int kernel_version = 0; - kernel_version = get_kernel_version(); - if (kernel_version < 20600) // less 2.6 - { - printf("Qps: kernel 2.4.x not supported !!!\n\n"); // because of - // 2.4.x SMP - // bugs - exit(0); - } -} diff --git a/src/proc.h b/src/proc.h deleted file mode 100644 index 7a537c8..0000000 --- a/src/proc.h +++ /dev/null @@ -1,889 +0,0 @@ -/* - * proc.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef PROC_H -#define PROC_H - -#include "config.h" -#include - -#ifdef SOLARIS -#include // kstat_ctl_t -#endif - -#ifndef USING_PCH -#include -#include -#include -#include -#include -#endif - -class Procinfo; -int read_file(char *name, char *buf, int max); -int read_file_addNULL(char *name, void *buf, int max); -void check_system_requirement(); -int get_kernel_version(); - -//#define F_PID 0x00000000 -enum fields -{ - F_PID = 0, -#ifdef LINUX - F_TGID, -#endif - F_PPID, - F_PGID, - F_SID, - F_TTY, -#ifdef LINUX - F_TPGID, -#endif -#ifdef MOSIX - F_MIGR, - F_LOCKED, - F_NMIGS, - F_NOMOVE, - F_RPID, -#endif - F_USER, - F_GROUP, - F_UID, - F_EUID, -#ifdef LINUX - F_SUID, - F_FSUID, -#endif - F_GID, - F_EGID, -#ifdef LINUX - F_SGID, - F_FSGID, -#endif - F_PRI, - F_NICE, - F_PLCY, - F_RPRI, -#ifdef LINUX - F_TMS, - F_AFFCPU, - F_SLPAVG, -#endif - F_NLWP, -#ifdef SOLARIS - F_ARCH, -#endif - F_MAJFLT, - F_MINFLT, -#ifdef LINUX - F_TRS, - F_DRS, - F_STACK, -#endif - F_SIZE, // VSIZE - F_SWAP, // Linux not correct - F_MEM, - F_RSS, -#ifdef LINUX - F_SHARE, - F_DT, - F_IOW, - F_IOR, -#endif - F_STAT, - F_FLAGS, - F_WCHAN, - F_WCPU, - F_CPU, /* %CPU */ - F_PMEM, // F_PMEM: %MEM - F_START, - F_TIME, - F_CPUNUM, - F_CMD, - F_PROCESSNAME, // NEW - F_CWD, - F_ROOT, //? - F_CMDLINE, - F_END = -1 -}; - -class Details; - -#ifdef LINUX - -class Sockinfo -{ - public: - enum proto_t - { - TCP, - UDP - }; - proto_t proto; - unsigned char st; - unsigned char tr; - unsigned local_addr; - unsigned rem_addr; - unsigned short local_port; - unsigned short rem_port; - unsigned tx_queue; - unsigned rx_queue; - unsigned tm_when; - unsigned rexmits; - int uid; //?? - int pid; - int timeout; - int inode; -}; - -class SockInode -{ - public: - SockInode(int descr, unsigned long ino) : fd(descr), inode(ino){}; - int fd; - unsigned long inode; -}; - -class UnixSocket -{ - public: - unsigned long inode; - QString name; - unsigned flags; - unsigned char type; // SOCK_STREAM or SOCK_DGRAM - unsigned char state; // SS_FREE, SS_UNCONNECTED, SS_CONNECTING, - // SS_CONNECTED, SS_DISCONNECTING -}; - -#endif // LINUX - -// COMMON -class Mapsinfo -{ - public: - unsigned long from, to; - unsigned long offset; - unsigned long inode; - QString filename; // null if name unknown - char perm[4]; // "rwx[ps]"; last is private/shared flag - unsigned minor, major; -}; - -#define OPEN_READ 1 -#define OPEN_WRITE 2 - -class Fileinfo -{ - public: - Fileinfo(int descr, QString name, int open_mode = 0) - : fd(descr), filename(name), mode(open_mode){}; - int fd; - QString filename; // "major:minor inode" in Linux 2.0, - // texual description in Solaris 2.6 - unsigned mode; // bits from OPEN_* above (Linux only) -}; - -class NameValue -{ - public: - NameValue(){}; - // NameValue(const NameValue &nv){ name=nv.name; value=nv.value; }; - NameValue(const char *n, const char *val) : name(n), value(val){}; - QString name; - QString value; -}; - -class Category -{ - public: - Category( const QString &heading, const QString &explain ) : name(heading), help(explain), reversed(false),flag_int_value(false){} - virtual ~Category(); - - virtual int alignment() = 0; - virtual QString string(Procinfo *p) = 0; - virtual int width() = 0; - virtual int compare(Procinfo *a, Procinfo *b); - - QString name; - QString help; - int index; - int id; - bool reversed; // testing - bool flag_int_value; // testing: for total sum , cat_memory , cat_int -}; - -// COMMON -class Cat_int : public Category -{ - public: - Cat_int(const QString &heading, const QString &explain, int w, - int Procinfo::*member); - virtual int alignment() { return Qt::AlignRight; }; - virtual QString string(Procinfo *p); - virtual int width() { return field_width; }; - virtual int compare(Procinfo *a, Procinfo *b); - - protected: - int Procinfo::*int_member; - int field_width; -}; - -// COMMON for memory usage -class Cat_memory : public Category -{ - public: - Cat_memory(const QString &heading, const QString &explain, int w, - unsigned long Procinfo::*member); - virtual int alignment() { return Qt::AlignRight; }; - virtual QString string(Procinfo *p); - virtual int width() { return field_width; }; - virtual int compare(Procinfo *a, Procinfo *b); - - protected: - unsigned long Procinfo::*uintl_member; - int field_width; -}; - -class Cat_uintl : public Category -{ - public: - Cat_uintl(const QString &heading, const QString &explain, int w, - unsigned long Procinfo::*member); - virtual int alignment() { return Qt::AlignRight; }; - virtual QString string(Procinfo *p); - virtual int width() { return field_width; }; - virtual int compare(Procinfo *a, Procinfo *b); - - protected: - unsigned long Procinfo::*uintl_member; - int field_width; -}; - -class Cat_hex : public Cat_uintl -{ - public: - Cat_hex(const QString &heading, const QString &explain, int w, - unsigned long Procinfo::*member); - virtual QString string(Procinfo *p); -}; - -class Cat_swap : public Category -{ - public: - Cat_swap(const QString &heading, const QString &explain); - virtual int alignment() { return Qt::AlignRight; }; - virtual QString string(Procinfo *p); - virtual int width() { return 8; }; - virtual int compare(Procinfo *a, Procinfo *b); -}; - -class Cat_string : public Category -{ - public: - Cat_string(const QString &heading, const QString &explain, - QString Procinfo::*member = 0); - virtual int alignment() { return Qt::AlignLeft; }; - virtual QString string(Procinfo *p); - virtual int width() { return -9; }; - virtual int gap() { return 8; }; - - protected: - QString Procinfo::*str_member; -}; - -class Cat_user : public Cat_string -{ - public: - Cat_user(const QString &heading, const QString &explain); - virtual QString string(Procinfo *p); -}; - -class Cat_group : public Cat_string -{ - public: - Cat_group(const QString &heading, const QString &explain); - virtual QString string(Procinfo *p); -}; - -class Cat_wchan : public Cat_string -{ - public: - Cat_wchan(const QString &heading, const QString &explain); - virtual QString string(Procinfo *p); -}; - -class Cat_dir : public Cat_string -{ - public: - Cat_dir(const QString &heading, const QString &explain, const char *dirname, - QString Procinfo::*member); - virtual QString string(Procinfo *p); - - protected: - const char *dir; - QString Procinfo::*cache; -}; - -class Cat_cmdline : public Cat_string -{ - public: - Cat_cmdline(const QString &heading, const QString &explain); - virtual QString string(Procinfo *p); -}; - -class Cat_state : public Category -{ - public: - Cat_state(const QString &heading, const QString &explain); - virtual int alignment() { return Qt::AlignLeft; }; - virtual QString string(Procinfo *p); - virtual int width() { return 6; }; - virtual int gap() { return 8; }; -}; - -class Cat_policy : public Category -{ - public: - Cat_policy(const QString &heading, const QString &explain); - virtual int alignment() { return Qt::AlignLeft; }; - virtual QString string(Procinfo *p); - virtual int width() { return 3; }; - virtual int gap() { return 8; }; - virtual int compare(Procinfo *a, Procinfo *b); -}; - -class Cat_rtprio : public Category -{ - public: - Cat_rtprio(const QString &heading, const QString &explain); - virtual int alignment() { return Qt::AlignRight; }; - virtual QString string(Procinfo *p); - virtual int width() { return 5; }; - virtual int compare(Procinfo *a, Procinfo *b); -}; - -#ifdef LINUX -class Cat_tms : public Category -{ - public: - Cat_tms(const QString &heading, const QString &explain); - virtual int alignment() { return Qt::AlignRight; }; - virtual QString string(Procinfo *p); - virtual int width() { return 5; }; - virtual int compare(Procinfo *a, Procinfo *b); -}; - -class Cat_affcpu : public Category -{ - public: - Cat_affcpu(const QString &heading, const QString &explain); - virtual int alignment() { return Qt::AlignRight; }; - virtual QString string(Procinfo *p); - virtual int width() { return 8; }; - // virtual int compare(Procinfo *a, Procinfo *b); -}; -#endif - -class Cat_time : public Category -{ - public: - Cat_time(const QString &heading, const QString &explain); - virtual int alignment() { return Qt::AlignRight; }; - virtual QString string(Procinfo *p); - virtual int width() { return 7; }; - virtual int compare(Procinfo *a, Procinfo *b); -}; - -class Cat_start : public Category -{ - public: - Cat_start(const QString &heading, const QString &explain); - virtual int alignment() { return Qt::AlignRight; }; - virtual QString string(Procinfo *p); - virtual int width() { return 8; }; - virtual int compare(Procinfo *a, Procinfo *b); -}; - -class Cat_percent : public Category -{ - public: - Cat_percent(const QString &heading, const QString &explain, int w, - float Procinfo::*member); - virtual int alignment() { return Qt::AlignRight; }; - virtual QString string(Procinfo *p); - virtual int width() { return field_width; }; - virtual int compare(Procinfo *a, Procinfo *b); - - protected: - float Procinfo::*float_member; - int field_width; -}; - -class Cat_tty : public Cat_string -{ - public: - Cat_tty(const QString &heading, const QString &explain); - virtual QString string(Procinfo *p); -}; - -#define CPU_TIMES(cpu, kind) cpu_times_vec[cpu * CPUTIMES + kind] -class Proc; - -class Procinfo // Process Infomation -{ - public: - Procinfo(Proc *system_proc, int pid, int thread_id = -1); -#ifdef SOLARIS - // Procinfo(int pid); //solaris ! - // Procinfo(int pid, int thread); //solaris ! - int readproc(int pid, int lwp); -#endif - ~Procinfo(); - Procinfo *ref() - { - refcnt++; - return this; - }; - void deref() - { - if (!--refcnt) - delete this; - }; - Proc *proc; - - inline void calculate_cpu(); - - int readproc(); - - bool isThread(); - void read_fd(int fdnum, char *path); - bool read_fds(); - bool read_maps(); - bool read_environ(); -#ifdef SOLARIS - void read_pmap_maps(); -#endif -#ifdef MOSIX - static void check_for_mosix(); - static Svec mosix_nodes(); -#endif - - int get_policy(); - int get_rtprio(); - -#ifdef LINUX - double get_tms(); - unsigned long get_affcpu(); - - QVector sock_inodes; // socket inodes or NULL if not read -#endif - int pid; - bool clone; - - bool first_run; // for optimization - char hashstr[128 * 8]; // cache - int hashlen; - int hashcmp(char *str); - - QString command; // COMMAND - QString cmdline; // COMMAND_LINE - QString username; // - QString groupname; // - QString cwd; // null if not read - QString root; // null if not read - - bool accepted; - int test_stop; // for test - int session; // ??? - - int uid, euid; - int gid, egid; - - char state; - int ppid; // Parent's PID - int pgrp; - dev_t tty; // tty major:minor device - int type; // TESTING X,NETWORK,FILE_OPEN,TERMINAL(tty),THREAD, - - int nthreads; // number of threads : LWP(Solaris), task(Linux) - int tgid; // thread leader's id - -#ifdef LINUX - double tms; // slice time - int slpavg; - unsigned long affcpu; - - int suid, fsuid; - int sgid, fsgid; - int tpgid; - - unsigned long cminflt; - unsigned long cmajflt; -#endif - - unsigned long io_read; // byte, testing - unsigned long io_write; // testing - unsigned long io_read_KBps; // K byte/sec - unsigned long io_write_KBps; // K byte/sec - unsigned long io_read_prev, io_write_prev; - - unsigned long flags; //? - unsigned long minflt; - unsigned long majflt; - - long utime; - long old_utime; // initial value = -1 ; - long cutime; - int priority; - int nice; - unsigned long starttime; // start time since run in epoch? Linux : jiffies - // since boot , solaris - unsigned long wchan; - QString wchan_str; - - // Memory - unsigned long mem; // user Memory define - unsigned long size; // SIZE: total memory (K) - unsigned long resident; // RSS: pages in resident set (non-swapped) (K) -#ifdef LINUX - unsigned long share; // shared memory pages (mmaped) (K) - unsigned long trs; // text resident set size (K) - unsigned long lrs; // shared-lib resident set size (K) - unsigned long drs; // data resident set size (K) - unsigned long - dt; // dirty pages (number of pages, not K), obsolute in Kernel 2.6 - unsigned long stack; // stack size (K) -#endif - -#ifdef SOLARIS - int addr_bits; // address bits (32 or 64) - - char policy_name[2]; // two first letters of scheduling class -#endif - struct timeval tv; // time when the snapshot was taken - struct timeval old_tv; // - - // Posix.1b scheduling - int policy; // -1 = uninitialized - int rtprio; // 0-99, higher can pre-empt lower (-1 = uninitialized) - - // Linux: the cpu used most of the time of the process - // Solaris: the cpu on which the process last ran - int which_cpu; - - // computed %cpu and %mem since last update - float wcpu, old_wcpu; // %WCPUwheight cpu - float pcpu; // %CPU: percent cpu after last update - float pmem; // %MEM - - QVector fd_files; // file names list - QVector maps; // maps list - QVector environ; // environment - char *envblock; // malloc()ed environment data block - -#ifdef SOLARIS - unsigned long env_ofs; -#endif - - Details *detail; // details window or NULL (backlink) - - unsigned int generation; // timestamp - - bool selected : 1; // true if selected in current view - bool hidekids : 1; // true if children are hidden in tree view - bool lastchild : 1; // true if last (visible) child in tree view - - short level; // distance from process root - QVector children; // real child processes - static const int MAX_CMD_LEN = 512; - - char refcnt; - - // virtual child for Table_Tree - QVector table_children; - int table_child_seq; - int clear_gen; - int child_seq_prev; - int parent_row; // virtual parent for tree table - -#ifdef MOSIX - bool isremote; - int from; - int where; - int remotepid; - QString migr; // String explaining migration "node>" or ">node" - int nmigs; - int locked; - QString cantmove; - static bool mosix_running; // true if MOSIX is running -#endif -}; - -typedef QHash Proclist; - -class SysHistory -{ - public: - int idx; - time_t time; // saved time, epoch... - int current_gen; - float load_cpu; // %CPU total ; green - float load_mem; // %mem ; yellow? - float load_io; // %SYS_IO ; BLUE - float load_net; // ;blue? orange? - Proclist procs; - ~SysHistory(); -}; - - -// for A System -// cf. Procinfo is for a Process -// -class Proc -{ -Q_DECLARE_TR_FUNCTIONS(Proc) - public: - Proc(); - ~Proc(); - void commonPostInit(); // COMMON - void read_proc_all(); // test - void refresh(); - - static void init_static(); - int read_system(); - int countCpu(); - void read_loadavg(); - - int read_pid_tasks(int pid); - - Category *cat_by_name( const QString &s ); - int field_id_by_name( const QString &s ); - -#ifdef LINUX - /* from /proc/net/{tcp,udp,unix} */ - QHash socks; // tcp/udp sockets - QHash usocks; // unix domain sockets - bool socks_current; // true if the socks list is current - bool usocks_current; // true if the usocks list is current - - bool read_socket_list(Sockinfo::proto_t proto, const char *pseudofile); - void read_sockets(); - bool read_usocket_list(); - void read_usockets(); - void invalidate_sockets(); - -#endif - -#ifdef SOLARIS - static kstat_ctl_t *kc; // NULL if kstat not opened -#endif - QHash categories; - - Proclist procs; // processes indexed by pid - - // TESTING - QString supasswd; // test - int syshistoryMAX; - Proclist *hprocs; // temp_hprocs list - Proclist *mprocs; // - QList history; - - void setHistory(int tick); - Proclist getHistory(int pos); - - int qps_pid; // test - float loadQps; // TEST - static int update_msec; - - // class - int num_cpus; // current number of CPUs - int old_num_cpus; // previous number of CPUs - - long num_network_process; // number of network(socket) process - long num_opened_files; // number of opened normal(not socket) files - int num_process; // number of process - - long dt_total; // - long dt_used; // cpu used time in clktick - - long read_byte; // test - long write_byte; // test - long io_byte; // test file_io - - float load_cpu; // %CPU total - float loadavg[3]; // 1,5,15 minutes load avgs - - unsigned int clk_tick; // the number of clock ticks per second. - unsigned int boot_time; // boot time in seconds since the Epoch - - int mem_total, mem_free; // (Kb) - int swap_total, swap_free; // in kB - - int mem_shared, mem_buffers, mem_cached; // Linux - - // the following are pointers to matrices indexed by kind (above) and - // cpu - unsigned *cpu_times_vec; - unsigned *old_cpu_times_vec; - - // accessors for (old_)cpu_times_vec - unsigned &cpu_times(int cpu, int kind) - { - return cpu_times_vec[cpu * CPUTIMES + kind]; - } - unsigned &old_cpu_times(int cpu, int kind) - { - return old_cpu_times_vec[cpu * CPUTIMES + kind]; - } - -#ifdef LINUX - // from /proc/stat - unsigned long *per_cpu_times; // vector of num_cpus times - unsigned long *old_per_cpu_times; // vector of num_cpus times -#endif - - // Solaris #defines CPU_xxx so we must avoid them - enum - { - CPUTIME_USER, -#ifdef LINUX - CPUTIME_NICE, -#endif - CPUTIME_SYSTEM, -#ifdef SOLARIS - CPUTIME_WAIT, -#endif - CPUTIME_IDLE, - CPUTIMES - }; - - //#define CPU_TIMES(cpu, kind) cpu_times_vec[cpu * CPUTIMES + kind] - - unsigned int current_gen; - int maxSizeHistory; -}; - -class Procview : public Proc -{ - public: - Procview(); - QString filterstr; - - static bool flag_show_file_path; - static bool flag_pcpu_single; - static bool flag_cumulative; - - static int compare(Procinfo *const *a, Procinfo *const *b); - static int compare_backwards(Procinfo *const *a, Procinfo *const *b); - void refresh(); - bool accept_proc(Procinfo *p); // COMMON - void linearize_tree(QVector *ps, int level, int prow, - bool flag_hide = false); - void build_tree(Proclist &); - void rebuild(); - - void set_fields(); - void set_fields_list(int fields[]); - void addField(char *name); // interface - void addField(int FIELD_ID, int where = -1); // base interface - void removeField(int FIELD_ID); - int findCol(int FIELD_ID); - void moveColumn(int col, int place); - void deduce_fields(); - void fieldArrange(); - void update_customfield(); - // - void setSortColumn(int col, bool r = false); - void setTreeMode(bool b); - void saveCOMMANDFIELD(); - -#ifndef GTK - Procinfo *getProcinfoByPID(int pid) { return procs.value(pid, NULL); }; -#endif - - QVector linear_procs; // this is linear_proc_list for viewer - -#ifdef LINUX - QVector linear_socks; // Linux Testing -#endif - - // QList<> tags_kernel; - - // root_procs contains processes without parent; normally only init, but - // we cannot rely on this (Solaris has several parentless processes). - // Also, if the view is restricted, all processes whose parent isn't in - // the table. - QVector root_procs; // table_root_procs; for viewer - QVector cats; // for table - - Category *sortcat; - Category *sortcat_linear; // testing - int sort_column; // index of - bool reversed; // true if sorted backwards - static bool treeview; // true if viewed in tree form - bool enable; // tmp - - enum procstates - { - ALL, - OWNED, - NROOT, - RUNNING, - HIDDEN, - NETWORK - }; - enum fieldstates - { - USER = HIDDEN + 1, - JOBS, - MEM, - SCHED, - CUSTOM - }; - int viewproc; - int viewfields; - - int idxF_CMD; ////Test - QStringList customfields; - static int custom_fields[64]; - // lists of fields to be used for different views, terminated by -1: - static int mini_fields[]; // for mobile - static int basic_fields[]; - static int jobs_fields[]; - static int mem_fields[]; -#ifdef LINUX - static int sched_fields[]; -#endif - -#ifdef MOSIX - static int user_fields_mosix[]; - static int jobs_fields_mosix[]; - static int mem_fields_mosix[]; -#endif - static float avg_factor; // exponential factor for averaging - static const int cpu_avg_time = 30 * 1000; // averaging time for WCPU (ms) - - private: - static Category *static_sortcat; // kludge: to be used by compare -}; - -#endif // PROC_H diff --git a/src/proc_common.cpp b/src/proc_common.cpp deleted file mode 100644 index ab17443..0000000 --- a/src/proc_common.cpp +++ /dev/null @@ -1,1120 +0,0 @@ -/* - * fm-search-uri.c - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 2015 Hong Jen Yee (PCMan) - * Copyright 2012-2014 Andriy Grytsenko (LStranger) - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -// for Non-ASCII locale -//#include - -//#include -// extern QTextCodec * codec ; -//#define UniString(str) codec->toUnicode(str) - -int flag_24_ok; // we presume a kernel 2.4.x - -#include -#include -#include -#include -#include -#include -#include - -// COMMON -bool Procview::treeview = 0; // true -bool Procview::flag_show_file_path = false; -bool Procview::flag_cumulative = false; // times cumulative with children's -bool Procview::flag_pcpu_single = false; // %CPU= pcpu/num_cpus - -// COMMON: basic field -int Procview::mini_fields[] = {F_PID, F_STAT, F_MEM, F_CPU, F_CMDLINE, F_END}; - -// COMMON? -// return username from /etc/passwd -char *userName(int uid, int euid) -{ - char buff[128]; - struct passwd *pw = getpwuid(uid); - if (!pw) - { - // dont have name ! - sprintf(buff, "%d", uid); - } - else - strcpy(buff, pw->pw_name); - - if (uid != euid) - strcat(buff, euid == 0 ? "*" : "+"); - - return strdup(buff); -} - -// return group name (possibly numeric) -char *groupName(int gid, int egid) -{ - char *p; - struct group *gr = getgrgid(gid); - if (!gr) - { - p = (char *)malloc(11); - sprintf(p, "%d", gid); - } - else - p = strdup(gr->gr_name); - // s.append("*"); - return p; -} - -Category::~Category() {} - -int Category::compare(Procinfo *a, Procinfo *b) -{ - return string(a).compare(string(b)); -} - -Cat_int::Cat_int(const QString &heading, const QString &explain, int w, - int Procinfo::*member) - : Category(heading, explain), int_member(member), field_width(w) -{ -} - -QString Cat_int::string(Procinfo *p) -{ - QString s; - s.setNum(p->*int_member); - return s; -} - -int Cat_int::compare(Procinfo *a, Procinfo *b) -{ - // qsort() only cares about the sign of the number returned by the - // comparison function; only a subtraction is necessary - return a->*int_member - b->*int_member; -} - -// COMMON -Cat_percent::Cat_percent(const QString &heading, const QString &explain, int w, - float Procinfo::*member) - : Category(heading, explain), float_member(member), field_width(w) -{ -} - -QString Cat_percent::string(Procinfo *p) -{ - QString s; - s.sprintf("%01.2f", (double)(p->*float_member)); - return s; -} - -int Cat_percent::compare(Procinfo *a, Procinfo *b) -{ - float at = a->*float_member, bt = b->*float_member; - return at < bt ? 1 : (at > bt ? -1 : 0); -} -// added 2006/05/07 -Cat_memory::Cat_memory(const QString &heading, const QString &explain, int w, - unsigned long Procinfo::*member) - : Category(heading, explain), uintl_member(member), field_width(w) -{ -} - -QString Cat_memory::string(Procinfo *p) -{ - QString s; - char buff[128]; - - long sizeK, sizeM; - sizeK = p->*uintl_member; - - sizeM = sizeK / 1024; - /* if ( sizeM > 1024 ) - { - sprintf(buff,"%dM",sizeM/1024); - } - else */ - if (sizeM > 0) - { - sprintf(buff, "%ldM", sizeM); - } - else - sprintf(buff, "%ldK", sizeK); - - if (sizeK == 0) - s = "0"; - else - s = buff; - return s; -} - -int Cat_memory::compare(Procinfo *a, Procinfo *b) -{ - int bu = b->*uintl_member, au = a->*uintl_member; - return bu >= au ? (bu == au ? 0 : 1) : -1; -} - -Cat_uintl::Cat_uintl(const QString &heading, const QString &explain, int w, - unsigned long Procinfo::*member) - : Category(heading, explain), uintl_member(member), field_width(w) -{ -} - -QString Cat_uintl::string(Procinfo *p) -{ - QString s; - s.setNum(p->*uintl_member); - return s; -} - -int Cat_uintl::compare(Procinfo *a, Procinfo *b) -{ - int bu = b->*uintl_member, au = a->*uintl_member; - return bu >= au ? (bu == au ? 0 : 1) : -1; -} - -Cat_hex::Cat_hex(const QString &heading, const QString &explain, int w, - unsigned long Procinfo::*member) - : Cat_uintl(heading, explain, w, member) -{ -} - -// QString.sprintf 2x speed than glibc.sprintf (by fasthyun@magicn.com) -// but QString structuring & destructring eat more time -QString Cat_hex::string(Procinfo *p) -{ - QString s; - s.sprintf("%8x", (unsigned)(p->*uintl_member)); - return s; -} - -// COMMON, -Cat_swap::Cat_swap(const QString &heading, const QString &explain) - : Category(heading, explain) -{ -} - -QString Cat_swap::string(Procinfo *p) -{ - QString s; - // It can actually happen that size < resident (Sun under Solaris 2.6) - // Possible with Linux ? - - long sizeK, sizeM; - sizeK = p->size > p->resident ? p->size - p->resident : 0; - - sizeM = sizeK / 1024; - - if (sizeM > 0) - s = QString::number(sizeM) + "M"; - else - s = QString::number(sizeK) + "K"; - - if (sizeK == 0) - s = "0"; - return s; -} - -int Cat_swap::compare(Procinfo *a, Procinfo *b) -{ - return (b->size - b->resident) - (a->size - a->resident); -} - -Cat_string::Cat_string(const QString &heading, const QString &explain, - QString Procinfo::*member) - : Category(heading, explain), str_member(member) -{ -} - -QString Cat_string::string(Procinfo *p) { return p->*str_member; } - -Cat_user::Cat_user(const QString &heading, const QString &explain) - : Cat_string(heading, explain) -{ -} - -QString Cat_user::string(Procinfo *p) -{ - if (p->uid == p->euid) - return Uidstr::userName(p->uid); - else - { - QString s = Uidstr::userName(p->uid); - s.append(p->euid == 0 ? "*" : "+"); - return s; - } -} - -Cat_group::Cat_group(const QString &heading, const QString &explain) - : Cat_string(heading, explain) -{ -} - -QString Cat_group::string(Procinfo *p) -{ - if (p->gid == p->egid) - return Uidstr::groupName(p->gid); - else - { - QString s = Uidstr::groupName(p->gid); - s.append("*"); - return s; - } -} - -Cat_wchan::Cat_wchan(const QString &heading, const QString &explain) - : Cat_string(heading, explain) -{ -} - -QString Cat_wchan::string(Procinfo *p) -{ -#ifdef LINUX - return p->wchan_str; -#else - return Wchan::name(p->wchan); -#endif -} - -Cat_cmdline::Cat_cmdline(const QString &heading, const QString &explain) - : Cat_string(heading, explain) -{ -} - -QString Cat_cmdline::string(Procinfo *p) -{ - if (p->cmdline.isEmpty()) - { - QString s("("); - s.append(p->command); - s.append(")"); - return s; - } - else - { - if (Procview::flag_show_file_path) - return p->cmdline; - else - { - QString s(p->cmdline); - - int i = s.indexOf(' '); - if (i < 0) - i = s.length(); - if (i > 0) - { - i = s.lastIndexOf('/', i - 1); - if (i >= 0) - s.remove(0, i + 1); - } - return s; - } - } -} - -// hmm COMMON? almost same...but Solaris's zombie process... -Cat_start::Cat_start(const QString &heading, const QString &explain) - : Category(heading, explain) -{ -} -// don't let your confidence be shaken, just learn what you can from this young -// master. -QString Cat_start::string(Procinfo *p) -{ -#ifdef SOLARIS - if (p->state == 'Z') - return "-"; // Solaris zombies have no valid start time -#endif - Proc *proc = p->proc; - // time_t start = boot_time + p->starttime / (unsigned)HZ; - QString s; - // time_t start = proc->boot_time + p->starttime / proc->clk_tick; - time_t start = p->starttime; - char *ct = ctime(&start); // ctime(sec) - time_t sec = p->starttime - proc->boot_time; // secs - // if(p->tv.tv_sec - start < 86400) { - if (sec < 86400) - { // 24hours - ct[16] = '\0'; - s = ct + 11; // Hour:minu - } - else - { - ct[10] = '\0'; - s = ct + 4; // Date - } - return s; -} - -int Cat_start::compare(Procinfo *a, Procinfo *b) -{ - unsigned long bs = b->starttime, as = a->starttime; - return bs >= as ? (bs == as ? 0 : 1) : -1; -} - -/* ======================== Procview ============================ */ -float Procview::avg_factor = 1.0; - -Procview::Procview() -{ - // Proc::Proc(); //call once more ? - cats.clear(); - reversed = false; - viewproc = ALL; - treeview = true; - idxF_CMD = 0; // **** important **** - viewfields = USER; - set_fields(); - - sortcat = 0; // categories[F_PID]; - sort_column = -1; - sortcat_linear = NULL; - enable = true; - maxSizeHistory = 1200; - refresh(); // before reading Watchdog list -} - -// COMMON: -// Description : -// View mode : ALL , OWNER, NO-ROOOT , HIDDEN, NETWORK -bool Procview::accept_proc(Procinfo *p) -{ - QString pid; - static int my_uid = getuid(); - bool result; - - result = true; - - // BAD - if (false and viewproc == NETWORK) - { - /* - p->read_fds(); - if(p->sock_inodes.size()==0) - result=false; - for(int i=0;isock_inodes.size();i++) - { - SockInode *sn=p->sock_inodes[i]; - Sockinfo *si=Procinfo::socks.value(sn->inode,NULL); - if(si) - { - si->pid=p->pid; - linear_socks.append(si); - } - } - */ - } - else if (viewproc == ALL) - result = true; - else if (viewproc == OWNED) - result = (p->uid == my_uid); - else if (viewproc == NROOT) - result = (p->uid != 0); - else if (viewproc == RUNNING) - result = strchr("ORDW", p->state) != 0; - - /* - if ( viewproc == HIDDEN) - { - result=false; - for(int j=0;jcommand) - result=true ; - } - else - { - for(int j=0;jcommand) - result=false; - } */ - - if (result == false) - return false; // dont go further !! for better speed - - /// if(search_box==NULL) return result; - if (filterstr == "") - return result; - - if (filterstr == "*") - return true; - - // Notice: - // 1. some process name maybe different CMDLINE. ex) Xorg - if (p->cmdline.contains(filterstr, - Qt::CaseInsensitive)) // search_box->text() - return true; - if (p->command.contains(filterstr, Qt::CaseInsensitive)) - return true; - if (p->username.contains(filterstr, Qt::CaseInsensitive)) - return true; - - pid = pid.setNum(p->pid); //=QString::number(p->pid); - if (pid.contains(filterstr, Qt::CaseInsensitive)) - return true; - - /// printf("search_Box =%s , %s - /// \n",search_box->text().toAscii().data(),p->command.toAscii().data()); - - return false; -} - -extern "C" { -typedef int (*compare_func)(const void *, const void *); -} - -/* -template -void Svec::sort(int (*compare)(const T *a, const T *b)) -{ - qsort(vect, used, sizeof(T), (compare_func)compare); -} -*/ - -// table view - sort -void Procview::linearize_tree(QVector *ps, int level, int prow, - bool hide) -{ - static_sortcat = sortcat; - // ps->sort(reversed ? compare_backwards : compare); - if (reversed) - qsort(ps->data(), ps->size(), sizeof(Procinfo *), - (compare_func)compare_backwards); - else - qsort(ps->data(), ps->size(), sizeof(Procinfo *), - (compare_func)compare); - - int size = ps->size(); - // printf("level=%d prow=%d size=%d\n",level,prow,size); - for (int i = 0; i < size; i++) - { - Procinfo *p = (*ps)[i]; - // if (p->pid<6 ) printf("pid=%d level=%d - // parent_row=%d\n",p->pid,p->pid,p->parent_row); - p->level = level; - p->lastchild = false; - p->table_child_seq = i; // ************* where using ? -> sequence - p->parent_row = prow; - if (!hide) - linear_procs.append(p); // need !! - if (p->table_children.size()) // and !p->hidekids) - linearize_tree(&p->table_children, level + 1, - linear_procs.size() - 1, hide | p->hidekids); - } - - if (size > 0) - (*ps)[size - 1]->lastchild = true; -} - -/// basic,memory,job fields -void Procview::set_fields_list(int fields[]) -{ - cats.clear(); - for (int i = 0; fields[i] != F_END; i++) - { - if (fields[i] == F_CPUNUM and Proc::num_cpus < 2) - continue; // not correctly work - - Category *c = categories.value(fields[i], NULL); - if (c) - { - // printf("name=%s\n",c->name); - cats.append(c); - } - } - return; -} - -// return the column number of a field, or -1 if not displayed -int Procview::findCol(int field_id) -{ - for (int i = 0; i < cats.size(); i++) - if (cats[i]->id == field_id) - return i; - return -1; -} - -// basis -// called by -// void Procview::fieldArrange(); -// qps(); -// -void Procview::addField(int Fid, int where) -{ - // where=-1; - // printf("Fid =%d where=%d\n",Fid,where); - // where=pstable->clickedColumn(); - if (where == 0) - { - // if (pstable->treeMode()) where=1; - } - - if (Fid == F_PROCESSNAME) - where = 0; - if (Fid == F_CMDLINE) - where = cats.size(); // always should be the last column - - if (where < 0) - { - // this is default - where = cats.size(); - } - - if (where > cats.size()) // CMD_LINE ! ?????? - where = 1; - - Category *newcat = categories[Fid]; - // printf("name =%s where=%d\n",newcat->name,where); - if (cats.indexOf(newcat) < 0) // if not in the list **** - cats.insert(where, newcat); -} - -// add a category to last by name -void Procview::addField(char *name) // interface -{ - // QString str=sl[i]; - int id = field_id_by_name(name); - if (id >= 0) - addField(id); // add to last - - return; - - Category *cat = cat_by_name(name); - if (cat) - cats.append(cat); -} - -void Procview::removeField(int field_id) -{ - for (int i = 0; i < cats.size();) - { - // printf("Fid=%d cats[%d].id=%d - //\n",field_id,i,cats[i]->id); - if (true) - { - if (cats[i]->id == field_id) - { - // if(cats[i]->id==F_CMD and !treeview) - // idxF_CMD=-1; - cats.remove(i); - break; - } - else - i++; - } - } - // printf("Fid=%d cats.size=%d\n",field_id,cats.size()); -} - -// called by -// 1. write_settings() -// DEL? -> not yet -void Procview::update_customfield() -{ - int i; - // printf("update custom_fields\n"); - - customfields.clear(); - - for (i = 0; i < cats.size(); i++) - customfields.append(cats[i]->name); - - // DEL - if (false and treeview) - { - int idx = customfields.indexOf("COMMAND"); // == removeField(F_CMD); - if (idx >= 0) - customfields.removeAt(idx); - - if (idxF_CMD >= 0) - { - /* if(customfields.size()<=idxF_CMD) - customfields.append(categories[F_CMD]->name); - else */ - customfields.insert(idxF_CMD, categories[F_CMD]->name); - } - } - - return; -} - -// Description : FIELD movement by mouse drag -// From col To place -void Procview::moveColumn(int col, int place) -{ - int i; - - int f_size = cats.size(); - if (col < 0 or place < 0 or f_size <= col or f_size <= place) - { - printf("QPS code bugs!! : moveColumn() col=%d place=%d " - "cats.size=%d\n", - col, place, cats.size()); - return; - } - - if (treeview == true) - { - // *** important : F_PROCESSNAME field should be the first in - // TreeMode! - /// if(place==0) return; - if (cats[col]->index == F_PROCESSNAME) - place = 0; - } - - // COMMAND_LINE field should always be the last field - // if(cats[place]->index==F_CMDLINE) return; - if (cats[col]->index == F_CMDLINE) - place = cats.size() - 1; - - Category *cat = cats[col]; // SEGFAULT POSSIBLE! - cats.insert(place, cat); // insert - - if (place < col) - col++; - - cats.remove(col); // remove idx - // refresh(); - /// update_customfield(); -} - -// always called when linear to tree -// DEL -void Procview::saveCOMMANDFIELD() {} - -// call by -// void Pstable::moveCol(int col, int place) -// void Pstable::setTreeMode(bool treemode) -// void Procview::set_fields() -// TODO: checkField(); -void Procview::fieldArrange() -{ - - if (treeview == true) - { - // Tree Mode - // If ProcessName isn't the leftmost column, move it to - // leftmost - // *** important : F_PROCESSNAME field should be the first in - // TreeMode! - if (cats[0]->index != F_PROCESSNAME) - { - // find F_PROCESSNAME - for (int i = 1; i < cats.size(); i++) - { - if (cats[i]->index == F_PROCESSNAME) - moveColumn(i, 0); - } - } - // PID sort for convenience (default) - /* - if(false and cats[i]->index == F_PID ) - { - reversed = false; - sortcat = cats[i]; - //// pstable->setSortedCol(i); - } */ - // Linear_Mode: - } - - if (true) - { - - for (int i = 0; i < cats.size(); i++) - { - - if (cats[i]->index == F_CMDLINE) - { - // COMMAND_LINE field should always be the last - // field - if (i == (cats.size() - 1)) - moveColumn(i, 0); - else - { - } - } - } - } -} - -void Procview::setTreeMode(bool b) -{ - if (treeview == false) - { - if (sortcat_linear == NULL) - sortcat_linear = sortcat; - else - sortcat = sortcat_linear; - } -} - -void Procview::setSortColumn(int col, bool r) -{ - // qDebug("xxx error? col>=cats.size() %d",col); - if (col >= cats.size()) - { - qDebug("hmmm error? col>=cats.size() %d", col); - return; - } - - // if(!procview->treeview) just reverse the lines - if (col == sort_column) - reversed = !reversed; - else - reversed = false; - sortcat = cats[col]; - sort_column = col; -} - -Category *Procview::static_sortcat = 0; -int Procview::compare(Procinfo *const *a, Procinfo *const *b) -{ - if (static_sortcat == 0) - return 0; - int r = static_sortcat->compare(*a, *b); - return (r == 0) ? ((*a)->pid > (*b)->pid ? 1 : -1) : r; -} - -int Procview::compare_backwards(Procinfo *const *a, Procinfo *const *b) -{ - if (static_sortcat == 0) - return 0; - int r = static_sortcat->compare(*b, *a); - return (r == 0) ? ((*b)->pid > (*a)->pid ? 1 : -1) : r; -} - -// COMMON -Category *Proc::cat_by_name( const QString &s ) -{ - - if ( ! s.isNull() ) - { - // java style - QHashIterator i(categories); - while (i.hasNext()) - { - i.next(); - const QString &p = i.value()->name; - int index = p.indexOf( QRegExp( "\\S" ) ); - if ( p.indexOf( s, index ) == index ) - return i.value(); - // cout << i.key() << ": " << i.value() << endl; - } - } - return 0; -} - -// COMMON -// call by -int Proc::field_id_by_name(const QString &s) -{ - if ( ! s.isNull() ) - { - // STL style - QHash::iterator i = categories.begin(); - while (i != categories.end()) - { - if ( i.value()->name == s ) - return i.key(); // cout << i.key() << ": " << - // i.value() << endl; - ++i; - } - } - return -1; -} - -// postInit -void Proc::commonPostInit() -{ - // java style - /* - QHashIterator i(categories); // a little suck! - while (i.hasNext()) { - i.next(); - i.value()->index=i.key(); - i.value()->id=i.key(); - }*/ - - // STL style , set id - QHash::iterator i = categories.begin(); - while (i != categories.end()) - { - i.value()->index = i.key(); - i.value()->id = i.key(); - // cout << i.key() << ": " << i.value() << endl; - ++i; - } - - num_opened_files = 0; // test - num_process = 0; // 64bit - num_network_process = 0; // 64bit - - dt_total = 0; // diff system tick - dt_used = 0; // for infobar - - loadavg[0] = loadavg[1] = loadavg[2] = - 0.0; // CPU load avg 1min,5min,15minute - - Proc::num_cpus = 0; - Proc::old_num_cpus = 0; - - Proc::mem_total = 0; - Proc::mem_free = 0; - - Proc::mem_buffers = 0; - Proc::mem_cached = 0; - // mem_shared = 0; // only linux kernel 2.4.x??? - - Proc::swap_total = 0; - Proc::swap_free = 0; - - Proc::qps_pid = -1; - Proc::loadQps = 0.0; - - Proc::cpu_times_vec = 0; // array. - Proc::old_cpu_times_vec = 0; - - Proc::boot_time = 0; - Proc::clk_tick = 100; // for most system - - current_gen = 0; // ! - mprocs = NULL; - hprocs = NULL; - - clk_tick = - sysconf(_SC_CLK_TCK); //****** The number of clock ticks per second. - // - // printf("Qps: hz=%d\n",clk_tick); - - /// Procinfo::init_static(); -} - -// COMMON? -// called by Procview::rebuild() -// using procs, makes root_procs for TABLE_View -void Procview::build_tree(Proclist &procs) -{ - Procinfo *p; - int proc_n = 0; - - // children clear - root_procs.clear(); - - QHash::iterator i; - for (i = procs.begin(); i != procs.end();) - { - Procinfo *p = i.value(); - p->table_children.clear(); - if ((p->accepted = accept_proc(p))) - proc_n++; - ++i; - } - - Proc::num_process = proc_n; // count process - - // find parent of a process - for (i = procs.begin(); i != procs.end(); ++i) - { - p = i.value(); // always not NULL - - if (p->accepted) - { - Procinfo *parent = 0; - int virtual_parent_pid; - - if (p->isThread()) - virtual_parent_pid = p->tgid; // thread's leader ID. - else - virtual_parent_pid = p->ppid; - - if (p->pid < p->ppid) - { - // this occurs !! a reporter mailed to me - } - - parent = procs.value(virtual_parent_pid, - NULL); // if pid not found, then return NULL. - - // printf("thread_leader=0 (%d) - //%s\n",p->tgid,p->command.ascii()); - if (treeview and parent and parent->accepted) - { - // p->table_child_seq=parent->table_children.size(); - parent->table_children.append(p); - } - else - { - // 1.init(pid=1) process - // 2.some process which parent not accepted - // 3.(null) thread has TGID=0,PPID=0 - // 4.when not tree mode - root_procs.append(p); - } - } - } -} - -// COMMON -// BOTTLENECK No.3 0.5% -// re-sort the process list , ::rebuild() for Table -// called by Pstable::refresh() -void Procview::rebuild() -{ - linear_procs.clear(); // Svec procs in Proview -#ifdef LINUX - linear_socks.clear(); -#endif - - // Procinfo *pi = getProcinfoByPID(Procinfo::qps_pid); - // if(pi) Procinfo::loadQps=pi->pcpu; - // printf("rebuild\n"); - - /* if(mprocs) - { - build_tree(*mprocs); - } - else */ - build_tree(Proc::procs); - - linearize_tree(&root_procs, 0, -1); -} - -#include // log() -// COMMON: CORE -// Description: update the process list BottleNeck 1.5% -// read /proc/* -// called by Procview::refresh(), every UPDATE . -void Proc::refresh() -{ - current_gen++; - - // TEST for Process History - SysHistory *s = new SysHistory; - - history.append(s); - hprocs = &(s->procs); - - // init - /// num_opened_files=0; - Proc::num_process = 0; - Proc::num_network_process = 0; - - Proc::read_loadavg(); - Proc::read_system(); // **** should be every refresh !! - // s->load_cpu=(float)Proc::dt_used/Proc::dt_total; //after - // read_system(); - - s->load_cpu = load_cpu; // after read_system(); - s->time = time(NULL); // save current time in seconds since epoch - - // TODO: clean - // Procinfo::read_sockets(); // for future, BottleNect 2% - read_byte = 0; - write_byte = 0; - io_byte = 0; //!!! - /// Proc::read_sockets(); // test - - read_proc_all(); // Linux, Solaris... - - // s->load_io=(float)(read_byte + write_byte ); // (50*1024*1024); - // //dt_total; - if (io_byte != 0) - { - s->load_io = log10(io_byte) * 2; // 9000 -> 3point - // printf("DEBUG: rw=[%d,%d] %d, %f\n",read_byte, - // write_byte,io_byte,s->load_io); - } - else - s->load_io = 0; - - // remove non-existing processes, remove Procinfos of nonexisting - // processes - QHash::iterator i; - for (i = procs.begin(); i != procs.end();) - { - Procinfo *p = i.value(); - if (p->generation != current_gen) - { - // printf("delete %d\n",p->pid); - i = procs.erase(i); - delete p; - } - else - { - // p->table_children.clear(); // for rebuild() - // p->accepted=accept_proc(p); - ++i; - } - } - - // TESTING - while (history.size() >= maxSizeHistory) - { - // if(history.isEmpty()==false) - delete history.takeFirst(); - } -} - -// COMMON -// read new process info -void Procview::refresh() -{ - /****************************************************************/ - /* Procview.procs has the procinfo - */ - /****************************************************************/ - if (enable) - { - // printf("Procview::refresh()\n"); - Proc::refresh(); // read "/proc/*", then update the process list - } -} - -SysHistory::~SysHistory() -{ - for (const auto *p : qAsConst(procs)) - { - delete p; - } - procs.clear(); // remove all (key,val) -} - -/* check -Category *Proc::cat_by_name(const char *s) -{ - if( s ) - { - for( int i = 0; i < categories.size(); i++ ) - if( strcmp(categories[i]->name, s) == 0 ) - return categories[i]; - } - return 0; -} - - -int Proc::field_id_by_name(const char *s) -{ - if( s ) - { - for( int i = 0; i < categories.size(); i++ ) - if( strcmp(categories[i]->name, s) == 0 ) - return i; - } - return -1; -} -*/ diff --git a/src/proc_linux.cpp b/src/proc_linux.cpp deleted file mode 100644 index 7b4ecdd..0000000 --- a/src/proc_linux.cpp +++ /dev/null @@ -1,2271 +0,0 @@ -/* - * proc.cpp for Linux - * - * Copyright 1997-1999 Mattias Engdegård - * Copyright Olivier Daudel - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -/* - LWP (Light Weight Process): just thread, mainly used in Solaris - Task : thread and process in Linux - NPTL(Native POSIX Thread Library) - TGID thread group leader's pid -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include // sched_rr_get_interval(pid, &ts); -#include // basename() -#include // sysconf() POSIX.1-2001 - -#include -//#include //HZ defined, no more used. -//#include "misc.h" // x_atoi() , userName() ,groupname() - -#include "proc.h" -#include "uidstr.h" -#include "ttystr.h" -#include "wchan.h" - -#ifdef GTK -#include "detail_gtk.h" -#else -#include "details.h" //qt -#endif - -#include "proc_common.cpp" // COMMON code !!!! - -#define PROCDIR "/proc" // hmmm - -bool flag_SMPsim = false; // SMP simulation - -extern int flag_thread_ok; -extern bool flag_schedstat; -extern bool flag_show_thread; -extern bool flag_devel; - -int pagesize; -int Proc::update_msec = 1024; - -// socket states, from and touched to avoid name collisions -enum -{ - SSFREE = 0, /* not allocated */ - SSUNCONNECTED, /* unconnected to any socket */ - SSCONNECTING, /* in process of connecting */ - SSCONNECTED, /* connected to socket */ - SSDISCONNECTING /* in process of disconnecting */ -}; - -#define QPS_SCHED_AFFINITY ok - -#ifdef QPS_SCHED_AFFINITY -#ifndef SYS_sched_setaffinity -#define SYS_sched_setaffinity 241 -#endif -#ifndef SYS_sched_getaffinity -#define SYS_sched_getaffinity 242 -#endif - -// Needed for some glibc -int qps_sched_setaffinity(pid_t pid, unsigned int len, unsigned long *mask) -{ - return syscall(SYS_sched_setaffinity, pid, len, mask); -}; -int qps_sched_getaffinity(pid_t pid, unsigned int len, unsigned long *mask) -{ - return syscall(SYS_sched_getaffinity, pid, len, mask); -}; -#endif - -/* - Thread Problems. - pthread_exit() - */ - -struct proc_info_ -{ - int proc_id; - char flag; - char type; - int files; -} proc_info; // TESTING - -struct list_files_ -{ - int proc_id; - int flag; - char *filename; // path + filename -} list_files; // TESTING - -// read() the number of bytes read is returned (zero indicates end of file) -// return the number of bytes read if ok, -1 if failed -inline int read_file(char *name, char *buf, int max) -{ - int fd = open(name, O_RDONLY); - if (fd < 0) - return -1; - int r = read(fd, buf, max); - close(fd); - // buf[r]=0; - return r; -} - -// Description : read proc files -// return 0 : if error occurs. -char buffer_proc[1024 * 4]; // enough..maybe -char *read_proc_file(const char *fname, int pid = -1, int tgid = -1, - int *size = NULL) -{ - static int max_size = 0; - char path[256]; - int r; - - if (pid < 0) - sprintf(path, "/proc/%s", fname); - else - { - if (tgid > 0) - sprintf(path, "/proc/%d/task/%d/%s", tgid, pid, fname); - else - sprintf(path, "/proc/%d/%s", pid, fname); - } - - if (strcmp(fname, "exe") == 0) - { - if ((r = readlink(path, buffer_proc, sizeof(buffer_proc) - 1)) >= 0) - { - buffer_proc[r] = 0; // safer - return buffer_proc; - } - else - return 0; - } - - int fd = open(path, O_RDONLY); - if (fd < 0) - return 0; - r = read(fd, buffer_proc, sizeof(buffer_proc) - 1); // return 0 , -1 , - if (r < 0) - return 0; - - if (max_size < r) - max_size = r; - - if (size != 0) - *size = r; - - buffer_proc[r] = 0; // safer - - return buffer_proc; - // note: not work fgets(sbuf, sizeof(64), fp) why??? -} - -char *read_proc_file2(char *r_path, const char *fname, int *size = NULL) -{ - static int max_size = 0; - char path[256]; - int r; - - // strcpy(path,r_path); - - sprintf(path, "%s/%s", r_path, fname); - - if (strcmp(fname, "exe") == 0) - { - if ((r = readlink(path, buffer_proc, sizeof(buffer_proc) - 1)) >= 0) - { - buffer_proc[r] = 0; // safer - return buffer_proc; - } - else - return 0; - } - - int fd = open(path, O_RDONLY); - if (fd < 0) - return 0; - r = read(fd, buffer_proc, - sizeof(buffer_proc) - 1); // return 0 , -1 , read_count - if (r < 0) - return 0; - - if (max_size < r) - max_size = r; - - if (size != 0) - *size = r; - - buffer_proc[r] = 0; // safer - close(fd); - - return buffer_proc; - // note: not work fgets(sbuf, sizeof(64), fp) why??? -} - -// TEST CODE , Bottleneck -// Description: read /proc/PID/fd/* check opened file, count opened files -// this fuction will be called when every update. -// Return Value : -int proc_pid_fd(const int pid) -{ - char path[256]; - char buffer[256], fname[256]; - DIR *d; - int fdnum; - int len, path_len; - - sprintf(path, "/proc/%d/fd", pid); - - path_len = strlen(path); - d = opendir(path); - - if (!d) - { - // this happend when the process died already or Zombie process - // printf("Qps : read fail !! /proc/%d/fd !!! kernel bug ? - // \n",pid); - return false; - } - - struct dirent *e; - while ((e = readdir(d)) != 0) - { - if (e->d_name[0] == '.') - continue; // skip "." and ".." - - path[path_len] = '/'; - path[path_len + 1] = 0; - strcat(path, e->d_name); - - len = readlink(path, fname, sizeof(fname) - 1); - if (len > 0) - { - fname[len] = 0; - // printf("DEBUG: %s[%s]\n",path,fname); - // if (strcmp(fname,"/dev/null")==0 ) continue; - } - - /// num_opened_files++; - // strcpy(p, e->d_name); - // fdnum = atoi(p); - // read_fd(fdnum, path); - } - closedir(d); - return true; -} - -// new process created -Procinfo::Procinfo(Proc *system_proc, int process_id, int thread_id) : refcnt(1) -{ - first_run = true; - clone = false; - - proc = system_proc; - - if (thread_id < 0) // - { - pid = process_id; - tgid = process_id; // thread group leader's id - } - else - { - pid = thread_id; - tgid = process_id; // thread group leader's id - } - - ppid = 0; // no parent - selected = false; - hidekids = false; - envblock = 0; //!! - - table_child_seq = -1; - child_seq_prev = -1; - - lastchild = 0; - generation = -1; - detail = 0; - - /// per_cpu_times = 0; not yet - - size = 0; - resident = 0; - trs = 0; - drs = 0; - stack = 0; - share = 0; - mem = 0; - - io_read_prev = 0; // ** - io_write_prev = 0; - io_read = 0; // ** - io_write = 0; // ** - - // tgid=0; - pcpu = 0; - pmem = 0; - - old_utime = 0; // this must be current utime ! - old_wcpu = 0; - - command = "noname"; - tty = 0; - nice = 0; - starttime = 0; - state = 'Z'; - cutime = utime = 0; - - nthreads = 0; /* number of threads */ - - hashstr[0] = 0; - hashlen = 0; -} - -Procinfo::~Procinfo() -{ - if (!clone) - { - void watchdog_check_if_finish(QString cmd, Procinfo * p); - watchdog_check_if_finish(command, this); - - if (detail) - { - // printf("~Procinfo() : pid=%d\n",pid); - detail->process_gone(); - detail = 0; - } - - // if(environ) delete environ; - if (envblock) - free(envblock); /// double free , SEGFAULT - } - - // fd_files.squeeze(); - // maps.squeeze(); - /* - if(maps) { - maps->purge(); - delete maps; - } - if(fd_files) { - fd_files->purge(); - delete fd_files; - } - */ - - // if(children) - // { children->clear(); delete children; } - /// delete[] per_cpu_times; -} - -// miscellaneous static initializations -void Proc::init_static() -{ - - // socks.setAutoDelete(true); - /// usocks.setAutoDelete(true); - - pagesize = sysconf(_SC_PAGESIZE); // same getpagesize() in - // printf("pagesize=%d, %d\n",getpagesize(), - // sysconf(_SC_PAGESIZE)); //4027 -} - -// tricky function...(by fasthyun@magicn.com) -// Description : -// let's deal thread as normal process! -// read /proc/PID/task/* and add to Proc::procs[] -int Proc::read_pid_tasks(int pid) -{ - char path[256]; - struct dirent *e; - int thread_pid; - int thread_n = 0; - Procinfo *pi = 0; - - sprintf(path, "/proc/%d/task", pid); - - DIR *d = opendir(path); - if (!d) - return -1; // process dead already! - - while ((e = readdir(d)) != 0) - { - if (e->d_name[0] == '.') - continue; // skip "." , ".." - - thread_pid = atoi(e->d_name); - if (pid == thread_pid) - continue; // skip - - pi = procs.value(thread_pid, NULL); - - if (pi == NULL) - { - pi = new Procinfo(this, pid, thread_pid); - procs.insert(thread_pid, pi); - } - if (pi->readproc() >= 0) - { - pi->generation = current_gen; - // if(pid!=thread_pid) - // pi->cmdline="(thread)"; - } - thread_n++; - } - closedir(d); - return thread_n; -} - -// update wcpu,%cpu field -void Procinfo::calculate_cpu() // -{ -} - -// using cache for Speed up -int Procinfo::hashcmp(char *sbuf) -{ - int statlen; - - statlen = strlen(sbuf); - if (statlen > sizeof(hashstr)) - { - // some user reported 265byte. - printf("Qps BUG: hashstr shortage statlen(%d) > hashstr(%lu), " - "report this " - "message to fasthyun@magicn.com \n", - statlen, sizeof(hashstr)); - abort(); - } - else if (statlen == hashlen) - { - if (memcmp(hashstr, sbuf, statlen) == 0) - { - pcpu = 0; - // 1. I am a sleeping process - // printf("[%d] sleep process \n",pid); - return 1; - } - } - memcpy(hashstr, sbuf, statlen); // to back - hashlen = statlen; - return 0; -} - -int mini_sscanf(const char *s, const char *fmt, ...); - -// Description : read /proc/PID/* or read /proc/PID/task/* -// be called every refresh() time. -// return -1 means the process already dead ! -int Procinfo::readproc() -{ - char cmdbuf[MAX_CMD_LEN]; - char path[64]; - int len; - char *sbuf; // should be enough to acommodate /proc/PID/stat - char *buf; - - int x_pid; // just pid - int i_tty; // - long stime, cstime; - - // Note : /proc/PID/* is not same /proc/task/PID/* - if (isThread()) // flag_thread_ok - { - sprintf(path, "/proc/%d/task/%d", tgid, pid); - } - else - sprintf(path, "/proc/%d", pid); - - if (first_run) - { - // Note: COMMAND(?) , TGID, UID , COMMAND_LINE never - // change ! - old_wcpu = wcpu = pcpu = 0.0; - - // read /proc/PID/status - if ((buf = read_proc_file2(path, "status")) == 0) - return -1; - - // Note: Process_name from - // 1.status (15 chars-name) - // 2.stat (15 chars-name, pass) - // 3.cmdline : full name (sometimes have null, Thread - // can't use - // cmdline) - // 4.exe : full name (frequently this does not exist, - // thread can't use - // exe) - // 5.comm : 15 chars ? - // - // Note: - // 1. thread's name_max is 15 chars - - if (mini_sscanf(buf, "Name: %S\n", cmdbuf) == 0) - return -1; - else - { - command = cmdbuf; - if (command.contains("kthread")) - hidekids = true; // kthread, kthreadd , - // ///Procinfo::qps_pid=pid; - } - - if (mini_sscanf(buf, "Tgid: %d ", &tgid) == 0) - return -1; - if (mini_sscanf(buf, "Uid: %d %d %d %d", &uid, &euid, &suid, &fsuid) != - 4) - return -1; - if (mini_sscanf(buf, "Gid: %d %d %d %d", &gid, &egid, &sgid, &fsgid) != - 4) - return -1; - - username = userName(uid, euid); - groupname = groupName(gid, egid); - - int bug = 0; - char cmdline_cmd[4096]; // some cmdline very large! ex)chrome - // read /proc/pid/cmdline - int size; - cmdline_cmd[0] = 0; - - // anyone can read [cmdline] - if ((buf = read_proc_file2(path, "cmdline", &size)) == 0) - return -1; - else - { - // printf("DEBUG: size=%d \n",size); - int cmdlen = strlen(buf); - - if (cmdlen == 0) - { - // 1. kthread - // printf("Qps:debug no_cmdline pid=%d\n",pid ); - cmdline = ""; - } - // for non-ascii locale language - // cmdline = codec->toUnicode(cmdbuf,strlen(cmdbuf)); - else - { - - // change 0x00,0xA to ' ' - for (int i = 0; i < size - 1; i++) // OVERFLOW - if (buf[i] == 0 or buf[i] == 0x0A) - buf[i] = ' '; - cmdline = buf; - strcpy(cmdline_cmd, buf); - } - } - - // VERY COMPLEX CODE - // because Command's MAX_length is only 15, so sometimes - // cmd_name truncated, - // we should guess ... - // - // The solution is... - // 1.check [exe] file ( only owner can read it) - // 2.check [cmdline] ( anyone can read it ) - // 3.check [comm] - // - if (command.size() == 15) - { - // only root & owner can read [exe] link - /* - if((buf= read_proc_file2(path,"exe")) !=0 ) - { - // printf("Qps:debug %s\n",buf ); - if(strlen(basename(buf))>15 and - strncmp(qPrintable(command),basename(buf),15)==0 - ) - command=basename(buf); // no - memory leak ! - else ;// just use command - //printf("Qps:debug %s\n",buf ); - } */ - - if (true) // guess the full name of the command - { - // Use /proc/PID/cmdline, comm, status - // ex) - // /usr/lib/chromium/chromium --option1 - // --option2 - // python /usr/lib/system-service-d - // pam: gdm-password - // hald-addon-input: Listing On /dev~ - // - char *p; - p = strstr(cmdline_cmd, ": "); // cut the options ! - if (p != 0) - *p = 0; - p = strchr(cmdline_cmd, ' '); // cut the options ! - if (p != 0) - *p = 0; - - // printf("Qps:debug %s\n",cmdline_cmd ); - char *pstart = strstr(basename(cmdline_cmd), cmdbuf); - if (pstart != 0) - { - command = pstart; // copy - /// printf("Qps:debug2 - /// %s\n",basename(cmdline_cmd)); - } - } - } - - if (isThread()) - cmdline = command + " (thread)"; - - if (flag_devel and bug) - { - // command.append("^"); - cmdline += " ^ Qps: may be a wrong commandline "; - } - - void watchdog_check_if_start(QString cmd, Procinfo * ps); - watchdog_check_if_start(command, this); // segfault possible. - - first_run = false; - } - - if (flag_schedstat == true) - { - // if no change then return. twice faster ! - // MAX_256 bytes check...? - // 2.6.9 upper only and some system no has - if ((sbuf = read_proc_file2(path, "schedstat")) == 0) - return -1; - - if (hashcmp(sbuf)) - return 1; // no change - } - // read /proc/PID/stat - if ((sbuf = read_proc_file2(path, "stat")) == 0) - return -1; - - if (flag_schedstat == false) // if no change then return. twice faster ! - { - if (hashcmp(sbuf)) - return 1; - } - - /// if (proc_pid_fd(pid)== true) ; // bottleneck !! - - /* - Not all values from /proc/#/stat are interesting; the ones left - out - have been retained in comments to see where they should go, in - case - they are needed again. - - Notes : - 1. man -S 5 proc - 2. man -S 2 times - 3. ppid can be changed when parent dead ! - 4. initial utime maybe 0, so %CPU field NotAnumber !! - utime: user time - stime: kernel mode tick - cutime : The number of jiffies that this process's waited-for - children have been scheduled in user mode. - - #jiffies == tick - */ - unsigned int guest_utime, cguest_utime; -#if 1 - char *p, *p1; - // in odd cases the name can contain spaces and '(' or ')' and numbers, - // so - // this makes - // parsing more difficult. We scan for the outermost '(' ')' to find the - // name. - p = strchr(sbuf, '('); - p1 = strrchr(sbuf, ')'); - if (p == 0 || p1 == 0) - return -1; - p1++; - // we can safely use sscanf() on the rest of the string - sscanf(p1, - " %c %d %d %d %d %d" - " %lu %lu %lu %lu %lu " - "%ld %ld %ld %ld %d %d %d %*s %lu %*s %*s %*s %*s %*s %*s %*s %*s " - "%*s %*s %*s %*s %lu %*s %*s %*s %u %*s %*s %*s %u %u", -#else - // some errors will occur ! - mini_sscanf( - sbuf, - "%d (%S) %c %d %d %d %d %d" - "%lu %lu %lu %lu %lu " - "%ld %ld %ld %ld %d %d %d %*s %lu %*s %*s %*s %*s %*s %*s %*s %*s " - "%*s %*s %*s %*s %lu %*s %*s %*s %u %*s %*s %*s %u %u", - &x_pid, &cmdbuf[0], -#endif - &state, &ppid, &pgrp, &session, &i_tty, &tpgid, &flags, &minflt, - &cminflt, &majflt, &cmajflt, &utime, &stime, &cutime, &cstime, - &priority, &nice, &nthreads /* number of threads v2.6 */, - /* itrealvalue */ - &starttime, /* start time(static) */ // jiffes - /* vsize */ - /* rss */ - /* rlim, startcode, endcode, startstack kstkesp kstkeip, - signal, blocked, sigignore, sigcatch */ - &wchan, - /* 0L, 0L, exit_signal */ - &which_cpu - /* rt_priority, policy, delayacct_blkio_ticks */ - , - &guest_utime, &cguest_utime); - - starttime = proc->boot_time /* secs */ + (starttime / proc->clk_tick); - - tty = (dev_t)i_tty; // hmmm - // if(tty!=0) printf("pid=%d tty =%d\n",pid,tty); - - // if(guest_utime>0 or cguest_utime>0) - // printf("cmd [%s] guest_utime=%d cguest_utime - //=%d\n",qPrintable(command),guest_utime,cguest_utime); - - utime += stime; // we make no user/system time distinction - cutime += cstime; - - if (old_utime > 0) // check.. - { - int dcpu; - dcpu = utime - old_utime; // user_time from proc - if (dcpu < 0) - { - // why.. this occurs ? - // Qps exception:[3230,firefox] dcpu=-22 utime=39268 - // old_utime=39290 why - // occur? - if (flag_devel) - printf("Qps :[%d,%s] dcpu=%d utime=%ld " - "old_utime=%ld why occurs?\n", - pid, qPrintable(command), dcpu, utime, old_utime); - return 1; - } - - // gettimeofday(&tv, 0); //sys/time - if (proc->dt_total > 0) // move to Proc ?? - { - pcpu = 100.0 * dcpu / proc->dt_total; - if (Procview::flag_pcpu_single == true) - pcpu *= proc->num_cpus; // - } - // else too fast read again - // printf("Qps exception: dt_total=%d report to - // fasthyun@magicn.com - // \n",Proc::dt_total); - - if (flag_devel and pcpu > 100) // DEBUG CODE - { - printf("Qps pcpu error: %0.0f%% [%d,%s] dt_total=%ld " - "dcpu=%d utime=%ld " - "old_utime=%ld \n", - pcpu, pid, qPrintable(command), proc->dt_total, dcpu, utime, - old_utime); - pcpu = 99.99; - } - - const float a = Procview::avg_factor; - wcpu = a * old_wcpu + (1 - a) * pcpu; - } - old_tv = tv; - old_wcpu = wcpu; - old_utime = utime; // **** - - // read /proc/%PID/statm - memory usage - if (1) - { - if ((buf = read_proc_file2(path, "statm")) == 0) - return -1; // kernel 2.2 ? - sscanf(buf, "%lu %lu %lu %lu %lu %lu %lu", &size, &resident, &share, - &trs, &lrs, &drs, &dt); - size *= pagesize / 1024; // total memory in kByte - resident *= pagesize / 1024; - share *= pagesize / 1024; // share - // trs ; // text(code) - // lrs ; // zero : lib, awlays zero in - // Kernel 2.6 - // drs ; // data: wrong in kernel 2.6 - // dt ; // zero : in Kernel 2.6 - mem = resident - share; - // pmem = 100.0 * resident / proc->mem_total; - pmem = 100.0 * mem / proc->mem_total; - } - - // read /proc/PID/status check !! - if ((buf = read_proc_file2(path, "status")) == 0) - return -1; - else - { - // slpavg : not supported in kernel 2.4; default value of -1 - if (mini_sscanf(buf, "SleepAVG:%d", &slpavg) == 0) - slpavg = -1; - - if (strstr(buf, "VmSize:")) - { - // mini_sscanf(p, "VmSize: %d",&size); // XXX - // mini_sscanf(p, "VmRSS: %d",&resident); - // mini_sscanf(sbuf, "VmLib: %d",&share); - mini_sscanf(buf, "VmData: %d", &drs); // data in kByte - mini_sscanf(buf, "VmStk: %d", &stack); // stack in kByte - mini_sscanf(buf, "VmExe: %d", &trs); // text - } - } - - /* - generally - shared = RSS - ( CODE + DATA + STACK ) - share= resident - trs -drs -stack; - - // Defines from task_mmu.c of kernel source - total_vm==size - data = mm->total_vm - mm->shared_vm - mm->stack_vm; - swap = p->size - p->resident ; - */ - - // read /proc/PID/file_io - // NOTE: 2.6.11 dont have IO file - // COMPLEX_CODE - if ((buf = read_proc_file2(path, "io")) != 0) - { - // rchar = ... not file maybe sockread - // - mini_sscanf(buf, "read_bytes:%d", &io_read); - mini_sscanf(buf, "write_bytes:%d", &io_write); - - // if(io_read_prev!=0) - { - if (io_read_prev == 0) - io_read_prev = io_read; - if (io_write_prev == 0) - io_write_prev = io_write; - - // NOTE: Kbps right???? - io_read_KBps = (io_read - io_read_prev) / - proc->update_msec; // not accurate.... - io_write_KBps = (io_write - io_write_prev) / proc->update_msec; - - proc->io_byte += io_read_KBps; // test - proc->io_byte += io_write_KBps; - } - - io_read_prev = io_read; - io_write_prev = io_write; - - // io_read>>=10; // divide by 1024 - // io_write>>=10; // divide by 1024 - } - // per_cpu_times = 0; // not yet - - if ((buf = read_proc_file2(path, "wchan")) != 0) - { - wchan_str = buf; - } - - policy = -1; // will get it when needed - rtprio = -1; // ditto - tms = -1; // ditto - - // useless ? if(detail) detail->set_procinfo(this); // BAD !!! - return 2; // return ok. -} - -// just grab the load averages -// called by -void Proc::read_loadavg() -{ - char path[80]; - char buf[512]; - int n; - strcpy(path, "/proc/loadavg"); - if ((n = read_file(path, buf, sizeof(buf) - 1)) <= 0) - { - fprintf(stderr, "qps: Cannot open /proc/loadavg (make sure " - "/proc is mounted)\n"); - exit(1); - } - buf[n] = '\0'; - sscanf(buf, "%f %f %f", &loadavg[0], &loadavg[1], &loadavg[2]); -} - -int Proc::countCpu() -{ - static bool first_run = true; - char path[80]; - char buf[1024 * 8]; // for SMP - - int num_cpus = 0, n; - // read system status /proc/stat - strcpy(path, "/proc/stat"); - // if((buf= read_proc_file("stat:)) ==0 ) return -1; - if ((n = read_file(path, buf, sizeof(buf) - 1)) <= 0) - { - printf("Qps Error: /proc/stat can't be read ! check it and " - "report to " - "fasthyun@magicn.com\n"); - abort(); // return 0; - } - buf[n] = '\0'; - - // count (current) cpu of system - char *p; - p = strstr(buf, "cpu"); - while (p < buf + sizeof(buf) - 4 && strncmp(p, "cpu", 3) == 0) - { - num_cpus++; - if (strncmp(p, "cpu0", 4) == 0) - Proc::num_cpus--; - p = strchr(p, '\n'); - if (p) - p++; - } - - if (flag_devel and flag_SMPsim) - { - // num_cpus=64; - int vals[] = {2, 4, 8, 16, 32}; - int r = rand() % 5; - num_cpus = vals[r]; - } - return num_cpus; -} - -// LINUX -// Description: read common information for all processes -// return value -// -1 : too fast refresh ! -int Proc::read_system() // -{ - static bool first_run = true; - char path[80]; - char buf[1024 * 8]; // for SMP - - char *p; - int n; - - if (first_run) - { - /* Version 2.4.x ? */ - strcpy(path, "/proc/vmstat"); - if (!stat(path, (struct stat *)buf)) - flag_24_ok = false; - else - flag_24_ok = true; - - /* NPTL(Native POSIX Thread Library) */ - strcpy(path, "/proc/1/task"); - if (!stat(path, (struct stat *)buf)) - flag_thread_ok = true; - else - flag_thread_ok = false; - - /* check schedstat */ - strcpy(path, "/proc/1/schedstat"); // some system doesn't have - if (!stat(path, (struct stat *)buf)) - flag_schedstat = true; - else - flag_schedstat = false; - - strcpy(path, "/proc/stat"); - if ((n = read_file(path, buf, sizeof(buf) - 1)) <= 0) - return 0; - buf[n] = '\0'; - p = strstr(buf, "btime"); - if (p == NULL) - { - // used - printf("Qps: A bug occurs ! [boot_time] \n"); - // boot_time= current time - } - else - { - p += 6; - // sscanf(p, "%d", &Proc::boot_time); //???? why - // segfault??? - sscanf(p, "%d", &boot_time); - } - - // Max SMP 1024 cpus, MOVETO: COMMON - int max_cpus = 512; - cpu_times_vec = new unsigned[CPUTIMES * max_cpus]; //??? +2 - old_cpu_times_vec = new unsigned[CPUTIMES * max_cpus]; - - // init - for (int cpu = 0; cpu < max_cpus; cpu++) - for (int i = 0; i < CPUTIMES; i++) - { - cpu_times(cpu, i) = 0; - old_cpu_times(cpu, i) = 0; - } - - // first_run=false; // not yet , at the bottom of this function - } - - // read system status /proc/stat - strcpy(path, "/proc/stat"); - // if((buf= read_proc_file("stat:)) ==0 ) return -1; - if ((n = read_file(path, buf, sizeof(buf) - 1)) <= 0) - { - printf("Qps Error: /proc/stat can't be read ! check it and " - "report to " - "fasthyun@magicn.com\n"); - abort(); // return 0; - } - buf[n] = '\0'; - - if (true) - { - // count (current) cpu of system - char *p; - p = strstr(buf, "cpu"); - num_cpus = 0; - while (p < buf + sizeof(buf) - 4 && strncmp(p, "cpu", 3) == 0) - { - num_cpus++; - if (strncmp(p, "cpu0", 4) == 0) - Proc::num_cpus--; - p = strchr(p, '\n'); - if (p) - p++; - } - - if (flag_SMPsim) - { - int vals[] = {2, 4, 8, 16, 32}; - int r = rand() % 5; - num_cpus = vals[r]; - num_cpus = 8; - } - - // Hotplugging Detection : save total_cpu - if (Proc::num_cpus != Proc::old_num_cpus) - { - // for(int i = 0; i < CPUTIMES; i++) - // cpu_times(num_cpus, i) = - // cpu_times(Proc::old_num_cpus, - // i); - - Proc::old_num_cpus = Proc::num_cpus; - } - } - - // backup old values : important******* - for (int cpu = 0; cpu < Proc::num_cpus + 1; cpu++) - { - for (int i = 0; i < CPUTIMES; i++) - old_cpu_times(cpu, i) = cpu_times(cpu, i); - } - - /* - /proc/stat - cpu# user nice system idle iowait(2.6) - irq(2.6) sft(2.6) steal(2.6.11) guest(2.6.24) - cpu0 3350 9 535 160879 - 1929 105 326 5 - 1200 - - Q1: kernel 2.4 cpu0 exist ? - */ - - // Total_cpu - int total_cpu = Proc::num_cpus; - unsigned user, nice, system, idle, iowait, irq, sftirq, steal, guest, nflds; - nflds = sscanf(buf, "cpu %u %u %u %u %u %u %u %u %u", &user, &nice, &system, - &idle, &iowait, &irq, &sftirq, &steal, &guest); - if (nflds > 4) - { - // kernel 2.6.x - system += (irq + sftirq); - idle += iowait; - } - if (nflds == 9) - { - system += steal; - system += guest; - } - cpu_times(Proc::num_cpus, CPUTIME_USER) = user; - cpu_times(Proc::num_cpus, CPUTIME_NICE) = nice; - cpu_times(Proc::num_cpus, CPUTIME_SYSTEM) = system; - cpu_times(Proc::num_cpus, CPUTIME_IDLE) = idle; - - // DRAFT! - // num_cpus == total_cpu - // - // dt_total= user + system + nice + idle - // dt_used= user + system; - Proc::dt_used = - user - old_cpu_times(Proc::num_cpus, - CPUTIME_USER); // infobar uses this value - Proc::dt_used += system - old_cpu_times(Proc::num_cpus, CPUTIME_SYSTEM); - Proc::dt_total = dt_used + nice - - old_cpu_times(Proc::num_cpus, CPUTIME_NICE) + idle - - old_cpu_times(Proc::num_cpus, CPUTIME_IDLE); - - load_cpu = (float)Proc::dt_used / Proc::dt_total; // COMMON - - if (first_run) - { - // printf("\n==================== tooo fast - //=================================\n"); - // printf("DEBUG:dt_total=%d - // dt_used=%d\n",Proc::dt_total,Proc::dt_used); - // return -1; // too early refresh again !! - } - if (Proc::dt_total == 0) - { - //????? - printf("Error: dt_total=0 , dt_used=%ld(%u) report to " - "fasthyun@magicn.com\n", - Proc::dt_used, old_cpu_times(Proc::num_cpus, CPUTIME_IDLE)); - dt_total = 500; // more tolerable? - // abort(); // stdlib.h - } - - // void watchdog_syscpu(int ); - // watchdog_syscpu((user-old_cpu_times(num_cpus,CPUTIME_USER))*100/dt_total); - //// test - - // if(flag_devel and flag_SMPsim ) - if (flag_SMPsim) - { - // for Developer only !!! - // printf("user%d nuce%d system%d - // idle%d\n",user,nice,system,idle); - for (int cpu = 0; cpu < num_cpus; cpu++) - { - // stdlib.h, int rand(); - if (dt_used != 0) - cpu_times(cpu, CPUTIME_USER) = - old_cpu_times(cpu, CPUTIME_USER) + rand() % dt_used; - else - cpu_times(cpu, CPUTIME_USER) = 0; - cpu_times(cpu, CPUTIME_NICE) = nice; - cpu_times(cpu, CPUTIME_SYSTEM) = system; - cpu_times(cpu, CPUTIME_IDLE) = idle; - } - } - else - { - // Single-CPU and SMP(Multi-CPU) - for (int cpu = 0; cpu < num_cpus; cpu++) - { - char cpu_buf[10]; - sprintf(cpu_buf, "cpu%d", cpu); - if ((p = strstr(buf, cpu_buf)) != 0) - { - nflds = sscanf(p, "%*s %u %u %u %u %u %u %u %u %u", - &cpu_times(cpu, CPUTIME_USER), - &cpu_times(cpu, CPUTIME_NICE), - &cpu_times(cpu, CPUTIME_SYSTEM), - &cpu_times(cpu, CPUTIME_IDLE), &iowait, &irq, - &sftirq, &steal, &guest); - // cpu_times(cpu, CPUTIME_USER),cpu_times(cpu, - // CPUTIME_NICE), - if (nflds > 4) - { - // kernel 2.6.x - cpu_times(cpu, CPUTIME_SYSTEM) += (irq + sftirq); - cpu_times(cpu, CPUTIME_IDLE) += iowait; - } - if (nflds == 9) - { - cpu_times(cpu, CPUTIME_SYSTEM) += (steal + guest); - } - - // 2.4.27-SMP bug ? - } - else - { - fprintf(stderr, "Qps: Error reading info for " - "cpu%d (/proc/stat)\n", - cpu); - abort(); - } - } - } - - // read memory info - strcpy(path, PROCDIR); - strcat(path, "/meminfo"); - if ((n = read_file(path, buf, sizeof(buf) - 1)) <= 0) - return 0; - buf[n] = '\0'; - - // Skip the old /meminfo cruft, making this work in post-2.1.42 kernels - // as well. (values are now in kB) - if ((p = strstr(buf, "MemTotal:"))) - sscanf(p, "MemTotal: %d kB\n", &mem_total); - if ((p = strstr(buf, "MemFree:")) != NULL) - sscanf(p, "MemFree: %d kB\n", &mem_free); - if ((p = strstr(buf, "Buffers:")) != NULL) - sscanf(p, "Buffers: %d kB\n", &mem_buffers); - if ((p = strstr(buf, "Cached:")) != NULL) - sscanf(p, "Cached: %d kB\n", &mem_cached); - - p = strstr(buf, "SwapTotal:"); - sscanf(p, "SwapTotal: %d kB\nSwapFree: %d kB\n", &swap_total, &swap_free); - - first_run = false; - return 0; -} - -int Procinfo::get_policy() -{ - if (policy == -1) - policy = sched_getscheduler(pid); - return policy; -} - -int Procinfo::get_rtprio() -{ - if (rtprio == -1) - { - struct sched_param p; - if (sched_getparam(pid, &p) == 0) - rtprio = p.sched_priority; - } - return rtprio; -} - -double Procinfo::get_tms() -{ - struct timespec ts; - if (sched_rr_get_interval(pid, &ts) == -1) // POSIX - tms = -1; // should not be possible - else - { - tms = ts.tv_nsec; // nano seconds - tms /= 1000000; // mili seconds - tms += ts.tv_sec * 1000; - } - return tms; -} - -unsigned long Procinfo::get_affcpu() -{ -#ifdef QPS_SCHED_AFFINITY - if (qps_sched_getaffinity(pid, sizeof(unsigned long), &affcpu) == -1) - affcpu = (unsigned long)0; -#else - if (sched_getaffinity(pid, sizeof(unsigned long), (cpu_set_t *)&affcpu) == - -1) - affcpu = (unsigned long)0; -#endif - return affcpu; -} - -// Description : read /proc/PID/fd/* (SYMBOLIC LINK NAME) -/* We need to implement support for IPV6 and sctp ? */ -void Procinfo::read_fd(int fdnum, char *path) -{ - int len; - char buf[128]; - struct stat sb; - - // The fd mode is contained in the link permission bits - if (lstat(path, &sb) < 0) - return; - int mode = 0; - if (sb.st_mode & 0400) - mode |= OPEN_READ; - if (sb.st_mode & 0200) - mode |= OPEN_WRITE; - - if ((len = readlink(path, buf, sizeof(buf) - 1)) > 0) - { - buf[len] = '\0'; - unsigned long dev, ino; - - // check socket_fd - if ((buf[0] == '[' and sscanf(buf, "[%lx]:%lu", &dev, &ino) == 2 and - dev == 0) // Linux 2.0 style - || - sscanf(buf, "socket:[%lu]", &ino) > 0) // Linux 2.1 upper - { - Sockinfo *si = NULL; - si = proc->socks.value(ino, NULL); // sock - char buf[80]; - if (si) - { - printf("sock ino=%lu\n", ino); - si->pid = pid; - // a TCP or UDP socket - sock_inodes.append(new SockInode(fdnum, ino)); - sprintf(buf, "%s socket %lu", - si->proto == Sockinfo::TCP ? "TCP" : "UDP", ino); - fd_files.append(new Fileinfo(fdnum, buf, mode)); - return; - } - else - { - // maybe a unix domain socket? - // read_usockets(); - UnixSocket *us = NULL; - - us = proc->usocks.value(ino, NULL); - if (us) - { - const char *tp = "?", *st = "?"; - switch (us->type) - { - case SOCK_STREAM: - tp = "stream"; - break; - case SOCK_DGRAM: - tp = "dgram"; - break; - } - switch (us->state) - { - case SSFREE: - st = "free"; - break; - case SSUNCONNECTED: - st = "unconn"; - break; - case SSCONNECTING: - st = "connecting"; - break; - case SSCONNECTED: - st = "connected"; - break; - case SSDISCONNECTING: - st = "disconn"; - break; - } - sprintf(buf, "UNIX domain socket %lu (%s, %s) ", ino, tp, - st); - QString s = buf; - s.append(us->name); - fd_files.append(new Fileinfo(fdnum, s, mode)); - return; - } - } - } - // normal filess - // assume fds will be read in increasing order - fd_files.append(new Fileinfo(fdnum, buf, mode)); - } -} - -// Description : -// read /PID/fd opened files -// return true if /proc/PID/fd could be read, false otherwise -// store fileinfo, and also socket inodes separately -// -// called by Detail() -bool Procinfo::read_fds() -{ - char path[128], *p; - if (flag_thread_ok && flag_show_thread) - sprintf(path, "/proc/%d/task/%d/fd", pid, pid); - else - sprintf(path, "/proc/%d/fd", pid); - - DIR *d = opendir(path); - if (!d) - return false; - - /* - if(!sock_inodes) sock_inodes = new Svec(4); - else sock_inodes->purge(); */ - - strcat(path, "/"); - - fd_files.clear(); // - struct dirent *e; - while ((e = readdir(d)) != 0) - { - char str[128]; - if (e->d_name[0] == '.') - continue; // skip . and .. - int fdnum = atoi(e->d_name); - strcpy(str, path); - strcat(str, e->d_name); - // printf("str=%s\n",str); - read_fd(fdnum, str); - } - // printf("end str=\n"); - closedir(d); - return true; -} - -// tcp, udp -bool Proc::read_socket_list(Sockinfo::proto_t proto, const char *filename) -{ - char path[80]; - sprintf(path, "/proc/net/%s", filename); - FILE *f = fopen(path, "r"); - if (!f) - return false; - - char buf[128 * 3]; - // Header - // sl local_addr rem_addr st tx_queue rx_queue tr tm->when retrnsmt - // uid - // timeout inode - - Sockinfo si; - - printf("read_socket_list()\n"); - fgets(buf, sizeof(buf), f); // skip header - while (fgets(buf, sizeof(buf), f) != 0) - { - // Sockinfo *si = new Sockinfo; - si.pid = -1; - si.proto = proto; - unsigned local_port, rem_port, st, tr; - sscanf(buf + 6, "%x:%x %x:%x %x %x:%x %x:%x %x %d %d %d", - &si.local_addr, &local_port, &si.rem_addr, &rem_port, &st, - &si.tx_queue, &si.rx_queue, &tr, &si.tm_when, &si.rexmits, - &si.uid, &si.timeout, &si.inode); - // fix fields that aren't sizeof(int) - si.local_port = local_port; - si.rem_port = rem_port; - si.st = st; - si.tr = tr; - - Sockinfo *psi; - psi = socks.value(si.inode, NULL); - if (psi == NULL) - { - printf("inode =%d \n", si.inode); - psi = new Sockinfo; - *psi = si; - socks.insert(si.inode, psi); - } - else - *psi = si; - - // linear_socks.add(si); - } - fclose(f); - return true; -} - -bool Proc::read_usocket_list() -{ - char path[80]; - strcpy(path, PROCDIR); - strcat(path, "/net/unix"); - FILE *f = fopen(path, "r"); - if (!f) - return false; - - char buf[256]; - fgets(buf, sizeof(buf), f); // skip header - while (fgets(buf, sizeof(buf), f)) - { - if (buf[0]) - buf[strlen(buf) - 1] = '\0'; // chomp newline - // UnixSocket *us = new UnixSocket; - UnixSocket us; - - unsigned q; - unsigned type, state; - int n; - sscanf(buf, "%x: %x %x %x %x %x %ld %n", - // Num refcount protocol flags type state indoe path - &q, &q, &q /*protocol*/, &us.flags, &type, &state, &us.inode, - &n); - us.name = buf + n; - us.type = type; - us.state = state; - - UnixSocket *pus; - pus = usocks.value(us.inode, NULL); - if (pus == NULL) - { - printf("inode =%lu \n", us.inode); - - pus = new UnixSocket; - *pus = us; - usocks.insert(us.inode, pus); - } - else - *pus = us; - } - fclose(f); - return true; -} - -void Proc::read_sockets() -{ - // socks.clear(); - - // memory leak !! - if (!read_socket_list(Sockinfo::TCP, "tcp") || - !read_socket_list(Sockinfo::UDP, "udp")) - return; - // remove no more socket ino - read_usocket_list(); - - socks_current = true; -} - -void Proc::read_usockets() -{ - if (usocks_current) - return; - - usocks.clear(); - if (!read_usocket_list()) - return; - - usocks_current = true; -} - -void Proc::invalidate_sockets() { socks_current = usocks_current = false; } - -// return true if /proc/XX/maps could be read, false otherwise -bool Procinfo::read_maps() -{ - // idea: here we could readlink /proc/XX/exe to identify the executable - // when running 2.0.x - char name[80]; - - if (flag_thread_ok && flag_show_thread) - sprintf(name, "/proc/%d/task/%d/maps", pid, pid); - else - sprintf(name, "/proc/%d/maps", pid); - - FILE *f = fopen(name, "r"); - if (!f) - return false; - - char line[1024]; // lines can be longer , SEGFAULT - - while (fgets(line, sizeof(line), f)) - { - Mapsinfo *mi = new Mapsinfo; - int n; - sscanf(line, "%lx-%lx %4c %lx %x:%x %lu%n", - // sscanf(line, "%lx-%lx %4c %lx %x:%x %n", - &mi->from, &mi->to, mi->perm, &mi->offset, &mi->major, - &mi->minor, &mi->inode, &n); - if (line[n] != '\n') - { - int len = strlen(line); - if (line[len - 1] == '\n') - line[len - 1] = '\0'; - while (line[n] == ' ' && line[n]) - n++; - mi->filename = line + n; - } - else if ((mi->major | mi->minor | mi->inode) == 0) - mi->filename = "(anonymous)"; - maps.append(mi); - } - fclose(f); - if (maps.size() == 0) - return false; - - return true; -} - -// DRAFT CODE: -// return true if /proc/777/environ could be read, false otherwise -int fsize(char *fname); -bool Procinfo::read_environ() -{ - int file_size = 0; - int size; - char path[256]; - - environ.clear(); // - if (flag_thread_ok && flag_show_thread) - sprintf(path, "/proc/%d/task/%d/environ", pid, pid); - else - sprintf(path, "/proc/%d/environ", pid); - - file_size = fsize(path); - if (file_size <= 0) - return false; - - envblock = (char *)malloc(file_size + 1); - size = read_file(path, envblock, file_size + 1); - if (size <= 0) - return false; - - // kernel 2.6.x has a bug - if (envblock[size - 2] == 0) // how to check the bug. - { - char buf[128]; - sprintf(buf, "Kernel Bug= wrong environments ! please, check " - "/proc/%d/environ !", - pid); - size = strlen(buf) + 1; - if (file_size > size) - strcpy(envblock, buf); - } - - int i = 0, n = 0, v = 0; - char ch; - - for (i = 0; i < size; i++) - { - ch = envblock[i]; - if (ch == '=') - { - envblock[i] = 0; - v = i + 1; - } - if (ch == 0) - { - NameValue nv(&envblock[n], &envblock[v]); - environ.append(nv); - // printf("%s %s\n",&envblock[n],&envblock[v]); - n = i + 1; - } - } - if (envblock) - { - free(envblock); // refresh() // INVALID VALGRIND - envblock = 0; - } - return true; -} - -// CWD,ROOT only so... -Cat_dir::Cat_dir(const char *heading, const char *explain, const char *dirname, - QString Procinfo::*member) - : Cat_string(heading, explain), dir(dirname), cache(member) -{ -} - -QString Cat_dir::string(Procinfo *p) -{ - if ((p->*cache).isNull()) - { - char path[128], buf[512]; - - if (flag_thread_ok && flag_show_thread) - sprintf(path, "/proc/%d/task/%d/%s", p->pid, p->pid, dir); - else - sprintf(path, "/proc/%d/%s", p->pid, dir); - - int n = readlink(path, buf, sizeof(buf) - 1); - if (n < 0) - { - // Either a kernel process, or access denied. - // A hyphen is visually least disturbing here. - p->*cache = "-"; - return p->*cache; - } - else if (buf[0] != '[') - { - // linux >= 2.1.x: path name directly in link - buf[n] = '\0'; - p->*cache = buf; - return p->*cache; - } - - // Either a Linux 2.0 link in [device]:inode form, or a Solaris - // link. - // To resolve it, we just chdir() to it and see where we end up. - // Perhaps we should change back later? - if (chdir(path) < 0) - { - p->*cache = "-"; // Most likely access denied - } - else - { - // getcwd() is fairly expensive, but this is cached - // anyway - if (!getcwd(buf, sizeof(buf))) - { - p->*cache = "(deleted)"; - } - else - p->*cache = buf; - } - } - return p->*cache; -} - -Cat_state::Cat_state(const char *heading, const char *explain) - : Category(heading, explain) -{ -} - -QString Cat_state::string(Procinfo *p) -{ - QString s(" "); - int ni = p->nice; - - s[0] = p->state; - s[1] = (p->resident == 0 && p->state != 'Z') ? 'W' : ' '; - s[2] = (ni > 0) ? 'N' : ((ni < 0) ? '<' : ' '); - return s; -} - -// LINUX -Cat_policy::Cat_policy(const char *heading, const char *explain) - : Category(heading, explain) -{ -} - -QString Cat_policy::string(Procinfo *p) -{ - QString s; - switch (p->get_policy()) - { - case SCHED_FIFO: - s = "FI"; - break; // first in, first out - case SCHED_RR: - s = "RR"; - break; // round-robin - case SCHED_OTHER: - s = "TS"; - break; // time-sharing - default: - s = "??"; - break; - } - return s; -} - -int Cat_policy::compare(Procinfo *a, Procinfo *b) -{ - return b->get_policy() - a->get_policy(); -} - -Cat_rtprio::Cat_rtprio(const char *heading, const char *explain) - : Category(heading, explain) -{ -} - -QString Cat_rtprio::string(Procinfo *p) -{ - QString s; - s.setNum(p->get_rtprio()); - return s; -} - -int Cat_rtprio::compare(Procinfo *a, Procinfo *b) -{ - return b->get_rtprio() - a->get_rtprio(); -} - -// maybe tms COMMON -Cat_tms::Cat_tms(const char *heading, const char *explain) - : Category(heading, explain) -{ -} - -QString Cat_tms::string(Procinfo *p) -{ - QString s; - p->tms = p->get_tms(); - s.sprintf("%.3f", p->tms); - // s.sprintf("%d",p->tms); - return s; -} - -int Cat_tms::compare(Procinfo *a, Procinfo *b) -{ - return (int)((b->get_tms() - a->get_tms()) * 1000); -} - -Cat_affcpu::Cat_affcpu(const char *heading, const char *explain) - : Category(heading, explain) -{ -} - -QString Cat_affcpu::string(Procinfo *p) -{ - QString s; - p->affcpu = p->get_affcpu(); - s.sprintf("%lx", p->affcpu); - return s; -} -/* - int Cat_affcpu::compare(Procinfo *a, Procinfo *b) - { - return (int)(b->affcpu - a->affcpu); - } - */ - -// LINUX or COMMON? -Cat_time::Cat_time(const char *heading, const char *explain) - : Category(heading, explain) -{ -} - -QString Cat_time::string(Procinfo *p) -{ - QString s; - char buff[64]; - int ticks = p->utime; - int ms; - - int proctick = p->proc->clk_tick; - - if (Procview::flag_cumulative) - ticks += p->cutime; - - int t = ticks / p->proc->clk_tick; // seconds - // COMPLEX CODE - if (t < 10) - { // ex. 9.23s - ms = ticks / (p->proc->clk_tick / 100) % 100; // Need FIX - sprintf(buff, "%1d.%02ds", t, ms); - } - else if (t < 60) - { // ex. 48s - sprintf(buff, "%5ds", t); - } - else if (t < 60 * 10) - { // ex. 8.9m, 9.0m - sprintf(buff, "%2d.%1dm", t / 60, (t % 60) / 6); - } - else if (t < 60 * 60) - { // 58m - sprintf(buff, "%5dm", t / 60); - } - else if (t < 24 * 3600) - { // - int h = t / 3600; // 1hour = 3600 = 60m*60s - t %= 3600; - sprintf(buff, "%2d:%02d", h, t / 60); - } - else if (t < 10 * 24 * 3600) - { // - int d = t / 86400; // 1 day = 24* 3600s - t %= 86400; - sprintf(buff, "%2d.%1dd", d, (t * 10 / (3600 * 24))); - } - else - { - int d = t / 86400; // 1 day = 24* 3600s - sprintf(buff, "%5dd", d); - } - s = buff; - return s; -} - -int Cat_time::compare(Procinfo *a, Procinfo *b) -{ - int at = a->utime, bt = b->utime; - if (Procview::flag_cumulative) - { - at += a->cutime; - bt += b->cutime; - } - return bt - at; -} - -// LINUX ? -Cat_tty::Cat_tty(const char *heading, const char *explain) - : Cat_string(heading, explain) -{ -} - -QString Cat_tty::string(Procinfo *p) { return Ttystr::name(p->tty); } - -Proc::Proc() -{ - // Note: - categories.insert(F_PID, - new Cat_int("PID", "Process ID", 6, &Procinfo::pid)); - categories.insert(F_TGID, - new Cat_int("TGID", "Task group ID ( parent of threads )", - 6, &Procinfo::tgid)); - categories.insert( - F_PPID, new Cat_int("PPID", "Parent process ID", 6, &Procinfo::ppid)); - categories.insert( - F_PGID, new Cat_int("PGID", "Process group ID", 6, &Procinfo::pgrp)); - categories.insert(F_SID, - new Cat_int("SID", "Session ID", 6, &Procinfo::session)); - categories.insert(F_TTY, new Cat_tty("TTY", "Terminal")); - categories.insert(F_TPGID, - new Cat_int("TPGID", "Process group ID of tty owner", 6, - &Procinfo::tpgid)); - - categories.insert( - F_USER, new Cat_string("USER", "Owner (*=suid root, +=suid a user)", - &Procinfo::username)); - categories.insert(F_GROUP, - new Cat_string("GROUP", "Group name (*=sgid other)", - &Procinfo::groupname)); - - categories.insert(F_UID, - new Cat_int("UID", "Real user ID", 6, &Procinfo::uid)); - categories.insert( - F_EUID, new Cat_int("EUID", "Effective user ID", 6, &Procinfo::euid)); - categories.insert(F_SUID, new Cat_int("SUID", "Saved user ID (Posix)", 6, - &Procinfo::suid)); - categories.insert(F_FSUID, new Cat_int("FSUID", "File system user ID", 6, - &Procinfo::fsuid)); - categories.insert(F_GID, - new Cat_int("GID", "Real group ID", 6, &Procinfo::gid)); - categories.insert( - F_EGID, new Cat_int("EGID", "Effective group ID", 6, &Procinfo::egid)); - categories.insert(F_SGID, new Cat_int("SGID", "Saved group ID (Posix)", 6, - &Procinfo::sgid)); - categories.insert(F_FSGID, new Cat_int("FSGID", "File system group ID", 6, - &Procinfo::fsgid)); - categories.insert( - F_PRI, new Cat_int("PRI", "Dynamic priority", 4, &Procinfo::priority)); - categories.insert(F_NICE, - new Cat_int("NICE", - "Scheduling favour (higher -> less cpu time)", - 4, &Procinfo::nice)); - categories.insert( - F_NLWP, new Cat_int("NLWP", "Number of tasks(threads) in task group", 5, - &Procinfo::nthreads)); - - categories.insert(F_PLCY, new Cat_policy("PLCY", "Scheduling policy")); - categories.insert( - F_RPRI, - new Cat_rtprio("RPRI", "Realtime priority (0-99, more is better)")); - categories.insert(F_TMS, new Cat_tms("TMS", "Time slice in milliseconds")); - categories.insert(F_SLPAVG, - new Cat_int("%SAVG", - "Percentage average sleep time (-1 -> N/A)", - 4, &Procinfo::slpavg)); - categories.insert( - F_AFFCPU, - new Cat_affcpu("CPUSET", - "Affinity CPU mask (0 -> API not supported)")); // ??? - categories.insert(F_MAJFLT, - new Cat_uintl("MAJFLT", - "Number of major faults (disk access)", 8, - &Procinfo::majflt)); - categories.insert(F_MINFLT, - new Cat_uintl("MINFLT", - "Number of minor faults (no disk access)", - 8, &Procinfo::minflt)); - - // Memory - categories.insert(F_SIZE, - new Cat_memory("VSIZE", "Virtual image size of process", - 8, &Procinfo::size)); - categories.insert(F_RSS, new Cat_memory("RSS", "Resident set size", 8, - &Procinfo::resident)); - categories.insert(F_MEM, new Cat_memory("MEM", "memory usage (RSS-SHARE)", - 8, &Procinfo::mem)); - categories.insert(F_TRS, - new Cat_memory("TRS", "Text(code) resident set size", 8, - &Procinfo::trs)); - categories.insert( - F_DRS, - new Cat_memory("DRS", "Data resident set size(malloc+global variable)", - 8, &Procinfo::drs)); - categories.insert( - F_STACK, new Cat_memory("STACK", "Stack size", 8, &Procinfo::stack)); - categories.insert(F_SHARE, - new Cat_memory("SHARE", "Shared memory with other libs", - 8, &Procinfo::share)); - categories.insert(F_SWAP, new Cat_swap("SWAP", "Kbytes on swap device")); - categories.insert( - F_IOR, new Cat_memory("IO_R", "io read (file)", 8, &Procinfo::io_read)); - categories.insert(F_IOW, new Cat_memory("IO_W", "io write (file)", 8, - &Procinfo::io_write)); - - categories.insert(F_DT, - new Cat_uintl("DT", "Number of dirty (non-written) pages", - 7, &Procinfo::dt)); - categories.insert(F_STAT, new Cat_state("STAT", "State of the process ")); - categories.insert(F_FLAGS, new Cat_hex("FLAGS", "Process flags (hex)", 9, - &Procinfo::flags)); - categories.insert( - F_WCHAN, - new Cat_wchan("WCHAN", "Kernel function where process is sleeping")); - categories.insert( - F_WCPU, - new Cat_percent("%WCPU", "Weighted percentage of CPU (30 s average)", 6, - &Procinfo::wcpu)); - categories.insert( - F_CPU, - new Cat_percent("%CPU", "Percentage of CPU used since last update", 6, - &Procinfo::pcpu)); - categories.insert( - F_PMEM, - new Cat_percent("%MEM", "Percentage of memory used (RSS/total mem)", 6, - &Procinfo::pmem)); - categories.insert(F_START, new Cat_start("START", "Time process started")); - categories.insert(F_TIME, - new Cat_time("TIME", "Total CPU time used since start")); - categories.insert( - F_CPUNUM, - new Cat_int("CPU", "CPU the process is executing on (SMP system)", 3, - &Procinfo::which_cpu)); - - categories.insert(F_CMD, new Cat_string("Process Name", "the process name", - &Procinfo::command)); - // categories.insert(F_PROCESSNAME, new Cat_string("Process Name", - //"the - // process name", &Procinfo::command)); - categories.insert(F_CWD, new Cat_dir("CWD", "Current working directory", - "cwd", &Procinfo::cwd)); - categories.insert(F_ROOT, new Cat_dir("ROOT", "Root directory of process", - "root", &Procinfo::root)); - - // command_line="COMMAND_LINE"; //reference to /proc/1234/cmdline - categories.insert(F_CMDLINE, - new Cat_cmdline("COMMAND_LINE", - "Command line that started the process")); - - commonPostInit(); - - socks_current = false; - usocks_current = false; - - Proc::init_static(); -} - -Proc::~Proc() -{ - // killall procinfos -} - -// COMMON for LINUX,SOLARIS -// Polling /proc/PID/* -void Proc::read_proc_all() -{ - DIR *d = opendir("/proc"); - struct dirent *e; - - while ((e = readdir(d)) != 0) - { - if (e->d_name[0] >= '0' and e->d_name[0] <= '9') - { // good idea ! - int pid; - Procinfo *pi = NULL; - - // inline int x_atoi(const char *sstr); - // pid=x_atoi(e->d_name); //if(pid<100) continue; - pid = atoi(e->d_name); - - pi = procs.value(pid, NULL); - - if (pi == NULL) // new process - { - pi = new Procinfo(this, pid); - procs.insert(pid, pi); - /* - Procinfo *parent; - parent =procs[pi->ppid]; - if(parent) - parent->children->add(pi); - printf("Qps : parent null - pid[%d]\n",pi->pid); } - */ - } - int ret = pi->readproc(); - if (ret > 0) - { - pi->generation = current_gen; // this process is alive - // printf(" [%s] %d - // %d\n",pi->command.toAscii().data(),pi->generation,current_gen); - - if (flag_show_thread and flag_thread_ok) - read_pid_tasks(pid); // for threads - - // add to History expect thread - if (ret == 2) - { - Procinfo *p = new Procinfo(*pi); // copy - p->clone = true; - hprocs->insert(pid, p); - } - } - else - { - // already gone. /proc/PID dead! - // later remove this process ! not yet - } - } - } - closedir(d); -} - -// COMMON , redesign -Proclist Proc::getHistory(int pos) -{ - Proclist l; - if (pos <= 0) - { - return l; - } - int size = history.size(); - if (size > pos) - l = history[size - pos]->procs; - return l; -} - -void Proc::setHistory(int tick) -{ - return; - if (tick <= 0) - { - mprocs = 0; - return; - } - int size = history.size(); - if (size > tick) - mprocs = &history[size - tick]->procs; - else - mprocs = 0; -} - -bool Procinfo::isThread() -{ - return pid != tgid; // how to check -} - -// LINUX size=64 -int Procview::custom_fields[] = {F_PID, F_TTY, F_USER, F_NICE, - F_SIZE, F_MEM, F_STAT, F_CPU, - F_START, F_TIME, F_CMDLINE, F_END}; - -// COMMON: basic field -int Procview::basic_fields[] = {F_PID, F_TTY, F_USER, F_CPUNUM, - F_STAT, F_MEM, F_CPU, F_START, - F_TIME, F_CMDLINE, F_END}; - -int Procview::jobs_fields[] = {F_PID, F_TGID, F_PPID, F_PGID, - F_SID, F_TPGID, F_STAT, F_UID, - F_TIME, F_CMDLINE, F_END}; - -int Procview::mem_fields[] = {F_PID, F_TTY, F_MAJFLT, F_MINFLT, F_SIZE, - F_RSS, F_TRS, F_DRS, F_STACK, F_SHARE, - // F_DT, - F_CMDLINE, F_END}; - -int Procview::sched_fields[] = {F_PID, F_TGID, F_NLWP, F_STAT, F_FLAGS, - F_PLCY, F_PRI, F_NICE, F_TMS, F_SLPAVG, - F_RPRI, F_AFFCPU, F_CPU, F_START, F_TIME, - F_CMDLINE, F_END}; - -void Procview::set_fields() -{ - switch (viewfields) - { - case USER: // BASIC FIELD - set_fields_list(basic_fields); - break; - case JOBS: - set_fields_list(jobs_fields); - break; - case MEM: - set_fields_list(mem_fields); - break; - case SCHED: - set_fields_list(sched_fields); - break; - case CUSTOM: - set_fields_list(custom_fields); - break; - default: - printf("Error ? set_fields_list \n"); - } - fieldArrange(); -} - -// LINUX: -// deduce whether the currently selected fields correspond to a field list -void Procview::deduce_fields() -{ - return; // under development (by fasthyun@magicn.com) 2006/05/24 - - if (viewfields != CUSTOM) - return; - - Procview::fieldstates tags[4] = {USER, JOBS, MEM, SCHED}; - int *lists[4] = {basic_fields, jobs_fields, mem_fields, sched_fields}; - for (int i = 0; i < 4; i++) - { - int *l = lists[i]; - int j; - for (j = 0; l[j] != F_END; j++) - if (findCol(l[j]) < 0) - break; - if (l[j] == F_END && j == cats.size()) - { - viewfields = tags[i]; - return; - } - } -} - -// move to Proc.cpp -#include // uname() -int get_kernel_version() -{ - int version = 0; - char *p; - struct utsname uname_info; - if (uname(&uname_info) == 0) // man -S 2 uname - { - // printf("sysname =%s \n",uname_info.sysname); - if (strcasecmp(uname_info.sysname, "linux") == 0) - { - Q_UNUSED(uname_info.release[0]); - } - p = uname_info.release; - char str[32]; - int major, minor, patch; - int result; - - result = sscanf(p, "%d.%d.%d", &major, &minor, &patch); - if (result == 2) - { - // only read two value - patch = 0; // ex) 3.0-ARCH - } - else if (result < 3) - { - fprintf(stderr, "Qps: can't determine version, read %s \n", p); - fprintf(stderr, "please report this bug.\n"); - exit(1); - } - version = major * 10000 + minor * 100 + patch; - // ex) 2.6.17 == 20617 , 2.4.8 == 20408 - printf("DEBUG: version = %d\n", version); - } - else - { - fprintf(stderr, "Qps: uname() failed. (%d) \n", version); - fprintf(stderr, "please report this bug.\n"); - exit(1); - } - return version; -} - -void check_system_requirement() -{ - int kernel_version = 0; - kernel_version = get_kernel_version(); - if (kernel_version < 20600) // less 2.6 - { - printf("Qps: kernel 2.4.x not supported !!!\n\n"); // because of - // 2.4.x SMP - // bugs - exit(0); - } -} diff --git a/src/proc_mosix.cpp b/src/proc_mosix.cpp deleted file mode 100644 index 57ea5b4..0000000 --- a/src/proc_mosix.cpp +++ /dev/null @@ -1,2480 +0,0 @@ -/* - * proc_mosix.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "qps.h" -#include "proc.h" -#include "svec.cpp" -#include "uidstr.h" -#include "ttystr.h" -#include "wchan.h" -#include "details.h" - -#ifdef SOLARIS -#include -#include -#include -#include -#endif - -#include "proc_common.cpp" - -// socket states, from and touched to avoid name collisions -enum -{ - SSFREE = 0, /* not allocated */ - SSUNCONNECTED, /* unconnected to any socket */ - SSCONNECTING, /* in process of connecting */ - SSCONNECTED, /* connected to socket */ - SSDISCONNECTING /* in process of disconnecting */ -}; - -char procdir[128] = "/proc"; - -int kernel_version = 0; -int Procinfo::page_k_shift; - -Procinfo::Procinfo(int proc_pid) : refcnt(1) -{ - details = 0; - children = 0; - fd_files = 0; - maps = 0; - - environ = 0; - envblock = 0; - if (readproc(proc_pid) < 0) - pid = -1; // invalidate object, will be deleted - - selected = FALSE; - hidekids = FALSE; -} - -Procinfo::~Procinfo() -{ - if (details) - { - details->process_gone(); - details = 0; - } - delete environ; - if (envblock) - free(envblock); - if (maps) - { - maps->purge(); - delete maps; - } - if (fd_files) - { - fd_files->purge(); - delete fd_files; - } - delete children; -} - -// miscellaneous static initializations -void Procinfo::init_static() -{ - - page_k_shift = 0; - for (int j = getpagesize(); j > 1024; j >>= 1) - page_k_shift++; -} - -// return number of bytes read if ok, -1 if failed -int Procinfo::read_file(char *name, void *buf, int max) -{ - int fd = open(name, O_RDONLY); - if (fd < 0) - return -1; - int r = read(fd, buf, max); - close(fd); - return r; -} - -static inline bool isprintable(unsigned char c) -{ - // assume, somewhat naïvely, that all latin-1 characters are printable - return (c >= 0x20 && c < 0x7f) || c >= 0xa0; -} - -// replace unprintables by spaces -static void make_printable(char *s) -{ - while (*s) - { - if (!isprintable(*s)) - *s = ' '; - ++s; - } -} - -#ifdef LINUX - -// read task and ADD to Proc::procs[] !! -// eg) /proc/1234/task/* -int Proc::readTaskByPID(int pid) -{ - char path[256]; - struct dirent *e; - char *p; - int TID; - int thread_n = 0; - - printf("pid=%d :", pid); - sprintf(path, "/proc/%d/task", pid); - - DIR *d = opendir(path); - if (!d) - return FALSE; - - /* - if(!fd_files) - fd_files = new Svec(8); - fd_files->clear(); - - #ifdef LINUX - if(!sock_inodes) - sock_inodes = new Svec(4); - sock_inodes->clear(); - #endif - */ - // p = path + strlen(path) + 1;?? - // p[-1] = '/'; - - while ((e = readdir(d)) != 0) - { - if (e->d_name[0] == '.') - continue; // skip . and .. - - TID = atoi(e->d_name); // only numbre !! - printf("tid=%d ", TID); - - if (pid != TID) - { - sprintf(procdir, "/proc/%d/task", pid, TID); - Procinfo *pi = new Procinfo(TID); - - if (pi->pid == -1) - { - printf("--"); - delete pi; // already gone - } - else - { - pi->generation = current_gen; - newproc(pi); - printf("**"); - } - } - - thread_n++; - // read_fd(fdnum, path); - } - printf("\n"); - closedir(d); - - return thread_n; -} - -int Procinfo::readproc(int proc_pid) -{ - char path[256]; - char buf[256]; - char sbuf[4096]; // should be enough to acommodate /proc/X/stat - char cmdbuf[MAX_CMD_LEN]; - QString tmp_str; - pid = proc_pid; - - // sprintf(path, "%s/%d", "/proc", pid); - sprintf(path, "%s/%d", procdir, proc_pid); - // read /proc/XX/cmdline - strcpy(buf, path); - strcat(buf, "/cmdline"); - int cmdlen; - if ((cmdlen = read_file(buf, cmdbuf, MAX_CMD_LEN - 1)) < 0) - return -1; - if (cmdlen == 0) - { - cmdline = ""; - } - else - { - for (int i = 0; i < cmdlen; i++) - if (!cmdbuf[i]) - cmdbuf[i] = ' '; - int j = cmdlen - 1; - while (j >= 0 && cmdbuf[j] == ' ') - j--; - cmdbuf[j + 1] = '\0'; - make_printable(cmdbuf); - tmp_str = cmdbuf; - cmdline = UniString(tmp_str); // for Non-ascii locale language - } - - // read /proc/XX/stat - strcpy(buf, path); - strcat(buf, "/stat"); - int statlen; - if ((statlen = read_file(buf, sbuf, sizeof(sbuf) - 1)) <= 0) - return -1; - sbuf[statlen] = '\0'; - char *p = strrchr(sbuf, ')'); - *p = '\0'; // split in two parts - command = strchr(sbuf, '(') + 1; - - // - // Not all values from /proc/#/stat are interesting; the ones left out - // have been retained in comments to see where they should go, in case - // they are needed again. - // - // In Linux 2.2.x, timeout has been removed, and the signal information - // here is obsolete (/proc/#/status has real-time signal info). - // - // There are undocumented values after wchan, unused so far: - // nswap pages swapped out since process started - // cnswap nswap of children - // exit_signal (2.2.x) signal sent to parent when process exits - // (The latter could provide a way to detect cloned processes since - // they usually have exit_signal != SIGCHLD, but I prefer waiting - // for real TIDs before implementing thread support.) - // - long stime, cstime; - int i_tty; - sscanf(p + 2, - "%c %d %d %d %d %d %lu %lu %lu %lu %lu " - "%ld %ld %ld %ld %d %d %*s %*s %lu %*s %*s %*s %*s %*s %*s %*s %*s " - "%*s %*s %*s %*s %lu", - &state, &ppid, &pgrp, &session, &i_tty, &tpgid, &flags, &minflt, - &cminflt, &majflt, &cmajflt, &utime, &stime, &cutime, &cstime, - &priority, &nice, - /* timeout, itrealvalue */ - &starttime, - /* vsize */ - /* rss */ - /* rlim, startcode, endcode, startstack kstkesp kstkeip, - signal, blocked, sigignore, sigcatch */ - &wchan); - - tty = (dev_t)i_tty; - utime += stime; // we make no user/system time distinction - cutime += cstime; - - // read /proc/XX/statm - strcpy(buf, path); - strcat(buf, "/statm"); - if ((statlen = read_file(buf, sbuf, sizeof(sbuf) - 1)) <= 0) - { - printf("33"); - return -1; - } - - sbuf[statlen] = '\0'; - sscanf(sbuf, "%lu %lu %lu %lu %lu %lu %lu", &size, &resident, &share, &trs, - &lrs, &drs, &dt); - size <<= page_k_shift; - resident <<= page_k_shift; - share <<= page_k_shift; - trs <<= page_k_shift; - lrs <<= page_k_shift; - drs <<= page_k_shift; - - pmem = 100.0 * resident / mem_total; - -#ifdef MOSIX - if (mosix_running) - { - // Read /proc/XX/where - strcpy(buf, path); - strcat(buf, "/where"); - if ((statlen = read_file(buf, sbuf, sizeof(sbuf) - 1)) <= 0) - where = -1; - else - { - sbuf[statlen] = '\0'; - sscanf(sbuf, "%d", &where); - } - // Read /proc/XX/cantmove - strcpy(buf, path); - strcat(buf, "/cantmove"); - if ((statlen = read_file(buf, sbuf, sizeof(sbuf) - 1)) > 0) - { - sbuf[statlen] = '\0'; - p = strchr(sbuf, '\n'); - if (p) - { - *p = '\0'; - cantmove = sbuf; - } - } - // Read /proc/XX/nmigs - strcpy(buf, path); - strcat(buf, "/nmigs"); - if ((statlen = read_file(buf, sbuf, sizeof(sbuf) - 1)) <= 0) - nmigs = -1; - else - { - sbuf[statlen] = '\0'; - sscanf(sbuf, "%d", &nmigs); - } - // Read /proc/XX/lock - strcpy(buf, path); - strcat(buf, "/lock"); - if ((statlen = read_file(buf, sbuf, sizeof(sbuf) - 1)) <= 0) - locked = -1; - else - { - sbuf[statlen] = '\0'; - sscanf(sbuf, "%d", &locked); - } - - // See if this is a remote job - // Read /proc/mosix/remote/xx/statm - char path2[256]; - sprintf(path2, "%s/mosix/remote/%d", procdir, pid); - // There are only two files to read: stats and from - // (statm is identical to /proc/xx/statm). - strcpy(buf, path2); - strcat(buf, "/stats"); - if ((statlen = read_file(buf, sbuf, sizeof(sbuf) - 1)) > 0) - { - isremote = TRUE; // This process is a visitor - - // The following variables are available, but are not - // used at the - // moment, so they are merely placeholders right now. - char state2; - long nswap, cnswap, rss, vsize; - if (sscanf(sbuf, "utime=%ld cutime=%ld nice=%d " - "state=%c vsize=%ld" - " rss=%ld nswap=%ld cnswap=%ld", - &utime, &cutime, &nice, &state2, &vsize, &rss, &nswap, - &cnswap) != 8) - return -1; - - // read "from" - strcpy(buf, path2); - strcat(buf, "/from"); - if ((statlen = read_file(buf, sbuf, sizeof(sbuf) - 1)) <= 0) - return -1; - sbuf[statlen] = '\0'; - if (sscanf(sbuf, "%d", &from) != 1) - return -1; - - // command is parsed wrong (contains "remote(xx)") - sscanf(command, "remote(%d)", &remotepid); - command = cmdline; // grab comm from there... - } - else - { - isremote = FALSE; - remotepid = -1; - from = -1; - } - if (from > 0) - sprintf(buf, "%d>", from); - else if (where > 0) - sprintf(buf, ">%d", where); - else - strcpy(buf, "-"); - migr = buf; - } -#endif // MOSIX - - // read /proc/XX/status - strcpy(buf, path); // /proc/$PID - strcat(buf, "/status"); - if ((statlen = read_file(buf, sbuf, sizeof(sbuf) - 1)) <= 0) - return -1; - sbuf[statlen] = '\0'; - if (!(p = strstr(sbuf, "Uid:"))) - return -1; - sscanf(p, "Uid: %d %d %d %d Gid: %d %d %d %d", &uid, &euid, &suid, &fsuid, - &gid, &egid, &sgid, &fsgid); - - which_cpu = 0; - per_cpu_times = 0; - - // only works kernel 2.4.x - if (num_cpus > 1) - { - per_cpu_times = new unsigned long[num_cpus]; - if (per_cpu_times == NULL) - return -1; - if (kernel_version < 20600) - { // less than version 2.6.0 and SMP - strcpy(buf, path); // /proc/$PID - strcat(buf, "/cpu"); // /proc/$PID/cpu - if ((statlen = read_file(buf, sbuf, sizeof(sbuf) - 1)) <= 0) - return -1; - sbuf[statlen] = '\0'; - p = sbuf; - for (unsigned cpu = 0; cpu < num_cpus; cpu++) - { - p = strchr(p, '\n'); - if (!p) - { - for (cpu = 0; cpu < num_cpus; cpu++) - per_cpu_times[cpu] = 0; - break; - } - p++; - unsigned long utime, stime; - sscanf(p, "%*s %lu %lu", &utime, &stime); - per_cpu_times[cpu] = utime + stime; - } - } - } - - gettimeofday(&tv, 0); - policy = -1; // will get it when needed - rtprio = -1; // ditto - - return pid; -} - -#endif // LINUX - -#ifdef SOLARIS -int Procinfo::readproc(int proc_pid) -{ - char path[256]; - - pid = proc_pid; - - sprintf(path, "%s/%d/psinfo", procdir, proc_pid); - psinfo_t psi; - if (read_file(path, (void *)&psi, sizeof(psi)) < (int)sizeof(psi)) - return -1; - - sprintf(path, "%s/%d/usage", procdir, proc_pid); - prusage_t pru; - if (read_file(path, (void *)&pru, sizeof(pru)) < (int)sizeof(pru)) - return -1; - - uid = psi.pr_uid; - euid = psi.pr_euid; - gid = psi.pr_gid; - egid = psi.pr_egid; - - make_printable(psi.pr_psargs); - cmdline = psi.pr_psargs; - - state = psi.pr_lwp.pr_sname; - command = (state == 'Z') ? "" : psi.pr_fname; - ppid = psi.pr_ppid; - pgrp = psi.pr_pgid; - session = psi.pr_sid; - tty = psi.pr_ttydev; // type? - flags = psi.pr_flag; - const int ns_ticks = 1000000000 / HZ; - utime = psi.pr_time.tv_sec * HZ + psi.pr_time.tv_nsec / ns_ticks; - cutime = psi.pr_ctime.tv_sec * HZ + psi.pr_ctime.tv_nsec / ns_ticks; - priority = psi.pr_lwp.pr_pri; - nice = psi.pr_lwp.pr_nice; - if (Qps::normalize_nice) - nice -= NZERO; - starttime = (psi.pr_start.tv_sec - boot_time) * HZ + - psi.pr_start.tv_nsec / ns_ticks; - wchan = psi.pr_lwp.pr_wchan; - minflt = pru.pr_minf; - majflt = pru.pr_majf; - size = psi.pr_size; - resident = psi.pr_rssize; - nthreads = psi.pr_nlwp; - addr_bits = psi.pr_dmodel == PR_MODEL_ILP32 ? 32 : 64; - which_cpu = psi.pr_lwp.pr_onpro; - env_ofs = psi.pr_envp; - - // pr_pctcpu and pr_pctmem are scaled so that 1.0 is stored as 0x8000. - // We rescale pcpu so a CPU-bound process is shown as 100%. (This means - // that wcpu may exceed 100% with several LWPs.) - wcpu = psi.pr_pctcpu * (1 / 327.68) * num_cpus; - pmem = psi.pr_pctmem * (1 / 327.68); - - gettimeofday(&tv, 0); - rtprio = -1; // ditto - policy_name[0] = psi.pr_lwp.pr_clname[0]; - policy_name[1] = psi.pr_lwp.pr_clname[1]; - - return pid; -} -#endif // SOLARIS - -float Procinfo::loadavg[] = {0.0, 0.0, 0.0}; -int Procinfo::mem_total = 0; -int Procinfo::mem_free = 0; -#ifdef LINUX -// int Procinfo::mem_shared = 0; // only linux kernel 2.4.x -int Procinfo::mem_buffers = 0; -int Procinfo::mem_cached = 0; -#endif -int Procinfo::swap_total = 0; -int Procinfo::swap_free = 0; -unsigned *Procinfo::cpu_times_vec = 0; -unsigned *Procinfo::old_cpu_times_vec = 0; -long Procinfo::boot_time = 0; -#ifdef LINUX -Q3IntDict Procinfo::socks(17); -bool Procinfo::socks_current = FALSE; -Q3IntDict Procinfo::usocks(17); -bool Procinfo::usocks_current = FALSE; -#endif -unsigned int Procinfo::num_cpus = 0; -unsigned int Procinfo::old_num_cpus = 0; -#ifdef SOLARIS -kstat_ctl_t *Procinfo::kc = 0; -#endif -#ifdef MOSIX -bool Procinfo::mosix_running; -#endif - -#ifdef LINUX -// just grab the load averages -void Procinfo::read_loadavg() -{ - char path[80]; - char buf[512]; - strcpy(path, procdir); - strcat(path, "/loadavg"); - int n; - if ((n = read_file(path, buf, sizeof(buf) - 1)) <= 0) - { - fprintf(stderr, "qps: Cannot open /proc/loadavg" - " (make sure /proc is mounted)\n"); - exit(1); - } - buf[n] = '\0'; - sscanf(buf, "%f %f %f", &loadavg[0], &loadavg[1], &loadavg[2]); -} -#endif // LINUX - -#ifdef SOLARIS -static float getscaled(kstat_t *ks, const char *name) -{ - // load avgs are scaled by 256 - kstat_named_t *kn = (kstat_named_t *)kstat_data_lookup(ks, (char *)name); - return kn ? kn->value.ui32 * (1 / 256.0) : 0.0; -} - -void Procinfo::read_loadavg() -{ - kstat_chain_update(kc); - - kstat_t *ks = kstat_lookup(kc, (char *)"unix", 0, (char *)"system_misc"); - if (!ks || kstat_read(kc, ks, 0) == -1) - { - perror("kstat_lookup/read"); - exit(1); - } - - loadavg[0] = getscaled(ks, "avenrun_1min"); - loadavg[1] = getscaled(ks, "avenrun_5min"); - loadavg[2] = getscaled(ks, "avenrun_15min"); - - // we might as well get the boot time too since it's in the same kstat - // (not that it is going to change) - kstat_named_t *kn; - kn = (kstat_named_t *)kstat_data_lookup(ks, (char *)"boot_time"); - if (kn) - boot_time = kn->value.ui32; -} -#endif // SOLARIS - -#ifdef LINUX -// read information common to all processes -// !!! should be simplified !! -void Procinfo::read_common() -{ - char path[80]; - char buf[4096 + 1]; - - char *p; - int n; - - int i1, i2, i3, i4; - // read kernel version - strcpy(path, "/proc/version"); - if ((n = read_file(path, buf, sizeof(buf) - 1)) <= 0) - return; - buf[n] = '\0'; - sscanf(buf, "Linux version %d.%d.%d", &i1, &i2, &i3); - kernel_version = i1 * 10000 + i2 * 100 + i3 * 1; - // printf("DEBUG: kernel_version =%d \n",kernel_version); - - // read memory info - strcpy(path, procdir); - strcat(path, "/meminfo"); - if ((n = read_file(path, buf, sizeof(buf) - 1)) <= 0) - return; - buf[n] = '\0'; - - // Skip the old /meminfo cruft, making this work in post-2.1.42 kernels - // as well. (values are now in kB) - p = strstr(buf, "MemTotal:"); - sscanf(p, "MemTotal: %d kB\nMemFree: %d kB\b\nBuffers: %d kB\nCached: " - "%d kB\n", - &mem_total, &mem_free, &mem_buffers, &mem_cached); - p = strstr(buf, "SwapTotal:"); - sscanf(p, "SwapTotal: %d kB\nSwapFree: %d kB\n", &swap_total, &swap_free); - - // read system status - strcpy(path, procdir); - strcat(path, "/stat"); // /proc/stat - if ((n = read_file(path, buf, sizeof(buf) - 1)) <= 0) - return; - buf[n] = '\0'; - - old_num_cpus = num_cpus; - if (!num_cpus) - { -// count cpus -#ifdef FAKE_SMP - num_cpus = 4; -#else - char *p; - p = strstr(buf, "cpu"); - while (p < buf + sizeof(buf) - 4 && strncmp(p, "cpu", 3) == 0) - { - num_cpus++; - if (strncmp(p, "cpu0", 4) == 0) - num_cpus--; - p = strchr(p, '\n'); - if (p) - p++; - } -#endif - cpu_times_vec = new unsigned[CPUTIMES * num_cpus]; - old_cpu_times_vec = new unsigned[CPUTIMES * num_cpus]; - } - - for (unsigned cpu = 0; cpu < num_cpus; cpu++) - for (int i = 0; i < CPUTIMES; i++) - old_cpu_times(cpu, i) = cpu_times(cpu, i); - - if (num_cpus == 1) - { - unsigned iowait, irq, sftirq; - sscanf(buf, "cpu %u %u %u %u %u %u %u", &cpu_times(0, CPUTIME_USER), - &cpu_times(0, CPUTIME_NICE), &cpu_times(0, CPUTIME_SYSTEM), - &cpu_times(0, CPUTIME_IDLE), &iowait, &irq, &sftirq); - cpu_times(0, CPUTIME_SYSTEM) += (irq + sftirq); - cpu_times(0, CPUTIME_IDLE) += iowait; - } - else - { -#ifdef FAKE_SMP - sscanf(buf, "cpu %u %u %u %u", &cpu_times(0, CPUTIME_USER), - &cpu_times(0, CPUTIME_NICE), &cpu_times(0, CPUTIME_SYSTEM), - &cpu_times(0, CPUTIME_IDLE)); - for (unsigned cpu = 1; cpu < num_cpus; cpu++) - { - for (int i = 0; i < CPUTIMES; i++) - cpu_times(cpu, i) = cpu_times(0, i); - } -#else - // SMP - for (unsigned cpu = 0; cpu < num_cpus; cpu++) - { - char cpu_buf[10]; - sprintf(cpu_buf, "cpu%d", cpu); - if ((p = strstr(buf, cpu_buf)) != 0) - { - sscanf(p, "%*s %u %u %u %u", &cpu_times(cpu, CPUTIME_USER), - &cpu_times(cpu, CPUTIME_NICE), - &cpu_times(cpu, CPUTIME_SYSTEM), - &cpu_times(cpu, CPUTIME_IDLE)); - } - else - { - fprintf(stderr, "Error reading info for cpu %d\n", cpu); - abort(); - } - } -#endif - } - - // 2.0.x kernels (at least up to 2.0.33) have an SMP bug that reports - // cpu_time(CPUTIME_IDLE) incorrectly, since it doesn't take the number - // of - // cpus into account. This is fixed in 2.1.x kernels, and since 2.0.x - // is rather old (and unsuited for SMP anyway) we don't work around it. - - p = strstr(buf, "btime") + 6; - sscanf(p, "%lu", &boot_time); -} -#endif // LINUX - -#ifdef SOLARIS -void Procinfo::read_common() -{ - // memory info: this is easy - just use sysconf - - mem_total = sysconf(_SC_PHYS_PAGES) << page_k_shift; - mem_free = sysconf(_SC_AVPHYS_PAGES) << page_k_shift; - - // get swap info: somewhat trickier - we have to count all swap spaces - - int nswaps = swapctl(SC_GETNSWP, 0); - swaptbl_t *st = - (swaptbl_t *)malloc(sizeof(int) + nswaps * sizeof(swapent_t)); - st->swt_n = nswaps; - // We are not interested in the paths, just the values, so we allocate - // one scratch buffer for all paths to keep swapctl happy. - char path_buf[PATH_MAX + 1]; - for (int i = 0; i < nswaps; i++) - st->swt_ent[i].ste_path = path_buf; - swapctl(SC_LIST, st); - // count the swap spaces - swap_total = swap_free = 0; - for (int i = 0; i < nswaps; i++) - { - swap_total += st->swt_ent[i].ste_pages; - swap_free += st->swt_ent[i].ste_free; - } - swap_total <<= page_k_shift; - swap_free <<= page_k_shift; - free(st); - - if (cpu_times_vec) - { - if (old_cpu_times_vec) - free(old_cpu_times_vec); - old_cpu_times_vec = cpu_times_vec; - cpu_times_vec = - (unsigned *)malloc(sizeof(unsigned) * num_cpus * CPUTIMES); - } - old_num_cpus = num_cpus; - - // cpu states: are stored as kstats named "cpu_statN", where N is the - // cpu number. Unfortunately, the cpu numbers are not guessable so we - // sweep the kstat chain for all of them, assuming (foolishly?) - // that they are in order. - - kstat_chain_update(kc); - int cpu = 0; - for (kstat_t *ks = kc->kc_chain; ks; ks = ks->ks_next) - { - if (strncmp(ks->ks_name, "cpu_stat", 8) == 0) - { - if (kstat_read(kc, ks, NULL) == -1) - { - perror("kstat_read"); - exit(1); - } - cpu_stat_t *cs = (cpu_stat_t *)ks->ks_data; - if (cpu + 1 >= (int)num_cpus) - { - num_cpus = cpu + 1; - cpu_times_vec = (unsigned *)realloc( - cpu_times_vec, num_cpus * CPUTIMES * sizeof(unsigned)); - } - cpu_times(cpu, CPUTIME_USER) = cs->cpu_sysinfo.cpu[CPU_USER]; - cpu_times(cpu, CPUTIME_SYSTEM) = cs->cpu_sysinfo.cpu[CPU_KERNEL]; - cpu_times(cpu, CPUTIME_WAIT) = cs->cpu_sysinfo.cpu[CPU_WAIT]; - cpu_times(cpu, CPUTIME_IDLE) = cs->cpu_sysinfo.cpu[CPU_IDLE]; - cpu++; - } - } -} -#endif // SOLARIS - -#ifdef MOSIX -void Procinfo::check_for_mosix() -{ - char path[256]; - strcpy(path, procdir); - strcat(path, "/mosix"); - DIR *d = opendir(path); - if (d) - { - closedir(d); - mosix_running = TRUE; - return; - } - mosix_running = FALSE; -} - -Svec Procinfo::mosix_nodes() -{ - Svec nodes; - char path[256]; - strcpy(path, procdir); - strcat(path, "/mosix/nodes"); - DIR *d = opendir(path); - if (d) - { - struct dirent *e; - while ((e = readdir(d)) != 0) - { - int num; - if (sscanf(e->d_name, "%d", &num) == 1) - nodes.add(num); - } - closedir(d); - } - return nodes; -} -#endif // MOSIX - -int Procinfo::get_policy() -{ - if (policy == -1) - policy = sched_getscheduler(pid); - return policy; -} - -int Procinfo::get_rtprio() -{ - if (rtprio == -1) - { - struct sched_param p; - if (sched_getparam(pid, &p) == 0) - rtprio = p.sched_priority; - } - return rtprio; -} - -#ifdef LINUX -void Procinfo::read_fd(int fdnum, char *path) -{ - int len; - char buf[80]; - struct stat sb; - - // The fd mode is contained in the link permission bits - if (lstat(path, &sb) < 0) - return; - int mode = 0; - if (sb.st_mode & 0400) - mode |= OPEN_READ; - if (sb.st_mode & 0200) - mode |= OPEN_WRITE; - - if ((len = readlink(path, buf, sizeof(buf) - 1)) > 0) - { - buf[len] = '\0'; - unsigned long dev, ino; - if ((buf[0] == '[' // Linux 2.0 style /proc/fd - && sscanf(buf, "[%lx]:%lu", &dev, &ino) == 2 && dev == 0) || - sscanf(buf, "socket:[%lu]", &ino) > 0) - { // Linux 2.1 - Sockinfo *si = Procinfo::socks[ino]; - char buf[80]; - if (si) - { - // a TCP or UDP socket - sock_inodes->add(SockInode(fdnum, ino)); - sprintf(buf, "%sp socket %lu", - si->proto == Sockinfo::TCP ? "tc" : "ud", ino); - fd_files->add(new Fileinfo(fdnum, buf, mode)); - return; - } - else - { - // maybe a unix domain socket? - read_usockets(); - UnixSocket *us = Procinfo::usocks[ino]; - if (us) - { - char *tp = "?", *st = "?"; - switch (us->type) - { - case SOCK_STREAM: - tp = "stream"; - break; - case SOCK_DGRAM: - tp = "dgram"; - break; - } - switch (us->state) - { - case SSFREE: - st = "free"; - break; - case SSUNCONNECTED: - st = "unconn"; - break; - case SSCONNECTING: - st = "connecting"; - break; - case SSCONNECTED: - st = "connected"; - break; - case SSDISCONNECTING: - st = "disconn"; - break; - } - sprintf(buf, "unix domain socket %lu (%s, %s) ", ino, tp, - st); - QString s = buf; - s.append(us->name); - fd_files->add(new Fileinfo(fdnum, s, mode)); - return; - } - } - } - // assume fds will be read in increasing order - fd_files->add(new Fileinfo(fdnum, buf, mode)); - } -} -#endif // LINUX - -#ifdef SOLARIS -void Procinfo::read_fd(int fdnum, char *path) -{ - struct stat sb; - if (lstat(path, &sb) < 0) - { - // The file has been closed, or we could really not stat it - // despite - // having it open (could be a fd passed from another process). - - fd_files->add(new Fileinfo(fdnum, "(no info available)")); - return; - } - // We could in principle find out more about the fd, such as its mode - // (RDONLY, RDWR etc) and flags, but it's messy. pfiles uses an agent - // lwp - // for this, but I don't know how to do it. - QString s; - const char *n; - switch (sb.st_mode & S_IFMT) - { - case S_IFCHR: - // if it is a tty, we might know its real name - if (sb.st_rdev != (dev_t)-1) - { - QString t = Ttystr::name(sb.st_rdev); - if (t[0] != '?') - { - s = "/dev/"; - s.append(t); - break; - } - } - s.sprintf("char device %u:%u", (unsigned)major(sb.st_rdev), - (unsigned)minor(sb.st_rdev)); - break; - - case S_IFBLK: - s.sprintf("block device %u:%u", (unsigned)major(sb.st_rdev), - (unsigned)minor(sb.st_rdev)); - break; - - case S_IFLNK: - // Directories appear as symlinks in /proc/#/fd; we chdir() to - // it - // and see where we end up. Not efficient though. - // Besides, we change cwd a lot in unpredictable ways. This - // makes - // core dumps hard to find, if they are generated at all. - s = "directory "; - if (chdir(path) >= 0) - { - char buf[512]; - if (getcwd(buf, sizeof(buf)) >= 0) - { - s.append(buf); - break; - } - } - s.append("(unknown)"); - break; - - default: - switch (sb.st_mode & S_IFMT) - { - case S_IFIFO: // fifo or anonymous pipe - n = "pipe"; - break; - case S_IFDIR: // this shouldn't happen - n = "directory"; - break; - case S_IFREG: - n = "file"; - break; - case S_IFSOCK: - n = "unix domain socket"; - break; - case S_IFDOOR: - n = "door"; - break; - default: - n = "unknown"; - break; - } - s.sprintf("%s, dev %u:%u inode %u", n, (unsigned)major(sb.st_dev), - (unsigned)minor(sb.st_dev), (unsigned)sb.st_ino); - break; - } - fd_files->add(new Fileinfo(fdnum, s)); -} -#endif // SOLARIS - -// return TRUE if /proc/PID/fd could be read, FALSE otherwise -// store fileinfo, and also socket inodes separately -bool Procinfo::read_fds() -{ - char path[80], *p; - sprintf(path, "%s/%d/fd", procdir, pid); - - DIR *d = opendir(path); - if (!d) - return FALSE; - - if (!fd_files) - fd_files = new Svec(8); - fd_files->clear(); - -#ifdef LINUX - if (!sock_inodes) - sock_inodes = new Svec(4); - sock_inodes->clear(); -#endif - - p = path + strlen(path) + 1; - p[-1] = '/'; - - struct dirent *e; - while ((e = readdir(d)) != 0) - { - if (e->d_name[0] == '.') - continue; // skip . and .. - strcpy(p, e->d_name); - int fdnum = atoi(p); - read_fd(fdnum, path); - } - closedir(d); - return TRUE; -} - -#ifdef LINUX - -bool Procinfo::read_socket_list(Sockinfo::proto_t proto, char *pseudofile) -{ - char path[80]; - strcpy(path, procdir); - strcat(path, "/net/"); - strcat(path, pseudofile); - FILE *f = fopen(path, "r"); - if (!f) - return FALSE; - - char buf[256]; - fgets(buf, sizeof(buf), f); // skip header - while (fgets(buf, sizeof(buf), f) != 0) - { - Sockinfo *si = new Sockinfo; - si->proto = proto; - unsigned local_port, rem_port, st, tr; - sscanf(buf + 6, "%x:%x %x:%x %x %x:%x %x:%x %x %d %d %d", - &si->local_addr, &local_port, &si->rem_addr, &rem_port, &st, - &si->tx_queue, &si->rx_queue, &tr, &si->tm_when, &si->rexmits, - &si->uid, &si->timeout, &si->inode); - // fix fields that aren't sizeof(int) - si->local_port = local_port; - si->rem_port = rem_port; - si->st = st; - si->tr = tr; - - socks.insert(si->inode, si); - if (socks.count() > socks.size() * 3) - socks.resize(socks.count()); - } - fclose(f); - return TRUE; -} - -bool Procinfo::read_usocket_list() -{ - char path[80]; - strcpy(path, procdir); - strcat(path, "/net/unix"); - FILE *f = fopen(path, "r"); - if (!f) - return FALSE; - - char buf[256]; - fgets(buf, sizeof(buf), f); // skip header - while (fgets(buf, sizeof(buf), f)) - { - if (buf[0]) - buf[strlen(buf) - 1] = '\0'; // chomp newline - UnixSocket *us = new UnixSocket; - unsigned q; - unsigned type, state; - int n; - sscanf(buf, "%x: %x %x %x %x %x %ld %n", &q, &q, &q, &us->flags, &type, - &state, &us->inode, &n); - us->name = buf + n; - us->type = type; - us->state = state; - usocks.insert(us->inode, us); - if (usocks.count() > usocks.size() * 3) - usocks.resize(usocks.count()); - } - fclose(f); - return TRUE; -} - -void Procinfo::read_sockets() -{ - if (socks_current) - return; - - socks.clear(); - if (!read_socket_list(Sockinfo::TCP, "tcp") || - !read_socket_list(Sockinfo::UDP, "udp")) - return; - - socks_current = TRUE; -} - -void Procinfo::read_usockets() -{ - if (usocks_current) - return; - - usocks.clear(); - if (!read_usocket_list()) - return; - - usocks_current = TRUE; -} - -void Procinfo::invalidate_sockets() { socks_current = usocks_current = FALSE; } - -// return TRUE if /proc/XX/maps could be read, FALSE otherwise -bool Procinfo::read_maps() -{ - // idea: here we could readlink /proc/XX/exe to identify the executable - // when running 2.0.x - char name[80]; - sprintf(name, "%s/%d/maps", procdir, pid); - FILE *f = fopen(name, "r"); - if (!f) - return FALSE; - char line[1024]; // lines can be this long, or longer - if (!maps) - maps = new Svec; - else - maps->clear(); - - while (fgets(line, sizeof(line), f)) - { - Mapsinfo *mi = new Mapsinfo; - int n; - sscanf(line, "%lx-%lx %4c %lx %x:%x %lu%n", &mi->from, &mi->to, - mi->perm, &mi->offset, &mi->major, &mi->minor, &mi->inode, &n); - if (line[n] != '\n') - { - int len = strlen(line); - if (line[len - 1] == '\n') - line[len - 1] = '\0'; - while (line[n] == ' ' && line[n]) - n++; - mi->filename = line + n; - } - else if ((mi->major | mi->minor | mi->inode) == 0) - mi->filename = "(anonymous)"; - maps->add(mi); - } - fclose(f); - return TRUE; -} - -// return TRUE if /proc/XX/environ could be read, FALSE otherwise -bool Procinfo::read_environ() -{ - int bs = 4096; // good start - if (envblock) - free(envblock); - envblock = (char *)malloc(bs + 1); - char path[128]; - sprintf(path, "%s/%d/environ", procdir, pid); - int fd = open(path, O_RDONLY); - if (fd < 0) - { - free(envblock); - envblock = 0; - return FALSE; - } - int n; - int ofs = 0; - while ((n = read(fd, envblock + ofs, bs - ofs)) == bs - ofs) - { - ofs = bs; - envblock = (char *)realloc(envblock, (bs += 4096) + 1); - } - close(fd); - if (n < 0) - { - free(envblock); - envblock = 0; - return FALSE; - } - n += ofs; - envblock[n] = '\0'; - if (!environ) - environ = new Svec(64); - else - environ->clear(); - for (int i = 0; i < n;) - { - char *p = strchr(envblock + i, '='); - if (p) - *p++ = '\0'; - else // degenerate variable: treat as name with empty value - p = envblock + i + strlen(envblock + i); - make_printable(envblock + i); - make_printable(p); - environ->add(NameValue(envblock + i, p)); - i = p - envblock + strlen(p) + 1; - } - return TRUE; -} - -#endif // LINUX - -#ifdef SOLARIS - -// return TRUE if the process environment could be read, FALSE otherwise -bool Procinfo::read_environ() -{ - int fd; - char file[128]; - sprintf(file, "/proc/%d/as", pid); - if ((fd = open(file, O_RDONLY)) < 0) - return FALSE; - - // Just read the first 8K from the environment. Adaptive code here is - // possible, but not really worth the effort. - int bs = 8192; - if (envblock) - free(envblock); - envblock = (char *)malloc(bs); - if (pread(fd, envblock, bs, env_ofs) < 0) - { - free(envblock); - envblock = 0; - return FALSE; - } - close(fd); - envblock[bs - 1] = '\0'; - - if (!environ) - environ = new Svec(64); - else - environ->clear(); - - for (int i = 0; i * (int)sizeof(char *) < bs && ((char **)envblock)[i]; i++) - { - int b = ((char **)envblock)[i] - (char *)env_ofs; - if (b < 0 || b >= bs) - continue; // outside retrieved memory block - char *val = strchr(envblock + b, '='); - if (val) - *val++ = '\0'; - else - val = (char *)""; // degenerate: treat as name with - // empty value - make_printable(envblock + b); - make_printable(val); - environ->add(NameValue(envblock + b, val)); - } - return TRUE; -} - -// Try using /proc/bin/pmap to add file names to the memory map -void Procinfo::read_pmap_maps() -{ - char buf[256]; - sprintf(buf, "/usr/proc/bin/pmap %d 2>/dev/null", pid); - FILE *pmap = popen(buf, "r"); - if (!pmap) - return; - - // skip first line - if (!fgets(buf, sizeof buf, pmap)) - { - pclose(pmap); - return; - } - - int map_num = 0; - while (fgets(buf, sizeof buf, pmap)) - { - // Each output line from pmap looks like - //
K - // We use
and only to match with previously - // read - // map info, and only use here. - - unsigned long addr; - unsigned len; - int next; - char *p; - if (sscanf(buf, "%lx %dK%n", &addr, &len, &next) != 2) - continue; - - // Correlate this with info already gathered. Assume they are in - // the - // same order (ascending by address). - Mapsinfo *mi; - int i = map_num; - while (i < maps->size() && (mi = (*maps)[i])->from != addr) - i++; - // Mismatches can happen since changes can have taken place - // since - // we read the maps. If so, skip this mapping and try the next. - if (mi->to != addr + ((unsigned long)len << 10) || i == maps->size()) - continue; - map_num = i + 1; - - while (buf[next] == ' ') - next++; - while (buf[next] && buf[next] != ' ') - next++; - while (buf[next] == ' ') - next++; - // At this point we are looking at a file name, or at a - // suitable - // designator like [ heap ], [ anon ] or [ stack ]. Use it right - // away - // (after peeling off the newline) - int l = strlen(buf + next); - if (buf[next + l - 1] == '\n') - buf[next + l - 1] = '\0'; - mi->filename = buf + next; - } - - pclose(pmap); - return; -} - -// return TRUE if /proc/XX/map could be read, FALSE otherwise -bool Procinfo::read_maps() -{ - char name[128]; - sprintf(name, "%s/%d/map", procdir, pid); - FILE *f = fopen(name, "r"); - if (!f) - return FALSE; - if (!maps) - maps = new Svec; - else - maps->clear(); - - prmap_t pm; - while (fread(&pm, sizeof(pm), 1, f) == 1) - { - Mapsinfo *mi = new Mapsinfo; - mi->from = pm.pr_vaddr; - mi->to = pm.pr_vaddr + pm.pr_size; - mi->offset = pm.pr_offset; - mi->perm[0] = pm.pr_mflags & MA_READ ? 'r' : '-'; - mi->perm[1] = pm.pr_mflags & MA_WRITE ? 'w' : '-'; - mi->perm[2] = pm.pr_mflags & MA_EXEC ? 'x' : '-'; - mi->perm[3] = pm.pr_mflags & MA_SHARED ? 's' : 'p'; - - if (pm.pr_mapname[0]) - { - // To find device/inode, stat the file in - // /proc/#/object: - char obj[128]; - sprintf(obj, "%s/%d/object/%s", procdir, pid, pm.pr_mapname); - struct stat sb; - if (lstat(obj, &sb) < 0) - { - delete mi; - continue; - } - mi->major = major(sb.st_dev); - mi->minor = minor(sb.st_dev); - mi->inode = sb.st_ino; - if (strcmp(pm.pr_mapname, "a.out") == 0) - mi->filename = "(executable)"; - } - else - { - mi->major = mi->minor = mi->inode = 0; - mi->filename = "(anonymous)"; - } - - maps->add(mi); - } - fclose(f); - - // If desired and possible, use /usr/proc/bin/pmap to get the - // names of the mapped files - static int myeuid = geteuid(); - if (Qps::use_pmap && (myeuid == 0 || myeuid == euid)) - read_pmap_maps(); - - return TRUE; -} - -#endif // SOLARIS - -Category::~Category() {} - -int Category::compare(Procinfo *a, Procinfo *b) -{ -#if QT_VERSION < 200 - return strcmp(string(a), string(b)); -#else - return string(a).compare(string(b)); -#endif -} - -Cat_int::Cat_int(const char *heading, const char *explain, int w, - int Procinfo::*member) - : Category(heading, explain), int_member(member), field_width(w) -{ -} - -QString Cat_int::string(Procinfo *p) -{ - QString s; - s.setNum(p->*int_member); - return s; -} - -int Cat_int::compare(Procinfo *a, Procinfo *b) -{ - // qsort() only cares about the sign of the number returned by the - // comparison function; only a subtraction is necessary - return a->*int_member - b->*int_member; -} - -Cat_uintl::Cat_uintl(const char *heading, const char *explain, int w, - unsigned long Procinfo::*member) - : Category(heading, explain), uintl_member(member), field_width(w) -{ -} - -QString Cat_uintl::string(Procinfo *p) -{ - QString s; - s.setNum(p->*uintl_member); - return s; -} - -int Cat_uintl::compare(Procinfo *a, Procinfo *b) -{ - int bu = b->*uintl_member, au = a->*uintl_member; - return bu >= au ? (bu == au ? 0 : 1) : -1; -} - -Cat_hex::Cat_hex(const char *heading, const char *explain, int w, - unsigned long Procinfo::*member) - : Cat_uintl(heading, explain, w, member) -{ -} - -QString Cat_hex::string(Procinfo *p) -{ - QString s; - s.sprintf("%8x", (unsigned)(p->*uintl_member)); - return s; -} - -Cat_swap::Cat_swap(const char *heading, const char *explain) - : Category(heading, explain) -{ -} - -QString Cat_swap::string(Procinfo *p) -{ - QString s; - // It can actually happen that size < resident (XSun under Solaris 2.6) - s.setNum(p->size > p->resident ? p->size - p->resident : 0); - return s; -} - -int Cat_swap::compare(Procinfo *a, Procinfo *b) -{ - return (b->size - b->resident) - (a->size - a->resident); -} - -Cat_string::Cat_string(const char *heading, const char *explain, - QString Procinfo::*member) - : Category(heading, explain), str_member(member) -{ -} - -QString Cat_string::string(Procinfo *p) { return p->*str_member; } - -Cat_user::Cat_user(const char *heading, const char *explain) - : Cat_string(heading, explain) -{ -} - -QString Cat_user::string(Procinfo *p) -{ -#ifdef MOSIX - if (p->isremote) - return "-mosix-"; -#endif - if (p->uid == p->euid) - return Uidstr::userName(p->uid); - else - { - QString s = Uidstr::userName(p->uid); -#if QT_VERSION < 200 - s.detach(); -#endif - s.append(p->euid == 0 ? "*" : "+"); - return s; - } -} - -Cat_group::Cat_group(const char *heading, const char *explain) - : Cat_string(heading, explain) -{ -} - -QString Cat_group::string(Procinfo *p) -{ - if (p->gid == p->egid) - return Uidstr::groupName(p->gid); - else - { - QString s = Uidstr::groupName(p->gid); -#if QT_VERSION < 200 - s.detach(); -#endif - s.append("*"); - return s; - } -} - -Cat_wchan::Cat_wchan(const char *heading, const char *explain) - : Cat_string(heading, explain) -{ -} - -QString Cat_wchan::string(Procinfo *p) { return Wchan::name(p->wchan); } - -Cat_cmdline::Cat_cmdline(const char *heading, const char *explain) - : Cat_string(heading, explain) -{ -} - -QString Cat_cmdline::string(Procinfo *p) -{ - if (p->cmdline.isEmpty()) - { - QString s("("); - s.append(p->command); - s.append(")"); - return s; - } - else - { - if (Qps::show_file_path) - return p->cmdline; - else - { - QString s(p->cmdline); -#if QT_VERSION < 200 - s.detach(); -#endif - int i = s.find(' '); - if (i < 0) - i = s.length(); - if (i > 0) - { - i = s.findRev('/', i - 1); - if (i >= 0) - s.remove(0, i + 1); - } - return s; - } - } -} - -Cat_dir::Cat_dir(const char *heading, const char *explain, const char *dirname, - QString Procinfo::*member) - : Cat_string(heading, explain), dir(dirname), cache(member) -{ -} - -QString Cat_dir::string(Procinfo *p) -{ - if ((p->*cache).isNull()) - { - char path[128], buf[512]; - sprintf(path, "%s/%d/%s", procdir, p->pid, dir); - -#ifdef LINUX - int n = readlink(path, buf, sizeof(buf) - 1); - if (n < 0) - { - // Either a kernel process, or access denied. - // A hyphen is visually least disturbing here. - p->*cache = "-"; - return p->*cache; - } - else if (buf[0] != '[') - { - // linux >= 2.1.x: path name directly in link - buf[n] = '\0'; - p->*cache = buf; - return p->*cache; - } -#endif - - // Either a Linux 2.0 link in [device]:inode form, or a Solaris - // link. - // To resolve it, we just chdir() to it and see where we end up. - // Perhaps we should change back later? - if (chdir(path) < 0) - { - p->*cache = "-"; // Most likely access denied - } - else - { - // getcwd() is fairly expensive, but this is cached - // anyway - if (!getcwd(buf, sizeof(buf))) - { - p->*cache = "(deleted)"; - } - else - p->*cache = buf; - } - } - return p->*cache; -} - -Cat_state::Cat_state(const char *heading, const char *explain) - : Category(heading, explain) -{ -} - -QString Cat_state::string(Procinfo *p) -{ - QString s(" "); - s[0] = p->state; -#ifdef SOLARIS - if (p->state == 'Z') - return s; -#endif - s[1] = (p->resident == 0 && p->state != 'Z') ? 'W' : ' '; - int ni = p->nice; -#ifdef SOLARIS - if (!Qps::normalize_nice) - ni -= NZERO; -#endif - s[2] = (ni > 0) ? 'N' : ((ni < 0) ? '<' : ' '); - return s; -} - -Cat_policy::Cat_policy(const char *heading, const char *explain) - : Category(heading, explain) -{ -} - -QString Cat_policy::string(Procinfo *p) -{ - QString s; -#ifdef LINUX - switch (p->get_policy()) - { - case SCHED_FIFO: - s = "FI"; - break; // first in, first out - case SCHED_RR: - s = "RR"; - break; // round-robin - case SCHED_OTHER: - s = "TS"; - break; // time-sharing - default: - s = "??"; - break; - } -#endif -#ifdef SOLARIS - s = " "; - s[0] = p->policy_name[0]; - s[1] = p->policy_name[1]; -#endif - return s; -} - -int Cat_policy::compare(Procinfo *a, Procinfo *b) -{ -#ifdef LINUX - return b->get_policy() - a->get_policy(); -#endif -#ifdef SOLARIS - int r = b->policy_name[0] - a->policy_name[0]; - return r ? r : b->policy_name[1] - a->policy_name[1]; -#endif -} - -Cat_rtprio::Cat_rtprio(const char *heading, const char *explain) - : Category(heading, explain) -{ -} - -QString Cat_rtprio::string(Procinfo *p) -{ - QString s; - s.setNum(p->get_rtprio()); - return s; -} - -int Cat_rtprio::compare(Procinfo *a, Procinfo *b) -{ - return b->get_rtprio() - a->get_rtprio(); -} - -Cat_time::Cat_time(const char *heading, const char *explain) - : Category(heading, explain) -{ -} - -QString Cat_time::string(Procinfo *p) -{ - QString s; - int ticks = p->utime; - if (Qps::cumulative) - ticks += p->cutime; - int t = ticks / HZ; // seconds - if (t < 10) - { - int hundreds = ticks / (HZ / 100) % 100; - s.sprintf("%1d.%02ds", t, hundreds); - } - else if (t < 100 * 60) - { - s.sprintf("%2d:%02d", t / 60, t % 60); - } - else if (t < 100 * 3600) - { - int h = t / 3600; - t %= 3600; - s.sprintf("%2d:%02dh", h, t / 60); - } - else - { - int d = t / 86400; - t %= 86400; - s.sprintf("%dd%dh", d, t / 3600); - } - return s; -} - -int Cat_time::compare(Procinfo *a, Procinfo *b) -{ - int at = a->utime, bt = b->utime; - if (Qps::cumulative) - { - at += a->cutime; - bt += b->cutime; - } - return bt - at; -} - -Cat_start::Cat_start(const char *heading, const char *explain) - : Category(heading, explain) -{ -} - -QString Cat_start::string(Procinfo *p) -{ -#ifdef SOLARIS - if (p->state == 'Z') - return "-"; // Solaris zombies have no valid start time -#endif - time_t start = p->boot_time + p->starttime / (unsigned)HZ; - QString s; - char *ct = ctime(&start); - if (p->tv.tv_sec - start < 86400) - { - ct[16] = '\0'; - s = ct + 11; - } - else - { - ct[10] = '\0'; - s = ct + 4; - } - return s; -} - -int Cat_start::compare(Procinfo *a, Procinfo *b) -{ - unsigned long bs = b->starttime, as = a->starttime; - return bs >= as ? (bs == as ? 0 : 1) : -1; -} - -Cat_percent::Cat_percent(const char *heading, const char *explain, int w, - float Procinfo::*member) - : Category(heading, explain), float_member(member), field_width(w) -{ -} - -QString Cat_percent::string(Procinfo *p) -{ - QString s; - s.sprintf("%01.2f", (double)(p->*float_member)); - return s; -} - -int Cat_percent::compare(Procinfo *a, Procinfo *b) -{ - float at = a->*float_member, bt = b->*float_member; - return at < bt ? 1 : (at > bt ? -1 : 0); -} - -Cat_tty::Cat_tty(const char *heading, const char *explain) - : Cat_string(heading, explain) -{ -} - -QString Cat_tty::string(Procinfo *p) { return Ttystr::name(p->tty); } - -Proc::Proc() -{ - // Note: When adding/removing/changing the fields, the save file - // version must be increased! - char *command, *command_line; - allcats.set(F_PID, new Cat_int("PID", "Process ID", 6, &Procinfo::pid)); - allcats.set(F_PPID, - new Cat_int("PPID", "Parent process ID", 6, &Procinfo::ppid)); - allcats.set(F_PGID, - new Cat_int("PGID", "Process group ID", 6, &Procinfo::pgrp)); - allcats.set(F_SID, new Cat_int("SID", "Session ID", 6, &Procinfo::session)); - allcats.set(F_TTY, new Cat_tty("TTY", "Controlling tty")); -#ifdef LINUX - allcats.set(F_TPGID, new Cat_int("TPGID", "Process group ID of tty owner", - 6, &Procinfo::tpgid)); -#endif -#ifdef MOSIX - allcats.set(F_MIGR, new Cat_string("MIGR", "Process migrated to (>node) " - "or from (node>)", - &Procinfo::migr)); - allcats.set(F_LOCKED, - new Cat_int("LOCK", "Whether this process is locked to" - " this node", - 6, &Procinfo::locked)); - allcats.set(F_NMIGS, new Cat_int("NMIGS", "How many times this process" - " has migrated", - 6, &Procinfo::nmigs)); - allcats.set(F_NOMOVE, - new Cat_string("NOMOVE", "Reason for why process can't move", - &Procinfo::cantmove)); - allcats.set(F_RPID, new Cat_int("RPID", "Process ID on home node", 6, - &Procinfo::remotepid)); -#endif - - allcats.set(F_USER, - new Cat_user("USER", "Owner (*=suid root, +=suid other user" -#ifdef MOSIX - " -mosix-=immigrated from other node" -#endif - ")")); - allcats.set(F_GROUP, new Cat_group("GROUP", "Group name (*=sgid other)")); - allcats.set(F_UID, new Cat_int("UID", "Real user ID", 6, &Procinfo::uid)); - allcats.set(F_EUID, - new Cat_int("EUID", "Effective user ID", 6, &Procinfo::euid)); -#ifdef LINUX - allcats.set(F_SUID, new Cat_int("SUID", "Saved user ID (Posix)", 6, - &Procinfo::suid)); - allcats.set(F_FSUID, new Cat_int("FSUID", "File system user ID", 6, - &Procinfo::fsuid)); -#endif - allcats.set(F_GID, new Cat_int("GID", "Real group ID", 6, &Procinfo::gid)); - allcats.set(F_EGID, - new Cat_int("EGID", "Effective group ID", 6, &Procinfo::egid)); -#ifdef LINUX - allcats.set(F_SGID, new Cat_int("SGID", "Saved group ID (Posix)", 6, - &Procinfo::sgid)); - allcats.set(F_FSGID, new Cat_int("FSGID", "File system group ID", 6, - &Procinfo::fsgid)); -#endif - allcats.set(F_PRI, - new Cat_int("PRI", "Dynamic priority", 4, &Procinfo::priority)); - allcats.set(F_NICE, - new Cat_int("NICE", - "Scheduling favour (higher -> less cpu time)", 4, - &Procinfo::nice)); - allcats.set(F_PLCY, new Cat_policy("PLCY", "Scheduling policy")); - allcats.set( - F_RPRI, - new Cat_rtprio("RPRI", "Realtime priority (0-99, more is better)")); -#ifdef SOLARIS - allcats.set(F_NLWP, new Cat_int("NLWP", "Number of threads in process", 5, - &Procinfo::nthreads)); - allcats.set(F_ARCH, new Cat_int("ARCH", "Architecture (address bits)", 2, - &Procinfo::addr_bits)); -#endif - allcats.set(F_MAJFLT, - new Cat_uintl("MAJFLT", "Number of major faults (disk access)", - 8, &Procinfo::majflt)); - allcats.set(F_MINFLT, - new Cat_uintl("MINFLT", - "Number of minor faults (no disk access)", 8, - &Procinfo::minflt)); -#ifdef LINUX - allcats.set(F_TRS, new Cat_uintl("TRS", "Text resident set size in Kbytes", - 8, &Procinfo::trs)); - allcats.set(F_DRS, new Cat_uintl("DRS", "Data resident set size in Kbytes", - 8, &Procinfo::drs)); -#endif - allcats.set(F_SIZE, - new Cat_uintl("SIZE", "Virtual image size of process in Kbytes", - 8, &Procinfo::size)); - allcats.set(F_SWAP, new Cat_swap("SWAP", "Kbytes on swap device")); - allcats.set(F_RSS, - new Cat_uintl("RSS", "Resident set size; Kbytes of program " - "in memory", - 8, &Procinfo::resident)); -#ifdef LINUX - allcats.set(F_SHARE, new Cat_uintl("SHARE", "Shared memory in Kbytes", 8, - &Procinfo::share)); - allcats.set(F_DT, new Cat_uintl("DT", "Number of dirty (non-written) pages", - 7, &Procinfo::dt)); -#endif - allcats.set(F_STAT, new Cat_state("STAT", "State of the process")); - allcats.set(F_FLAGS, new Cat_hex("FLAGS", "Process flags (hex)", 9, - &Procinfo::flags)); - allcats.set( - F_WCHAN, - new Cat_wchan("WCHAN", "Kernel function where process is sleeping")); - allcats.set(F_WCPU, - new Cat_percent("%WCPU", - "Weighted percentage of CPU (30 s average)", 6, - &Procinfo::wcpu)); - allcats.set(F_CPU, new Cat_percent( - "%CPU", "Percentage of CPU used since last update", - 6, &Procinfo::pcpu)); - allcats.set(F_MEM, new Cat_percent( - "%MEM", "Percentage of memory used (RSS/total mem)", - 6, &Procinfo::pmem)); - allcats.set(F_START, new Cat_start("START", "Time process started")); - allcats.set(F_TIME, - new Cat_time("TIME", "Total CPU time used since start")); - allcats.set(F_CPUNUM, new Cat_int("CPU", "CPU the process is executing on", - 3, &Procinfo::which_cpu)); -#ifdef OLD_LABEL - command = "COMM"; // label in linux source code --> /proc/XXX/stat -#else - command = "COMMAND"; -#endif - allcats.set(F_COMM, - new Cat_string(command, "Command that started the process", - &Procinfo::comm)); - allcats.set(F_CWD, new Cat_dir("CWD", "Current working directory", "cwd", - &Procinfo::cwd)); - allcats.set(F_ROOT, new Cat_dir("ROOT", "Root directory of process", "root", - &Procinfo::root)); -#ifdef OLD_LABEL - command_line = "CMDLINE"; // reference to /proc/XXX/cmdline -#else - command_line = "COMMAND_LINE"; -#endif - allcats.set( - F_CMDLINE, - new Cat_cmdline(command_line, "Command line that started the process")); - - for (int i = 0; i < allcats.size(); i++) - allcats[i]->index = i; - - Procinfo::init_static(); - - current_gen = 0; // ! -} - -void Proc::newproc(Procinfo *p) -{ - Procinfo *oldp = procs[p->pid]; - if (oldp) - { - // calculate pcpu (and wcpu for Linux) from previous procinfo - int dt = (p->tv.tv_usec - oldp->tv.tv_usec) / (1000000 / HZ) + - (p->tv.tv_sec - oldp->tv.tv_sec) * HZ; - int dcpu = p->utime - oldp->utime; - p->pcpu = 100.0 * dcpu / dt; - if (p->pcpu > 99.99) - p->pcpu = 99.99; - -#if defined(LINUX) - const float a = Procview::avg_factor; - p->wcpu = a * oldp->wcpu + (1 - a) * p->pcpu; -#endif - - // propagate some fields to new incarnation - p->selected = oldp->selected; - p->details = oldp->details; - p->hidekids = oldp->hidekids; - oldp->details = 0; - if (p->details) - p->details->set_procinfo(p); - -#ifdef LINUX - if (Procinfo::num_cpus > 1) - { - // SMP: see which processor was used the most - int best_cpu = -1; - unsigned long most = 0; - for (unsigned cpu = 0; cpu < Procinfo::num_cpus; cpu++) - { - unsigned long delta = - p->per_cpu_times[cpu] - oldp->per_cpu_times[cpu]; - if (delta > most) - { - most = delta; - best_cpu = cpu; - } - // if no cpu time has been spent, use previous - // value - p->which_cpu = (best_cpu >= 0) ? best_cpu : oldp->which_cpu; - } - } -#endif - oldp->deref(); - } - else - { -// New process -#ifdef LINUX - // %cpu first time = (cpu time since start) / (time since start) - int jiffies_since_boot = - p->tv.tv_usec / (1000000 / HZ) + (p->tv.tv_sec - p->boot_time) * HZ; - int dt = jiffies_since_boot - p->starttime; - int dcpu = p->utime; - p->pcpu = 100.0 * dcpu / dt; - if (dt == 0 || p->pcpu > 99.99 || p->pcpu < 0) - p->pcpu = 0.0; - p->selected = FALSE; -#endif - p->wcpu = p->pcpu; // just a start - -#ifdef LINUX - if (Procinfo::num_cpus > 1) - { - // first tick: count times from 0 - unsigned long most = 0; - for (unsigned cpu = 0; cpu < Procinfo::num_cpus; cpu++) - { - unsigned long t = p->per_cpu_times[cpu]; - if (t > most) - { - most = t; - p->which_cpu = cpu; - } - } - } -#endif - } - procs.replace(p->pid, p); - if (procs.count() > procs.size()) - procs.resize(procs.count() * 2 - 1); -} - -// update the process list -void Proc::refresh() -{ - current_gen = !current_gen; // 1,2,3,4.... - - Procinfo::read_common(); - - int pid; - - DIR *d = opendir(procdir); - struct dirent *e; - while ((e = readdir(d)) != 0) - { - if (e->d_name[0] >= '0' && e->d_name[0] <= '9') - { // good idea ! - - pid = atoi(e->d_name); - Procinfo *pi = new Procinfo(pid); - - if (pi->pid == -1) - delete pi; // already gone - else - { - pi->generation = current_gen; - newproc(pi); - } - } - } - closedir(d); - -#ifdef MOSIX - if (Procinfo::mosix_running) - { - char path[256]; - strcpy(path, procdir); - strcat(path, "/mosix/remote"); - d = opendir(path); - if (d) - { - while ((e = readdir(d)) != 0) - { - if (e->d_name[0] >= '0' && e->d_name[0] <= '9') - { - Procinfo *pi = new Procinfo(atoi(e->d_name)); - if (pi->pid == -1) - delete pi; // already gone - else - { - pi->generation = current_gen; - newproc(pi); - } - } - } - closedir(d); - } - } -#endif // MOSIX - - // remove Procinfos of nonexisting processes - for (Q3IntDictIterator it(procs); it.current();) - { - Procinfo *p = it.current(); - if (p->generation != current_gen) - { - procs.remove(p->pid); - p->deref(); - } - else - ++it; - } -} - -Category *Proc::cat_by_name(const char *s) -{ - if (s) - { - for (int i = 0; i < allcats.size(); i++) - if (strcmp(allcats[i]->name, s) == 0) - return allcats[i]; - } - return 0; -} - -int Proc::field_id_by_name(const char *s) -{ - if (s) - { - for (int i = 0; i < allcats.size(); i++) - if (strcmp(allcats[i]->name, s) == 0) - return i; - } - return -1; -} - -int Procview::custom_fields[18] = {F_PID, F_TTY, F_USER, F_NICE, -#ifdef SOLARIS - F_NLWP, -#endif - F_SIZE, F_RSS, F_STAT, F_CPU, - F_START, F_TIME, F_CMDLINE, F_END}; - -int Procview::user_fields[] = {F_PID, F_TTY, F_USER, F_NICE, -#ifdef SOLARIS - F_NLWP, -#endif - F_SIZE, F_RSS, F_STAT, F_CPU, - F_START, F_TIME, F_CMDLINE, F_END}; - -#ifdef MOSIX -int Procview::user_fields_mosix[] = {F_PID, F_TTY, F_USER, F_NICE, F_MIGR, - F_NMIGS, F_SIZE, F_RSS, F_STAT, F_CPU, - F_START, F_TIME, F_CMDLINE, F_END}; -#endif - -int Procview::jobs_fields[] = {F_PID, F_PPID, F_PGID, F_SID, F_TTY, -#ifdef LINUX - F_TPGID, -#endif - F_STAT, F_UID, F_TIME, F_CMDLINE, F_END}; -#ifdef MOSIX -int Procview::jobs_fields_mosix[] = { - F_PID, F_PPID, F_PGID, F_SID, F_MIGR, F_NMIGS, F_LOCKED, F_NOMOVE, - F_TTY, F_TPGID, F_STAT, F_UID, F_TIME, F_CMDLINE, F_END}; -#endif - -int Procview::mem_fields[] = {F_PID, F_TTY, F_MAJFLT, F_MINFLT, -#ifdef LINUX - F_TRS, F_DRS, -#endif - F_SIZE, F_SWAP, F_RSS, -#ifdef LINUX - F_SHARE, F_DT, -#endif - F_CMDLINE, F_END}; -#ifdef MOSIX -int Procview::mem_fields_mosix[] = { - F_PID, F_MIGR, F_TTY, F_MAJFLT, F_MINFLT, F_TRS, F_DRS, - F_SIZE, F_SWAP, F_RSS, F_SHARE, F_DT, F_CMDLINE, F_END}; -#endif - -float Procview::avg_factor = 1.0; - -Procview::Procview(Proc *p) : proc(p) -{ - sortcat = p->allcats[F_WCPU]; - reversed = FALSE; - viewproc = ALL; - viewfields = USER; - treeview = TRUE; // init_mode by fasthyun - set_fields(); -} - -// read new process info -void Procview::refresh() -{ - for (int i = 0; i < old_procs.size(); i++) - old_procs[i]->deref(); - old_procs = procs; - procs.clear(); - proc->refresh(); // update the process list ,read "/proc" - rebuild(); -} - -bool Procview::accept_proc(Procinfo *p) -{ - static int my_uid = getuid(); - return viewproc == ALL || viewproc == OWNED && p->uid == my_uid || - viewproc == NROOT && p->uid != 0 || - viewproc == RUNNING && strchr("ORDW", p->state) != 0 -#ifdef MOSIX - || viewproc == RUNNING && p->where > 0 -#endif - ; -} - -// be called by Procview::rebuild() -void Procview::build_tree() -{ - if (root_procs.size() > 0) - { - Procinfo *p; - for (Q3IntDictIterator it(proc->procs); (p = it.current()); - ++it) - if (p->children) - p->children->clear(); - root_procs.clear(); - } - Procinfo *p; - for (Q3IntDictIterator it(proc->procs); (p = it.current()); ++it) - { - if (accept_proc(p)) - { - Procinfo *parent = 0; - - if (p->ppid && (parent = proc->procs[p->ppid]) && - accept_proc(parent)) - { - if (!parent->children) - parent->children = new Svec(4); - parent->children->add(p); - } - else - { - root_procs.add(p); - } - } - else - p->selected = FALSE; - } -} - -// re-sort the process info -void Procview::rebuild() -{ - for (int i = 0; i < procs.size(); i++) - procs[i]->deref(); // delete procs ? - procs.clear(); - if (treeview) - { - build_tree(); - parent_rows.clear(); - linearize_tree(&root_procs, 0, -1); - } - else - { - for (Q3IntDictIterator it(proc->procs); it.current(); ++it) - { - Procinfo *p = it.current(); - if (accept_proc(p)) - procs.add(p->ref()); - else - p->selected = FALSE; - } - static_sortcat = sortcat; - procs.sort(reversed ? compare_backwards : compare); - } -} - -// ???? -void Procview::linearize_tree(Svec *ps, int level, int prow) -{ - static_sortcat = sortcat; - ps->sort(reversed ? compare_backwards : compare); - for (int i = 0; i < ps->size(); i++) - { - Procinfo *p = (*ps)[i]; - p->level = level; - p->lastchild = FALSE; - procs.add(p->ref()); - parent_rows.add(prow); - if (p->children && !p->hidekids) - linearize_tree(p->children, level + 1, procs.size() - 1); - } - if (ps->size() > 0) - (*ps)[ps->size() - 1]->lastchild = TRUE; -} - -void Procview::set_fields_list(int fields[]) -{ - cats.clear(); - for (int i = 0; fields[i] != F_END; i++) - { - cats.add(proc->allcats[fields[i]]); - // printf("DEBUG: %d %s \n", i,proc->allcats[fields[i]]->name); - } -} - -void Procview::set_fields() -{ - switch (viewfields) - { - case USER: -#ifdef MOSIX - if (Procinfo::mosix_running) - { - set_fields_list(user_fields_mosix); - break; - } -#endif - set_fields_list(user_fields); - break; - case JOBS: -#ifdef MOSIX - if (Procinfo::mosix_running) - { - set_fields_list(jobs_fields_mosix); - break; - } -#endif - set_fields_list(jobs_fields); - break; - case MEM: -#ifdef MOSIX - if (Procinfo::mosix_running) - { - set_fields_list(mem_fields_mosix); - break; - } -#endif - set_fields_list(mem_fields); - break; - case CUSTOM: - set_fields_list(custom_fields); - break; - } -} - -// return the column number of a field, or -1 if not displayed -int Procview::findCol(int field) -{ - for (int i = 0; i < cats.size(); i++) - if (cats[i] == proc->allcats[field]) - return i; - return -1; -} - -// add a category (last) -void Procview::add_cat(Category *c) -// void Procview::add_category(Category *c) -{ - cats.add(c); -} - -void Procview::remove_cat(int index) { cats.remove(index); } - -// deduce whether the currently selected fields correspond to a field list -void Procview::deduce_fields() -{ - return; - - if (viewfields != CUSTOM) - return; - Procview::fieldstates tags[3] = {USER, JOBS, MEM}; - int *lists[3] = {user_fields, jobs_fields, mem_fields}; -#ifdef MOSIX - if (Procinfo::mosix_running) - { - lists[0] = user_fields_mosix; - lists[1] = jobs_fields_mosix; - lists[2] = mem_fields_mosix; - } -#endif - for (int i = 0; i < 3; i++) - { - int *l = lists[i]; - int j; - for (j = 0; l[j] != F_END; j++) - if (findCol(l[j]) < 0) - break; - if (l[j] == F_END && j == cats.size()) - { - viewfields = tags[i]; - return; - } - } -} - -Category *Procview::static_sortcat = 0; - -int Procview::compare(Procinfo *const *a, Procinfo *const *b) -{ - int r = static_sortcat->compare(*a, *b); - return (r == 0) ? ((*a)->pid > (*b)->pid ? 1 : -1) : r; -} - -int Procview::compare_backwards(Procinfo *const *a, Procinfo *const *b) -{ - int r = static_sortcat->compare(*b, *a); - return (r == 0) ? ((*b)->pid > (*a)->pid ? 1 : -1) : r; -} diff --git a/src/proc_solaris.cpp b/src/proc_solaris.cpp deleted file mode 100644 index f7999af..0000000 --- a/src/proc_solaris.cpp +++ /dev/null @@ -1,1344 +0,0 @@ -/* - * proc.cpp for Solaris (SunOS) - * - * Copyright 1997-1999 Mattias Engdegård - * Copyright 2005 José Luis Sánchez - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include -#include -#include //HZ -#include -#include -#include -#include -#include -#include -#include - -#include "qps.h" -#include "proc.h" -#include "uidstr.h" -#include "ttystr.h" -#include "wchan.h" -#include "details.h" - -// Solaris... -#include -#include -#include -#include - -//#include -#define _STRUCTURED_PROC 1 -#include // psinfo_t , - /* - * - If you want an "#ifdef solaris", the portable way is - - #if defined (__SVR4) && defined (__sun) - - This should work on gcc, sun cc, and lots o other compilers, on both sparc and - intel. - If for some reason, you want to know that Sun forte CC (c++) compiler is being - used, something that seems to work is - - #if defined(__SUNPRO_CC) - - Whereas for forte cc (regular C), you can use - - #if defined(__SUNPRO_C) - - */ -#include "proc_common.cpp" - -char procdir[128] = "/proc"; - -int page_k_shift; // - -extern int flag_thread_ok; -extern bool flag_show_thread; -extern bool flag_devel; - -kstat_ctl_t *Proc::kc = 0; - -int proc_PID_fd(const int pid) -{ - char path[128]; - int numfd; - - sprintf(path, "/proc/%d/fd", pid); - - QDir qdir(path); - numfd = qdir.count(); - - /// num_opened_files += numfd; - // printf("PID %d: %d opened files\n", pid, numfd); - return TRUE; -} - -Procinfo::Procinfo(Proc *system_proc, int process_id, int thread_id) : refcnt(1) -{ - proc = system_proc; // - first_run = true; - clone = false; - - if (thread_id < 0) - { - pid = process_id; - tgid = process_id; - } - else - { - pid = thread_id; - tgid = process_id; - } - - detail = NULL; - /// children = 0; - - envblock = 0; - // if( readproc(proc_pid) < 0 ) pid = -1; // - // invalidate object, - // will be deleted - - ppid = 0; // no parent important!! - selected = false; - hidekids = false; - envblock = 0; //!! - - table_child_seq = -1; - child_seq_prev = -1; - - lastchild = 0; - generation = -1; - detail = 0; - - size = 0; - resident = 0; - // trs=0; - // drs=0; - // stack=0; - // share=0; - mem = 0; - - io_read_prev = 0; - io_write_prev = 0; - - // tgid=0; - pcpu = 0; - pmem = 0; - - command = "noname"; - tty = 0; - nice = 0; - starttime = 0; - state = 'Z'; - cutime = utime = 0; - - old_utime = 0; -} - -// COMMON? -Procinfo::~Procinfo() -{ - if (detail) - { - detail->process_gone(); - detail = 0; - } - - /* - if( envblock ) - free(envblock); - if( maps ) - { - // maps->purge(); - delete maps; - } - if( fd_files ) - { - // fd_files->purge(); - delete fd_files; - } */ - /// delete children; -} - -// miscellaneous static initializations -void Proc::init_static() -{ - if (!kc) - { - kc = kstat_open(); - if (!kc) - { - perror("kstat_open"); - exit(1); - } - } - - int pagesize = sysconf(_SC_PAGESIZE); // same getpagesize() in - printf("pagesize=%d, %d\n ", getpagesize(), sysconf(_SC_PAGESIZE)); // 4027 - - page_k_shift = 0; - for (int j = getpagesize(); j > 1024; j >>= 1) - page_k_shift++; -} - -// return number of bytes read if ok, -1 if failed -int read_file(char *name, void *buf, int max) -{ - int fd = open(name, O_RDONLY); - if (fd < 0) - return -1; - int r = read(fd, buf, max); - close(fd); - return r; -} - -// SOLARIS -// Description : read /proc/1234/task/* tasks(thread,LWP) -// add to Proc::procs[] -int Proc::read_pid_tasks(int pid) -{ - char path[256]; - char *p; - struct dirent *e; - int thread_pid; - int thread_n = 0; - - // printf("DEBUG:pid=%d :",pid); - sprintf(path, "%s/%d/lwp", procdir, pid); - - DIR *d = opendir(path); - if (!d) - return -1; - - while ((e = readdir(d)) != 0) - { - if (e->d_name[0] == '.') - continue; // skip "." , ".." - - Procinfo *pi; - thread_pid = atoi(e->d_name); // only number !! - - if (pid == thread_pid) - continue; // skip - - /* - Procinfo *pi = new Procinfo(this,pid, thread_id); - - if(pi->pid == -1) - delete pi; // already gone - - else { - pi->generation = current_gen; - pi->cmdline="(thread)"; - // newproc(pi); - } - */ - pi = procs.value(thread_pid, NULL); - - if (pi == NULL) - { - pi = new Procinfo(this, pid, thread_pid); - procs.insert(thread_pid, pi); - } - if (pi->readproc() >= 0) - { - pi->generation = current_gen; - // if(pid!=thread_pid) - // pi->cmdline="(thread)"; - } - - thread_n++; - } - /// printf("\n"); - closedir(d); - return thread_n; -} - -// DEL ( because of 2byte language) -static inline bool isprintable(unsigned char c) -{ - // assume, somewhat na.vely, that all latin-1 characters are printable - return (c >= 0x20 && c < 0x7f) || c >= 0xa0; -} - -// DEL replace unprintables by spaces -static void make_printable(char *s) -{ - while (*s) - { - if (!isprintable(*s)) - *s = ' '; - ++s; - } -} - -// what this fuck..??? move to readproc -/* void Proc::newproc(Procinfo *p) -{ - Procinfo *oldp = procs[p->pid]; - - //if(oldp && flag_thread_ok && (previous_flag_show_thread != -flag_show_thread) ){ - // oldp->deref(); - // oldp =NULL; - // } - { - // New process - p->wcpu = p->pcpu; // just a start - } -} */ - -// read proc/PID Solaris 10, not tested in Solaris 9 -int Procinfo::readproc() -{ - char path[256]; - - // Procinfo:pid; - proc_PID_fd(pid); // check!! - sprintf(path, "%s/%d/psinfo", procdir, pid); - - psinfo_t psi; - if (read_file(path, (void *)&psi, sizeof(psi)) < (int)sizeof(psi)) - return -1; - - sprintf(path, "%s/%d/usage", procdir, pid); - prusage_t pru; - if (read_file(path, (void *)&pru, sizeof(pru)) < (int)sizeof(pru)) - return -1; - - if (first_run) - { - - first_run = false; - } - minflt = pru.pr_minf; - majflt = pru.pr_majf; - - uid = psi.pr_uid; // ok - euid = psi.pr_euid; // ok - gid = psi.pr_gid; // ok - egid = psi.pr_egid; // ok - - // make_printable(psi.pr_psargs); - cmdline = psi.pr_psargs; // ok - command = psi.pr_fname; - - ppid = psi.pr_ppid; // ok - pgrp = psi.pr_pgid; // ok - session = psi.pr_sid; // ok - tty = psi.pr_ttydev; // ok type? - - nthreads = psi.pr_nlwp; // num of threads - - //------- no checked - const int ns_ticks = 1000000000 / HZ; // HZ=100, clk_tick - // printf("ns_ticks=%d\n",ns_ticks);// 10000000 - // starttime = (psi.pr_start.tv_sec) * HZ + - // psi.pr_start.tv_nsec / - // ns_ticks; - starttime = psi.pr_start.tv_sec; // discard tv_nsec - env_ofs = psi.pr_envp; - addr_bits = psi.pr_dmodel == PR_MODEL_ILP32 ? 32 : 64; - - gettimeofday(&tv, 0); // current_time, sys/time , tv.tv_sec, tv.tv_usec - - // god dam!!!! if that dont reel in the ladies then nothing will!!!! - - // No - state = psi.pr_lwp.pr_sname; // no - command = (state == 'Z') ? "" : psi.pr_fname; - flags = psi.pr_flag; // no - - // No - utime = psi.pr_time.tv_sec * HZ + psi.pr_time.tv_nsec / ns_ticks; //?? - cutime = psi.pr_ctime.tv_sec * HZ + psi.pr_ctime.tv_nsec / ns_ticks; - - // printf("[%d] utime=%d\n",pid,utime); - - int dcpu; - if (old_utime == 0 and utime == 0) - { - pcpu = 0; - } - else - { - dcpu = utime - old_utime; - - // calculate pcpu (and wcpu for Linux) from previous procinfo - int dt = (tv.tv_usec - old_tv.tv_usec) / (1000000 / HZ) + - (tv.tv_sec - old_tv.tv_sec) * HZ; - - if (dt == 0) - pcpu = 0; - else - pcpu = 100.0 * dcpu / dt; - - // if( pcpu > 99.99 ) pcpu = 99.99; - - old_utime = utime; - old_tv = tv; - } - - priority = psi.pr_lwp.pr_pri; - nice = psi.pr_lwp.pr_nice; - if (Qps::normalize_nice) //??? - nice -= NZERO; - - wchan = psi.pr_lwp.pr_wchan; - - // MEM - size = psi.pr_size; - resident = psi.pr_rssize; - which_cpu = psi.pr_lwp.pr_onpro; - - // pr_pctcpu and pr_pctmem are scaled so that 1.0 is stored as 0x8000. - // We rescale pcpu so a CPU-bound process is shown as 100%. (This means - // that wcpu may exceed 100% with several LWPs.) - wcpu = psi.pr_pctcpu * (1 / 327.68) * proc->num_cpus; - pmem = psi.pr_pctmem * (1 / 327.68); - - rtprio = -1; // ditto - policy_name[0] = psi.pr_lwp.pr_clname[0]; - policy_name[1] = psi.pr_lwp.pr_clname[1]; - - if (dcpu == 0) - return 1; - return 2; // this process consumed jiffi of cpu -} - -// thread Solaris 10 -int Procinfo::readproc(int proc_pid, int thread) -{ - char ppath[256]; - char upath[256]; - - pid = proc_pid; - - proc_PID_fd(pid); - - if (!flag_thread_ok || !flag_show_thread) - { - return readproc(); - } - // get the process stuff - // readproc(); - - pid = thread; //***** - - sprintf(ppath, "%s/%d/lwp/%d/lwpsinfo", procdir, proc_pid, thread); - sprintf(upath, "%s/%d/lwp/%d/lwpusage", procdir, proc_pid, thread); - - lwpsinfo_t psi; - if (read_file(ppath, (void *)&psi, sizeof(psi)) < (int)sizeof(psi)) - { - return -1; - } - - prusage_t pru; - if (read_file(upath, (void *)&pru, sizeof(pru)) < (int)sizeof(pru)) - { - return -1; - } - - state = psi.pr_sname; - flags = psi.pr_flag; - const int ns_ticks = 1000000000 / HZ; - utime = psi.pr_time.tv_sec * HZ + psi.pr_time.tv_nsec / ns_ticks; - priority = psi.pr_pri; - nice = psi.pr_nice; - if (Qps::normalize_nice) - nice -= NZERO; - starttime = (psi.pr_start.tv_sec - proc->boot_time) * HZ + - psi.pr_start.tv_nsec / ns_ticks; - wchan = psi.pr_wchan; - - minflt = pru.pr_minf; - majflt = pru.pr_majf; - which_cpu = psi.pr_onpro; - - // pr_pctcpu and pr_pctmem are scaled so that 1.0 is stored as 0x8000. - // We rescale pcpu so a CPU-bound process is shown as 100%. (This means - // that wcpu may exceed 100% with several LWPs.) - if (psi.pr_pctcpu) - { - wcpu = (psi.pr_pctcpu / 327.68) * proc->num_cpus; - } - else - { - wcpu = 0.0; - } - gettimeofday(&tv, 0); // - rtprio = -1; // ditto - policy_name[0] = psi.pr_clname[0]; - policy_name[1] = psi.pr_clname[1]; - /// num_process++; - return pid; - // thread Solaris10 -} - -static float getscaled(kstat_t *ks, const char *name) -{ - // load avgs are scaled by 256 - kstat_named_t *kn = (kstat_named_t *)kstat_data_lookup(ks, (char *)name); - return kn ? kn->value.ui32 * (1 / 256.0) : 0.0; -} - -void Proc::read_loadavg() -{ - kstat_chain_update(kc); - - kstat_t *ks = kstat_lookup(kc, (char *)"unix", 0, (char *)"system_misc"); - if (!ks || kstat_read(kc, ks, 0) == -1) - { - perror("kstat_lookup/read"); - exit(1); - } - - loadavg[0] = getscaled(ks, "avenrun_1min"); - loadavg[1] = getscaled(ks, "avenrun_5min"); - loadavg[2] = getscaled(ks, "avenrun_15min"); - - // we might as well get the boot time too since it's in the same kstat - // (not that it is going to change) - kstat_named_t *kn; - kn = (kstat_named_t *)kstat_data_lookup(ks, (char *)"boot_time"); - if (kn) - boot_time = kn->value.ui32; -} - -// read /proc -// called by Proc::fresh(); -int Proc::read_system() -{ - static bool first_run = true; - if (first_run) - { - flag_thread_ok = true; - - // memory info: this is easy - just use sysconf - mem_total = sysconf(_SC_PHYS_PAGES) << page_k_shift; - mem_free = sysconf(_SC_AVPHYS_PAGES) << page_k_shift; - - // Max SMP 1024 cpus . COMMON - int max_cpus = 1024; - // cpu_times_vec = (unsigned *)malloc(sizeof(unsigned) * - // num_cpus * - // CPUTIMES); - cpu_times_vec = new unsigned[CPUTIMES * max_cpus]; - old_cpu_times_vec = new unsigned[CPUTIMES * max_cpus]; - - // init - for (int cpu = 0; cpu < max_cpus; cpu++) - for (int i = 0; i < CPUTIMES; i++) - { - cpu_times(cpu, i) = 0; - old_cpu_times(cpu, i) = 0; - } - - /* - if(cpu_times_vec) - { - if(old_cpu_times_vec) free(old_cpu_times_vec); - old_cpu_times_vec = cpu_times_vec; - cpu_times_vec = (unsigned - *)malloc(sizeof(unsigned) * - num_cpus * CPUTIMES); - } - old_num_cpus = num_cpus; - */ - first_run = 0; - } - - // get swap info: somewhat trickier - we have to count all swap spaces - int nswaps = swapctl(SC_GETNSWP, 0); - swaptbl_t *st = - (swaptbl_t *)malloc(sizeof(int) + nswaps * sizeof(swapent_t)); - st->swt_n = nswaps; - // We are not interested in the paths, just the values, so we allocate - // one scratch buffer for all paths to keep swapctl happy. - char path_buf[PATH_MAX + 1]; - - for (int i = 0; i < nswaps; i++) - st->swt_ent[i].ste_path = path_buf; - swapctl(SC_LIST, st); - - // count the swap spaces - swap_total = swap_free = 0; - for (int i = 0; i < nswaps; i++) - { - swap_total += st->swt_ent[i].ste_pages; - swap_free += st->swt_ent[i].ste_free; - } - swap_total <<= page_k_shift; - swap_free <<= page_k_shift; - free(st); - - // cpu states: are stored as kstats named "cpu_statN", where N is the - // cpu number. Unfortunately, the cpu numbers are not guessable so we - // sweep the kstat chain for all of them, assuming (foolishly?) - // that they are in order. - - // kstat_chain_update(kc); - int cpu = 0; - - for (kstat_t *ks = kc->kc_chain; ks; ks = ks->ks_next) - { - // printf("kstat name :%s\n",ks->ks_name); - - if (strncmp(ks->ks_name, "cpu_stat", 8) == 0) - { - if (kstat_read(kc, ks, NULL) == -1) - { - perror("kstat_read"); - exit(1); - } - cpu_stat_t *cs = (cpu_stat_t *)ks->ks_data; - cpu_times(cpu, CPUTIME_USER) = cs->cpu_sysinfo.cpu[CPU_USER]; - cpu_times(cpu, CPUTIME_SYSTEM) = cs->cpu_sysinfo.cpu[CPU_KERNEL]; - cpu_times(cpu, CPUTIME_WAIT) = cs->cpu_sysinfo.cpu[CPU_WAIT]; - cpu_times(cpu, CPUTIME_IDLE) = cs->cpu_sysinfo.cpu[CPU_IDLE]; - - cpu++; - } - } - Proc::num_cpus = cpu; - - // exit(1); - dt_total = 0; - dt_used = 0; - - // dt_used= user + system; - // dt_total= user + system + nice + idle - // dt_used+=cpu_times(cpu, CPUTIME_USER) + cpu_times(cpu, - // CPUTIME_SYSTEM); - // dt_total=dt_used - - cpu_times(num_cpus, CPUTIME_USER) = 0; - cpu_times(num_cpus, CPUTIME_SYSTEM) = 0; - cpu_times(num_cpus, CPUTIME_WAIT) = 0; - cpu_times(num_cpus, CPUTIME_IDLE) = 0; - for (int cpu = 0; cpu < num_cpus; cpu++) - { - cpu_times(num_cpus, CPUTIME_USER) += cpu_times(cpu, CPUTIME_USER); - cpu_times(num_cpus, CPUTIME_SYSTEM) += cpu_times(cpu, CPUTIME_SYSTEM); - cpu_times(num_cpus, CPUTIME_WAIT) += cpu_times(cpu, CPUTIME_WAIT); - cpu_times(num_cpus, CPUTIME_IDLE) += cpu_times(cpu, CPUTIME_IDLE); - } - - cpu = num_cpus; - dt_used += - cpu_times(cpu, CPUTIME_USER) + cpu_times(cpu, CPUTIME_SYSTEM); // Kernel - dt_total += cpu_times(cpu, CPUTIME_USER) + cpu_times(cpu, CPUTIME_SYSTEM) + - cpu_times(cpu, CPUTIME_WAIT) + cpu_times(cpu, CPUTIME_IDLE); - - load_cpu = (float)Proc::dt_used / Proc::dt_total; - - // Hotplugging Detection : save total_cpu - if (Proc::num_cpus != Proc::old_num_cpus) - { - // for(int i = 0; i < CPUTIMES; i++) - // cpu_times(num_cpus, i) = - // cpu_times(Proc::old_num_cpus, i); - // Proc::old_num_cpus=Proc::num_cpus; - } -} - -int Procinfo::get_policy() -{ - if (policy == -1) - policy = sched_getscheduler(pid); - return policy; -} - -int Procinfo::get_rtprio() -{ - if (rtprio == -1) - { - struct sched_param p; - if (sched_getparam(pid, &p) == 0) - rtprio = p.sched_priority; - } - return rtprio; -} - -// called by bool Procinfo::read_fds() -void Procinfo::read_fd(int fdnum, char *path) -{ - struct stat sb; - - if (lstat(path, &sb) < 0) - { - // The file has been closed, or we could really not stat it - // despite - // having it open (could be a fd passed from another process). - fd_files.append(new Fileinfo(fdnum, "(no info available)")); - return; - } - // We could in principle find out more about the fd, such as its mode - // (RDONLY, RDWR etc) and flags, but it's messy. pfiles uses an agent - // lwp - // for this, but I don't know how to do it. - QString s; - const char *n; - switch (sb.st_mode & S_IFMT) - { - case S_IFCHR: - // if it is a tty, we might know its real name - if (sb.st_rdev != (dev_t)-1) - { - QString t = Ttystr::name(sb.st_rdev); - if (t[0] != '?') - { - s = "/dev/"; - s.append(t); - break; - } - } - s.sprintf("char device %u:%u", (unsigned)major(sb.st_rdev), - (unsigned)minor(sb.st_rdev)); - break; - - case S_IFBLK: - s.sprintf("block device %u:%u", (unsigned)major(sb.st_rdev), - (unsigned)minor(sb.st_rdev)); - break; - - case S_IFLNK: - // Directories appear as symlinks in /proc/#/fd; we chdir() to - // it - // and see where we end up. Not efficient though. - // Besides, we change cwd a lot in unpredictable ways. This - // makes - // core dumps hard to find, if they are generated at all. - s = "directory "; - if (chdir(path) >= 0) - { - char buf[512]; - if (getcwd(buf, sizeof(buf)) >= 0) - { - s.append(buf); - break; - } - } - s.append("(unknown)"); - break; - - default: - switch (sb.st_mode & S_IFMT) - { - case S_IFIFO: // fifo or anonymous pipe - n = "pipe"; - break; - case S_IFDIR: // this shouldn't happen - n = "directory"; - break; - case S_IFREG: - n = "file"; - break; - case S_IFSOCK: - n = "unix domain socket"; - break; - case S_IFDOOR: - n = "door"; - break; - default: - n = "unknown"; - break; - } - s.sprintf("%s, dev %u:%u inode %u", n, (unsigned)major(sb.st_dev), - (unsigned)minor(sb.st_dev), (unsigned)sb.st_ino); - break; - } - fd_files.append(new Fileinfo(fdnum, s)); -} - -// return TRUE if /proc/PID/fd could be read, FALSE otherwise -// store fileinfo, and also socket inodes separately -bool Procinfo::read_fds() -{ - char path[80], *p; - - sprintf(path, "%s/%d/fd", procdir, pid); - - DIR *d = opendir(path); - if (!d) - return FALSE; - - p = path + strlen(path) + 1; - p[-1] = '/'; - - struct dirent *e; - while ((e = readdir(d)) != 0) - { - if (e->d_name[0] == '.') - continue; // skip . and .. - strcpy(p, e->d_name); - int fdnum = atoi(p); - read_fd(fdnum, path); - } - closedir(d); - return TRUE; -} - -// return TRUE if the process environment could be read, FALSE otherwise -bool Procinfo::read_environ() -{ - int fd; - char file[128]; - - return 0; - - sprintf(file, "/proc/%d/as", pid); - if ((fd = open(file, O_RDONLY)) < 0) - return FALSE; - - // Just read the first 8K from the environment. Adaptive code here is - // possible, but not really worth the effort. - int bs = 8192; - if (envblock) - free(envblock); - envblock = (char *)malloc(bs); - if (pread(fd, envblock, bs, env_ofs) < 0) - { - free(envblock); - envblock = 0; - return FALSE; - } - close(fd); - envblock[bs - 1] = '\0'; - - /// environ.purge(); - - for (int i = 0; i * (int)sizeof(char *) < bs && ((char **)envblock)[i]; i++) - { - int b = ((char **)envblock)[i] - (char *)env_ofs; - if (b < 0 || b >= bs) - continue; // outside retrieved memory block - char *val = strchr(envblock + b, '='); - if (val) - *val++ = '\0'; - else - val = (char *)""; // degenerate: treat as name with - // empty value - make_printable(envblock + b); - make_printable(val); - environ.append(NameValue(envblock + b, val)); // ????? - } - return TRUE; -} - -// Try using /proc/bin/pmap to add file names to the memory map -void Procinfo::read_pmap_maps() -{ - char buf[256]; - - sprintf(buf, "/usr/proc/bin/pmap %d 2>/dev/null", pid); - - FILE *pmap = popen(buf, "r"); - if (!pmap) - return; - - // skip first line - if (!fgets(buf, sizeof buf, pmap)) - { - pclose(pmap); - return; - } - - int map_num = 0; - while (fgets(buf, sizeof buf, pmap)) - { - // Each output line from pmap looks like - //
K - // We use
and only to match with previously - // read - // map info, and only use here. - - unsigned long addr; - unsigned len; - int next; - char *p; - - if (sscanf(buf, "%lx %dK%n", &addr, &len, &next) != 2) - continue; - - // Correlate this with info already gathered. Assume they are in - // the - // same order (ascending by address). - Mapsinfo *mi; - int i = map_num; - while (i < maps.size() && (mi = maps[i])->from != addr) - i++; - // Mismatches can happen since changes can have taken place - // since - // we read the maps. If so, skip this mapping and try the next. - if (mi->to != addr + ((unsigned long)len << 10) || i == maps.size()) - continue; - map_num = i + 1; - - while (buf[next] == ' ') - next++; - while (buf[next] && buf[next] != ' ') - next++; - while (buf[next] == ' ') - next++; - // At this point we are looking at a file name, or at a - // suitable - // designator like [ heap ], [ anon ] or [ stack ]. Use it right - // away - // (after peeling off the newline) - int l = strlen(buf + next); - if (buf[next + l - 1] == '\n') - buf[next + l - 1] = '\0'; - mi->filename = buf + next; - } - - pclose(pmap); - return; -} - -// return TRUE if /proc/XX/map could be read, FALSE otherwise -bool Procinfo::read_maps() -{ - char name[128]; - sprintf(name, "%s/%d/map", procdir, pid); - - FILE *f = fopen(name, "r"); - if (!f) - return FALSE; - - prmap_t pm; - while (fread(&pm, sizeof(pm), 1, f) == 1) - { - Mapsinfo *mi = new Mapsinfo; - mi->from = pm.pr_vaddr; - mi->to = pm.pr_vaddr + pm.pr_size; - mi->offset = pm.pr_offset; - mi->perm[0] = pm.pr_mflags & MA_READ ? 'r' : '-'; - mi->perm[1] = pm.pr_mflags & MA_WRITE ? 'w' : '-'; - mi->perm[2] = pm.pr_mflags & MA_EXEC ? 'x' : '-'; - mi->perm[3] = pm.pr_mflags & MA_SHARED ? 's' : 'p'; - - if (pm.pr_mapname[0]) - { - // To find device/inode, stat the file in - // /proc/#/object: - char obj[128]; - sprintf(obj, "%s/%d/object/%s", procdir, pid, pm.pr_mapname); - struct stat sb; - if (lstat(obj, &sb) < 0) - { - delete mi; - continue; - } - mi->major = major(sb.st_dev); - mi->minor = minor(sb.st_dev); - mi->inode = sb.st_ino; - if (strcmp(pm.pr_mapname, "a.out") == 0) - mi->filename = "(executable)"; - } - else - { - mi->major = mi->minor = mi->inode = 0; - mi->filename = "(anonymous)"; - } - - maps.append(mi); - } - fclose(f); - - // If desired and possible, use /usr/proc/bin/pmap to get the - // names of the mapped files - static int myeuid = geteuid(); - if (Qps::use_pmap && (myeuid == 0 || myeuid == euid)) - read_pmap_maps(); - - return TRUE; -} - -Cat_dir::Cat_dir(const char *heading, const char *explain, const char *dirname, - QString Procinfo::*member) - : Cat_string(heading, explain), dir(dirname), cache(member) -{ -} - -QString Cat_dir::string(Procinfo *p) -{ - if ((p->*cache).isNull()) - { - char path[128], buf[512]; - sprintf(path, "/proc/%d/%s", p->pid, dir); - - // Either a Linux 2.0 link in [device]:inode form, or a Solaris - // link. - // To resolve it, we just chdir() to it and see where we end up. - // Perhaps we should change back later? - if (chdir(path) < 0) - { - p->*cache = "-"; // Most likely access denied - } - else - { - // getcwd() is fairly expensive, but this is cached - // anyway - if (!getcwd(buf, sizeof(buf))) - { - p->*cache = "(deleted)"; - } - else - p->*cache = buf; - } - } - return p->*cache; -} - -Cat_state::Cat_state(const char *heading, const char *explain) - : Category(heading, explain) -{ -} - -QString Cat_state::string(Procinfo *p) -{ - QString s(" "); - s[0] = p->state; - if (p->state == 'Z') - return s; - s[1] = (p->resident == 0 && p->state != 'Z') ? 'W' : ' '; - int ni = p->nice; - if (!Qps::normalize_nice) - ni -= NZERO; - s[2] = (ni > 0) ? 'N' : ((ni < 0) ? '<' : ' '); - return s; -} - -Cat_policy::Cat_policy(const char *heading, const char *explain) - : Category(heading, explain) -{ -} - -QString Cat_policy::string(Procinfo *p) -{ - QString s; - s = " "; - s[0] = p->policy_name[0]; - s[1] = p->policy_name[1]; - return s; -} - -int Cat_policy::compare(Procinfo *a, Procinfo *b) -{ - int r = b->policy_name[0] - a->policy_name[0]; - return r ? r : b->policy_name[1] - a->policy_name[1]; -} - -Cat_rtprio::Cat_rtprio(const char *heading, const char *explain) - : Category(heading, explain) -{ -} - -QString Cat_rtprio::string(Procinfo *p) -{ - QString s; - s.setNum(p->get_rtprio()); - return s; -} - -int Cat_rtprio::compare(Procinfo *a, Procinfo *b) -{ - return b->get_rtprio() - a->get_rtprio(); -} - -Cat_time::Cat_time(const char *heading, const char *explain) - : Category(heading, explain) -{ -} - -QString Cat_time::string(Procinfo *p) -{ - QString s; - int ticks = p->utime; - if (Procview::flag_cumulative) - ticks += p->cutime; - int t = ticks / HZ; // seconds - if (t < 10) - { - int hundreds = ticks / (HZ / 100) % 100; - s.sprintf("%1d.%02ds", t, hundreds); - } - else if (t < 100 * 60) - { - s.sprintf("%2d:%02d", t / 60, t % 60); - } - else if (t < 100 * 3600) - { - int h = t / 3600; - t %= 3600; - s.sprintf("%2d:%02dh", h, t / 60); - } - else - { - int d = t / 86400; - t %= 86400; - s.sprintf("%dd%dh", d, t / 3600); - } - return s; -} - -int Cat_time::compare(Procinfo *a, Procinfo *b) -{ - int at = a->utime, bt = b->utime; - if (Procview::flag_cumulative) - { - at += a->cutime; - bt += b->cutime; - } - return bt - at; -} - -Cat_tty::Cat_tty(const char *heading, const char *explain) - : Cat_string(heading, explain) -{ -} - -QString Cat_tty::string(Procinfo *p) { return Ttystr::name(p->tty); } - -Proc::Proc() -{ - - categories.insert(F_PID, - new Cat_int("PID", "Process ID", 6, &Procinfo::pid)); - categories.insert( - F_PPID, new Cat_int("PPID", "Parent process ID", 6, &Procinfo::ppid)); - categories.insert( - F_PGID, new Cat_int("PGID", "Process group ID", 6, &Procinfo::pgrp)); - categories.insert(F_SID, - new Cat_int("SID", "Session ID", 6, &Procinfo::session)); - categories.insert(F_TTY, new Cat_tty("TTY", "Controlling tty")); - categories.insert( - F_USER, new Cat_user("USER", "Owner (*=suid root, +=suid other user)")); - categories.insert(F_GROUP, - new Cat_group("GROUP", "Group name (*=sgid other)")); - categories.insert(F_UID, - new Cat_int("UID", "Real user ID", 6, &Procinfo::uid)); - categories.insert( - F_EUID, new Cat_int("EUID", "Effective user ID", 6, &Procinfo::euid)); - categories.insert(F_GID, - new Cat_int("GID", "Real group ID", 6, &Procinfo::gid)); - categories.insert( - F_EGID, new Cat_int("EGID", "Effective group ID", 6, &Procinfo::egid)); - categories.insert( - F_PRI, new Cat_int("PRI", "Dynamic priority", 4, &Procinfo::priority)); - categories.insert(F_NICE, - new Cat_int("NICE", - "Scheduling favour (higher -> less cpu time)", - 4, &Procinfo::nice)); - categories.insert(F_PLCY, new Cat_policy("PLCY", "Scheduling policy")); - categories.insert( - F_RPRI, - new Cat_rtprio("RPRI", "Realtime priority (0-99, more is better)")); - categories.insert(F_NLWP, - new Cat_int("NLWP", "Number of threads in process", 5, - &Procinfo::nthreads)); - categories.insert(F_ARCH, new Cat_int("ARCH", "Architecture (address bits)", - 2, &Procinfo::addr_bits)); - categories.insert(F_MAJFLT, - new Cat_uintl("MAJFLT", - "Number of major faults (disk access)", 8, - &Procinfo::majflt)); - categories.insert(F_MINFLT, - new Cat_uintl("MINFLT", - "Number of minor faults (no disk access)", - 8, &Procinfo::minflt)); - - // Memory - categories.insert(F_SIZE, - new Cat_memory("SIZE", - "Virtual image size of process in Kbytes", - 8, &Procinfo::size)); - categories.insert(F_SWAP, new Cat_swap("SWAP", "Kbytes on swap device")); - categories.insert( - F_RSS, - new Cat_memory("RSS", "Resident set size; Kbytes of program in memory", - 8, &Procinfo::resident)); - - categories.insert(F_STAT, new Cat_state("STAT", "State of the process")); - categories.insert(F_FLAGS, new Cat_hex("FLAGS", "Process flags (hex)", 9, - &Procinfo::flags)); - categories.insert( - F_WCHAN, - new Cat_wchan("WCHAN", "Kernel function where process is sleeping")); - - categories.insert( - F_WCPU, - new Cat_percent("%WCPU", "Weighted percentage of CPU (30 s average)", 6, - &Procinfo::wcpu)); - categories.insert( - F_CPU, - new Cat_percent(" %CPU", "Percentage of CPU used since last update", 6, - &Procinfo::pcpu)); - categories.insert( - F_MEM, - new Cat_percent(" %MEM", "Percentage of memory used (RSS/total mem)", 6, - &Procinfo::pmem)); - categories.insert(F_START, new Cat_start("START", "Time process started")); - categories.insert(F_TIME, - new Cat_time("TIME", "Total CPU time used since start")); - categories.insert(F_CPUNUM, - new Cat_int("CPU", "CPU the process is executing on", 3, - &Procinfo::which_cpu)); - categories.insert(F_CMD, new Cat_string("COMMAND", - "Command that started the process", - &Procinfo::command)); - categories.insert(F_CWD, new Cat_dir("CWD", "Current working directory", - "cwd", &Procinfo::cwd)); - categories.insert(F_ROOT, new Cat_dir("ROOT", "Root directory of process", - "root", &Procinfo::root)); - categories.insert(F_CMDLINE, - new Cat_cmdline("COMMAND_LINE", - "Command line that started the process")); - - commonPostInit(); - - Proc::init_static(); -} - -// update the process list -// called by void Proc::refresh() -void Proc::read_proc_all() -{ - - DIR *d = opendir(procdir); - struct dirent *e; - while ((e = readdir(d)) != 0) - { - if (e->d_name[0] >= '0' && e->d_name[0] <= '9') // good idea! - { - - /* if(flag_thread_ok && flag_show_thread) - read_pid_tasks(pid); - - */ - - Procinfo *pi; - int pid; - - pid = atoi(e->d_name); - - pi = procs.value(pid, NULL); // if not found pid then, return Null - - if (pi == NULL) // new process - { - pi = new Procinfo(this, pid); - procs.insert(pid, pi); - } - int ret = pi->readproc(); - if (ret > 0) - { - pi->generation = current_gen; // this process is alive - - // if(flag_show_thread and flag_thread_ok ) - // read_pid_tasks(pid); //for threads - - // add to History /// COMMONZ - if (ret == 2) - { - Procinfo *p = new Procinfo(*pi); // copy - p->clone = true; - hprocs->insert(pid, p); - } - } - else - { - // already gone. /proc/PID dead! - // later remove this process ! not yet - } - } - } - closedir(d); -} - -int Procview::custom_fields[] = {F_PID, F_TTY, F_USER, F_NICE, F_NLWP, - F_SIZE, F_RSS, F_STAT, F_CPU, F_START, - F_TIME, F_CMDLINE, F_END}; - -int Procview::basic_fields[] = {F_PID, F_TTY, F_USER, F_NICE, F_NLWP, - F_SIZE, F_RSS, F_STAT, F_CPU, F_START, - F_TIME, F_CMDLINE, F_END}; -int Procview::jobs_fields[] = {F_PID, F_PPID, F_PGID, F_SID, F_TTY, - F_STAT, F_UID, F_TIME, F_CMDLINE, F_END}; - -int Procview::mem_fields[] = {F_PID, F_TTY, F_MAJFLT, F_MINFLT, F_SIZE, - F_SWAP, F_RSS, F_CMDLINE, F_END}; - -void Procview::set_fields() -{ - switch (viewfields) - { - case USER: - set_fields_list(basic_fields); - break; - case JOBS: - set_fields_list(jobs_fields); - break; - case MEM: - set_fields_list(mem_fields); - break; - case CUSTOM: - set_fields_list(custom_fields); - break; - } -} - -// SOLARIS: -// deduce whether the currently selected fields correspond to a field list -void Procview::deduce_fields() -{ - return; - /* - if( viewfields != CUSTOM ) - return; - - Procview::fieldstates tags[3] = {USER, JOBS, MEM}; - int *lists[3] = {user_fields, jobs_fields, mem_fields}; - for( int i = 0; i < 3; i++ ) - { - int *l = lists[i]; - int j; - for( j = 0; l[j] != F_END; j++ ) - if( findCol(l[j]) < 0 ) - break; - if( l[j] == F_END && j == cats.size() ) - { - viewfields = tags[i]; - return; - } - } */ -} - -void check_system_requirement() {} - -bool Procinfo::isThread() -{ - return pid != tgid; // not a thread ! -} - -Proc::~Proc() {} diff --git a/src/pstable.cpp b/src/pstable.cpp deleted file mode 100644 index f46fae3..0000000 --- a/src/pstable.cpp +++ /dev/null @@ -1,603 +0,0 @@ -/* - * pstable.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -// ** toooo complex,so need new Design ... should be more simple.. (by -// fasthyun@magicn.com) - -#include "proc.h" -#include "pstable.h" -#include "misc.h" - -///#include -#include -#include -#include - -// When a subtree is folded away, selections inside it disappear to prevent -// unexpected behaviour -static void clear_subtree_selections(Procinfo *p) -{ - for (int i = 0; i < p->table_children.size(); i++) - { - Procinfo *c = p->table_children[i]; - c->selected = false; - clear_subtree_selections(c); - } -} - -// SLOT : -// connect(this, SIGNAL(titleClicked(int)), SLOT(setSortColumn(int))); -void Pstable::setSortColumn(int col) -{ - procview->setSortColumn(col, false); - setSortedCol(col); // void HeadedTable::setSortedCol(int col) - refresh(); // rebuild table -} - -// AWKWARD -// sync Procview and HeadedTable set sorted column of table to procview->sortcol -// called by 1. Pstable::moveCol(int col, int place) -void Pstable::set_sortcol() -{ - for (int i = 0; i < procview->cats.size(); i++) - { - if (procview->cats[i] == procview->sortcat) - { - HeadedTable::setSortedCol(i); // HeadedTable - return; - } - } - setSortedCol(-1); -} - -// for Optimization -int Pstable::sizeHintForColumn(int col) const -{ - // int aw=fontMetrics().averageCharWidth(); - int aw = fontMetrics().width("0"); - int cat_idx = procview->cats[col]->index; - // if(col==0) printf("col.idx=%d - // %s\n",cat_idx,procview->cats[col]->name); - switch (cat_idx) - { - // only COMMON Field - // case F_PID : - case F_RSS: - case F_SIZE: - case F_TTY: - return aw * 6; - case F_MEM: - case F_START: - case F_CPU: // PCPU - return aw * 6 + 2; - case F_TIME: - return aw * 5; - case F_WCPU: - case F_NICE: - return aw * 5; - case F_CMD: - return -(aw * 20); - - case F_USER: - // case F_USER : return aw*10; - case F_CMDLINE: - default: - return -1; - } - return -1; -} - -// inner -QString Pstable::title(int col) -{ - if (col >= procview->cats.size()) - { - qDebug("Qps Bug!: title() over col !! %d\n", col); - return ""; - } - return procview->cats[col]->name; -} - -// TESTING -void Pstable::overpaintCell(QPainter *p, int row, int col, int xpos) -{ - if (col != 0) - return; - if (procview->cats[col]->id != F_CMD) - return; - - int w; - - Procinfo *pi = procview->linear_procs[row]; - - int n = pi->nthreads; - if (n == 1) - return; -#ifdef LINUX - if (pi->pid != pi->tgid) - return; // LINUX - -#endif - w = p->fontMetrics().width(text(row, col)); - - QFont font = p->font(); - int size = font.pointSize(); // point size - - if (size <= 0) - return; // saver! - - int h = body->cellHeight(); - h = p->fontMetrics().height(); // return pixel - - int msize = h * 3.0 / 8.0; - // printf("DEBUG: height=%d, msize=%d\n",h,msize); - - if (h <= 11) - return; // saver! - - if (msize < 6) - msize = 6; - - // font.setPointSize(msize); // not pixel! - font.setPixelSize(msize); // not pixel! - p->setFont(font); - p->drawText(xpos + w + 2, msize + msize / 3, QString::number(n)); - font.setPointSize(size); - p->setFont(font); -} -// -QString Pstable::text(int row, int col) -{ - if (col >= procview->cats.size()) - { - qDebug("Qps Bug!: text() over col !! %d\n", col); - return ""; - } - return procview->cats[col]->string(procview->linear_procs[row]); -} - -int Pstable::totalRow() //??? -{ - return procview->linear_procs.size(); -} - -int Pstable::colWidth(int col) -{ - // this is -1 for variable width fields, htable keeps track of it - if (col >= procview->cats.size()) - { - qDebug("Qps Bug!: colWidth() over col !! %d\n", col); - return -1; - } - return procview->cats[col]->width(); -} - -int Pstable::alignment(int col) -{ - // qDebug("debug:alignment()\n"); - Category *cat = procview->cats[col]; - return cat->alignment(); -} - -// virtual of HeadedTable -void Pstable::setSelected(int row, bool flag) -{ - /// qDebug("debug:Pstable::setSelected()\n"); - Procinfo *pi = procview->linear_procs[row]; - if (pi->selected != flag) - { - pi->selected = flag; - // body->repaintRow(row); // TEMP trick.. - } -} - -// virtual -bool Pstable::isSelected(int row) -{ - Procinfo *pi = procview->linear_procs[row]; - return pi->selected; // VALGRIND -} - -int Pstable::rowDepth(int row) -{ - Procinfo *pi = procview->linear_procs[row]; - if (pi) - return pi->level; // VALGRIND segfault - - qDebug("Qps bug: over row %d!!!\n", row); - return 0; -} - -bool Pstable::lastChild(int row) -{ - Procinfo *pi = procview->linear_procs[row]; - if (pi) - return pi->lastchild; - qDebug("Qps bug: over row %d!!!\n", row); - return 0; -} - -// Segfault !!!! -// return not PPID ! just virtual parent in tree -int Pstable::parentRow(int row) -{ - return procview->linear_procs[row]->parent_row; - /* int ppid= procview->linear_procs[row]->ppid; - Procinfo *pi= procview->getProcinfoByPID(ppid); - if(pi) return ppid; - else return -1; */ -} - -// DRAFT tooltip -QString Pstable::tipText(int col) -{ - Category *cat = procview->cats[col]; - QString s(cat->help); - // trick - if (cat->index == F_STAT) - s.append("\n(R =Running, S =Sleeping, T =sTopped, Z=Zombie)"); - if (cat->index == F_PLCY) - s.append("\n(TS =Time Sharing)"); - // if(cat->index == F_RSS); - // s.append("\nRSS = CODE + DATA + SHARE\n" - // "RSS = TRS + DRS + SHARE\n"); - /// s.append("\n(RSS = TRS + DRS)"); - if (cat == procview->sortcat) - s.append(procview->reversed ? "\n(sorted backwards)" : "\n(sorted)"); - - // printf("size=%d\n",s.capacity()); - return s; -} - -void Pstable::showTip(QPoint p, int idx) -{ - QToolTip::showText(p, tipText(idx)); -} - -extern TFrame *infobox; // testing - -// SLOT -void Pstable::mouseOutOfCell() { infobox->hide(); } - -// TEST -void Pstable::mouseOnCell(int row, int col) -{ - // printf("cursor on (%d,%d)\n",row,col); - - Category *cat = procview->cats[col]; - QString s = ""; - - return; - - // below TEST code! - if (cat->index == F_USER) - { - Procinfo *pi = procview->linear_procs[row]; - s = pi->username; - } - else - { - infobox->hide(); - return; - } - - if (infobox != NULL) - { - // p.setY(p.y() + geometry().y()); - // p.setY(QCursor::pos().y() - geometry().y()); - // p.setY(QCursor::pos().y() - frameGeometry().y()); - // p.setX(QCursor::pos().x() - frameGeometry().x()); - // QPoint p=QCursor::pos(); - // if(htable->numSelected()>=2) - - infobox->show(); - infobox->setPos(); - if (s > 0) - { - infobox->setText(s); - } - else - infobox->hide(); - } - - // char *str=htable->total_selectedRow(col); -} - -void Pstable::leaveEvent(QEvent *) {} - -// DRAFT who call? -// void TableBody::mouseMoveEvent(QMouseEvent *e) -char *Pstable::total_selectedRow(int col) -{ - static char buff[48]; - char mem_str[48]; - std::string name; - int index; - - if (procview->cats.size() <= col or col < 0) - return 0; // col == -1 - index = procview->cats[col]->index; - - switch (index) - { - case F_SIZE: - name = "total SIZE: "; - break; - case F_RSS: - name = "total RSS: "; - break; -#ifdef LINUX - case F_TRS: - name = "total Text: "; - break; - case F_DRS: - name = "total Data: "; - break; - case F_STACK: - name = "total STACK: "; - break; -#endif - default: - return 0; - } - - int total = 0; - int rows = procview->linear_procs.size(); - for (int i = 0; i < rows; i++) - if (procview->linear_procs[i]->selected) - { - switch (index) - { - case F_SIZE: - total += procview->linear_procs[i]->size; - break; - case F_RSS: - total += procview->linear_procs[i]->resident; - break; -#ifdef LINUX - case F_TRS: - total += procview->linear_procs[i]->trs; - break; - case F_DRS: - total += procview->linear_procs[i]->drs; - break; - case F_STACK: - total += procview->linear_procs[i]->stack; - break; -#endif - } - } - - mem_string(total, mem_str); // misc.h - strcpy(buff, name.c_str()); - strcat(buff, mem_str); - // sqDebug(buff,"total:%s",total); - return buff; -} - -// col -// colMoved(col, place); -Pstable::Pstable(QWidget *parent, Procview *pv) : HeadedTable(parent, 0) -{ - procview = pv; - // connect(this, SIGNAL(selectionChanged(const Svec - //*)),SLOT(selection_update(const Svec *))); //DEL? - // connect(this, - // SIGNAL(selectionChanged()),SLOT(selection_update())); // - // when procinfo clicked - connect(this, SIGNAL(titleClicked(int)), SLOT(setSortColumn(int))); - connect(this, SIGNAL(foldSubTree(int)), SLOT(subtree_folded(int))); - connect(head, SIGNAL(toolTip(QPoint, int)), this, - SLOT(showTip(QPoint, int))); - connect(this, SIGNAL(flyOnCell(int, int)), SLOT(mouseOnCell(int, int))); - connect(this, SIGNAL(outOfCell()), SLOT(mouseOutOfCell())); -} - -// who call this ? : from qps.cpp -void Pstable::setProcview(Procview *pv) { procview = pv; } - -HeadedTable::NodeState Pstable::folded(int row) -{ - Procinfo *p = procview->linear_procs[row]; - return (p->table_children.size() > 0) ? (p->hidekids ? Closed : Open) - : Leaf; -} - -// slot: called when selection changes -// called by -// 1.void HeadedTable::selectionNotify() -/* -void Pstable::selection_update(const Svec *rows) -{ - //CLIPBOARD - qDebug("debug:selection_update()\n"); - for(int i = 0; i < rows->size(); i++) { - int row = (*rows)[i]; - procview->linear_procs[row]->selected = isSelected(row); // -WRONG !!! - } - - qps->update_menu_selection_status(); - - if(numSelected() > 0 && qps->pids_to_selection) { - // set the X11 selection to "PID1 PID2 PID3 ..." - QString s, num; - int n = numRows(); - for(int i = 0; i < n; i++) { - if(isSelected(i)) { - num.setNum(procview->linear_procs[i]->pid); - s.append(num); - if(i < n - 1) - s.append(" "); - } - } - - // important: this mustn't be called non-interactively since Qt -uses - // the selection time of the last mouse or keyboard event -//// QApplication::clipboard()->setText(s); - } - -} */ - -// call by -// 1.void Qps::set_table_mode(bool treemode) -// slot: changes table mode -void Pstable::setTreeMode(bool treemode) -{ - // qDebug("Pstable::setTreeMode() %d , procview.treeview - // =%d\n",treemode,procview->treeview); - // no more HeadedTable::setTreeMode(treemode); - HeadedTable::setTreeMode(treemode); - procview->treeview = treemode; - procview->fieldArrange(); - set_sortcol(); - refresh(); //==rebuild(); -} - -// -bool Pstable::columnMovable(int col) -{ - if (treemode) - { - if (col == 0) - return false; - } - if (procview->cats[col]->index == F_CMDLINE) - return false; - - return true; -} - -// called by HeadedTable -// Description : FIELD movement by mouse drag to place From col -// virtual HeadedTable::moveCol(col,place); -void Pstable::moveCol(int col, int place) -{ - // qDebug("Pstable::moveCol\n"); - procview->moveColumn(col, place); - set_sortcol(); //??? - procview->fieldArrange(); - // update(); - refresh(); // width size changed ,... - return; - // updateColWidth(place); updateColWidth(col);// TEMP -} - -// NEED Check !! -// Slot: called when a subtree is opened or closed -// row = row number of sheet -void Pstable::subtree_folded(int row) -{ - - Procinfo *p = procview->linear_procs[row]; - p->hidekids = !p->hidekids; - - if (p->hidekids) - clear_subtree_selections(p); // *** important - - refresh(); // tree rebuild only - return; - // ??? - Procinfo *nextp = - (row < numRows() - 1) ? procview->linear_procs[row + 1] : 0; - if (!p->hidekids) - { - // Show as much as possible of the opened subtree - int r = row + 1; - while (r < numRows() && procview->linear_procs[r] != nextp) - r++; - // setAutoUpdate(FALSE); - showRange(row, r - 1); - // setAutoUpdate(TRUE); - } - // This is a stopgap solution; it would be better to have htable - // take care of the hiding of subtrees and repaint only the rows under - // the line hidden -} - -// DRAFT CODE: -// 1.procview->refresh: proc.refresh, rebuild -// 2.resetwidth -// 3.repaint - -// called by -// 1.void Qps::refresh() -void STATUSBAR_SETCOUNT(int n); - -static int kgen = 123; -void Pstable::checkTableModel() -{ - // int size=procview->linear_procs.size(); - // if(size!=numRows()) - { - // printf("Warnning: this is the bug.. wrong! %d - //%d\n",size,numRows()); - } - if (procview->current_gen != kgen) - { - // printf("Warnning: maybe this is the bug.. wrong! - //%d - //%d\n",kgen,procview->current_gen); - // setAutoUpdate(false); // ********** important for - // GUI-thread - // HeadedTable::setTreeMode(procview->treeview); - procview->rebuild(); // for Table - setNumRows(procview->linear_procs.size()); // 1. - // qDebug("Pstable setTreeMode =%d , procview.treeview - //=%d\n",treemode,procview->treeview); - setNumCols(procview->cats.size()); // 2. resetWidths() - kgen = procview->current_gen; - // setAutoUpdate(true); - } -} - -// paintEvent(); - -void Pstable::refresh() -{ - // qDebug("Pstable:refresh()"); - // procview->refresh(); -> move to Qps::refresh() - // qDebug("catsize=%d\n",procview->cats.size()); - procview->rebuild(); // for Table - setNumRows(procview->linear_procs.size()); // 1. - setNumCols(procview->cats.size()); // 2. resetWidths() UNINITIAL - kgen = procview->current_gen; - // checkTableModel(); - repaint_changed(); - - /* - if(true) - { - int count=0,trow=0; - for(int row = 0; row < nrows; row++) - if(isSelected(row)) - { - count++; - trow=row; - } - if (count == 1) - centerVertically(trow); - } */ - - STATUSBAR_SETCOUNT(procview->num_process); -} diff --git a/src/pstable.h b/src/pstable.h deleted file mode 100644 index 2d256ef..0000000 --- a/src/pstable.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * pstable.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef PSTABLE_H -#define PSTABLE_H - -#include "proc.h" -#include "htable.h" - -class Pstable : public HeadedTable -{ - Q_OBJECT - public: - Pstable(QWidget *parent, Procview *pv); - - void set_sortcol(); - void setProcview(Procview *pv); - virtual void moveCol(int col, int place); - void refresh(); - - // called by super - bool hasSelection() { return 0; }; - - virtual bool isSelected(int row); - virtual void setSelected(int row, bool sel); - virtual int totalRow(); - virtual void checkTableModel(); - - public slots: - // void selection_update(const Svec *row); - void setSortColumn(int col); - void subtree_folded(int row); - void showTip(QPoint p, int index); - void setTreeMode(bool treemode); - void mouseOnCell(int row, int col); - void mouseOutOfCell(); - - protected: - // implementation of the interface to HeadedTable - virtual QString title(int col); - virtual QString text(int row, int col); - virtual int colWidth(int col); - virtual int alignment(int col); - virtual QString tipText(int col); - virtual int rowDepth(int row); - virtual NodeState folded(int row); - virtual int parentRow(int row); - virtual bool lastChild(int row); - virtual char *total_selectedRow(int col); - virtual int sizeHintForColumn(int col) const; - virtual bool columnMovable(int col); - - virtual void overpaintCell(QPainter *p, int row, int col, int xpos); - // virtual bool hasChildren(int row); - - virtual void leaveEvent(QEvent *); - - private: - Procview *procview; -}; - -#endif // PSTABLE_H diff --git a/src/pstable2.cpp b/src/pstable2.cpp deleted file mode 100644 index 76f374e..0000000 --- a/src/pstable2.cpp +++ /dev/null @@ -1,513 +0,0 @@ -/* - * pstable2.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 2014 dae hyun, yang - * Copyright 2015 Paulo Lieuthier - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include "pstable2.h" -int flag_x = 0; -PstableModel::PstableModel(QObject *parent, Procview *pv) : HtableModel(parent) -{ - procview = pv; -} - -QModelIndex PstableModel::index(int row, int col, - const QModelIndex &parent) const -{ - if (flag_x) - printf("index(): row=%d col=%d parent(%d %d)\n", row, col, - parent.row(), parent.column()); - // if(row<0 or column<0) // root? - // return QModelIndex(); - Procinfo *pi; - - if (col < 0 or col >= procview->cats.size()) - return QModelIndex(); - // qFatal("Qps::Pstable2::sizeHintForColumn() Bug!: over col !! - // %d\n",col); - if (parent == QModelIndex()) - { - if (row >= 0 and row < procview->root_procs.size()) - { - Procinfo *pi = procview->root_procs[row]; // NULL possible!! - return createIndex(row, col, pi); - } - else - printf("out of row %d", row); // ??????????????????? - } - - if (parent.isValid()) - { - - Procinfo *ppi = static_cast(parent.internalPointer()); - - if (ppi and row < ppi->table_children.size() and row >= 0) - { - Procinfo *pi = ppi->table_children[row]; - return createIndex(row, col, pi); - } - } - printf(" indeX() error\n"); - // qFatal("Error : index() row=%d ",row); - return QModelIndex(); -} - -// Pure Virtual -QModelIndex PstableModel::parent(const QModelIndex &child) const -{ - // wrong parent makes segfault - // return QModelIndex(); - // printf("parent() ! %d %d\n",child.row(),child.column()); - if (child.isValid()) - { - Procinfo *pi = static_cast(child.internalPointer()); - // if (pi==NULL or pi->level==0 )//or pi->parent_row<0) - if (pi->level < 1) // or pi->parent_row<0) - { - // printf("root , pid=%d ppid=%d - //\n",pi->pid,pi->ppid); - return QModelIndex(); - } - - // parent_row == -1 segfault - Procinfo *ppi = procview->procs.value(pi->ppid, 0); /// - if (ppi == NULL) - printf("error xxxxxxxxxxxx\n"); - // if(pi->ppid==2608) printf("parent_row=%d - // ppid=%d\n",pi->parent_row,pi->ppid); - // Procinfo *ppi=procview->linear_procs[pi->parent_row]; - // if (pi->ppid==0 or ppi==NULL)// or !procview->treeview) - ////if(flag_x) printf("parent : pid=%d (row=%d - /// ppid=%d)\n",pi->pid,ppi->table_child_seq,ppi->pid); - return createIndex(ppi->table_child_seq, 0, ppi); - // return createIndex(0 , 0 ,ppi); - } - printf("parent() Invalud\n"); - return QModelIndex(); // no parent! - - // if(row>=0 and col>=0 and rownrows) - // return createIndex(htable->parentRow(row),col,NULL); -} - -int PstableModel::columnCount(const QModelIndex &parent) const -{ - if (parent.column() > 0) - return 0; - // printf("columnCount() size=%d\n" ,procview->cats.size()); - return procview->cats.size(); -} - -// pure virtual: return chilren count -int PstableModel::rowCount(const QModelIndex &parent) const -{ - if (parent.column() > 0) - return 0; - - int count = 0; - if (parent == QModelIndex()) - { - count = procview->root_procs.size(); - // printf("rowCount() root_procs size=%d\n" - //,count); - } - else - { - Procinfo *pi = static_cast(parent.internalPointer()); - count = pi->table_children.size(); - } - // printf("rowCount (%d %d), - //%d\n",parent.row(),parent.column(),count); - // if(pi->table_children.size()>0) - // htable->setExpanded(index,false); - // if(count>0) htable->setExpanded(parent,false); - // if(count>0) htable->expand(parent); - return count; -} - -bool PstableModel::hasChildren(const QModelIndex &parent) const -{ - int count; - if (parent.column() > 0) - return false; - return rowCount(parent); -} - -QVariant PstableModel::data(const QModelIndex &index, int role) const -{ - // printf("data\n"); - Procinfo *pi = static_cast(index.internalPointer()); - int col = index.column(); - - if (role == Qt::DisplayRole) - { - // if(pi->child_seq_prev>=0 and pi->child_seq!=index.row()) - // printf("========= not equal row =====\n"); - return procview->cats[index.column()]->string(pi); - // returhtable->text(index.row(),index.column()); - } - else if (role == Qt::DecorationRole) - { - } - else if (role == Qt::EditRole) - { - } - else if (role == Qt::CheckStateRole) - { - // if(item->enable) - // return Qt::Checked; - // else - // return Qt::Unchecked; - } - else if (role == Qt::TextAlignmentRole) - { - Category *cat = procview->cats[index.column()]; - return cat->alignment(); - } - if (role == Qt::EditRole) - { - } - else if (role == Qt::BackgroundColorRole) - { - } - else if (role == Qt::SizeHintRole) - { - // return QSize(18,18); - } - return QVariant(); -} -// MOVE TO Procview -// slot: called when a title is clicked - -// void Pstable::set_sortcol() -// setSortedCol(i); -// connect(header(), SIGNAL(sectionPressed( int )),SLOT(setSortColumn(int ))); -void Pstable2::setSortColumn(int col) -{ - // col=-1 no section - if (col < 0 or col >= procview->cats.size()) - return; - // qFatal("Qps::Pstable2::setSortColumn() Bug!: over col !! %d\n",col); - // printf("setSortColumn()\n"); - procview->setSortColumn(col, false); - setSortedCol(col); // void HeadedTable::setSortedCol(int col) - refresh(); // no redraw - model->update(); -} - -// sync Procview and HeadedTable -// set sorted column of table to procview->sortcol -void Pstable2::set_sortcol() -{ - for (int i = 0; i < procview->cats.size(); i++) - { - if (procview->cats[i] == procview->sortcat) - { - setSortedCol(i); // HeadedTable - return; - } - } - setSortedCol(-1); -} - -// for Speed Optimize -int Pstable2::sizeHintForColumn(int col) const -{ - if (col < 0 or col >= procview->cats.size()) - qFatal("Qps::Pstable2::sizeHintForColumn() Bug!: over col !! %d\n", - col); - // int aw=fontMetrics().averageCharWidth(); - int aw = fontMetrics().width("0"); - // int title_witdh=fontMetrics().width(procview->cats[col]->name); - // static int z5=fontMetrics ().width("00000"); - // static int z6=fontMetrics ().width("000000"); - int cat_id = procview->cats[col]->index; - switch (cat_id) - { - // only COMMON Field - // case F_PID : - case F_RSS: - case F_NICE: - case F_SIZE: - case F_TIME: - return aw * 6; - case F_TTY: - case F_MEM: - case F_CPU: - // return aw*7; - return fontMetrics().width("%MEM") + 10; - case F_WCPU: - return fontMetrics().width("%WCPU") + 10; - // return aw*4; - case F_USER: - case F_CMD: - // case F_CMDLINE: return 300; - default: - return QTreeView::sizeHintForColumn(col); - // return HeadedTable::sizeHintForColumn(col); - // QTreeView::resizeColumnToContents (col); - return -1; - ; - } - return -1; -} - -// inner -QString Pstable2::title(int col) -{ - if (col < 0 or col >= procview->cats.size()) - { - qFatal("Qps::Pstable2::title(): Bug! over col !! %d\n", col); - return ""; - } - return procview->cats[col]->name; -} - -QString Pstable2::text(int row, int col) // not called -{ - if (col < 0 or col >= procview->cats.size()) - qFatal("Qps::Pstable2::text() Bug!: over col !! %d\n", col); - - return procview->cats[col]->string(procview->linear_procs[row]); -} - -int Pstable2::totalRow() //??? -{ - return procview->linear_procs.size(); -} - -int Pstable2::colWidth(int col) -{ - if (col < 0 or col >= procview->cats.size()) - qFatal("Qps::Pstable2::colWidth() Bug!: over col !! %d\n", col); - /// return 30; - // this is -1 for variable width fields, htable keeps track of it - return procview->cats[col]->width(); -} - -int Pstable2::alignment(int col) -{ - if (col < 0 or col >= procview->cats.size()) - qFatal("Qps::Pstable2::alignment() Bug!: over col !! %d\n", col); - // printf("debug:alignment()\n"); - Category *cat = procview->cats[col]; - return cat->alignment(); -} - -// virtual of HeadedTable -void Pstable2::setSelected(int row, bool sel) -{ - /// printf("debug:setSelected()\n"); - Procinfo *pi = procview->linear_procs[row]; - if (pi->selected != sel) - { - pi->selected = sel; - // body->repaintRow(row); // TEMP trick.. - } -} - -// virtual -bool Pstable2::isSelected(int row) -{ - Procinfo *pi = procview->linear_procs[row]; - return pi->selected; -} - -int Pstable2::rowDepth(int row) -{ - // if(row < procview->linear_procs.size()) - Procinfo *pi = procview->linear_procs[row]; - if (pi) - return pi->level; - - printf("Qps bug: over row %d!!!\n", row); - return 0; -} - -bool Pstable2::lastChild(int row) -{ - Procinfo *pi = procview->linear_procs[row]; - if (pi) - return pi->lastchild; - printf("Qps bug: over row %d!!!\n", row); - return 0; -} - -/* -int Pstable2::childCount(int row) -{ - return procview->linear_procs[row]->table_children.size(); - //and !p->hidekids) -} */ - -// Segfault !!!! -// return not PPID ! just virtual parent in tree -int Pstable2::parentRow(int row) -{ - return procview->linear_procs[row]->parent_row; - /* int ppid= procview->linear_procs[row]->ppid; - Procinfo *pi= procview->getProcinfoByPID(ppid); - if(pi) return ppid; - else return -1; */ -} - -// DRAFT -QString Pstable2::tipText(int col) -{ - Category *cat = procview->cats[col]; - QString s(cat->help); - - // trick - if (cat->index == F_STAT) - s.append("\n(R =Running, S =Sleeping, T =sTopped, Z=Zombie)"); - if (cat->index == F_PLCY) - s.append("\n(TS =Time Sharing)"); - if (cat->index == F_RSS) - ; - // s.append("\nRSS = CODE + DATA + SHARE\n" - // "RSS = TRS + DRS + SHARE\n"); - /// s.append("\n(RSS = TRS + DRS)"); - if (cat == procview->sortcat) - s.append(procview->reversed ? "\n(sorted backwards)" : "\n(sorted)"); - return s; -} - -// DRAFT who call? -char *Pstable2::total_selectedRow(int col) { return 0; } - -Pstable2::Pstable2(QWidget *parent, Procview *pv) : HeadedTable2(parent, 0) -{ - printf("read 3-2\n"); - procview = pv; - model = new PstableModel(this, pv); - setModel(model); - // activate() double click - // pressed() one click - // entered() drag - // connect(this, SIGNAL(activated ( const QModelIndex & - // )),SLOT(selection_update(const QModelIndex&))); - connect(this, SIGNAL(pressed(const QModelIndex &)), - SLOT(selection_update(const QModelIndex &))); - // connect(header(), SIGNAL(sectionClicked( int - //)),SLOT(setSortColumn(int - //))); - connect(header(), SIGNAL(sectionPressed(int)), SLOT(setSortColumn(int))); - // connect(this, SIGNAL(titleClicked(int)), - // SLOT(setSortColumn(int))); - - printf("read 3-3\n"); - // modelIterate(rootIndex()); - // modelIterate(QModelIndex()); - // update(QModelIndex()); - // reset(); - // expandAll(); - // reset(); - printf("read 3-4\n"); -} - -// who call this ? : from qps.cpp -void Pstable2::setProcview(Procview *pv) { procview = pv; } - -HeadedTable2::NodeState Pstable2::folded(int row) -{ - Procinfo *p = procview->linear_procs[row]; - return (p->table_children.size() > 0) ? (p->hidekids ? Closed : Open) - : Leaf; -} - -// slot: called when selection changes -// called by -void Pstable2::selection_update(const QModelIndex &idx) -{ - QModelIndexList list = selectionModel()->selectedRows(); - printf("debug:selection_update()\n"); - // qps->update_menu_selection_status(); -} - -// slot: changes table mode -// call by -// 1.void Qps::set_table_mode(bool treemode) -void Pstable2::setTreeMode(bool treemode) -{ - /// printf("Pstable setTreeMode\n"); - procview->treeview = treemode; - procview->fieldArrange(); - set_sortcol(); - HeadedTable2::setTreeMode(treemode); - Pstable2::refresh(); - if (treemode) - setRootIsDecorated(true); - else - setRootIsDecorated(false); - - reset(); - expandAll(); - // model->update(); //SEGFAULT - // rebuild(); -} - -bool Pstable2::columnMovable(int col) -{ - if (treemode) - { - if (col == 0) - return false; - } - if (procview->cats[col]->index == F_CMDLINE) - return false; - - return true; -} - -// called by HeadedTable -// Description : FIELD movement by mouse drag -// To place From col -// virtual HeadedTable::moveCol(col,place); -void Pstable2::moveCol(int col, int place) -{ - // printf("Pstable::moveCol\n"); - procview->moveColumn(col, place); - set_sortcol(); - // update(); - refresh(); // width size changed ,... -} - -// DRAFT CODE: -// 1.procview->refresh: proc.refresh, rebuild -// 2.resetwidth -// 3.repaint - -// called by -// 1.void Qps::refresh() -void Pstable2::refresh() -{ - printf("Pstable2:refresh()\n"); - procview->rebuild(); // for Table - setNumCols(procview->cats.size()); // 2. resetWidths() - setNumRows(procview->linear_procs.size()); // 1. - // printf("catsize=%d - // row=%d\n",procview->cats.size(),procview->linear_procs.size()); - // update(); - // update(QModelIndex()); - // repaint(); - // repaint_changed(); - // model->revert(); //temp - // model->submit(); //temp - // model->update(); -} diff --git a/src/pstable2.h b/src/pstable2.h deleted file mode 100644 index c46fcc7..0000000 --- a/src/pstable2.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * pstable2.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 2014 dae hyun, yang - * Copyright 2015 Paulo Lieuthier - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include "proc.h" -#include "htable2.h" -#include - -class PstableModel : public HtableModel -{ - Q_OBJECT - public: - PstableModel(QObject *parent, Procview *procview); - ~PstableModel(){}; - virtual QModelIndex index(int row, int column, - const QModelIndex &parent = QModelIndex()) const; - virtual QModelIndex parent(const QModelIndex &child) const; // pure virtual - virtual int rowCount(const QModelIndex &parent) const; - virtual int columnCount(const QModelIndex &parent) const; - virtual QVariant data(const QModelIndex &index, int role) const; - virtual bool hasChildren(const QModelIndex &parent = QModelIndex()) const; - // int columnCount(const QModelIndex &parent) const; - // HeadedTable2 *htable; - Procview *procview; -}; - -class Pstable2 : public HeadedTable2 -{ - Q_OBJECT - public: - Pstable2(QWidget *parent, Procview *pv); - - void set_sortcol(); - void setProcview(Procview *pv); - void setTreeMode(bool treemode); - virtual void moveCol(int col, int place); - void refresh(); - - // called by super - bool hasSelection() { return selectionModel()->hasSelection(); }; - - virtual bool isSelected(int row); // hmm - virtual void setSelected(int row, bool sel); - virtual int totalRow(); // DEL? - - public slots: - void selection_update(const QModelIndex &); // hmm - void setSortColumn(int col); - -signals: - void selection_changed(); - - protected: - // implementation of the interface to HeadedTable - virtual QString title(int col); // ok - virtual QString text(int row, int col); // ok - virtual int colWidth(int col); - virtual int alignment(int col); // ok - virtual QString tipText(int col); // ok - - virtual int rowDepth(int row); - virtual NodeState folded(int row); - virtual int parentRow(int row); - virtual bool lastChild(int row); - virtual char *total_selectedRow(int col); - virtual int sizeHintForColumn(int col) const; - virtual bool columnMovable(int col); - - // virtual void drawCellContents(int row, int col, int w, int h, - // QPainter *p); - - private: - Procview *procview; -}; diff --git a/src/qps.cpp b/src/qps.cpp deleted file mode 100644 index cb8dda2..0000000 --- a/src/qps.cpp +++ /dev/null @@ -1,2473 +0,0 @@ -/* - * qps.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * Copyright 2005-2012 fasthyun@magicn.com - * Copyright 2015- daehyun.yang@gmail.com - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -// TODO & MEMO -/* - * - * For easy maintance - * 1. F_CMDLINE should be rightmost field - * 2. F_PROCESSNAME shoud be leftmost field and NEVER removed! - * - */ - -// . Memory Hole or Qt's string allocate bug? -// . clipboard copy [CMDLINE,PID,USERNAME...] -// . [klog] table cache. -// . save sort of tree, linear -// . watchdog showmsg substitude -// . history system -// . cmd [w] analsys: [IDLE] [WHAT] -// . ExecWindow - [running] finish. -// . UNIX Domain SOCKET -// . COLOR : orange FF5d00 -// . P_MEM -> P_%MEM or P_PMEM - -#include "../icon/icon.xpm" - -#include -#include -#include -#include -#include -#include -#include // uname -#include -#include -#include -#include //for sleep - -#include "qps.h" -#include "qpsapp.h" -#include "dialogs.h" -#include "commanddialog.h" -#include "commandutils.h" -#include "watchcond.h" -#include "watchdogdialog.h" -#include "lookup.h" -#include "misc.h" - -#ifndef USING_PCH -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif - -#include -#include -/* --------------------- Global Variable START ---------------------- */ -QList commands; - -bool previous_flag_show_thread_prev = false; // previous state -bool flag_show_thread = false; // to see informations at the thread level -int flag_thread_ok = true; // we presume a kernel 2.6.x using NPTL -bool flag_session_start = false; -bool flag_start_mini = false; // Need for Xorg.Session -bool flag_refresh = true; // DEL -bool flag_xcompmgr = false; // DEL test.compiz.. -bool flag_devel = false; -bool flag_schedstat = false; -bool flag_smallscreen = false; -bool flag_firstRun = true; // test - -Qps *qps; -// ControlBar *controlbar=NULL; -SearchBox *search_box = NULL; -TFrame *infobox = NULL; // testing -// DEL Screenshot *screenshot=NULL; -QFontComboBox *font_cb = NULL; -WatchdogDialog *watchdogDialog = NULL; - -/// PDisplay *pdisplay; - -QList proclist; - -#include "trayicon.h" -TrayIcon *trayicon = NULL; - -// for Non-ASCII Languages (CJK:chinese,japanese,korean, arabic ...) -#include -QTextCodec *codec = NULL; -#define UniString(str) str // codec->toUnicode(str) -/* ------------------------ END global variables -------------------------- */ - -// default values of settings, overridden by $HOME/.qpsrc if present -bool Qps::flag_show = - true; // window state of last run : mini(iconic) or normal window -bool Qps::flag_exit = true; -bool Qps::flag_qps_hide = true; // TEST -bool Qps::flag_useTabView = false; -bool Qps::show_file_path = false; -bool Qps::show_cmd_path = true; -bool Qps::show_infobar = true; -bool Qps::show_ctrlbar = true; -bool Qps::show_cpu_bar = true; -bool Qps::show_load_graph = true; // DEL -bool Qps::show_statusbar = true; -bool Qps::load_in_icon = true; -bool Qps::auto_save_options = true; -#ifdef LINUX -bool Qps::hostname_lookup = true; -bool Qps::service_lookup = true; -#endif -bool Qps::pids_to_selection = true; -bool Qps::vertical_cpu_bar = false; // not used -#ifdef SOLARIS -bool Qps::normalize_nice = true; -bool Qps::use_pmap = true; -#endif -bool Qps::tree_gadgets = true; -bool Qps::tree_lines = true; -int Qps::swaplimit = 5; // default: warn when less than 10% swap left -bool Qps::swaplim_percent = true; - -QThread *thread_main = 0; - -Qps::Qps() -{ - setObjectName("qps_main_window"); - timer_id = 0; - field_win = 0; - prefs_win = 0; - command_win = 0; - default_icon = 0; - default_icon_set = false; - - setIconSize(24, 24); // Important!! - // setMouseTracking(true); // no need? - - if (flag_devel) - { - thread_main = thread(); // Test - printf("qps thread =%p , qApp thread =%p\n", thread(), - QApplication::instance()->thread()); - } - - // watchdogDialog = new WatchdogDialog; //Memory Leak - - // font_cb=new QFontComboBox(this); // preload - // font_cb->setWritingSystem ( QFontDatabase::Latin ); - // font_cb->hide(); - - make_signal_popup_menu(); - - // MOVETO Pstable !! - m_headpopup = new QMenu( tr( "header_popup" ), this); - m_headpopup->addAction( tr( "Remove Field" ), this, SLOT(menu_remove_field())); - m_fields = new QMenu( tr( "Add Field" ), this); - m_headpopup->addMenu(m_fields); - // connect(m_fields, SIGNAL(activated(int)), - // SLOT(add_fields_menu(int))); - // m_headpopup->addAction("Select Field", this, SLOT(menu_custom()) ); - - m_command = new QMenu( tr( "Command" ), this); // filled in later - - QAction *act; - - m_view = new QMenu( tr( "View" ), this); - act = m_view->addAction( tr( "Process" ) ); // act->setData(Procview::CUSTOM); - act = m_view->addAction( tr( "Log" ) ); // act->setData(Procview::CUSTOM); - // m_view->hide(); - - m_field = new QMenu("Field", this); - act = m_field->addAction( tr( "Custom Fields" ) ); - act->setData(Procview::CUSTOM); - act = m_field->addAction( tr( "Basic Fields " ) ); - act->setData(Procview::USER); - act = m_field->addAction( tr( "Jobs Fields " ) ); - act->setData(Procview::JOBS); - act = m_field->addAction( tr( "Memory Fields " ) ); - act->setData(Procview::MEM); -#ifdef LINUX - act = m_field->addAction( tr( "Scheduling Fields " ) ); - act->setData(Procview::SCHED); -#endif - - m_field->addSeparator(); - act = m_field->addAction( QIcon::fromTheme(QStringLiteral("edit-find-replace")) - , tr( "Select Custom Fields..." ) - , this - , SLOT(menu_custom())); - act->setData(MENU_CUSTOM); - - connect(m_field, SIGNAL(triggered(QAction *)), this, - SLOT(view_menu(QAction *))); - connect(m_field, SIGNAL(aboutToShow()), SLOT(update_menu_status())); - - /// connect(m_view, SIGNAL(triggered(QAction *)),this, - /// SLOT(view_menu(QAction - /// *))); - /// connect(m_view, SIGNAL(aboutToShow ()), SLOT(update_menu_status())); - - m_options = new QMenu( tr( "Option" ), this); - m_options->addAction( tr( "Update Period..." ), this, SLOT(menu_update())); - m_options->addSeparator(); - act = m_options->addAction("", /* MENU_PATH */ this, - SLOT(menu_toggle_path())); - act->setData(QVariant(MENU_PATH)); - act = m_options->addAction("", this, SLOT(menu_toggle_infobar())); - act->setData(QVariant(MENU_INFOBAR)); - act = m_options->addAction("", this, SLOT(menu_toggle_ctrlbar())); - act->setData(QVariant(MENU_CTRLBAR)); - act = m_options->addAction( tr( "Show Status bar" ) - , this - ,SLOT(menu_toggle_statusbar())); - act->setData(QVariant(MENU_STATUS)); - act = m_options->addAction("", this, SLOT(menu_toggle_cumul())); - act->setData(QVariant(MENU_CUMUL)); - - m_options->addSeparator(); - m_options->addAction( QIcon::fromTheme(QStringLiteral("preferences-system")) - , tr( "Preferences..." ) - , this - , SLOT(menu_prefs())); // MENU_PREFS - - connect(m_options, SIGNAL(aboutToShow()), SLOT(update_menu_status())); - - QMenu *m_help = new QMenu( tr( "Help" ), this); - // m_help->addAction("FAQ", this, SLOT(license())); - m_help->addAction(QIcon::fromTheme("help-about"), tr( "About" ), this, - SLOT(about())); - - // menu = new QMenuBar(this); - menubar = new QMenuBar; - menubar->addMenu(m_command); - // am_view=menubar->addMenu(m_view); - menubar->addMenu(m_field); - menubar->addMenu(m_options); - menubar->addSeparator(); - menubar->addMenu(m_help); - - ctrlbar = new ControlBar(this); - // controlbar=ctrlbar; - - connect(ctrlbar, SIGNAL(need_refresh()), SLOT(refresh())); - connect(ctrlbar, SIGNAL(viewChange(QAction *)), - SLOT(view_menu(QAction *))); //????? - - context_col = -1; - - procview = new Procview(); // refresh() only not rebuild() -/// procview = new Procview("localhost"); // refresh() only not rebuild() -/// procview->refresh(); // TODO -/// proclist.append(procview); -/// procview->start(); // thread start - -#ifdef HTABLE2 - pstable = new Pstable2(this, procview); // -#else - pstable = new Pstable(this, procview); // no refresh() -#endif - PDisplay *display = new PDisplay(this); - infobar = display->addSystem(procview); - //. infobar = new Infobar(this,procview); // graph_bar - // infobar = new Infobar(procview); // graph_bar - statusBar = new StatusBar(this); - - if (!read_settings()) - { - // printf("default value\n"); - set_update_period(1300); // default - resize(640, 370); // default initial size - } - - set_table_mode(procview->treeview); // Pstable::refresh() occur - make_command_menu(); // after qpsrc reading - - // misc. accelerators - QShortcut *c1 = - new QShortcut(Qt::CTRL + Qt::Key_Q, this, SLOT(save_quit())); - QShortcut *c3 = new QShortcut(Qt::CTRL + Qt::Key_Space, - ctrlbar->pauseButton, SLOT(click())); - QShortcut *c2 = - new QShortcut(Qt::CTRL + Qt::Key_L, pstable, SLOT(repaintAll())); - - // MOVETO : pstable better? hmmm... - // where is leftClick? - connect(pstable, SIGNAL(doubleClicked(int)), SLOT(open_details(int))); - connect(pstable, SIGNAL(rightClicked(QPoint)), this, - SLOT(show_popup_menu(QPoint))); - connect(pstable->header(), SIGNAL(rightClicked(QPoint, int)), this, - SLOT(context_heading_menu(QPoint, int))); - // connect(netable, SIGNAL(rightClicked(QPoint)), this, - // SLOT(context_row_menu(QPoint))); - - selection_items_enabled = true; // ???? - update_load_time = 0; - //// update_menu_status(); - - QVBoxLayout *vlayout = new QVBoxLayout; - vlayout->setMargin(0); - if (flag_useTabView) - vlayout->setSpacing(0); - else - vlayout->setSpacing(1); - - // vlayout->addWidget(menu); - vlayout->setMenuBar(menubar); - vlayout->addWidget(display); - // vlayout->addWidget( infobar); - vlayout->addWidget(ctrlbar); - - /// vlayout->addSpacing(5); - - // if(flag_devel){ - if (0) - { - if (0) - { - QSplitter *splitter = new QSplitter(Qt::Vertical); - QDockWidget *dock = new QDockWidget(tr("Detail"), this); - dock->setFeatures(QDockWidget::DockWidgetClosable); - // dock->setWidget(); - // dock->setAllowedAreas(Qt::LeftDockWidgetArea | - // Qt::RightDockWidgetArea); - // customerList = new QListWidget(dock); - // vlayout->addStretch(); - splitter->addWidget(pstable); - splitter->addWidget(dock); - vlayout->addWidget(splitter); - vlayout->addWidget(statusBar); - setLayout(vlayout); - } - } - - logbox = new QTextEdit(this); - logbox->setReadOnly(true); - - if (0) // if(flag_smallscreen==false) - { - // - } - else - { - vlayout->addWidget(pstable); - vlayout->addWidget(logbox); - logbox->hide(); - } - - vlayout->addWidget(statusBar); - setLayout(vlayout); - - infobox = new TFrame(this); - // setAttribute(Qt::WA_ShowWithoutActivating); - if (update_period != eternity) - Qps::update_timer(); // startTimer(update_period); - /// setFocusPolicy (Qt::WheelFocus); - - bar_visibility(); // need - - // testing - popupx = new QMenu( tr( "test" ), this); - popupx->addAction( tr( "Copied to Clipboard" ) ); -} - -// explicit destructor needed for gcc -Qps::~Qps() {} -void Qps::tabChanged(int idx) -{ - /* - for(int i; i<1024;i++) - { - QFont font; - if(font_cb) - font=font_cb->currentFont(); - //font=font_cb->currentFont(); - QApplication::setFont(font); - } - - printf("tab\n"); - */ - - if (idx == 0) - { - procview->viewproc = Procview::ALL; - pstable->refresh(); - // pstable->update(); - } - else if (idx == 1) - { - // procview->viewproc=Procview::NETWORK; - // netable->refresh(); - // netable->update(); - } -} -// return true if all selected processes are stopped -bool Qps::all_selected_stopped() -{ - for (int i = 0; i < procview->linear_procs.size(); i++) - { - Procinfo *p = procview->linear_procs[i]; - if (p->selected && p->state != 'T') - return false; - } - return true; -} - -// Adjust menu to contain Stop or Continue -void Qps::adjust_popup_menu(QMenu *m, bool cont) -{ - // int idx = m->indexOf(MENU_DETAILS); - if (procview->treeview == true) - { - // m->setItemVisible (MENU_PARENT,false); - // m->setItemVisible (MENU_CHILD,false); - // m->setItemVisible (MENU_DYNASTY,false); - } - else - { - // m->setItemVisible (MENU_PARENT,true); - // m->setItemVisible (MENU_CHILD,true); - // m->setItemVisible (MENU_DYNASTY,true); - } - - if (procview->viewproc == Procview::HIDDEN) - { - // m->setItemVisible (MENU_ADD_HIDDEN,false); - // m->setItemVisible (MENU_REMOVE_HIDDEN,true); - } - else - { - // m->setItemVisible (MENU_ADD_HIDDEN,true); - // m->setItemVisible (MENU_REMOVE_HIDDEN,false); - } -} - -// -void Qps::adjust_popup_menu() -{ - bool allstop = all_selected_stopped(); - QList list = m_popup->actions(); - // printf("adjust_popup_menu () size=%d \n",list.size()); - - if (allstop) - for (int i = 0; i < list.size() - 1; i++) - { - QAction *act = list[i]; - int id = act->data().toInt(); - if (id == MENU_SIGCONT) - act->setVisible(true); - if (id == MENU_SIGSTOP) - act->setVisible(false); - } - else - for (int i = 0; i < list.size() - 1; i++) - { - QAction *act = list[i]; - int id = act->data().toInt(); - if (id == MENU_SIGCONT) - act->setVisible(false); - if (id == MENU_SIGSTOP) - act->setVisible(true); - } -} - -// build signal menu (used in two places) -QMenu *Qps::make_signal_popup_menu() -{ - - // move to pstable? - QAction *act; // show_popup_menu() callback - m_popup = new QMenu( tr( "context popup" ), this); - m_popup->addAction( tr( "Renice..." ), this, SLOT(menu_renice())); - m_popup->addAction( tr( "Scheduling..." ), this, SLOT(menu_sched())); - m_popup->addSeparator(); - m_popup->addAction( tr( "Terminate" ), this, SLOT(sig_term()), - Qt::Key_Delete); // better - m_popup->addAction( tr( "Hangup" ), this, SLOT(sig_hup()), Qt::ALT + Qt::Key_H); - m_popup->addAction( tr( "Kill" ), this, SLOT(sig_kill()), Qt::ALT + Qt::Key_K); - act = m_popup->addAction( tr( "Stop" ), this, SLOT(sig_stop())); - act->setData(MENU_SIGSTOP); - act = m_popup->addAction( tr( "Continue" ), this, SLOT(sig_cont())); - act->setData(MENU_SIGCONT); - - // connect(m_popup, SIGNAL(aboutToShow ()),this, - // SLOT(adjust_popup_menu())); - /// m_popup->addAction("Find Parent", this, - /// SLOT(menu_parent()),0,MENU_PARENT); - /// m_popup->addAction("Find Children", this, - /// SLOT(menu_children()),0,MENU_CHILD); - /// m_popup->addAction("Find Descendants", this, - /// SLOT(menu_dynasty()),0,MENU_DYNASTY); - - QMenu *m = new QMenu("Other Signals"); - act = m->addAction( tr( "SIGINT (interrupt)" ) ); - act->setData(SIGINT); - act = m->addAction( tr( "SIGCONT (continue)" ) ); - act->setData(SIGCONT); - act = m->addAction( tr( "SIGSTOP (stop)" ) ); - act->setData(SIGSTOP); - act = m->addAction( tr( "SIGQUIT (quit)" ) ); - act->setData(SIGQUIT); - act = m->addAction( tr( "SIGILL (illegal instruction)" )); - act->setData(SIGILL); - act = m->addAction( tr( "SIGABRT (abort)" ) ); - act->setData(SIGABRT); - act = m->addAction( tr( "SIGFPE (floating point exception)" ) ); - act->setData(SIGFPE); - act = m->addAction( tr( "SIGSEGV (segmentation violation)" ) ); - act->setData(SIGSEGV); - act = m->addAction( tr( "SIGPIPE (broken pipe)" ) ); - act->setData(SIGPIPE); - act = m->addAction( tr( "SIGALRM (timer signal)" ) ); - act->setData(SIGALRM); - act = m->addAction( tr( "SIGUSR1 (user-defined 1)" ) ); - act->setData(SIGUSR1); - act = m->addAction( tr( "SIGUSR2 (user-defined 2)" ) ); - act->setData(SIGUSR2); - act = m->addAction( tr( "SIGCHLD (child death)" ) ); - act->setData(SIGCHLD); - act = m->addAction( tr( "SIGTSTP (stop from tty)" ) ); - act->setData(SIGTSTP); - act = m->addAction( tr( "SIGTTIN (tty input)" ) ); - act->setData(SIGTTIN); - act = m->addAction( tr( "SIGTTOU (tty output)" ) ); - act->setData(SIGTTOU); - - connect(m, SIGNAL(triggered(QAction *)), SLOT(signal_menu(QAction *))); - - m_popup->addMenu(m); - m_popup->addSeparator(); - m_popup->addAction( tr( "View Details" ), this, SLOT(Action_Detail())); - - return m; -} - -void Qps::signal_menu(QAction *act) -{ - int signal = act->data().toInt(); - send_to_selected(signal); -} - -#ifdef MOSIX - -// build migrate menu -static int intcmp(const int *a, const int *b) { return *a - *b; } - -QMenu *Qps::make_migrate_menu() -{ - QString buf; - QMenu *m = new QMenu; - Svec lst = Procinfo::mosix_nodes(); - lst.sort(intcmp); /// sort - m->insertItem("Home", 1); - m->insertItem("Find Best", 0); - for (int i = 0; i < lst.size(); i++) - { - buf.sprintf("to node %d", lst[i]); - m->insertItem(buf, lst[i] + 1); - } - return m; -} -#endif // MOSIX - -// update the visibility of the {info, control, status} bar -void Qps::bar_visibility() -{ - - if (show_infobar) - infobar->show(); - else - infobar->hide(); - - if (show_ctrlbar) - ctrlbar->show(); - else - ctrlbar->hide(); - - if (show_statusbar) - statusBar->show(); - else - statusBar->hide(); - - if (flag_useTabView) - { - // DEL tbar->showTab(true); - /// am_view->setVisible(false); - } - else - { - // DEL tbar->showTab(false); - // am_view->setVisible(true); - } -} - -void Qps::timerEvent(QTimerEvent *e) { Qps::refresh(); } -// -// dialogs.cpp: qps->update_timer(); -void Qps::update_timer() -{ - if (timer_id) - killTimer(timer_id); - timer_id = startTimer(update_period); // *** important !!! -} - -// change the update period, recomputing the averaging factor -void Qps::set_update_period(int milliseconds) -{ - if (milliseconds == 0) - { - qDebug("DEBUG: set_update_period(): update= %dms \n", milliseconds); - milliseconds = 1000; - } - update_period = milliseconds; - Proc::update_msec = milliseconds; // testing transfer... - Procview::avg_factor = exp(-(float)update_period / Procview::cpu_avg_time); -} - -void Qps::refresh() -{ - if (flag_refresh == false) - return; - - procview->refresh(); // important - // infobar->update_load(); // add_point and drawGraphOnPixmap(); - infobar->updatePixmap(); // add_point and drawGraphOnPixmap(); - - if (isVisible()) - { // infobar->isVisible() - // printf("paint\n"); - // if(search_box and !search_box->hasFocus()) - // search_box->setFocus(Qt::OtherFocusReason); - pstable->refresh(); - // if(netable and netable->isVisible())netable->refresh(); - if (show_infobar) // if(Qps::show_load_graph) - infobar->update(); // TODO: thread update or - // infobar->repaint(); - //==> pdisplay->update(); - // DEL update_menu_selection_status(); // update pop menu - } - - if (trayicon) - update_icon(); // make icon for systray - refresh_details(); -} - -// make next timer_refresh happen a little earlier to remove processes that -// might have died after a signal -void Qps::earlier_refresh() -{ - const int delay = 500; // wait no more than this period (ms) - if (update_period > delay && update_period != eternity) - { - } -} - -void Qps::resizeEvent(QResizeEvent *e) -{ - // DEBUG("Qps::resize() w=%d\n",e->size().width()); - // QWidget::resizeEvent(event); - - int w; - return; - - // search_box->isVisible(true); // imidiate - w = ctrlbar->sizeHint().width(); - if (!search_box->isVisible()) - w += search_box->sizeHint().width(); - - if (e->size().width() < w) - { - // ctrlbar-> - search_box->hide(); - } - // else search_box->show(); - - return; - if (e->size().width() < 639) - { - // tbar->setDrawBase (false); - flag_smallscreen = true; - statusBar->hide(); - // void QTabWidget::setTabEnabled ( int index, bool enable - //) - } - else - { - flag_smallscreen = false; - statusBar->show(); - } -} - -/* - Description : - 1. called when visible() or hide() state. QT4 - 2. called when clicked WINDOW_EXIT_X_BUTTON - 3. NOT called when user logout (session manager) -*/ -void Qps::closeEvent(QCloseEvent *e) -{ - // DEBUG("DEBUG: closeEvent()....\n"); - // sleep(2); - if ((Qps::flag_exit == false) and trayicon->hasSysTray()) - { - e->ignore(); // dont close window! - hide(); - return; - } - e->accept(); // ok. I will be exit Now !! - save_quit(); -} - -// call by void Qps::make_command_menu() -// void signal_handler(int sig) -void Qps::save_quit() // will be removed ! -{ - // printf("DEBUG: save_quit()....\n"); - close(); // if another window exists, then no exit. // occurs - // QCoseEvent! - save_settings(); - qApp->quit(); // MACRO -} - -// NEW Version ! -// : write geometry, visible fields and other settings to $HOME/.qpsrc -void Qps::save_settings() -{ - if (Qps::auto_save_options) - write_settings(); -} - -void Qps::leaveEvent(QEvent *event) -{ - // printf("out!xx\n"); //works well -} - -void Qps::enterEvent(QEvent *event) -{ - // printf("in!\n"); // works well -} - -void Qps::showEvent(QShowEvent *event) -{ - // printf("showEvent()\n"); - // event->accept(); -} -void Qps::mouseMoveEvent(QMouseEvent *event) -{ - // printf("Qps::mouseMoveEvent\n"); //work in child surface without - // setMouseTracking(true); -} - -// setFocusPolicy() should on -void Qps::focusInEvent(QFocusEvent *event) -{ - // printf("focusIn\n"); // not work in compiz,Metacity - // infobar->showup(); - // event->accept(); -} - -void Qps::focusOutEvent(QFocusEvent *event) -{ - // printf("focusOut\n"); // not work in compiz,Metacity - // event->accept(); -} - -void Qps::keyPressEvent(QKeyEvent *event) -{ - // printf("Qps::key\n"); // not work in compiz - if (search_box) - { - if (!search_box->hasFocus()) - search_box->setFocus(Qt::OtherFocusReason); - search_box->keyPressEvent(event); - } - // search_box->setFocusProxy(pstable); -} -void Qps::moveEvent(QMoveEvent *event) -{ - ////infobar->refresh(); - // printf("move\n"); -} -void Qps::paintEvent(QPaintEvent *event) -{ - // printf("paintEvent : Qps\n"); - // update_icon(); -} -void Qps::update_icon() -{ - if (load_in_icon) - set_load_icon(); // always true - else - set_default_icon(); -} -// called by update_icon() -void Qps::set_default_icon() -{ - if (!default_icon_set) - { - if (!default_icon) - default_icon = new QPixmap((const char **)icon_xpm); - setWindowIcon(*default_icon); - default_icon_set = true; - } -} - -void Qps::set_load_icon() -{ - QPixmap *pm = infobar->load_icon(icon_width, icon_height); - if (!pm->mask()) - { - // avoid a fvwm/Qt 1.30 problem and create a filled mask for the - // icon - // (without mask, Qt would attempt to use a heuristically - // created mask) - QBitmap bm(pm->size()); - bm.fill(Qt::color1); - pm->setMask(bm); - } - // QApplication::setWindowIcon(*pm); - if (trayicon->hasSysTray()) - { - trayicon->setIcon(*pm); - // str.sprintf("Qps %2.2f%",Procinfo::loadQps); - // trayicon->setToolTip(str); - // trayicon->showMessage("str",str); - } - // else - setWindowIcon(*pm); - // QApplication::setWindowIcon(*pm); - default_icon_set = false; -} - -QPixmap *Qps::get_load_icon() -{ - return infobar->load_icon(icon_width, icon_height); -} - -// -void Qps::refresh_details() -{ -//// details.first(); -////Details d; -#ifdef LINUX -// Proc::invalidate_sockets(); -#endif - - for (int i = 0; i < details.size(); ++i) - { - /////Details *d=details[i] - ////if(details[i].isVisible()) - /////details[i].refresh(); - } - /* - while((d = details.current()) != 0) { - if(d->isVisible()) - d->refresh(); - details.next(); - } */ -} - -// called by -// 1.void Qps::field_removed(int index) -// ====> QMenu::aboutToShow () -void Qps::update_menu_status() -{ - // printf("update_menu_status\n"); - update_menu_selection_status(); - // ctrlbar->view->setCurrentItem (procview->viewproc); //??? - - // Field Menu - QList list = m_field->actions(); - for (int i = 0; i < list.size() - 1; i++) - { - QAction *act = list[i]; - act->setCheckable(true); - int id = act->data().toInt(); - if (id == procview->viewfields) - act->setChecked(true); - else - act->setChecked(false); - } - - // View Menu temporary - /* - QString str=tbar->tabText(tbar->currentIndex()); - list=m_view->actions(); - for(int i =0 ;i< list.size() ;i++) - { - QAction *act=list[i]; - act->setCheckable(true); - - if(act->text()==str) - { - act->setChecked(true); - } - else - act->setChecked(false); - } */ - - // Option Menu - list = m_options->actions(); - for (int i = 0; i < list.size() - 1; i++) - { - QAction *act = list[i]; - int id = act->data().toInt(); - - if (id == MENU_PATH) - { - act->setCheckable(true); - act->setChecked(Procview::flag_show_file_path); - act->setText("Show File Path"); - // act->setText(Procview::flag_show_file_path? - //"Hide File Path" : - //"Show File Path"); - } - else if (id == MENU_INFOBAR) - { - act->setCheckable(true); - act->setChecked(show_infobar); - act->setText("Show Graph"); - // act->setText(show_infobar ? "Hide Graph" : "Show - // Graph"); - } - else if (id == MENU_CTRLBAR) - { - act->setCheckable(true); - act->setChecked(show_ctrlbar); - act->setText("Show Control Bar"); - // act->setText(show_ctrlbar ? "Hide Control bar" : - // "Show Control - // Bar"); - } - else if (id == MENU_STATUS) - { - act->setCheckable(true); - act->setChecked(show_statusbar); - } - else if (id == MENU_CUMUL) - { - act->setCheckable(true); - act->setChecked(Procview::flag_cumulative); - act->setText("Include Child Times"); - // act->setText(Procview::flag_cumulative ? - // "Exclude Child Times" : - // "Include Child Times"); - } - } -} - -// need to change name , redesign -void Qps::view_menu(QAction *act) -{ - int id = act->data().toInt(); - if (act->text() == "Process") - { - // tbar->setCurrentIndex(0); - return; - } - if (act->text() == "Log") - { - // tbar->setCurrentIndex(1); - return; - } - - int state = id; - if (id >= Procview::ALL && id <= Procview::HIDDEN) - { - if (procview->viewproc != state) - { - procview->viewproc = state; - } - } - - if (id >= Procview::USER && id <= Procview::CUSTOM) - { - if (procview->viewfields != state) - { - procview->viewfields = state; - procview->set_fields(); - } - } - pstable->refresh(); // layout - /// update_menu_status(); -} - -// called when selection changed & update time -// void Qps::update_menu_status() -// void Qps::make_command_menu() -// DEL. -// -> show_popup_menu() -void Qps::update_menu_selection_status() -{ - - // bool enabled = (pstable->numSelected() > 0); - // if(enabled) - if (0) - { - bool cont = all_selected_stopped(); - adjust_popup_menu(m_popup, cont); - } - - for (int i = 0; i < commands.size(); i++) - { - /* if (commands[i]->IsNeedProc()==false) - m_command->setItemEnabled(MENU_FIRST_COMMAND + i, true); - else m_command->setItemEnabled(MENU_FIRST_COMMAND + i, enabled); - */} -} - -// call by SearchBox::keyPressEvent - -// slot -void Qps::sig_term() { send_to_selected(SIGTERM); } - -void Qps::sig_hup() { send_to_selected(SIGHUP); } - -// need -void Qps::sig_stop() -{ - send_to_selected(SIGSTOP); - - // test - for (int i = 0; i < procview->linear_procs.size(); i++) - { - Procinfo *p = procview->linear_procs[i]; - if (p->selected) - { - p->test_stop = 1; // who ?? - // sendsig(p, sig); - } - } -} - -void Qps::sig_cont() -{ - send_to_selected(SIGCONT); - - // test - for (int i = 0; i < procview->linear_procs.size(); i++) - { - Procinfo *p = procview->linear_procs[i]; - if (p->selected) - p->test_stop = 0; - } -} - -void Qps::sig_kill() { send_to_selected(SIGKILL); } - -void Qps::menu_custom() -{ - //// view_menu(Procview::CUSTOM); // should !! - if (field_win) - { - field_win->show(); - field_win->raise(); - } - else - { - field_win = new FieldSelect(procview); - setWindowGroup(field_win); - field_win->show(); - connect(field_win, SIGNAL(added_field(int)), this, - SLOT(field_added(int))); - connect(field_win, SIGNAL(removed_field(int)), this, - SLOT(field_removed(int))); - } -} - -// MOVE TO PSTABlE ? hmmm wait... -// Interface for reading_setting() -// SLOT: -// -// called by -// 1.click Tree_checkbox -// 2.void Qps::view_menu(int id) -void Qps::set_table_mode(bool treemode) -{ - // qDebug("set_table_mode()\n"); - ctrlbar->setMode(treemode); // toggle checkbox - pstable->setTreeMode(treemode); // first pstable->refresh(); -} - -// Slot: -// SEGFAULT CODE: MOVETO Pstable -// called by -// 1. void Qps::add_fields_menu(int id) -// 2. field_win -void Qps::field_added(int field_id) -{ - int where = -1; - where = pstable->clickedColumn(); - procview->addField(field_id, where); - pstable->refresh(); // pstable->update(); // repaint - // update_menu_status(); -} - -// MOVETO Proview -// what this hell? SEGFAULT! -// call by -// 1. FieldSelect -// 2. void Qps::menu_remove_field() -void Qps::field_removed(int index) -{ - /// printf("field_removed() index=%d\n",index); - procview->removeField(index); - if (procview->treeview and index == F_CMD) - set_table_mode(false); - // should be changed to linear mode !! - - /// update_menu_status(); // ??? - - // pstable->update(); // no - pstable->refresh(); - context_col = -1; // *** important **** : right clicked column removed - return; -} - -// moveto command? -void Qps::menu_edit_cmd() -{ - if (command_win) - { - command_win->show(); - command_win->raise(); - } - else - { - command_win = new CommandDialog(); - setWindowGroup(command_win); - command_win->show(); - connect(command_win, SIGNAL(command_change()), - SLOT(make_command_menu())); - } -} - -// init command menu -// callback by CommandDialog::add_new() -void Qps::make_command_menu() -{ - // should clear SIGNAL!!! - QAction *act; - m_command->clear(); - m_command->disconnect(); - - if (flag_devel) - { - m_command->addAction( tr( "WatchDog" ), watchdogDialog, - SLOT(show())); //, m_event); - // m_command->addAction("ScreenShot", screenshot, - // SLOT(show()) ); - act = m_command->addAction( tr( "Edit Commands..." ), this, - SLOT(menu_edit_cmd())); - // act->setEnabled(false); - } - - // if(commands.size()) m_command->addSeparator(); - add_default_command(); - - for (int i = 0; i < commands.size(); i++) - { - // commands[i]->menu = m_command->insertItem(commands[i]->name, - // MENU_FIRST_COMMAND + i); - // commands[i]->menu = - act = m_command->addAction(commands[i]->name); - // connect(act, SIGNAL(triggered(bool )), - // SLOT(signal_menu(bool))); - } - connect(m_command, SIGNAL(triggered(QAction *)), - SLOT(run_command(QAction *))); - - update_menu_selection_status(); // DEL - //#ifdef SOLARIS - /* Solaris CDE don't have a tray, so we need a method to terminate */ - m_command->addSeparator(); - m_command->addAction(QIcon::fromTheme(QStringLiteral("application-exit")) - , tr( "Quit" ) - , this - , SLOT(save_quit()) - , Qt::ALT + Qt::Key_Q); - //#endif -} - -// run by MENU_ID ? qt slot? -// void Qps::run_command(int command_id) -void Qps::run_command(QAction *act) -{ - int command_id; - int i, j, idx = -1; - // FUNC_START - - // printf("%s\n",qPrintable(act->text())); - AddLog(act->text()); - - // find_command - for (i = 0; i < commands.size(); i++) - { - // if(commands[i]->menu==command_id) - if (commands[i]->name == act->text()) - { - if (commands[idx]->IsNeedProc() == false) - { - commands[idx]->call(NULL); - return; - } - - for (int i = 0; i < procview->linear_procs.size(); i++) - { - Procinfo *p = procview->linear_procs[i]; - if (p->selected) - commands[idx]->call(p); - } - break; - } - } - - return; -} - -// detail -void Qps::Action_Detail() -{ - for (int i = 0; i < procview->linear_procs.size(); i++) - { - Procinfo *p = procview->linear_procs[i]; - if (p->selected) - open_details(i); - } -} - -// MOVETO : pstable.cpp -void Qps::open_details(int row) -{ - Procinfo *p = procview->linear_procs[row]; - if (p->detail) - { - // p->detail->raise(); - p->detail->show(); - printf("show detail \n"); - } - else - { - Details *d = new Details(p, procview); - // details.append(*d); - // setWindowGroup(d); - d->show(); - /// connect(d, SIGNAL(closed(Details *)), this, - /// SLOT(details_closed(Details - ///*))); - } -} - -void Qps::details_closed(Details *d) -{ - // printf("details_closed()\n"); - // disconnect - - // This is potentially dangerous, since this is called in response to a - // signal sent by the widget that is about to be deleted here. Better - // hope - // that nobody references the object down the call chain! - // what ?????? - - //////details.removeAt(*d); // deletes window - // details.removeAt(*d); // deletes window -} - -// find parents of selected processes -void Qps::menu_parent() { locate_relatives(&Procinfo::ppid, &Procinfo::pid); } - -void Qps::menu_children() { locate_relatives(&Procinfo::pid, &Procinfo::ppid); } - -// Find processes whose attribute b is equal to the attribute a of -// selected processes. Center around topmost found. -// This is quadratic in worst case (shouldn't be a problem) -// called by -// 1.menu_children() -// 2.menu_parent() -void Qps::locate_relatives(int Procinfo::*a, int Procinfo::*b) -{ - QList relatives; - const int infinity = 2000000000; - int topmost = infinity; - for (int i = 0; i < procview->linear_procs.size(); i++) - { - Procinfo *p = procview->linear_procs[i]; - if (p->selected) - { - pstable->setSelected(i, false); - for (int j = 0; j < procview->linear_procs.size(); j++) - { - Procinfo *q = procview->linear_procs[j]; - if (p->*a == q->*b) - { - relatives.append(j); - if (j < topmost) - topmost = j; - } - } - } - } - for (int i = 0; i < relatives.size(); i++) - pstable->setSelected(relatives[i], true); - /// if(topmost < infinity) pstable->centerVertically(topmost); - //// pstable->selectionNotify(); -} - -// select all (direct and indirect) offsprings of currently selected -// processes, without deselecting them -void Qps::menu_dynasty() -{ - QList family; - for (int i = 0; i < procview->linear_procs.size(); i++) - if (pstable->isSelected(i)) - family.append(i); - for (int i = 0, j = family.size(); i < j;) - { - for (int k = 0; k < procview->linear_procs.size(); k++) - { - Procinfo *p = procview->linear_procs[k]; - for (int m = i; m < j; m++) - { - Procinfo *q = procview->linear_procs[family[m]]; - if (q->pid == p->ppid) - family.append(k); - } - } - i = j; - j = family.size(); - } - const int infinity = 2000000000; - int topmost = infinity; - for (int i = 0; i < family.size(); i++) - { - pstable->setSelected(family[i], true); - if (family[i] < topmost) - topmost = family[i]; - } - ////if(topmost < infinity) pstable->centerVertically(topmost); - ////pstable->selectionNotify(); -} - -// CALLBACK: called when right button is clicked in table -void Qps::show_popup_menu(QPoint p) -{ -#ifdef MOSIX - bool may_migrate = false; - for (int i = 0; i < procview->linear_procs.size(); i++) - { - Procinfo *p = procview->linear_procs[i]; - if (p->selected && p->cantmove.isEmpty()) - { - may_migrate = true; - break; - } - } - m_popup->setItemEnabled(POPUP_MIGRATE, may_migrate); -#endif - adjust_popup_menu(); - m_popup->popup(p); -} - -// called when right button is clicked in heading -// -void Qps::context_heading_menu(QPoint p, int col) -{ - context_col = col; // **** - ////printf("context_col=%d\n",col); - static int init = 0; - // rebuild the submenu: only include non-displayed fields - int ncats = procview->categories.size(); - - if (init == 0) - { - /* #ifdef SHash - SHash::const_iterator it=procview->categories.begin(); - QList keys; - for ( ; it != procview->categories.end(); it++ ) - keys.append((*it).first); - #else - */ QList keys = procview->categories.keys(); - // #endif - for (int i = 0; i < ncats; i++) - { - Category *cat = procview->categories[keys.takeFirst()]; - QAction *act = m_fields->addAction(cat->name); - act->setData(cat->id); // index==key - } - connect(m_fields, SIGNAL(triggered(QAction *)), this, - SLOT(add_fields_menu(QAction *))); - init = 1; - } - - QBitArray displayed(64); // MAX_FIELDS - displayed.fill(false); - // printf("categories.size=%d cats.size=%d\n",ncats, - // procview->cats.size()); - - for (int i = 0; i < procview->cats.size(); i++) - { - // printf("cat id=%d \n",procview->cats[i]->id); - displayed.setBit(procview->cats[i]->id); - } - - QList la = m_fields->actions(); - for (int j = 0; j < la.size(); j++) - { - QAction *act = la[j]; - int id = act->data().toInt(); - if (!displayed.testBit(id)) - act->setVisible(true); - else - act->setVisible(false); - } - - m_headpopup->popup(p); -} - -void Qps::add_fields_menu(QAction *act) -{ - // act->text(); - int id = act->data().toInt(); - field_added(id); - // add_fields_menu(id); -} - -// called when field is added from heading context menu -// called by 1. context_heading_menu -void Qps::add_fields_menu(int cat_id) -{ - field_added(cat_id); - context_col = -1; - // if(field_win) field_win->update_boxes(); // change to showEvent. !!!! -} - -// -void Qps::menu_remove_field() -{ - if (context_col < 0) - return; - /// printf("cats.size=%d , context_col=%d - /// \n",procview->cats.size(),context_col); - field_removed(procview->cats[context_col]->index); -} - -void Qps::menu_update() -{ - - QString txt; - if (update_period == eternity) - txt = "1 s"; - else if (update_period % 1000 == 0) - txt.sprintf("%d s", update_period / 1000); - else - txt.sprintf("%d ms", update_period); - IntervalDialog id(txt.toUtf8().data(), update_period != eternity); - id.exec(); - /// save_settings(); - return; -} - -void Qps::menu_toggle_path() -{ - Procview::flag_show_file_path = !Procview::flag_show_file_path; - /// table refresh() ! -} - -void Qps::menu_toggle_infobar() -{ - show_infobar = !show_infobar; - bar_visibility(); -} - -void Qps::menu_toggle_ctrlbar() -{ - show_ctrlbar = !show_ctrlbar; - bar_visibility(); -} - -void Qps::menu_toggle_statusbar() -{ - show_statusbar = !show_statusbar; - bar_visibility(); -} - -void Qps::menu_toggle_cumul() -{ - Procview::flag_cumulative = !Procview::flag_cumulative; - // refresh() !! -} - -void Qps::menu_prefs() -{ - if (prefs_win) - { - prefs_win->show(); - prefs_win->raise(); - } - else - { - prefs_win = new Preferences(); - setWindowGroup(prefs_win); - prefs_win->show(); - prefs_win->raise(); - - connect(prefs_win, SIGNAL(prefs_change()), this, SLOT(config_change())); - /// connect(infobar, SIGNAL(config_change()), prefs_win, - /// SLOT(update_boxes())); // doesnt need !! --> aboutToShow() - } -} - -// if "Preferences" changed -void Qps::config_change() -{ - - write_settings(); - bar_visibility(); - // DEL infobar->configure(); - /// resizeEvent(0); // in case it caused geometry change - - for (int i = 0; i < details.size(); ++i) - { - ///// details[i].config_change(); - } - /* while((d = details.current()) != 0) { - d->config_change(); - details.next(); - } */ -} - -void Qps::menu_renice() -{ - // if(pstable->hasSelection() == 0) return; - - int defnice = -1000; - - // use nice of first selected process as default, and check permission - bool possible = true; - int euid = geteuid(); - Procinfo *p = 0; - - for (int i = 0; i < procview->linear_procs.size(); i++) - { - p = procview->linear_procs[i]; - if (p->selected) - { - if (defnice == -1000) - defnice = p->nice; - if (euid != 0 && euid != p->uid && euid != p->euid) - possible = false; - } - } - - if (!possible) - { - QMessageBox::warning( this - , tr( "Permission denied" ) - , tr( "You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that." ) ); - return; - } - - int new_nice; - for (;;) - { - SliderDialog sd(defnice, -20, 19); // Linux kernel : -20 ~ 19 - if (!sd.exec()) - return; - bool ok; - new_nice = sd.ed_result.toInt(&ok); - if (ok && new_nice >= -20 && new_nice <= 19) - break; - } - int nicecol = procview->findCol(F_NICE); - int statcol = procview->findCol(F_STAT); -#ifdef LINUX - int tmscol = procview->findCol(F_TMS); -#endif - - // do the actual renicing - for (int i = 0; i < procview->linear_procs.size(); i++) - { - Procinfo *p = procview->linear_procs[i]; - if (p->selected) - { - if (setpriority(PRIO_PROCESS, p->pid, new_nice) < 0) - { - QString s; - switch (errno) - { - case EPERM: - // this shouldn't happen, but (e)uid - // could be changed... - QMessageBox::warning( this - , tr( "Permission denied" ) - , tr( "You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that." ) - .arg( p->pid ) - .arg( p->command ) ); - break; - case EACCES: - QMessageBox::warning( this - , tr( "Permission denied" ) - , tr( "Only the super-user may lower the nice value of a process." ) ); - return; - } - } - else - { - p->nice = new_nice; // don't wait for update -#ifdef LINUX - p->tms = p->get_tms(); // ditto -#endif - } - } - } -} - -void Qps::menu_sched() -{ - // if(pstable->hasSelection()==false) return; - if (geteuid() != 0) - { - QMessageBox::warning( this - , tr( "Permission denied" ) - , tr( "Only the super-user may change the scheduling policy and static priority." ) ); - return; - } - - // provide reasonable defaults (first selected process) - Procinfo *p = 0; - for (int i = 0; i < procview->linear_procs.size(); i++) - { - p = procview->linear_procs[i]; - if (p->selected) - break; - } - int pol = p->get_policy(); - int pri = p->get_rtprio(); - SchedDialog sd(pol, pri); - if (!sd.exec()) - return; - - if (sd.out_policy == SCHED_OTHER) - sd.out_prio = 0; // only allowed value - int plcycol = procview->findCol(F_PLCY); - int rpricol = procview->findCol(F_RPRI); -#ifdef LINUX - int tmscol = procview->findCol(F_TMS); -#endif - for (int i = 0; i < procview->linear_procs.size(); i++) - { - Procinfo *p = procview->linear_procs[i]; - if (p->selected) - { - struct sched_param sp; - sp.sched_priority = sd.out_prio; - if (sched_setscheduler(p->pid, sd.out_policy, &sp) < 0) - { - if (errno == EPERM) - { - QMessageBox::warning( this - , tr( "Permission denied" ) - , tr( "You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that." ) - .arg( p->pid ) - .arg( p->command ) ); - break; - } - } - else - { - p->policy = sd.out_policy; // don't wait for update - p->rtprio = sd.out_prio; -#ifdef LINUX - p->tms = p->get_tms(); -#endif - } - } - } -} - -#ifdef MOSIX - -void Qps::mig_menu(int id) { migrate_selected(id - 1); } - -void Qps::migrate_selected(int migto) -{ - // User wants to migrate a process somewhere - // Write destination into /proc/XX/goto - int warnremote = 0; - for (int i = 0; i < procview->linear_procs.size(); i++) - { - Procinfo *p = procview->linear_procs[i]; - if (p->selected) - { - if (p->isremote) - ++warnremote; - char buf[80]; - sprintf(buf, "/proc/%d/goto", p->pid); - FILE *f = fopen(buf, "w"); - if (f) - { - fprintf(f, "%d", migto); - fclose(f); - } - } - } - if (warnremote) - QMessageBox::warning(this, "Remote migration attempt", - "You can only migrate an immigrated process " - "using qps on the home node."); - earlier_refresh(); -} -#else - -// Since this is a slot, at least a stub must be defined even when it isn't -// used (moc ignores preprocessor directives) -void Qps::mig_menu(int) {} - -#endif // MOSIX - -void Qps::send_to_selected(int sig) -{ - for (int i = 0; i < procview->linear_procs.size(); i++) - { - Procinfo *p = procview->linear_procs[i]; - if (p->selected) - sendsig(p, sig); - } - earlier_refresh(); // in case we killed one -} - -void Qps::sendsig(Procinfo *p, int sig) -{ - if (kill(p->pid, sig) < 0) - { - // if the process is gone, do nothing - no need to alert the - // user - if (errno == EPERM) - { - QMessageBox::warning( this - , tr( "Permission denied" ) - , tr( "You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it." ) - .arg( p->pid ) - .arg( p->command ) ); - // PermissionDialog *pd = new - // PermissionDialog(s,supasswd); - // pd->exec(); - } - } -} - -// write geometry, visible fields and other settings to $HOME/.qps-settings -#define SETTINGS_FILE ".qpsrc" -// If the file format is changed in any way (including adding new -// viewable fields), QPS_FILE_VERSION must be incremented to prevent -// version mismatches and core dumps - -#ifdef LINUX -#define QPS_FILE_VERSION 40 // version of .qps-linux file format -#endif - -#ifdef SOLARIS -#define QPS_FILE_VERSION 24 // version of .qps-solaris file format -#endif - -struct Sflagvar -{ - const char *name; - bool *var; -}; -static Sflagvar flagvars[] = {{"ExitOnClose", &Qps::flag_exit}, - {"TabView", &Qps::flag_useTabView}, - {"SingleCPU", &Procview::flag_pcpu_single}, - {"devel", &flag_devel}, - {"cmdpath", &Procview::flag_show_file_path}, - {"infobar", &Qps::show_infobar}, - {"ctrlbar", &Qps::show_ctrlbar}, - {"statbar", &Qps::show_statusbar}, - {"autosave", &Qps::auto_save_options}, - {"cpubar", &Qps::show_cpu_bar}, - {"loadgraph", &Qps::show_load_graph}, - {"loadicon", &Qps::load_in_icon}, - {"selectpids", &Qps::pids_to_selection}, - {"tree", &Procview::treeview}, - {"cumulative", &Procview::flag_cumulative}, -#ifdef LINUX - {"hostname", &Qps::hostname_lookup}, - {"service", &Qps::service_lookup} -#endif -#ifdef SOLARIS - {"normalize", &Qps::normalize_nice}, - {"pmap", &Qps::use_pmap} -#endif - , - {0, 0}}; - -char *settings_path(char *name) -{ - char *home = getenv("HOME"); - if (!home) - return 0; - strcpy(name, home); - strcat(name, "/" SETTINGS_FILE); - return name; -} - -#include -extern QList watchlist; -// 1.Procview should be contstructed ! -// 2. -bool Qps::read_settings() -{ - char path[512]; - if (settings_path(path) == NULL) - { - return false; - } - QSettings set(path, QSettings::NativeFormat); - - int v = set.value("version", 0).toInt(); - if (v == 0) - return false; - - int x, y, w, h; - x = set.value("geometry/x").toInt(); - y = set.value("geometry/y").toInt(); - w = set.value("geometry/width").toInt(); - h = set.value("geometry/height").toInt(); - // set.value("geometry/visiable",isVisible()); - Qps::flag_show = true; - setGeometry(x, y, w, h); - - if (set.value("font/name") != QVariant() and - set.value("font/size") != QVariant()) - { - QString fname = set.value("font/name").toString(); - int fsize = set.value("font/size").toInt(); // if not exist then 0 - QFont font; - font.setFamily(fname); - font.setPointSize(fsize); - QApplication::setFont(font); - } - - // Field - procview->cats.clear(); - QStringList sl = set.value("field").toStringList(); - for (int i = 0; i < sl.size(); i++) - { - QString str = sl[i]; - procview->addField(str.toUtf8().data()); - } - /// procview->saveCOMMANDFIELD(); // TMP - - // procview->idxF_CMD=set.value("F_CMD").toInt(); - - if (sl.size() == - 0) // *** for safe , if there is no field. this happen when no qpsrc - { - procview->viewfields = Procview::USER; - procview->set_fields(); /// - } - else - { - procview->viewfields = Procview::CUSTOM; - } - - int fid = procview->field_id_by_name( set.value("sort/field").toString() ); // procview->sortcat->name - int col = procview->findCol(fid); - if (col >= 0) - // pstable->setSortColumn(col); // Pstable::refresh() - procview->setSortColumn(col); // Pstable::refresh() - // pstable -> procview - procview->reversed = set.value("sort/reversed").toBool(); // tmp - - sl = set.value("flags").toStringList(); - // for(int i=0;iname; fs++) - { - if (sl.contains(fs->name)) - *(fs->var) = true; - else - *(fs->var) = false; - } - // procview->treeview=set.value("treeview").toBool(); - - int i = set.value("interval").toInt(); - set_update_period(i); - i = set.value("viewproc").toInt(); - procview->viewproc = i; - ctrlbar->view->setCurrentIndex( - i); // procview->viewproc=set.value("viewproc").toInt(); - - int size = set.beginReadArray("watchdog"); - for (int i = 0; i < size; i++) - { - set.setArrayIndex(i); - watchCond *w = new watchCond; - w->putstring(set.value("cat").toString()); - watchlist.append(w); - } - set.endArray(); - size = set.beginReadArray("commands"); - for (int i = 0; i < size; i++) - { - set.setArrayIndex(i); - Command *c = new Command; - c->putString(set.value("cmd").toString()); - commands.append(c); - } - set.endArray(); - - return true; - /* - } else if(strcmp(buf, "swaplim") == 0) { - swaplimit = atoi(p); - swaplim_percent = false; - if(swaplimit < 0) { - swaplimit = -swaplimit; - swaplim_percent = true; - } - fclose(f); */ - return true; -} - -// USING : -// write geometry, visible fields and other settings to $HOME/.qps-settings -void Qps::write_settings() // save setting -{ - char path[512]; - if (settings_path(path) == NULL) - { - return; - } - - QSettings set(path, QSettings::NativeFormat); - - set.setValue("version", QPS_FILE_VERSION); - // set.beginGroup(""); - // set.endGroup(); - set.setValue("geometry/x", - geometry().x()); // if hide then, wrong value saved!! - set.setValue("geometry/y", geometry().y()); - set.setValue("geometry/width", geometry().width()); - set.setValue("geometry/height", geometry().height()); - set.setValue("geometry/visiable", - isVisible()); // isVisible() ? "show":"hide"); - set.setValue("viewproc", - procview->viewproc); // All, your , running process... - /// set.setValue("treeview",procview->treeview); - - QStringList sl; - // printf("procview cats.size=%d\n",procview->cats.size()); - procview->update_customfield(); - set.setValue("field", procview->customfields); - // set.setValue("F_CMD",procview->idxF_CMD); - - if (procview->sortcat) // sometimes, sortcat==NULL. - { - set.setValue("sort/field", procview->sortcat->name); - set.setValue("sort/reversed", procview->reversed); - } - // return; - sl.clear(); - for (Sflagvar *fs = flagvars; fs->name; fs++) - { - if (*(fs->var)) - sl.append(fs->name); // fprintf(f, " %s", fs->name); - } - set.setValue("flags", sl); - - // fprintf(f, "swaplim: %d\n" "interval: %d\n", - // swaplim_percent ? -swaplimit : - // swaplimit, - // update_period); - - sl.clear(); - set.setValue("font/name", QApplication::font().family()); - set.setValue("font/size", QApplication::font().pointSize()); - - set.setValue("interval", update_period); - - set.beginWriteArray("watchdog"); - for (int i = 0; i < watchlist.size(); i++) - { - set.setArrayIndex(i); - set.setValue("cat", watchlist[i]->getstring()); - } - set.endArray(); - - set.beginWriteArray("commands"); - for (int i = 0; i < commands.size(); i++) - { - set.setArrayIndex(i); - set.setValue("cmd", commands[i]->getString()); - } - set.endArray(); - - /* - fprintf(f, "hidden_process:"); - for(int i = 0; i < hidden_process.size(); i++) { - if(i!=0) fprintf(f,","); - fprintf(f,"%s",(const char *)hidden_process[i]); - } - */ - - /// printf("Qps: setting saved !\n"); -} - -// set the window_group hint to that of the main (qps) window -// DELETE ? -> need function , why? -void Qps::setWindowGroup(QWidget *w) -{ - /* - XWMHints wmh; - - wmh.flags = WindowGroupHint; - wmh.window_group = handle(); - XSetWMHints(w->x11Display(), w->handle(), &wmh); - */ -} - -// DEL -void Qps::setCommand(int argc, char **argv) -{ - // bug: argv[0] should really be frobbed into an absolute path name here - /// XSetCommand(x11Display(), handle(), argv, argc); -} - -// return host name with domain stripped -QString short_hostname() -{ - //// int gethostname(char *name, size_t len); // hyun? - struct utsname u; - uname(&u); - char *p = strchr(u.nodename, '.'); - if (p) - *p = '\0'; - QString s(u.nodename); - return s; -} - -bool opt_eq(const char *arg, const char *opt) -{ - if (arg[0] == '-') - arg++; - if (arg[0] == '-') - arg++; - - return strncmp(arg, opt, strlen(opt)) == 0; -} - -// print some help to stdout and exit -void print_help(char *cmdname) -{ - fprintf(stderr, "Usage: qps [options]\n" - "Options:\n" - " -version\t\tversion\n" - " -mini \t\tstart Minimized\n"); -} - -/// #include -QByteArray geo; -void Qps::clicked_trayicon() -{ - // QT 4.5 bug : hide(), then show() window's pos will be changed a - // little. - if (isMinimized() or (isVisible() == false)) // if hidden - { - // printf("showNormal\n"); - // show(); // works.. - showNormal(); // works.. - return; - } - - // METACITY- focus stealing prevention : XRaiseWindow() not work. - // Compiz works well !! - if (isActiveWindow() == false) // if lower than other windows - { - raise(); - activateWindow(); // for WindowMaker - return; - } - hide(); -} - -void Qps::clicked_trayicon(QSystemTrayIcon::ActivationReason r) -{ - // printf("ActivationReason = %d\n",r); - if (r == QSystemTrayIcon::Trigger) - { - if (!isHidden()) - { - hide(); - } - else - { - showNormal(); - } - } - if (r == QSystemTrayIcon::Context) - { - } -} - -// -void Qps::hideEvent(QHideEvent *event) -{ - // printf("hideEvent()\n"); - if (trayicon->hasSysTray()) - { - // event->accept(); - } - // geo=saveGeometry(); -} - -#include -void signal_handler(int sig) -{ - // if(sig==SIGINT) printf("DEBUG: catched SIGINT \n"); - // if(sig==SIGTERM)printf("DEBUG: catched SIGTERM \n"); - qps->save_quit(); - // printf("Qps: suiciding.... wait \n"); - printf("Qps: terminating...\n"); -} - -int main(int argc, char **argv, char **envp) -{ - signal(SIGTERM, signal_handler); - signal(SIGINT, signal_handler); - signal(SIGKILL, signal_handler); - - Lookup::initproctitle(argv, envp); // will be REMOVEd - - for (int i = 1; i < argc; i++) - { - if (opt_eq(argv[i], "version")) - { - fprintf(stderr, - "qps version " QPS_VERSION ", using Qt library %s\n", - qVersion()); - exit(1); - } - else if (opt_eq(argv[i], "help") || opt_eq(argv[i], "h")) - { - print_help(argv[0]); - exit(1); - } - else if (opt_eq(argv[i], "session") or opt_eq(argv[i], "sm")) - { - flag_session_start = true; - sleep(2); // **** important !! maybe systray runs later - } - else if (opt_eq(argv[i], "min")) // mini - { - flag_start_mini = true; - } - else if (strstr(argv[i], "screen")) - { - // int screenshot_main(int argc, char **argv); - // screenshot_main(argc,argv); - // return 1; - } - } - // codec = QTextCodec::codecForLocale(); // for Local locale - check_system_requirement(); // check kernel version.. etc in proc.cpp - check_qps_running(); // check already qps running. in misc.cpp - - QpsApp app(argc, argv); - - init_misc(0); // init misc, some test code runs ... - qps = new Qps(); - // sleep(20); - - QString caption( QString( "%1@%2").arg( getenv( "USER" ) ) - .arg( short_hostname() ) ); // geteuid() - - qps->setWindowTitle(UniString(caption)); - qps->setWindowIcon(QPixmap((const char **)icon_xpm)); - - // MOVETO Systray - QMenu *menu = new QMenu(qps); - /// menu->addAction( UniString("About"), qps, SLOT(about()) ); - menu->addAction( QObject::tr( "Show" ) - , qps - , SLOT( showNormal() ) ); - menu->addAction( QObject::tr( "Hide" ) - , qps - , SLOT( hide() ) ); - menu->addSeparator(); - if (flag_devel) - { - menu->addAction( QObject::tr( "ScreenShot" ) - , qps - , SLOT(start_screenshot())); - } - - menu->addAction( QObject::tr( "Quit" ) - , qps - , SLOT(save_quit()) - , Qt::ALT + Qt::Key_Q); - - trayicon = new TrayIcon(QPixmap((const char **)icon_xpm /* init icon */), - "qps", menu); - QObject::connect(trayicon, SIGNAL(clicked(const QPoint &)), qps, - SLOT(clicked_trayicon())); - QObject::connect(trayicon, SIGNAL(doubleClicked(const QPoint &)), qps, - SLOT(clicked_trayicon())); - QObject::connect(trayicon, - SIGNAL(activated(QSystemTrayIcon::ActivationReason)), qps, - SLOT(clicked_trayicon(QSystemTrayIcon::ActivationReason))); - - trayicon->sysInstall(); // ok - - if (flag_session_start or flag_start_mini) - { - if (trayicon->hasSysTray()) - { - qps->hide(); // qps->setHidden(true); - } - else - { - qps->showMinimized(); - } - } - else - { - qps->show(); - } - - // Testing - // app.setStyleSheet(" QToolTip { opacity: 100;" "border-width: - // 1px; - // border-style: solid; border-color: rgb(50,110,80); border-radius: - // 4px ;" - //"background-color : rgba(0,0,0); padding: 3px; color: rgb(0,255,150); - //}"); - AddLog( QString( "Qps %1 launched." ).arg( QPS_VERSION ) ); - - return app.exec(); -} - -#include -#include -#include -#include -#include - -void Qps::test_popup(const QUrl &link) -{ - - QClipboard *clipboard = QApplication::clipboard(); - clipboard->setText(link.toString(), QClipboard::Clipboard); - popupx->popup(QCursor::pos()); -} - -void Qps::about() -{ - QDialog *diag = new QDialog(this); - diag->setWindowTitle( tr( "About" ) ); - QVBoxLayout *lay = new QVBoxLayout(diag); - - QLabel *label = new QLabel(diag); - // label->setMinimumSize( 400,200 ); - label->setOpenExternalLinks(true); - // QLabel::setOpenExternalLinks ( bool open ); - QTextBrowser *browser = new QTextBrowser(diag); - browser->setOpenExternalLinks(false); - browser->setOpenLinks(false); - - connect(browser, SIGNAL(anchorClicked(const QUrl &)), this, - SLOT(test_popup(const QUrl &))); - - lay->addWidget(label); - lay->addWidget(browser); - - // QDesktopServices::openUrl(QUrl("file:///", QUrl::TolerantMode)); - // - - QString str( tr( "

Qps %1 - A Visual Process Manager

%2 using Qt library %3" - "

" - "Source: https://github.com/lxqt/qps/" - "
" - "Bugtracker: https://github.com/lxqt/qps/issues") - .arg( QPS_VERSION ) - .arg( -#ifdef SOLARIS -#ifdef _LP64 - "64-bit " -#else - "32-bit " -#endif - "Solaris version " -#else - "" -#endif // SOLARIS - ) - .arg( qVersion() ) ); - label->setText( str ); - str.append( tr( "Original Qps by
" - "Mattias Engdegård (f91-men@nada.kth.se)

" - "Contributors
" - "Olivier.Daudel@u-paris10.fr
" - "jsanchez@todounix.homeip.net
" - "daehyun.yang@gmail.com
" - "Luís Pereira (luis.artur.pereira@gmail.com)
" - "Alf Gaida (agaida@siduction.org)
" - "Paulo Lieuthier (paulolieuthier@gmail.com)
" - "Jerome Leclanche (jerome@leclan.ch)
" ) ); - browser->setText(str); - - QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Ok - , Qt::Horizontal - , diag ); - - lay->addWidget(bbox); - - connect(bbox, SIGNAL(accepted()), diag, SLOT(accept())); - - diag->exec(); - - // mb.setIconPixmap(QPixmap((const char **)icon_xpm)); -} - -void Qps::license() // -> help() -{ - - QDialog *diag = new QDialog(this); - diag->setWindowTitle("Quick Help"); - // diag->setSizeGripEnabled(true) ; - QHBoxLayout *lay = new QHBoxLayout(diag); - - QTextBrowser *browser = new QTextBrowser(diag); - browser->setMinimumSize(400, 200); - - lay->addWidget(browser); - - // QDesktopServices::openUrl(QUrl("file:///", QUrl::TolerantMode)); - // QLabel::setOpenExternalLinks ( bool open ); - browser->setOpenExternalLinks(true); - browser->setOpenLinks(true); - browser->setText( tr( "

QPS Help

" - "Updated: May 24 2005
" - "http://kldp.net/projects/" - "qps
" - - "" - " " - " " - " Quit" - " " - " " - " " - " " - " Update" - " " - " " - " " - " " - "" - " " - " " - "
  CTRL + q , CTRL + x" - "
 Space , Enter " - "
process Terminate ALT + T , DELETE
process Kill ALT + K
" ) ); - diag->exec(); -} - -// slot -void Qps::start_screenshot() {} - -// MOVETO qps::keyPressEvent() -void SearchBox::keyPressEvent(QKeyEvent *e) -{ - if (e->key() == Qt::Key_Delete) - { - qps->sig_term(); - return; - } - - if (e->key() == Qt::Key_Escape) - { - - clear(); // clear searchbox - - qps->pstable->clearAllSelections(); // TEMP - - // xb->setDown(true); - // event_xbutton_clicked(); - // xb->setDown(false); - } - else - QLineEdit::keyPressEvent(e); - - qps->procview->filterstr = text(); - qps->pstable->refresh(); /// qps->refresh(); // better ? -} - -void STATUSBAR_COUNT_UPDATE() {} - -void STATUSBAR_SETCOUNT(int n) -{ - if (qps) - qps->statusBar->update(n); -} - -void PSTABLE_SETTREEMODE(bool mode) -{ - if (qps) - qps->pstable->setTreeMode(mode); -} - -void QPS_SHOW() -{ - if (qps) - qps->showNormal(); -} - -// TESTING -int QPS_PROCVIEW_CPU_NUM() -{ - if (qps) - return qps->procview->num_cpus; - else - return 0; -} - -void AddLog(QString str) -{ - qDebug() << qps; - if (qps && qps->logbox) - { - qps->logbox->append(str); - } -} diff --git a/src/qps.h b/src/qps.h deleted file mode 100644 index 1e77f52..0000000 --- a/src/qps.h +++ /dev/null @@ -1,338 +0,0 @@ -/* - * qps.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef QPS_H -#define QPS_H - -#ifndef USING_PCH -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif - -#if QT_VERSION >= 0x040200 -#else -//#error Qt library version 4.2 or higher is needed for this version of qps -#endif - -#define HTABLE1 -#include "misc.h" -#ifdef HTABLE2 -#include "pstable2.h" -#else -#include "pstable.h" -#endif -#include "proc.h" -#include "infobar.h" -#include "fieldsel.h" -#include "details.h" -#include "prefs.h" -#include "command.h" - -#define DEBUG printf - -#define FUNC_START -#define FUNC_END - -#include - -class CommandDialog; - -class Qps : public QWidget -{ - Q_OBJECT - public: - Qps(); - ~Qps(); - - void set_update_period(int milliseconds); - void setWindowGroup(QWidget *w); - void setCommand(int argc, char **argv); - void setIconSize(int w, int h) { icon_width = w, icon_height = h; } - void write_settings(); - void save_settings(); - - QPixmap *get_load_icon(); - - // settings - static bool show_file_path; // shows command/file map path - static bool show_cmd_path; // DEL CMDLINE shows command path - static bool show_infobar; // information bar is shown - static bool show_ctrlbar; // control bar is shown - static bool show_statusbar; // - static bool show_mem_bar; // memory is shown as a bar - static bool show_swap_bar; // swap is shown as a bar - static bool show_cpu_bar; // cpu states are shown as a bar - static bool show_load_graph; // load is shown as a graph - static bool load_in_icon; // load graph in icon - static bool auto_save_options; // settings saved on exit -#ifdef LINUX - static bool hostname_lookup; // do a name lookup on socket addresses - static bool service_lookup; // map port numbers to service names -#endif - static bool pids_to_selection; // selected processes' PIDS to X11 sel - static bool vertical_cpu_bar; // save space with SMP - - static int swaplimit; // limit of swap redline, in K or % - static bool swaplim_percent; // true if swaplimit is in % -#ifdef SOLARIS - static bool - normalize_nice; // whether nice should be normalized (normal nice - // is 0 etc) - static bool use_pmap; // use /proc/bin/pmap for map names -#endif - static bool tree_gadgets; // use open/close gadgets (triangles) - static bool tree_lines; // draw tree branch lines - - // static bool comm_is_magic; //DEL, auto-remove COMM - // when - // switching - static bool flag_systray; // trayicon , sytemtray - static bool flag_exit; - static bool flag_show; // last qps-main_window state - static bool flag_useTabView; - static bool flag_qps_hide; - - // colors which may be set by the user - enum - { - COLOR_CPU_USER, -#ifdef LINUX - COLOR_CPU_NICE, -#endif - COLOR_CPU_SYS, -#ifdef SOLARIS - COLOR_CPU_WAIT, -#endif - COLOR_CPU_IDLE, - COLOR_MEM_USED, - COLOR_MEM_BUFF, - COLOR_MEM_CACHE, - COLOR_MEM_FREE, - COLOR_SWAP_USED, - COLOR_SWAP_FREE, - COLOR_SWAP_WARN, - COLOR_LOAD_BG, - COLOR_LOAD_FG, - COLOR_LOAD_LINES, - COLOR_SELECTION_BG, - COLOR_SELECTION_FG, - NUM_COLORS - }; - - enum menuid - { - MENU_SIGQUIT, - MENU_SIGILL, - MENU_SIGABRT, - MENU_SIGFPE, - MENU_SIGSEGV, - MENU_SIGPIPE, - MENU_SIGALRM, - MENU_SIGUSR1, - MENU_SIGUSR2, - MENU_SIGCHLD, - MENU_SIGCONT, - MENU_SIGSTOP, - MENU_SIGTSTP, - MENU_SIGTTIN, - MENU_SIGTTOU, - MENU_RENICE, - MENU_SCHED, - MENU_DETAILS, - MENU_PARENT, - MENU_CHILD, - MENU_DYNASTY, - MENU_SIGTERM, - MENU_SIGHUP, - MENU_SIGINT, - MENU_SIGKILL, - MENU_OTHERS, - MENU_PROCS, - MENU_FIELDS, - MENU_CUSTOM, - MENU_PATH, - MENU_INFOBAR, - MENU_CTRLBAR, - MENU_CUMUL, - MENU_PREFS, - MENU_ADD_HIDDEN, - MENU_REMOVE_HIDDEN, - MENU_STATUS, -#ifdef MOSIX - POPUP_MIGRATE, -#endif - MENU_FIRST_COMMAND // must be last - }; - - public slots: - void start_screenshot(); - void clicked_trayicon(QSystemTrayIcon::ActivationReason); - void clicked_trayicon(); - void sig_term(); - void sig_hup(); - void sig_stop(); - void sig_cont(); - void sig_kill(); - void signal_menu(QAction *); - void run_command(QAction *); - void about(); - void license(); - void menu_update(); - void menu_toggle_path(); - void menu_toggle_infobar(); - void menu_toggle_ctrlbar(); - void menu_toggle_statusbar(); - void menu_toggle_cumul(); - void menu_prefs(); - void menu_renice(); - void menu_sched(); - void Action_Detail(); - void menu_parent(); - void menu_children(); - void menu_dynasty(); - void menu_custom(); - void menu_remove_field(); - void menu_edit_cmd(); - void mig_menu(int id); // MOSIX only - void make_command_menu(); - void view_menu(QAction *); - void save_quit(); - void add_fields_menu(int id); - void add_fields_menu(QAction *act); - void tabChanged(int i); - - void show_popup_menu(QPoint p); - void context_heading_menu(QPoint p, int col); - - void update_menu_selection_status(); - void field_added(int index); - void field_removed(int index); - void set_table_mode(bool treemode); // hmmm - - void details_closed(Details *d); - void open_details(int row); - - void config_change(); - - void update_timer(); - void refresh(); - void refresh_details(); - void test_popup(const QUrl &link); - void update_menu_status(); - - protected: - // reimplementation of QWidget methods - virtual void timerEvent(QTimerEvent *); - virtual void closeEvent(QCloseEvent *); - virtual void moveEvent(QMoveEvent *event); - virtual void mouseMoveEvent(QMouseEvent *event); - virtual void hideEvent(QHideEvent *event); - virtual void resizeEvent(QResizeEvent *event); - virtual void paintEvent(QPaintEvent *event); - virtual void enterEvent(QEvent *event); - virtual void leaveEvent(QEvent *event); - virtual void showEvent(QShowEvent *event); - virtual void focusInEvent(QFocusEvent *event); - virtual void focusOutEvent(QFocusEvent *event); - virtual void keyPressEvent(QKeyEvent *event); - // bool event(QEvent *e); - void transfer_selection(); - void adjust_popup_menu(QMenu *m, bool cont); - void adjust_popup_menu(); - bool all_selected_stopped(); - - void locate_relatives(int Procinfo::*a, int Procinfo::*b); - QMenu *make_signal_popup_menu(); -#ifdef MOSIX - QMenu *make_migrate_menu(); - void migrate_selected(int sig); -#endif - void send_to_selected(int sig); - void sendsig(Procinfo *p, int sig); - void earlier_refresh(); - bool read_settings(); - - bool load_settings(); - - void bar_visibility(); - void set_default_icon(); - void set_load_icon(); - - public: -#ifdef HTABLE2 - Pstable2 *pstable; // test -#else - Pstable *pstable; -#endif - Procview *procview; - StatusBar *statusBar; - // Netable *netable; - QTextEdit *logbox; - void update_icon(); - - private: - QMenuBar *menubar; - QMenu *m_field; // Field Menu - QMenu *m_view; // Field Menu - QAction *am_view; - QMenu *m_command; - QMenu *m_options; - QMenu *m_popup; - QMenu *m_headpopup; - QMenu *m_fields; - QMenu *popupx; // testing - - bool selection_items_enabled; // state of certain menu items (???) - - Infobar2 *infobar; // tmp - ControlBar *ctrlbar; - FieldSelect *field_win; - Preferences *prefs_win; - CommandDialog *command_win; - - QList
details; - - int update_period; // in mili second - static const int eternity = 0x7fffffff; // turns off automatic update - // the Linux kernel updates its load average counters every 5 seconds - // (kernel 2.0.29), so there is no point in reading it too often - static const int load_update_period = 4800; // in ms - int update_load_time; // time left to update load - - // size of our icon - int icon_width; - int icon_height; - int timer_id; - - QPixmap *default_icon; - bool default_icon_set; // true if default icon is current icon - int context_col; // where heading context menu was clicked -}; - -#endif // QPS_H diff --git a/src/qpsapp.cpp b/src/qpsapp.cpp deleted file mode 100644 index 5678f6a..0000000 --- a/src/qpsapp.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* - * qpsapp.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * Copyright 2005-2012 fasthyun@magicn.com - * Copyright 2015- daehyun.yang@gmail.com - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include "qpsapp.h" - -void QpsApp::saveState(QSessionManager &manager) -{ - // printf("saveState()\n"); - // manager.setRestartHint(QSessionManager::RestartIfRunning); - // manager.release(); -} - -// this is called when X Logout -// closeEvent() never called !! -void QpsApp::commitData(QSessionManager &manager) -{ - /* - printf("commitData()\n"); - manager.setRestartHint(QSessionManager::RestartIfRunning); - qps->flag_exit=true; // ready to Logout - qps->save_settings() ; - manager.release(); - sleep(2); - return; - if (manager.allowsInteraction()) { - int ret = QMessageBox::warning( - qps, - tr("My Application"), - tr("Save changes to document?"), - QMessageBox::Save | QMessageBox::Discard | - QMessageBox::Cancel); - - switch (ret) { - case QMessageBox::Save: - manager.release(); - // if (!saveDocument()) manager.cancel(); - break; - case QMessageBox::Discard: - break; - case QMessageBox::Cancel: - default: - manager.cancel(); - } - } else { - - manager.release(); - - // we did not get permission to interact, then - // do something reasonable instead - } - */ - /* - //DEL sm.release(); - qDebug("Qps: Session saved\n"); - // sm.cancel(); - //sm.setRestartHint (QSessionManager::RestartIfRunning); - QApplication::commitData(sm); - */ -} diff --git a/src/qpsapp.h b/src/qpsapp.h deleted file mode 100644 index 210a826..0000000 --- a/src/qpsapp.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * qpsapp.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * Copyright 2005-2012 fasthyun@magicn.com - * Copyright 2015- daehyun.yang@gmail.com - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef QPSAPP_H -#define QPSAPP_H - -#include - -// MOD!!!: For systray update. -// this trick very suck, but I can't find a better solution. -class QpsApp : public QApplication -{ - public: - QpsApp(int &argc, char **argv) : QApplication(argc, argv){}; - void commitData(QSessionManager &sm); - void saveState(QSessionManager &manager); - - /* - virtual bool x11EventFilter ( XEvent *xev ){ - // catch X11 event for systray_update !! which event? - ///if(trayicon!=NULL) return - trayicon->checkNewTrayEvent(xev); - return false; // events to qt. - }; */ -}; - -#endif // QPSAPP_H diff --git a/src/qttableview.cpp b/src/qttableview.cpp deleted file mode 100644 index 02351c8..0000000 --- a/src/qttableview.cpp +++ /dev/null @@ -1,1819 +0,0 @@ -/********************************************************************** -** $Id: qttableview.cpp,v 1.115 2011/08/27 00:13:41 fasthyun Exp $ -** -** Implementation of QtTableView class -** -** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. -** -** This file contains a class moved out of the Qt GUI Toolkit API. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech AS of Norway and appearing in the file -** LICENSE.QPL included in the packaging of this file. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file COPYING included in the -** packaging of this file. -** -** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition -** licenses may use this file in accordance with the Qt Commercial License -** Agreement provided with the Software. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about Qt Commercial License Agreements. -** See http://www.trolltech.com/qpl/ for QPL licensing information. -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#include "qttableview.h" - -enum ScrollBarDirtyFlags -{ - verSteps = 0x02, - verRange = 0x04, - verValue = 0x08, - horSteps = 0x20, - horRange = 0x40, - horValue = 0x80, - verMask = 0x0F, - horMask = 0xF0 -}; - -QtTableView::QtTableView(QWidget *parent, const char *name) - : QAbstractScrollArea(parent) -{ - nRows = nCols = 0; // zero rows/cols - - xCellOffs = yCellOffs = 0; // zero offset - xCellDelta = yCellDelta = 0; // zero cell offset - xOffs = yOffs = 0; // zero total pixel offset - cellH = cellW = 0; // user defined cell size - vScrollBar = hScrollBar = 0; // no scroll bars - tFlags = 0; - sbDirty = 0; - verSliding = false; - verSnappingOff = false; - horSliding = false; - horSnappingOff = false; - inSbUpdate = false; - flag_view = 0; - view = viewport(); - enablePaint = true; - test = false; - - // setSizePolicy(QSizePolicy - // (QSizePolicy::Expanding,QSizePolicy::Expanding)); - // setFocusPolicy(Qt::NoFocus); - - verticalScrollBar(); // created - horizontalScrollBar(); // created - // setFocusPolicy(Qt::NoFocus); - // setFrameShape (QFrame::NoFrame); - // setStyle(new QCleanlooksStyle); // compiz bug - // setStyle(new QWindowsStyle); // repaint bug -} -/* - Destroys the table view. -*/ -QtTableView::~QtTableView() -{ - delete vScrollBar; - delete hScrollBar; -} - -/* - Returns a pointer to the vertical scroll bar mainly so you can - connect() to its signals. Note that the scroll bar works in pixel - values; use findRow() to translate to cell numbers. -*/ - -QScrollBar *QtTableView::verticalScrollBar() const -{ - QtTableView *that = (QtTableView *)this; // semantic const - if (!vScrollBar) - { - QScrollBar *sb = QAbstractScrollArea::verticalScrollBar(); - sb->setFocusPolicy(Qt::NoFocus); - connect(sb, SIGNAL(valueChanged(int)), SLOT(verSbValue(int))); - connect(sb, SIGNAL(sliderMoved(int)), SLOT(verSbSliding(int))); - connect(sb, SIGNAL(sliderReleased()), SLOT(verSbSlidingDone())); - that->vScrollBar = sb; - // vScrollBar = sb; - return sb; - } - return vScrollBar; -} - -QScrollBar *QtTableView::horizontalScrollBar() const -{ - QtTableView *that = (QtTableView *)this; // semantic const - if (!hScrollBar) - { - QScrollBar *sb = QAbstractScrollArea::horizontalScrollBar(); - sb->setFocusPolicy(Qt::NoFocus); - // sb->setTracking( true ); // bar cause heads moving - connect(sb, SIGNAL(valueChanged(int)), SLOT(horSbValue(int))); - connect(sb, SIGNAL(sliderMoved(int)), SLOT(horSbSliding(int))); - connect(sb, SIGNAL(sliderReleased()), SLOT(horSbSlidingDone())); - that->hScrollBar = sb; - return sb; - } - return hScrollBar; -} - -/* - Sets the number of rows of the table to \a rows (must be non-negative). - Does not change topCell(). - The table repaints itself automatically if updatesEnabled() is set. - - numCols(), setNumCols(), numRows() -*/ - -void QtTableView::setNumRows(int rows) -{ - /// view->setMaximumHeight(rows*cellH); - if (rows < 0) - { - qWarning("QtTableView::setNumRows: (%s) Negative argument %d.", - "unnamed", rows); - return; - } - if (nRows == rows) - return; - - if (isVisible()) - { - int oldLastVisible = lastRowVisible(); - int oldTopCell = topCell(); - } - nRows = rows; - updateScrollBars(verRange); -} - -void QtTableView::setNumCols(int cols) -{ - if (cols < 0) - { - qWarning("QtTableView::setNumCols: (%s) Negative argument %d.", - "unnamed", cols); - return; - } - if (nCols == cols) - return; - int oldCols = nCols; - nCols = cols; - updateScrollBars(horRange); // int maxCol = lastColVisible(); -} - -/* - \fn int QtTableView::topCell() const - Returns the index of the first row in the table that is visible in - the view. The index of the first row is 0. - \sa leftCell(), setTopCell() - Scrolls the table so that \a row becomes the top row. - The index of the very first row is 0. - \sa setYOffset(), setTopLeftCell(), setLeftCell() -*/ - -void QtTableView::setTopCell(int row) -{ - setTopLeftCell(row, -1); - return; -} - -/* - \fn int QtTableView::leftCell() const - Returns the index of the first column in the table that is visible in - the view. The index of the very leftmost column is 0. - \sa topCell(), setLeftCell() -*/ - -/* - Scrolls the table so that \a col becomes the leftmost - column. The index of the leftmost column is 0. - \sa setXOffset(), setTopLeftCell(), setTopCell() -*/ - -void QtTableView::setLeftCell(int col) -{ - setTopLeftCell(-1, col); - return; -} - -/* - Scrolls the table so that the cell at row \a row and colum \a - col becomes the top-left cell in the view. The cell at the extreme - top left of the table is at position (0,0). - \sa setLeftCell(), setTopCell(), setOffset() -*/ - -void QtTableView::setTopLeftCell(int row, int col) -{ - int newX = xOffs; - int newY = yOffs; - - if (col >= 0) - { - if (cellW) - { - newX = col * cellW; - if (newX > maxXOffset()) - newX = maxXOffset(); - } - else - { - newX = 0; - while (col) - newX += cellWidth(--col); // optimize using current! ### - } - } - if (row >= 0) - { - if (cellH) - { - newY = row * cellH; - if (newY > maxYOffset()) - newY = maxYOffset(); - } - else - { - newY = 0; - while (row) - newY += cellHeight(--row); // optimize using current! ### - } - } - setOffset(newX, newY); -} - -/* - \fn int QtTableView::xOffset() const - - Returns the x coordinate in \e table coordinates of the pixel that is - currently on the left edge of the view. - - \sa setXOffset(), yOffset(), leftCell() */ - -/* - Scrolls the table so that \a x becomes the leftmost pixel in the view. - The \a x parameter is in \e table coordinates. - - The interaction with \link setTableFlags() Tbl_snapToHGrid - \endlink is tricky. - - \sa xOffset(), setYOffset(), setOffset(), setLeftCell() -*/ - -void QtTableView::setXOffset(int x) { setOffset(x, yOffset()); } - -/* - int QtTableView::yOffset() const - - Returns the y coordinate in \e table coordinates of the pixel that is - currently on the top edge of the view. - - :setYOffset(), xOffset(), topCell() -*/ - -// SCROLL Code called by wheel -void QtTableView::setYOffset(int y) { setOffset(xOffset(), y, true); } - -/* - Scrolls the table so that \a (x,y) becomes the top-left pixel - in the view. Parameters \a (x,y) are in \e table coordinates. - - The interaction with \link setTableFlags() Tbl_snapTo*Grid \endlink - is tricky. If \a updateScrBars is true, the scroll bars are - updated. - - \sa xOffset(), yOffset(), setXOffset(), setYOffset(), setTopLeftCell() -*/ - -void QtTableView::setOffset(int x, int y, bool updateScrBars) -{ - if ((!testTableFlags(Tbl_snapToHGrid) || xCellDelta == 0) && - (!testTableFlags(Tbl_snapToVGrid) || yCellDelta == 0) && - (x == xOffs && y == yOffs)) - return; - - if (x < 0) - x = 0; - if (y < 0) - y = 0; - - if (cellW) - { - if (x > maxXOffset()) - x = maxXOffset(); - xCellOffs = x / cellW; - if (!testTableFlags(Tbl_snapToHGrid)) - { - xCellDelta = (short)(x % cellW); - } - else - { - x = xCellOffs * cellW; - xCellDelta = 0; - } - } - else - { - int xn = 0, xcd = 0, col = 0; - while (col < nCols - 1 && x >= xn + (xcd = cellWidth(col))) - { - xn += xcd; - col++; - } - xCellOffs = col; //!!! - if (testTableFlags(Tbl_snapToHGrid)) - { - xCellDelta = 0; - x = xn; - } - else - { - xCellDelta = (short)(x - xn); - } - } - if (cellH) - { // same cellHegiht - if (y > maxYOffset()) - y = maxYOffset(); - yCellOffs = y / cellH; //******** - if (!testTableFlags(Tbl_snapToVGrid)) - { - yCellDelta = (short)(y % cellH); - } - else - { - y = yCellOffs * cellH; - yCellDelta = 0; - } - } - else - { - } - // printf("y=%d yOffs=%d ", y,yOffs); - int dx = (xOffs - x); - int dy = (yOffs - y); // - xOffs = x; - yOffs = y; - if (updatesEnabled() && isVisible()) - { - // *** scroll() call update( desposal region ) !! - // printf("scroll: xpixel=%d , ypixel=%d \n",xPixels,yPixels); - scrollTrigger(dx, dy); - view->scroll(dx, dy); - } - if (updateScrBars) - updateScrollBars(verValue | horValue); -} - -void QtTableView::scrollContentsBy(int dx, int dy) -{ - // view->update() //default - // printf("scroll: dx=%d , dy=%d \n",dx,dy); -} -/* - Moves the visible area of the table right by \a xPixels and - down by \a yPixels pixels. Both may be negative. - \warning You might find that QScrollView offers a higher-level of - functionality than using QtTableView and this function. - setXOffset(), setYOffset(), setOffset(), setTopCell(), setLeftCell() -*/ - -/* - \overload int QtTableView::cellWidth() const - - Returns the column width in pixels. Returns 0 if the columns have - variable widths. - - \sa setCellWidth(), cellHeight() - Returns the width of column \a col in pixels. - - setCellWidth(), cellHeight(), totalWidth(), updateTableSize() -*/ - -// virtual -int QtTableView::cellWidth(int col) { return cellW; } - -/* - Sets the width in pixels of the table cells to \a cellWidth. - - Setting it to 0 means that the column width is variable. When - set to 0 (this is the default) QtTableView calls the virtual function - cellWidth() to get the width. - - \sa cellWidth(), setCellHeight(), totalWidth(), numCols() -*/ - -void QtTableView::setCellWidth(int cellWidth) -{ - if (cellW == cellWidth) - return; -#if defined(QT_CHECK_RANGE) - if (cellWidth < 0 || cellWidth > SHRT_MAX) - { - qWarning("QtTableView::setCellWidth: (%s) Argument out of " - "range (%d)", - name("unnamed"), cellWidth); - return; - } -#endif - cellW = (short)cellWidth; - - updateScrollBars(horSteps | horRange); - if (updatesEnabled() && isVisible()) - update(); -} - -/* - \overload int QtTableView::cellHeight() const - - Returns the row height, in pixels. Returns 0 if the rows have - variable heights. - - \sa setCellHeight(), cellWidth() - - Returns the height of row \a row in pixels. - - This function is virtual and must be reimplemented by subclasses that - have variable cell heights. Note that if the total table height - changes, updateTableSize() must be called. - - \sa setCellHeight(), cellWidth(), totalHeight() -*/ - -int QtTableView::cellHeight(int) { return cellH; } - -/* - Sets the height in pixels of the table cells to \a cellHeight. - - Setting it to 0 means that the row height is variable. When set - to 0 (this is the default), QtTableView calls the virtual function - cellHeight() to get the height. - - cellHeight(), setCellWidth(), totalHeight(), numRows() -*/ -// call by htable:: fontChanged -void QtTableView::setCellHeight(int cellHeight) -{ - - if (cellH == cellHeight) - return; -#if defined(QT_CHECK_RANGE) - if (cellHeight < 0 || cellHeight > SHRT_MAX) - { - qWarning("QtTableView::setCellHeight: (%s) Argument out of " - "range (%d)", - name("unnamed"), cellHeight); - return; - } -#endif - cellH = (short)cellHeight; - if (updatesEnabled() && isVisible()) - update(); - updateScrollBars(verSteps | verRange); -} - -// using -int QtTableView::totalWidth() -{ - if (cellW) - { - return cellW * nCols; - } - else - { - int tw = 0; - for (int i = 0; i < nCols; i++) - tw += cellWidth(i); - return tw; - } -} - -// using -int QtTableView::totalHeight() -{ - if (cellH) - { - return cellH * nRows; - } - else - { - int th = 0; - for (int i = 0; i < nRows; i++) - th += cellHeight(i); - return th; - } -} - -/* - \fn uint QtTableView::tableFlags() const - - Returns the union of the table flags that are currently set. - - \sa setTableFlags(), clearTableFlags(), testTableFlags() -*/ - -/* - \fn bool QtTableView::testTableFlags( uint f ) const - - Returns true if any of the table flags in \a f are currently set, - otherwise false. - - \sa setTableFlags(), clearTableFlags(), tableFlags() -*/ - -/* - Sets the table flags to \a f. - - If a flag setting changes the appearance of the table, the table is - repainted if - and only if - updatesEnabled() is true. - - The table flags are mostly single bits, though there are some multibit - flags for convenience. Here is a complete list: - - Tbl_vScrollBar - The table has a vertical scroll bar. - Tbl_hScrollBar
- The table has a horizontal scroll bar. - Tbl_autoVScrollBar
- The table has a vertical scroll bar if - - and only if - the table is taller than the view. - Tbl_autoHScrollBar
The table has a horizontal scroll bar if - - and only if - the table is wider than the view. - Tbl_autoScrollBars
- The union of the previous two flags. - Tbl_clipCellPainting
- The table uses QPainter::setClipRect() to - make sure that paintCell() will not draw outside the cell - boundaries. - Tbl_cutCellsV
- The table will never show part of a - cell at the bottom of the table; if there is not space for all of - a cell, the space is left blank. -
Tbl_cutCellsH
- The table will never show part of a - cell at the right side of the table; if there is not space for all of - a cell, the space is left blank. -
Tbl_cutCells
- The union of the previous two flags. -
Tbl_scrollLastHCell
- When the user scrolls horizontally, - let him/her scroll the last cell left until it is at the left - edge of the view. If this flag is not set, the user can only scroll - to the point where the last cell is completely visible. -
Tbl_scrollLastVCell
- When the user scrolls vertically, let - him/her scroll the last cell up until it is at the top edge of - the view. If this flag is not set, the user can only scroll to the - point where the last cell is completely visible. -
Tbl_scrollLastCell
- The union of the previous two flags. -
Tbl_smoothHScrolling
- The table scrolls as smoothly as - possible when the user scrolls horizontally. When this flag is not - set, scrolling is done one cell at a time. -
Tbl_smoothVScrolling
- The table scrolls as smoothly as - possible when scrolling vertically. When this flag is not set, - scrolling is done one cell at a time. -
Tbl_smoothScrolling
- The union of the previous two flags. -
Tbl_snapToHGrid
- Except when the user is actually scrolling, - the leftmost column shown snaps to the leftmost edge of the view. -
Tbl_snapToVGrid
- Except when the user is actually - scrolling, the top row snaps to the top edge of the view. -
Tbl_snapToGrid
- The union of the previous two flags. - - - You can specify more than one flag at a time using bitwise OR. - - Example: - setTableFlags( Tbl_smoothScrolling | Tbl_autoScrollBars ); - - \warning The cutCells options (\c Tbl_cutCells, \c Tbl_cutCellsH and - Tbl_cutCellsV) may cause painting problems when scrollbars are - enabled. Do not combine cutCells and scrollbars. - clearTableFlags(), testTableFlags(), tableFlags() -*/ - -void QtTableView::setTableFlags(uint f) -{ - f = (f ^ tFlags) & f; // clear flags already set - tFlags |= f; - - bool updateOn = updatesEnabled(); - setAutoUpdate(false); - - uint repaintMask = Tbl_cutCellsV | Tbl_cutCellsH; - - if (f & Tbl_autoVScrollBar) - { - updateScrollBars(verRange); - } - if (f & Tbl_autoHScrollBar) - { - updateScrollBars(horRange); - } - if (f & Tbl_scrollLastHCell) - { - updateScrollBars(horRange); - } - if (f & Tbl_scrollLastVCell) - { - updateScrollBars(verRange); - } - if (f & Tbl_snapToHGrid) - { - updateScrollBars(horRange); - } - if (f & Tbl_snapToVGrid) - { - updateScrollBars(verRange); - } - if (f & Tbl_snapToGrid) - { // Note: checks for 2 flags - if (((f & Tbl_snapToHGrid) != 0 && - xCellDelta != 0) || // have to scroll? - ((f & Tbl_snapToVGrid) != 0 && yCellDelta != 0)) - { - repaintMask |= Tbl_snapToGrid; // repaint table - } - } - - if (updateOn) - { - setAutoUpdate(true); - updateScrollBars(); - if (isVisible() && (f & repaintMask)) - update(); - } -} - -/* - Clears the \link setTableFlags() table flags\endlink that are set - in \a f. - - Example (clears a single flag): - \code - clearTableFlags( Tbl_snapToGrid ); - \endcode - - The default argument clears all flags. - - \sa setTableFlags(), testTableFlags(), tableFlags() -*/ - -void QtTableView::clearTableFlags(uint f) -{ - f = (f ^ ~tFlags) & f; // clear flags that are already 0 - tFlags &= ~f; - - bool updateOn = updatesEnabled(); - setAutoUpdate(false); - - uint repaintMask = Tbl_cutCellsV | Tbl_cutCellsH; - - if (f & Tbl_scrollLastHCell) - { - int maxX = maxXOffset(); - if (xOffs > maxX) - { - setOffset(maxX, yOffs); - repaintMask |= Tbl_scrollLastHCell; - } - updateScrollBars(horRange); - } - if (f & Tbl_scrollLastVCell) - { - int maxY = maxYOffset(); - if (yOffs > maxY) - { - setOffset(xOffs, maxY); - repaintMask |= Tbl_scrollLastVCell; - } - updateScrollBars(verRange); - } - if (f & Tbl_smoothScrolling) - { // Note: checks for 2 flags - if (((f & Tbl_smoothHScrolling) != 0 && - xCellDelta != 0) || // must scroll? - ((f & Tbl_smoothVScrolling) != 0 && yCellDelta != 0)) - { - repaintMask |= Tbl_smoothScrolling; // repaint table - } - } - if (f & Tbl_snapToHGrid) - { - updateScrollBars(horRange); - } - if (f & Tbl_snapToVGrid) - { - updateScrollBars(verRange); - } - if (updateOn) - { - setAutoUpdate(true); - updateScrollBars(); // returns immediately if nothing to do - if (isVisible() && (f & repaintMask)) - update(); // repaint(); - } -} - -/* - Sets the auto-update option of the table view to enable. - - If enable is true (this is the default), the view updates itself - automatically whenever it has changed in some way (for example, when a - setTableFlags() flag\endlink is changed). -*/ - -void QtTableView::setAutoUpdate(bool enable) -{ - enablePaint = enable; - // updatesEnabled= enable ; - - // setAttribute(Qt::WA_ForceUpdatesDisabled, !enable); - //// setAttribute(Qt::WA_UpdatesDisabled, !enable); - // d->setUpdatesEnabled_helper(enable); - - return; - - if (updatesEnabled() == enable) - return; - setUpdatesEnabled(enable); // update() call - if (enable) - { - // updateScrollBars(); - } -} - -/* - Returns the index of the last (bottom) row in the view. - The index of the first row is 0. - - If no rows are visible it returns -1. This can happen if the - view is too small for the first row and Tbl_cutCellsV is set. - - \sa lastColVisible() - */ - -int QtTableView::lastRowVisible() const -{ - int cellMaxY; - int row = findRawRow(maxViewY(), &cellMaxY); - if (row == -1 || row >= nRows) - { // maxViewY() past end? - row = nRows - 1; // yes: return last row - } - else - { - if (testTableFlags(Tbl_cutCellsV) && cellMaxY > maxViewY()) - { - if (row == yCellOffs) // cut by right margin? - return -1; // yes, nothing in the view - else - row = row - 1; // cut by margin, one back - } - } - return row; -} - -/* - Returns the index of the last (right) column in the view. - The index of the first column is 0. - - If no columns are visible it returns -1. This can happen if the - view is too narrow for the first column and Tbl_cutCellsH is set. - - \sa lastRowVisible() -*/ - -/* -int QtTableView::lastVisibleCol() const -{ - int cellMaxX; - int col = findRawCol( maxViewX(), &cellMaxX ); - if ( col == -1 || col >= nCols ) { // maxViewX() past end? - col = nCols - 1; // yes: return last col - } else { - col = col - 1; // cell by margin, one back - } - return col; -} */ - -int QtTableView::lastColVisible() const -{ - int cellMaxX; - int col = findRawCol(maxViewX(), &cellMaxX); - if (col == -1 || col >= nCols) - { // maxViewX() past end? - col = nCols - 1; // yes: return last col - } - else - { - if (testTableFlags(Tbl_cutCellsH) && cellMaxX > maxViewX()) - { - if (col == xCellOffs) // cut by bottom margin? - return -1; // yes, nothing in the view - else - col = col - 1; // cell by margin, one back - } - } - return col; -} - -/* - Returns true if \a row is at least partially visible. - \sa colIsVisible() -*/ - -bool QtTableView::rowIsVisible(int row) const { return rowYPos(row, 0); } - -/* - Returns true if \a col is at least partially visible. - \sa rowIsVisible() -*/ - -bool QtTableView::colIsVisible(int col) const { return colXPos(col, 0); } - -/* - \internal - This internal slot is connected to the horizontal scroll bar's - QScrollBar::valueChanged() signal. - - Moves the table horizontally to offset \a val without updating the - scroll bar. -*/ - -void QtTableView::horSbValue(int val) -{ - if (horSliding) - { - horSliding = false; - if (horSnappingOff) - { - horSnappingOff = false; - tFlags |= Tbl_snapToHGrid; - } - } - setOffset(val, yOffs, false); -} - -/* - \internal - This internal slot is connected to the horizontal scroll bar's - QScrollBar::sliderMoved() signal. - - Scrolls the table smoothly horizontally even if \c Tbl_snapToHGrid is set. -*/ - -void QtTableView::horSbSliding(int val) -{ - if (testTableFlags(Tbl_snapToHGrid) && testTableFlags(Tbl_smoothHScrolling)) - { - tFlags &= ~Tbl_snapToHGrid; // turn off snapping while sliding - setOffset(val, yOffs, false); - tFlags |= Tbl_snapToHGrid; // turn on snapping again - } - else - { - setOffset(val, yOffs, false); - } -} - -/* - \internal - This internal slot is connected to the horizontal scroll bar's - QScrollBar::sliderReleased() signal. -*/ - -void QtTableView::horSbSlidingDone() -{ - if (testTableFlags(Tbl_snapToHGrid) && testTableFlags(Tbl_smoothHScrolling)) - ; // snapToGrid( true, false ); -} - -/* - \internal - This internal slot is connected to the vertical scroll bar's - QScrollBar::valueChanged() signal. - - Moves the table vertically to offset \a val without updating the - scroll bar. - */ - -void QtTableView::verSbValue(int val) -{ - if (verSliding) - { - verSliding = false; - if (verSnappingOff) - { - verSnappingOff = false; - tFlags |= Tbl_snapToVGrid; - } - } - setOffset(xOffs, val, false); -} - -/* - \internal - This internal slot is connected to the vertical scroll bar's - QScrollBar::sliderMoved() signal. - - Scrolls the table smoothly vertically even if \c Tbl_snapToVGrid is set. -*/ - -void QtTableView::verSbSliding(int val) -{ - if (testTableFlags(Tbl_snapToVGrid) && testTableFlags(Tbl_smoothVScrolling)) - { - tFlags &= ~Tbl_snapToVGrid; // turn off snapping while sliding - setOffset(xOffs, val, false); - tFlags |= Tbl_snapToVGrid; // turn on snapping again - } - else - { - setOffset(xOffs, val, false); - } -} - -/* - \internal - This internal slot is connected to the vertical scroll bar's - QScrollBar::sliderReleased() signal. -*/ - -void QtTableView::verSbSlidingDone() -{ - if (testTableFlags(Tbl_snapToVGrid) && testTableFlags(Tbl_smoothVScrolling)) - ; // snapToGrid( false, true ); -} - -/* - This virtual function is called before painting of table cells - is started. It can be reimplemented by subclasses that want to - to set up the painter in a special way and that do not want to - do so for each cell. -*/ - -/* - Handles paint events, for the table view. - Calls paintCell() for the cells that needs to be repainted. -*/ -// work? -void QtTableView::repaintCell(int row, int col, bool usecache) // false -{ - // - static int c = 0; - int xPos, yPos; - if (!colXPos(col, &xPos)) - return; - if (!rowYPos(row, &yPos)) - return; - - QRect uR = QRect(xPos, yPos, cellWidth(col), cellHeight(row)); - // printf("repaintCell() %d, - // [%d,%d,%d,%d]\n",c++,uR.x(),uR.y(),uR.width(),uR.height() ); - view->repaint(uR.intersected(viewRect())); // slow - // view->update( uR.intersect(viewRect())); -} - -// using -void QtTableView::repaintRow(int row) -{ - int y; - if (rowYPos(row, &y)) - { - // view->repaint(minViewX(),y,viewWidth(),cellHeight()); - view->update(minViewX(), y, viewWidth(), cellHeight()); - }; -} - -extern QThread *thread_main; -void QtTableView::paintEvent(QPaintEvent *e) -{ - static int count = 0; - - ////if(thread_main!=thread()) - /// printf("Error : main_thread(%X) != paint_thread(%X) report this - /// message!!!\n",thread_main,thread()); - - /// if ( !isVisible() or !enablePaint ) return; - checkProfile(); // check cache, current_get - - if (!isVisible()) - return; - - QRect viewR = viewRect(); - bool flag_fullpainting = false; - QRect updateR = e->rect(); // update rectangle - - QPainter paint(viewport()); - // printf("Qps: %s::paintEvent() - // count=%d\n",objectName().toAscii().data(),count++); - // printf("%s - //[%d,%d,%d,%d];\n",objectName().toAscii().data(),updateR.x(),updateR.y(),updateR.width(),updateR.height()); - - /* possible? - int maxVX = maxXOffset(), maxVY = maxYOffset(); - if ( updateR.right() > maxVX ) updateR.setRight( maxVX ); - if ( updateR.bottom() > maxVY ) updateR.setBottom( maxVY ); - */ - - if (updateR.width() < viewR.width() or updateR.height() < viewR.height()) - { - // when: Scroll_up,down and Selection - // printf("partial: %d!=%d, - // %d!=%d\n",updateR.width(),viewR.width(),updateR.height(),viewR.height()); - // printf("viewR (%d,%d,%d,%d) - // \n",viewR.x(),viewR.y(),viewR.width(),viewR.height()); - } - else - { - flag_fullpainting = true; - /// printf("%s::paintEvent() fullpainting - ///%d\n",objectName().toAscii().data(),count++); - } - - int firstRow = findRow(updateR.y()); - int firstCol = findCol(updateR.x()); - - int xStart, yStart; - - if (!colXPos(firstCol, &xStart)) - { - // right empty area of table - // paint.eraseRect( updateR ); // erase area outside cells but - // in view - // printf("colXPos null\n"); - eraseRight(&paint, updateR); - return; - } - - // if ( !rowYPos( firstRow, &yStart ) || !colXPos( firstCol, &xStart ) ) - if (!rowYPos(firstRow, &yStart)) - { // get firstRow - // printf("eraseRect()\n"); - paint.eraseRect(updateR); - return; - } - - int maxX = updateR.right(); // x2 - int maxY = updateR.bottom(); // y2 - int row = firstRow; - int col; - int yPos = yStart; - int xPos = maxX + 1; // in case the while() is empty - int nextX; - int nextY; - - // printf("frow=%d,fcol=%d\n",firstRow,firstCol); - // void (QtTableView::*painT)( QPainter *, int row, int col - // ,bool - // update); - // painT=&QtTableView::paintCell; - // paint.setClipRect( 0,0,viewR.width()-30,viewR.height() ); //enable, - // font - // not clip - - paint.setClipRect(viewR); // enable, font not clip (less Qt-4.3.x) - // paint.setClipRect(updateR); //enable, font not clip - - while (yPos <= maxY and row < nRows) - { // row=...5,6,7.... - nextY = yPos + cellHeight(); - col = firstCol; - xPos = xStart; - while (xPos < maxX and col < nCols) - { - QRect cell; - int width = cellWidth(col); - nextX = xPos + width; - cell.setRect(xPos, yPos, width, cellH); - tmp_size = viewR.intersected(cell).size(); - tmp_x = xPos; - { - paint.translate(xPos, yPos); // (0,0) // for subclass - //(*this.*painT)( &paint, row, col , - // flag_use_cache); - paintCell(&paint, row, col, false); - paint.translate(-xPos, -yPos); // paint.translate(0,0); - } - col++; - xPos = nextX; - } - row++; - yPos = nextY; - } - - // printf("%s: xoff=%d ,yoff=%d - //\n",objectName().toAscii().data(),xOffs, - // yOffs); - - // while painting we have to erase any areas in the view that - // are not covered by cells but are covered by the paint event - // rectangle these must be erased. We know that xPos is the last - // x pixel updated + 1 and that yPos is the last y pixel updated + 1. - if (xPos <= maxX) - { - QRect r = viewR; - r.setLeft(xPos); - r.setBottom(yPos < maxY ? yPos : maxY); - - // QRect ir=r.intersect( updateR ); - eraseRight(&paint, r); //???????? - } - - if (yPos <= maxY) - { - QRect r = viewR; - r.setTop(yPos); - paint.eraseRect(r.intersected(updateR)); - } -} - -void QtTableView::repaintChanged() // only fullpainting -{ - - if (0) - { - // printf("repaintChanged()\n"); - test = true; - // viewport()->setAutoFillBackground (false); - viewport()->setAttribute(Qt::WA_OpaquePaintEvent); - viewport()->repaint(); - viewport()->setAttribute(Qt::WA_OpaquePaintEvent, false); - test = false; - } - - if (!isVisible()) - return; - bool flag_fullpainting = false; - - QRect updateR = viewRect(); - QRect viewR = viewRect(); - - flag_fullpainting = true; - - int firstRow = findRow(updateR.y()); - int firstCol = findCol(updateR.x()); - - int xStart, yStart; - - if (!colXPos(firstCol, &xStart)) - { - // right empty area of table - printf("b\n"); - view->update(updateR); - return; - } - - // if ( !rowYPos( firstRow, &yStart ) || !colXPos( firstCol, &xStart ) ) - if (!rowYPos(firstRow, &yStart)) - { // get firstRow - /// printf("a\n"); - view->update(updateR); - return; - } - - int maxX = updateR.right(); // x2 - int maxY = updateR.bottom(); // y2 - int row = firstRow; - int col; - int yPos = yStart; - int xPos = maxX + 1; // in case the while() is empty - int nextX; - int nextY; - - while (yPos <= maxY and row < nRows) - { // row=...5,6,7.... - nextY = yPos + cellHeight(); - col = firstCol; - xPos = xStart; - while (xPos < maxX and col < nCols) - { - QRect cell; - int width = cellWidth(col); - nextX = xPos + width; - cell.setRect(xPos, yPos, width, cellH); - int ctl = 0; - tmp_size = viewR.intersected(cell).size(); - - if (isCellChanged(row, col)) - { - if (col == firstCol) - { - repaintRow(row); // speed up! update()... - // view->update(minViewX(),y,viewWidth(),cellHeight()); - /// printf("row %d\n",row); - break; - } - - // printf("row %d col=%d\n",row,col); - repaintCell(row, col, false); - } - col++; - xPos = nextX; - } - row++; - yPos = nextY; - } - - if (xPos <= maxX) - { - QRect r = viewR; - r.setLeft(xPos); - r.setBottom(yPos < maxY ? yPos : maxY); - view->repaint(r.intersected(updateR)); - } - if (yPos <= maxY) - { - QRect r = viewR; - r.setTop(yPos); - view->repaint(r.intersected(updateR)); // why? CPU +2~3% -> rect.unite() - } - - return; - - int rows = numRows(); - int cols = numCols(); - int left = leftCell(), right = lastColVisible(); - int top = topCell(), bottom = lastRowVisible(); - - if (right >= cols) - right = cols - 1; //??? - if (bottom >= rows) - bottom = rows - 1; - // if width[col] be changed ,then the right of [col] should be repainted - // ! - // repaintColumns(c,-1); - // printf("left=%d \n",left); - - for (int r = top; r <= bottom; r++) - { - for (int c = left; c <= right; c++) - { - // if(isCellChanged(r,c)) repaintCell(r, c,false); - } - } -} - -void QtTableView::resizeEvent(QResizeEvent *e) -{ - // printf("QtTableView::resize [%d,%d] \n",width(),height()); - // QAbstractScrollArea::resizeEvent(e); - updateScrollBars(horValue | verValue | horSteps | horRange | verSteps | - verRange); - return; -} - -// BOTTLENECK? -int QtTableView::findRawRow(int yPos, int *cellMaxY, int *cellMinY, - bool goOutsideView) const -{ - int r = -1; - if (nRows == 0) - return r; - if (goOutsideView || (yPos >= minViewY() && yPos <= maxViewY())) - { - if (yPos < minViewY()) - { -#if defined(QT_CHECK_RANGE) - qWarning("QtTableView::findRawRow: (%s) internal error: " - "yPos < minViewY() && goOutsideView " - "not supported. (%d,%d)", - name("unnamed"), yPos, yOffs); -#endif - return -1; - } - if (cellH) - { // uniform cell height - r = (yPos - minViewY() + yCellDelta) / cellH; // cell offs from top - if (cellMaxY) - *cellMaxY = (r + 1) * cellH + minViewY() - yCellDelta - 1; - if (cellMinY) - *cellMinY = r *cellH + minViewY() - yCellDelta; - r += yCellOffs; // absolute cell index - } - else - { // variable cell height - QtTableView *tw = (QtTableView *)this; - r = yCellOffs; - int h = minViewY() - yCellDelta; //##arnt3 - int oldH = h; - Q_ASSERT(r < nRows); - while (r < nRows) - { - oldH = h; - h += tw->cellHeight(r); // Start of next cell - if (yPos < h) - break; - r++; - } - if (cellMaxY) - *cellMaxY = h - 1; - if (cellMinY) - *cellMinY = oldH; - } - } - return r; -} - -// return vitrual col. -int QtTableView::findRawCol(int xPos, int *cellMaxX, int *cellMinX, - bool goOutsideView) const -{ - int c = -1; - if (nCols == 0) - return c; - if (goOutsideView || (xPos >= minViewX() && xPos <= maxViewX())) - { - if (xPos < minViewX()) - { -#if defined(QT_CHECK_RANGE) - qWarning("QtTableView::findRawCol: (%s) internal error: " - "xPos < minViewX() && goOutsideView " - "not supported. (%d,%d)", - name("unnamed"), xPos, xOffs); -#endif - return -1; - } - if (cellW) - { // uniform cell width - c = (xPos - minViewX() + xCellDelta) / cellW; // cell offs from left - if (cellMaxX) - *cellMaxX = (c + 1) * cellW + minViewX() - xCellDelta - 1; - if (cellMinX) - *cellMinX = c *cellW + minViewX() - xCellDelta; - c += xCellOffs; // absolute cell index - } - else - { // variable cell width - QtTableView *tw = (QtTableView *)this; - c = xCellOffs; - int w = minViewX() - xCellDelta; //##arnt3 - int oldW = w; - Q_ASSERT(c < nCols); - while (c < nCols) - { - oldW = w; - w += tw->cellWidth(c); // Start of next cell - if (xPos < w) - break; - c++; - } - if (cellMaxX) - *cellMaxX = w - 1; - if (cellMinX) - *cellMinX = oldW; - } - } - return c; -} - -/* - Returns the index of the row at position \a yPos, where \a yPos is in - \e widget coordinates. Returns -1 if \a yPos is outside the valid - range. - - \sa findCol(), rowYPos() -*/ - -int QtTableView::findRow(int yPos) const -{ - int cellMaxY; - int row = findRawRow(yPos, &cellMaxY); - if (testTableFlags(Tbl_cutCellsV) && cellMaxY > maxViewY()) - row = -1; // cell cut by bottom margin - if (row >= nRows) - row = -1; - return row; -} - -/* - Returns the index of the column at position \a xPos, where \a xPos is - in \e widget coordinates. Returns -1 if \a xPos is outside the valid - range. - - \sa findRow(), colXPos() -*/ - -int QtTableView::findCol(int xPos) const -{ - int cellMaxX; - int col = findRawCol(xPos, &cellMaxX); - if (testTableFlags(Tbl_cutCellsH) && cellMaxX > maxViewX()) - col = -1; // cell cut by right margin - if (col >= nCols) - col = -1; - return col; -} - -// testing -int QtTableView::findColNoMinus(int xPos) const -{ - int col = findCol(xPos); - - if (col < 0) - { - if (xPos < 0) - col = 0; - else - col = nCols - 1; - } - return col; -} -/* - Computes the position in the widget of row \a row. - - Returns true and stores the result in \a *yPos (in \e widget - coordinates) if the row is visible. Returns false and does not modify - \a *yPos if \a row is invisible or invalid. - - \sa colXPos(), findRow() -*/ - -// return : false means out of bound -bool QtTableView::rowYPos(int row, int *yPos) const -{ - int y; - if (row >= yCellOffs) - { - if (cellH) - { - int lastVisible = lastRowVisible(); - if (row > lastVisible || lastVisible == -1) - return false; - y = (row - yCellOffs) * cellH + minViewY() - yCellDelta; - } - else - { - //##arnt3 - y = minViewY() - yCellDelta; // y of leftmost cell in view - int r = yCellOffs; - QtTableView *tw = (QtTableView *)this; - int maxY = maxViewY(); - while (r < row && y <= maxY) - y += tw->cellHeight(r++); - if (y > maxY) - return false; - } - } - else - { - return false; - } - if (yPos) - *yPos = y; - return true; -} - -/* - Computes the position in the widget of column col. - - Returns true and stores the result in \a *xPos (in \e widget - coordinates) if the column is visible. Returns false and does not - modify \a *xPos if \a col is invisible or invalid. - - \sa rowYPos(), findCol() -*/ - -bool QtTableView::colXPos(int col, int *xPos) const -{ - int x; - if (col >= xCellOffs) - { - if (cellW) - { - int lastVisible = lastColVisible(); - if (col > lastVisible || lastVisible == -1) - return false; - x = (col - xCellOffs) * cellW + minViewX() - xCellDelta; - } - else - { - //##arnt3 - x = minViewX() - xCellDelta; // x of uppermost cell in view - int c = xCellOffs; - QtTableView *tw = (QtTableView *)this; - int maxX = maxViewX(); - while (c < col && x <= maxX) - x += tw->cellWidth(c++); - if (x > maxX) - return false; - } - } - else - { - return false; - } - if (xPos) - *xPos = x; - return true; -} - -QRect QtTableView::viewRect() const -{ - return viewport()->rect(); - // return QRect( 0, 0, viewWidth(), viewHeight() ); -} - -int QtTableView::minViewX() const -{ - return 0; // frameWidth(); -} - -int QtTableView::minViewY() const -{ - return 0; // view->frameWidth(); -} - -/* - Returns the rightmost pixel of the table view in \e view - coordinates. This excludes the frame and any scroll bar, but - includes blank pixels to the right of the visible table data. - - \sa maxViewY(), viewWidth(), -*/ - -int QtTableView::maxViewX() const { return viewport()->width(); } - -/* - Returns the bottom pixel of the table view in \e view - coordinates. This excludes the frame and any scroll bar, but - includes blank pixels below the visible table data. - - \sa maxViewX(), viewHeight(), -*/ - -int QtTableView::maxViewY() const { return viewport()->height(); } - -/* - Returns the width of the table view, as such, in \e view - coordinates. This does not include any header, scroll bar or frame, - but it does include background pixels to the right of the table data. - - minViewX() maxViewX(), viewHeight(),viewRect() -*/ - -int QtTableView::viewWidth() const { return maxViewX(); } - -int QtTableView::viewHeight() const -{ - return maxViewY(); /// - minViewY() + 1; -} - -/* - \fn void QtTableView::updateScrollBars() - Updates the scroll bars' contents and presence to match the table's - state. Generally, you should not need to call this. - \sa setTableFlags() - Updates the scroll bars' contents and presence to match the table's - state \c or \a f. - \sa setTableFlags() -*/ - -void QtTableView::updateScrollBars(uint f) -{ - sbDirty = sbDirty | f; - // if ( inSbUpdate ) return; - // inSbUpdate = true; - - if (yOffset() > 0 && testTableFlags(Tbl_autoVScrollBar) && - !testTableFlags(Tbl_vScrollBar)) - { - setYOffset(0); //???????? - } - if (xOffset() > 0 && testTableFlags(Tbl_autoHScrollBar) && - !testTableFlags(Tbl_hScrollBar)) - { - setXOffset(0); //????? - } - if (!isVisible()) - { - inSbUpdate = false; - return; - } - - if (testTableFlags(Tbl_hScrollBar) && (sbDirty & horMask) != 0) - { - if (sbDirty & horSteps) - { - if (cellW) - hScrollBar->setSingleStep(qMin((int)cellW, viewWidth() / 2)); - else - hScrollBar->setSingleStep(16); - hScrollBar->setPageStep(viewWidth()); - } - - if (sbDirty & horRange) - { - hScrollBar->setRange(0, maxXOffset()); - } - if (sbDirty & horValue) - hScrollBar->setValue(xOffs); - } - - if (testTableFlags(Tbl_vScrollBar) && (sbDirty & verMask) != 0) - { - if (sbDirty & verSteps) - { - if (cellH) - vScrollBar->setSingleStep(qMin((int)cellH, viewHeight() / 2)); - else - vScrollBar->setSingleStep(16); // fttb! ### - vScrollBar->setPageStep(viewHeight()); - } - - if (sbDirty & verRange) - vScrollBar->setRange(0, maxYOffset()); - - if (sbDirty & verValue) - vScrollBar->setValue(yOffs); - } - - sbDirty = 0; - inSbUpdate = false; -} - -/* - Updates the scroll bars and internal state. - - Call this function when the table view's total size is changed; - typically because the result of cellHeight() or cellWidth() have changed. - This function does not repaint the widget. -*/ -//-> updateViewSize(); -void QtTableView::updateTableSize() -{ - updateScrollBars(horSteps | horRange | verSteps | verRange); - return; - bool updateOn = updatesEnabled(); - setAutoUpdate(false); - int xofs = xOffset(); - xOffs++; // so that setOffset will not return immediately - setOffset(xofs, yOffset(), false); // to calculate internal state correctly - setAutoUpdate(updateOn); -} - -/* - Returns the maximum horizontal offset within the table of the - view's left edge in \e table coordinates. - - This is used mainly to set the horizontal scroll bar's range. - - \sa maxColOffset(), maxYOffset(), totalWidth() -*/ - -int QtTableView::maxXOffset() -{ - int tw = totalWidth(); - int maxOffs; - if (testTableFlags(Tbl_scrollLastHCell)) - { - if (nCols != 1) - maxOffs = tw - (cellW ? cellW : cellWidth(nCols - 1)); - else - maxOffs = tw - viewWidth(); - } - else - { - if (testTableFlags(Tbl_snapToHGrid)) - { - if (cellW) - { - maxOffs = tw - (viewWidth() / cellW) * cellW; - } - else - { - int goal = tw - viewWidth(); - int pos = tw; - int nextCol = nCols - 1; - int nextCellWidth = cellWidth(nextCol); - while (nextCol > 0 && pos > goal + nextCellWidth) - { - pos -= nextCellWidth; - nextCellWidth = cellWidth(--nextCol); - } - if (goal + nextCellWidth == pos) - maxOffs = goal; - else if (goal < pos) - maxOffs = pos; - else - maxOffs = 0; - } - } - else - { - maxOffs = tw - viewWidth(); - } - } - return maxOffs > 0 ? maxOffs : 0; -} - -/* - Returns the maximum vertical offset within the table of the - view's top edge in \e table coordinates. - - This is used mainly to set the vertical scroll bar's range. - \sa maxRowOffset(), maxXOffset(), totalHeight() -*/ - -int QtTableView::maxYOffset() -{ - int th = totalHeight(); - int maxOffs; - if (testTableFlags(Tbl_scrollLastVCell)) - { - if (nRows != 1) - maxOffs = th - (cellH ? cellH : cellHeight(nRows - 1)); - else - maxOffs = th - viewHeight(); - } - else - { - if (testTableFlags(Tbl_snapToVGrid)) - { - if (cellH) - { - maxOffs = th - (viewHeight() / cellH) * cellH; - } - else - { - int goal = th - viewHeight(); - int pos = th; - int nextRow = nRows - 1; - int nextCellHeight = cellHeight(nextRow); - while (nextRow > 0 && pos > goal + nextCellHeight) - { - pos -= nextCellHeight; - nextCellHeight = cellHeight(--nextRow); - } - if (goal + nextCellHeight == pos) - maxOffs = goal; - else if (goal < pos) - maxOffs = pos; - else - maxOffs = 0; - } - } - else - { - maxOffs = th - viewHeight(); - } - } - return maxOffs > 0 ? maxOffs : 0; -} - -/* - Returns the index of the last column, which may be at the left edge - of the view. - - Depending on the \link setTableFlags() Tbl_scrollLastHCell\endlink flag, - this may or may not be the last column. - - \sa maxXOffset(), maxRowOffset() -*/ - -int QtTableView::maxColOffset() -{ - int mx = maxXOffset(); - if (cellW) - return mx / cellW; - else - { - int xcd = 0, col = 0; - while (col < nCols && mx > (xcd = cellWidth(col))) - { - mx -= xcd; - col++; - } - return col; - } -} - -/* - Returns the index of the last row, which may be at the top edge of - the view. - Depending on the \link setTableFlags() Tbl_scrollLastVCell\endlink flag, - this may or may not be the last row. - - \sa maxYOffset(), maxColOffset() -*/ - -int QtTableView::maxRowOffset() -{ - int my = maxYOffset(); - if (cellH) - return my / cellH; - else - { - int ycd = 0, row = 0; - while (row < nRows && my > (ycd = cellHeight(row))) - { - my -= ycd; - row++; - } - return row; - } -} - -// DEL -void QtTableView::showOrHideScrollBars() { return; } diff --git a/src/qttableview.h b/src/qttableview.h deleted file mode 100644 index 4641c88..0000000 --- a/src/qttableview.h +++ /dev/null @@ -1,240 +0,0 @@ -/********************************************************************** -** $Id: qttableview.h,v 1.46 2011/08/27 00:13:41 fasthyun Exp $ -** -** Definition of QtTableView class -** -** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. -** -** This file contains a class moved out of the Qt GUI Toolkit API. -** -** This file may be distributed under the terms of the Q Public License -** as defined by Trolltech AS of Norway and appearing in the file -** LICENSE.QPL included in the packaging of this file. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file COPYING included in the -** packaging of this file. -** -** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition -** licenses may use this file in accordance with the Qt Commercial License -** Agreement provided with the Software. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about Qt Commercial License Agreements. -** See http://www.trolltech.com/qpl/ for QPL licensing information. -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#ifndef QTTABLEVIEW_H -#define QTTABLEVIEW_H - -#ifndef USING_PCH -#include -#include -#include -#include -#include -#endif - -class QScrollBar; -class QtTableView : public QAbstractScrollArea -{ - Q_OBJECT - public: - QWidget *view; - int flag_view; - int cellWidth() const; - int cellHeight() const; - void repaintRow(int row); // paintRow(); - void coverCornerSquare(bool); - void clearCache() {} - void repaintChanged(); - virtual bool isCellChanged(int r, int c) { return true; }; - virtual void eraseRight(QPainter *, QRect &r) { return; } - virtual void checkProfile(){}; - QSize tmp_size; // testing. - int tmp_x; - bool test; - QColor backColor; - - protected: - QtTableView(QWidget *parent = 0, const char *name = 0); - ~QtTableView(); - - int numRows() const; - int numCols() const; - void setNumRows(int); - void setNumCols(int); - - int topCell() const; - int leftCell() const; - void setTopCell(int row); - void setLeftCell(int col); - void setTopLeftCell(int row, int col); - - int xOffset() const; - int yOffset() const; - virtual void setXOffset(int); - virtual void setYOffset(int); - virtual void setOffset(int x, int y, bool updateScrBars = true); - virtual void scrollTrigger(int x, int y){}; // tmp - - virtual int cellWidth(int col); - int cellHeight(int row); - virtual void setCellWidth(int); - virtual void setCellHeight(int); - - int totalWidth(); - int totalHeight(); - - uint tableFlags() const; - // bool testTableFlags( uint f ) const; - virtual void setTableFlags(uint f); - void clearTableFlags(uint f = ~0); - - void setAutoUpdate(bool); - - void repaintCell(int row, int column, bool usecache = false); - - QRect cellUpdateRect() const; - QRect viewRect() const; - - int lastRowVisible() const; - int lastColVisible() const; - - bool rowIsVisible(int row) const; - bool colIsVisible(int col) const; - - QScrollBar *verticalScrollBar() const; - QScrollBar *horizontalScrollBar() const; - - private slots: - void horSbValue(int); - void horSbSliding(int); - void horSbSlidingDone(); - void verSbValue(int); - void verSbSliding(int); - void verSbSlidingDone(); - - protected: - virtual void paintCell(QPainter *, int row, int col, bool update) = 0; - virtual void paintEvent(QPaintEvent *); - virtual void resizeEvent(QResizeEvent *); - virtual void scrollContentsBy(int dx, int dy); - - int findRow(int yPos) const; - int findCol(int xPos) const; - int findColNoMinus(int xPos) const; - - bool rowYPos(int row, int *yPos) const; - bool colXPos(int col, int *xPos) const; - - int maxXOffset(); - int maxYOffset(); - int maxColOffset(); - int maxRowOffset(); - - int minViewX() const; - int minViewY() const; - int maxViewX() const; - int maxViewY() const; - int viewWidth() const; - int viewHeight() const; - - void updateScrollBars(); - void updateTableSize(); - - QRect cellUpdateR; - - private: - int findRawRow(int yPos, int *cellMaxY, int *cellMinY = 0, - bool goOutsideView = false) const; - int findRawCol(int xPos, int *cellMaxX, int *cellMinX = 0, - bool goOutsideView = false) const; - int maxColsVisible() const; - - void updateScrollBars(uint); - void showOrHideScrollBars(); - - int nRows; - int nCols; - int xOffs, yOffs; - int xCellOffs, yCellOffs; - short xCellDelta, yCellDelta; - short cellH, cellW; // - - uint eraseInPaint : 1; - uint verSliding : 1; - uint verSnappingOff : 1; - uint horSliding : 1; - uint horSnappingOff : 1; - uint coveringCornerSquare : 1; - uint sbDirty : 8; - uint inSbUpdate : 1; - - bool enablePaint; - - uint tFlags; - - QScrollBar *vScrollBar; - QScrollBar *hScrollBar; -}; - -const uint Tbl_vScrollBar = 0x00000001; -const uint Tbl_hScrollBar = 0x00000002; -const uint Tbl_autoVScrollBar = 0x00000004; -const uint Tbl_autoHScrollBar = 0x00000008; -const uint Tbl_autoScrollBars = 0x0000000C; - -const uint Tbl_clipCellPainting = 0x00000100; -const uint Tbl_cutCellsV = 0x00000200; -const uint Tbl_cutCellsH = 0x00000400; -const uint Tbl_cutCells = 0x00000600; - -const uint Tbl_scrollLastHCell = 0x00000800; -const uint Tbl_scrollLastVCell = 0x00001000; -const uint Tbl_scrollLastCell = 0x00001800; - -const uint Tbl_smoothHScrolling = 0x00002000; -const uint Tbl_smoothVScrolling = 0x00004000; -const uint Tbl_smoothScrolling = 0x00006000; - -const uint Tbl_snapToHGrid = 0x00008000; -const uint Tbl_snapToVGrid = 0x00010000; -const uint Tbl_snapToGrid = 0x00018000; - -inline int QtTableView::numRows() const { return nRows; } - -inline int QtTableView::numCols() const { return nCols; } - -inline int QtTableView::topCell() const { return yCellOffs; } - -inline int QtTableView::leftCell() const { return xCellOffs; } - -inline int QtTableView::xOffset() const { return xOffs; } - -inline int QtTableView::yOffset() const { return yOffs; } - -inline int QtTableView::cellHeight() const { return cellH; } - -inline int QtTableView::cellWidth() const { return cellW; } - -inline uint QtTableView::tableFlags() const { return tFlags; } - -#define testTableFlags(f) ((tFlags & f) != 0) -// inline bool QtTableView::testTableFlags( uint f ) const{ return (tFlags & f) -// != 0; } - -inline QRect QtTableView::cellUpdateRect() const { return cellUpdateR; } - -inline void QtTableView::updateScrollBars() { updateScrollBars(0); } - -#endif // QTTABLEVIEW_H diff --git a/src/screenshot.cpp b/src/screenshot.cpp deleted file mode 100644 index 0d231f0..0000000 --- a/src/screenshot.cpp +++ /dev/null @@ -1,448 +0,0 @@ -/* - * screenshot.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 2014 dae hyun, yang - * Copyright 2015 Paulo Lieuthier - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include -#include -#include "screenshot.h" -#include -#include -#include -#include -#include -#include -#include -#include - -/* -SizeGrip::SizeGrip() -{ - - setWindowFlags( Qt::FramelessWindowHint); -} */ - -QSizeGrip *sg; -int window_width = 320; -int window_height = 240; - -TitleBar::TitleBar(QWidget *w) : QWidget(w) -{ - // setWindowFlags( Qt::FramelessWindowHint); - // resize(window_width,32); - setMinimumHeight(32); -} - -void TitleBar::mousePressEvent(QMouseEvent *) -{ - // press_pos = e->pos(); - // printf("x=%d y=%d\n",press_pos.x(),press_pos.y()); -} - -void TitleBar::mouseMoveEvent(QMouseEvent *e) -{ - if (e->buttons() == Qt::LeftButton) // Button state ) - { - // move(e->globalX()-e->x(), e->globalY()-e->y());// - // coe->x(),e->y()); - // move(e->globalX() - press_pos.x(), e->globalY()- - // press_pos.y());// - // coe->x(),e->y()); - // sg->move(x()-100,y()-100); - } -} - -ShotArea::ShotArea() -{ - setLineWidth(3); - setFrameStyle(QFrame::Panel | QFrame::Raised); - setAttribute(Qt::WA_OpaquePaintEvent); - setAttribute(Qt::WA_NoSystemBackground); - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); -} - -void ShotArea::resizeEvent(QResizeEvent * /* event */) -{ - // printf("ShotArea::resizeEvent()\n"); - // QPixmap pixmap = QPixmap(screenshotLabel->size()); -} - -void ShotArea::paintEvent(QPaintEvent *event) -{ - // printf("ShotArea::paintEvent\n"); - // QPainter painter(this); - // painter.setOpacity(1.0); - // painter.fillRect(10, 10, 100, 80, QColor(255,255,255,120)); -} - -void ShotArea::mousePressEvent(QMouseEvent *e) -{ - press_pos = e->pos(); - /// printf("x=%d y=%d\n",press_pos.x(),press_pos.y()); -} - -void ShotArea::mouseMoveEvent(QMouseEvent *e) -{ - if (e->buttons() == Qt::LeftButton) // Button state ) - { - // move(e->globalX()-e->x(), e->globalY()-e->y());// - // coe->x(),e->y()); - // move(e->globalX() - press_pos.x(), e->globalY()- - // press_pos.y());// - // coe->x(),e->y()); - // sg->move(x()-100,y()-100); - } -} - -#include -Screenshot::Screenshot(QWidget *p) : QWidget(p) -{ - // Qt::WindowTitleHint - // Qt::CustomizeWindowHint ); - // setWindowTitle(tr("Screenshot")); - // TitleBar *titlebar=new TitleBar(this); - QStatusBar *statusbar = new QStatusBar(this); - shotarea = new ShotArea(); - // setWindowFlags(Qt::WindowStaysOnTopHint); - setWindowFlags(Qt::FramelessWindowHint); - // setWindowFlags(Qt::X11BypassWindowManagerHint); - setStyleSheet( // padding: 2px - "QWidget { background-color : rgba(20,20,20,70%); color: " - "rgb(0,255,150);}" - "QPushButton,QToolButton,QLineEdit { border-width: 1px; " - "padding:3px; " - "border-style: solid; border-color: rgb(210,50,130); " - "border-radius: 5px " - ";}" - "QPushButton:hover,QToolButton:hover { color:rgb(40,255,190); " - "padding:3px; border-width: 1px; border-style: solid; " - "border-color: " - "rgb(230,80,170); border-radius: 5px ;}" - "QPushButton:pressed,QToolButton:pressed { color:rgb(0,255,150); " - "padding:3px; border-width: 2px; border-style: solid; " - "border-color: " - "rgb(210,50,130); border-radius: 5px ;}" - "QComboBox { border-width: 1px; padding:3px; border-style: solid; " - "border-color: rgb(50,200,130); border-radius: 5px ;}" - "QLabel { border-width: 1px; padding:3px; border-style: solid; " - "border-color: rgb(65,16,40); border-radius: 5px ;}" - "QComboBox:drop-down { border-width: 2px; padding:0px; " - "border-style: " - "solid; border-color: rgb(50,200,130); border-radius: 3px ;}"); - -// sg=new QSizeGrip(NULL); -// sg->show(); -// sg->move(100,100); -// QStyle::PE_Frame -// createOptionsGroupBox(); -// createButtonsLayout(); - -#if QT_VERSION > 0x040500 - -#endif - - mainLayout = new QVBoxLayout; -#if QT_VERSION < 0x040300 - mainLayout->setMargin(3); // qt-4.2 -#else - mainLayout->setContentsMargins(3, 3, 3, 3); // qt-4.3 -#endif - mainLayout->setSpacing(0); - - // mainLayout->addWidget(titlebar); - mainLayout->addWidget(shotarea); - // mainLayout->addLayout(buttonsLayout); - mainLayout->addWidget(statusbar); - - // saveScreenshotButton = createButton(tr("Save"),this, - // SLOT(saveScreenshot())); - saveScreenshotButton = new QPushButton("Save"); - connect(saveScreenshotButton, SIGNAL(clicked()), this, - SLOT(saveScreenshot())); - - statusbar->addWidget(saveScreenshotButton); - // statusbar->addWidget( quitScreenshotButton); - statusbar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); - setLayout(mainLayout); - // delaySpinBox->setValue(5); - - setMouseTracking(true); - - // if (QApplication::desktop()->winId() < 0) - // printf("Qps: Null Desktop\n"); - resize(300, 240); -} - -static QPoint init_pos; -void Screenshot::mousePressEvent(QMouseEvent *e) -{ - - press_pos = e->globalPos(); - init_pos = pos(); - // printf("x=%d y=%d\n",press_pos.x(),press_pos.y()); -} - -void Screenshot::mouseMoveEvent(QMouseEvent *e) -{ - if (e->buttons() == Qt::LeftButton) // Button state ) - { - move(init_pos + e->globalPos() - press_pos); - // move(x() + e->globalX() - press_pos.x(), y()+e->globalY()- - // press_pos.y());// coe->x(),e->y()); - // sg->move(x()-100,y()-100); - } -} - -extern bool flag_xcompmgr; -void Screenshot::paintEvent(QPaintEvent *e) -{ - QPainter p(this); - // printf("Screenshot::paintEvent\n"); - // setAttribute(Qt::WA_NoSystemBackground); - if (0) // if(flag_xcompmgr)//setWindowOpacity (0.9); - // //_NET_WM_WINDOW_OPACITY - { - setAttribute(Qt::WA_OpaquePaintEvent); - // setAttribute(Qt::WA_); - // p.setOpacity(0.1); - p.setCompositionMode(QPainter::CompositionMode_Source); // need! - p.fillRect(rect(), Qt::transparent); // clear! - // QRect rectR(shotarea->x(),shotarea->y(), - // shotarea->width(),shotarea->height()); - // p.fillRect(rectR,QColor(0,255,0,10)); - // p.fillRect(rect(),QColor(255,255,255,255)); - } - - return; - QStyleOptionFrame opt; - QRect rectR(shotarea->x() - 1, shotarea->y() - 1, shotarea->width() + 2, - shotarea->height() + 2); - opt.rect = rectR; - opt.lineWidth = 2; - opt.midLineWidth = 1; - opt.state = opt.state | QStyle::State_Sunken; - /// style()->drawControl(QStyle::CE_Header, &opt, p, this); - style()->drawPrimitive(QStyle::PE_Frame, &opt, &p, 0); -} - -void Screenshot::resizeEvent(QResizeEvent *e /* event */) -{ - - // printf("Screenshot::resizeEvent()\n"); - // QWidget::resizeEvent(e); - // return; - if (flag_xcompmgr == false) - { - QPixmap pixmap = QPixmap(size()); - QPainter painter(&pixmap); - // painter.eraseRect(0,0,width(),height()); - painter.fillRect(0, 0, width(), height(), QColor(0, 0, 0)); - painter.fillRect(shotarea->x() + 1, shotarea->y() + 1, - shotarea->width() - 2, shotarea->height() - 2 - // painter.fillRect(shotarea->geometry() - , - QColor(255, 255, 255)); -#if QT_VERSION >= 0x040300 - setMask( - pixmap.createMaskFromColor(QColor(255, 255, 255), Qt::MaskInColor)); -// setMask(pixmap.mask()); // with alpha channel ,notwork -#else -// #error Qt library version 4.2 or higher is needed for this version of -// qps -#endif - } - - // QSize scaledSize = originalPixmap.size(); - // scaledSize.scale(screenshotLabel->size(), Qt::KeepAspectRatio); - // if (!screenshotLabel->pixmap()|| scaledSize != - // screenshotLabel->pixmap()->size()) - // updateScreenshotLabel(); -} - -void Screenshot::newScreenshot() -{ - // newScreenshotButton->setDisabled(true); - // shootScreen(); - // QTimer::singleShot(delaySpinBox->value() * 1000, this, - // SLOT(shootScreen())); -} - -void Screenshot::saveScreenshot() -{ - shootScreen(); - QString format = "png"; - QString path = QDir::homePath() + "/Desktop"; // *** ooooooo - if (QFile::exists(path)) - path = path + tr("/untitled.") + format; - else - path = QDir::homePath(); - - QString fileName = QFileDialog::getSaveFileName( - this, tr("Save As"), path, - tr("%1 Files (*.%2);;All Files (*)").arg(format.toUpper()).arg(format)); - if (!fileName.isEmpty()) - originalPixmap.save(fileName, format.toLatin1()); - - // setWindowFlags(Qt::X11BypassWindowManagerHint); -} - -void Screenshot::shootScreen() -{ - - // if (delaySpinBox->value() != 0) qApp->beep(); - originalPixmap = QPixmap::grabWindow( - QApplication::desktop()->winId(), geometry().x() + shotarea->x(), - geometry().y() + shotarea->y(), shotarea->width(), shotarea->height()); - /// updateScreenshotLabel(); -} - -void Screenshot::updateCheckBox() -{ - if (delaySpinBox->value() == 0) - hideThisWindowCheckBox->setDisabled(true); - else - hideThisWindowCheckBox->setDisabled(false); -} - -void Screenshot::createOptionsGroupBox() -{ - optionsGroupBox = new QGroupBox(tr("Options")); - - delaySpinBox = new QSpinBox; - delaySpinBox->setSuffix(tr(" s")); - delaySpinBox->setMaximum(60); - connect(delaySpinBox, SIGNAL(valueChanged(int)), this, - SLOT(updateCheckBox())); - - delaySpinBoxLabel = new QLabel(tr("Screenshot Delay:")); - - hideThisWindowCheckBox = new QCheckBox(tr("Hide This Window")); - - optionsGroupBoxLayout = new QGridLayout; - optionsGroupBoxLayout->addWidget(delaySpinBoxLabel, 0, 0); - optionsGroupBoxLayout->addWidget(delaySpinBox, 0, 1); - optionsGroupBoxLayout->addWidget(hideThisWindowCheckBox, 1, 0, 1, 2); - optionsGroupBox->setLayout(optionsGroupBoxLayout); -} - -void Screenshot::createButtonsLayout() -{ - newScreenshotButton = - createButton(tr("New Screenshot"), this, SLOT(newScreenshot())); - quitScreenshotButton = createButton(tr("Quit"), this, SLOT(close())); - - buttonsLayout = new QHBoxLayout; - buttonsLayout->addStretch(); - buttonsLayout->addWidget(newScreenshotButton); - buttonsLayout->addWidget(saveScreenshotButton); - buttonsLayout->addWidget(quitScreenshotButton); -} - -QPushButton *Screenshot::createButton(const QString &text, QWidget *receiver, - const char *member) -{ - QPushButton *button = new QPushButton(text); - button->connect(button, SIGNAL(clicked()), receiver, member); - return button; -} - -// preview -void Screenshot::updateScreenshotLabel() -{ - screenshotLabel->setPixmap(originalPixmap.scaled(screenshotLabel->size(), - Qt::KeepAspectRatio, - Qt::SmoothTransformation)); -} - -//#include "widget.h" - -#include -#include - -int screenshot_main(int argc, char **argv) -// int screenshot_main() -{ - // qWarning("Please make sure you're running a composition manager!"); - bool argbVisual = false; - Display *dpy = QX11Info::display(); // open default display - if (!dpy) - { - qWarning("Cannot connect to the X server"); - exit(1); - } - - int screen = DefaultScreen(dpy); - Colormap colormap = 0; - Visual *visual = 0; - int eventBase, errorBase; - - if (0 and XRenderQueryExtension(dpy, &eventBase, &errorBase)) - { - int nvi; - XVisualInfo templ; - templ.screen = screen; - templ.depth = 32; - templ.c_class = TrueColor; - XVisualInfo *xvi = XGetVisualInfo( - dpy, VisualScreenMask | VisualDepthMask | VisualClassMask, &templ, - &nvi); - - printf("nvi=%d\n", nvi); - for (int i = 0; i < nvi; ++i) - { - XRenderPictFormat *format = - XRenderFindVisualFormat(dpy, xvi[i].visual); - if (format->type == PictTypeDirect && format->direct.alphaMask > 0) - { - visual = xvi[i].visual; - colormap = XCreateColormap(dpy, RootWindow(dpy, screen), visual, - AllocNone); - argbVisual = true; - break; - } - } - } - if (argbVisual == true) - { - qWarning("Found ARGB visual. Starting app..."); - // QApplication app(dpy, argc, argv, Qt::HANDLE(visual), - // Qt::HANDLE(colormap)); - } - else - { - // qWarning("Couldn't find ARGB visual... Exiting."); - // QApplication app(dpy, argc, argv); - } - - // QApplication app(dpy, argc, argv, Qt::HANDLE(visual), - // Qt::HANDLE(colormap)); - QApplication app(argc, argv); - - Display *dsp = QX11Info::display(); // get the display(X server?) - - Screenshot *w = new Screenshot(); - w->show(); - // Widget w; - // w.resize(400, 300); - // w.show(); - - return app.exec(); -} diff --git a/src/screenshot.h b/src/screenshot.h deleted file mode 100644 index d6f7157..0000000 --- a/src/screenshot.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * screenshot.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 2014 dae hyun, yang - * Copyright 2015 Paulo Lieuthier - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef SCREENSHOT_H -#define SCREENSHOT_H - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class TitleBar : public QWidget -{ - Q_OBJECT - public: - TitleBar(QWidget *w); - - protected: - // void resizeEvent(QResizeEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mousePressEvent(QMouseEvent *e); - private slots: - private: - QPoint press_pos; -}; - -class ShotArea : public QFrame -{ - Q_OBJECT - public: - ShotArea(); - - protected: - // void resizeEvent(QResizeEvent *event); - - virtual void resizeEvent(QResizeEvent *e); - virtual void paintEvent(QPaintEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mousePressEvent(QMouseEvent *e); - private slots: - private: - QPoint press_pos; -}; - -/* -class SizeGrip : public QWidget -{ - Q_OBJECT -public: - SizeGrip(); -protected: -// void resizeEvent(QResizeEvent *event); - void mouseMoveEvent ( QMouseEvent * event ); - void mousePressEvent(QMouseEvent *e); -private slots: -private: - QPoint press_pos; -}; -*/ - -class Screenshot : public QWidget -{ - Q_OBJECT - - public: - Screenshot(QWidget *p = 0); - - protected: - void resizeEvent(QResizeEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mousePressEvent(QMouseEvent *e); - virtual void paintEvent(QPaintEvent *event); - - private slots: - void newScreenshot(); - void saveScreenshot(); - void shootScreen(); - void updateCheckBox(); - - private: - void createOptionsGroupBox(); - void createButtonsLayout(); - QPushButton *createButton(const QString &text, QWidget *receiver, - const char *member); - void updateScreenshotLabel(); - - QPoint press_pos; - QPixmap originalPixmap; - - QLabel *screenshotLabel; - QGroupBox *optionsGroupBox; - QSpinBox *delaySpinBox; - QLabel *delaySpinBoxLabel; - QCheckBox *hideThisWindowCheckBox; - QPushButton *newScreenshotButton; - QPushButton *saveScreenshotButton; - QPushButton *quitScreenshotButton; - - QVBoxLayout *mainLayout; - QGridLayout *optionsGroupBoxLayout; - QHBoxLayout *buttonsLayout; - ShotArea *shotarea; -}; - -#endif diff --git a/src/stable.h b/src/stable.h deleted file mode 100644 index 0caa4f3..0000000 --- a/src/stable.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * stable.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 2014 dae hyun, yang - * Copyright 2015 Paulo Lieuthier - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - - -// for Precompiled Header ! -#include -#include -#include -#include - -#if defined __cplusplus - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include "svec.h" -#endif diff --git a/src/svec.cpp b/src/svec.cpp deleted file mode 100644 index 488959c..0000000 --- a/src/svec.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* - * svec.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -// implement a stretchy vector class: -// An Svec grows automatically (doubles when full), so that adding -// elements to the end has an amortized cost of O(1). -// For now, only use this for types not requiring a con/destructor. - -#ifndef SVEC_C -#define SVEC_C - -#include "svec.h" -////#define fatal(str) { printf("fatal error: %s\n",str); exit(0);} -#define fatal printf - -template Svec::Svec(const Svec &s) -{ - int n = s.size(); - if (n < 8) - n = 8; - vect = (T *)malloc(n * sizeof(T)); - alloced = n; - used = s.size(); - for (int i = 0; i < used; i++) - vect[i] = s[i]; -} - -template Svec &Svec::operator=(const Svec &s) -{ - if (this != &s) - { - if (alloced < s.size()) - { - alloced = s.size(); - vect = (T *)realloc(vect, alloced * sizeof(T)); - } - for (int i = 0; i < s.size(); i++) - { - vect[i] = s.vect[i]; - } - used = s.size(); - } - return *this; -} - -/* -template -void Svec::indexerr(int index) const -{ - fatal("Svec: index out of range (%d, valid is 0..%d)", index, used - 1); -} -*/ - -template void Svec::setSize(int newsize) -{ - while (newsize > alloced) - grow(); - used = newsize; -} - -template void Svec::setextend(int index, T value) -{ -#ifdef CHECK_INDICES - if (index < 0) - fatal("const Svec: negative index"); -#endif - while (index >= alloced) - grow(); - if (index >= used) - used = index + 1; - vect[index] = value; -} - -template void Svec::insert(int index, T value) -{ -#ifdef CHECK_INDICES - if (index < 0 || index > used) - fatal("Svec: index out of range"); -#endif - if ((used + 1) > alloced) - grow(); - - /*int i; - T v; - v=vect[i+1]; - for(i = index; j < =used ; i++) - vect[i+1]=v; - vect[i+1]=vect[i]; //vect[index+1]=vect[index]; - */ - - // old - for (int j = used - 1; j >= index; j--) - vect[j + 1] = vect[j]; - - vect[index] = value; - - used++; -} - -// for int,float type , no delete -template void Svec::remove(int index) -{ -#ifdef CHECK_INDICES - if (index < 0 || index >= used) - fatal("Svec: index out of range"); -#endif - for (int j = index; j < used - 1; j++) - vect[j] = vect[j + 1]; - used--; -} - -// for class type -template void Svec::Delete(int index) -{ -#ifdef CHECK_INDICES - if (index < 0 || index >= used) - fatal("Svec: index out of range"); -#endif - delete vect[index]; - for (int j = index; j < used - 1; j++) - vect[j] = vect[j + 1]; - used--; -} - -// Assuming T is "pointer to U", delete all contents. -// Warning: duplicated objects will be deleted twice --- doubleplusungood -template void Svec::purge() -{ - for (int i = 0; i < used; i++) - delete vect[i]; - used = 0; -} - -extern "C" { -typedef int (*compare_func)(const void *, const void *); -} - -template void Svec::sort(int (*compare)(const T *a, const T *b)) -{ - qsort(vect, used, sizeof(T), (compare_func)compare); -} - -#endif // SVEC_C diff --git a/src/svec.h b/src/svec.h deleted file mode 100644 index f25f918..0000000 --- a/src/svec.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * svec.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef SVEC_H -#define SVEC_H - -#include -#include - -template class SHash : public std::map -{ - public: - T value(Key k, T r) - { - using namespace std; - typename map::const_iterator it; - it = map::find(k); - if (it == map::end()) - return r; - return (*it).second; - } - void insert(Key k, T r) - { - using namespace std; - map::insert(pair(k, r)); - } - bool contains(Key k) - { - if (value(k, NULL) == NULL) - return false; - else - return true; - } -}; - -#include - -//#ifndef NDEBUG -//#define CHECK_INDICES // Check invalid vector indices (the default) -//#endif - -template class Svec -{ - public: - Svec(int max = 16); - Svec(const Svec &s); - ~Svec(); - - Svec &operator=(const Svec &s); - int size() const; - void setSize(int newsize); - T &operator[](int i); - T operator[](int i) const; - void set(int i, T val); - void sort(int (*compare)(const T *a, const T *b)); - void add(T x); - void insert(int index, T val); - void remove(int index); - void Delete(int index); - void clear(); - void purge(); // like clear() but deletes all contents - - private: - void grow(); - void setextend(int index, T value); - void indexerr(int index) const; - - T *vect; - int alloced; // # of entries allocated - int used; // # of entries actually used (size) -}; - -template inline Svec::Svec(int max) : alloced(max), used(0) -{ - vect = (T *)malloc(max * sizeof(T)); -} - -template inline Svec::~Svec() { free(vect); } - -template inline int Svec::size() const { return used; } - -template inline T &Svec::operator[](int i) -{ -#ifdef CHECK_INDICES - if (i < 0 || i >= used) - indexerr(i); -#endif - return vect[i]; -} - -template inline T Svec::operator[](int i) const -{ -#ifdef CHECK_INDICES - if (i < 0 || i >= used) - indexerr(i); -#endif - return vect[i]; -} - -template inline void Svec::set(int i, T val) -{ - if (i < 0 || i >= used) - setextend(i, val); - else - vect[i] = val; -} - -template inline void Svec::add(T x) -{ - if (++used > alloced) - grow(); - vect[used - 1] = x; -} - -/* -template -inline void Svec::add(T x) -{ - if(++used > alloced) - { - - } - - vect[used - 1] = x; -} -*/ - -template inline void Svec::clear() { used = 0; } - -template inline void Svec::grow() -{ - // printf("size=%d\n",sizeof(T)); - vect = (T *)realloc(vect, (alloced *= 2) * sizeof(T)); -} - -#endif // SVEC_H diff --git a/src/tablefield.h b/src/tablefield.h deleted file mode 100644 index 787eb6b..0000000 --- a/src/tablefield.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * tablefield.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef TABLEFIELD_H -#define TABLEFIELD_H - -#include - -struct TableField -{ - QString name; - int width; - int gap; - int align; - QString tooltip; -}; - -#endif // TABLEFIELD_H diff --git a/src/translations/qps.ts b/src/translations/qps.ts deleted file mode 100644 index c43cf0b..0000000 --- a/src/translations/qps.ts +++ /dev/null @@ -1,1772 +0,0 @@ - - - - - AllFields - - - Field - - - - - Field name - - - - - Description - - - - - Field description - - - - - Value - - - - - Field value - - - - - Boxvar - - - Exit On Close Button - - - - - Host Name Lookup - - - - - Service Name Lookup - - - - - Disclosure Triangles - - - - - Branch Lines - - - - - Auto Save Settings on Exit - - - - - Selection: Copy PIDs to Clipboard - - - - - Normalize NICE - - - - - Use pmap for Map Names - - - - - Cbgroup - - - General - - - - - Command - - - The command: - - - - - - - - -failed with the error: - - - - - - - Too many processes - - - - - Unknown error - - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - - - - - -exited with status - - - - - Command Failed - - - - - CommandDialog - - - Edit Commands 0.1 alpha - - - - - Name: - - - - - Popup - - - - - Command Line: - - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - - - - - New... - - - - - - Add... - - - - - Delete - - - - - Close - - - - - ControlBar - - - Linear - - - - - Tree - - - - - All Processes - - - - - Your Processes - - - - - Non-Root Processes - - - - - Running Processes - - - - - Pause (Ctrl+Space) - - - - - Details - - - Process %1 ( %2 ) - details - - - - - Files - - - - - Sockets - - - - - Memory Maps - - - - - Environment - - - - - All Fields - - - - - Environ - - - Variable - - - - - Variable name - - - - - Value - - - - - Variable value - - - - - EventDialog - - - Watchdog 0.1 alpha - - - - - Eventcat - - - - - Select condition - - - - - labelDescrition - - - - - Enable - - - - - process name - - - - - cpu - - - - - % - - - - - include already running process - - - - - run command - - - - - show Message - - - - - Help (Not yet. just concept) - - - - - %p : pid -%c : command - - - - - New - - - - - Add - - - - - Delete - - - - - Close - - - - - ExecWindow - - - Qps - - - - - Ok - - - - - Qps Watchdog - - - - - %1 exit with code %2 - - - - - Close - - - - - %1 [running] - - - - - terminate command - - - - - Error %1 : [%2] Maybe command not found - - - - - FieldSelect - - - Select Custom Fields - - - - - Close - - - - - Files - - - Fd - - - - - File descriptor - - - - - Mode - - - - - Open mode - - - - - Name - - - - - File name (if available) - - - - - IntervalDialog - - - Change Update Period - - - - - New Update Period - - - - - Cancel - - - - - OK - - - - - No UPDATE - - - - - Invalid value - - - - - ListModel - - - Event Category - - - - - Enable - - - - - Maps - - - Address Range - - - - - Mapped addresses (hex) ) - - - - - Size - - - - - Kbytes mapped (dec) - - - - - Perm - - - - - Permission flags - - - - - Offset - - - - - File offset at start of mapping (hex) - - - - - Device - - - - - Major,Minor device numbers (dec) - - - - - Inode - - - - - Inode number (dec) - - - - - File - - - - - File name (if available) - - - - - PermissionDialog - - - Permission - - - - - Root password - - - - - Cancel - - - - - OK - - - - - Preferences - - - Preferences - - - - - Setting - - - - - %CPU divided by - - - - - Total cpu: %1 - - - - - Single cpu: 1 - - - - - default - - - - - for developer - - - - - Appearance - - - - - Proc - - - PID - - - - - Process ID - - - - - TGID - - - - - Task group ID ( parent of threads ) - - - - - PPID - - - - - Parent process ID - - - - - PGID - - - - - Process group ID - - - - - SID - - - - - Session ID - - - - - TTY - - - - - Terminal - - - - - TPGID - - - - - Process group ID of tty owner - - - - - USER - - - - - Owner (*=suid root, +=suid a user) - - - - - GROUP - - - - - Group name (*=sgid other) - - - - - UID - - - - - Real user ID - - - - - EUID - - - - - Effective user ID - - - - - SUID - - - - - Saved user ID (Posix) - - - - - FSUID - - - - - File system user ID - - - - - GID - - - - - Real group ID - - - - - EGID - - - - - Effective group ID - - - - - SGID - - - - - Saved group ID (Posix) - - - - - FSGID - - - - - File system group ID - - - - - PRI - - - - - Dynamic priority - - - - - NICE - - - - - Scheduling favour (higher -> less cpu time) - - - - - NLWP - - - - - Number of tasks(threads) in task group - - - - - PLCY - - - - - Scheduling policy - - - - - RPRI - - - - - Realtime priority (0-99, more is better) - - - - - TMS - - - - - Time slice in milliseconds - - - - - %SAVG - - - - - Percentage average sleep time (-1 -> N/A) - - - - - CPUSET - - - - - Affinity CPU mask (0 -> API not supported) - - - - - MAJFLT - - - - - Number of major faults (disk access) - - - - - MINFLT - - - - - Number of minor faults (no disk access) - - - - - VSIZE - - - - - Virtual image size of process - - - - - RSS - - - - - Resident set size - - - - - MEM - - - - - memory usage (RSS-SHARE) - - - - - TRS - - - - - Text(code) resident set size - - - - - DRS - - - - - Data resident set size(malloc+global variable) - - - - - STACK - - - - - Stack size - - - - - SHARE - - - - - Shared memory with other libs - - - - - SWAP - - - - - Kbytes on swap device - - - - - IO_R - - - - - io read (file) - - - - - IO_W - - - - - io write (file) - - - - - DT - - - - - Number of dirty (non-written) pages - - - - - STAT - - - - - State of the process - - - - - FLAGS - - - - - Process flags (hex) - - - - - WCHAN - - - - - Kernel function where process is sleeping - - - - - %WCPU - - - - - Weighted percentage of CPU (30 s average) - - - - - %CPU - - - - - Percentage of CPU used since last update - - - - - %MEM - - - - - Percentage of memory used (RSS/total mem) - - - - - START - - - - - Time process started - - - - - TIME - - - - - Total CPU time used since start - - - - - CPU - - - - - CPU the process is executing on (SMP system) - - - - - the process name - - - - - Process Name - - - - - CWD - - - - - Current working directory - - - - - ROOT - - - - - Root directory of process - - - - - COMMAND_LINE - - - - - Command line that started the process - - - - - QObject - - - Show - - - - - Hide - - - - - ScreenShot - - - - - Quit - - - - - Qps - - - header_popup - - - - - Remove Field - - - - - Add Field - - - - - Command - - - - - View - - - - - Process - - - - - Log - - - - - Custom Fields - - - - - Basic Fields - - - - - Jobs Fields - - - - - Memory Fields - - - - - Scheduling Fields - - - - - Select Custom Fields... - - - - - Option - - - - - Update Period... - - - - - Show Status bar - - - - - Preferences... - - - - - Help - - - - - - About - - - - - Detail - - - - - test - - - - - Copied to Clipboard - - - - - context popup - - - - - Renice... - - - - - Scheduling... - - - - - Terminate - - - - - Hangup - - - - - Kill - - - - - Stop - - - - - Continue - - - - - SIGINT (interrupt) - - - - - SIGCONT (continue) - - - - - SIGSTOP (stop) - - - - - SIGQUIT (quit) - - - - - SIGILL (illegal instruction) - - - - - SIGABRT (abort) - - - - - SIGFPE (floating point exception) - - - - - SIGSEGV (segmentation violation) - - - - - SIGPIPE (broken pipe) - - - - - SIGALRM (timer signal) - - - - - SIGUSR1 (user-defined 1) - - - - - SIGUSR2 (user-defined 2) - - - - - SIGCHLD (child death) - - - - - SIGTSTP (stop from tty) - - - - - SIGTTIN (tty input) - - - - - SIGTTOU (tty output) - - - - - View Details - - - - - WatchDog - - - - - Edit Commands... - - - - - Quit - - - - - - - - - - Permission denied - - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - - - - - Only the super-user may lower the nice value of a process. - - - - - Only the super-user may change the scheduling policy and static priority. - - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - - - - - SchedDialog - - - Change scheduling - - - - - Scheduling Policy - - - - - SCHED_OTHER (time-sharing) - - - - - SCHED_FIFO (real-time) - - - - - SCHED_RR (real-time) - - - - - OK - - - - - Cancel - - - - - Priority (1-99): - - - - - Invalid Input - - - - - The priority must be in the range 1..99 - - - - - Screenshot - - - /untitled. - - - - - Save As - - - - - %1 Files (*.%2);;All Files (*) - - - - - Options - - - - - s - - - - - Screenshot Delay: - - - - - Hide This Window - - - - - New Screenshot - - - - - Quit - - - - - SearchBox - - - PID,COMMAND,USER... - - - - - SliderDialog - - - Renice Process - - - - - New nice value: - - - - - Cancel - - - - - OK - - - - - Sockets - - - Fd - - - - - File descriptor - - - - - Proto - - - - - Protocol (TCP or UDP) - - - - - Recv-Q - - - - - Bytes in receive queue - - - - - Send-Q - - - - - Bytes in send queue - - - - - Local Addr - - - - - Local IP address - - - - - - Port - - - - - Local port - - - - - Remote Addr - - - - - Remote IP address - - - - - Remote port - - - - - State - - - - - Connection state - - - - - StatusBar - - - Process count: %1 - - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - - - - - TFrame - - - this is Tframe widget - - - - - UFrame - - - title - - - - - WatchdogDialog - - - if process start - - - - - if process finish - - - - - select condition - - - - diff --git a/src/translations/qps_ca.ts b/src/translations/qps_ca.ts deleted file mode 100644 index 24e2e70..0000000 --- a/src/translations/qps_ca.ts +++ /dev/null @@ -1,1791 +0,0 @@ - - - - - AllFields - - - Field - Camp - - - - Field name - Nom del camp - - - - Description - Descripció - - - - Field description - Descripció del camp - - - - Value - Valor - - - - Field value - Valor del camp - - - - Boxvar - - - Exit On Close Button - Botó tanca en sortir - - - - Host Name Lookup - Recerca del nom d'amfitrió - - - - Service Name Lookup - Recerca del nom de servei - - - - Disclosure Triangles - Triangles de divulgació - - - - Branch Lines - Línies de bifurcació - - - - Auto Save Settings on Exit - Desa automàticament els ajusts en sortir - - - - Selection: Copy PIDs to Clipboard - Selecció: copia els PID al porta-retalls - - - - Normalize NICE - Normalitza NICE - - - - Use pmap for Map Names - Utilitza pmap per al mapatge dels noms - - - - Cbgroup - - - General - - - - - Command - - - The command: - - - L'ordre: - - - - - - - -failed with the error: - - - - -ha fallat amb l'error: - - - - - - Too many processes - Hi ha massa processos - - - - Unknown error - Error desconegut - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - -no s'ha pogut executar perquè no s'ha trobat, -o no teniu permisos d'execució. - - - - - -exited with status - - -ha sortit amb l'estat - - - - Command Failed - Ordre fallida - - - - CommandDialog - - - Edit Commands 0.1 alpha - Editor d'ordres 0.1 alfa - - - - Name: - Nom: - - - - Popup - Emergent - - - - Command Line: - Línia d'ordres: - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - Substitucions: -%p PID -%c ORDRE -%C LÍNIA_ORDRES -%u USUARI -%% % - - - - - - New... - Nou... - - - - - Add... - Afegeix... - - - - Delete - - - - - Close - Tanca - - - - ControlBar - - - Linear - Lineal - - - - Tree - Arbre - - - - All Processes - Tots els processos - - - - Your Processes - Els vostres processos - - - - Non-Root Processes - Els processos que no siguin de root - - - - Running Processes - Els processos en execució - - - - Pause (Ctrl+Space) - Pausa (Ctrl+Espai) - - - - Details - - - Process %1 ( %2 ) - details - Procés %1 ( %2 ) - detalls - - - - Files - Fitxers - - - - Sockets - Sòcols - - - - Memory Maps - Mapatges de memòria - - - - Environment - Entorn - - - - All Fields - Tots els camps - - - - Environ - - - Variable - - - - - Variable name - Nom de la variable - - - - Value - Valor - - - - Variable value - Valor de la variable - - - - EventDialog - - - Watchdog 0.1 alpha - Vigilant 0.1 alfa - - - - Eventcat - - - - - Select condition - Condició de selecció - - - - labelDescrition - Descripció - - - - Enable - Habilita - - - - process name - nom del procés - - - - cpu - - - - - % - - - - - include already running process - inclou el procés que ja s'està executant - - - - run command - executa l'ordre - - - - show Message - mostra el missatge - - - - Help (Not yet. just concept) - Ajuda (encara no. tan sols el concepte) - - - - %p : pid -%c : command - %p : pid -%c : ordre - - - - New - Nou - - - - Add - Afegeix - - - - Delete - Elimina - - - - Close - Tanca - - - - ExecWindow - - - Qps - - - - - Ok - D'acord - - - - Qps Watchdog - Vigilant de Qps - - - - %1 exit with code %2 - %1 surt amb el codi %2 - - - - Close - Tanca - - - - %1 [running] - %1 [en execució] - - - - terminate command - finalitza l'ordre - - - - Error %1 : [%2] Maybe command not found - Error %1 : [%2] Potser no s'ha trobat l'ordre - - - - FieldSelect - - - Select Custom Fields - Selecció dels camps personalitzats - - - - Close - Tanca - - - - Files - - - Fd - - - - - File descriptor - Descriptor de fitxer - - - - Mode - - - - - Open mode - - - - - Name - Nom - - - - File name (if available) - Nom de fitxer (si està disponible) - - - - IntervalDialog - - - Change Update Period - Canvi del període d'actualització - - - - New Update Period - Període d'actualització nou - - - - Cancel - Cancel·la - - - - OK - D'acord - - - - No UPDATE - - - - - Invalid value - Valor no vàlid - - - - ListModel - - - Event Category - Categoria d'esdeveniment - - - - Enable - Habilita - - - - Maps - - - Address Range - Interval d'adreces - - - - Mapped addresses (hex) ) - Adreces assignades (hex) ) - - - - Size - Mida - - - - Kbytes mapped (dec) - Kbytes assignats (dec) - - - - Perm - - - - - Permission flags - Indicadors dels permisos - - - - Offset - Desplaçament - - - - File offset at start of mapping (hex) - Desplaçament de fitxer al començament del mapatge (hex) - - - - Device - Dispositiu - - - - Major,Minor device numbers (dec) - Nombres de dispositius major,menor (dec) - - - - Inode - - - - - Inode number (dec) - Nombre d'inode (dec) - - - - File - Fitxer - - - - File name (if available) - Nom de fitxer (si està disponible) - - - - PermissionDialog - - - Permission - Permisos - - - - Root password - Contrasenya de root - - - - Cancel - Cancel·la - - - - OK - D'acord - - - - Preferences - - - Preferences - Preferències - - - - Setting - Establiment - - - - %CPU divided by - %CPU dividida per - - - - Total cpu: %1 - cpu total: %1 - - - - Single cpu: 1 - cpu individual: 1 - - - - default - per defecte - - - - for developer - per al desenvolupador - - - - Appearance - Aparença - - - - Proc - - - PID - - - - - Process ID - ID procés - - - - TGID - - - - - Task group ID ( parent of threads ) - ID de grup de tasques ( pare dels fils ) - - - - PPID - - - - - Parent process ID - ID de procés pare - - - - PGID - - - - - Process group ID - ID de grup de processos - - - - SID - - - - - Session ID - ID de sessió - - - - TTY - - - - - Terminal - - - - - TPGID - - - - - Process group ID of tty owner - ID de grup de processos del propietari del tty - - - - USER - USUARI - - - - Owner (*=suid root, +=suid a user) - Propietari (*=suid root, +=suid un usuari) - - - - GROUP - GRUP - - - - Group name (*=sgid other) - Nom de grup (*=sgid altres) - - - - UID - - - - - Real user ID - ID d'usuari real - - - - EUID - - - - - Effective user ID - ID d'usuari efectiu - - - - SUID - - - - - Saved user ID (Posix) - ID d'usuari desat (Posix) - - - - FSUID - - - - - File system user ID - ID d'usuari de sistema de fitxers - - - - GID - - - - - Real group ID - ID de grup real - - - - EGID - - - - - Effective group ID - ID de grup efectiu - - - - SGID - - - - - Saved group ID (Posix) - ID de grup desat (Posix) - - - - FSGID - - - - - File system group ID - ID de grup de sistemes de fitxers - - - - PRI - - - - - Dynamic priority - Prioritat dinàmica - - - - NICE - - - - - Scheduling favour (higher -> less cpu time) - A favor de la planificació (més alt -> menys temps de CPU) - - - - NLWP - - - - - Number of tasks(threads) in task group - Nombre de tasques(fils) al grup de tasques - - - - PLCY - - - - - Scheduling policy - Política de planificació - - - - RPRI - - - - - Realtime priority (0-99, more is better) - Prioritat de temps real (0-99, més és millor) - - - - TMS - - - - - Time slice in milliseconds - Porció de temps en mil·lisegons - - - - %SAVG - - - - - Percentage average sleep time (-1 -> N/A) - Percentatge mitjà de temps d'adormiment (-1 -> N/D) - - - - CPUSET - - - - - Affinity CPU mask (0 -> API not supported) - Màscara de CPU d'afinitat (0 -> API no admesa) - - - - MAJFLT - - - - - Number of major faults (disk access) - Nombre de falles major (accés de disc) - - - - MINFLT - - - - - Number of minor faults (no disk access) - Nombre de falles menor (sense accés de disc) - - - - VSIZE - - - - - Virtual image size of process - Mida d'imatge virtual del procés - - - - RSS - - - - - Resident set size - Mida d'establiment resident - - - - MEM - - - - - memory usage (RSS-SHARE) - ús de memòria (RSS-SHARE) - - - - TRS - - - - - Text(code) resident set size - Mida d'establiment resident de Text(code) - - - - DRS - - - - - Data resident set size(malloc+global variable) - - - - - STACK - PILA - - - - Stack size - Mida de pila - - - - SHARE - - - - - Shared memory with other libs - Memòria compartida amb altres biblioteques - - - - SWAP - INTERCANI - - - - Kbytes on swap device - Kbytes al dispositiu d'intercanvi - - - - IO_R - ES_L - - - - io read (file) - lectura e/s (fitxer) - - - - IO_W - ES_E - - - - io write (file) - escriptura e/s (fitxer) - - - - DT - - - - - Number of dirty (non-written) pages - Nombre de pàgines brutes (no escrites) - - - - STAT - ESTAT - - - - State of the process - Estat del procés - - - - FLAGS - INDICADORS - - - - Process flags (hex) - Indicadors de procés (hex) - - - - WCHAN - - - - - Kernel function where process is sleeping - Funció del Kernel on el procés està dormint - - - - %WCPU - - - - - Weighted percentage of CPU (30 s average) - Percentatge ponderat de CPU (mitjana de 30 s) - - - - %CPU - - - - - Percentage of CPU used since last update - Percentatge de CPU utilitzat des de l'última actualització - - - - %MEM - - - - - Percentage of memory used (RSS/total mem) - Percentatge utilitzat de memòria (RSS/total mem) - - - - START - INICI - - - - Time process started - L'hora en què es va iniciar el procés - - - - TIME - TEMPS - - - - Total CPU time used since start - Temps de CPU total que s'ha utilitzat des de que es va iniciar - - - - CPU - - - - - CPU the process is executing on (SMP system) - CPU en què s'està executant el procés (sistema SMP) - - - - the process name - el nom del procés - - - - Process Name - Nom del procés - - - - CWD - - - - - Current working directory - Directori actual de treball - - - - ROOT - ARREL - - - - Root directory of process - Directori arrel del procés - - - - COMMAND_LINE - LÍNEA_ORDRE - - - - Command line that started the process - Línia de l'ordre que va iniciar el procés - - - - QObject - - - Show - Mostra - - - - Hide - Oculta - - - - ScreenShot - Captura de pantalla - - - - Quit - Surt - - - - Qps - - - header_popup - - - - - Remove Field - Suprimeix el camp - - - - Add Field - Afegeix un camp - - - - Command - Ordre - - - - View - Visualitza - - - - Process - Procés - - - - Log - Registre - - - - Custom Fields - Camps personalitzats - - - - Basic Fields - Camps bàsics - - - - Jobs Fields - Camps dels treballs - - - - Memory Fields - Camps de la memòria - - - - Scheduling Fields - Camps de la planificació - - - - Select Custom Fields... - Selecciona els camps personalitzats... - - - - Option - Opció - - - - Update Period... - Període d'actualització... - - - - Show Status bar - Mostra la barra d'estat - - - - Preferences... - Preferències... - - - - Help - Ajuda - - - - - About - Quant a - - - - Detail - Detallat - - - - test - prova - - - - Copied to Clipboard - S'ha copiat al porta-retalls - - - - context popup - - - - - Renice... - - - - - Scheduling... - Planificació... - - - - Terminate - - - - - Hangup - - - - - Kill - Mata - - - - Stop - Atura - - - - Continue - Continua - - - - SIGINT (interrupt) - SIGINT (interromp) - - - - SIGCONT (continue) - SIGCONT (continua) - - - - SIGSTOP (stop) - SIGSTOP (atura) - - - - SIGQUIT (quit) - SIGQUIT (surt) - - - - SIGILL (illegal instruction) - SIGILL (instrucció il·legal) - - - - SIGABRT (abort) - SIGABRT (avorta) - - - - SIGFPE (floating point exception) - SIGFPE (excepció de punt flotant) - - - - SIGSEGV (segmentation violation) - SIGSEGV (violació de la segmentació) - - - - SIGPIPE (broken pipe) - SIGPIPE (canonada trencada) - - - - SIGALRM (timer signal) - SIGALRM (senyal del temporitzador) - - - - SIGUSR1 (user-defined 1) - SIGUSR1 (definida de l'usuari 1) - - - - SIGUSR2 (user-defined 2) - SIGUSR2 (definida de l'usuari 2) - - - - SIGCHLD (child death) - SIGCHLD (mort del fill) - - - - SIGTSTP (stop from tty) - SIGTSTP (aturada des del tty) - - - - SIGTTIN (tty input) - SIGTTIN (entrada tty) - - - - SIGTTOU (tty output) - SIGTTOU (sortida tty) - - - - View Details - Mostra els detalls - - - - WatchDog - Vigilant - - - - Edit Commands... - Edita les ordres... - - - - Quit - Surt - - - - - - - - - Permission denied - Permís denegat - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - - - - - Only the super-user may lower the nice value of a process. - - - - - Only the super-user may change the scheduling policy and static priority. - - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - - - - - SchedDialog - - - Change scheduling - Canvia la planificació - - - - Scheduling Policy - Política de planificació - - - - SCHED_OTHER (time-sharing) - SCHED_OTHER (compartició del temps) - - - - SCHED_FIFO (real-time) - SCHED_FIFO (temps real) - - - - SCHED_RR (real-time) - SCHED_RR (temps real) - - - - OK - D'acord - - - - Cancel - Cancel·la - - - - Priority (1-99): - Prioritat (1-99): - - - - Invalid Input - Entrada no vàlida - - - - The priority must be in the range 1..99 - La prioritat ha d'estar dins de l'interval 1..99 - - - - Screenshot - - - /untitled. - - - - - Save As - Anomena i desa - - - - %1 Files (*.%2);;All Files (*) - Fitxers %1 (*.%2);;Tots els fitxers (*) - - - - Options - Opcions - - - - s - - - - - Screenshot Delay: - Retard de la captura de pantalla: - - - - Hide This Window - Oculta aquesta finestra - - - - New Screenshot - Captura de pantalla nova - - - - Quit - Surt - - - - SearchBox - - - PID,COMMAND,USER... - PID,ORDRE,USUARI... - - - - SliderDialog - - - Renice Process - - - - - New nice value: - - - - - Cancel - Cancel·la - - - - OK - D'acord - - - - Sockets - - - Fd - - - - - File descriptor - Descriptor de fitxer - - - - Proto - - - - - Protocol (TCP or UDP) - Protocol (TCP o UDP) - - - - Recv-Q - - - - - Bytes in receive queue - Bytes a la cua de recepció - - - - Send-Q - - - - - Bytes in send queue - Bytes a la cua d'enviament - - - - Local Addr - Adreça local - - - - Local IP address - Adreça IP local - - - - - Port - - - - - Local port - Port local - - - - Remote Addr - Adreça remota - - - - Remote IP address - Adreça IP remota - - - - Remote port - Port remot - - - - State - Estat - - - - Connection state - Estat de la connexió - - - - StatusBar - - - Process count: %1 - Nombre de processos: %1 - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - - - - - TFrame - - - this is Tframe widget - - - - - UFrame - - - title - títol - - - - WatchdogDialog - - - if process start - si s'inicia el procés - - - - if process finish - si s'acaba el procés - - - - select condition - seleccioneu la condició - - - diff --git a/src/translations/qps_cs.ts b/src/translations/qps_cs.ts deleted file mode 100644 index 899e555..0000000 --- a/src/translations/qps_cs.ts +++ /dev/null @@ -1,1792 +0,0 @@ - - - - - AllFields - - - Field - Kolonka - - - - Field name - Název kolonky - - - - Description - Popis - - - - Field description - Popis kolonky - - - - Value - Hodnota - - - - Field value - Hodnota v kolonce - - - - Boxvar - - - Exit On Close Button - Při kliknutí na tlačítko zavření ukončit - - - - Host Name Lookup - Překládat IP adresy na názvy strojů - - - - Service Name Lookup - Překládat čísla portů na názvy služeb - - - - Disclosure Triangles - Šipky pro zobrazení (ovládací prvek) - - - - Branch Lines - Linky větve - - - - Auto Save Settings on Exit - Při ukončování automaticky uložit nastavení - - - - Selection: Copy PIDs to Clipboard - Výběr: zkopírovat identif. procesů do schránky - - - - Normalize NICE - Normalizovat prioritu (NICE) - - - - Use pmap for Map Names - Použít pro názvy map mapu procesů - - - - Cbgroup - - - General - Obecné - - - - Command - - - The command: - - - Příkaz: - - - - - - - -failed with the error: - - - - -nezdařilo se s chybou: - - - - - - Too many processes - Příliš mnoho procesů - - - - Unknown error - Neznámá chyba - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - -se nepodařilo spustit protože nebylo nalezeno, -nebo nemá nastavené oprávnění pro spouštění. - - - - - -exited with status - - -skončilo se stavem - - - - Command Failed - Příkaz se nezdařil - - - - CommandDialog - - - Edit Commands 0.1 alpha - Úprava příkazů verze 0.1 alfa - - - - Name: - Název: - - - - Popup - Vyskakovací - - - - Command Line: - Příkazový řádek: - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - Dosazování: -%p identif. procesu -%c příkaz -%C příkazový řádek -%u uživatel -%% % - - - - - - New... - Nové… - - - - - Add... - Přidat… - - - - Delete - Smazat - - - - Close - Zavřít - - - - ControlBar - - - Linear - Lineární - - - - Tree - Strom - - - - All Processes - Všechny procesy - - - - Your Processes - Vaše procesy - - - - Non-Root Processes - Procesy nenáležející správci systému (root) - - - - Running Processes - Spuštěné procesy - - - - Pause (Ctrl+Space) - Pozastavit (Ctrl+mezerník) - - - - Details - - - Process %1 ( %2 ) - details - Proces %1 ( %2 ) – podrobnosti - - - - Files - Soubory - - - - Sockets - Sokety - - - - Memory Maps - Mapy paměti - - - - Environment - Prostředí - - - - All Fields - Všechny kolonky - - - - Environ - - - Variable - Proměnná - - - - Variable name - Název proměnné - - - - Value - Hodnota - - - - Variable value - Hodnota v proměnné - - - - EventDialog - - - Watchdog 0.1 alpha - Resetátor (watchdog) verze 0.1 alfa - - - - Eventcat - - - - - Select condition - Vybrat podmínku - - - - labelDescrition - štítekPopis - - - - Enable - Zapnout - - - - process name - název procesu - - - - cpu - procesor - - - - % - - - - - include already running process - zahrnout už spuštěný proces - - - - run command - spustit příkaz - - - - show Message - zobrazit hlášení - - - - Help (Not yet. just concept) - Nápověda (zatím neimplementováno, pouze náčrt) - - - - %p : pid -%c : command - %p : identif. procesu -%c : příkaz - - - - New - Nový - - - - Add - Přidat - - - - Delete - Smazat - - - - Close - Zavřít - - - - ExecWindow - - - Qps - - - - - Ok - - - - - Qps Watchdog - Qps resetátor (watchdog) - - - - %1 exit with code %2 - %1 ukončit s kódem %2 - - - - Close - Zavřít - - - - %1 [running] - %1 [spuštěné] - - - - terminate command - ukončit příkaz - - - - Error %1 : [%2] Maybe command not found - Chyba %1 : [%2] Příkaz se nejspíš nepodařilo najít - - - - FieldSelect - - - Select Custom Fields - Vybrat uživatelem určené kolonky - - - - Close - Zavřít - - - - Files - - - Fd - Popis. soub. - - - - File descriptor - Popisovač souboru - - - - Mode - Režim - - - - Open mode - Režim otevírání - - - - Name - Název - - - - File name (if available) - Název souboru (pokud je k dispozici) - - - - IntervalDialog - - - Change Update Period - Změnit interval aktualizace - - - - New Update Period - Nový interval aktualizace - - - - Cancel - Storno - - - - OK - - - - - No UPDATE - Neaktualizovat - - - - Invalid value - Neplatná hodnota - - - - ListModel - - - Event Category - Kategorie události - - - - Enable - Zapnout - - - - Maps - - - Address Range - Adresní rozsah - - - - Mapped addresses (hex) ) - Mapované adresy (osmičkově) ) - - - - Size - Velikost - - - - Kbytes mapped (dec) - Mapováno kilobajtů (desítkově) - - - - Perm - Oprávnění - - - - Permission flags - Příznaky oprávnění - - - - Offset - Posun - - - - File offset at start of mapping (hex) - Posun souboru na začátku mapování (osmičkově) - - - - Device - Zařízení - - - - Major,Minor device numbers (dec) - Hlavní,vedlejší čísla zařízení (desítkově) - - - - Inode - I-uzel - - - - Inode number (dec) - Číslo i-uzlu (desítkově) - - - - File - Soubor - - - - File name (if available) - Název souboru (pokud je k dispozici) - - - - PermissionDialog - - - Permission - Oprávnění - - - - Root password - Heslo správce systému - - - - Cancel - Storno - - - - OK - - - - - Preferences - - - Preferences - Předvolby - - - - Setting - Nastavení - - - - %CPU divided by - %procesoru děleno - - - - Total cpu: %1 - Celkem procesoru: %1 - - - - Single cpu: 1 - Jediný procesor: 1 - - - - default - výchozí - - - - for developer - pro vývojáře - - - - Appearance - Vzhled - - - - Proc - - - PID - - - - - Process ID - Identif. procesu - - - - TGID - - - - - Task group ID ( parent of threads ) - Identif. skupiny úlohy (nadřazené vláknům) - - - - PPID - - - - - Parent process ID - Identif. nadřazeného procesu - - - - PGID - - - - - Process group ID - Identif. skupiny procesu - - - - SID - - - - - Session ID - Identif. sezení - - - - TTY - - - - - Terminal - Konzole - - - - TPGID - - - - - Process group ID of tty owner - Identif. skupiny vlastníka konzole - - - - USER - UŽIVATEL - - - - Owner (*=suid root, +=suid a user) - Vlastník (*=suid správce, +=suid uživatel) - - - - GROUP - SKUPINA - - - - Group name (*=sgid other) - Název skupiny (*=sgid ostatní) - - - - UID - - - - - Real user ID - Skutečný identif. uživatele - - - - EUID - - - - - Effective user ID - Efektivní identif. uživatele - - - - SUID - - - - - Saved user ID (Posix) - Uložený identif. uživatele (Posix) - - - - FSUID - - - - - File system user ID - Identifikátor uživatele soubor. systému - - - - GID - - - - - Real group ID - Skutečný identif. skupiny - - - - EGID - - - - - Effective group ID - Efektivní identif. skupiny - - - - SGID - - - - - Saved group ID (Posix) - Uložený identif. skupiny (Posix) - - - - FSGID - - - - - File system group ID - Identif. skupiny souborového systému - - - - PRI - - - - - Dynamic priority - Dynamická priorita - - - - NICE - - - - - Scheduling favour (higher -> less cpu time) - Přednost při plánování (vyšší -> méně času procesoru) - - - - NLWP - - - - - Number of tasks(threads) in task group - Počet úloh (vláken) ve skupině úlohy - - - - PLCY - - - - - Scheduling policy - Zásada plánování - - - - RPRI - - - - - Realtime priority (0-99, more is better) - Priorita pro reálný čas (0-99, vyšší je lepší) - - - - TMS - - - - - Time slice in milliseconds - Časové okno (v milisekundách) - - - - %SAVG - - - - - Percentage average sleep time (-1 -> N/A) - Průměrné procento doby spánku (-1 -> N/A) - - - - CPUSET - - - - - Affinity CPU mask (0 -> API not supported) - Maska přiřazení procesoru CPU (0 -> aplikační program. rozhraní není podporováno) - - - - MAJFLT - - - - - Number of major faults (disk access) - Počet velkých nezdarů (přístup k disku) - - - - MINFLT - - - - - Number of minor faults (no disk access) - Počet drobných nezdarů (žádný přístup k disku) - - - - VSIZE - - - - - Virtual image size of process - Velikost virtuálního obrazu procesu - - - - RSS - - - - - Resident set size - Velikost rezidentní sady - - - - MEM - - - - - memory usage (RSS-SHARE) - využití paměti (RSS-SHARE) - - - - TRS - - - - - Text(code) resident set size - Velikost rezidentní sady textu (kódu) - - - - DRS - - - - - Data resident set size(malloc+global variable) - Velikost rezidentní sady dat (přiřazení paměti + globální proměnná) - - - - STACK - - - - - Stack size - Velikost stacku - - - - SHARE - - - - - Shared memory with other libs - Paměť sdílená s ostatními knihovnami - - - - SWAP - - - - - Kbytes on swap device - Kilobajtů na zařízení pro odkládání stránek paměti (swap) - - - - IO_R - - - - - io read (file) - čtení vst/výst. (soubor) - - - - IO_W - - - - - io write (file) - zápis vst/výst. (soubor) - - - - DT - - - - - Number of dirty (non-written) pages - Počet nezapsaných („dirty“) stránek - - - - STAT - - - - - State of the process - Stav procesu - - - - FLAGS - - - - - Process flags (hex) - Příznaky procesu (osmičkově) - - - - WCHAN - - - - - Kernel function where process is sleeping - Funkce jádra kde proces spí - - - - %WCPU - - - - - Weighted percentage of CPU (30 s average) - Vážený průměr procent procesoru (za 30 s) - - - - %CPU - - - - - Percentage of CPU used since last update - Procento využití procesoru od minulé aktualizace - - - - %MEM - - - - - Percentage of memory used (RSS/total mem) - Procento využití paměti (RSS / celkem paměti) - - - - START - - - - - Time process started - Okamžik spuštění procesu - - - - TIME - - - - - Total CPU time used since start - Celkový čas procesoru spotřebovaný od spuštění - - - - CPU - Procesor - - - - CPU the process is executing on (SMP system) - Jádro procesoru na kterém je proces vykonáván - - - - the process name - název procesu - - - - Process Name - Název procesu - - - - CWD - - - - - Current working directory - Stávající pracovní složka - - - - ROOT - - - - - Root directory of process - Kořenová složka procesu - - - - COMMAND_LINE - - - - - Command line that started the process - Příkaz kterým byl proces spuštěn - - - - QObject - - - Show - Zobrazit - - - - Hide - Skrýt - - - - ScreenShot - Snímek obrazovky - - - - Quit - Ukončit - - - - Qps - - - header_popup - vyskakovací hlavička - - - - Remove Field - Odebrat kolonku - - - - Add Field - Přidat kolonku - - - - Command - Příkaz - - - - View - Zobrazit - - - - Process - Proces - - - - Log - Záznam událostí (log) - - - - Custom Fields - Uživatelem určené kolonky - - - - Basic Fields - Základní kolonky - - - - Jobs Fields - Kolonky úloh - - - - Memory Fields - Kolonky paměti - - - - Scheduling Fields - Kolonky plánování - - - - Select Custom Fields... - Vybrat uživatelem určené kolonky… - - - - Option - Volba - - - - Update Period... - Perioda aktualizace… - - - - Show Status bar - Zobrazit stavový pruh - - - - Preferences... - Předvolby… - - - - Help - Nápověda - - - - - About - O aplikaci - - - - Detail - Podrobnosti - - - - test - - - - - Copied to Clipboard - Zkopírováno do schránky - - - - context popup - kontextová vyskakovací nabídka - - - - Renice... - Změnit prioritu (nice)… - - - - Scheduling... - Plánování… - - - - Terminate - Ukončit - - - - Hangup - Zavěsit - - - - Kill - Vynutit ukončení (kill) - - - - Stop - Zastavit - - - - Continue - Pokračovat - - - - SIGINT (interrupt) - SIGINT (přerušení) - - - - SIGCONT (continue) - SIGCONT (pokračovat) - - - - SIGSTOP (stop) - SIGSTOP (zastavit) - - - - SIGQUIT (quit) - SIGQUIT (ukončit) - - - - SIGILL (illegal instruction) - SIGILL (neplatná instrukce) - - - - SIGABRT (abort) - SIGABRT (přerušit) - - - - SIGFPE (floating point exception) - SIGFPE (výjimka v plovoucí desetinné čárce) - - - - SIGSEGV (segmentation violation) - SIGSEGV (porušení ochrany paměti) - - - - SIGPIPE (broken pipe) - SIGPIPE (neočekávané uzavření roury) - - - - SIGALRM (timer signal) - SIGALRM (signál časovače) - - - - SIGUSR1 (user-defined 1) - SIGUSR1 (uživatelem určený 1) - - - - SIGUSR2 (user-defined 2) - SIGUSR2 (uživatelem určený 2) - - - - SIGCHLD (child death) - SIGCHLD (podřízený proces ukončen) - - - - SIGTSTP (stop from tty) - SIGTSTP (zastavení z konzole) - - - - SIGTTIN (tty input) - SIGTTIN (vstup z konzole) - - - - SIGTTOU (tty output) - SIGTTOU (výstup z konzole) - - - - View Details - Zobrazit podrobnosti - - - - WatchDog - Resetátor (watchdog) - - - - Edit Commands... - Upravit příkazy… - - - - Quit - Ukončit - - - - - - - - - Permission denied - Přístup odepřen - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - Nemáte oprávnění upravovat prioritu procesů (nice). To může udělat pouze vlastník procesu nebo správce systému. - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - Nemáte oprávnění upravovat prioritu procesu %1 (%2). To může udělat pouze vlastník procesu nebo správce systému. - - - - Only the super-user may lower the nice value of a process. - Zvýšit nebo snížit prioritu procesu (nice) může pouze správce systému. - - - - Only the super-user may change the scheduling policy and static priority. - Pouze správce systému může měnit zásadu plánování a pevně danou prioritu. - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - Nemáte oprávnění měnit plánování a/nebo prioritu procesu %1 (%2). To může udělat pouze vlastník procesu nebo správce systému. - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - Nemáte oprávnění poslat signál procesu %1 (%2). To může udělat pouze vlastník procesu nebo správce systému. - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - <h2> Qps %1 – vizuální správce procesů </h2> %2 založený na knihovně Qt %3<br><br><b>Zdrojové kódy: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Hlášení chyb: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - <b>Původní Qps vytvořil </b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Na vývoji se podíleli</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - <H1>Nápověda ke QPS</H1>Aktualizováno: 24. květen 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Ukončit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Aktualizovat </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> Vynucené ukončení procesu </td> <td> ALT + K </td> </tr> </tbody></table> - - - - SchedDialog - - - Change scheduling - Změnit plánování - - - - Scheduling Policy - Zásada plánování - - - - SCHED_OTHER (time-sharing) - SCHED_OTHER (sdílení času) - - - - SCHED_FIFO (real-time) - SCHED_FIFO (v reálném čase) - - - - SCHED_RR (real-time) - SCHED_RR (v reálném čase) - - - - OK - - - - - Cancel - Storno - - - - Priority (1-99): - Priorita (1-99): - - - - Invalid Input - Neplatné zadání - - - - The priority must be in the range 1..99 - Je třeba, aby priorita byla z rozsahu 1 až 99 - - - - Screenshot - - - /untitled. - /beznazvu. - - - - Save As - Uložit jako - - - - %1 Files (*.%2);;All Files (*) - %1 soubory (*.%2);;Všechny soubory (*) - - - - Options - Volby - - - - s - - - - - Screenshot Delay: - Prodleva pořízení snímku obrazovky: - - - - Hide This Window - Skrýt toto okno - - - - New Screenshot - Nový snímek obrazovky - - - - Quit - Ukončit - - - - SearchBox - - - PID,COMMAND,USER... - PID,COMMAND,USER… - - - - SliderDialog - - - Renice Process - Změnit prioritu (nice) procesu - - - - New nice value: - Nová hodnota priority: - - - - Cancel - Storno - - - - OK - - - - - Sockets - - - Fd - - - - - File descriptor - Popisovač souboru - - - - Proto - - - - - Protocol (TCP or UDP) - Protokol (TCP nebo UDP) - - - - Recv-Q - - - - - Bytes in receive queue - Bajtů ve frontě příjmu - - - - Send-Q - - - - - Bytes in send queue - Bajtů ve frontě odesílání - - - - Local Addr - Místní adr. - - - - Local IP address - Místní IP adresa - - - - - Port - - - - - Local port - Místní port - - - - Remote Addr - Vzdálená adr. - - - - Remote IP address - IP adresa protějšku - - - - Remote port - Vzdálený port - - - - State - Stav - - - - Connection state - Stav spojení - - - - StatusBar - - - Process count: %1 - Počet procesů: %1 - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - Toto je nestabilní funkce v ranném stádiu vývoje - Může vyvolávat porušení ochrany paměti… - - - - TFrame - - - this is Tframe widget - toto je Tframe ovládací prvek - - - - UFrame - - - title - titulek - - - - WatchdogDialog - - - if process start - pokud je proces spuštěn - - - - if process finish - pokud proces skončí - - - - select condition - vybrat podmínku - - - diff --git a/src/translations/qps_cy.ts b/src/translations/qps_cy.ts deleted file mode 100644 index e0b0bf8..0000000 --- a/src/translations/qps_cy.ts +++ /dev/null @@ -1,1772 +0,0 @@ - - - - - AllFields - - - Field - - - - - Field name - - - - - Description - - - - - Field description - - - - - Value - - - - - Field value - - - - - Boxvar - - - Exit On Close Button - - - - - Host Name Lookup - - - - - Service Name Lookup - - - - - Disclosure Triangles - - - - - Branch Lines - - - - - Auto Save Settings on Exit - - - - - Selection: Copy PIDs to Clipboard - - - - - Normalize NICE - - - - - Use pmap for Map Names - - - - - Cbgroup - - - General - - - - - Command - - - The command: - - - - - - - - -failed with the error: - - - - - - - Too many processes - - - - - Unknown error - - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - - - - - -exited with status - - - - - Command Failed - - - - - CommandDialog - - - Edit Commands 0.1 alpha - - - - - Name: - - - - - Popup - - - - - Command Line: - - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - - - - - New... - - - - - - Add... - - - - - Delete - - - - - Close - - - - - ControlBar - - - Linear - - - - - Tree - - - - - All Processes - - - - - Your Processes - - - - - Non-Root Processes - - - - - Running Processes - - - - - Pause (Ctrl+Space) - - - - - Details - - - Process %1 ( %2 ) - details - - - - - Files - - - - - Sockets - - - - - Memory Maps - - - - - Environment - - - - - All Fields - - - - - Environ - - - Variable - - - - - Variable name - - - - - Value - - - - - Variable value - - - - - EventDialog - - - Watchdog 0.1 alpha - - - - - Eventcat - - - - - Select condition - - - - - labelDescrition - - - - - Enable - - - - - process name - - - - - cpu - - - - - % - - - - - include already running process - - - - - run command - - - - - show Message - - - - - Help (Not yet. just concept) - - - - - %p : pid -%c : command - - - - - New - - - - - Add - - - - - Delete - - - - - Close - - - - - ExecWindow - - - Qps - - - - - Ok - - - - - Qps Watchdog - - - - - %1 exit with code %2 - - - - - Close - - - - - %1 [running] - - - - - terminate command - - - - - Error %1 : [%2] Maybe command not found - - - - - FieldSelect - - - Select Custom Fields - - - - - Close - - - - - Files - - - Fd - - - - - File descriptor - - - - - Mode - - - - - Open mode - - - - - Name - - - - - File name (if available) - - - - - IntervalDialog - - - Change Update Period - - - - - New Update Period - - - - - Cancel - - - - - OK - - - - - No UPDATE - - - - - Invalid value - - - - - ListModel - - - Event Category - - - - - Enable - - - - - Maps - - - Address Range - - - - - Mapped addresses (hex) ) - - - - - Size - - - - - Kbytes mapped (dec) - - - - - Perm - - - - - Permission flags - - - - - Offset - - - - - File offset at start of mapping (hex) - - - - - Device - - - - - Major,Minor device numbers (dec) - - - - - Inode - - - - - Inode number (dec) - - - - - File - - - - - File name (if available) - - - - - PermissionDialog - - - Permission - - - - - Root password - - - - - Cancel - - - - - OK - - - - - Preferences - - - Preferences - - - - - Setting - - - - - %CPU divided by - - - - - Total cpu: %1 - - - - - Single cpu: 1 - - - - - default - - - - - for developer - - - - - Appearance - - - - - Proc - - - PID - - - - - Process ID - - - - - TGID - - - - - Task group ID ( parent of threads ) - - - - - PPID - - - - - Parent process ID - - - - - PGID - - - - - Process group ID - - - - - SID - - - - - Session ID - - - - - TTY - - - - - Terminal - - - - - TPGID - - - - - Process group ID of tty owner - - - - - USER - - - - - Owner (*=suid root, +=suid a user) - - - - - GROUP - - - - - Group name (*=sgid other) - - - - - UID - - - - - Real user ID - - - - - EUID - - - - - Effective user ID - - - - - SUID - - - - - Saved user ID (Posix) - - - - - FSUID - - - - - File system user ID - - - - - GID - - - - - Real group ID - - - - - EGID - - - - - Effective group ID - - - - - SGID - - - - - Saved group ID (Posix) - - - - - FSGID - - - - - File system group ID - - - - - PRI - - - - - Dynamic priority - - - - - NICE - - - - - Scheduling favour (higher -> less cpu time) - - - - - NLWP - - - - - Number of tasks(threads) in task group - - - - - PLCY - - - - - Scheduling policy - - - - - RPRI - - - - - Realtime priority (0-99, more is better) - - - - - TMS - - - - - Time slice in milliseconds - - - - - %SAVG - - - - - Percentage average sleep time (-1 -> N/A) - - - - - CPUSET - - - - - Affinity CPU mask (0 -> API not supported) - - - - - MAJFLT - - - - - Number of major faults (disk access) - - - - - MINFLT - - - - - Number of minor faults (no disk access) - - - - - VSIZE - - - - - Virtual image size of process - - - - - RSS - - - - - Resident set size - - - - - MEM - - - - - memory usage (RSS-SHARE) - - - - - TRS - - - - - Text(code) resident set size - - - - - DRS - - - - - Data resident set size(malloc+global variable) - - - - - STACK - - - - - Stack size - - - - - SHARE - - - - - Shared memory with other libs - - - - - SWAP - - - - - Kbytes on swap device - - - - - IO_R - - - - - io read (file) - - - - - IO_W - - - - - io write (file) - - - - - DT - - - - - Number of dirty (non-written) pages - - - - - STAT - - - - - State of the process - - - - - FLAGS - - - - - Process flags (hex) - - - - - WCHAN - - - - - Kernel function where process is sleeping - - - - - %WCPU - - - - - Weighted percentage of CPU (30 s average) - - - - - %CPU - - - - - Percentage of CPU used since last update - - - - - %MEM - - - - - Percentage of memory used (RSS/total mem) - - - - - START - - - - - Time process started - - - - - TIME - - - - - Total CPU time used since start - - - - - CPU - - - - - CPU the process is executing on (SMP system) - - - - - the process name - - - - - Process Name - - - - - CWD - - - - - Current working directory - - - - - ROOT - - - - - Root directory of process - - - - - COMMAND_LINE - - - - - Command line that started the process - - - - - QObject - - - Show - - - - - Hide - - - - - ScreenShot - - - - - Quit - - - - - Qps - - - header_popup - - - - - Remove Field - - - - - Add Field - - - - - Command - - - - - View - - - - - Process - - - - - Log - - - - - Custom Fields - - - - - Basic Fields - - - - - Jobs Fields - - - - - Memory Fields - - - - - Scheduling Fields - - - - - Select Custom Fields... - - - - - Option - - - - - Update Period... - - - - - Show Status bar - - - - - Preferences... - - - - - Help - - - - - - About - - - - - Detail - - - - - test - - - - - Copied to Clipboard - - - - - context popup - - - - - Renice... - - - - - Scheduling... - - - - - Terminate - - - - - Hangup - - - - - Kill - - - - - Stop - - - - - Continue - - - - - SIGINT (interrupt) - - - - - SIGCONT (continue) - - - - - SIGSTOP (stop) - - - - - SIGQUIT (quit) - - - - - SIGILL (illegal instruction) - - - - - SIGABRT (abort) - - - - - SIGFPE (floating point exception) - - - - - SIGSEGV (segmentation violation) - - - - - SIGPIPE (broken pipe) - - - - - SIGALRM (timer signal) - - - - - SIGUSR1 (user-defined 1) - - - - - SIGUSR2 (user-defined 2) - - - - - SIGCHLD (child death) - - - - - SIGTSTP (stop from tty) - - - - - SIGTTIN (tty input) - - - - - SIGTTOU (tty output) - - - - - View Details - - - - - WatchDog - - - - - Edit Commands... - - - - - Quit - - - - - - - - - - Permission denied - - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - - - - - Only the super-user may lower the nice value of a process. - - - - - Only the super-user may change the scheduling policy and static priority. - - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - - - - - SchedDialog - - - Change scheduling - - - - - Scheduling Policy - - - - - SCHED_OTHER (time-sharing) - - - - - SCHED_FIFO (real-time) - - - - - SCHED_RR (real-time) - - - - - OK - - - - - Cancel - - - - - Priority (1-99): - - - - - Invalid Input - - - - - The priority must be in the range 1..99 - - - - - Screenshot - - - /untitled. - - - - - Save As - - - - - %1 Files (*.%2);;All Files (*) - - - - - Options - - - - - s - - - - - Screenshot Delay: - - - - - Hide This Window - - - - - New Screenshot - - - - - Quit - - - - - SearchBox - - - PID,COMMAND,USER... - - - - - SliderDialog - - - Renice Process - - - - - New nice value: - - - - - Cancel - - - - - OK - - - - - Sockets - - - Fd - - - - - File descriptor - - - - - Proto - - - - - Protocol (TCP or UDP) - - - - - Recv-Q - - - - - Bytes in receive queue - - - - - Send-Q - - - - - Bytes in send queue - - - - - Local Addr - - - - - Local IP address - - - - - - Port - - - - - Local port - - - - - Remote Addr - - - - - Remote IP address - - - - - Remote port - - - - - State - - - - - Connection state - - - - - StatusBar - - - Process count: %1 - - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - - - - - TFrame - - - this is Tframe widget - - - - - UFrame - - - title - - - - - WatchdogDialog - - - if process start - - - - - if process finish - - - - - select condition - - - - diff --git a/src/translations/qps_da.ts b/src/translations/qps_da.ts deleted file mode 100644 index bc7ffe4..0000000 --- a/src/translations/qps_da.ts +++ /dev/null @@ -1,1792 +0,0 @@ - - - - - AllFields - - - Field - Felt - - - - Field name - Feltnavn - - - - Description - Beskrivelse - - - - Field description - Feltbeskrivelse - - - - Value - Værdi - - - - Field value - Feltværdi - - - - Boxvar - - - Exit On Close Button - Afslut ved luk-knap - - - - Host Name Lookup - Opslag af host navn - - - - Service Name Lookup - Opslag af service navn - - - - Disclosure Triangles - Afsløringstrekanter - - - - Branch Lines - Grenlinjer - - - - Auto Save Settings on Exit - Gem indstillinger automatisk ved afslut - - - - Selection: Copy PIDs to Clipboard - Markering: Kopiér PID'er til udklipsholder - - - - Normalize NICE - Normaliser NICE - - - - Use pmap for Map Names - Brug pmap til kortnavne - - - - Cbgroup - - - General - Generelt - - - - Command - - - The command: - - - Kommandoen: - - - - - - - -failed with the error: - - - - -mislykkede med fejlen: - - - - - - Too many processes - For mange processer - - - - Unknown error - Ukendt fejl - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - -kunne ikke eksekveres da den ikke blev fundet, -eller du ikke har tilladelse til at eksekvere. - - - - - -exited with status - - -afsluttede med status - - - - Command Failed - Kommando mislykkedes - - - - CommandDialog - - - Edit Commands 0.1 alpha - Rediger kommandoer 0,1 alfa - - - - Name: - Navn: - - - - Popup - Pop op - - - - Command Line: - Kommandolinje: - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - Erstatninger: -%p PID -%c KOMMANDO -%C KOMMANDOLINJE -%u BRUGER -%% % - - - - - - New... - Ny... - - - - - Add... - Tilføj... - - - - Delete - Slet - - - - Close - Luk - - - - ControlBar - - - Linear - Lineær - - - - Tree - Træ - - - - All Processes - Alle processer - - - - Your Processes - Dine processer - - - - Non-Root Processes - Ikke-root processer - - - - Running Processes - Kørende processer - - - - Pause (Ctrl+Space) - Pause (Ctrl+Mellemrum) - - - - Details - - - Process %1 ( %2 ) - details - Proces %1 ( %2 ) - detaljer - - - - Files - Filer - - - - Sockets - Sokler - - - - Memory Maps - Hukommelseskort - - - - Environment - Miljø - - - - All Fields - Alle felter - - - - Environ - - - Variable - Variabel - - - - Variable name - Variabelnavn - - - - Value - Værdi - - - - Variable value - Variabelværdi - - - - EventDialog - - - Watchdog 0.1 alpha - Watchdog 0.1 alfa - - - - Eventcat - Eventcat - - - - Select condition - Vælg betingelse - - - - labelDescrition - etiketbeskrivelse - - - - Enable - Aktivér - - - - process name - procesnavn - - - - cpu - cpu - - - - % - % - - - - include already running process - inkluder allerede kørende proces - - - - run command - kør kommando - - - - show Message - vis meddelelse - - - - Help (Not yet. just concept) - Hjælp (ikke endnu, kun et koncept) - - - - %p : pid -%c : command - %p: pid -%c: kommando - - - - New - Ny - - - - Add - Tilføj - - - - Delete - Slet - - - - Close - Luk - - - - ExecWindow - - - Qps - Qps - - - - Ok - OK - - - - Qps Watchdog - Qps-watchdog - - - - %1 exit with code %2 - %1 afsluttede med koden %2 - - - - Close - Luk - - - - %1 [running] - %1 [kørende] - - - - terminate command - terminer kommando - - - - Error %1 : [%2] Maybe command not found - Fejl %1 : [%2] Måske findes kommendoen ikke - - - - FieldSelect - - - Select Custom Fields - Vælg tilpassede felter - - - - Close - Luk - - - - Files - - - Fd - Fb - - - - File descriptor - Filbeskriver - - - - Mode - Tilstand - - - - Open mode - Åbningstilstand - - - - Name - Navn - - - - File name (if available) - Filnavn (hvis tilgængeligt) - - - - IntervalDialog - - - Change Update Period - Skift opdateringsperiode - - - - New Update Period - Ny opdateringsperiode - - - - Cancel - Annuller - - - - OK - OK - - - - No UPDATE - Ingen opdatering - - - - Invalid value - Ugyldig værdi - - - - ListModel - - - Event Category - Begivenhedskategori - - - - Enable - Aktivér - - - - Maps - - - Address Range - Adresseområde - - - - Mapped addresses (hex) ) - Kortlagte adresser (hex) ) - - - - Size - Størrelse - - - - Kbytes mapped (dec) - Kbytes-kortlagt (dec) - - - - Perm - Till - - - - Permission flags - Tilladelsesflag - - - - Offset - Forskydning - - - - File offset at start of mapping (hex) - Filforskydning ved begyndelse af kortlægning (hex) - - - - Device - Enhed - - - - Major,Minor device numbers (dec) - Større,mindre-enhedsnummre (dec) - - - - Inode - Inode - - - - Inode number (dec) - Inode-nummer (dec) - - - - File - Fil - - - - File name (if available) - Filnavn (hvis tilgængeligt) - - - - PermissionDialog - - - Permission - Tilladelse - - - - Root password - Root-adgangskode - - - - Cancel - Annuller - - - - OK - OK - - - - Preferences - - - Preferences - Præferencer - - - - Setting - Indstilling - - - - %CPU divided by - %CPU divideret med - - - - Total cpu: %1 - Samlet cpu: %1 - - - - Single cpu: 1 - Enkelt cpu: 1 - - - - default - standard - - - - for developer - til udvikler - - - - Appearance - Udseende - - - - Proc - - - PID - PID - - - - Process ID - Proces-ID - - - - TGID - OGID - - - - Task group ID ( parent of threads ) - Opgavens gruppe-ID ( forælder af tråde ) - - - - PPID - FPID - - - - Parent process ID - Forælderens proces-ID - - - - PGID - PGID - - - - Process group ID - Processens gruppe-ID - - - - SID - SID - - - - Session ID - Session-ID - - - - TTY - TTY - - - - Terminal - Terminal - - - - TPGID - TPGID - - - - Process group ID of tty owner - Processens gruppe-ID af tty-ejer - - - - USER - BRUGER - - - - Owner (*=suid root, +=suid a user) - Ejer (*=suid root, +=suid en bruger) - - - - GROUP - GRUPPE - - - - Group name (*=sgid other) - Gruppenavn (*=sgid andet) - - - - UID - BID - - - - Real user ID - Rigtige bruger-ID - - - - EUID - VBID - - - - Effective user ID - Virkende bruger-ID - - - - SUID - GBID - - - - Saved user ID (Posix) - Gemte bruger-ID (Posix) - - - - FSUID - FSBID - - - - File system user ID - Filsystemets bruger-ID - - - - GID - GID - - - - Real group ID - Rigtige gruppe-ID - - - - EGID - VGID - - - - Effective group ID - Virkende gruppe-ID - - - - SGID - GBID - - - - Saved group ID (Posix) - Gemte gruppe-ID (Posix) - - - - FSGID - FSGID - - - - File system group ID - Filsystemets gruppe-ID - - - - PRI - PRI - - - - Dynamic priority - Dynamisk prioritet - - - - NICE - NICE - - - - Scheduling favour (higher -> less cpu time) - Planlægningsfavør (højere -> mindre cpu-tid) - - - - NLWP - NLWP - - - - Number of tasks(threads) in task group - Antal grupper (tråde) i opgavegruppe - - - - PLCY - PLTK - - - - Scheduling policy - Planlægningspolitik - - - - RPRI - RPRI - - - - Realtime priority (0-99, more is better) - Realtidsprioritet (0-99, mere er bedre) - - - - TMS - TMS - - - - Time slice in milliseconds - Tidsskive i millisekunder - - - - %SAVG - %SGEN - - - - Percentage average sleep time (-1 -> N/A) - Procent gennemsnitlig sovetid (-1 -> ikke relevant) - - - - CPUSET - CPUSET - - - - Affinity CPU mask (0 -> API not supported) - Affinitet CPU-maske (0 -> API understøttes ikke) - - - - MAJFLT - STØFJL - - - - Number of major faults (disk access) - Antal større fejl (diskadgang) - - - - MINFLT - MINFJL - - - - Number of minor faults (no disk access) - Antal mindre fejl (diskadgang) - - - - VSIZE - VSTØR - - - - Virtual image size of process - Virtuelt aftryksstørrelse af proces - - - - RSS - RSS - - - - Resident set size - Resident set-størrelse - - - - MEM - HUK - - - - memory usage (RSS-SHARE) - hukommelsesforbrug (RSS-DELING) - - - - TRS - TRS - - - - Text(code) resident set size - Tekst (kode) resident set-størrelse - - - - DRS - DRS - - - - Data resident set size(malloc+global variable) - Data resident set-størrelse (malloc+global variabel) - - - - STACK - STAK - - - - Stack size - Stakstørrelse - - - - SHARE - DELT - - - - Shared memory with other libs - Delt hukommelse med andre biblioteker - - - - SWAP - SWAP - - - - Kbytes on swap device - Kbytes på swap-enhed - - - - IO_R - IO_L - - - - io read (file) - io-læs (fil) - - - - IO_W - IO_S - - - - io write (file) - io-skriv (fil) - - - - DT - BS - - - - Number of dirty (non-written) pages - Antal beskidte (ikke skrevne) sider - - - - STAT - STAT - - - - State of the process - Tilstand af processen - - - - FLAGS - FLAG - - - - Process flags (hex) - Procesflag (hex) - - - - WCHAN - WKAN - - - - Kernel function where process is sleeping - Kernefunktion hvor processen sover - - - - %WCPU - %VCPU - - - - Weighted percentage of CPU (30 s average) - Vægtet procent af CPU (30 s i gennemsnit) - - - - %CPU - %CPU - - - - Percentage of CPU used since last update - Procent af CPU brugt siden sidste opdatering - - - - %MEM - %HUK - - - - Percentage of memory used (RSS/total mem) - Procent af hukommelse brugt (RSS/samlet hukommelse) - - - - START - START - - - - Time process started - Tidsproces startet - - - - TIME - TID - - - - Total CPU time used since start - Samlet CPU-tid brugt siden start - - - - CPU - CPU - - - - CPU the process is executing on (SMP system) - CPU som processen udføres på (SMP-system) - - - - the process name - processens navn - - - - Process Name - Processens navn - - - - CWD - NAM - - - - Current working directory - Nuværende arbejdsmappe - - - - ROOT - ROD - - - - Root directory of process - Rodmappen for processen - - - - COMMAND_LINE - KOMMANDOLINJE - - - - Command line that started the process - Kommandolinje som startede processen - - - - QObject - - - Show - Vis - - - - Hide - Skjul - - - - ScreenShot - Skærmbillede - - - - Quit - Afslut - - - - Qps - - - header_popup - header_popop - - - - Remove Field - Fjern felt - - - - Add Field - Tilføj felt - - - - Command - Kommando - - - - View - Vis - - - - Process - Proces - - - - Log - Log - - - - Custom Fields - Tilpassede felter - - - - Basic Fields - Grundlæggende felter - - - - Jobs Fields - Jobfelter - - - - Memory Fields - Hukommelsesfelter - - - - Scheduling Fields - Planlægningsfelter - - - - Select Custom Fields... - Vælg tilpassede felter... - - - - Option - Valgmulighed - - - - Update Period... - Opdater periode... - - - - Show Status bar - Vis statuslinje - - - - Preferences... - Præferencer... - - - - Help - Hjælp - - - - - About - Om - - - - Detail - Detalje - - - - test - test - - - - Copied to Clipboard - Kopieret til udklipsholder - - - - context popup - genvejsmenu - - - - Renice... - Renice... - - - - Scheduling... - Planlægning... - - - - Terminate - Terminér - - - - Hangup - Læg på - - - - Kill - Dræb - - - - Stop - Stop - - - - Continue - Fortsæt - - - - SIGINT (interrupt) - SIGINT (interrupt) - - - - SIGCONT (continue) - SIGCONT (fortsæt) - - - - SIGSTOP (stop) - SIGSTOP (stop) - - - - SIGQUIT (quit) - SIGQUIT (afslut) - - - - SIGILL (illegal instruction) - SIGILL (ulovlig instruktion) - - - - SIGABRT (abort) - SIGABRT (afbryd) - - - - SIGFPE (floating point exception) - SIGFPE (undtagelse med flydende kommatal) - - - - SIGSEGV (segmentation violation) - SIGSEGV (overtrædelse af segmentering) - - - - SIGPIPE (broken pipe) - SIGPIPE (ødelagt pipe) - - - - SIGALRM (timer signal) - SIGALRM (timersignal) - - - - SIGUSR1 (user-defined 1) - SIGUSR1 (brugerdefineret 1) - - - - SIGUSR2 (user-defined 2) - SIGUSR2 (brugerdefineret 2) - - - - SIGCHLD (child death) - SIGCHLD (barnedød) - - - - SIGTSTP (stop from tty) - SIGTSTP (stop fra tty) - - - - SIGTTIN (tty input) - SIGTTIN (tty-input) - - - - SIGTTOU (tty output) - SIGTTOU (tty-output) - - - - View Details - Vis detaljer - - - - WatchDog - WatchDog - - - - Edit Commands... - Rediger kommandoer... - - - - Quit - Afslut - - - - - - - - - Permission denied - Tilladelse nægtet - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - Du har ikke tilladelse til at renice de valgte processer. Det er kun processens ejer og superbrugeren som har tilladelse til det. - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - Du har ikke tilladelse til at renice processen %1 (%2). Det er kun processens ejer og superbrugeren som har tilladelse til det. - - - - Only the super-user may lower the nice value of a process. - Det er kun superbrugeren som må mindske nice-værdien af en process. - - - - Only the super-user may change the scheduling policy and static priority. - Det er kun superbrugeren som må skifte planlægningspolitikken og statisk prioritet. - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - Du har ikke tilladelse til at skifte planlægningen og/eller prioriteten af processen %1 (%2). Det er kun superbrugeren som må det. - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - Du har ikke tilladelse til at sende et signal til processen %1 (%2). Det er kun superbrugeren og ejeren af processen som må sende signaler til den. - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - <h2> Qps %1 - En visuel proceshåndtering </h2> %2 bruger Qt-biblioteket %3<br><br><b>Kilde: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Fejlsporing: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - <b>Original Qps af</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Bidragydere</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - <H1>QPS hjælp</H1>Opdateret: 24. maj 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Afslut </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Opdater </td> <td>&nbsp;Mellemrum , Enter </td> </tr> <tr><td> proces terminér </td> <td> ALT + T , DELETE </td> </tr> <tr><td> proces dræb </td> <td> ALT + K </td> </tr> </tbody></table> - - - - SchedDialog - - - Change scheduling - Skift planlægning - - - - Scheduling Policy - Planlægningspolitik - - - - SCHED_OTHER (time-sharing) - PLANL_ANDET (tidsdeling) - - - - SCHED_FIFO (real-time) - PLANL_FIFO (realtid) - - - - SCHED_RR (real-time) - PLANL_RR (realtid) - - - - OK - OK - - - - Cancel - Annuller - - - - Priority (1-99): - Prioritet (1-99): - - - - Invalid Input - Ugyldig input - - - - The priority must be in the range 1..99 - Prioriteten skal være i området 1..99 - - - - Screenshot - - - /untitled. - /unavngivet. - - - - Save As - Gem som - - - - %1 Files (*.%2);;All Files (*) - %1 filer (*.%2);;Alle filer (*) - - - - Options - Valgmuligheder - - - - s - s - - - - Screenshot Delay: - Forsinkelse for skærmbillede: - - - - Hide This Window - Skjul vinduet - - - - New Screenshot - Nyt skærmbillede - - - - Quit - Afslut - - - - SearchBox - - - PID,COMMAND,USER... - PID,KOMMANDO,BRUGER... - - - - SliderDialog - - - Renice Process - Renice proces - - - - New nice value: - Ny nice-værdi: - - - - Cancel - Annuller - - - - OK - OK - - - - Sockets - - - Fd - Fb - - - - File descriptor - Filbeskriver - - - - Proto - Proto - - - - Protocol (TCP or UDP) - Protokol (TCP eller UDP) - - - - Recv-Q - Modt-Q - - - - Bytes in receive queue - Bytes i modtagekø - - - - Send-Q - Send-Q - - - - Bytes in send queue - Bytes i sendekø - - - - Local Addr - Lokal adre - - - - Local IP address - Lokal IP-adresse - - - - - Port - Port - - - - Local port - Lokal port - - - - Remote Addr - Fjernadre - - - - Remote IP address - Fjern-IP-adresse - - - - Remote port - Fjernport - - - - State - Tilstand - - - - Connection state - Forbindelsestilstand - - - - StatusBar - - - Process count: %1 - Procestælling: %1 - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - Dette er en ustabil alfa-funktionalitet - Det kan være du ser en SEGFAULT... - - - - TFrame - - - this is Tframe widget - dette er Tframe-widget - - - - UFrame - - - title - titel - - - - WatchdogDialog - - - if process start - hvis processen starter - - - - if process finish - hvis processen afslutter - - - - select condition - vælg betingelse - - - diff --git a/src/translations/qps_de.ts b/src/translations/qps_de.ts deleted file mode 100644 index ace5370..0000000 --- a/src/translations/qps_de.ts +++ /dev/null @@ -1,1792 +0,0 @@ - - - - - AllFields - - - Field - Feld - - - - Field name - Feldname - - - - Description - Beschreibung - - - - Field description - Feldbeschreibung - - - - Value - Wert - - - - Field value - Feldwert - - - - Boxvar - - - Exit On Close Button - Beenden durch Schließen-Schaltfläche - - - - Host Name Lookup - Nachschlagen des Hostnamens - - - - Service Name Lookup - Nachschlagen des Dienstnamens - - - - Disclosure Triangles - Aufdeckungsdreiecke - - - - Branch Lines - Zweiglinien - - - - Auto Save Settings on Exit - Einstellungen beim Beenden automatisch speichern - - - - Selection: Copy PIDs to Clipboard - Auswahl: PIDs in die Zwischenablage kopieren - - - - Normalize NICE - NICE normalisieren - - - - Use pmap for Map Names - Pmap zur Namensgebung bei der Prozessabbildung verwenden - - - - Cbgroup - - - General - Allgemein - - - - Command - - - The command: - - - Der Befehl: - - - - - - - -failed with the error: - - - - -scheiterte mit dem Fehler: - - - - - - Too many processes - Zu viele Prozesse - - - - Unknown error - Unbekannter Fehler - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - -konnte nicht ausgeführt werden, mangels fehlender -Identifizierbarkeit oder Ausführungsberechtigung. - - - - - -exited with status - - -endete mit Status - - - - Command Failed - Befehl fehlgeschlagen - - - - CommandDialog - - - Edit Commands 0.1 alpha - - - - - Name: - Name: - - - - Popup - Pop-up - - - - Command Line: - Befehlszeile: - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - Substitutionen: -%p PID -%c BEFEHL -%C BEFEHLSZEILE -%u BENUTZER -%% % - - - - - - New... - Neu... - - - - - Add... - Hinzufügen... - - - - Delete - Löschen - - - - Close - Schließen - - - - ControlBar - - - Linear - Linear - - - - Tree - Baum - - - - All Processes - Alle Prozesse - - - - Your Processes - Ihre Prozesse - - - - Non-Root Processes - Keine Root-Prozesse - - - - Running Processes - Laufende Prozesse - - - - Pause (Ctrl+Space) - Pause (Strg+Leertaste) - - - - Details - - - Process %1 ( %2 ) - details - Prozess %1 ( %2 ) - Details - - - - Files - Dateien - - - - Sockets - Sockets - - - - Memory Maps - Memory Maps - - - - Environment - Umgebung - - - - All Fields - Alle Felder - - - - Environ - - - Variable - Variable - - - - Variable name - Variablenname - - - - Value - Wert - - - - Variable value - Variablenwert - - - - EventDialog - - - Watchdog 0.1 alpha - - - - - Eventcat - - - - - Select condition - Bedingung auswählen - - - - labelDescrition - Etikettbezeichnung - - - - Enable - Aktivieren - - - - process name - Prozessname - - - - cpu - CPU - - - - % - - - - - include already running process - derzeitig laufenden Prozess einbeziehen - - - - run command - Befehl ausführen - - - - show Message - zeige Nachricht - - - - Help (Not yet. just concept) - Hilfe (Existiert noch nicht.) - - - - %p : pid -%c : command - %p : pid -%c : Befehl - - - - New - Neu - - - - Add - Hinzufügen - - - - Delete - Löschen - - - - Close - Schließen - - - - ExecWindow - - - Qps - - - - - Ok - - - - - Qps Watchdog - Qps Watchdog - - - - %1 exit with code %2 - %1 beendet mit Rückgabewert %2 - - - - Close - Schließen - - - - %1 [running] - %1 [laufend] - - - - terminate command - Befehl abbrechen - - - - Error %1 : [%2] Maybe command not found - Fehler %1 : [%2] Der Befehl wurde wahrscheinlich nicht gefunden - - - - FieldSelect - - - Select Custom Fields - Benutzerdefinierte Felder auswählen - - - - Close - Schließen - - - - Files - - - Fd - Fd - - - - File descriptor - Dateideskriptor - - - - Mode - Modus - - - - Open mode - Offener Modus - - - - Name - Name - - - - File name (if available) - Dateiname (falls verfügbar) - - - - IntervalDialog - - - Change Update Period - Aktualisierungsintervall ändern - - - - New Update Period - Aktualisierungsintervall - - - - Cancel - Abbrechen - - - - OK - OK - - - - No UPDATE - Keine AKTUALISIERUNG - - - - Invalid value - Ungültiger Wert - - - - ListModel - - - Event Category - Ereigniskategorie - - - - Enable - Aktivieren - - - - Maps - - - Address Range - Adressbereich - - - - Mapped addresses (hex) ) - Gemappte Adressen (hex) ) - - - - Size - Größe - - - - Kbytes mapped (dec) - Kbytes gemappt (dez) - - - - Perm - Berechtigung - - - - Permission flags - Berechtigungskennzeichen - - - - Offset - Versatz - - - - File offset at start of mapping (hex) - Dateiversatz bei Beginn des Mappings (hex) - - - - Device - Gerät - - - - Major,Minor device numbers (dec) - Haupt-,Nebengerätsnummern (dez) - - - - Inode - Inode - - - - Inode number (dec) - Inode Nummer (dez) - - - - File - Datei - - - - File name (if available) - Dateiname (falls verfügbar) - - - - PermissionDialog - - - Permission - Berechtigung - - - - Root password - Root-Passwort - - - - Cancel - Abbrechen - - - - OK - OK - - - - Preferences - - - Preferences - Einstellungen - - - - Setting - Einstellung - - - - %CPU divided by - Durchschnittliche Prozessorlast dargestellt als - - - - Total cpu: %1 - Quotient aller %1 Prozessorkerne - - - - Single cpu: 1 - Gesamtheit - - - - default - Vorgabe - - - - for developer - für Entwicker - - - - Appearance - Erscheinungsbild - - - - Proc - - - PID - PID - - - - Process ID - Prozess-ID - - - - TGID - TGID - - - - Task group ID ( parent of threads ) - Taskgruppen ID ( Eltern von Threads ) - - - - PPID - PPID - - - - Parent process ID - Elternprozess-ID - - - - PGID - PGID - - - - Process group ID - Prozessgruppen-ID - - - - SID - SID - - - - Session ID - Sitzungs-ID - - - - TTY - TTY - - - - Terminal - Terminal - - - - TPGID - TPGID - - - - Process group ID of tty owner - Prozessgruppen-ID des tty-Besitzers - - - - USER - BENUTZER - - - - Owner (*=suid root, +=suid a user) - Besitzer (*=suid Root, +=suid ein Benutzer) - - - - GROUP - GRUPPE - - - - Group name (*=sgid other) - Gruppenname (*=sgid Weitere) - - - - UID - UID - - - - Real user ID - Tatsächliche Benutzer-ID - - - - EUID - EUID - - - - Effective user ID - Effektive Benutzer-ID - - - - SUID - SUID - - - - Saved user ID (Posix) - Gespeicherte Benutzer-ID (Posix) - - - - FSUID - FSUID - - - - File system user ID - Dateisystem Benutzer-ID - - - - GID - GID - - - - Real group ID - Tatsächliche Gruppen-ID - - - - EGID - EGID - - - - Effective group ID - Wirksame Gruppen-ID - - - - SGID - SGID - - - - Saved group ID (Posix) - Gespeicherte Gruppen-ID (Posix) - - - - FSGID - FSGID - - - - File system group ID - Dateisystem Gruppen-ID - - - - PRI - PRI - - - - Dynamic priority - Dynamische Priorität - - - - NICE - NICE - - - - Scheduling favour (higher -> less cpu time) - Ressourcenbereitstellung (Höhersetzung verringert Rechenzeit) - - - - NLWP - NLWP - - - - Number of tasks(threads) in task group - Task-/Threadanzahl in einer Taskgruppe - - - - PLCY - PLCY - - - - Scheduling policy - Ausführungsrichtlinien - - - - RPRI - RPRI - - - - Realtime priority (0-99, more is better) - Echtzeitpriorität (0-99, höher ist besser) - - - - TMS - TMS - - - - Time slice in milliseconds - Zeitausschnitt in Millisekunden - - - - %SAVG - %SAVG - - - - Percentage average sleep time (-1 -> N/A) - Prozentsatz durchschnittlicher Auszeit (-1 -> N/V) - - - - CPUSET - CPUSET - - - - Affinity CPU mask (0 -> API not supported) - CPU-Affinitätsmaske (0 -> API nicht unterstützt) - - - - MAJFLT - MAJFLT - - - - Number of major faults (disk access) - Anzahl großer Fehler (Datenträgerzugriff) - - - - MINFLT - MINFLT - - - - Number of minor faults (no disk access) - Anzahl kleiner Fehler (kein Datenträgerzugriff) - - - - VSIZE - VSIZE - - - - Virtual image size of process - Virtuelle Abbildgröße des Prozesses - - - - RSS - RSS - - - - Resident set size - Residente Speicherzuweisung - - - - MEM - MEM - - - - memory usage (RSS-SHARE) - Speichernutzung (RSS_SHARE) - - - - TRS - TRS - - - - Text(code) resident set size - Text(code) residente Speicherzuweisung - - - - DRS - DRS - - - - Data resident set size(malloc+global variable) - Residente Datenspeicherzuweisung (malloc+globale Variable) - - - - STACK - STAPEL - - - - Stack size - Stapelgröße - - - - SHARE - SHARE - - - - Shared memory with other libs - Geteilter Speicher mit anderen Bibliotheken - - - - SWAP - SWAP - - - - Kbytes on swap device - Kbytes auf Auslagerungsbereich - - - - IO_R - IO_R - - - - io read (file) - io lesen (Datei) - - - - IO_W - IO_W - - - - io write (file) - io schreiben (Datei) - - - - DT - DT - - - - Number of dirty (non-written) pages - Anzahl unreiner (nicht-geschriebener) Seiten - - - - STAT - STAT - - - - State of the process - Prozessstatus - - - - FLAGS - FLAGS - - - - Process flags (hex) - Prozessindikatoren (hex) - - - - WCHAN - WCHAN - - - - Kernel function where process is sleeping - Kernelfunktion bei ruhenden Prozessen - - - - %WCPU - %WCPU - - - - Weighted percentage of CPU (30 s average) - Durchschnittlich prozentuale CPU-Auslastung innerhalb 30 Sekunden - - - - %CPU - %CPU - - - - Percentage of CPU used since last update - Prozentual verwendete CPU-Ressourcen seit letzter Aktualisierung - - - - %MEM - %MEM - - - - Percentage of memory used (RSS/total mem) - Prozentual verwendeter Speicher (RSS/gesamter Speicher) - - - - START - START - - - - Time process started - Startzeit des Prozesses - - - - TIME - ZEIT - - - - Total CPU time used since start - Seit dem Start verbrauchte gesamte CPU-Zeit - - - - CPU - CPU - - - - CPU the process is executing on (SMP system) - CPU, auf der der Prozess ausgeführt wird (SMP-System) - - - - the process name - der Prozessname - - - - Process Name - Prozessname - - - - CWD - CWD - - - - Current working directory - Aktuelles Arbeitsverzeichnis - - - - ROOT - ROOT - - - - Root directory of process - Rootverzeichnis des Prozesses - - - - COMMAND_LINE - COMMAND_LINE - - - - Command line that started the process - Befehlszeile, die den Prozess startete - - - - QObject - - - Show - Anzeigen - - - - Hide - Ausblenden - - - - ScreenShot - Bildschirmfoto - - - - Quit - Beenden - - - - Qps - - - header_popup - Kopfzeile_Popup - - - - Remove Field - Feld Entfernen - - - - Add Field - Feld hinzufügen - - - - Command - Befehl - - - - View - Ansicht - - - - Process - Prozess - - - - Log - Log - - - - Custom Fields - Benutzerdefiniertes - - - - Basic Fields - Grundlegendes - - - - Jobs Fields - Aufträge - - - - Memory Fields - Speicher - - - - Scheduling Fields - Terminierungen - - - - Select Custom Fields... - Benutzerdefinierte auswählen... - - - - Option - Optionen - - - - Update Period... - Aktualisierungsperiode... - - - - Show Status bar - Statusleiste anzeigen - - - - Preferences... - Einstellungen... - - - - Help - Hilfe - - - - - About - Über - - - - Detail - - - - - test - Test - - - - Copied to Clipboard - In die Zwischenablage kopiert - - - - context popup - Kontext Popup - - - - Renice... - Ressourcenbereitstellung... - - - - Scheduling... - Ausführungsrichtlinien... - - - - Terminate - Beenden - - - - Hangup - Auflegen - - - - Kill - Schließen erzwingen - - - - Stop - Anhalten - - - - Continue - Fortsetzen - - - - SIGINT (interrupt) - SIGINT (unterbrechen) - - - - SIGCONT (continue) - SIGCONT (fortfahren) - - - - SIGSTOP (stop) - SIGSTOP (anhalten) - - - - SIGQUIT (quit) - SIGQUIT (verlassen) - - - - SIGILL (illegal instruction) - SIGILL (verbotene Anweisung) - - - - SIGABRT (abort) - SIGABRT (abbrechen) - - - - SIGFPE (floating point exception) - SIGFPE (Gleitkomma-Ausnahme) - - - - SIGSEGV (segmentation violation) - SIGSEGV (Segmentierungsverletzung) - - - - SIGPIPE (broken pipe) - SIGPIPE (fehlerhafte Pipe-Verbindung) - - - - SIGALRM (timer signal) - SIGALRM (Timersignal) - - - - SIGUSR1 (user-defined 1) - SIGUSR1 (Benutzerdefiniert 1) - - - - SIGUSR2 (user-defined 2) - SIGUSR2 (Benutzerdefiniert 2) - - - - SIGCHLD (child death) - SIGCHLD (Unterprozessabbruch) - - - - SIGTSTP (stop from tty) - SIGTSTP (Vom TTY anhalten) - - - - SIGTTIN (tty input) - SIGTTIN (TTY Eingabe) - - - - SIGTTOU (tty output) - SIGTTOU (TTY Ausgabe) - - - - View Details - Siehe Einzelheiten - - - - WatchDog - WatchDog - - - - Edit Commands... - Befehle bearbeiten... - - - - Quit - Beenden - - - - - - - - - Permission denied - Berechtigung verweigert - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - Keine Berechtigung die Ressourcenbereitstellung des ausgewählten Prozesses zu ändern. Dies ist ausschließlich dem Prozesseigentümer und "Super-Usern" vorbehalten. - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - Keine Berechtigung die Ressourcenbereitstellung des Prozesses %1 (%2) zu ändern. Dies ist ausschließlich dem Prozesseigentümer und "Super-Usern" vorbehalten. - - - - Only the super-user may lower the nice value of a process. - Ausschließlich "Super-User" sind berechtigt den Wert der Ressourcenbereitstellung zu reduzieren. - - - - Only the super-user may change the scheduling policy and static priority. - Ausschließlich "Super-User" sind berechtigt Ausführungsrichtlinien und statische Priorität zu ändern. - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - Keine Berechtigung Ausführungsrichtlinien und/oder statische Priorität des Prozesses 1% (%2) zu ändern. Dies ist ausschließlich "Super-Usern" vorbehalten. - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - Keine Berechtigung Signal an Prozess 1% (%2) zu senden. Dies ist ausschließlich "Super-Usern" vorbehalten. - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - <h2> Qps %1 - Eine Prozessverwaltung mit grafischer Benutzeroberfläche </h2> %2 unter Verwendung der Qt Bibliothek %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - <b>Ursprüngliche Entwickelung von Qps</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Beitragende</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - <H1>QPS Hilfe</H1>Aktualisiert: 24.05.2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - - - - SchedDialog - - - Change scheduling - Ausführungsrichtlinien ändern - - - - Scheduling Policy - Ausführungsrichtlinien - - - - SCHED_OTHER (time-sharing) - SCHED_OTHER (Rechenzeitaufteilung) - - - - SCHED_FIFO (real-time) - SCHED_FIFO (Echtzeit) - - - - SCHED_RR (real-time) - SCHED_RR (Echtzeit) - - - - OK - OK - - - - Cancel - Abbrechen - - - - Priority (1-99): - Priorität (1-99): - - - - Invalid Input - Ungültige Eingabe - - - - The priority must be in the range 1..99 - Die Priorität muss im Bereich von 1..99 liegen - - - - Screenshot - - - /untitled. - - - - - Save As - Speichern unter - - - - %1 Files (*.%2);;All Files (*) - %1 Dateien (*.%2);;Alle Dateien (*) - - - - Options - Optionen - - - - s - - - - - Screenshot Delay: - Bildschirmfotoverzögerung: - - - - Hide This Window - Verstecke Dieses Fenster - - - - New Screenshot - Neues Bildschirmfoto - - - - Quit - Beenden - - - - SearchBox - - - PID,COMMAND,USER... - PID,BEFEHL,BENUTZER... - - - - SliderDialog - - - Renice Process - Ressourcenbereitstellungsprozess - - - - New nice value: - Neuer Ressourcenbereitstellungswert: - - - - Cancel - Abbrechen - - - - OK - OK - - - - Sockets - - - Fd - Fd - - - - File descriptor - Dateideskriptor - - - - Proto - Proto - - - - Protocol (TCP or UDP) - Protokoll (TCP oder UDP) - - - - Recv-Q - Recv-Q - - - - Bytes in receive queue - Bytes innerhalb Empfangswarteschlange - - - - Send-Q - Send-Q - - - - Bytes in send queue - Bytes innerhalb Sendewarteschlange - - - - Local Addr - Local Addr - - - - Local IP address - Lokale IP-Adresse - - - - - Port - Port - - - - Local port - Lokaler Port - - - - Remote Addr - Rechnerferne Addresse - - - - Remote IP address - Rechnerferne IP-Adresse - - - - Remote port - Rechnerferner Anschluss - - - - State - Status - - - - Connection state - Verbindungsstatus - - - - StatusBar - - - Process count: %1 - Prozessanzahl: %1 - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - Dies ist eine instabile Alphafunktion. - SEGFAULTs sind möglich. - - - - TFrame - - - this is Tframe widget - Dies ist ein Tframe-Steuerelement - - - - UFrame - - - title - Titel - - - - WatchdogDialog - - - if process start - wenn der Prozess startet - - - - if process finish - wenn der Prozess abgeschlossen ist - - - - select condition - Bedingung auswählen - - - diff --git a/src/translations/qps_el.ts b/src/translations/qps_el.ts deleted file mode 100644 index 919d635..0000000 --- a/src/translations/qps_el.ts +++ /dev/null @@ -1,1772 +0,0 @@ - - - - - AllFields - - - Field - - - - - Field name - - - - - Description - - - - - Field description - - - - - Value - - - - - Field value - - - - - Boxvar - - - Exit On Close Button - - - - - Host Name Lookup - - - - - Service Name Lookup - - - - - Disclosure Triangles - - - - - Branch Lines - - - - - Auto Save Settings on Exit - - - - - Selection: Copy PIDs to Clipboard - - - - - Normalize NICE - - - - - Use pmap for Map Names - - - - - Cbgroup - - - General - - - - - Command - - - The command: - - - - - - - - -failed with the error: - - - - - - - Too many processes - - - - - Unknown error - - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - - - - - -exited with status - - - - - Command Failed - - - - - CommandDialog - - - Edit Commands 0.1 alpha - - - - - Name: - - - - - Popup - - - - - Command Line: - - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - - - - - New... - - - - - - Add... - - - - - Delete - - - - - Close - - - - - ControlBar - - - Linear - - - - - Tree - - - - - All Processes - - - - - Your Processes - - - - - Non-Root Processes - - - - - Running Processes - - - - - Pause (Ctrl+Space) - - - - - Details - - - Process %1 ( %2 ) - details - - - - - Files - - - - - Sockets - - - - - Memory Maps - - - - - Environment - - - - - All Fields - - - - - Environ - - - Variable - - - - - Variable name - - - - - Value - - - - - Variable value - - - - - EventDialog - - - Watchdog 0.1 alpha - - - - - Eventcat - - - - - Select condition - - - - - labelDescrition - - - - - Enable - - - - - process name - - - - - cpu - - - - - % - - - - - include already running process - - - - - run command - - - - - show Message - - - - - Help (Not yet. just concept) - - - - - %p : pid -%c : command - - - - - New - - - - - Add - - - - - Delete - - - - - Close - - - - - ExecWindow - - - Qps - - - - - Ok - - - - - Qps Watchdog - - - - - %1 exit with code %2 - - - - - Close - - - - - %1 [running] - - - - - terminate command - - - - - Error %1 : [%2] Maybe command not found - - - - - FieldSelect - - - Select Custom Fields - - - - - Close - - - - - Files - - - Fd - - - - - File descriptor - - - - - Mode - - - - - Open mode - - - - - Name - - - - - File name (if available) - - - - - IntervalDialog - - - Change Update Period - - - - - New Update Period - - - - - Cancel - - - - - OK - - - - - No UPDATE - - - - - Invalid value - - - - - ListModel - - - Event Category - - - - - Enable - - - - - Maps - - - Address Range - - - - - Mapped addresses (hex) ) - - - - - Size - - - - - Kbytes mapped (dec) - - - - - Perm - - - - - Permission flags - - - - - Offset - - - - - File offset at start of mapping (hex) - - - - - Device - - - - - Major,Minor device numbers (dec) - - - - - Inode - - - - - Inode number (dec) - - - - - File - - - - - File name (if available) - - - - - PermissionDialog - - - Permission - - - - - Root password - - - - - Cancel - - - - - OK - - - - - Preferences - - - Preferences - - - - - Setting - - - - - %CPU divided by - - - - - Total cpu: %1 - - - - - Single cpu: 1 - - - - - default - - - - - for developer - - - - - Appearance - - - - - Proc - - - PID - - - - - Process ID - - - - - TGID - - - - - Task group ID ( parent of threads ) - - - - - PPID - - - - - Parent process ID - - - - - PGID - - - - - Process group ID - - - - - SID - - - - - Session ID - - - - - TTY - - - - - Terminal - - - - - TPGID - - - - - Process group ID of tty owner - - - - - USER - - - - - Owner (*=suid root, +=suid a user) - - - - - GROUP - - - - - Group name (*=sgid other) - - - - - UID - - - - - Real user ID - - - - - EUID - - - - - Effective user ID - - - - - SUID - - - - - Saved user ID (Posix) - - - - - FSUID - - - - - File system user ID - - - - - GID - - - - - Real group ID - - - - - EGID - - - - - Effective group ID - - - - - SGID - - - - - Saved group ID (Posix) - - - - - FSGID - - - - - File system group ID - - - - - PRI - - - - - Dynamic priority - - - - - NICE - - - - - Scheduling favour (higher -> less cpu time) - - - - - NLWP - - - - - Number of tasks(threads) in task group - - - - - PLCY - - - - - Scheduling policy - - - - - RPRI - - - - - Realtime priority (0-99, more is better) - - - - - TMS - - - - - Time slice in milliseconds - - - - - %SAVG - - - - - Percentage average sleep time (-1 -> N/A) - - - - - CPUSET - - - - - Affinity CPU mask (0 -> API not supported) - - - - - MAJFLT - - - - - Number of major faults (disk access) - - - - - MINFLT - - - - - Number of minor faults (no disk access) - - - - - VSIZE - - - - - Virtual image size of process - - - - - RSS - - - - - Resident set size - - - - - MEM - - - - - memory usage (RSS-SHARE) - - - - - TRS - - - - - Text(code) resident set size - - - - - DRS - - - - - Data resident set size(malloc+global variable) - - - - - STACK - - - - - Stack size - - - - - SHARE - - - - - Shared memory with other libs - - - - - SWAP - - - - - Kbytes on swap device - - - - - IO_R - - - - - io read (file) - - - - - IO_W - - - - - io write (file) - - - - - DT - - - - - Number of dirty (non-written) pages - - - - - STAT - - - - - State of the process - - - - - FLAGS - - - - - Process flags (hex) - - - - - WCHAN - - - - - Kernel function where process is sleeping - - - - - %WCPU - - - - - Weighted percentage of CPU (30 s average) - - - - - %CPU - - - - - Percentage of CPU used since last update - - - - - %MEM - - - - - Percentage of memory used (RSS/total mem) - - - - - START - - - - - Time process started - - - - - TIME - - - - - Total CPU time used since start - - - - - CPU - - - - - CPU the process is executing on (SMP system) - - - - - the process name - - - - - Process Name - - - - - CWD - - - - - Current working directory - - - - - ROOT - - - - - Root directory of process - - - - - COMMAND_LINE - - - - - Command line that started the process - - - - - QObject - - - Show - - - - - Hide - - - - - ScreenShot - - - - - Quit - - - - - Qps - - - header_popup - - - - - Remove Field - - - - - Add Field - - - - - Command - - - - - View - - - - - Process - - - - - Log - - - - - Custom Fields - - - - - Basic Fields - - - - - Jobs Fields - - - - - Memory Fields - - - - - Scheduling Fields - - - - - Select Custom Fields... - - - - - Option - - - - - Update Period... - - - - - Show Status bar - - - - - Preferences... - - - - - Help - - - - - - About - - - - - Detail - - - - - test - - - - - Copied to Clipboard - - - - - context popup - - - - - Renice... - - - - - Scheduling... - - - - - Terminate - - - - - Hangup - - - - - Kill - - - - - Stop - - - - - Continue - - - - - SIGINT (interrupt) - - - - - SIGCONT (continue) - - - - - SIGSTOP (stop) - - - - - SIGQUIT (quit) - - - - - SIGILL (illegal instruction) - - - - - SIGABRT (abort) - - - - - SIGFPE (floating point exception) - - - - - SIGSEGV (segmentation violation) - - - - - SIGPIPE (broken pipe) - - - - - SIGALRM (timer signal) - - - - - SIGUSR1 (user-defined 1) - - - - - SIGUSR2 (user-defined 2) - - - - - SIGCHLD (child death) - - - - - SIGTSTP (stop from tty) - - - - - SIGTTIN (tty input) - - - - - SIGTTOU (tty output) - - - - - View Details - - - - - WatchDog - - - - - Edit Commands... - - - - - Quit - - - - - - - - - - Permission denied - - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - - - - - Only the super-user may lower the nice value of a process. - - - - - Only the super-user may change the scheduling policy and static priority. - - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - - - - - SchedDialog - - - Change scheduling - - - - - Scheduling Policy - - - - - SCHED_OTHER (time-sharing) - - - - - SCHED_FIFO (real-time) - - - - - SCHED_RR (real-time) - - - - - OK - - - - - Cancel - - - - - Priority (1-99): - - - - - Invalid Input - - - - - The priority must be in the range 1..99 - - - - - Screenshot - - - /untitled. - - - - - Save As - - - - - %1 Files (*.%2);;All Files (*) - - - - - Options - - - - - s - - - - - Screenshot Delay: - - - - - Hide This Window - - - - - New Screenshot - - - - - Quit - - - - - SearchBox - - - PID,COMMAND,USER... - - - - - SliderDialog - - - Renice Process - - - - - New nice value: - - - - - Cancel - - - - - OK - - - - - Sockets - - - Fd - - - - - File descriptor - - - - - Proto - - - - - Protocol (TCP or UDP) - - - - - Recv-Q - - - - - Bytes in receive queue - - - - - Send-Q - - - - - Bytes in send queue - - - - - Local Addr - - - - - Local IP address - - - - - - Port - - - - - Local port - - - - - Remote Addr - - - - - Remote IP address - - - - - Remote port - - - - - State - - - - - Connection state - - - - - StatusBar - - - Process count: %1 - - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - - - - - TFrame - - - this is Tframe widget - - - - - UFrame - - - title - - - - - WatchdogDialog - - - if process start - - - - - if process finish - - - - - select condition - - - - diff --git a/src/translations/qps_es.ts b/src/translations/qps_es.ts deleted file mode 100644 index 8c2a590..0000000 --- a/src/translations/qps_es.ts +++ /dev/null @@ -1,1792 +0,0 @@ - - - - - AllFields - - - Field - Campo - - - - Field name - Nombre del campo - - - - Description - Descripción - - - - Field description - Descripción del campo - - - - Value - Valor - - - - Field value - Valor del campo - - - - Boxvar - - - Exit On Close Button - Salir al pulsar el botón de cerrar - - - - Host Name Lookup - Búsqueda del nombre de host - - - - Service Name Lookup - Búsqueda del nombre del servicio - - - - Disclosure Triangles - Triángulos de expansión - - - - Branch Lines - Líneas de las ramas - - - - Auto Save Settings on Exit - Autoguardar la configuración al salir - - - - Selection: Copy PIDs to Clipboard - Selección: copiar los PID al portapapeles - - - - Normalize NICE - Normalizar NICE - - - - Use pmap for Map Names - Usar pmap para el nombre del mapa - - - - Cbgroup - - - General - General - - - - Command - - - The command: - - - El comando: - - - - - - - -failed with the error: - - - - -ha fallado con el error: - - - - - - Too many processes - Demasiados procesos - - - - Unknown error - Error desconocido - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - -no se ha podido ejecutar porque no se ha encontrado -o porque usted no tiene los permisos para ejecutarlo. - - - - - -exited with status - - -ha terminado con el código de salida - - - - Command Failed - El comando ha fallado - - - - CommandDialog - - - Edit Commands 0.1 alpha - Editar comandos 0.1 alfa - - - - Name: - Nombre: - - - - Popup - Ventana emergente - - - - Command Line: - Línea de comandos: - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - Sustituciones: -%p PID -%c COMANDO -%C COMANDO COMPLETO -%u USUARIO -%% % - - - - - - New... - Nuevo... - - - - - Add... - Añadir... - - - - Delete - Borrar - - - - Close - Cerrar - - - - ControlBar - - - Linear - Lineal - - - - Tree - Árbol - - - - All Processes - Todos los procesos - - - - Your Processes - Sus procesos - - - - Non-Root Processes - Procesos que no son de «root» - - - - Running Processes - Procesos en ejecución - - - - Pause (Ctrl+Space) - Pausar (Ctrl+Espacio) - - - - Details - - - Process %1 ( %2 ) - details - Proceso %1 (%2) - detalles - - - - Files - Archivos - - - - Sockets - - - - - Memory Maps - Mapas de memoria - - - - Environment - Entorno - - - - All Fields - Todos los campos - - - - Environ - - - Variable - Variable - - - - Variable name - Nombre de la variable - - - - Value - Valor - - - - Variable value - Valor de la variable - - - - EventDialog - - - Watchdog 0.1 alpha - Watchdog 0.1 alfa - - - - Eventcat - - - - - Select condition - Seleccionar la condición - - - - labelDescrition - - - - - Enable - Habilitar - - - - process name - nombre del proceso - - - - cpu - - - - - % - % - - - - include already running process - incluir los procesos ya en ejecución - - - - run command - ejecutar comando - - - - show Message - mostrar Mensaje - - - - Help (Not yet. just concept) - Ayuda (Aún no disponible) - - - - %p : pid -%c : command - %p : pid -%c : comando - - - - New - Nuevo - - - - Add - Añadir - - - - Delete - Borrar - - - - Close - Cerrar - - - - ExecWindow - - - Qps - - - - - Ok - Aceptar - - - - Qps Watchdog - Vigilante de Qps - - - - %1 exit with code %2 - %1 termina con el código %2 - - - - Close - Cerrar - - - - %1 [running] - %1 [ejecución] - - - - terminate command - terminar el comando - - - - Error %1 : [%2] Maybe command not found - Error %1 : [%2] Puede que no se haya encontrado el comando - - - - FieldSelect - - - Select Custom Fields - Elegir los campos personalizados - - - - Close - Cerrar - - - - Files - - - Fd - - - - - File descriptor - Descriptor de fichero - - - - Mode - Modo - - - - Open mode - Modo de apertura - - - - Name - Nombre - - - - File name (if available) - Nombre del archivo (si está disponible) - - - - IntervalDialog - - - Change Update Period - Cambiar el intervalo de actualización - - - - New Update Period - Nuevo intervalo de actualización - - - - Cancel - Cancelar - - - - OK - Aceptar - - - - No UPDATE - No ACTUALIZAR - - - - Invalid value - Valor no válido - - - - ListModel - - - Event Category - Categoría del evento - - - - Enable - Habilitar - - - - Maps - - - Address Range - Rango de direcciones - - - - Mapped addresses (hex) ) - Direcciones mapeadas (hexadecimal) - - - - Size - Tamaño - - - - Kbytes mapped (dec) - Kbytes mapeados (decimal) - - - - Perm - Permiso - - - - Permission flags - Indicadores de permiso - - - - Offset - Desplazamiento - - - - File offset at start of mapping (hex) - Desplazamiento del archivo al principio del mapeado (hexadecimal) - - - - Device - Dispositivo - - - - Major,Minor device numbers (dec) - Números mayor y menor del dispositivo (decimal) - - - - Inode - Inodo - - - - Inode number (dec) - Número de inodo (decimal) - - - - File - Archivo - - - - File name (if available) - Nombre del archivo (si está disponible) - - - - PermissionDialog - - - Permission - Permiso - - - - Root password - Contraseña de «root» - - - - Cancel - Cancelar - - - - OK - Aceptar - - - - Preferences - - - Preferences - Preferencias - - - - Setting - Opción - - - - %CPU divided by - %CPU dividido por - - - - Total cpu: %1 - Total de cpu: %1 - - - - Single cpu: 1 - Una CPU: 1 - - - - default - predefinido - - - - for developer - para desarrollador - - - - Appearance - Apariencia - - - - Proc - - - PID - PID - - - - Process ID - ID del proceso - - - - TGID - TGID - - - - Task group ID ( parent of threads ) - ID del grupo de la tarea ( padre de hebras ) - - - - PPID - PPID - - - - Parent process ID - ID del proceso padre - - - - PGID - - - - - Process group ID - ID del grupo del proceso - - - - SID - SID - - - - Session ID - ID de la sesión - - - - TTY - TTY - - - - Terminal - - - - - TPGID - TPGID - - - - Process group ID of tty owner - ID del grupo del proceso del propietario de la tty - - - - USER - USUARIO - - - - Owner (*=suid root, +=suid a user) - Propietario (*=suid a «root», +=suid a un usuario) - - - - GROUP - GRUPO - - - - Group name (*=sgid other) - Nombre del grupo (*=sgid otro) - - - - UID - UID - - - - Real user ID - ID real del usuario - - - - EUID - - - - - Effective user ID - ID de usuario efectivo - - - - SUID - - - - - Saved user ID (Posix) - ID de usuario guardado (Posix) - - - - FSUID - FSUID - - - - File system user ID - ID de usuario del sistema de archivos - - - - GID - - - - - Real group ID - ID real del grupo - - - - EGID - - - - - Effective group ID - ID de grupo efectivo - - - - SGID - - - - - Saved group ID (Posix) - ID de grupo guardado (Posix) - - - - FSGID - - - - - File system group ID - ID de usuario del sistema de archivos - - - - PRI - - - - - Dynamic priority - Prioridad dinámica - - - - NICE - - - - - Scheduling favour (higher -> less cpu time) - Prioridad de planificación (mayor -> menos tiempo de CPU) - - - - NLWP - - - - - Number of tasks(threads) in task group - Número de tareas (hebras) en el grupo de la tarea - - - - PLCY - - - - - Scheduling policy - Prioridad de planificación - - - - RPRI - - - - - Realtime priority (0-99, more is better) - Prioridad de tiempo real (0-99, más es mejor) - - - - TMS - - - - - Time slice in milliseconds - Fracción de tiempo en milisegundos - - - - %SAVG - - - - - Percentage average sleep time (-1 -> N/A) - Porcentaje de tiempo medio dormido (-1 -> No disponible) - - - - CPUSET - - - - - Affinity CPU mask (0 -> API not supported) - Máscara de afinidad de la CPU (0 -> API no disponible) - - - - MAJFLT - - - - - Number of major faults (disk access) - Número de fallos graves (acceso al disco) - - - - MINFLT - - - - - Number of minor faults (no disk access) - Número de fallos leves (no acceso al disco) - - - - VSIZE - Tamaño virtual - - - - Virtual image size of process - Tamaño de la imagen virtual del proceso - - - - RSS - - - - - Resident set size - Tamaño del conjunto residente - - - - MEM - Memoria - - - - memory usage (RSS-SHARE) - Uso de memoria (RSS-SHARE) - - - - TRS - - - - - Text(code) resident set size - Tamaño del conjunto de texto(código) residente - - - - DRS - - - - - Data resident set size(malloc+global variable) - Tamaño del conjunto residente de datos (malloc+variable global) - - - - STACK - Pila - - - - Stack size - Tamaño de la pila - - - - SHARE - - - - - Shared memory with other libs - Memoria compartida con otras bibliotecas - - - - SWAP - - - - - Kbytes on swap device - Kbytes de swap en el dispositivo - - - - IO_R - - - - - io read (file) - Lectura E/S (archivo) - - - - IO_W - - - - - io write (file) - Escritura E/S (archivo) - - - - DT - - - - - Number of dirty (non-written) pages - Número de páginas sucias (no escritas) - - - - STAT - Estado - - - - State of the process - Estado del proceso - - - - FLAGS - - - - - Process flags (hex) - Indicadores del proceso (hexadecimal) - - - - WCHAN - - - - - Kernel function where process is sleeping - Función del kernel donde está durmiendo el proceso - - - - %WCPU - - - - - Weighted percentage of CPU (30 s average) - Porcentaje ponderado de CPU (media de 30 s) - - - - %CPU - - - - - Percentage of CPU used since last update - Porcentaje de CPU usado desde la última actualización - - - - %MEM - %Memoria - - - - Percentage of memory used (RSS/total mem) - Porcentaje de memoria usada (RSS/memoria total) - - - - START - INICIO - - - - Time process started - Hora a la que empezó el proceso - - - - TIME - HORA - - - - Total CPU time used since start - Tiempo total de uso de CPU desde el inicio - - - - CPU - - - - - CPU the process is executing on (SMP system) - La CPU donde se está ejecutando el proceso (sistema SMP) - - - - the process name - el nombre del proceso - - - - Process Name - Nombre el proceso - - - - CWD - - - - - Current working directory - Directorio de trabajo actual - - - - ROOT - - - - - Root directory of process - Directorio raíz del proceso - - - - COMMAND_LINE - Orden completa - - - - Command line that started the process - Comando que inició el proceso - - - - QObject - - - Show - Mostar - - - - Hide - Ocultar - - - - ScreenShot - Captura de pantalla - - - - Quit - Salir - - - - Qps - - - header_popup - - - - - Remove Field - Borrar el campo - - - - Add Field - Añadir campo - - - - Command - Comando - - - - View - Vista - - - - Process - Proceso - - - - Log - Registro - - - - Custom Fields - Campos personalizados - - - - Basic Fields - Campos básicos - - - - Jobs Fields - Campos de tareas - - - - Memory Fields - Campo de memoria - - - - Scheduling Fields - Campos de planificación - - - - Select Custom Fields... - Elegir los campos personalizados... - - - - Option - Opciones - - - - Update Period... - Intervalo de actualización... - - - - Show Status bar - Mostrar la barra de tareas - - - - Preferences... - Preferencias... - - - - Help - Ayuda - - - - - About - Acerca de - - - - Detail - Detalle - - - - test - - - - - Copied to Clipboard - Copiado al portapapeles - - - - context popup - menú contextual - - - - Renice... - Cambiar la prioridad (renice)... - - - - Scheduling... - Planificación... - - - - Terminate - Terminar - - - - Hangup - Pausar - - - - Kill - Matar - - - - Stop - Detener - - - - Continue - Continuar - - - - SIGINT (interrupt) - SIGINT (interrumpir) - - - - SIGCONT (continue) - SIGCONT (continuar) - - - - SIGSTOP (stop) - SIGSTOP (detener) - - - - SIGQUIT (quit) - SIGQUIT (terminar) - - - - SIGILL (illegal instruction) - SIGILL (instrucción ilegal) - - - - SIGABRT (abort) - SIGABRT (abortar) - - - - SIGFPE (floating point exception) - SIGFPE (excepción de punto flotante) - - - - SIGSEGV (segmentation violation) - SIGSEGV (violación de segmento) - - - - SIGPIPE (broken pipe) - SIGPIPE (tubería rota) - - - - SIGALRM (timer signal) - SIGALRM (señal de temporizador) - - - - SIGUSR1 (user-defined 1) - SIGUSR1 (definida por el usuario 1) - - - - SIGUSR2 (user-defined 2) - SIGUSR2 (definida por el usuario 2) - - - - SIGCHLD (child death) - SIGCHLD (hijo muerto) - - - - SIGTSTP (stop from tty) - SIGTSTP (detener desde tty) - - - - SIGTTIN (tty input) - SIGTTIN (entrada de tty) - - - - SIGTTOU (tty output) - SIGTTOU (salida de tty) - - - - View Details - Ver los detalles - - - - WatchDog - Vigilante - - - - Edit Commands... - Editar comandos... - - - - Quit - Salir - - - - - - - - - Permission denied - Permiso denegado - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - No tiene el permiso para cambiar la prioridad de los procesos seleccionados. Solo pueden hacerlo el dueño del proceso y el superusuario. - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - No tiene permiso para cambiar la prioridad del proceso %1 (%2). Solo pueden hacerlo el dueño del proceso y el superusuario. - - - - Only the super-user may lower the nice value of a process. - El superusuario es el único que puede bajar el valor de la prioridad de un proceso. - - - - Only the super-user may change the scheduling policy and static priority. - El superusuario es el único que puede cambiar el valor de la política de planificación y la prioridad estática. - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - No tiene permiso para cambiar la planificación y/o prioridad del proceso %1 (%2). Solo puede hacerlo el superusuario. - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - No tiene permiso para enviar una señal al proceso %1 (%2). El superusuario y el dueño del proceso.son los únicos que pueden enviarle señales. - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - <h2> Qps %1 - Un administrador de tareas visual </h2> %2 que usa la biblioteca Qt %3<br><br><b>Fuente: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Seguimiento de errores: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a><br><br> - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - <b>La versión original de original es de</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Colaboradores</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - <H1>Ayuda de QPS</H1>Actualizada: 24 de Mayo de 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Salir </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Actualizar </td> <td>&nbsp;Espacio , Intro </td> </tr> <tr><td> Terminar proceso </td> <td> ALT + T , SUPRIMIR </td> </tr> <tr><td> Matar proceso </td> <td> ALT + K </td> </tr> </tbody></table> - - - - SchedDialog - - - Change scheduling - Cambiar la planificación - - - - Scheduling Policy - Política de planificación - - - - SCHED_OTHER (time-sharing) - SHED_OTHER (tiempo compartido) - - - - SCHED_FIFO (real-time) - SCHED_FIFO (tiempo real) - - - - SCHED_RR (real-time) - SCHED_RR (tiempo real) - - - - OK - Aceptar - - - - Cancel - Cancelar - - - - Priority (1-99): - Prioridad (1-99): - - - - Invalid Input - Entrada no válida - - - - The priority must be in the range 1..99 - La prioridad debe estar en el rango 1..99 - - - - Screenshot - - - /untitled. - /sin título. - - - - Save As - Guardar como - - - - %1 Files (*.%2);;All Files (*) - Archivos %1 (*.%2);; Todos los archivos (*) - - - - Options - Opciones - - - - s - - - - - Screenshot Delay: - Retardo al capturar la pantalla: - - - - Hide This Window - Ocultar esta ventana - - - - New Screenshot - Nueva captura de pantalla - - - - Quit - Salir - - - - SearchBox - - - PID,COMMAND,USER... - PID,COMANDO,USUARIO... - - - - SliderDialog - - - Renice Process - Cambiar la prioridad del proceso (renice) - - - - New nice value: - Nuevo valor de prioridad (nice): - - - - Cancel - Cancelar - - - - OK - Aceptar - - - - Sockets - - - Fd - - - - - File descriptor - Descriptor de archivo - - - - Proto - - - - - Protocol (TCP or UDP) - Protocolo (TCP o UDP) - - - - Recv-Q - - - - - Bytes in receive queue - Bytes en la cola de recibidos - - - - Send-Q - - - - - Bytes in send queue - Bytes en la cola de enviados - - - - Local Addr - Dirección local - - - - Local IP address - Dirección IP local - - - - - Port - Puerto - - - - Local port - Puerto local - - - - Remote Addr - Dirección remota - - - - Remote IP address - Dirección IP remota - - - - Remote port - Puerto remoto - - - - State - Estado - - - - Connection state - Estado de la conexión - - - - StatusBar - - - Process count: %1 - Número de procesos: %1 - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - Esta es una función alfa inestable - Puede que vea algún SEGFAULT... - - - - TFrame - - - this is Tframe widget - este es el control Tframe - - - - UFrame - - - title - título - - - - WatchdogDialog - - - if process start - si el proceso empieza - - - - if process finish - si el proceso termina - - - - select condition - seleccionar condición - - - diff --git a/src/translations/qps_fr.ts b/src/translations/qps_fr.ts deleted file mode 100644 index 4eb404f..0000000 --- a/src/translations/qps_fr.ts +++ /dev/null @@ -1,1789 +0,0 @@ - - - - - AllFields - - - Field - Champ - - - - Field name - Nom du champ - - - - Description - - - - - Field description - Champ de la description - - - - Value - Valeur - - - - Field value - Champ de la valeur - - - - Boxvar - - - Exit On Close Button - Quitter avec le bouton Fermer - - - - Host Name Lookup - Recherche du nom d'hôte - - - - Service Name Lookup - Recherche du nom de service - - - - Disclosure Triangles - - - - - Branch Lines - - - - - Auto Save Settings on Exit - Sauvegarde automatiquement les paramètres en sortant - - - - Selection: Copy PIDs to Clipboard - Selection: Copier les PIDs dans le presse-papier - - - - Normalize NICE - - - - - Use pmap for Map Names - Utiliser pmap pour les Map Names - - - - Cbgroup - - - General - - - - - Command - - - The command: - - - - - - - - -failed with the error: - - - - -Echec sur l'erreur: - - - - - - Too many processes - Processus trop nombreux - - - - Unknown error - Erreur inconnue - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - -N'a pu être exécuté car n'a pas été trouvé, -ou bien vous n'avez pas la permission d'exécuter. - - - - - -exited with status - - -arrêt avec le statut. - - - - Command Failed - Echec de la commande - - - - CommandDialog - - - Edit Commands 0.1 alpha - - - - - Name: - Nom : - - - - Popup - - - - - Command Line: - Ligne de commande : - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - Substitutions: -%p PID -%c COMMANDE -%C LIGNE DE COMMANDE -%u UTILISATEUR -%% % - - - - - - New... - - - - - - Add... - Ajouter... - - - - Delete - - - - - Close - Fermer - - - - ControlBar - - - Linear - - - - - Tree - Arborescence - - - - All Processes - Tous les processus - - - - Your Processes - Vos processus - - - - Non-Root Processes - Processus non root - - - - Running Processes - Processus en cours d'exécution - - - - Pause (Ctrl+Space) - - - - - Details - - - Process %1 ( %2 ) - details - - - - - Files - - - - - Sockets - - - - - Memory Maps - - - - - Environment - - - - - All Fields - Tous les champs - - - - Environ - - - Variable - - - - - Variable name - - - - - Value - Valeur - - - - Variable value - Valeur variable - - - - EventDialog - - - Watchdog 0.1 alpha - - - - - Eventcat - - - - - Select condition - Condition de sélection - - - - labelDescrition - - - - - Enable - Activer - - - - process name - - - - - cpu - - - - - % - - - - - include already running process - inclus les processus déjà en cours d'exécution - - - - run command - - - - - show Message - afficher le message - - - - Help (Not yet. just concept) - Aide (pas encore. juste le concept) - - - - %p : pid -%c : command - %p : pid -%c : commande - - - - New - - - - - Add - Ajouter - - - - Delete - - - - - Close - Fermer - - - - ExecWindow - - - Qps - - - - - Ok - - - - - Qps Watchdog - - - - - %1 exit with code %2 - %1 s'arrête avec le code %2 - - - - Close - Fermer - - - - %1 [running] - %1 [en cours] - - - - terminate command - arrêter la commande - - - - Error %1 : [%2] Maybe command not found - Erreur %1: [%2] Peut-être la commande n'a-t-elle pas été trouvée - - - - FieldSelect - - - Select Custom Fields - Choisissez les champs personnalisés - - - - Close - Fermer - - - - Files - - - Fd - - - - - File descriptor - Descripteur de fichier - - - - Mode - - - - - Open mode - - - - - Name - - - - - File name (if available) - Nom de fichier (si disponible) - - - - IntervalDialog - - - Change Update Period - Changer la fréquence de mise-à-jour - - - - New Update Period - Nouvelle fréquence de mise-à-jour - - - - Cancel - Annuler - - - - OK - - - - - No UPDATE - - - - - Invalid value - Valeur non valable - - - - ListModel - - - Event Category - Catégorie d'événement - - - - Enable - Activer - - - - Maps - - - Address Range - Plage d'adresses - - - - Mapped addresses (hex) ) - - - - - Size - Taille - - - - Kbytes mapped (dec) - - - - - Perm - - - - - Permission flags - Flags de permission - - - - Offset - - - - - File offset at start of mapping (hex) - - - - - Device - - - - - Major,Minor device numbers (dec) - Chiffres majeurs et mineurs des devices (dec) - - - - Inode - - - - - Inode number (dec) - Numéro d'inode (dec) - - - - File - - - - - File name (if available) - Nom de fichier (si disponible) - - - - PermissionDialog - - - Permission - - - - - Root password - - - - - Cancel - Annuler - - - - OK - - - - - Preferences - - - Preferences - - - - - Setting - Paramétrage - - - - %CPU divided by - %CPU divisé par - - - - Total cpu: %1 - - - - - Single cpu: 1 - CPU unique: 1 - - - - default - - - - - for developer - - - - - Appearance - Apparence - - - - Proc - - - PID - - - - - Process ID - - - - - TGID - - - - - Task group ID ( parent of threads ) - ID de groupe de tâches ( parent de threads ) - - - - PPID - - - - - Parent process ID - ID du processus parent - - - - PGID - - - - - Process group ID - ID de groupe de processus - - - - SID - - - - - Session ID - ID de session - - - - TTY - - - - - Terminal - - - - - TPGID - - - - - Process group ID of tty owner - ID du groupe de processus du propriétaire tty - - - - USER - - - - - Owner (*=suid root, +=suid a user) - Propriétaire (*=suid root, +=suid a user) - - - - GROUP - - - - - Group name (*=sgid other) - Nom de groupe (*=sgid autre) - - - - UID - - - - - Real user ID - - - - - EUID - - - - - Effective user ID - ID d'utilisateur effectif - - - - SUID - - - - - Saved user ID (Posix) - ID d'utilisateur sauvegardé (Posix) - - - - FSUID - - - - - File system user ID - - - - - GID - - - - - Real group ID - ID de groupe réel - - - - EGID - - - - - Effective group ID - ID de groupe effectif - - - - SGID - - - - - Saved group ID (Posix) - ID de groupe sauvegardé (Posix) - - - - FSGID - - - - - File system group ID - ID de groupe de système de fichiers - - - - PRI - - - - - Dynamic priority - Priorité dynamique - - - - NICE - - - - - Scheduling favour (higher -> less cpu time) - - - - - NLWP - - - - - Number of tasks(threads) in task group - Nombre de tâches (threads) dans le groupe de tâches - - - - PLCY - - - - - Scheduling policy - Politique de planification - - - - RPRI - - - - - Realtime priority (0-99, more is better) - Priorité temps réel (0-99, avantage au plus élevé) - - - - TMS - - - - - Time slice in milliseconds - Tranche de temps en milliseconds - - - - %SAVG - - - - - Percentage average sleep time (-1 -> N/A) - - - - - CPUSET - - - - - Affinity CPU mask (0 -> API not supported) - Masque d'affinité de CPU (0 -> API non supportée) - - - - MAJFLT - - - - - Number of major faults (disk access) - Nombre d'échecs majeurs (accès disque) - - - - MINFLT - - - - - Number of minor faults (no disk access) - - - - - VSIZE - - - - - Virtual image size of process - Taille de l'image virtuelle du processus - - - - RSS - - - - - Resident set size - Taille du resident set - - - - MEM - - - - - memory usage (RSS-SHARE) - Utilisation mémoire (RSS-SHARE) - - - - TRS - - - - - Text(code) resident set size - Taille du resident set texte (code) - - - - DRS - - - - - Data resident set size(malloc+global variable) - Taille du resident set data (malloc+global variable) - - - - STACK - - - - - Stack size - Taille de la pile - - - - SHARE - - - - - Shared memory with other libs - Mémoire partagée avec d'autres libs - - - - SWAP - - - - - Kbytes on swap device - Kbytes sur le disque de swap - - - - IO_R - - - - - io read (file) - io en lecture (fichier) - - - - IO_W - - - - - io write (file) - io en écriture (fichier) - - - - DT - - - - - Number of dirty (non-written) pages - Nombre de pages "sales" (non écrites) - - - - STAT - - - - - State of the process - Etat du processus - - - - FLAGS - - - - - Process flags (hex) - Flags de processus (hex) - - - - WCHAN - - - - - Kernel function where process is sleeping - - - - - %WCPU - - - - - Weighted percentage of CPU (30 s average) - Pourcentage pondéré de CPU (30 s en moyenne) - - - - %CPU - - - - - Percentage of CPU used since last update - Pourcentage de CPU utilisé depuis la dernière mise-à-jour - - - - %MEM - - - - - Percentage of memory used (RSS/total mem) - Pourcentage de mémoire utilisé (RSS/total mem) - - - - START - - - - - Time process started - Moment de démarrage du processus - - - - TIME - - - - - Total CPU time used since start - Temps total de CPU utilisé depuis le démarrage - - - - CPU - - - - - CPU the process is executing on (SMP system) - CPU sur laquelle le processus s'exécute (SMP system) - - - - the process name - - - - - Process Name - Nom du processus - - - - CWD - - - - - Current working directory - Répertoire courant - - - - ROOT - - - - - Root directory of process - Répertoire racine du processus - - - - COMMAND_LINE - - - - - Command line that started the process - Ligne de commande qui a lancé le processus - - - - QObject - - - Show - Afficher - - - - Hide - Cacher - - - - ScreenShot - - - - - Quit - Abandonner - - - - Qps - - - header_popup - - - - - Remove Field - Retirer le champ - - - - Add Field - Ajouter un champ - - - - Command - - - - - View - - - - - Process - - - - - Log - - - - - Custom Fields - Champs personnalisés - - - - Basic Fields - Champs de base - - - - Jobs Fields - - - - - Memory Fields - Champs mémoire - - - - Scheduling Fields - Champs de planification - - - - Select Custom Fields... - Choisir des champs personnalisés... - - - - Option - - - - - Update Period... - Fréquence de mise-à-jour... - - - - Show Status bar - Afficher la barre de statut - - - - Preferences... - - - - - Help - - - - - - About - A propos - - - - Detail - - - - - test - - - - - Copied to Clipboard - Copié dans le presse-papier - - - - context popup - popup de contexte - - - - Renice... - - - - - Scheduling... - Ordonnancement... - - - - Terminate - Arrêter - - - - Hangup - Suspendre - - - - Kill - - - - - Stop - - - - - Continue - Continuer - - - - SIGINT (interrupt) - - - - - SIGCONT (continue) - - - - - SIGSTOP (stop) - - - - - SIGQUIT (quit) - - - - - SIGILL (illegal instruction) - SIGILL (instruction illégale) - - - - SIGABRT (abort) - - - - - SIGFPE (floating point exception) - - - - - SIGSEGV (segmentation violation) - - - - - SIGPIPE (broken pipe) - - - - - SIGALRM (timer signal) - - - - - SIGUSR1 (user-defined 1) - SIGUSR1 (défini par l'utilisateur 1) - - - - SIGUSR2 (user-defined 2) - SIGUSR2 (défini par l'utilisateur 2) - - - - SIGCHLD (child death) - - - - - SIGTSTP (stop from tty) - - - - - SIGTTIN (tty input) - - - - - SIGTTOU (tty output) - - - - - View Details - - - - - WatchDog - - - - - Edit Commands... - Modifier les commandes... - - - - Quit - Abandonner - - - - - - - - - Permission denied - Permission refusée - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - - - - - Only the super-user may lower the nice value of a process. - - - - - Only the super-user may change the scheduling policy and static priority. - - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - Vous n'avez pas la permission de changer l'ordonnancement et/ou la priorité du processus %1 (%2). Seul le super utilisateur en a le droit. - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - Vous n'avez pas la permission d'envoyer un signal au processus %1 (%2). Seuls le super utilisateur et le propriétaire du processus ont le droit de lui envoyer des signaux. - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - - - - - SchedDialog - - - Change scheduling - Changer l'ordonnancement - - - - Scheduling Policy - Politique d'ordonnancement - - - - SCHED_OTHER (time-sharing) - - - - - SCHED_FIFO (real-time) - - - - - SCHED_RR (real-time) - - - - - OK - - - - - Cancel - Annuler - - - - Priority (1-99): - - - - - Invalid Input - Entrée invalide - - - - The priority must be in the range 1..99 - La priorité doit se situer dans la plage 1..99 - - - - Screenshot - - - /untitled. - - - - - Save As - Sauvegarder sous - - - - %1 Files (*.%2);;All Files (*) - %1 Fichier (*.%2);;Tous les fichiers (*) - - - - Options - - - - - s - - - - - Screenshot Delay: - Attente pour la copie d'écran : - - - - Hide This Window - Cacher cette fenêtre - - - - New Screenshot - - - - - Quit - Abandonner - - - - SearchBox - - - PID,COMMAND,USER... - - - - - SliderDialog - - - Renice Process - - - - - New nice value: - Nouvelle bonne valeur : - - - - Cancel - Annuler - - - - OK - - - - - Sockets - - - Fd - - - - - File descriptor - Descripteur de fichier - - - - Proto - - - - - Protocol (TCP or UDP) - Protocole (TCP ou UDP) - - - - Recv-Q - - - - - Bytes in receive queue - Octets dans la file de réception - - - - Send-Q - - - - - Bytes in send queue - Octets dans la file d'émission - - - - Local Addr - Addresse locale - - - - Local IP address - - - - - - Port - - - - - Local port - - - - - Remote Addr - Adresse distante - - - - Remote IP address - Adresse IP distante - - - - Remote port - Port distant - - - - State - Etat - - - - Connection state - Etat de la connexion - - - - StatusBar - - - Process count: %1 - Nombre de processus: %1 - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - - - - - TFrame - - - this is Tframe widget - - - - - UFrame - - - title - titre - - - - WatchdogDialog - - - if process start - - - - - if process finish - si le processus se termine - - - - select condition - condition de sélection - - - diff --git a/src/translations/qps_gl.ts b/src/translations/qps_gl.ts deleted file mode 100644 index fb4bf3f..0000000 --- a/src/translations/qps_gl.ts +++ /dev/null @@ -1,1792 +0,0 @@ - - - - - AllFields - - - Field - Campo - - - - Field name - Nome do campo - - - - Description - Descrición - - - - Field description - Descrición do campo - - - - Value - Valor - - - - Field value - Valor do campo - - - - Boxvar - - - Exit On Close Button - Saír ao premer no botón de peche - - - - Host Name Lookup - Busca do nome da máquina/servidor - - - - Service Name Lookup - Busca do nome do servizo - - - - Disclosure Triangles - Triángulos de expansión - - - - Branch Lines - Liñas das bifurcacións - - - - Auto Save Settings on Exit - Gardar automaticamente a configuración ao saír - - - - Selection: Copy PIDs to Clipboard - Selección: copiar os PID no portapapeis - - - - Normalize NICE - Normalizar NICE - - - - Use pmap for Map Names - Usar pmap para os nomes das asignacións - - - - Cbgroup - - - General - Xeral - - - - Command - - - The command: - - - A orde: - - - - - - - -failed with the error: - - - - -produciuse un fallo co erro: - - - - - - Too many processes - Demasiados procesos - - - - Unknown error - Produciuse un erro descoñecido - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - -non foi posíbel executalo xa que non foi atopado, -ou vostede non ten permisos para executalo. - - - - - -exited with status - - -saíu co estado - - - - Command Failed - Produciuse un fallo na orde - - - - CommandDialog - - - Edit Commands 0.1 alpha - Editor de ordes 0.1 alfa - - - - Name: - Nome: - - - - Popup - Xanela emerxente - - - - Command Line: - Liña de ordes: - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - Substitucións: -%p PID -%c ORDE -%C LIÑA_ORDES -%u USUARIO -%% % - - - - - - New... - Novo... - - - - - Add... - Engadir... - - - - Delete - Eliminar - - - - Close - Pechar - - - - ControlBar - - - Linear - Lineal - - - - Tree - Árbore - - - - All Processes - Todos os procesos - - - - Your Processes - Os seus procesos - - - - Non-Root Processes - Procesos que no son de «root» - - - - Running Processes - Procesos en execución - - - - Pause (Ctrl+Space) - Pausa (Ctrl+Espazo) - - - - Details - - - Process %1 ( %2 ) - details - Proceso %1 ( %2 ) - detalles - - - - Files - Ficheiros - - - - Sockets - Zócolos - - - - Memory Maps - Mapas de memoria - - - - Environment - Contorno - - - - All Fields - Todos os campos - - - - Environ - - - Variable - Variábel - - - - Variable name - Nome da variábel - - - - Value - Valor - - - - Variable value - Valor da variábel - - - - EventDialog - - - Watchdog 0.1 alpha - Vixiante 0.1 alfa - - - - Eventcat - Cat. do evento - - - - Select condition - Seleccionar a condición - - - - labelDescrition - Descrición - - - - Enable - Activar - - - - process name - nome do proceso - - - - cpu - - - - - % - - - - - include already running process - incluír os procesos que xa están en execución - - - - run command - executar a orde - - - - show Message - amosar a mensaxe - - - - Help (Not yet. just concept) - Axuda (aínda non, só o concepto) - - - - %p : pid -%c : command - %p : pid -%c : orde - - - - New - Novo - - - - Add - Engadir - - - - Delete - Eliminar - - - - Close - Pechar - - - - ExecWindow - - - Qps - Qps - - - - Ok - Aceptar - - - - Qps Watchdog - Vixiante do Qps - - - - %1 exit with code %2 - %1 sae co código %2 - - - - Close - Pechar - - - - %1 [running] - %1 [en execución] - - - - terminate command - rematar a orde - - - - Error %1 : [%2] Maybe command not found - Produciuse un erro %1 : [%2] É probábel que non se atopara a orde - - - - FieldSelect - - - Select Custom Fields - Escoller os campos personalizados - - - - Close - Pechar - - - - Files - - - Fd - Df - - - - File descriptor - Descritor de ficheiro - - - - Mode - Modo - - - - Open mode - Modo de apertura - - - - Name - Nome - - - - File name (if available) - Nome do ficheiro (se está dispoñíbel) - - - - IntervalDialog - - - Change Update Period - Cambiar o intervalo de actualización - - - - New Update Period - Novo intervalo de actualización - - - - Cancel - Cancelar - - - - OK - Aceptar - - - - No UPDATE - Non ACTUALIZAR - - - - Invalid value - Valor incorrecto - - - - ListModel - - - Event Category - Categoría do evento - - - - Enable - Activar - - - - Maps - - - Address Range - Intervalo de enderezos - - - - Mapped addresses (hex) ) - Enderezos asignados (hex) ) - - - - Size - Tamaño - - - - Kbytes mapped (dec) - Kbytes asignados (dec) - - - - Perm - Perm. - - - - Permission flags - Indicadores de permisos - - - - Offset - Desprazamento - - - - File offset at start of mapping (hex) - Desprazamento do ficheiro no inicio da asignación (hex) - - - - Device - Dispositivo - - - - Major,Minor device numbers (dec) - Números maior e menor do dispositivo (dec) - - - - Inode - Inodo - - - - Inode number (dec) - Número de inodo (dec) - - - - File - Ficheiro - - - - File name (if available) - Nome do ficheiro (se está dispoñíbel) - - - - PermissionDialog - - - Permission - Permiso - - - - Root password - Contrasinal de «root» - - - - Cancel - Cancelar - - - - OK - Aceptar - - - - Preferences - - - Preferences - Preferencias - - - - Setting - Axuste - - - - %CPU divided by - %CPU dividida por - - - - Total cpu: %1 - Total de CPU: %1 - - - - Single cpu: 1 - CPU única: 1 - - - - default - predefinido - - - - for developer - para o desenvolvedor - - - - Appearance - Aparencia - - - - Proc - - - PID - - - - - Process ID - ID do proceso - - - - TGID - - - - - Task group ID ( parent of threads ) - ID do grupo da tarefa ( pai de fíos) - - - - PPID - - - - - Parent process ID - ID do proceso pai - - - - PGID - - - - - Process group ID - ID do grupo do proceso - - - - SID - - - - - Session ID - ID da sesión - - - - TTY - - - - - Terminal - - - - - TPGID - - - - - Process group ID of tty owner - ID do grupo do proceso do propietario do tty - - - - USER - USUARIO - - - - Owner (*=suid root, +=suid a user) - Propietario (*=suid «root», +=suid un usuario) - - - - GROUP - GRUPO - - - - Group name (*=sgid other) - Nome do grupo (*=sgid outro) - - - - UID - - - - - Real user ID - ID do usuario real - - - - EUID - - - - - Effective user ID - ID do usuario efectivo - - - - SUID - - - - - Saved user ID (Posix) - ID do usuario gardado (Posix) - - - - FSUID - - - - - File system user ID - ID do usuario do sistema de ficheiros - - - - GID - - - - - Real group ID - ID do grupo real - - - - EGID - - - - - Effective group ID - ID do grupo efectivo - - - - SGID - - - - - Saved group ID (Posix) - ID do grupo gardado (Posix) - - - - FSGID - - - - - File system group ID - ID do grupo do sistema de ficheiros - - - - PRI - - - - - Dynamic priority - Prioridade dinámica - - - - NICE - - - - - Scheduling favour (higher -> less cpu time) - Prioridade de planificación (maior -> menos tempo de CPU) - - - - NLWP - - - - - Number of tasks(threads) in task group - Número de tarefas (fíos) no grupo da tarefa - - - - PLCY - - - - - Scheduling policy - Prioridade de planificación - - - - RPRI - - - - - Realtime priority (0-99, more is better) - Prioridade de tempo real (0-99, máis é mellor) - - - - TMS - - - - - Time slice in milliseconds - Fracción de tempo en milisegundos - - - - %SAVG - - - - - Percentage average sleep time (-1 -> N/A) - Porcentaxe de tempo medio durmido (-1 -> N/D) - - - - CPUSET - - - - - Affinity CPU mask (0 -> API not supported) - Máscara de afinidade da CPU (0 -> API non admitida) - - - - MAJFLT - - - - - Number of major faults (disk access) - Número de fallos graves (acceso ao disco) - - - - MINFLT - - - - - Number of minor faults (no disk access) - Número de fallos lenes (sen acceso ao disco) - - - - VSIZE - - - - - Virtual image size of process - Tamaño da imaxe virtual do proceso - - - - RSS - - - - - Resident set size - Tamaño do conxunto residente - - - - MEM - - - - - memory usage (RSS-SHARE) - uso de memoria (RSS-SHARE) - - - - TRS - - - - - Text(code) resident set size - Tamaño do conxunto de texto(código) residente - - - - DRS - - - - - Data resident set size(malloc+global variable) - Tamaño do conxunto residente de datos (malloc+variábel global) - - - - STACK - MOREA - - - - Stack size - Tamaño da morea - - - - SHARE - COMPARTIDA - - - - Shared memory with other libs - Memoria compartida con outras bibliotecas - - - - SWAP - INTERCAMBIO - - - - Kbytes on swap device - Kbytes no dispositivo de intercambio - - - - IO_R - L_ES - - - - io read (file) - lectura e/s (ficheiro) - - - - IO_W - E_ES - - - - io write (file) - escritura e/s (ficheiro) - - - - DT - - - - - Number of dirty (non-written) pages - Número de páxinas sucias (non escritas) - - - - STAT - ESTADO - - - - State of the process - Estado do proceso - - - - FLAGS - INDICADORES - - - - Process flags (hex) - Indicadores do proceso (hex) - - - - WCHAN - - - - - Kernel function where process is sleeping - Función do núcleo (kernel) onde esta a durmir o proceso - - - - %WCPU - - - - - Weighted percentage of CPU (30 s average) - Porcentaxe ponderado de CPU (media de 30 s) - - - - %CPU - - - - - Percentage of CPU used since last update - Porcentaxe de CPU usado dende a última actualización - - - - %MEM - - - - - Percentage of memory used (RSS/total mem) - Porcentaxe de memoria usada (RSS/memoria total) - - - - START - INICIO - - - - Time process started - Momento no que se iniciou o proceso - - - - TIME - TEMPO - - - - Total CPU time used since start - Tempo total de uso de CPU desde o inicio - - - - CPU - - - - - CPU the process is executing on (SMP system) - A CPU onde se está a executar o proceso (sistema SMP) - - - - the process name - o nome do proceso - - - - Process Name - Nome do proceso - - - - CWD - - - - - Current working directory - Directorio de traballo actual - - - - ROOT - RAÍZ - - - - Root directory of process - Directorio raíz do proceso - - - - COMMAND_LINE - LIÑA_ORDES - - - - Command line that started the process - Liña de ordes que iniciou o proceso - - - - QObject - - - Show - Amosar - - - - Hide - Agachar - - - - ScreenShot - Captura de pantalla - - - - Quit - Saír - - - - Qps - - - header_popup - Xanela emerxente de cabeceira - - - - Remove Field - Retirar o campo - - - - Add Field - Engadir un campo - - - - Command - Orde - - - - View - Ver - - - - Process - Proceso - - - - Log - Rexistro - - - - Custom Fields - Campos personalizados - - - - Basic Fields - Campos básicos - - - - Jobs Fields - Campos de tarefas - - - - Memory Fields - Campos de memoria - - - - Scheduling Fields - Campos de planificación - - - - Select Custom Fields... - Escoller os campos personalizados... - - - - Option - Opción - - - - Update Period... - Intervalo de actualización... - - - - Show Status bar - Amosar a barra de tarefas - - - - Preferences... - Preferencias... - - - - Help - Axuda - - - - - About - Sobre - - - - Detail - Detalle - - - - test - proba - - - - Copied to Clipboard - Copiado no portapapeis - - - - context popup - xanela emerxente contextual - - - - Renice... - Cambiar a prioridade (renice)... - - - - Scheduling... - Planificación... - - - - Terminate - Rematar - - - - Hangup - Suspender - - - - Kill - Matar - - - - Stop - Deter - - - - Continue - Continuar - - - - SIGINT (interrupt) - SIGINT (interromper) - - - - SIGCONT (continue) - SIGCONT (continuar) - - - - SIGSTOP (stop) - SIGSTOP (deter) - - - - SIGQUIT (quit) - SIGQUIT (saír) - - - - SIGILL (illegal instruction) - SIGILL (instrución incorrecta) - - - - SIGABRT (abort) - SIGABRT (anular) - - - - SIGFPE (floating point exception) - SIGFPE (excepción de punto flotante) - - - - SIGSEGV (segmentation violation) - SIGSEGV (infracción de segmento) - - - - SIGPIPE (broken pipe) - SIGPIPE (canalización rachada) - - - - SIGALRM (timer signal) - SIGALRM (sinal do temporizador) - - - - SIGUSR1 (user-defined 1) - SIGUSR1 (definida polo usuario 1) - - - - SIGUSR2 (user-defined 2) - SIGUSR2 (definida polo usuario 2) - - - - SIGCHLD (child death) - SIGCHLD (fillo morto) - - - - SIGTSTP (stop from tty) - SIGTSTP (detida dende o tty) - - - - SIGTTIN (tty input) - SIGTTIN (entrada do tty) - - - - SIGTTOU (tty output) - SIGTTOU (saída do tty) - - - - View Details - Ver os detalles - - - - WatchDog - Vixiante - - - - Edit Commands... - Editar as ordes... - - - - Quit - Saír - - - - - - - - - Permission denied - Permiso denegado - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - Non ten permiso para cambiar a prioridade dos procesos seleccionados. Só o dono do proceso e o superusuario poden facelo. - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - Non ten permiso para cambiar a prioridade do proceso s%1 (%2). Só o dono do proceso e o superusuario poden facelo. - - - - Only the super-user may lower the nice value of a process. - O superusuario é o único que pode baixar o valor da prioridade dun proceso. - - - - Only the super-user may change the scheduling policy and static priority. - O superusuario é o único que pode cambiar o valor da política de planificación e a prioridade estática. - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - Non ten permiso para cambiar a planificación e/ou a prioridade do proceso s%1 (%2). Só pode facelo o superusuario. - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - Non ten permiso para enviar un sinal ao proceso s%1 (%2). O superusuario e o dono do proceso son os únicos que poden enviarlle sinais. - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - <h2> Qps %1 - Un administrador visual de tarefas </h2> %2 que emprega a biblioteca Qt %3<br><br><b>Código: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Seguemento de erros: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a><br><br> - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - <b>O desenvolvemento orixinal do Qps e de</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Colaboradores</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - <H1>Axuda doQPS</H1>Actualizada: 24 de maio de 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Saír </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Actualizar </td> <td>&nbsp;Espazo , Intro </td> </tr> <tr><td> Rematar o proceso </td> <td> ALT + T , SUPRIMIR </td> </tr> <tr><td> Matar o proceso </td> <td> ALT + K </td> </tr> </tbody></table> - - - - SchedDialog - - - Change scheduling - Cambiar a planificación - - - - Scheduling Policy - Política de planificación - - - - SCHED_OTHER (time-sharing) - SCHED_OTHER (tempo compartido) - - - - SCHED_FIFO (real-time) - SCHED_FIFO (tempo real) - - - - SCHED_RR (real-time) - SCHED_RR (tempo real) - - - - OK - Aceptar - - - - Cancel - Cancelar - - - - Priority (1-99): - Prioridade (1-99): - - - - Invalid Input - Entrada incorrecta - - - - The priority must be in the range 1..99 - A prioridade debe estar no intervalo 1..99 - - - - Screenshot - - - /untitled. - /sen_título. - - - - Save As - Gardar como - - - - %1 Files (*.%2);;All Files (*) - %1 ficheiros (*.%2);;Todos os ficheiros (*) - - - - Options - Opcións - - - - s - - - - - Screenshot Delay: - Demora ao capturar a pantalla: - - - - Hide This Window - Agachar esta xanela - - - - New Screenshot - Nova captura de pantalla - - - - Quit - Saír - - - - SearchBox - - - PID,COMMAND,USER... - PID,ORDE,USUARIO... - - - - SliderDialog - - - Renice Process - Cambiar a prioridade do proceso (renice) - - - - New nice value: - Novo valor de prioridade (nice): - - - - Cancel - Cancelar - - - - OK - Aceptar - - - - Sockets - - - Fd - Df - - - - File descriptor - Descritor de ficheiro - - - - Proto - Proto - - - - Protocol (TCP or UDP) - Protocolo (TCP ou UDP) - - - - Recv-Q - Cola_rec - - - - Bytes in receive queue - Bytes na cola de recibidos - - - - Send-Q - Cola_env - - - - Bytes in send queue - Bytes na cola de enviados - - - - Local Addr - Enderezo local - - - - Local IP address - Enderezo IP local - - - - - Port - Porto - - - - Local port - Porto local - - - - Remote Addr - Enderezo remoto - - - - Remote IP address - Enderezo IP remoto - - - - Remote port - Porto remoto - - - - State - Estado - - - - Connection state - Estado da conexión - - - - StatusBar - - - Process count: %1 - Número de procesos: %1 - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - Esta é unha función alfa inestábel - É probábel que vexa algún SEGFAULT... - - - - TFrame - - - this is Tframe widget - este é o trebello Tframe - - - - UFrame - - - title - título - - - - WatchdogDialog - - - if process start - se inicia o proceso - - - - if process finish - se acaba o proceso - - - - select condition - seleccionar a condición - - - diff --git a/src/translations/qps_he.ts b/src/translations/qps_he.ts deleted file mode 100644 index 23783fc..0000000 --- a/src/translations/qps_he.ts +++ /dev/null @@ -1,1786 +0,0 @@ - - - - - AllFields - - - Field - שדה - - - - Field name - שם השדה - - - - Description - תיאור - - - - Field description - תיאור שדה - - - - Value - ערך - - - - Field value - ערך שדה - - - - Boxvar - - - Exit On Close Button - - - - - Host Name Lookup - - - - - Service Name Lookup - - - - - Disclosure Triangles - - - - - Branch Lines - - - - - Auto Save Settings on Exit - שמירת ההגדרות אוטומטית עם היציאה - - - - Selection: Copy PIDs to Clipboard - בחירה: העתקת מזהי תהליכים ללוח הגזירים - - - - Normalize NICE - - - - - Use pmap for Map Names - - - - - Cbgroup - - - General - כללי - - - - Command - - - The command: - - - הפקודה: - - - - - - - -failed with the error: - - - - -נכשל עם השגיאה: - - - - - - Too many processes - יותר מדי תהליכים - - - - Unknown error - שגיאה לא ידועה - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - - - - - -exited with status - - - - - Command Failed - הפקודה נכשלה - - - - CommandDialog - - - Edit Commands 0.1 alpha - עריכת פקודות 0.1 אלפא - - - - Name: - שם: - - - - Popup - חלון מוקפץ - - - - Command Line: - שורת פקודה: - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - החלפות: -%p מזהה תהליך -%c פקודה -%C שורת פקודה -%u משתמש -%% % - - - - - - New... - חדש… - - - - - Add... - הוספה… - - - - Delete - מחיקה - - - - Close - סגירה - - - - ControlBar - - - Linear - קווי - - - - Tree - עץ - - - - All Processes - כל התהליכים - - - - Your Processes - התהליכים שלך - - - - Non-Root Processes - תהליכים שאינם של משתמש העל - - - - Running Processes - תהליכים פעילים - - - - Pause (Ctrl+Space) - עצירה (Ctrl+Space) - - - - Details - - - Process %1 ( %2 ) - details - תהליך %1 ( %2 ) - פרטים - - - - Files - קבצים - - - - Sockets - שקעים - - - - Memory Maps - מפות זיכרון - - - - Environment - סביבה - - - - All Fields - כל השדות - - - - Environ - - - Variable - משתנה - - - - Variable name - שם המשתנה - - - - Value - ערך - - - - Variable value - ערך המשתנה - - - - EventDialog - - - Watchdog 0.1 alpha - משגיח 0.1 אלפא - - - - Eventcat - יומן אירועים - - - - Select condition - בחירת מצב - - - - labelDescrition - תווית תיאור - - - - Enable - הפעלה - - - - process name - שם תהליך - - - - cpu - מעבד - - - - % - - - - - include already running process - כולל תהליך שכבר רץ - - - - run command - הפעלת פקודה - - - - show Message - הצגת הודעה - - - - Help (Not yet. just concept) - עזרה (בינתיים אין, זה בגדר רעיון) - - - - %p : pid -%c : command - ‎%p : מזהה תהליך -‎%c : פקודה - - - - New - חדש - - - - Add - הוספה - - - - Delete - מחיקה - - - - Close - סגירה - - - - ExecWindow - - - Qps - - - - - Ok - אישור - - - - Qps Watchdog - משגיח Qps - - - - %1 exit with code %2 - %1 יצא עם קוד %2 - - - - Close - סגירה - - - - %1 [running] - %1 [פעיל] - - - - terminate command - חיסול פקודה - - - - Error %1 : [%2] Maybe command not found - שגיאה %1 ‏: [%2] אולי הפקודה לא נמצאה - - - - FieldSelect - - - Select Custom Fields - - - - - Close - סגירה - - - - Files - - - Fd - - - - - File descriptor - - - - - Mode - מצב - - - - Open mode - - - - - Name - שם - - - - File name (if available) - שם קובץ (אם יש) - - - - IntervalDialog - - - Change Update Period - שינוי טווח עדכון - - - - New Update Period - טווח עדכון חדש - - - - Cancel - ביטול - - - - OK - אישור - - - - No UPDATE - אין עדכון - - - - Invalid value - ערך שגוי - - - - ListModel - - - Event Category - - - - - Enable - הפעלה - - - - Maps - - - Address Range - טווח כתובות - - - - Mapped addresses (hex) ) - כתובות ממופות (הקס) - - - - Size - גודל - - - - Kbytes mapped (dec) - קילובתים ממופים (עשרוני) - - - - Perm - הרש׳ - - - - Permission flags - דגלוני הרשאה - - - - Offset - היסט - - - - File offset at start of mapping (hex) - היסט מהקובץ לתחילת המיפוי (הקס) - - - - Device - התקן - - - - Major,Minor device numbers (dec) - מספרי התקנים עיקריים, משניים (עשרוני) - - - - Inode - תא מפרק - - - - Inode number (dec) - - - - - File - קובץ - - - - File name (if available) - שם קובץ (אם יש) - - - - PermissionDialog - - - Permission - הרשאה - - - - Root password - ססמת משתמש על - - - - Cancel - ביטול - - - - OK - אישור - - - - Preferences - - - Preferences - העדפות - - - - Setting - הגדרות - - - - %CPU divided by - %מעבד לפי חלוקה של - - - - Total cpu: %1 - סך ניצולת מעבד: %1 - - - - Single cpu: 1 - מעבד יחיד: 1 - - - - default - בררת מחדל - - - - for developer - למפתח - - - - Appearance - מראה - - - - Proc - - - PID - מזהה תהליך - - - - Process ID - מזהה תהליך - - - - TGID - TGID - - - - Task group ID ( parent of threads ) - - - - - PPID - - - - - Parent process ID - - - - - PGID - - - - - Process group ID - - - - - SID - - - - - Session ID - - - - - TTY - TTY - - - - Terminal - מסוף - - - - TPGID - - - - - Process group ID of tty owner - - - - - USER - משתמש - - - - Owner (*=suid root, +=suid a user) - בעלות (‎*=suid root,‏ ‎+=suid a user) - - - - GROUP - קבוצה - - - - Group name (*=sgid other) - שם קבוצה ‎(*=sgid other) - - - - UID - - - - - Real user ID - - - - - EUID - - - - - Effective user ID - - - - - SUID - - - - - Saved user ID (Posix) - - - - - FSUID - - - - - File system user ID - - - - - GID - - - - - Real group ID - - - - - EGID - - - - - Effective group ID - - - - - SGID - - - - - Saved group ID (Posix) - - - - - FSGID - - - - - File system group ID - - - - - PRI - - - - - Dynamic priority - - - - - NICE - - - - - Scheduling favour (higher -> less cpu time) - - - - - NLWP - - - - - Number of tasks(threads) in task group - - - - - PLCY - - - - - Scheduling policy - - - - - RPRI - - - - - Realtime priority (0-99, more is better) - - - - - TMS - - - - - Time slice in milliseconds - - - - - %SAVG - - - - - Percentage average sleep time (-1 -> N/A) - - - - - CPUSET - - - - - Affinity CPU mask (0 -> API not supported) - - - - - MAJFLT - - - - - Number of major faults (disk access) - - - - - MINFLT - - - - - Number of minor faults (no disk access) - - - - - VSIZE - - - - - Virtual image size of process - - - - - RSS - - - - - Resident set size - - - - - MEM - - - - - memory usage (RSS-SHARE) - - - - - TRS - - - - - Text(code) resident set size - - - - - DRS - - - - - Data resident set size(malloc+global variable) - - - - - STACK - - - - - Stack size - - - - - SHARE - - - - - Shared memory with other libs - - - - - SWAP - - - - - Kbytes on swap device - - - - - IO_R - - - - - io read (file) - - - - - IO_W - - - - - io write (file) - - - - - DT - - - - - Number of dirty (non-written) pages - - - - - STAT - - - - - State of the process - - - - - FLAGS - - - - - Process flags (hex) - - - - - WCHAN - - - - - Kernel function where process is sleeping - - - - - %WCPU - - - - - Weighted percentage of CPU (30 s average) - - - - - %CPU - - - - - Percentage of CPU used since last update - - - - - %MEM - - - - - Percentage of memory used (RSS/total mem) - - - - - START - - - - - Time process started - - - - - TIME - - - - - Total CPU time used since start - - - - - CPU - מעבד - - - - CPU the process is executing on (SMP system) - המעבד עליו פועל התהליך (מערכת SMP) - - - - the process name - שם התהליך - - - - Process Name - שם התהליך - - - - CWD - CWD - - - - Current working directory - תיקיית העבודה הנוכחית - - - - ROOT - ROOT - - - - Root directory of process - תיקיית הבסיס של התהליך - - - - COMMAND_LINE - COMMAND_LINE - - - - Command line that started the process - שורת הפקודה שהפעילה את התהליך - - - - QObject - - - Show - הצגה - - - - Hide - הסתרה - - - - ScreenShot - צילום מסך - - - - Quit - יציאה - - - - Qps - - - header_popup - - - - - Remove Field - הסרת שדה - - - - Add Field - הוספת שדה - - - - Command - פקודה - - - - View - הצגה - - - - Process - תהליך - - - - Log - יומן - - - - Custom Fields - שדות בהתאמה אישית - - - - Basic Fields - שדות בסיסיים - - - - Jobs Fields - שדות משימות - - - - Memory Fields - שדות זיכרון - - - - Scheduling Fields - שדות תזמון - - - - Select Custom Fields... - בחירת שדות בהתאמה אישית… - - - - Option - אפשרות - - - - Update Period... - טווח עדכון… - - - - Show Status bar - הצגת סרגל מצב - - - - Preferences... - העדפות… - - - - Help - עזרה - - - - - About - על אודות - - - - Detail - פרט - - - - test - בדיקה - - - - Copied to Clipboard - הועתק ללוח גזירים - - - - context popup - - - - - Renice... - - - - - Scheduling... - תזמון… - - - - Terminate - חיסול - - - - Hangup - ניתוק - - - - Kill - הריגה - - - - Stop - עצירה - - - - Continue - המשך - - - - SIGINT (interrupt) - SIGINT (פסיקה) - - - - SIGCONT (continue) - SIGCONT (המשך) - - - - SIGSTOP (stop) - SIGSTOP (עצירה) - - - - SIGQUIT (quit) - SIGQUIT (יציאה) - - - - SIGILL (illegal instruction) - SIGILL (הנחייה בלתי חוקית) - - - - SIGABRT (abort) - SIGABRT (ביטול) - - - - SIGFPE (floating point exception) - SIGFPE (חריגת נקודה עשרונית) - - - - SIGSEGV (segmentation violation) - SIGSEGV (הפרת סגמנטציה) - - - - SIGPIPE (broken pipe) - - - - - SIGALRM (timer signal) - SIGALRM (אות תזמון) - - - - SIGUSR1 (user-defined 1) - SIGUSR1 (הגדרת משתמש 1) - - - - SIGUSR2 (user-defined 2) - SIGUSR2 (הגדרת משתמש 2) - - - - SIGCHLD (child death) - SIGCHLD (מות צאצא) - - - - SIGTSTP (stop from tty) - SIGTSTP (עצירה מ־tty) - - - - SIGTTIN (tty input) - SIGTTIN (קלט tty) - - - - SIGTTOU (tty output) - SIGTTOU (פלט tty) - - - - View Details - הצגת פרטים - - - - WatchDog - משגיח - - - - Edit Commands... - עריכת פקודות… - - - - Quit - יציאה - - - - - - - - - Permission denied - ההרשאה נדחתה - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - אין לך אפשרות לשנות nice של התהליכים הנבחרים. רק הבעלים ומשתמש העל מורשים לעשות זאת. - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - אין לך אפשרות לשנות nice לתהליך %1 (%2). רק הבעלים של התהליך ומשתמש העל מורשים לעשות זאת. - - - - Only the super-user may lower the nice value of a process. - רק משתמש העל יכול להוריד את ערך ה־nice של תהליך. - - - - Only the super-user may change the scheduling policy and static priority. - רק משתמש העל יכול לשנות את מדיניות התזמון ואת העדיפות הסטטית. - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - אין לך הרשאות לשנות את התזמון ו/או העדיפות של התהליך %1 (%2). רק משתמש העל יכול לעשות זאת. - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - אין לך הרשאות לשלוח אות לתהליך %1 (%2). רק משתמש העל והבעלים של התהליך יכולים לשלוח אליו אותות. - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - <h2> Qps %1 - מנהל תהליכים חזותי </h2> %2 משתמש בספריית Qt %3<br><br><b>מקור: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>עוקב תקלות: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - <b>ה־Qps המקורי נוצר על ידי</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>תורמים</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - - - - - SchedDialog - - - Change scheduling - החלפת תזמון - - - - Scheduling Policy - מדיניות תזמון - - - - SCHED_OTHER (time-sharing) - - - - - SCHED_FIFO (real-time) - - - - - SCHED_RR (real-time) - - - - - OK - אישור - - - - Cancel - ביטול - - - - Priority (1-99): - - - - - Invalid Input - - - - - The priority must be in the range 1..99 - - - - - Screenshot - - - /untitled. - - - - - Save As - שמירה בשם - - - - %1 Files (*.%2);;All Files (*) - קובצי %1 (‎*.%2);;כל הקבצים (*) - - - - Options - אפשרויות - - - - s - שנ׳ - - - - Screenshot Delay: - השהיית צילום מסך: - - - - Hide This Window - הסתרת החלון הזה - - - - New Screenshot - צילום מסך חדש - - - - Quit - יציאה - - - - SearchBox - - - PID,COMMAND,USER... - - - - - SliderDialog - - - Renice Process - - - - - New nice value: - - - - - Cancel - ביטול - - - - OK - אישור - - - - Sockets - - - Fd - - - - - File descriptor - - - - - Proto - פרוטו - - - - Protocol (TCP or UDP) - פרוטוקול (TCP או UDP) - - - - Recv-Q - תור נכנס - - - - Bytes in receive queue - בתים בתור הקבלה - - - - Send-Q - תור יוצא - - - - Bytes in send queue - בתים בתור השליחה - - - - Local Addr - כת׳ מקומית - - - - Local IP address - כתובת IP מקומית - - - - - Port - פתחה - - - - Local port - פתחה מקומית - - - - Remote Addr - כת׳ מרוחקת - - - - Remote IP address - כתובת IP מרוחקת - - - - Remote port - פתחה מרוחקת - - - - State - מצב - - - - Connection state - מצב החיבור - - - - StatusBar - - - Process count: %1 - - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - - - - - TFrame - - - this is Tframe widget - - - - - UFrame - - - title - - - - - WatchdogDialog - - - if process start - אם תהליך מתחיל - - - - if process finish - אם תהליך מסתיים - - - - select condition - בחירת תנאי - - - diff --git a/src/translations/qps_id.ts b/src/translations/qps_id.ts deleted file mode 100644 index 42f0f2e..0000000 --- a/src/translations/qps_id.ts +++ /dev/null @@ -1,1791 +0,0 @@ - - - - - AllFields - - - Field - Kolom - - - - Field name - Nama kolom - - - - Description - Deskripsi - - - - Field description - Deskripsi kolom - - - - Value - Nilai - - - - Field value - Nilai kolom - - - - Boxvar - - - Exit On Close Button - Keluar dari Tombol Tutup - - - - Host Name Lookup - Pencarian Nama Host - - - - Service Name Lookup - Pencarian Nama Layanan - - - - Disclosure Triangles - Disclosure Triangles - - - - Branch Lines - Branch Lines - - - - Auto Save Settings on Exit - Simpan Otomatis Pengaturan saat Keluar - - - - Selection: Copy PIDs to Clipboard - Pilihan: Salin PID ke Clipboard - - - - Normalize NICE - Normalisasi NICE - - - - Use pmap for Map Names - Gunakan pmap untuk Nama Map - - - - Cbgroup - - - General - Umum - - - - Command - - - The command: - - - Perintah: - - - - - - - -failed with the error: - - - - -gagal dengan kesalahan: - - - - - - Too many processes - Terlalu banyak proses - - - - Unknown error - Kesalahan tak dikenal - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - -tidak bisa dieksekusi karena tidak ditemukan, -atau anda tidak memiliki izin untuk mengeksekusi. - - - - - -exited with status - - -keluar dengan status - - - - Command Failed - Perintah gagal - - - - CommandDialog - - - Edit Commands 0.1 alpha - Edit Perintah 0.1 alpha - - - - Name: - Nama: - - - - Popup - Popup - - - - Command Line: - Baris Perintah: - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - - - - New... - Baru... - - - - - Add... - Tambah... - - - - Delete - Hapus - - - - Close - Tutup - - - - ControlBar - - - Linear - Linear - - - - Tree - Tree - - - - All Processes - Semua Proses - - - - Your Processes - Proses Anda - - - - Non-Root Processes - Proses Non-Root - - - - Running Processes - Proses Berjalan - - - - Pause (Ctrl+Space) - Jeda (Ctrl + Spasi) - - - - Details - - - Process %1 ( %2 ) - details - Proses %1 ( %2 ) - detail - - - - Files - Berkas - - - - Sockets - Soket - - - - Memory Maps - Peta Memori - - - - Environment - Lingkungan - - - - All Fields - Semua Kolom - - - - Environ - - - Variable - Variabel - - - - Variable name - Nama variabel - - - - Value - Nilai - - - - Variable value - Nilai variabel - - - - EventDialog - - - Watchdog 0.1 alpha - Watchdog 0.1 alfa - - - - Eventcat - Eventcat - - - - Select condition - Pilih kondisi - - - - labelDescrition - labelDescription - - - - Enable - Aktifkan - - - - process name - nama proses - - - - cpu - cpu - - - - % - % - - - - include already running process - termasuk proses yang sudah berjalan - - - - run command - jalankan perintah - - - - show Message - tampilkan Pesan - - - - Help (Not yet. just concept) - Bantuan (Belum ada. Hanya konsep) - - - - %p : pid -%c : command - %p : pid -%c : command - - - - New - Baru - - - - Add - Tambah - - - - Delete - Hapus - - - - Close - Tutup - - - - ExecWindow - - - Qps - Qps - - - - Ok - Ok - - - - Qps Watchdog - Qps Watchdog - - - - %1 exit with code %2 - %1 keluar dengan kode %2 - - - - Close - Tutup - - - - %1 [running] - %1 [berjalan] - - - - terminate command - mengakhiri perintah - - - - Error %1 : [%2] Maybe command not found - Kesalahan %1: [%2] Mungkin perintah tidak ditemukan - - - - FieldSelect - - - Select Custom Fields - Pilih Kolom Khusus - - - - Close - Tutup - - - - Files - - - Fd - Fd - - - - File descriptor - Deskriptor berkas - - - - Mode - Mode - - - - Open mode - Buka mode - - - - Name - Nama - - - - File name (if available) - Nama berkas (jika tersedia) - - - - IntervalDialog - - - Change Update Period - Ubah Periode Pembaruan - - - - New Update Period - Periode Pembaruan Baru - - - - Cancel - Batal - - - - OK - OK - - - - No UPDATE - Tak ada pemutakhiran - - - - Invalid value - Nilai tidak valid - - - - ListModel - - - Event Category - Kategori Event - - - - Enable - Aktifkan - - - - Maps - - - Address Range - Kisaran Alamat - - - - Mapped addresses (hex) ) - Alamat yang dipetakan (hex) ) - - - - Size - Ukuran - - - - Kbytes mapped (dec) - Kbytes dipetakan (dec) - - - - Perm - Perm - - - - Permission flags - Permission flags - - - - Offset - Offset - - - - File offset at start of mapping (hex) - Berkas offset pada awal pemetaan (hex) - - - - Device - Perangkat - - - - Major,Minor device numbers (dec) - Mayor,Minor nomor perangkat kecil (dec) - - - - Inode - Inode - - - - Inode number (dec) - Nomor inode (dec) - - - - File - Berkas - - - - File name (if available) - Nama berkas (jika tersedia) - - - - PermissionDialog - - - Permission - Izin - - - - Root password - Kata sandi Root - - - - Cancel - Batal - - - - OK - OK - - - - Preferences - - - Preferences - Pengaturan - - - - Setting - Pengaturan - - - - %CPU divided by - %CPU dibagi oleh - - - - Total cpu: %1 - Total cpu: %1 - - - - Single cpu: 1 - Single cpu: 1 - - - - default - baku - - - - for developer - untuk pengembang - - - - Appearance - Penampilan - - - - Proc - - - PID - PID - - - - Process ID - ID proses - - - - TGID - TGID - - - - Task group ID ( parent of threads ) - Task group ID ( parent of threads ) - - - - PPID - PPID - - - - Parent process ID - - - - - PGID - PGID - - - - Process group ID - ID grup proses - - - - SID - SID - - - - Session ID - ID sesi - - - - TTY - TTY - - - - Terminal - Terminal - - - - TPGID - TPGID - - - - Process group ID of tty owner - - - - - USER - - - - - Owner (*=suid root, +=suid a user) - - - - - GROUP - - - - - Group name (*=sgid other) - - - - - UID - - - - - Real user ID - - - - - EUID - - - - - Effective user ID - - - - - SUID - - - - - Saved user ID (Posix) - - - - - FSUID - - - - - File system user ID - - - - - GID - - - - - Real group ID - - - - - EGID - - - - - Effective group ID - - - - - SGID - - - - - Saved group ID (Posix) - - - - - FSGID - - - - - File system group ID - - - - - PRI - - - - - Dynamic priority - - - - - NICE - - - - - Scheduling favour (higher -> less cpu time) - - - - - NLWP - - - - - Number of tasks(threads) in task group - - - - - PLCY - - - - - Scheduling policy - - - - - RPRI - - - - - Realtime priority (0-99, more is better) - - - - - TMS - - - - - Time slice in milliseconds - - - - - %SAVG - - - - - Percentage average sleep time (-1 -> N/A) - - - - - CPUSET - - - - - Affinity CPU mask (0 -> API not supported) - - - - - MAJFLT - - - - - Number of major faults (disk access) - - - - - MINFLT - - - - - Number of minor faults (no disk access) - - - - - VSIZE - - - - - Virtual image size of process - - - - - RSS - - - - - Resident set size - - - - - MEM - - - - - memory usage (RSS-SHARE) - - - - - TRS - - - - - Text(code) resident set size - - - - - DRS - - - - - Data resident set size(malloc+global variable) - - - - - STACK - - - - - Stack size - - - - - SHARE - - - - - Shared memory with other libs - - - - - SWAP - - - - - Kbytes on swap device - - - - - IO_R - - - - - io read (file) - - - - - IO_W - - - - - io write (file) - - - - - DT - - - - - Number of dirty (non-written) pages - - - - - STAT - - - - - State of the process - - - - - FLAGS - - - - - Process flags (hex) - - - - - WCHAN - - - - - Kernel function where process is sleeping - - - - - %WCPU - - - - - Weighted percentage of CPU (30 s average) - - - - - %CPU - - - - - Percentage of CPU used since last update - - - - - %MEM - - - - - Percentage of memory used (RSS/total mem) - - - - - START - - - - - Time process started - - - - - TIME - - - - - Total CPU time used since start - - - - - CPU - - - - - CPU the process is executing on (SMP system) - - - - - the process name - - - - - Process Name - - - - - CWD - - - - - Current working directory - - - - - ROOT - - - - - Root directory of process - - - - - COMMAND_LINE - - - - - Command line that started the process - - - - - QObject - - - Show - - - - - Hide - - - - - ScreenShot - - - - - Quit - - - - - Qps - - - header_popup - - - - - Remove Field - - - - - Add Field - - - - - Command - - - - - View - - - - - Process - - - - - Log - - - - - Custom Fields - - - - - Basic Fields - - - - - Jobs Fields - - - - - Memory Fields - - - - - Scheduling Fields - - - - - Select Custom Fields... - - - - - Option - - - - - Update Period... - - - - - Show Status bar - - - - - Preferences... - - - - - Help - - - - - - About - - - - - Detail - - - - - test - - - - - Copied to Clipboard - - - - - context popup - - - - - Renice... - - - - - Scheduling... - - - - - Terminate - - - - - Hangup - - - - - Kill - - - - - Stop - - - - - Continue - - - - - SIGINT (interrupt) - - - - - SIGCONT (continue) - - - - - SIGSTOP (stop) - - - - - SIGQUIT (quit) - - - - - SIGILL (illegal instruction) - - - - - SIGABRT (abort) - - - - - SIGFPE (floating point exception) - - - - - SIGSEGV (segmentation violation) - - - - - SIGPIPE (broken pipe) - - - - - SIGALRM (timer signal) - - - - - SIGUSR1 (user-defined 1) - - - - - SIGUSR2 (user-defined 2) - - - - - SIGCHLD (child death) - - - - - SIGTSTP (stop from tty) - - - - - SIGTTIN (tty input) - - - - - SIGTTOU (tty output) - - - - - View Details - - - - - WatchDog - - - - - Edit Commands... - - - - - Quit - - - - - - - - - - Permission denied - - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - - - - - Only the super-user may lower the nice value of a process. - - - - - Only the super-user may change the scheduling policy and static priority. - - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - - - - - SchedDialog - - - Change scheduling - - - - - Scheduling Policy - - - - - SCHED_OTHER (time-sharing) - - - - - SCHED_FIFO (real-time) - - - - - SCHED_RR (real-time) - - - - - OK - - - - - Cancel - - - - - Priority (1-99): - - - - - Invalid Input - - - - - The priority must be in the range 1..99 - - - - - Screenshot - - - /untitled. - - - - - Save As - - - - - %1 Files (*.%2);;All Files (*) - - - - - Options - - - - - s - - - - - Screenshot Delay: - - - - - Hide This Window - - - - - New Screenshot - - - - - Quit - - - - - SearchBox - - - PID,COMMAND,USER... - - - - - SliderDialog - - - Renice Process - - - - - New nice value: - - - - - Cancel - - - - - OK - - - - - Sockets - - - Fd - - - - - File descriptor - - - - - Proto - - - - - Protocol (TCP or UDP) - - - - - Recv-Q - - - - - Bytes in receive queue - - - - - Send-Q - - - - - Bytes in send queue - - - - - Local Addr - - - - - Local IP address - - - - - - Port - - - - - Local port - - - - - Remote Addr - - - - - Remote IP address - - - - - Remote port - - - - - State - - - - - Connection state - - - - - StatusBar - - - Process count: %1 - - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - - - - - TFrame - - - this is Tframe widget - - - - - UFrame - - - title - - - - - WatchdogDialog - - - if process start - - - - - if process finish - - - - - select condition - - - - diff --git a/src/translations/qps_lt.ts b/src/translations/qps_lt.ts deleted file mode 100644 index 1563c0e..0000000 --- a/src/translations/qps_lt.ts +++ /dev/null @@ -1,1792 +0,0 @@ - - - - - AllFields - - - Field - Laukas - - - - Field name - Lauko pavadinimas - - - - Description - Aprašas - - - - Field description - Lauko aprašas - - - - Value - Reikšmė - - - - Field value - Lauko reikšmė - - - - Boxvar - - - Exit On Close Button - Išeiti, užvėrus langą - - - - Host Name Lookup - Serverių vardų paieška - - - - Service Name Lookup - Tarnybų pavadinimų paieška - - - - Disclosure Triangles - Trikampių atskleidimas - - - - Branch Lines - Atšakų linijos - - - - Auto Save Settings on Exit - Išeinant, automatiškai įrašyti nustatymus - - - - Selection: Copy PIDs to Clipboard - Žymėjimas: Kopijuoti PID į iškarpinę - - - - Normalize NICE - Normalizuoti "NICE" - - - - Use pmap for Map Names - Planų pavadinimams naudoti pmap - - - - Cbgroup - - - General - Bendra - - - - Command - - - The command: - - - Komanda: - - - - - - - -failed with the error: - - - - -patyrė nesėkmę su klaida: - - - - - - Too many processes - Per daug procesų - - - - Unknown error - Nežinoma klaida - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - -nepavyko įvykdyti, nes ji nebuvo rasta, -arba jūs neturite leidimo jos vykdyti. - - - - - -exited with status - - -išėjo su būsena - - - - Command Failed - Komanda nepavyko - - - - CommandDialog - - - Edit Commands 0.1 alpha - Taisyti komandas 0.1 alfa - - - - Name: - Pavadinimas: - - - - Popup - Iškylantysis langas - - - - Command Line: - Komandų eilutė: - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - Pakaitalai: -%p PID -%c KOMANDA -%C KOMANDŲ EILUTĖ -%u NAUDOTOJAS -%% % - - - - - - New... - Nauja... - - - - - Add... - Pridėti... - - - - Delete - Ištrinti - - - - Close - Užverti - - - - ControlBar - - - Linear - Linijinis - - - - Tree - Medis - - - - All Processes - Visi procesai - - - - Your Processes - Jūsų procesai - - - - Non-Root Processes - Ne šaknies procesai - - - - Running Processes - Vykdomi procesai - - - - Pause (Ctrl+Space) - Pristabdyti (Ctrl(Vald)+Tarpas) - - - - Details - - - Process %1 ( %2 ) - details - Procesas %1 ( %2 ) - išsamiau - - - - Files - Failai - - - - Sockets - Lizdai - - - - Memory Maps - Atminties schemos - - - - Environment - Aplinka - - - - All Fields - Visi laukai - - - - Environ - - - Variable - Kintamasis - - - - Variable name - Kintamojo pavadinimas - - - - Value - Reikšmė - - - - Variable value - Kintamojo reikšmė - - - - EventDialog - - - Watchdog 0.1 alpha - - - - - Eventcat - - - - - Select condition - Pasirinkti sąlygą - - - - labelDescrition - Aprašas - - - - Enable - Įjungti - - - - process name - proceso pavadinimas - - - - cpu - procesorius - - - - % - - - - - include already running process - įtraukti jau vykdomą procesą - - - - run command - vykdyti komandą - - - - show Message - rodyti pranešimą - - - - Help (Not yet. just concept) - Žinynas (Kol kas nėra. Tik koncepcija) - - - - %p : pid -%c : command - %p : pid -%c : komanda - - - - New - Naujas - - - - Add - Pridėti - - - - Delete - Ištrinti - - - - Close - Užverti - - - - ExecWindow - - - Qps - - - - - Ok - Gerai - - - - Qps Watchdog - Qps kontrolierius - - - - %1 exit with code %2 - %1 išėjo su kodu %2 - - - - Close - Užverti - - - - %1 [running] - %1 [vykdoma] - - - - terminate command - baigti komandą - - - - Error %1 : [%2] Maybe command not found - Klaida %1 : [%2] Galbūt, komanda nerasta - - - - FieldSelect - - - Select Custom Fields - Pasirinkti tinkintus laukus - - - - Close - Užverti - - - - Files - - - Fd - Fd - - - - File descriptor - Failo deskriptorius - - - - Mode - Veiksena - - - - Open mode - Atvėrimo veiksena - - - - Name - Pavadinimas - - - - File name (if available) - Failo pavadinimas (jei prieinama) - - - - IntervalDialog - - - Change Update Period - Keisti atnaujinimo intervalą - - - - New Update Period - Naujas atnaujinimo intervalas - - - - Cancel - Atsisakyti - - - - OK - Gerai - - - - No UPDATE - Jokio ATNAUJINIMO - - - - Invalid value - Neteisinga reikšmė - - - - ListModel - - - Event Category - Įvykio kategorija - - - - Enable - Įjungti - - - - Maps - - - Address Range - Adresų rėžis - - - - Mapped addresses (hex) ) - Atvaizduojami adresai (šešiolikt.) - - - - Size - Dydis - - - - Kbytes mapped (dec) - Atvaizduojama kilobaitų (dešimt.) - - - - Perm - Leid. - - - - Permission flags - Leidimų vėliavėlės - - - - Offset - Poslinkis - - - - File offset at start of mapping (hex) - Failo poslinkis atvaizdavimo pradžioje (šešiolikt.) - - - - Device - Įrenginys - - - - Major,Minor device numbers (dec) - Pagrindinio, šalutinio įrenginio numeriai (dešimt.) - - - - Inode - Inode - - - - Inode number (dec) - Inode numeris (dešimt.) - - - - File - Failas - - - - File name (if available) - Failo pavadinimas (jei prieinama) - - - - PermissionDialog - - - Permission - Leidimas - - - - Root password - Šaknies slaptažodis - - - - Cancel - Atsisakyti - - - - OK - Gerai - - - - Preferences - - - Preferences - Nuostatos - - - - Setting - Nustatymas - - - - %CPU divided by - %CPU padalintas iš - - - - Total cpu: %1 - Iš viso procesorių: %1 - - - - Single cpu: 1 - Vienas procesorius: 1 - - - - default - numatytasis - - - - for developer - kūrėjui - - - - Appearance - Išvaizda - - - - Proc - - - PID - PID - - - - Process ID - Proceso ID - - - - TGID - TGID - - - - Task group ID ( parent of threads ) - Užduočių grupės ID (gijų pirminio) - - - - PPID - PPID - - - - Parent process ID - Pirminio proceso ID - - - - PGID - PGID - - - - Process group ID - Proceso grupės ID - - - - SID - SID - - - - Session ID - Seanso ID - - - - TTY - TTY - - - - Terminal - Terminalas - - - - TPGID - TPGID - - - - Process group ID of tty owner - TTY savininko proceso grupės ID - - - - USER - NAUDOTOJAS - - - - Owner (*=suid root, +=suid a user) - Savininkas (*=suid šaknis, +=suid naudotojas) - - - - GROUP - GRUPĖ - - - - Group name (*=sgid other) - Grupės pavadinimas (*=sgid kita) - - - - UID - UID - - - - Real user ID - Tikrasis naudotojo ID - - - - EUID - EUID - - - - Effective user ID - Efektyvusis naudotojo ID - - - - SUID - SUID - - - - Saved user ID (Posix) - Įrašytas naudotojo ID (Posix) - - - - FSUID - FSUID - - - - File system user ID - Failų sistemos naudotojo ID - - - - GID - GID - - - - Real group ID - Tikrasis grupės ID - - - - EGID - EGID - - - - Effective group ID - Efektyvusis grupės ID - - - - SGID - SGID - - - - Saved group ID (Posix) - Įrašytas grupės ID (Posix) - - - - FSGID - FSGID - - - - File system group ID - Failų sistemos grupės ID - - - - PRI - PRI - - - - Dynamic priority - Dinaminė pirmenybė - - - - NICE - NICE - - - - Scheduling favour (higher -> less cpu time) - Planavimo palankumas (didesnis -> mažesnis apdorojimo laikas) - - - - NLWP - NLWP - - - - Number of tasks(threads) in task group - Užduočių (gijų) skaičius užduočių grupėje - - - - PLCY - PLCY - - - - Scheduling policy - Planavimo politika - - - - RPRI - RPRI - - - - Realtime priority (0-99, more is better) - Tikralaikė pirmenybė (0-99, daugiau yra geriau) - - - - TMS - TMS - - - - Time slice in milliseconds - Laiko tarpas, milisekundėmis - - - - %SAVG - %SAVG - - - - Percentage average sleep time (-1 -> N/A) - Vidutinio miego laiko procentinė dalis (-1 -> Nėra) - - - - CPUSET - CPUSET - - - - Affinity CPU mask (0 -> API not supported) - Procesoriaus atitikimo kaukė (0 -> API nepalaikomas) - - - - MAJFLT - MAJFLT - - - - Number of major faults (disk access) - Stambių klaidų skaičius (disko prieiga) - - - - MINFLT - MINFLT - - - - Number of minor faults (no disk access) - Nežymių klaidų skaičius (jokios disko prieigos) - - - - VSIZE - VSIZE - - - - Virtual image size of process - Proceso virtualaus atvaizdžio dydis - - - - RSS - RSS - - - - Resident set size - Rezidentinio rinkinio dydis - - - - MEM - MEM - - - - memory usage (RSS-SHARE) - atminties naudojimas (RSS-SHARE) - - - - TRS - TRS - - - - Text(code) resident set size - Teksto (kodo) rezidentinio rinkinio dydis - - - - DRS - DRS - - - - Data resident set size(malloc+global variable) - Duomenų rezidentinio rinkinio dydis (malloc+visuotinis kintamasis) - - - - STACK - STACK - - - - Stack size - Dėklo dydis - - - - SHARE - SHARE - - - - Shared memory with other libs - Bendrinama atmintis su kitomis bibliotekomis - - - - SWAP - SWAP - - - - Kbytes on swap device - Kilobaitų sukeitimų įrenginyje - - - - IO_R - IO_R - - - - io read (file) - io skaitymas (failai) - - - - IO_W - IO_W - - - - io write (file) - io rašymas (failai) - - - - DT - DT - - - - Number of dirty (non-written) pages - "Nešvarių" (neįrašytų) puslapių skaičius - - - - STAT - STAT - - - - State of the process - Proceso būsena - - - - FLAGS - VĖLIAVĖLĖS - - - - Process flags (hex) - Proceso vėliavėlės (šešiolikt.) - - - - WCHAN - WCHAN - - - - Kernel function where process is sleeping - Branduolio funkcija, kurioje miega procesas - - - - %WCPU - %WCPU - - - - Weighted percentage of CPU (30 s average) - Svertinė procesoriaus procentinė dalis (30 sek. vidurkis) - - - - %CPU - %CPU - - - - Percentage of CPU used since last update - Procesoriaus procentinė dalis, naudota nuo paskutinio atnaujinimo - - - - %MEM - %MEM - - - - Percentage of memory used (RSS/total mem) - Naudotos atminties procentinė dalis (RSS/viso atminties) - - - - START - PRADŽIA - - - - Time process started - Laikas, kai procesas buvo paleistas - - - - TIME - LAIKAS - - - - Total CPU time used since start - Bendras procesoriaus laikas, naudotas nuo paleidimo - - - - CPU - Procesorius - - - - CPU the process is executing on (SMP system) - Procesorius, kuriame yra vykdomas procesas (SMP sistemose) - - - - the process name - proceso pavadinimas - - - - Process Name - Proceso pavadinimas - - - - CWD - CWD - - - - Current working directory - Esamas darbinis katalogas - - - - ROOT - ŠAKNIS - - - - Root directory of process - Proceso šaknies katalogas - - - - COMMAND_LINE - KOMANDŲ EILUTĖ - - - - Command line that started the process - Komandų eilutė, kuri paleido procesą - - - - QObject - - - Show - Rodyti - - - - Hide - Slėpti - - - - ScreenShot - Ekrano kopija - - - - Quit - Išeiti - - - - Qps - - - header_popup - header_popup - - - - Remove Field - Šalinti lauką - - - - Add Field - Pridėti lauką - - - - Command - Komanda - - - - View - Rodinys - - - - Process - Procesas - - - - Log - Žurnalas - - - - Custom Fields - Tinkinti laukai - - - - Basic Fields - Pagrindiniai laukai - - - - Jobs Fields - Užduočių laukai - - - - Memory Fields - Atminties laukai - - - - Scheduling Fields - Planavimo laukai - - - - Select Custom Fields... - Pasirinkti tinkintus laukus... - - - - Option - Parinktis - - - - Update Period... - Atnaujinimo intervalas... - - - - Show Status bar - Rodyti būsenos juostą - - - - Preferences... - Nuostatos... - - - - Help - Žinynas - - - - - About - Apie - - - - Detail - Išsamiau - - - - test - išbandyti - - - - Copied to Clipboard - Nukopijuota į iškarpinę - - - - context popup - iškylantysis kontekstinis langas - - - - Renice... - Iš naujo nustatyti "nice"... - - - - Scheduling... - Planavimas... - - - - Terminate - Baigti - - - - Hangup - Užstrigdinti - - - - Kill - Nutraukti - - - - Stop - Stabdyti - - - - Continue - Tęsti - - - - SIGINT (interrupt) - SIGINT (pertraukti) - - - - SIGCONT (continue) - SIGCONT (tęsti) - - - - SIGSTOP (stop) - SIGSTOP (stabdyti) - - - - SIGQUIT (quit) - SIGQUIT (išeiti) - - - - SIGILL (illegal instruction) - SIGILL (neleidžiamoji komanda) - - - - SIGABRT (abort) - SIGABRT (nutraukti) - - - - SIGFPE (floating point exception) - SIGFPE (slankiojo kablelio išimtis) - - - - SIGSEGV (segmentation violation) - SIGSEGV (segmentavimo pažeidimas) - - - - SIGPIPE (broken pipe) - SIGPIPE (neveikiantis kanalas) - - - - SIGALRM (timer signal) - SIGALRM (laikmačio signalas) - - - - SIGUSR1 (user-defined 1) - SIGUSR1 (naudotojo apibrėžtas 1) - - - - SIGUSR2 (user-defined 2) - SIGUSR2 (naudotojo apibrėžtas 2) - - - - SIGCHLD (child death) - SIGCHLD (vyksnio mirtis) - - - - SIGTSTP (stop from tty) - SIGTSTP (stabdyti iš tty) - - - - SIGTTIN (tty input) - SIGTTIN (tty įvestis) - - - - SIGTTOU (tty output) - SIGTTOU (tty išvestis) - - - - View Details - Rodyti išsamiau - - - - WatchDog - Kontrolierius - - - - Edit Commands... - Taisyti komandas... - - - - Quit - Išeiti - - - - - - - - - Permission denied - Leidimas atmestas - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - Jūs neturite leidimo iš naujo nustatyti pažymėtų procesų "nice" reikšmę. Tai leidžiama daryti tik proceso savininkui ir supernaudotojui. - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - Jūs neturite leidimo iš naujo nustatyti proceso %1 (%2) "nice" reikšmę. Tai leidžiama daryti tik proceso savininkui ir supernaudotojui. - - - - Only the super-user may lower the nice value of a process. - Tik supernaudotojas gali mažinti proceso "nice" reikšmę. - - - - Only the super-user may change the scheduling policy and static priority. - Tik supernaudotojas gali keisti planavimo politiką ir statinę pirmenybę. - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - Jūs neturite leidimo keisti proceso %1 (%2) planavimą ir/ar pirmenybę. Tai gali daryti tik supernaudotojas. - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - Jūs neturite leidimo siųsti signalą procesui %1 (%2). Tik supernaudotojas ir proceso savininkas gali siųsti jam signalus. - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - <h2> Qps %1 - Vaizdinė procesų tvarkytuvė </h2> %2 naudoja Qt biblioteką %3<br><br><b>Šaltinis: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Klaidų seklys: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - <b>Pradinė Qps pagal</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Talkininkai</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - <H1>QPS žinynas</H1>Atnaujintas: 2005 gegužės 24<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Išeiti </td> <td >&nbsp; CTRL(VALD) + q , CTRL(VALD) + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Atnaujinti </td> <td>&nbsp;Tarpas , Enter(Įvedimas) </td> </tr> <tr><td> Baigti procesą </td> <td> ALT + T , DELETE(Naik) </td> </tr> <tr><td> Nutraukti procesą </td> <td> ALT + K </td> </tr> </tbody></table> - - - - SchedDialog - - - Change scheduling - Keisti planavimą - - - - Scheduling Policy - Planavimo politika - - - - SCHED_OTHER (time-sharing) - SCHED_OTHER (laiko paskirstymo) - - - - SCHED_FIFO (real-time) - SCHED_FIFO (tikralaikė) - - - - SCHED_RR (real-time) - SCHED_RR (tikralaikė) - - - - OK - Gerai - - - - Cancel - Atsisakyti - - - - Priority (1-99): - Pirmenybė (1-99): - - - - Invalid Input - Neteisinga įvestis - - - - The priority must be in the range 1..99 - Pirmenybė privalo būti rėžyje 1..99 - - - - Screenshot - - - /untitled. - /be_pavadinimo. - - - - Save As - Įrašyti kaip - - - - %1 Files (*.%2);;All Files (*) - %1 failai (*.%2);;Visi failai (*) - - - - Options - Parinktys - - - - s - sek. - - - - Screenshot Delay: - Ekrano kopijos delsa: - - - - Hide This Window - Slėpti šį langą - - - - New Screenshot - Nauja ekrano kopija - - - - Quit - Išeiti - - - - SearchBox - - - PID,COMMAND,USER... - PID,KOMANDA,NAUDOTOJAS... - - - - SliderDialog - - - Renice Process - Iš naujo nustatyti procesui "nice" reikšmę - - - - New nice value: - Nauja "nice" reikšmė: - - - - Cancel - Atsisakyti - - - - OK - Gerai - - - - Sockets - - - Fd - Fd - - - - File descriptor - Failo deskriptorius - - - - Proto - Protokolas - - - - Protocol (TCP or UDP) - Protokolas (TCP ar UDP) - - - - Recv-Q - Gavimo eilė - - - - Bytes in receive queue - Baitai gavimo eilėje - - - - Send-Q - Siuntimo eilė - - - - Bytes in send queue - Baitai siuntimo eilėje - - - - Local Addr - Vietinis adresas - - - - Local IP address - Vietinis IP adresas - - - - - Port - Prievadas - - - - Local port - Vietinis prievadas - - - - Remote Addr - Nuotolinis adresas - - - - Remote IP address - Nuotolinis IP adresas - - - - Remote port - Nuotolinis prievadas - - - - State - Būsena - - - - Connection state - Ryšio būsena - - - - StatusBar - - - Process count: %1 - Procesų skaičius: %1 - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - Tai yra nestabili Alfa ypatybė - Galite pamatyti SEGFAULT... - - - - TFrame - - - this is Tframe widget - tai yra Tframe valdiklis - - - - UFrame - - - title - pavadinimas - - - - WatchdogDialog - - - if process start - jei procesas prasidėjo - - - - if process finish - jei procesas pasibaigė - - - - select condition - pasirinkite sąlygą - - - diff --git a/src/translations/qps_nb_NO.ts b/src/translations/qps_nb_NO.ts deleted file mode 100644 index dd1a111..0000000 --- a/src/translations/qps_nb_NO.ts +++ /dev/null @@ -1,1792 +0,0 @@ - - - - - AllFields - - - Field - Felt - - - - Field name - Feltnavn - - - - Description - Beskrivelse - - - - Field description - Feltbeskrivelse - - - - Value - Verdi - - - - Field value - Feltverdi - - - - Boxvar - - - Exit On Close Button - Avslutt ved lukkeknapp - - - - Host Name Lookup - Oppslåelse av vertsnavn - - - - Service Name Lookup - Oppslåelse av servicenavn - - - - Disclosure Triangles - Avsløringstrekanter - - - - Branch Lines - Grenlinjer - - - - Auto Save Settings on Exit - Autolagre innstillinger ved avslutning - - - - Selection: Copy PIDs to Clipboard - Markering: Kopier PIDer til utklippsboken - - - - Normalize NICE - Normaliser prioritering - - - - Use pmap for Map Names - Bruk pmap til kartnavn - - - - Cbgroup - - - General - Generelt - - - - Command - - - The command: - - - Kommandoen: - - - - - - - -failed with the error: - - - - -mislyktes med feilen: - - - - - - Too many processes - For mange prosesser - - - - Unknown error - Ukjent feil - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - -kunne ikke utføres fordi den ikke ble funnet -eller du ikke hadde tillatelse til å kjøre den. - - - - - -exited with status - - -avsluttet med status - - - - Command Failed - Kommandoen mislyktes - - - - CommandDialog - - - Edit Commands 0.1 alpha - Rediger kommandoer 0,1 alfa - - - - Name: - Navn: - - - - Popup - Sprettopp - - - - Command Line: - Kommandolinje: - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - Erstatninger: -%p PID -%c KOMMANDO -%C KOMMANDOLINJE -%u BRUKER -%% % - - - - - - New... - Ny... - - - - - Add... - Legg til... - - - - Delete - Slett - - - - Close - Lukk - - - - ControlBar - - - Linear - Lineær - - - - Tree - Tre - - - - All Processes - Alle prosesser - - - - Your Processes - Dine prosesser - - - - Non-Root Processes - Ikke-rot-prosesser - - - - Running Processes - Kjørende prosesser - - - - Pause (Ctrl+Space) - Pause (Ctrl+Mellomrom) - - - - Details - - - Process %1 ( %2 ) - details - Prosess %1 ( %2 ) - detaljer - - - - Files - Filer - - - - Sockets - Sokler - - - - Memory Maps - Hukommelseskart - - - - Environment - Miljø - - - - All Fields - Alle felt - - - - Environ - - - Variable - Variabel - - - - Variable name - Variabelnavn - - - - Value - Verdi - - - - Variable value - Variabelnavn - - - - EventDialog - - - Watchdog 0.1 alpha - Vaktbikkje 0.1 alfa - - - - Eventcat - - - - - Select condition - Velg betingelse - - - - labelDescrition - etikettbeskrivelse - - - - Enable - Aktiver - - - - process name - prosessnavn - - - - cpu - - - - - % - - - - - include already running process - inkluder allerede kjørende prosess - - - - run command - kjør kommando - - - - show Message - vis beskjed - - - - Help (Not yet. just concept) - Hjelp (foreløpig bare et konsept) - - - - %p : pid -%c : command - %p : pid -%c : kommando - - - - New - Ny - - - - Add - Legg til - - - - Delete - Slett - - - - Close - Lukk - - - - ExecWindow - - - Qps - - - - - Ok - Okei - - - - Qps Watchdog - Qps-vaktbikkje - - - - %1 exit with code %2 - %1 avsluttet med koden %2 - - - - Close - Lukk - - - - %1 [running] - %1 [kjører] - - - - terminate command - avslutt kommando - - - - Error %1 : [%2] Maybe command not found - Feil %1 : [%2] Kanskje finnes kommandoen ikke - - - - FieldSelect - - - Select Custom Fields - Velg tilpassede felter - - - - Close - Lukk - - - - Files - - - Fd - Fb - - - - File descriptor - Filbeskrivelse - - - - Mode - Modus - - - - Open mode - Åpen modus - - - - Name - Navn - - - - File name (if available) - Filnavn (hvis tilgjengelig) - - - - IntervalDialog - - - Change Update Period - Skift oppdateringsperiode - - - - New Update Period - Ny oppdateringsperiode - - - - Cancel - Avbryt - - - - OK - Okei - - - - No UPDATE - Ingen oppdatering - - - - Invalid value - Ugyldig verdi - - - - ListModel - - - Event Category - Begivenhetskategori - - - - Enable - Aktiver - - - - Maps - - - Address Range - Adresseområde - - - - Mapped addresses (hex) ) - Kartlagte addresser (hex) ) - - - - Size - Størrelse - - - - Kbytes mapped (dec) - kByte kartlagt (dec) - - - - Perm - Till - - - - Permission flags - Tillatelsesflagg - - - - Offset - Forskyving - - - - File offset at start of mapping (hex) - Filforskyving ved begynnelse av kartlegging (hex) - - - - Device - Enhet - - - - Major,Minor device numbers (dec) - Store,små enhetsnummer (dec) - - - - Inode - - - - - Inode number (dec) - Inode-nummer (dec) - - - - File - Fil - - - - File name (if available) - Filnavn (hvis tilgjengelig) - - - - PermissionDialog - - - Permission - Tillatelse - - - - Root password - Rot-passord - - - - Cancel - Avbryt - - - - OK - Okei - - - - Preferences - - - Preferences - Valg - - - - Setting - Innstilling - - - - %CPU divided by - %CPU delt på - - - - Total cpu: %1 - Samlet cpu: %1 - - - - Single cpu: 1 - Enkel cpu: 1 - - - - default - forvalgt - - - - for developer - for utvikler - - - - Appearance - Utseende - - - - Proc - - - PID - - - - - Process ID - Prosess-ID - - - - TGID - OGID - - - - Task group ID ( parent of threads ) - Oppgavens gruppe ID ( foreldre til tråder ) - - - - PPID - FPID - - - - Parent process ID - Forelderens prosess-ID - - - - PGID - - - - - Process group ID - Prosessens gruppe-ID - - - - SID - - - - - Session ID - Sesjon-ID - - - - TTY - - - - - Terminal - - - - - TPGID - - - - - Process group ID of tty owner - Prosessens gruppe-ID av tty-eier - - - - USER - BRUKER - - - - Owner (*=suid root, +=suid a user) - Eier (*=suid rot, +=suid en bruker) - - - - GROUP - GRUPPE - - - - Group name (*=sgid other) - Gruppenavn (*=sgid annet) - - - - UID - BID - - - - Real user ID - Virkelig bruker-ID - - - - EUID - EBID - - - - Effective user ID - Effektiv bruker-ID - - - - SUID - LBID - - - - Saved user ID (Posix) - Lagret bruker-ID (Posix) - - - - FSUID - FSBID - - - - File system user ID - Filsystemets bruker-ID - - - - GID - - - - - Real group ID - Virkelig gruppe-ID - - - - EGID - - - - - Effective group ID - Effektiv gruppe-ID - - - - SGID - LGID - - - - Saved group ID (Posix) - Lagret gruppe-ID (Posix) - - - - FSGID - - - - - File system group ID - Filsystemets gruppe-ID - - - - PRI - - - - - Dynamic priority - Dynamisk prioritet - - - - NICE - - - - - Scheduling favour (higher -> less cpu time) - Planleggingsfavør (større -> mindre cpu-tid) - - - - NLWP - - - - - Number of tasks(threads) in task group - Antallet oppgaver (tråder) i oppgavegruppe - - - - PLCY - PLTK - - - - Scheduling policy - Planleggingspolitikk - - - - RPRI - - - - - Realtime priority (0-99, more is better) - Realtidsprioritet (0-99, mer er bedre) - - - - TMS - - - - - Time slice in milliseconds - Tidsskive i millisekunder - - - - %SAVG - %GST - - - - Percentage average sleep time (-1 -> N/A) - Prosent gjennomsnittlig søvntid (-1 -> ikke relevant) - - - - CPUSET - - - - - Affinity CPU mask (0 -> API not supported) - Affinitet CPU-maske (0 -> API støttes ikke) - - - - MAJFLT - STØFIL - - - - Number of major faults (disk access) - Antall større feil (disktilgang) - - - - MINFLT - MINFIL - - - - Number of minor faults (no disk access) - Antall mindre feil (disktilgang) - - - - VSIZE - VSTØR - - - - Virtual image size of process - Virtuelt avtrykksstørrelse for prosess - - - - RSS - - - - - Resident set size - Resident set-størrelse - - - - MEM - HUK - - - - memory usage (RSS-SHARE) - hukommelsesbruk (RSS-DELING) - - - - TRS - - - - - Text(code) resident set size - Tekst (kode) resident set-størrelse - - - - DRS - - - - - Data resident set size(malloc+global variable) - Data resident set-størrelse (malloc+global variabel) - - - - STACK - STAK - - - - Stack size - Stakstørrelse - - - - SHARE - DELT - - - - Shared memory with other libs - Delt hukommelse med andre bibliotek - - - - SWAP - - - - - Kbytes on swap device - kByte på swap-enhet - - - - IO_R - IO_L - - - - io read (file) - io-les (fil) - - - - IO_W - IO_S - - - - io write (file) - io-skriv (fil) - - - - DT - SS - - - - Number of dirty (non-written) pages - Antall skitne (ikke skrevne) sider - - - - STAT - - - - - State of the process - Prosessens tilstand - - - - FLAGS - FLAG - - - - Process flags (hex) - Prosessflagg (hex) - - - - WCHAN - WKAN - - - - Kernel function where process is sleeping - Kjernefunksjon hvor prosessen sover - - - - %WCPU - %VCPU - - - - Weighted percentage of CPU (30 s average) - Vektet prosent av CPU (30 s gjennomsnitt) - - - - %CPU - - - - - Percentage of CPU used since last update - Prosent av CPU brukt siden siste oppdatering - - - - %MEM - %HUK - - - - Percentage of memory used (RSS/total mem) - Prosent av hukommelsen brukt (RSS/total hukommelse) - - - - START - - - - - Time process started - Tidspunkt prosessen startet - - - - TIME - TID - - - - Total CPU time used since start - Total CPU-tid brukt siden starten - - - - CPU - - - - - CPU the process is executing on (SMP system) - CPU prosessen kjører på (SMP-system) - - - - the process name - prosessens navn - - - - Process Name - Prosessnavn - - - - CWD - NAM - - - - Current working directory - Nåværende arbeidsmappe - - - - ROOT - ROT - - - - Root directory of process - Rotmappen for prosessen - - - - COMMAND_LINE - KOMMANDOLINJE - - - - Command line that started the process - Kommandolinje som startet prosessen - - - - QObject - - - Show - Vis - - - - Hide - Skjul - - - - ScreenShot - Skjermbilde - - - - Quit - Avslutt - - - - Qps - - - header_popup - header_sprettopp - - - - Remove Field - Fjern felt - - - - Add Field - Legg til felt - - - - Command - Kommando - - - - View - Visning - - - - Process - Prosess - - - - Log - Logg - - - - Custom Fields - Tilpassede felt - - - - Basic Fields - Grunnleggende felt - - - - Jobs Fields - Jobbfelt - - - - Memory Fields - Hukommelsesfelt - - - - Scheduling Fields - Planleggingsfelt - - - - Select Custom Fields... - Velg tilpassede felt... - - - - Option - Valg - - - - Update Period... - Oppdateringsintervall... - - - - Show Status bar - Vis statuslinje - - - - Preferences... - Innstillinger... - - - - Help - Hjelp - - - - - About - Om - - - - Detail - Detalj - - - - test - - - - - Copied to Clipboard - Kopiert til utklippsboken - - - - context popup - sprettoppmeny - - - - Renice... - Forandre prioritet... - - - - Scheduling... - Planlegging... - - - - Terminate - Avslutt - - - - Hangup - Legg på - - - - Kill - Drep - - - - Stop - Stopp - - - - Continue - Fortsett - - - - SIGINT (interrupt) - SIGINT (avbryt) - - - - SIGCONT (continue) - SIGCONT (fortsett) - - - - SIGSTOP (stop) - SIGSTOP (stopp) - - - - SIGQUIT (quit) - SIGQUIT (avslutt) - - - - SIGILL (illegal instruction) - SIGILL (ulovlig instruksjon) - - - - SIGABRT (abort) - SIGABRT (avbryt) - - - - SIGFPE (floating point exception) - SIGFPE (Feil med flytende desimaltall) - - - - SIGSEGV (segmentation violation) - SIGSEGV (feil med oppdeling) - - - - SIGPIPE (broken pipe) - SIGPIPE (ødelagt rør [|]) - - - - SIGALRM (timer signal) - SIGALRM (timersignal) - - - - SIGUSR1 (user-defined 1) - SIGUSR1 (brukerdefinert 1) - - - - SIGUSR2 (user-defined 2) - SIGUSR2 (brukerdefinert 2) - - - - SIGCHLD (child death) - SIGCHLD (barnedød) - - - - SIGTSTP (stop from tty) - SIGTSTP (stopp fra tty) - - - - SIGTTIN (tty input) - SIGTTIN (tty-innsignal) - - - - SIGTTOU (tty output) - SIGTTOU (tty-utsignal) - - - - View Details - Vis detaljer - - - - WatchDog - Vaktbikkje - - - - Edit Commands... - Rediger kommandoer... - - - - Quit - Avslutt - - - - - - - - - Permission denied - Nektet tillatelse - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - Du har ikke tillatelse til å forandre prioritet for den valgte prosessen. Bare prosessens eier og superbrukeren har tillatelse til det. - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - Du har ikke tillatelse til å forandre prioritet på prosessen %1 (%2). Bare prosessens eier og superbrukeren har tillatelse til det. - - - - Only the super-user may lower the nice value of a process. - Bare superbrukeren kan minske nice-verdien til en prosess. - - - - Only the super-user may change the scheduling policy and static priority. - Bare superbrukeren kan forandre planlegginspolitikken og statisk prioritering. - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - Du har ikke tillatelse til å forandre planleggingen og/eller proriteten til prosessen %1 (%2). Bare superbrukeren kan gjøre det. - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - Du har ikke tillatelse til å sende et signal til prosessen %1 (%2). Bare superbrukeren og eieren av prosessen kan gjøre det. - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - <h2> Qps %1 - En visuell prosesshåndterer</h2> %2 som bruker Qt-biblioteket %3<br><br><b>Kilde: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Feilhåndterer: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - <b>Orginal Qps av</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Bidragsytere</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - <H1>QPS Hjelp</H1>Oppdatert 24. mai 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Avslutt </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Oppdater </td> <td>&nbsp;Mellomrom , Retur </td> </tr> <tr><td> Avslutt prosess </td> <td> ALT + T , DELETE </td> </tr> <tr><td> Drep prosess </td> <td> ALT + K </td> </tr> </tbody></table> - - - - SchedDialog - - - Change scheduling - Skift planlegging - - - - Scheduling Policy - Planleggingspolitikk - - - - SCHED_OTHER (time-sharing) - PLANL_ANNET (tidsdeling) - - - - SCHED_FIFO (real-time) - PLANL_FIFO (realtid) - - - - SCHED_RR (real-time) - PLANL_RR (realtid) - - - - OK - Okei - - - - Cancel - Avbryt - - - - Priority (1-99): - Prioritet (1-99): - - - - Invalid Input - Ugyldig innverdi - - - - The priority must be in the range 1..99 - Prioriteten må være mellom 1 og 99 - - - - Screenshot - - - /untitled. - /uten navn. - - - - Save As - Lagre som - - - - %1 Files (*.%2);;All Files (*) - %1 filer (*.%2);;Alle filer (*) - - - - Options - Valg - - - - s - - - - - Screenshot Delay: - Forsinkelse for skjermbilde: - - - - Hide This Window - Skjul dette vinduet - - - - New Screenshot - Nytt skjermbilde - - - - Quit - Avslutt - - - - SearchBox - - - PID,COMMAND,USER... - PID,KOMMANDO,BRUKER... - - - - SliderDialog - - - Renice Process - Forandre prioritet for prosess - - - - New nice value: - Ny prioriteringsverdi: - - - - Cancel - Avbryt - - - - OK - Okei - - - - Sockets - - - Fd - Fb - - - - File descriptor - Filbeskrivelse - - - - Proto - - - - - Protocol (TCP or UDP) - Protokoll (TCP eller UDP) - - - - Recv-Q - Motkø - - - - Bytes in receive queue - Byte i mottakskø - - - - Send-Q - Sendkø - - - - Bytes in send queue - Byte i sendekø - - - - Local Addr - Lokal adr - - - - Local IP address - Lokal IP-adresse - - - - - Port - - - - - Local port - Lokal port - - - - Remote Addr - Fjernadr - - - - Remote IP address - Fjern IP-adresse - - - - Remote port - Fjernport - - - - State - Tilstand - - - - Connection state - Status for forbindelse - - - - StatusBar - - - Process count: %1 - Antall prosesser: %1 - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - Dette er en ustabil funksjon i Alfa - Du kan oppleve en SEGFAULT... - - - - TFrame - - - this is Tframe widget - dette er Tframe-widgeten - - - - UFrame - - - title - tittel - - - - WatchdogDialog - - - if process start - hvis prosessen starter - - - - if process finish - hvis prosessen blir ferdig - - - - select condition - velg betingelse - - - diff --git a/src/translations/qps_pl.ts b/src/translations/qps_pl.ts deleted file mode 100644 index 1cf6289..0000000 --- a/src/translations/qps_pl.ts +++ /dev/null @@ -1,1773 +0,0 @@ - - - - - AllFields - - - Field - - - - - Field name - - - - - Description - - - - - Field description - - - - - Value - - - - - Field value - - - - - Boxvar - - - Exit On Close Button - - - - - Host Name Lookup - - - - - Service Name Lookup - - - - - Disclosure Triangles - - - - - Branch Lines - - - - - Auto Save Settings on Exit - - - - - Selection: Copy PIDs to Clipboard - - - - - Normalize NICE - - - - - Use pmap for Map Names - - - - - Cbgroup - - - General - - - - - Command - - - The command: - - - - - - - - -failed with the error: - - - - - - - Too many processes - - - - - Unknown error - - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - - - - - -exited with status - - - - - Command Failed - - - - - CommandDialog - - - Edit Commands 0.1 alpha - - - - - Name: - - - - - Popup - - - - - Command Line: - - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - - - - - New... - - - - - - Add... - - - - - Delete - Usuń - - - - Close - Zamknij - - - - ControlBar - - - Linear - - - - - Tree - - - - - All Processes - - - - - Your Processes - - - - - Non-Root Processes - - - - - Running Processes - - - - - Pause (Ctrl+Space) - Pauzuj (Ctrl+Spacja) - - - - Details - - - Process %1 ( %2 ) - details - - - - - Files - - - - - Sockets - - - - - Memory Maps - - - - - Environment - - - - - All Fields - - - - - Environ - - - Variable - - - - - Variable name - - - - - Value - - - - - Variable value - - - - - EventDialog - - - Watchdog 0.1 alpha - Watchdog 0.1 alpha - - - - Eventcat - - - - - Select condition - Wybierz warunek - - - - labelDescrition - - - - - Enable - Włącz - - - - process name - nazwa procesu - - - - cpu - procesor - - - - % - % - - - - include already running process - uwzględnij już uruchomiony proces - - - - run command - wykonaj polecenie - - - - show Message - wyświetl wiadomość - - - - Help (Not yet. just concept) - Pomoc (nie zaimplementowano jeszcze) - - - - %p : pid -%c : command - %p : id procesu -%c : polecenie - - - - New - Nowy - - - - Add - Dodaj - - - - Delete - Usuń - - - - Close - Zamknij - - - - ExecWindow - - - Qps - Qps - - - - Ok - OK - - - - Qps Watchdog - - - - - %1 exit with code %2 - - - - - Close - Zamknij - - - - %1 [running] - - - - - terminate command - - - - - Error %1 : [%2] Maybe command not found - - - - - FieldSelect - - - Select Custom Fields - - - - - Close - Zamknij - - - - Files - - - Fd - - - - - File descriptor - - - - - Mode - - - - - Open mode - - - - - Name - - - - - File name (if available) - - - - - IntervalDialog - - - Change Update Period - - - - - New Update Period - - - - - Cancel - - - - - OK - - - - - No UPDATE - - - - - Invalid value - - - - - ListModel - - - Event Category - - - - - Enable - Włącz - - - - Maps - - - Address Range - - - - - Mapped addresses (hex) ) - - - - - Size - - - - - Kbytes mapped (dec) - - - - - Perm - - - - - Permission flags - - - - - Offset - - - - - File offset at start of mapping (hex) - - - - - Device - - - - - Major,Minor device numbers (dec) - - - - - Inode - - - - - Inode number (dec) - - - - - File - - - - - File name (if available) - - - - - PermissionDialog - - - Permission - - - - - Root password - - - - - Cancel - - - - - OK - - - - - Preferences - - - Preferences - - - - - Setting - - - - - %CPU divided by - - - - - Total cpu: %1 - - - - - Single cpu: 1 - - - - - default - - - - - for developer - - - - - Appearance - - - - - Proc - - - PID - - - - - Process ID - - - - - TGID - - - - - Task group ID ( parent of threads ) - - - - - PPID - - - - - Parent process ID - - - - - PGID - - - - - Process group ID - - - - - SID - - - - - Session ID - - - - - TTY - - - - - Terminal - - - - - TPGID - - - - - Process group ID of tty owner - - - - - USER - - - - - Owner (*=suid root, +=suid a user) - - - - - GROUP - - - - - Group name (*=sgid other) - - - - - UID - - - - - Real user ID - - - - - EUID - - - - - Effective user ID - - - - - SUID - - - - - Saved user ID (Posix) - - - - - FSUID - - - - - File system user ID - - - - - GID - - - - - Real group ID - - - - - EGID - - - - - Effective group ID - - - - - SGID - - - - - Saved group ID (Posix) - - - - - FSGID - - - - - File system group ID - - - - - PRI - - - - - Dynamic priority - - - - - NICE - - - - - Scheduling favour (higher -> less cpu time) - - - - - NLWP - - - - - Number of tasks(threads) in task group - - - - - PLCY - - - - - Scheduling policy - - - - - RPRI - - - - - Realtime priority (0-99, more is better) - - - - - TMS - - - - - Time slice in milliseconds - - - - - %SAVG - - - - - Percentage average sleep time (-1 -> N/A) - - - - - CPUSET - - - - - Affinity CPU mask (0 -> API not supported) - - - - - MAJFLT - - - - - Number of major faults (disk access) - - - - - MINFLT - - - - - Number of minor faults (no disk access) - - - - - VSIZE - - - - - Virtual image size of process - - - - - RSS - - - - - Resident set size - - - - - MEM - - - - - memory usage (RSS-SHARE) - - - - - TRS - - - - - Text(code) resident set size - - - - - DRS - - - - - Data resident set size(malloc+global variable) - - - - - STACK - - - - - Stack size - - - - - SHARE - - - - - Shared memory with other libs - - - - - SWAP - - - - - Kbytes on swap device - - - - - IO_R - - - - - io read (file) - - - - - IO_W - - - - - io write (file) - - - - - DT - - - - - Number of dirty (non-written) pages - - - - - STAT - - - - - State of the process - - - - - FLAGS - - - - - Process flags (hex) - - - - - WCHAN - - - - - Kernel function where process is sleeping - - - - - %WCPU - - - - - Weighted percentage of CPU (30 s average) - - - - - %CPU - - - - - Percentage of CPU used since last update - - - - - %MEM - - - - - Percentage of memory used (RSS/total mem) - - - - - START - - - - - Time process started - - - - - TIME - - - - - Total CPU time used since start - - - - - CPU - - - - - CPU the process is executing on (SMP system) - - - - - the process name - - - - - Process Name - - - - - CWD - - - - - Current working directory - - - - - ROOT - - - - - Root directory of process - - - - - COMMAND_LINE - - - - - Command line that started the process - - - - - QObject - - - Show - - - - - Hide - - - - - ScreenShot - - - - - Quit - Wyjdź - - - - Qps - - - header_popup - - - - - Remove Field - - - - - Add Field - - - - - Command - - - - - View - - - - - Process - - - - - Log - - - - - Custom Fields - - - - - Basic Fields - - - - - Jobs Fields - - - - - Memory Fields - - - - - Scheduling Fields - - - - - Select Custom Fields... - - - - - Option - - - - - Update Period... - - - - - Show Status bar - - - - - Preferences... - - - - - Help - - - - - - About - - - - - Detail - Szczegół - - - - test - - - - - Copied to Clipboard - - - - - context popup - - - - - Renice... - - - - - Scheduling... - - - - - Terminate - - - - - Hangup - - - - - Kill - - - - - Stop - - - - - Continue - - - - - SIGINT (interrupt) - - - - - SIGCONT (continue) - - - - - SIGSTOP (stop) - - - - - SIGQUIT (quit) - - - - - SIGILL (illegal instruction) - - - - - SIGABRT (abort) - - - - - SIGFPE (floating point exception) - - - - - SIGSEGV (segmentation violation) - - - - - SIGPIPE (broken pipe) - - - - - SIGALRM (timer signal) - - - - - SIGUSR1 (user-defined 1) - - - - - SIGUSR2 (user-defined 2) - - - - - SIGCHLD (child death) - - - - - SIGTSTP (stop from tty) - - - - - SIGTTIN (tty input) - - - - - SIGTTOU (tty output) - - - - - View Details - - - - - WatchDog - - - - - Edit Commands... - - - - - Quit - Wyjdź - - - - - - - - - Permission denied - - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - - - - - Only the super-user may lower the nice value of a process. - - - - - Only the super-user may change the scheduling policy and static priority. - - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - - - - - SchedDialog - - - Change scheduling - - - - - Scheduling Policy - - - - - SCHED_OTHER (time-sharing) - - - - - SCHED_FIFO (real-time) - - - - - SCHED_RR (real-time) - - - - - OK - - - - - Cancel - - - - - Priority (1-99): - - - - - Invalid Input - - - - - The priority must be in the range 1..99 - - - - - Screenshot - - - /untitled. - /bez tytułu. - - - - Save As - Zapisz jako - - - - %1 Files (*.%2);;All Files (*) - %1 plików (*.%2);;Wszystkie pliki (*) - - - - Options - Opcje - - - - s - sek - - - - Screenshot Delay: - Opóźnienie wykonania zrzutu ekranu: - - - - Hide This Window - Ukryj to okno - - - - New Screenshot - Nowy zrzut ekranu - - - - Quit - Wyjdź - - - - SearchBox - - - PID,COMMAND,USER... - - - - - SliderDialog - - - Renice Process - - - - - New nice value: - - - - - Cancel - - - - - OK - - - - - Sockets - - - Fd - - - - - File descriptor - - - - - Proto - - - - - Protocol (TCP or UDP) - - - - - Recv-Q - - - - - Bytes in receive queue - - - - - Send-Q - - - - - Bytes in send queue - - - - - Local Addr - - - - - Local IP address - - - - - - Port - - - - - Local port - - - - - Remote Addr - - - - - Remote IP address - - - - - Remote port - - - - - State - - - - - Connection state - - - - - StatusBar - - - Process count: %1 - - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - - - - - TFrame - - - this is Tframe widget - - - - - UFrame - - - title - - - - - WatchdogDialog - - - if process start - - - - - if process finish - - - - - select condition - - - - diff --git a/src/translations/qps_pt.ts b/src/translations/qps_pt.ts deleted file mode 100644 index d5a6f45..0000000 --- a/src/translations/qps_pt.ts +++ /dev/null @@ -1,1778 +0,0 @@ - - - - - AllFields - - - Field - Campo - - - - Field name - Nome do campo - - - - Description - Descrição - - - - Field description - Descrição do campo - - - - Value - Valor - - - - Field value - Valor do campo - - - - Boxvar - - - Exit On Close Button - Saída no botão fechar - - - - Host Name Lookup - - - - - Service Name Lookup - - - - - Disclosure Triangles - - - - - Branch Lines - - - - - Auto Save Settings on Exit - - - - - Selection: Copy PIDs to Clipboard - Seleção: Copiar PID(s) para a área de transferência - - - - Normalize NICE - Normalizar NICE - - - - Use pmap for Map Names - Usar pmap para nomes de mapas - - - - Cbgroup - - - General - Geral - - - - Command - - - The command: - - - O comando: - - - - - - - -failed with the error: - - - - -falhou com o erro: - - - - - - Too many processes - Demasiados processos - - - - Unknown error - Erro desconhecido - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - - - - - -exited with status - - - - - Command Failed - - - - - CommandDialog - - - Edit Commands 0.1 alpha - - - - - Name: - - - - - Popup - - - - - Command Line: - - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - - - - - New... - - - - - - Add... - - - - - Delete - - - - - Close - - - - - ControlBar - - - Linear - - - - - Tree - - - - - All Processes - - - - - Your Processes - - - - - Non-Root Processes - - - - - Running Processes - - - - - Pause (Ctrl+Space) - - - - - Details - - - Process %1 ( %2 ) - details - - - - - Files - - - - - Sockets - - - - - Memory Maps - - - - - Environment - - - - - All Fields - - - - - Environ - - - Variable - - - - - Variable name - - - - - Value - - - - - Variable value - - - - - EventDialog - - - Watchdog 0.1 alpha - - - - - Eventcat - - - - - Select condition - - - - - labelDescrition - - - - - Enable - - - - - process name - - - - - cpu - - - - - % - - - - - include already running process - - - - - run command - - - - - show Message - - - - - Help (Not yet. just concept) - - - - - %p : pid -%c : command - - - - - New - - - - - Add - - - - - Delete - - - - - Close - - - - - ExecWindow - - - Qps - - - - - Ok - - - - - Qps Watchdog - - - - - %1 exit with code %2 - - - - - Close - - - - - %1 [running] - - - - - terminate command - - - - - Error %1 : [%2] Maybe command not found - - - - - FieldSelect - - - Select Custom Fields - - - - - Close - - - - - Files - - - Fd - - - - - File descriptor - - - - - Mode - - - - - Open mode - - - - - Name - - - - - File name (if available) - - - - - IntervalDialog - - - Change Update Period - - - - - New Update Period - - - - - Cancel - - - - - OK - - - - - No UPDATE - - - - - Invalid value - - - - - ListModel - - - Event Category - - - - - Enable - - - - - Maps - - - Address Range - - - - - Mapped addresses (hex) ) - - - - - Size - - - - - Kbytes mapped (dec) - - - - - Perm - - - - - Permission flags - - - - - Offset - - - - - File offset at start of mapping (hex) - - - - - Device - - - - - Major,Minor device numbers (dec) - - - - - Inode - - - - - Inode number (dec) - - - - - File - - - - - File name (if available) - - - - - PermissionDialog - - - Permission - - - - - Root password - - - - - Cancel - - - - - OK - - - - - Preferences - - - Preferences - - - - - Setting - - - - - %CPU divided by - - - - - Total cpu: %1 - - - - - Single cpu: 1 - - - - - default - - - - - for developer - - - - - Appearance - - - - - Proc - - - PID - - - - - Process ID - - - - - TGID - - - - - Task group ID ( parent of threads ) - - - - - PPID - - - - - Parent process ID - - - - - PGID - - - - - Process group ID - - - - - SID - - - - - Session ID - - - - - TTY - - - - - Terminal - - - - - TPGID - - - - - Process group ID of tty owner - - - - - USER - - - - - Owner (*=suid root, +=suid a user) - - - - - GROUP - - - - - Group name (*=sgid other) - - - - - UID - - - - - Real user ID - - - - - EUID - - - - - Effective user ID - - - - - SUID - - - - - Saved user ID (Posix) - - - - - FSUID - - - - - File system user ID - - - - - GID - - - - - Real group ID - - - - - EGID - - - - - Effective group ID - - - - - SGID - - - - - Saved group ID (Posix) - - - - - FSGID - - - - - File system group ID - - - - - PRI - - - - - Dynamic priority - - - - - NICE - - - - - Scheduling favour (higher -> less cpu time) - - - - - NLWP - - - - - Number of tasks(threads) in task group - - - - - PLCY - - - - - Scheduling policy - - - - - RPRI - - - - - Realtime priority (0-99, more is better) - - - - - TMS - - - - - Time slice in milliseconds - - - - - %SAVG - - - - - Percentage average sleep time (-1 -> N/A) - - - - - CPUSET - - - - - Affinity CPU mask (0 -> API not supported) - - - - - MAJFLT - - - - - Number of major faults (disk access) - - - - - MINFLT - - - - - Number of minor faults (no disk access) - - - - - VSIZE - - - - - Virtual image size of process - - - - - RSS - - - - - Resident set size - - - - - MEM - - - - - memory usage (RSS-SHARE) - - - - - TRS - - - - - Text(code) resident set size - - - - - DRS - - - - - Data resident set size(malloc+global variable) - - - - - STACK - - - - - Stack size - - - - - SHARE - - - - - Shared memory with other libs - - - - - SWAP - - - - - Kbytes on swap device - - - - - IO_R - - - - - io read (file) - - - - - IO_W - - - - - io write (file) - - - - - DT - - - - - Number of dirty (non-written) pages - - - - - STAT - - - - - State of the process - - - - - FLAGS - - - - - Process flags (hex) - - - - - WCHAN - - - - - Kernel function where process is sleeping - - - - - %WCPU - - - - - Weighted percentage of CPU (30 s average) - - - - - %CPU - - - - - Percentage of CPU used since last update - - - - - %MEM - - - - - Percentage of memory used (RSS/total mem) - - - - - START - - - - - Time process started - - - - - TIME - - - - - Total CPU time used since start - - - - - CPU - - - - - CPU the process is executing on (SMP system) - - - - - the process name - - - - - Process Name - - - - - CWD - - - - - Current working directory - - - - - ROOT - - - - - Root directory of process - - - - - COMMAND_LINE - - - - - Command line that started the process - - - - - QObject - - - Show - - - - - Hide - - - - - ScreenShot - - - - - Quit - - - - - Qps - - - header_popup - - - - - Remove Field - - - - - Add Field - - - - - Command - - - - - View - - - - - Process - - - - - Log - - - - - Custom Fields - - - - - Basic Fields - - - - - Jobs Fields - - - - - Memory Fields - - - - - Scheduling Fields - - - - - Select Custom Fields... - - - - - Option - - - - - Update Period... - - - - - Show Status bar - - - - - Preferences... - - - - - Help - - - - - - About - - - - - Detail - - - - - test - - - - - Copied to Clipboard - - - - - context popup - - - - - Renice... - - - - - Scheduling... - - - - - Terminate - - - - - Hangup - - - - - Kill - - - - - Stop - - - - - Continue - - - - - SIGINT (interrupt) - - - - - SIGCONT (continue) - - - - - SIGSTOP (stop) - - - - - SIGQUIT (quit) - - - - - SIGILL (illegal instruction) - - - - - SIGABRT (abort) - - - - - SIGFPE (floating point exception) - - - - - SIGSEGV (segmentation violation) - - - - - SIGPIPE (broken pipe) - - - - - SIGALRM (timer signal) - - - - - SIGUSR1 (user-defined 1) - - - - - SIGUSR2 (user-defined 2) - - - - - SIGCHLD (child death) - - - - - SIGTSTP (stop from tty) - - - - - SIGTTIN (tty input) - - - - - SIGTTOU (tty output) - - - - - View Details - - - - - WatchDog - - - - - Edit Commands... - - - - - Quit - - - - - - - - - - Permission denied - - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - - - - - Only the super-user may lower the nice value of a process. - - - - - Only the super-user may change the scheduling policy and static priority. - - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - - - - - SchedDialog - - - Change scheduling - - - - - Scheduling Policy - - - - - SCHED_OTHER (time-sharing) - - - - - SCHED_FIFO (real-time) - - - - - SCHED_RR (real-time) - - - - - OK - - - - - Cancel - - - - - Priority (1-99): - - - - - Invalid Input - - - - - The priority must be in the range 1..99 - - - - - Screenshot - - - /untitled. - - - - - Save As - - - - - %1 Files (*.%2);;All Files (*) - - - - - Options - - - - - s - - - - - Screenshot Delay: - - - - - Hide This Window - - - - - New Screenshot - - - - - Quit - - - - - SearchBox - - - PID,COMMAND,USER... - - - - - SliderDialog - - - Renice Process - - - - - New nice value: - - - - - Cancel - - - - - OK - - - - - Sockets - - - Fd - - - - - File descriptor - - - - - Proto - - - - - Protocol (TCP or UDP) - - - - - Recv-Q - - - - - Bytes in receive queue - - - - - Send-Q - - - - - Bytes in send queue - - - - - Local Addr - - - - - Local IP address - - - - - - Port - - - - - Local port - - - - - Remote Addr - - - - - Remote IP address - - - - - Remote port - - - - - State - - - - - Connection state - - - - - StatusBar - - - Process count: %1 - - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - - - - - TFrame - - - this is Tframe widget - - - - - UFrame - - - title - - - - - WatchdogDialog - - - if process start - - - - - if process finish - - - - - select condition - - - - diff --git a/src/translations/qps_pt_BR.ts b/src/translations/qps_pt_BR.ts deleted file mode 100644 index 65ae77e..0000000 --- a/src/translations/qps_pt_BR.ts +++ /dev/null @@ -1,1791 +0,0 @@ - - - - - AllFields - - - Field - Campo - - - - Field name - Nome do campo - - - - Description - Descrição - - - - Field description - Descrição do campo - - - - Value - Valor - - - - Field value - Valor do campo - - - - Boxvar - - - Exit On Close Button - Sair ao Fechar - - - - Host Name Lookup - Pesquisar Nome do Host - - - - Service Name Lookup - Pesquisar Nome do Serviço - - - - Disclosure Triangles - Triângulos de Divulgação - - - - Branch Lines - Linhas de Ramificação - - - - Auto Save Settings on Exit - Salvar configurações ao sair - - - - Selection: Copy PIDs to Clipboard - Seleção: Copiar PIDs para Área de transferência - - - - Normalize NICE - Normalizar NICE - - - - Use pmap for Map Names - Usar pmap para Nomes de Mapas - - - - Cbgroup - - - General - Geral - - - - Command - - - The command: - - - O comando: - - - - - - - -failed with the error: - - - - -falhou com o erro: - - - - - - Too many processes - Muitos processos - - - - Unknown error - Erro desconhecido - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - -não pôde ser executado porque não foi encontrado, -ou você não teve permissão de executar. - - - - - -exited with status - - -saiu com status - - - - Command Failed - Comando falhou - - - - CommandDialog - - - Edit Commands 0.1 alpha - Editar comandos 0.1 alpha - - - - Name: - Nome: - - - - Popup - - - - - Command Line: - Linha de Comando: - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - Substituições: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - - - - New... - Novo... - - - - - Add... - Adicionar... - - - - Delete - Excluir - - - - Close - Fechar - - - - ControlBar - - - Linear - - - - - Tree - Árvore - - - - All Processes - Todos os Processos - - - - Your Processes - Seus Processos - - - - Non-Root Processes - Processos Não-Root - - - - Running Processes - Processos em Execução - - - - Pause (Ctrl+Space) - Pausar (Ctrl+Espaço) - - - - Details - - - Process %1 ( %2 ) - details - Processo %1 ( %2 ) - detalhes - - - - Files - Arquivos - - - - Sockets - Soquetes - - - - Memory Maps - Mapas de Memória - - - - Environment - Ambiente - - - - All Fields - Todos os Campos - - - - Environ - - - Variable - Variável - - - - Variable name - Nome da variável - - - - Value - Valor - - - - Variable value - Valor da variável - - - - EventDialog - - - Watchdog 0.1 alpha - - - - - Eventcat - - - - - Select condition - Selecione a condição - - - - labelDescrition - rótuloDescrição - - - - Enable - Habilitar - - - - process name - nome do processo - - - - cpu - - - - - % - - - - - include already running process - incluir processo já em execução - - - - run command - comando de execução - - - - show Message - exibir Mensagem - - - - Help (Not yet. just concept) - Ajuda (Ainda não, apenas conceito) - - - - %p : pid -%c : command - %p : pid -%c : comando - - - - New - Novo - - - - Add - Adicionar - - - - Delete - Excluir - - - - Close - Fechar - - - - ExecWindow - - - Qps - - - - - Ok - - - - - Qps Watchdog - - - - - %1 exit with code %2 - %1 sair com código %2 - - - - Close - Fechar - - - - %1 [running] - %1 [executando] - - - - terminate command - terminar comando - - - - Error %1 : [%2] Maybe command not found - Erro %1 : [%2] Talvez comando não encontrado - - - - FieldSelect - - - Select Custom Fields - Selecionar Campos Personalizados - - - - Close - Fechar - - - - Files - - - Fd - - - - - File descriptor - Descritor de arquivo - - - - Mode - Modo - - - - Open mode - Modo abrir - - - - Name - Nome - - - - File name (if available) - Nome do arquivo (se disponível) - - - - IntervalDialog - - - Change Update Period - Alterar Período de Atualização - - - - New Update Period - Novo Período de Atualização - - - - Cancel - Cancelar - - - - OK - - - - - No UPDATE - Nenhuma ATUALIZAÇÃO - - - - Invalid value - Valor inválido - - - - ListModel - - - Event Category - Categoria do Evento - - - - Enable - Habilitar - - - - Maps - - - Address Range - Faixa de Endereços - - - - Mapped addresses (hex) ) - Endereços mapeados (hex) ) - - - - Size - Tamanho - - - - Kbytes mapped (dec) - Kbytes mapeados (dec) - - - - Perm - - - - - Permission flags - Sinalizadores de permissão - - - - Offset - Deslocar - - - - File offset at start of mapping (hex) - Deslocamento de arquivo no início do mapeamento (hex) - - - - Device - Dispositivo - - - - Major,Minor device numbers (dec) - Maior,Menor números de dispositivos (dec) - - - - Inode - - - - - Inode number (dec) - Número do inode (dec) - - - - File - Arquivo - - - - File name (if available) - Nome do arquivo (se disponível) - - - - PermissionDialog - - - Permission - Permissão - - - - Root password - Senha root - - - - Cancel - Cancelar - - - - OK - - - - - Preferences - - - Preferences - Preferências - - - - Setting - Configuração - - - - %CPU divided by - %CPU dividido por - - - - Total cpu: %1 - - - - - Single cpu: 1 - - - - - default - padrão - - - - for developer - para desenvolvedor - - - - Appearance - Aparência - - - - Proc - - - PID - - - - - Process ID - ID do Processo - - - - TGID - - - - - Task group ID ( parent of threads ) - - - - - PPID - - - - - Parent process ID - ID do Processo filho - - - - PGID - - - - - Process group ID - ID do grupo de processos - - - - SID - - - - - Session ID - ID de Sessão - - - - TTY - - - - - Terminal - - - - - TPGID - - - - - Process group ID of tty owner - - - - - USER - USUÁRIO - - - - Owner (*=suid root, +=suid a user) - - - - - GROUP - GRUPO - - - - Group name (*=sgid other) - - - - - UID - - - - - Real user ID - - - - - EUID - - - - - Effective user ID - - - - - SUID - - - - - Saved user ID (Posix) - - - - - FSUID - - - - - File system user ID - - - - - GID - - - - - Real group ID - - - - - EGID - - - - - Effective group ID - - - - - SGID - - - - - Saved group ID (Posix) - - - - - FSGID - - - - - File system group ID - - - - - PRI - - - - - Dynamic priority - - - - - NICE - - - - - Scheduling favour (higher -> less cpu time) - - - - - NLWP - - - - - Number of tasks(threads) in task group - - - - - PLCY - - - - - Scheduling policy - - - - - RPRI - - - - - Realtime priority (0-99, more is better) - - - - - TMS - - - - - Time slice in milliseconds - - - - - %SAVG - - - - - Percentage average sleep time (-1 -> N/A) - - - - - CPUSET - - - - - Affinity CPU mask (0 -> API not supported) - - - - - MAJFLT - - - - - Number of major faults (disk access) - - - - - MINFLT - - - - - Number of minor faults (no disk access) - - - - - VSIZE - - - - - Virtual image size of process - - - - - RSS - - - - - Resident set size - - - - - MEM - - - - - memory usage (RSS-SHARE) - - - - - TRS - - - - - Text(code) resident set size - - - - - DRS - - - - - Data resident set size(malloc+global variable) - - - - - STACK - - - - - Stack size - - - - - SHARE - - - - - Shared memory with other libs - - - - - SWAP - - - - - Kbytes on swap device - - - - - IO_R - - - - - io read (file) - - - - - IO_W - - - - - io write (file) - - - - - DT - - - - - Number of dirty (non-written) pages - - - - - STAT - - - - - State of the process - - - - - FLAGS - - - - - Process flags (hex) - - - - - WCHAN - - - - - Kernel function where process is sleeping - - - - - %WCPU - - - - - Weighted percentage of CPU (30 s average) - - - - - %CPU - - - - - Percentage of CPU used since last update - - - - - %MEM - - - - - Percentage of memory used (RSS/total mem) - - - - - START - - - - - Time process started - - - - - TIME - - - - - Total CPU time used since start - - - - - CPU - - - - - CPU the process is executing on (SMP system) - - - - - the process name - - - - - Process Name - - - - - CWD - - - - - Current working directory - - - - - ROOT - - - - - Root directory of process - - - - - COMMAND_LINE - - - - - Command line that started the process - - - - - QObject - - - Show - - - - - Hide - - - - - ScreenShot - - - - - Quit - - - - - Qps - - - header_popup - - - - - Remove Field - - - - - Add Field - - - - - Command - - - - - View - - - - - Process - - - - - Log - - - - - Custom Fields - - - - - Basic Fields - - - - - Jobs Fields - - - - - Memory Fields - - - - - Scheduling Fields - - - - - Select Custom Fields... - - - - - Option - - - - - Update Period... - - - - - Show Status bar - - - - - Preferences... - - - - - Help - - - - - - About - - - - - Detail - - - - - test - - - - - Copied to Clipboard - - - - - context popup - - - - - Renice... - - - - - Scheduling... - - - - - Terminate - - - - - Hangup - - - - - Kill - - - - - Stop - - - - - Continue - - - - - SIGINT (interrupt) - - - - - SIGCONT (continue) - - - - - SIGSTOP (stop) - - - - - SIGQUIT (quit) - - - - - SIGILL (illegal instruction) - - - - - SIGABRT (abort) - - - - - SIGFPE (floating point exception) - - - - - SIGSEGV (segmentation violation) - - - - - SIGPIPE (broken pipe) - - - - - SIGALRM (timer signal) - - - - - SIGUSR1 (user-defined 1) - - - - - SIGUSR2 (user-defined 2) - - - - - SIGCHLD (child death) - - - - - SIGTSTP (stop from tty) - - - - - SIGTTIN (tty input) - - - - - SIGTTOU (tty output) - - - - - View Details - - - - - WatchDog - - - - - Edit Commands... - - - - - Quit - - - - - - - - - - Permission denied - - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - - - - - Only the super-user may lower the nice value of a process. - - - - - Only the super-user may change the scheduling policy and static priority. - - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - - - - - SchedDialog - - - Change scheduling - - - - - Scheduling Policy - - - - - SCHED_OTHER (time-sharing) - - - - - SCHED_FIFO (real-time) - - - - - SCHED_RR (real-time) - - - - - OK - - - - - Cancel - - - - - Priority (1-99): - - - - - Invalid Input - - - - - The priority must be in the range 1..99 - - - - - Screenshot - - - /untitled. - - - - - Save As - - - - - %1 Files (*.%2);;All Files (*) - - - - - Options - - - - - s - - - - - Screenshot Delay: - - - - - Hide This Window - - - - - New Screenshot - - - - - Quit - - - - - SearchBox - - - PID,COMMAND,USER... - - - - - SliderDialog - - - Renice Process - - - - - New nice value: - - - - - Cancel - - - - - OK - - - - - Sockets - - - Fd - - - - - File descriptor - - - - - Proto - - - - - Protocol (TCP or UDP) - - - - - Recv-Q - - - - - Bytes in receive queue - - - - - Send-Q - - - - - Bytes in send queue - - - - - Local Addr - - - - - Local IP address - - - - - - Port - - - - - Local port - - - - - Remote Addr - - - - - Remote IP address - - - - - Remote port - - - - - State - - - - - Connection state - - - - - StatusBar - - - Process count: %1 - - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - - - - - TFrame - - - this is Tframe widget - - - - - UFrame - - - title - - - - - WatchdogDialog - - - if process start - - - - - if process finish - - - - - select condition - - - - diff --git a/src/translations/qps_ru.ts b/src/translations/qps_ru.ts deleted file mode 100644 index e80bbb3..0000000 --- a/src/translations/qps_ru.ts +++ /dev/null @@ -1,1792 +0,0 @@ - - - - - AllFields - - - Field - Поле - - - - Field name - Имя поля - - - - Description - Описание - - - - Field description - Описание поля - - - - Value - Значение - - - - Field value - Значение поля - - - - Boxvar - - - Exit On Close Button - Выход при закрытии - - - - Host Name Lookup - Определение имен компьютеров - - - - Service Name Lookup - Определение имен служб - - - - Disclosure Triangles - - - - - Branch Lines - - - - - Auto Save Settings on Exit - Сохранять настройки при выходе - - - - Selection: Copy PIDs to Clipboard - Выделение: копировать PID'ы в Буфер обмена - - - - Normalize NICE - Нормализовать NICE - - - - Use pmap for Map Names - Использовать pmap для имен карт памяти - - - - Cbgroup - - - General - Общие - - - - Command - - - The command: - - - Команда: - - - - - - - -failed with the error: - - - - -завершилась с ошибкой: - - - - - - Too many processes - Слишком много процессов - - - - Unknown error - Неизвестная ошибка - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - -не была выполнена, поскольку она не была найдена, -или у вас нет разрешения на ее исполнение. - - - - - -exited with status - - -завершилась с кодом возврата - - - - Command Failed - Не удалось выполнить команду - - - - CommandDialog - - - Edit Commands 0.1 alpha - Правка команд 0.1 альфа - - - - Name: - Имя: - - - - Popup - - - - - Command Line: - Командная строка: - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - Доступные замены: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - - - - New... - Создать... - - - - - Add... - Добавить... - - - - Delete - Удалить - - - - Close - Закрыть - - - - ControlBar - - - Linear - Линейный - - - - Tree - Иерархический - - - - All Processes - Все процессы - - - - Your Processes - Ваши процессы - - - - Non-Root Processes - Пользовательские процессы - - - - Running Processes - Выполняющиеся процессы - - - - Pause (Ctrl+Space) - Пауза (Ctrl+пробел) - - - - Details - - - Process %1 ( %2 ) - details - Процесс %1 ( %2 ) - подробности - - - - Files - Файлы - - - - Sockets - Сокеты - - - - Memory Maps - Карта памяти - - - - Environment - Окружение - - - - All Fields - Все поля - - - - Environ - - - Variable - Переменная - - - - Variable name - Имя переменной окружения - - - - Value - Значение - - - - Variable value - Значение переменной - - - - EventDialog - - - Watchdog 0.1 alpha - Сторожевой таймер 0.1 альфа - - - - Eventcat - - - - - Select condition - Выбор условия - - - - labelDescrition - - - - - Enable - Включить - - - - process name - имя процесса - - - - cpu - цп - - - - % - - - - - include already running process - включая уже запущенные процессы - - - - run command - выполнить команду - - - - show Message - вывести сообщение - - - - Help (Not yet. just concept) - Справка (еще не реализовано) - - - - %p : pid -%c : command - %p : pid -%c : команда - - - - New - Создать - - - - Add - Добавить - - - - Delete - Удалить - - - - Close - Закрыть - - - - ExecWindow - - - Qps - - - - - Ok - ОК - - - - Qps Watchdog - Сторожевой таймер Qps - - - - %1 exit with code %2 - %1 завершился с кодом %2 - - - - Close - Закрыть - - - - %1 [running] - %1 [выполняется] - - - - terminate command - Завершить команду - - - - Error %1 : [%2] Maybe command not found - Ошибка %1 : [%2] Возможно, команда не найдена - - - - FieldSelect - - - Select Custom Fields - Выбор полей пользователя - - - - Close - Закрыть - - - - Files - - - Fd - - - - - File descriptor - Дескриптор файла - - - - Mode - Режим - - - - Open mode - Режим открытия - - - - Name - Имя - - - - File name (if available) - Имя файла (если доступно) - - - - IntervalDialog - - - Change Update Period - Изменить период обновления - - - - New Update Period - Новый период обновления - - - - Cancel - Отмена - - - - OK - ОК - - - - No UPDATE - - - - - Invalid value - Неверное значение - - - - ListModel - - - Event Category - Категория события - - - - Enable - Включить - - - - Maps - - - Address Range - Диапазон адресов - - - - Mapped addresses (hex) ) - Отображенные адреса (шестн.) - - - - Size - Размер - - - - Kbytes mapped (dec) - Кбайт в отображении (десят.) - - - - Perm - Разр. - - - - Permission flags - Флаги разрешений - - - - Offset - Смещение - - - - File offset at start of mapping (hex) - Смещение в файле до начала отображения (шестн.) - - - - Device - Устр-во - - - - Major,Minor device numbers (dec) - Верхнее и нижнее число устройства (десят.) - - - - Inode - - - - - Inode number (dec) - Номер Inode (десят.) - - - - File - Файл - - - - File name (if available) - Имя файла (если доступно) - - - - PermissionDialog - - - Permission - Разрешения - - - - Root password - Пароль суперпользователя - - - - Cancel - Отмена - - - - OK - - - - - Preferences - - - Preferences - Настройки - - - - Setting - Параметр - - - - %CPU divided by - Делить %ЦП на - - - - Total cpu: %1 - Число ЦП: %1 - - - - Single cpu: 1 - Один ЦП: 1 - - - - default - - - - - for developer - для разработчика - - - - Appearance - Внешний вид - - - - Proc - - - PID - - - - - Process ID - ID процесса - - - - TGID - - - - - Task group ID ( parent of threads ) - ID группы задач (родителя потоков) - - - - PPID - - - - - Parent process ID - ID родительского процесса - - - - PGID - - - - - Process group ID - ID группы процессов - - - - SID - - - - - Session ID - ID сеанса - - - - TTY - - - - - Terminal - Терминал - - - - TPGID - - - - - Process group ID of tty owner - ID группы процесса владельца терминала - - - - USER - - - - - Owner (*=suid root, +=suid a user) - Пользователь (*=suid root, +=suid пользоват.) - - - - GROUP - - - - - Group name (*=sgid other) - Имя группы (*=sgid other) - - - - UID - - - - - Real user ID - Настоящий ID пользователя - - - - EUID - - - - - Effective user ID - Эффективный ID пользователя - - - - SUID - - - - - Saved user ID (Posix) - Сохраненный ID пользователя (Posix) - - - - FSUID - - - - - File system user ID - ID пользователя файл. сист. - - - - GID - - - - - Real group ID - Настоящий ID группы - - - - EGID - - - - - Effective group ID - Эффективный ID группы - - - - SGID - - - - - Saved group ID (Posix) - Сохраненный ID группы (Posix) - - - - FSGID - - - - - File system group ID - ID группы файл. сист. - - - - PRI - - - - - Dynamic priority - Динамический приоритет - - - - NICE - - - - - Scheduling favour (higher -> less cpu time) - Предпочтение планировщика (выше -> меньше времени ЦП) - - - - NLWP - - - - - Number of tasks(threads) in task group - Число задач (потоков) в группе задач - - - - PLCY - - - - - Scheduling policy - Политика планировщика - - - - RPRI - - - - - Realtime priority (0-99, more is better) - Приоритет реального времени (0-99, чем больше тем лучше) - - - - TMS - - - - - Time slice in milliseconds - - - - - %SAVG - - - - - Percentage average sleep time (-1 -> N/A) - Среднее время сна в процентах (-1 -> недоступно) - - - - CPUSET - - - - - Affinity CPU mask (0 -> API not supported) - Маска привязки ЦП (0 -> API не поддерживается) - - - - MAJFLT - - - - - Number of major faults (disk access) - - - - - MINFLT - - - - - Number of minor faults (no disk access) - - - - - VSIZE - - - - - Virtual image size of process - Размер виртуального образа - - - - RSS - - - - - Resident set size - Размер резидентного набора - - - - MEM - - - - - memory usage (RSS-SHARE) - Использование памяти (RSS-SHARE) - - - - TRS - - - - - Text(code) resident set size - Размер резидентного набора текста(кода) - - - - DRS - - - - - Data resident set size(malloc+global variable) - Размер резидентного набора данных (malloc+глоб. перем.) - - - - STACK - - - - - Stack size - Размер стека - - - - SHARE - - - - - Shared memory with other libs - Память, разделенная с другими библиотеками - - - - SWAP - - - - - Kbytes on swap device - Kбайт на устройстве подкачки - - - - IO_R - - - - - io read (file) - Прочитано ввода (файлы) - - - - IO_W - - - - - io write (file) - Записано вывода (файлы) - - - - DT - - - - - Number of dirty (non-written) pages - Число «грязных» (незаписанных) страниц - - - - STAT - - - - - State of the process - Состояние процесса - - - - FLAGS - - - - - Process flags (hex) - Флаги процесса (шестн.) - - - - WCHAN - - - - - Kernel function where process is sleeping - Функция ядра, в которой спит процесс - - - - %WCPU - - - - - Weighted percentage of CPU (30 s average) - Взвешенный процент ЦП (среднее за 30 с.) - - - - %CPU - - - - - Percentage of CPU used since last update - Процент ЦП с момента последнего обновления - - - - %MEM - - - - - Percentage of memory used (RSS/total mem) - Процент использования памяти (RSS/всего) - - - - START - - - - - Time process started - Время запуска процесса - - - - TIME - - - - - Total CPU time used since start - Общее время ЦП с момента запуска - - - - CPU - - - - - CPU the process is executing on (SMP system) - ЦП, на котором выполняется процесс (системы SMP) - - - - the process name - Имя процесса - - - - Process Name - Имя процесса - - - - CWD - - - - - Current working directory - Текущий рабочий каталог - - - - ROOT - - - - - Root directory of process - Корневой каталог процесса - - - - COMMAND_LINE - - - - - Command line that started the process - Командная строка процесса - - - - QObject - - - Show - Показать окно - - - - Hide - Скрыть окно - - - - ScreenShot - Снимок экрана - - - - Quit - Выход - - - - Qps - - - header_popup - - - - - Remove Field - Удалить поле - - - - Add Field - Добавить поле - - - - Command - Команда - - - - View - Вид - - - - Process - Процесс - - - - Log - Журнал - - - - Custom Fields - Поля пользователя - - - - Basic Fields - Основные поля - - - - Jobs Fields - Поля задач - - - - Memory Fields - Поля памяти - - - - Scheduling Fields - Поля планировщика - - - - Select Custom Fields... - Выбор полей... - - - - Option - Параметры - - - - Update Period... - Период обновления... - - - - Show Status bar - Строка состояния - - - - Preferences... - Настройки... - - - - Help - Справка - - - - - About - О программе - - - - Detail - Подробности - - - - test - - - - - Copied to Clipboard - Скопировано в Буфер обмена - - - - context popup - - - - - Renice... - Изменить nice... - - - - Scheduling... - Планирование... - - - - Terminate - Прервать - - - - Hangup - Обрыв линии - - - - Kill - Прервать (SIGKILL) - - - - Stop - Остановить - - - - Continue - Продолжить - - - - SIGINT (interrupt) - SIGINT (прерывание) - - - - SIGCONT (continue) - SIGCONT (продолжить) - - - - SIGSTOP (stop) - SIGSTOP (остановить) - - - - SIGQUIT (quit) - SIGQUIT (выйти) - - - - SIGILL (illegal instruction) - SIGILL (неверная инструкция) - - - - SIGABRT (abort) - SIGABRT (принудительное завершение) - - - - SIGFPE (floating point exception) - SIGFPE (исключение плавающей точки) - - - - SIGSEGV (segmentation violation) - SIGSEGV (ошибка сегментирования) - - - - SIGPIPE (broken pipe) - SIGPIPE (обрыв канала) - - - - SIGALRM (timer signal) - SIGALRM (сигнал таймера) - - - - SIGUSR1 (user-defined 1) - SIGUSR1 (пользовательский 1) - - - - SIGUSR2 (user-defined 2) - SIGUSR2 (пользовательский 2) - - - - SIGCHLD (child death) - SIGCHLD (завершился порожденный) - - - - SIGTSTP (stop from tty) - SIGTSTP (остановка с терминала) - - - - SIGTTIN (tty input) - SIGTTIN (ввод с терминала) - - - - SIGTTOU (tty output) - SIGTTOU (вывод на терминал) - - - - View Details - Просмотр подробностей - - - - WatchDog - Сторожевой таймер - - - - Edit Commands... - Правка команд... - - - - Quit - Выход - - - - - - - - - Permission denied - Отказ в доступе - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - У вас нет разрешения на изменение приоритета процессов. Только владелец процесса и суперпользователь может это сделать. - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - У вас нет разрешения на изменение приоритета процесса %1 (%2). Только владелец процесса и суперпользователь может это сделать. - - - - Only the super-user may lower the nice value of a process. - Только суперпользователь может понизить значение nice. - - - - Only the super-user may change the scheduling policy and static priority. - Только суперпользователь может изменить политику планировщика и статический приоритет. - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - У вас нет разрешения на смену политики планировщика или приоритета процесса %1 (%2). Только суперпользователь может это сделать. - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - У вас нет разрешения на отправку сигнала процессу %1 (%2). Только владелец процесса и суперпользователь могут отправлять ему сигналы. - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - <h2> Qps %1 - Графический диспетчер процессов </h2> %2 использует библиотеку Qt %3<br><br><b>Исходный код: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Отчеты об ошибках: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - <b>Оригинальный Qps разработан:</b><br>Маттиас Энгдегорд (f91-men@nada.kth.se)<br><br><b>Участники:</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Луис Перейра (luis.artur.pereira@gmail.com)<br>Элф Гаида (agaida@siduction.org)<br>Пауло Лютье (paulolieuthier@gmail.com)<br>Жером Лекланш (jerome@leclan.ch)<br> - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - <H1>Справка QPS</H1>Обновлено: 24 мая 2005 г.<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Выход </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Обновить </td> <td>&nbsp;Пробел , Ввод </td> </tr> <tr><td> завершить процесс </td> <td> ALT + T , DELETE </td> </tr> <tr><td> прервать процесс (kill) </td> <td> ALT + K </td> </tr> </tbody></table> - - - - SchedDialog - - - Change scheduling - Изменить планирование - - - - Scheduling Policy - Политика планировщика - - - - SCHED_OTHER (time-sharing) - SCHED_OTHER (разделение времени) - - - - SCHED_FIFO (real-time) - SCHED_FIFO (реального времени) - - - - SCHED_RR (real-time) - SCHED_RR (реального времени) - - - - OK - ОК - - - - Cancel - Отмена - - - - Priority (1-99): - Приоритет (1-99): - - - - Invalid Input - Неверный ввод - - - - The priority must be in the range 1..99 - Приоритет должен быть в диапазоне 1..99 - - - - Screenshot - - - /untitled. - - - - - Save As - Сохранить как - - - - %1 Files (*.%2);;All Files (*) - Файлы %1 (*.%2);;Все файлы (*) - - - - Options - Параметры - - - - s - с. - - - - Screenshot Delay: - Задержка снимка экрана: - - - - Hide This Window - Скрыть это окно - - - - New Screenshot - Новый снимок - - - - Quit - Выход - - - - SearchBox - - - PID,COMMAND,USER... - - - - - SliderDialog - - - Renice Process - Изменить nice - - - - New nice value: - Новое значение nice: - - - - Cancel - Отмена - - - - OK - - - - - Sockets - - - Fd - - - - - File descriptor - Дескриптор файла - - - - Proto - - - - - Protocol (TCP or UDP) - Протокол (TCP или UDP) - - - - Recv-Q - - - - - Bytes in receive queue - Байт в очереди приема - - - - Send-Q - - - - - Bytes in send queue - Байт в очереди отправки - - - - Local Addr - - - - - Local IP address - Локальный IP-адрес - - - - - Port - - - - - Local port - Локальный порт - - - - Remote Addr - - - - - Remote IP address - Удаленный IP-адрес - - - - Remote port - Удаленный порт - - - - State - Состояние - - - - Connection state - Состояние соединения - - - - StatusBar - - - Process count: %1 - Число процессов: %1 - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - Это нестабильная альфа функции -Она может привести к ошибке сегментации... - - - - TFrame - - - this is Tframe widget - - - - - UFrame - - - title - - - - - WatchdogDialog - - - if process start - при запуске процесса - - - - if process finish - при завершении процесса - - - - select condition - выберите условие - - - diff --git a/src/translations/qps_ru_RU.ts b/src/translations/qps_ru_RU.ts deleted file mode 100644 index 58a3283..0000000 --- a/src/translations/qps_ru_RU.ts +++ /dev/null @@ -1,1772 +0,0 @@ - - - - - AllFields - - - Field - - - - - Field name - - - - - Description - - - - - Field description - - - - - Value - - - - - Field value - - - - - Boxvar - - - Exit On Close Button - - - - - Host Name Lookup - - - - - Service Name Lookup - - - - - Disclosure Triangles - - - - - Branch Lines - - - - - Auto Save Settings on Exit - - - - - Selection: Copy PIDs to Clipboard - - - - - Normalize NICE - - - - - Use pmap for Map Names - - - - - Cbgroup - - - General - - - - - Command - - - The command: - - - - - - - - -failed with the error: - - - - - - - Too many processes - - - - - Unknown error - - - - - - -could not be executed because it was not found, -or you did not have execute permission. - - - - - - -exited with status - - - - - Command Failed - - - - - CommandDialog - - - Edit Commands 0.1 alpha - - - - - Name: - - - - - Popup - - - - - Command Line: - - - - - Substitutions: -%p PID -%c COMMAND -%C CMDLINE -%u USER -%% % - - - - - - - New... - - - - - - Add... - - - - - Delete - - - - - Close - - - - - ControlBar - - - Linear - - - - - Tree - - - - - All Processes - - - - - Your Processes - - - - - Non-Root Processes - - - - - Running Processes - - - - - Pause (Ctrl+Space) - - - - - Details - - - Process %1 ( %2 ) - details - - - - - Files - - - - - Sockets - - - - - Memory Maps - - - - - Environment - - - - - All Fields - - - - - Environ - - - Variable - - - - - Variable name - - - - - Value - - - - - Variable value - - - - - EventDialog - - - Watchdog 0.1 alpha - - - - - Eventcat - - - - - Select condition - - - - - labelDescrition - - - - - Enable - - - - - process name - - - - - cpu - - - - - % - - - - - include already running process - - - - - run command - - - - - show Message - - - - - Help (Not yet. just concept) - - - - - %p : pid -%c : command - - - - - New - - - - - Add - - - - - Delete - - - - - Close - - - - - ExecWindow - - - Qps - - - - - Ok - - - - - Qps Watchdog - - - - - %1 exit with code %2 - - - - - Close - - - - - %1 [running] - - - - - terminate command - - - - - Error %1 : [%2] Maybe command not found - - - - - FieldSelect - - - Select Custom Fields - - - - - Close - - - - - Files - - - Fd - - - - - File descriptor - - - - - Mode - - - - - Open mode - - - - - Name - - - - - File name (if available) - - - - - IntervalDialog - - - Change Update Period - - - - - New Update Period - - - - - Cancel - - - - - OK - - - - - No UPDATE - - - - - Invalid value - - - - - ListModel - - - Event Category - - - - - Enable - - - - - Maps - - - Address Range - - - - - Mapped addresses (hex) ) - - - - - Size - - - - - Kbytes mapped (dec) - - - - - Perm - - - - - Permission flags - - - - - Offset - - - - - File offset at start of mapping (hex) - - - - - Device - - - - - Major,Minor device numbers (dec) - - - - - Inode - - - - - Inode number (dec) - - - - - File - - - - - File name (if available) - - - - - PermissionDialog - - - Permission - - - - - Root password - - - - - Cancel - - - - - OK - - - - - Preferences - - - Preferences - - - - - Setting - - - - - %CPU divided by - - - - - Total cpu: %1 - - - - - Single cpu: 1 - - - - - default - - - - - for developer - - - - - Appearance - - - - - Proc - - - PID - - - - - Process ID - - - - - TGID - - - - - Task group ID ( parent of threads ) - - - - - PPID - - - - - Parent process ID - - - - - PGID - - - - - Process group ID - - - - - SID - - - - - Session ID - - - - - TTY - - - - - Terminal - - - - - TPGID - - - - - Process group ID of tty owner - - - - - USER - - - - - Owner (*=suid root, +=suid a user) - - - - - GROUP - - - - - Group name (*=sgid other) - - - - - UID - - - - - Real user ID - - - - - EUID - - - - - Effective user ID - - - - - SUID - - - - - Saved user ID (Posix) - - - - - FSUID - - - - - File system user ID - - - - - GID - - - - - Real group ID - - - - - EGID - - - - - Effective group ID - - - - - SGID - - - - - Saved group ID (Posix) - - - - - FSGID - - - - - File system group ID - - - - - PRI - - - - - Dynamic priority - - - - - NICE - - - - - Scheduling favour (higher -> less cpu time) - - - - - NLWP - - - - - Number of tasks(threads) in task group - - - - - PLCY - - - - - Scheduling policy - - - - - RPRI - - - - - Realtime priority (0-99, more is better) - - - - - TMS - - - - - Time slice in milliseconds - - - - - %SAVG - - - - - Percentage average sleep time (-1 -> N/A) - - - - - CPUSET - - - - - Affinity CPU mask (0 -> API not supported) - - - - - MAJFLT - - - - - Number of major faults (disk access) - - - - - MINFLT - - - - - Number of minor faults (no disk access) - - - - - VSIZE - - - - - Virtual image size of process - - - - - RSS - - - - - Resident set size - - - - - MEM - - - - - memory usage (RSS-SHARE) - - - - - TRS - - - - - Text(code) resident set size - - - - - DRS - - - - - Data resident set size(malloc+global variable) - - - - - STACK - - - - - Stack size - - - - - SHARE - - - - - Shared memory with other libs - - - - - SWAP - - - - - Kbytes on swap device - - - - - IO_R - - - - - io read (file) - - - - - IO_W - - - - - io write (file) - - - - - DT - - - - - Number of dirty (non-written) pages - - - - - STAT - - - - - State of the process - - - - - FLAGS - - - - - Process flags (hex) - - - - - WCHAN - - - - - Kernel function where process is sleeping - - - - - %WCPU - - - - - Weighted percentage of CPU (30 s average) - - - - - %CPU - - - - - Percentage of CPU used since last update - - - - - %MEM - - - - - Percentage of memory used (RSS/total mem) - - - - - START - - - - - Time process started - - - - - TIME - - - - - Total CPU time used since start - - - - - CPU - - - - - CPU the process is executing on (SMP system) - - - - - the process name - - - - - Process Name - - - - - CWD - - - - - Current working directory - - - - - ROOT - - - - - Root directory of process - - - - - COMMAND_LINE - - - - - Command line that started the process - - - - - QObject - - - Show - - - - - Hide - - - - - ScreenShot - - - - - Quit - - - - - Qps - - - header_popup - - - - - Remove Field - - - - - Add Field - - - - - Command - - - - - View - - - - - Process - - - - - Log - - - - - Custom Fields - Заданные поля - - - - Basic Fields - - - - - Jobs Fields - - - - - Memory Fields - - - - - Scheduling Fields - - - - - Select Custom Fields... - Выбор заданных полей... - - - - Option - - - - - Update Period... - - - - - Show Status bar - - - - - Preferences... - - - - - Help - - - - - - About - - - - - Detail - - - - - test - - - - - Copied to Clipboard - - - - - context popup - - - - - Renice... - - - - - Scheduling... - - - - - Terminate - - - - - Hangup - - - - - Kill - - - - - Stop - - - - - Continue - - - - - SIGINT (interrupt) - - - - - SIGCONT (continue) - - - - - SIGSTOP (stop) - - - - - SIGQUIT (quit) - - - - - SIGILL (illegal instruction) - - - - - SIGABRT (abort) - - - - - SIGFPE (floating point exception) - - - - - SIGSEGV (segmentation violation) - - - - - SIGPIPE (broken pipe) - - - - - SIGALRM (timer signal) - - - - - SIGUSR1 (user-defined 1) - - - - - SIGUSR2 (user-defined 2) - - - - - SIGCHLD (child death) - - - - - SIGTSTP (stop from tty) - - - - - SIGTTIN (tty input) - - - - - SIGTTOU (tty output) - - - - - View Details - - - - - WatchDog - - - - - Edit Commands... - - - - - Quit - - - - - - - - - - Permission denied - - - - - You do not have permission to renice the selected processes. Only the process owner and the super-user are allowed to do that. - - - - - You do not have permission to renice process %1 (%2).Only the process owner and the super-user are allowed to do that. - - - - - Only the super-user may lower the nice value of a process. - - - - - Only the super-user may change the scheduling policy and static priority. - - - - - You do not have permission to change the scheduling and/or priority of process %1 (%2). Only the super-user may do that. - - - - - You do not have permission to send a signal to process %1 (%2). Only the super-user and the owner of the process may send signals to it. - - - - - <h2> Qps %1 - A Visual Process Manager </h2> %2 using Qt library %3<br><br><b>Source: </b><a href="https://github.com/lxqt/qps">https://github.com/lxqt/qps/</a><br><b>Bugtracker: </b><a href="https://github.com/lxqt/qps/issues">https://github.com/lxqt/qps/issues</a> - - - - - <b>Original Qps by</b><br>Mattias Engdegård (f91-men@nada.kth.se)<br><br><b>Contributors</b><br>Olivier.Daudel@u-paris10.fr<br>jsanchez@todounix.homeip.net <br>daehyun.yang@gmail.com <br>Luís Pereira (luis.artur.pereira@gmail.com)<br>Alf Gaida (agaida@siduction.org)<br>Paulo Lieuthier (paulolieuthier@gmail.com)<br>Jerome Leclanche (jerome@leclan.ch)<br> - - - - - <H1>QPS Help</H1>Updated: May 24 2005<BR><A HREF="http://kldp.net/projects/qps">http://kldp.net/projects/qps</A><HR><table style="text-align: center; width: 100%;" border="1" cellpadding="1" cellspacing="0"> <tbody> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Quit </td> <td >&nbsp; CTRL + q , CTRL + x </td> </tr> <tr> <td style="vertical-align: top; background-color: rgb(204, 204, 204);">Update </td> <td>&nbsp;Space , Enter </td> </tr> <tr><td> process Terminate </td> <td> ALT + T , DELETE </td> </tr> <tr><td> process Kill </td> <td> ALT + K </td> </tr> </tbody></table> - - - - - SchedDialog - - - Change scheduling - - - - - Scheduling Policy - - - - - SCHED_OTHER (time-sharing) - - - - - SCHED_FIFO (real-time) - - - - - SCHED_RR (real-time) - - - - - OK - - - - - Cancel - - - - - Priority (1-99): - - - - - Invalid Input - - - - - The priority must be in the range 1..99 - - - - - Screenshot - - - /untitled. - - - - - Save As - - - - - %1 Files (*.%2);;All Files (*) - - - - - Options - - - - - s - - - - - Screenshot Delay: - - - - - Hide This Window - - - - - New Screenshot - - - - - Quit - - - - - SearchBox - - - PID,COMMAND,USER... - - - - - SliderDialog - - - Renice Process - - - - - New nice value: - - - - - Cancel - - - - - OK - - - - - Sockets - - - Fd - - - - - File descriptor - - - - - Proto - - - - - Protocol (TCP or UDP) - - - - - Recv-Q - - - - - Bytes in receive queue - - - - - Send-Q - - - - - Bytes in send queue - - - - - Local Addr - - - - - Local IP address - - - - - - Port - - - - - Local port - - - - - Remote Addr - - - - - Remote IP address - - - - - Remote port - - - - - State - - - - - Connection state - - - - - StatusBar - - - Process count: %1 - - - - - TBloon - - - This is unstable Alpha feature - You maybe see a SEGFAULT... - - - - - TFrame - - - this is Tframe widget - - - - - UFrame - - - title - - - - - WatchdogDialog - - - if process start - - - - - if process finish - - - - - select condition - - - - diff --git a/src/trayicon.cpp b/src/trayicon.cpp deleted file mode 100644 index bf7d301..0000000 --- a/src/trayicon.cpp +++ /dev/null @@ -1,263 +0,0 @@ -/* - * trayicon.h - system-independent trayicon class (adapted from Qt example) - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 2003 Justin Karneges - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - */ - - /* - really sucking codes.. sorry.. - from psi , modified and cleand by fasthyun@magicn.com - trayicon_x11.cpp - X11 trayicon (for use with KDE and GNOME) - Copyright (C) 2003 Justin Karneges - GNOME2 Notification Area support: Tomasz Sterna - - */ - -#include // *****should be First!!! -#include "global.h" // Qps *qps; -#include "trayicon.h" - -#include -#include -#include -#include - -// QIcon icon = iconComboBox->itemIcon(index); -// trayIcon->setIcon(icon); - -extern bool flag_session_start; -//---------------------------------------------------------------------------- -// common stuff -//---------------------------------------------------------------------------- -// for Gnome2 Notification Area -static int dock_xerror = 0; -extern bool flag_xcompmgr; - -#define SYSTEM_TRAY_REQUEST_DOCK 0 -#define SYSTEM_TRAY_BEGIN_MESSAGE 1 -#define SYSTEM_TRAY_CANCEL_MESSAGE 2 - -TrayIcon::TrayIcon(const QPixmap &icon, const QString &tooltip, QMenu *popup, - QWidget *parent, const char *name) - : QSystemTrayIcon(0 /* shoud be NULL!! */), pop(popup), pm(icon), - tip(tooltip) -{ - flag_show_tip = false; - flag_systray_ready = false; - inTray = false; - isWMDock = false; - - QSystemTrayIcon::setIcon(icon); - QSystemTrayIcon::setContextMenu(popup); - - if (!pm.width() || !pm.height()) - pm = QPixmap(45, 45); -} - -/*! - Removes the icon from the system tray and frees all allocated resources. -*/ -TrayIcon::~TrayIcon() { sysRemove(); } - -/*! - Sets the context menu to \a popup. The context menu will pop up when the - user clicks the system tray entry with the right mouse button. -*/ -void TrayIcon::setPopup(QMenu *popup) { pop = popup; } - -/*! - Returns the current popup menu. -*/ -QMenu *TrayIcon::popup() const { return pop; } - -QPixmap TrayIcon::icon() const { return pm; } - -//---------------------------------------------------------------------------- -// TrayIcon -//---------------------------------------------------------------------------- -// DRAFT Code (by fasthyun@magicn.com) -void TrayIcon::init_TrayIconFreeDesktop() {} - -void TrayIcon::init_WindowMakerDock() {} - -void TrayIcon::sysInstall() -{ - /// boolSysTray=hasSysTray(); - - if (hasSysTray() == true) - { - show(); - } - /* - if(hasSysTray()==false) - { - setFixedSize(46,46); // setIconSize - init_WindowMakerDock(); - setSysTray(true); - } */ -} - -bool TrayIcon::hasSysTray() { return QSystemTrayIcon::isSystemTrayAvailable(); } - -void TrayIcon::sysRemove() -{ - // printf("Qps: sysRemove\n"); - inTray = false; - /// boolSysTray=isWMDock=false; - hide(); -} - -/*! - update systray icon - called by qps::refresh() -*/ -void TrayIcon::setIcon(const QPixmap &pix) -{ - QSystemTrayIcon::setIcon(pix); - if (isVisible() == false) - return; - pm = pix; -} - -/*! - \property TrayIcon::toolTip - \brief the tooltip for the system tray entry - - On some systems, the tooltip's length is limited and will be truncated as - necessary. -*/ -void TrayIcon::setToolTip(const QString &tooltip) -{ - if (pop->isVisible()) - flag_show_tip = false; - if (flag_show_tip) - QToolTip::showText(tip_pos, tooltip); - else - QToolTip::hideText(); - tip = tooltip; -} - -void TrayIcon::leaveEvent(QEvent *) { flag_show_tip = false; } - -void TrayIcon::mouseMoveEvent(QMouseEvent *e) -{ - // printf("move\n"); - // QToolTip::showText(QPoint(0,0),"" ); - // QToolTip::showText(e->globalPos(),tip ); - tip_pos = e->globalPos(); - flag_show_tip = true; - QToolTip::showText(tip_pos, tip); - e->accept(); -} - -void TrayIcon::mousePressEvent(QMouseEvent *e) -{ - // test_xapp(); - // This is for X11, menus appear on mouse press - // I'm not sure whether Mac should be here or below.. Somebody check? - switch (e->button()) - { - case Qt::RightButton: - if (pop) - { - pop->popup(e->globalPos()); - e->accept(); - } - break; - case Qt::LeftButton: - case Qt::MidButton: - // emit clicked( e->globalPos(), e->button() ); - emit clicked(e->globalPos()); - default: - break; - } - e->ignore(); -} - -void TrayIcon::mouseReleaseEvent(QMouseEvent *e) -{ - // printf("mouseReleaseEvent\n"); - switch (e->button()) - { - case Qt::RightButton: - if (pop) - { - // Necessary to make keyboard focus - // and menu closing work on Windows. - // e->accept(); - } - break; - case Qt::LeftButton: - case Qt::MidButton: - // emit clicked( e->globalPos(), e->button() ); - // emit clicked( e->globalPos()); - break; - default: - break; - } - e->ignore(); -} - -void TrayIcon::mouseDoubleClickEvent(QMouseEvent *e) -{ - if (e->button() == Qt::LeftButton) - emit doubleClicked(e->globalPos()); - e->accept(); -} - -// this will be called before shown !! -void TrayIcon::paintEvent(QPaintEvent *) -{ - /* - //printf("paintEvent()\n"); - QPainter p(this); - int w,h; - if(isVisible()==false) // ** important to prevent X11 Error !! - { - // printf("paintEvent(): hidden\n"); - return; - } - w=width()/2 ; - h=height()/2; - p.drawPixmap(w - pm.width()/2, h - pm.height()/2, pm); */ -} - -// for session logout ?? never called -void TrayIcon::closeEvent(QCloseEvent *e) -{ - printf("TrayIcon::closeEvent()\n"); - e->accept(); -} - -// called after size changed -void TrayIcon::resizeEvent(QResizeEvent *e) -{ - int w, h; - // printf("TrayIcon::resizeEvent(): w=%d,h=%d\n",width(),height()); - // if(isVisible()==false) return; // X11 error !! - /// w=width();h=height(); - if (isWMDock) - { - /// w=w-14;h=h-14; - } - // qps->setIconSize(w,h); -} - -void QPS_SHOW(); diff --git a/src/trayicon.h b/src/trayicon.h deleted file mode 100644 index 2fc959d..0000000 --- a/src/trayicon.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * trayicon.h - system-independent trayicon class (adapted from Qt example) - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 2003 Justin Karneges - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - */ - -#ifndef CS_TRAYICON_H -#define CS_TRAYICON_H - -#include -#include - -#include - -//---------------------------------------------------------------------------- -// TrayIconPrivate -//---------------------------------------------------------------------------- - -class TrayIcon : public QSystemTrayIcon -{ - Q_OBJECT - public: - TrayIcon(const QPixmap &, const QString &, QMenu *popup = 0, - QWidget *parent = 0, const char *name = 0); - ~TrayIcon(); - - // use WindowMaker dock mode. ignored on non-X11 platforms - void setWMDock(bool use) { isWMDock = use; } - bool checkWMDock() { return isWMDock; } - bool hasSysTray(); - void setSysTray(bool val) - { // boolSysTray=val; - } - - // Set a popup menu to handle RMB - void setPopup(QMenu *); - QMenu *popup() const; - - QPixmap icon() const; - - void sysInstall(); - void sysRemove(); - - void init_TrayIconFreeDesktop(); - void init_WindowMakerDock(); - - public slots: - void setIcon(const QPixmap &icon); - void setToolTip(const QString &tip); -signals: - void clicked(const QPoint &); - void clicked(const QPoint &, int); - void doubleClicked(const QPoint &); - void closed(); - - protected: - // bool event( QEvent *e ); - virtual void mouseMoveEvent(QMouseEvent *e); - virtual void mousePressEvent(QMouseEvent *e); - virtual void mouseReleaseEvent(QMouseEvent *e); - virtual void mouseDoubleClickEvent(QMouseEvent *e); - virtual void leaveEvent(QEvent *); - - void paintEvent(QPaintEvent *); - void resizeEvent(QResizeEvent *e); - // void hideEvent ( QHideEvent *e ); // called after hide() - void closeEvent(QCloseEvent *e); - - private: - QMenu *pop; - QPixmap pm; - QString tip; - QPoint tip_pos; - - bool isWMDock; - // bool boolSysTray; //DEL? - bool inTray; - bool flag_systray_ready; - bool flag_show_tip; - - // DEL void sysUpdateToolTip(); -}; - -#endif // CS_TRAYICON_H diff --git a/src/ttystr.cpp b/src/ttystr.cpp deleted file mode 100644 index c4e3e68..0000000 --- a/src/ttystr.cpp +++ /dev/null @@ -1,228 +0,0 @@ -/* - * ttystr.cpp - * - * Copyright 1997-1999 Mattias Engdegård - * This file is part of qps -- Qt-based visual process status monitor - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include -#include -#include -#include //major() minor() -#include -#include -#include -#include -#include -#include "ttystr.h" - -#ifdef LINUX - -// Table of various tty devices (mostly serial boards) - -struct Ttytab -{ - short dev_maj; // major number of tty - char prefix; - char callout; // 1 if callout device, 0 if tty -}; - -static Ttytab ttytab[] = {{19, 'C', 0}, // Cyclades - {20, 'b', 1}, - {22, 'D', 0}, // Digiboard - {23, 'd', 1}, - {24, 'E', 0}, // Stallion - {25, 'e', 1}, - {32, 'X', 0}, // Specialix - {33, 'x', 1}, - {46, 'R', 0}, // Comtrol Rocketport - {47, 'r', 1}, - {48, 'L', 0}, // SDL RISCom - {49, 'l', 1}, - {57, 'P', 0}, // Hayes ESP - {58, 'p', 1}, - {71, 'F', 0}, // Computone IntelliPort II - {72, 'f', 1}, - {75, 'W', 0}, // Specialix IO8+ - {76, 'w', 1}, - {78, 'M', 0}, // PAM Software's multimodem boards - {79, 'm', 1}, - {105, 'V', 0}, // Comtrol VS-1000 - {106, 'v', 1}, - {0, 0, 0}}; - -// Return tty name of a device. Remove leading "tty" if any. -// Return "-" if devnr is zero, "?" if unknown. -QString Ttystr::name(dev_t devnr) -{ - if (devnr == 0) - return "-"; - - int dmin = minor(devnr); - int dmaj = major(devnr); - char name[40]; - switch (dmaj) - { - case 3: - // BSD-style pty slaves - name[0] = "pqrstuvwxyzabcde"[(dmin >> 4) & 0xf]; - name[1] = "0123456789abcdef"[dmin & 0xf]; - name[2] = '\0'; - break; - - case 4: - if (dmin < 64) - { - // virtual console 0..63 - sprintf(name, "%d", dmin); - } - else if (dmin < 128) - { - // serial port 0..63 - sprintf(name, "S%d", dmin - 64); - } - else if (dmin >= 192 && dmin < 256) - { - // obsolete tty devices - name[0] = "pqrs"[(dmin >> 4) & 0x3]; - name[1] = "0123456789abcdef"[dmin & 0xf]; - name[2] = '\0'; - } - else - strcpy(name, "?"); - break; - - case 5: - // alternate tty devices - switch (dmin) - { - case 0: - strcpy(name, "tty"); - break; - - case 1: - strcpy(name, "console"); - break; - - case 2: - strcpy(name, "ptmx"); - break; - - default: - if (dmin >= 64 && dmin < 128) - { - // callout devices 0..63 - sprintf(name, "cua%d", dmin - 64); - } - else - strcpy(name, "?"); - } - - default: - if (dmaj >= 136 && dmaj < 144) - { - // Unix98 pty slaves - sprintf(name, "pts/%d", ((dmaj - 136) << 8) + dmin); - break; - } - - // Various serial tty devices - for (int i = 0; ttytab[i].dev_maj; i++) - { - if (dmaj == ttytab[i].dev_maj) - { - sprintf(name, "%s%c%d", ttytab[i].callout ? "cu" : "", - ttytab[i].prefix, dmin); - break; - } - } - strcpy(name, "?"); - } - return name; -} - -#endif // LINUX - -#ifdef SOLARIS - -QHash Ttystr::dict; -bool Ttystr::scanned = FALSE; - -// return tty name, '-' if no tty, "??" if unidentifiable tty -QString Ttystr::name(dev_t devnr) -{ - if (!scanned) - { - read_devs(); - scanned = TRUE; // just scan /dev once - } - QString s; - if (devnr == (dev_t)-1) - s = "-"; - else - { - char *ts = dict.value(devnr, NULL); - - if (ts) - s = ts; - else - s = "??"; - } - return s; -} - -// scan device directory or subdirectory thereof -void Ttystr::scandevdir(const char *prefix) -{ - char dirname[80] = "/dev"; - strcat(dirname, prefix); - DIR *d = opendir(dirname); - if (!d) - return; - struct dirent *e; - struct stat sb; - char name[80]; - while ((e = readdir(d)) != 0) - { - sprintf(name, "/dev%s/%s", prefix, e->d_name); - if (stat(name, &sb) >= 0) - { - if (S_ISCHR(sb.st_mode)) - { - dev_t d = sb.st_rdev; - if (!dict.value(d, NULL)) - { - dict.insert(sb.st_rdev, strdup(name + 5)); // skip "/dev/" - } - } - } - } - closedir(d); -} - -void Ttystr::read_devs() -{ - // scan /dev and various subdirectories. In case of duplicates, pick - // the first name encountered - scandevdir("/term"); - scandevdir(""); - scandevdir("/pts"); - scandevdir("/cua"); -} - -#endif // SOLARIS diff --git a/src/ttystr.h b/src/ttystr.h deleted file mode 100644 index f423f03..0000000 --- a/src/ttystr.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * ttystr.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef TTYSTR_H -#define TTYSTR_H - -#include "config.h" -#include - -#ifdef LINUX -#include -#endif - -#ifdef SOLARIS -#include -#endif - -class Ttystr -{ - public: - static QString name(dev_t devnr); - -#ifdef SOLARIS - private: - static void read_devs(); - static void scandevdir(const char *prefix); - - static QHash dict; - static bool scanned; -#endif -}; - -#endif // TTYSTR_H diff --git a/src/uidstr.cpp b/src/uidstr.cpp deleted file mode 100644 index c65615b..0000000 --- a/src/uidstr.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * uidstr.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include -#include -#include -#include -#include -#include - -#include "uidstr.h" - -QHash Uidstr::udict; -QHash Uidstr::gdict; - -// return user name (possibly numeric) -QString Uidstr::userName(int uid) -{ - char *p = udict.value(uid, NULL); - if (!p) - { - struct passwd *pw = getpwuid(uid); - if (!pw) - { - p = (char *)malloc(11); - sprintf(p, "%d", uid); - } - else - p = strdup(pw->pw_name); - udict.insert(uid, p); - // if(udict.count() > udict.size() * 3) - // udict.resize(udict.count()); - } - QString s(p); - return s; -} - -// return group name (possibly numeric) - -QString Uidstr::groupName(int gid) -{ - char *p = gdict[gid]; - if (!p) - { - struct group *gr = getgrgid(gid); - if (!gr) - { - p = (char *)malloc(11); - sprintf(p, "%d", gid); - } - else - p = strdup(gr->gr_name); - gdict.insert(gid, p); - // if(gdict.count() > gdict.size() * 3) - // gdict.resize(gdict.count()); - } - QString s(p); - return s; -} diff --git a/src/uidstr.h b/src/uidstr.h deleted file mode 100644 index d455023..0000000 --- a/src/uidstr.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * uidstr.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef UIDSTR_H -#define UIDSTR_H - -#include -#include - -class Uidstr -{ - public: - static QString userName(int uid); - static QString groupName(int gid); - - private: - static QHash udict; - static QHash gdict; -}; - -#endif // UIDSTR_H diff --git a/src/watchcond.cpp b/src/watchcond.cpp deleted file mode 100644 index ae21a65..0000000 --- a/src/watchcond.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* - * watchcond.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include "watchcond.h" - -QString watchCond::getVal(QString &str, const char *key) -{ - int n; // key.length(); - int idx = str.indexOf(key); - if (idx < 0) - return "cant' found"; - - idx = str.indexOf("[", idx); - if (idx < 0) - return "[ error"; - int idx_end = str.indexOf("]", idx); - if (idx_end < 0) - return "] error"; - n = idx_end - idx; - return str.mid(idx + 1, n - 1); -} -QString watchCond::getstring() -{ - QString string; - string.clear(); - switch (cond) - { - case WATCH_PROCESS_FINISH: - string.append("if process [" + procname + "] finish, "); - // string=string.sprintf("if process [%s] finish",procname); - break; - case WATCH_PROCESS_START: - string.append("if process [" + procname + "] start, "); - break; - case WATCH_SYS_CPU_OVER: - string.append("if sys_cpu over [" + QString::number(cpu) + "], "); - break; - case WATCH_SYS_CPU_UNDER: - string.append("if sys_cpu under [" + QString::number(cpu) + "], "); - break; - default: - ; - } - if (!command.isEmpty()) - string.append("exec [" + command + "] "); - if (!message.isEmpty()) - string.append("showmsg [" + message + "] "); - if (enable) - string.append("enabled"); - else - string.append("disabled"); - - return string; -} -void watchCond::putstring(QString str) -{ - if (str.contains("if process")) - { - if (str.contains("start")) - cond = WATCH_PROCESS_START; - if (str.contains("finish")) - cond = WATCH_PROCESS_FINISH; - procname = getVal(str, "if process"); - } - if (str.contains("exec")) - command = getVal(str, "exec"); - if (str.contains("showmsg")) - message = getVal(str, "showmsg"); - if (str.contains("enabled")) - enable = true; - else - enable = false; -} diff --git a/src/watchcond.h b/src/watchcond.h deleted file mode 100644 index fafd12c..0000000 --- a/src/watchcond.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * watchcond.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef WATCHCOND_H -#define WATCHCOND_H - -#include - -#define WATCH_PROCESS_START 0 -#define WATCH_PROCESS_FINISH 1 -#define WATCH_PROCESS_CPU_OVER 2 -#define WATCH_SYS_CPU_OVER 3 -#define WATCH_SYS_CPU_UNDER 4 - - -// if process [name] start, exec [command], showmsg [xxx] -// if process [name] finish exec [command], showmsg [xxx] -// if system cpu over [90%], exec [command], msg [xxx] -// if system cpu under [10%], exec [command], msg [xxx] -// if process [name] cpu over [90%] exec [command] msg [xxx] -// if process [name] start, kill_it, msg [xxx] -// if process [name] start, soundplay [ ], msg [xxx] - -class watchCond -{ - public: - int cond; - int enable; - int cpu; - QString procname; - QString command; - QString message; - - watchCond() - { - enable = 0; - // procname[0]=0; command[0]=0; - // message[0]=0; - } - // key [txt] [a] - // QString getVal(QString &str, QString &key) - QString getVal(QString &str, const char *key); - QString getstring(); - void putstring(QString str); -}; - -#endif // WATCHCOND_H diff --git a/src/watchdog.ui b/src/watchdog.ui deleted file mode 100644 index a53df12..0000000 --- a/src/watchdog.ui +++ /dev/null @@ -1,458 +0,0 @@ - - - EventDialog - - - - 0 - 0 - 680 - 533 - - - - - 0 - 0 - - - - Qt::WheelFocus - - - Watchdog 0.1 alpha - - - QPushButtonX { - color: rgb(244, 244, 244); - border-image: url(:/icon/vista.png); -} -QWidget { -} -QFrame, QLabel, QToolTip { - } - - - - - 6 - - - 9 - - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 8 - 1 - - - - - 16777215 - 51 - - - - - - - - true - - - - 0 - 0 - - - - Qt::NoFocus - - - Qt::NoContextMenu - - - true - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - false - - - Qt::NoPen - - - - - - - - 0 - 0 - - - - Eventcat - - - - 6 - - - 9 - - - 9 - - - 9 - - - 9 - - - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - Select condition - - - - - - - - labelDescrition - - - - - - - Qt::Horizontal - - - - 36 - 20 - - - - - - - - false - - - Enable - - - - - - - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - process name - - - - - - - - - - cpu - - - - - - - - - - - - - - - - - - - % - - - - - - 90 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - false - - - - - - include already running process - - - true - - - - - - - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - run command - - - - - - - - - - - - - - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - show Message - - - - - - - - - - - - - - - - - - - - 0 - 0 - - - - Help (Not yet. just concept) - - - - 4 - - - 9 - - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - %p : pid -%c : command - - - - - - - - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - New - - - - - - - Add - - - - - - - Delete - - - - - - - Close - - - - - - - - - - - - diff --git a/src/watchdogdialog.cpp b/src/watchdogdialog.cpp deleted file mode 100644 index 9b9b083..0000000 --- a/src/watchdogdialog.cpp +++ /dev/null @@ -1,255 +0,0 @@ -/* - * watchdogdialog.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include "watchdogdialog.h" - -#include "listmodel.h" -#include "checkboxdelegate.h" -#include "misc.h" // TBloon class -#include "qps.h" -#include "watchcond.h" - -#include - -extern QList watchlist; -extern Qps *qps; - -WatchdogDialog::WatchdogDialog() -{ - setupUi(this); - listmodel = new ListModel(); - - tableView->setModel(listmodel); - checkBoxDelegate delegate; - tableView->setEditTriggers(QAbstractItemView::SelectedClicked); - /// tableView->setItemDelegate(&delegate); - - tableView->setSelectionBehavior(QAbstractItemView::SelectRows); - tableView->setSelectionMode(QAbstractItemView::SingleSelection); - QHeaderView *h = tableView->verticalHeader(); - h->setVisible(false); - - QHeaderView *v = tableView->horizontalHeader(); -#if QT_VERSION >= 0x050000 - v->setSectionResizeMode(0, QHeaderView::Stretch); - v->setSectionResizeMode(1, QHeaderView::ResizeToContents); -#endif - // v->setClickable (false); - connect(newButton, SIGNAL(clicked()), this, SLOT(_new())); - connect(closeButton, SIGNAL(clicked()), this, SLOT(apply())); - connect(addButton, SIGNAL(clicked()), this, SLOT(add())); - connect(delButton, SIGNAL(clicked()), this, SLOT(del())); - connect(comboBox, SIGNAL(activated(int)), SLOT(comboChanged(int))); - connect(comboBox, SIGNAL(highlighted(const QString &)), - SLOT(condChanged(const QString &))); - - connect(tableView, SIGNAL(clicked(const QModelIndex &)), - SLOT(eventcat_slected(const QModelIndex &))); - connect(message, SIGNAL(textEdited(const QString &)), - SLOT(Changed(const QString &))); - connect(command, SIGNAL(textEdited(const QString &)), - SLOT(Changed(const QString &))); - connect(proc_name, SIGNAL(textEdited(const QString &)), - SLOT(Changed(const QString &))); - connect(comboBox, SIGNAL(activated(const QString &)), - SLOT(Changed(const QString &))); - - checkBox_alreadyrun->hide(); - listView->hide(); - spinBox->hide(); - label_cpu->hide(); - /// printf("close ...\n"); - // tableView->update(); - // listmodel->update(); // meaningless.. - - TBloon *bloon = new TBloon(this); - return; -} - -void WatchdogDialog::showEvent(QShowEvent *event) -{ - // Qt 4.4.0 bug? - // printf("show!!!!!!!!!\n"); - listmodel->update(); -} -void WatchdogDialog::comboChanged(int idx) -{ - - // itemText(idx); - QString str = comboBox->currentText(); - - if (str.contains("cpu")) - { - label_cpu->show(); - spinBox->show(); - } - else - { - spinBox->hide(); - label_cpu->hide(); - } - - if (str.contains("process")) - { - label_procname->show(); - proc_name->show(); - } - else - { - label_procname->hide(); - proc_name->hide(); - } - - if (message->text().isEmpty()) - { - // if(str.contains("start")) message->setText("%CMD start - // with pid %PID"); - // if(str.contains("finish")) message->setText("%CMD - // finish with pid - //%PID"); - } -} - -void WatchdogDialog::eventcat_slected(const QModelIndex &idx) -{ - - watchCond *w = watchlist[idx.row()]; - // printf("row=%d\n",at=idx.row()); - - if (idx.column() == 1) - { - w->enable = !(w->enable); - listmodel->update(idx.row()); - return; - } - - QString str = idx.data().toString(); // Qt::DisplayRol - - if (str.contains("process")) - proc_name->setText(w->procname); - else - proc_name->setText(""); - if (str.contains("cpu")) - spinBox->setSingleStep(w->cpu); - else - spinBox->setSingleStep(50); - if (str.contains("exec")) - command->setText(w->command); - else - command->setText(""); - if (str.contains("showmsg")) - message->setText(w->message); - else - message->setText(""); - - checkCombo(); - comboBox->setCurrentIndex(w->cond); -} - -void WatchdogDialog::Changed(const QString &str) -{ - QModelIndex idx = tableView->currentIndex(); - // QModelIndexList list=tableView->selectedIndexes (); - bool flag = tableView->selectionModel()->hasSelection(); - // if(list.count() and idx.isValid()) - if (flag and idx.isValid()) - { - int at = idx.row(); - watchCond *w = watchlist[at]; - w->message = message->text(); - w->command = command->text(); - w->procname = proc_name->text(); - w->cond = comboBox->currentIndex(); - listmodel->update(at); - // watchlist.removeAt(at); - } - // listmodel->update(); -} - -void WatchdogDialog::checkCombo() -{ - if (comboBox->count() == 1) - { - comboBox->clear(); - comboBox->addItem(tr( "if process start" ) ); - comboBox->addItem(tr( "if process finish" ) ); - return; - } -} - -// comboChanged() -> checkCombo() -void WatchdogDialog::condChanged(const QString &str) -{ - checkCombo(); - // what is this? - // printf("chagend\n"); - // comboBox->currentText(); - // command->text(); - // message->text(); -} - -void WatchdogDialog::_new() -{ - tableView->clearSelection(); - proc_name->clear(); - command->clear(); - message->clear(); - comboBox->clear(); - comboBox->addItem( tr( "select condition" ) ); -} - -void WatchdogDialog::add() -{ - watchCond *w = new watchCond; - w->enable = true; - w->cond = comboBox->currentIndex(); - w->command = command->text(); - w->message = message->text(); - w->procname = proc_name->text(); - watchlist.append(w); - // listView->update(QModelIndex()); - // listView->reset(); - // tableView->reset(); - // listmodel->insertRow(listmodel->rowCount(QModelIndex())); - // tableView->update(QModelIndex()); - // tableView->dataChanged(QModelIndex(),QModelIndex()); //protected - listmodel->update(); -} - -void WatchdogDialog::del() -{ - // QModelIndex idx=listView->currentIndex(); - QModelIndex idx = tableView->currentIndex(); - if (idx.isValid()) - { - int at = idx.row(); - watchlist.removeAt(at); - } - listmodel->update(); - tableView->setCurrentIndex(idx); -} - -void WatchdogDialog::apply() -{ - qps->write_settings(); - close(); -} diff --git a/src/watchdogdialog.h b/src/watchdogdialog.h deleted file mode 100644 index fe49178..0000000 --- a/src/watchdogdialog.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * watchdogdialog.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef WATCHDOGDIALOG_H -#define WATCHDOGDIALOG_H - -#include "ui_watchdog.h" - -#include -#include -#include - -class ListModel; -class QShowEvent; - -class WatchdogDialog : public QDialog, private Ui_EventDialog -{ - Q_OBJECT - public: - WatchdogDialog(); - ListModel *listmodel; - // signals: - // void command_change(); - void checkCombo(); - protected slots: - void _new(); - void apply(); - void add(); - void del(); - void condChanged(const QString &str); - void Changed(const QString &str); - - void comboChanged(int); - void eventcat_slected(const QModelIndex &idx); - - protected: - virtual void showEvent(QShowEvent *event); - - // void set_select( const QModelIndex & ); - // void event_name_midified(const QString &new_name); - // void event_cmd_modified(); - // void event_toolbar_checked(bool); - private: -}; - -#endif // WATCHDOGDIALOG_H diff --git a/src/wchan.cpp b/src/wchan.cpp deleted file mode 100644 index fe14f42..0000000 --- a/src/wchan.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/* - * wchan.cpp - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "config.h" - -#include "wchan.h" - -#ifdef LINUX -QHash Wchan::dict; -char *Wchan::sysmap = 0; -bool Wchan::sysmap_inited = false; -int Wchan::sysmap_size = 0; - -// return malloc:ed hex representation of x -static char *hexstr(unsigned long x) -{ - char *p = (char *)malloc(sizeof(long) * 2 + 1); - sprintf(p, sizeof(long) == 8 ? "%016lx" : "%08lx", x); - return p; -} -#endif - -// called by ???? -// return wchan symbol (possibly numeric, and empty string if addr=0) - -QString Wchan::name(unsigned long addr) -{ -#ifdef LINUX - return ""; - -#endif - -#ifdef SOLARIS - char buf[sizeof(long) * 2 + 1]; - sprintf(buf, sizeof(long) == 8 ? "%016lx" : "%08lx", addr); - return QString(buf); -#endif -} - -#ifdef LINUX - -// return true if open succeeds -bool Wchan::open_sysmap() -{ - // common places to look for a valid System.map - static const char *paths[] = { - "/boot/System.map-%s", "/boot/System.map", "/lib/modules/%s/System.map", - "/usr/src/linux-%s/System.map", "/usr/src/linux/System.map", - "/usr/local/src/linux-%s/System.map", "/usr/local/src/linux/System.map", - 0}; - sysmap_inited = true; // don't try again - for (const char **p = paths; *p; p++) - { - char buf[80]; - struct utsname ub; - uname(&ub); - int major, minor, lvl; - if (sscanf(ub.release, "%d.%d.%d", &major, &minor, &lvl) != 3) - major = -1; // non-standard release, silently accept it - sprintf(buf, *p, ub.release); - if (try_sysmap(buf)) - { // try_sysmap - if (major >= 0) - { - char vstr[40]; - sprintf(vstr, "Version_%d", (major << 16) + (minor << 8) + lvl); - // map a zero page at the end to terminate - // string - int ps = getpagesize(); - - mmap(sysmap + ((sysmap_size + ps - 1) & ~(ps - 1)), ps, - PROT_READ, MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); - if (!strstr(sysmap, vstr)) - { - fprintf(stderr, "qps warning: %s does " - "not match current " - "kernel\n", - buf); - munmap(sysmap, sysmap_size + ps); - sysmap = 0; - continue; // search the list for a - // better file - } - } - return true; - } - } - return false; -} - -// try mapping System.map from path, return true if success -bool Wchan::try_sysmap(const char *path) -{ - int fd = open(path, O_RDONLY); - struct stat sbuf; - if (fd >= 0) - { - if (fstat(fd, &sbuf) == 0) - { - sysmap_size = sbuf.st_size; - // make room for a zero page after the sysmap - sysmap = (char *)mmap(0, sysmap_size + getpagesize(), PROT_READ, - MAP_SHARED, fd, 0); - close(fd); - if (sysmap != (char *)-1) - return true; - sysmap = 0; - return false; - } - close(fd); - } - return false; -} - -inline int Wchan::beginning_of_line(int ofs) -{ - // seek backwards to beginning of line - while (ofs >= 0 && sysmap[ofs] != '\n') - ofs--; - return ofs + 1; -} - -char *Wchan::find_sym(unsigned long addr) -{ - // use binary search to find symbol; return malloced string - int l = 0, r = sysmap_size; - for (;;) - { - unsigned long a; - char buf[80]; - int m = (l + r) / 2; - m = beginning_of_line(m); - if (m == l) - { - // see if there is a line further down - while (m < r - 1 && sysmap[m] != '\n') - m++; - if (m < r - 1) - { - m++; - } - else - { - if (r == sysmap_size) - { - // after last item, probably in a - // module. give hex addr - return hexstr(addr); - } - m = l; - sscanf(sysmap + m, "%lx %*c %s", &a, buf); - // strip leading sys_ or do_ to reduce field - // width - char *p = buf; - if (strncmp(buf, "do_", 3) == 0) - p += 3; - if (strncmp(buf, "sys_", 4) == 0) - p += 4; - return strdup(p); - } - } - sscanf(sysmap + m, "%lx %*c %s", &a, buf); - if (addr < a) - { - r = m; - } - else - { - l = m; - } - } -} - -#endif // LINUX diff --git a/src/wchan.h b/src/wchan.h deleted file mode 100644 index 3a284f5..0000000 --- a/src/wchan.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * wchan.h - * This file is part of qps -- Qt-based visual process status monitor - * - * Copyright 1997-1999 Mattias Engdegård - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -#ifndef WCHAN_H -#define WCHAN_H - -#include -#include - -class Wchan -{ - public: - static QString name(unsigned long addr); - -#ifdef LINUX - private: - static bool open_sysmap(); - static bool try_sysmap(const char *path); - static char *find_sym(unsigned long addr); - static inline int beginning_of_line(int ofs); - - static QHash dict; - static char *sysmap; // pointer to mmap()ed System.map - static bool sysmap_inited; // if an attempt to read sysmap has been made - static int sysmap_size; -#endif -}; - -#endif // WCHAN_H