pax_global_header00006660000000000000000000000064146574075630014533gustar00rootroot0000000000000052 comment=42d290d25efb165594e9e87ebc16efa9fc31c77d qdiskinfo-0.2+git20240812+ds/000077500000000000000000000000001465740756300153675ustar00rootroot00000000000000qdiskinfo-0.2+git20240812+ds/.gitignore000066400000000000000000000012171465740756300173600ustar00rootroot00000000000000# C++ objects and libs *.slo *.lo *.o *.a *.la *.lai *.so *.so.* *.dll *.dylib # Qt-es object_script.*.Release object_script.*.Debug *_plugin_import.cpp /.qmake.cache /.qmake.stash *.pro.user *.pro.user.* *.qbs.user *.qbs.user.* *.moc moc_*.cpp moc_*.h qrc_*.cpp ui_*.h *.qmlc *.jsc Makefile* *build-* *.prl # Qt unit tests target_wrapper.* # QtCreator *.autosave # QtCreator Qml *.qmlproject.user *.qmlproject.user.* # QtCreator CMake CMakeLists.txt.user* # QtCreator 4.8< compilation database compile_commands.json # QtCreator local machine specific files for imported projects *creator.user* *_qmlcache.qrc # The entire build directory build/ qdiskinfo-0.2+git20240812+ds/CMakeLists.txt000066400000000000000000000041161465740756300201310ustar00rootroot00000000000000cmake_minimum_required(VERSION 3.16) project(QDiskInfo VERSION 0.1 LANGUAGES CXX) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wuseless-cast -Wconversion -Wsign-conversion -Wshadow") if(NOT DEFINED QT_VERSION_MAJOR) set(QT_VERSION_MAJOR 6) endif() find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets) set(PROJECT_SOURCES src/main.cpp src/mainwindow.cpp src/mainwindow.h src/mainwindow.ui src/custombutton.h src/custombutton.cpp src/statusdot.h src/statusdot.cpp src/jsonparser.h src/jsonparser.cpp src/utils.h src/utils.cpp src/resources.qrc ) if (INCLUDE_OPTIONAL_RESOURCES) set(PROJECT_SOURCES ${PROJECT_SOURCES} dist/theme/theme_resources.qrc) endif() add_executable(QDiskInfo ${PROJECT_SOURCES} ) target_compile_definitions(QDiskInfo PRIVATE PROJECT_VERSION_MAJOR=${QDiskInfo_VERSION_MAJOR} PROJECT_VERSION_MINOR=${QDiskInfo_VERSION_MINOR} INCLUDE_OPTIONAL_RESOURCES=$ CHARACTER_IS_RIGHT=$ ) target_link_libraries(QDiskInfo PRIVATE Qt${QT_VERSION_MAJOR}::Widgets) set_target_properties(QDiskInfo PROPERTIES ${BUNDLE_ID_OPTION} MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE TRUE WIN32_EXECUTABLE TRUE ) include(GNUInstallDirs) install(TARGETS QDiskInfo BUNDLE DESTINATION . LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) install(FILES "dist/QDiskInfo.desktop" DESTINATION "share/applications") install(FILES "dist/QDiskInfo.svg" DESTINATION "share/icons/hicolor/scalable/apps") if(QT_VERSION_MAJOR EQUAL 6) qt_finalize_executable(QDiskInfo) endif() include(FeatureSummary) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) qdiskinfo-0.2+git20240812+ds/LICENSE000066400000000000000000001045151465740756300164020ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. 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 them 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 prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. 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. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey 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; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If 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 convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU 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 that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. 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. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 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. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 3 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, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . qdiskinfo-0.2+git20240812+ds/README.md000066400000000000000000000036511465740756300166530ustar00rootroot00000000000000# QDiskInfo CrystalDiskInfo alternative for Linux ![mockup](https://github.com/edisionnano/QDiskInfo/assets/26039434/e5488f41-6ea2-4304-9ae8-13d5dac7715b) This app is a frontend for smartctl which is part of the smartmontools package.
The icon is a modified version of the KDE Partition Manager logo which is available under GPL-3.0+. ## Compiling and Installing ### Compilation Dependencies Ubuntu and based distros (Mint, Pop!_OS, etc.) ```sh sudo apt install build-essential cmake git libgl1-mesa-dev libxkbcommon-dev qt6-base-dev qt6-wayland smartmontools ``` ### Compilation Steps First you will need to clone the repository and cd inside ```sh git clone https://github.com/edisionnano/QDiskInfo.git && cd QDiskInfo ``` Then you must create a build directory and cd inside ```sh mkdir build && cd build ``` After that use CMake to setup the project, Qt version can also be set to 5 (for example for Ubuntu) ```sh cmake .. -DCMAKE_BUILD_TYPE:STRING=MinSizeRel -DQT_VERSION_MAJOR=6 ``` And finally compile the project with all the threads ```sh make -j$(nproc) ``` This will create a `QDiskInfo` binary on the build directory but you can also install it using ```sh sudo make install ``` ## Using CrystalDiskInfo Anime Themes The process is similar to the one above with a few changes:
First you must download the edition of CrystalDiskInfo you want (Aoi for example) in ZIP format from [here](https://crystalmark.info/en/download/), from this archive you shall copy the light and dark backgrounds as well as the good, caution, bad, unknown icons to dist/theme with the same name as the templates there.
Once you do that compile like above but when running CMake do this instead: ```sh cmake .. -DCMAKE_BUILD_TYPE:STRING=MinSizeRel -DQT_VERSION_MAJOR=6 -DINCLUDE_OPTIONAL_RESOURCES=ON -DCHARACTER_IS_RIGHT=ON ``` Regarding the `-DCHARACTER_IS_RIGHT` set it to ON for themes where the character is right (like Aoi) or OFF for most other themes. qdiskinfo-0.2+git20240812+ds/dist/000077500000000000000000000000001465740756300163325ustar00rootroot00000000000000qdiskinfo-0.2+git20240812+ds/dist/QDiskInfo.desktop000066400000000000000000000003241465740756300215530ustar00rootroot00000000000000[Desktop Entry] Type=Application Version=1.0 Name=QDiskInfo GenericName=SMART Viewer Comment=SMART data viewer Icon=QDiskInfo Exec=QDiskInfo Terminal=false Categories=System;Monitor; Keywords=system;process;task qdiskinfo-0.2+git20240812+ds/dist/QDiskInfo.svg000066400000000000000000000316201465740756300207040ustar00rootroot00000000000000 i qdiskinfo-0.2+git20240812+ds/dist/theme/000077500000000000000000000000001465740756300174345ustar00rootroot00000000000000qdiskinfo-0.2+git20240812+ds/dist/theme/bad.png000066400000000000000000000000001465740756300206560ustar00rootroot00000000000000qdiskinfo-0.2+git20240812+ds/dist/theme/bg_dark.png000066400000000000000000000000001465740756300215210ustar00rootroot00000000000000qdiskinfo-0.2+git20240812+ds/dist/theme/bg_light.png000066400000000000000000000000001465740756300217070ustar00rootroot00000000000000qdiskinfo-0.2+git20240812+ds/dist/theme/caution.png000066400000000000000000000000001465740756300215720ustar00rootroot00000000000000qdiskinfo-0.2+git20240812+ds/dist/theme/good.png000066400000000000000000000000001465740756300210600ustar00rootroot00000000000000qdiskinfo-0.2+git20240812+ds/dist/theme/theme_resources.qrc000066400000000000000000000003761465740756300233450ustar00rootroot00000000000000 bg_light.png bg_dark.png good.png caution.png bad.png unknown.png qdiskinfo-0.2+git20240812+ds/dist/theme/unknown.png000066400000000000000000000000001465740756300216270ustar00rootroot00000000000000qdiskinfo-0.2+git20240812+ds/src/000077500000000000000000000000001465740756300161565ustar00rootroot00000000000000qdiskinfo-0.2+git20240812+ds/src/custombutton.cpp000066400000000000000000000036101465740756300214300ustar00rootroot00000000000000#include "custombutton.h" #include #include CustomButton::CustomButton(const QString &text1_, const QString &text2_, const QString &text3_, const QColor &lineColor_, QWidget *parent) : QPushButton(parent), text1(text1_), text2(text2_), text3(text3_), lineColor(lineColor_) { setMinimumHeight(60); adjustWidthToFitText(); } void CustomButton::adjustWidthToFitText() { QFont font = this->font(); QFontMetrics fm(font); int maxWidth = 0; QString lines[] = {text1, text2, text3}; for (const QString &line : lines) { int lineWidth = fm.horizontalAdvance(line); if (lineWidth > maxWidth) { maxWidth = lineWidth; } } int desiredWidth = maxWidth + 28; setMinimumWidth(desiredWidth); setMaximumWidth(desiredWidth); } void CustomButton::paintEvent(QPaintEvent *event) { QPushButton::paintEvent(event); QPainter painter(this); QPalette pal = palette(); QColor textColor = pal.color(QPalette::ButtonText); QPen pen(lineColor, 6); painter.setPen(pen); painter.drawLine(11, 10, 11, 50); QRect rect(20, 0, width() - 25, height()); painter.setPen(textColor); painter.drawText(rect, Qt::AlignVCenter | Qt::AlignLeft, text1 + "\n" + text2 + "\n" + text3); } void CustomButton::resizeEvent(QResizeEvent *event) { QPushButton::resizeEvent(event); adjustWidthToFitText(); } void CustomButton::setText1(const QString &newText1) { if (text1 != newText1) { text1 = newText1; adjustWidthToFitText(); update(); } } void CustomButton::setText2(const QString &newText2) { if (text2 != newText2) { text2 = newText2; adjustWidthToFitText(); update(); } } void CustomButton::setText3(const QString &newText3) { if (text3 != newText3) { text3 = newText3; adjustWidthToFitText(); update(); } } qdiskinfo-0.2+git20240812+ds/src/custombutton.h000066400000000000000000000012351465740756300210760ustar00rootroot00000000000000#pragma once #include #include #include #include class CustomButton : public QPushButton { Q_OBJECT public: CustomButton(const QString &text1_, const QString &text2_, const QString &text3_, const QColor &lineColor_, QWidget *parent = nullptr); protected: void paintEvent(QPaintEvent *event) override; void resizeEvent(QResizeEvent *event) override; void setText1(const QString &newText1); void setText2(const QString &newText2); void setText3(const QString &newText3); void adjustWidthToFitText(); private: QString text1; QString text2; QString text3; QColor lineColor; }; qdiskinfo-0.2+git20240812+ds/src/jsonparser.cpp000066400000000000000000000027441465740756300210570ustar00rootroot00000000000000#include "jsonparser.h" #include QVector> JsonParser::parse(const QString &json) { QVector> data; QStringList lines = json.split('\n'); bool found = false; bool skip = false; for (const QString &line : std::as_const(lines)) { QString trimmedLine = line.trimmed(); if (trimmedLine.contains("[")) { skip = true; continue; } if (trimmedLine.contains("]")) { skip = false; continue; } if (skip) { continue; } if (trimmedLine.contains("nvme_smart_health_information_log")) { found = true; continue; } if (found) { if (trimmedLine.contains("}")) { break; } qsizetype colonPos = trimmedLine.indexOf(":"); if (colonPos != -1) { QString key = removeQuotes(trimmedLine.left(colonPos)); QString valueString = trimmedLine.mid(colonPos + 1).trimmed(); valueString.chop(1); int value = valueString.toInt(); data.append(qMakePair(key, value)); } } } return data; } QString JsonParser::removeQuotes(const QString &s) { QString result = s.trimmed(); if (result.length() >= 2 && result.front() == '"' && result.back() == '"') { return result.mid(1, result.size() - 2); } return result; } qdiskinfo-0.2+git20240812+ds/src/jsonparser.h000066400000000000000000000003641465740756300205200ustar00rootroot00000000000000#pragma once #include #include #include class JsonParser { public: JsonParser() = default; QVector> parse(const QString &json); private: QString removeQuotes(const QString &s); }; qdiskinfo-0.2+git20240812+ds/src/main.cpp000066400000000000000000000007131465740756300176070ustar00rootroot00000000000000#include "mainwindow.h" #include #include #include int main(int argc, char *argv[]) { QApplication a(argc, argv); QTranslator translator; if (translator.load(QLocale(), QLatin1String("qdiskinfo"), QLatin1String("_"), QLatin1String(":/translations"))) { a.installTranslator(&translator); } MainWindow w; w.setWindowIcon(QIcon(":/icons/icon.svg")); w.show(); return a.exec(); } qdiskinfo-0.2+git20240812+ds/src/mainwindow.cpp000066400000000000000000001532301465740756300210420ustar00rootroot00000000000000#include "mainwindow.h" #include #include #include #include #include MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) , settings("qdiskinfo", "qdiskinfo") , initializing(true) { ui->setupUi(this); locale = QLocale::system(); buttonGroup = new QButtonGroup(this); buttonGroup->setExclusive(true); QWidget *containerWidget = ui->scrollAreaWidgetContents; horizontalLayout = new QHBoxLayout(containerWidget); horizontalLayout->setContentsMargins(0, 0, 0, 0); ui->scrollArea->setWidget(containerWidget); verticalLayout = ui->centralwidget->findChild("verticalLayout"); gridLayout = ui->centralwidget->findChild("gridLayout"); diskName = qobject_cast(ui->centralwidget->findChild("diskName")); temperatureValue = qobject_cast(ui->centralwidget->findChild("temperatureValueLabel")); healthStatusValue = qobject_cast(ui->centralwidget->findChild("healthStatusValueLabel")); temperatureLabelHorizontal = qobject_cast(ui->centralwidget->findChild("healthStatusLabelHorizozontal")); healthStatusLabelHorizontal = qobject_cast(ui->centralwidget->findChild("temperatureLabelHorizontal")); temperatureValueHorizontal = qobject_cast(ui->centralwidget->findChild("temperatureValueLabelHorizontal")); healthStatusValueHorizontal = qobject_cast(ui->centralwidget->findChild("healthStatusValueLabelHorizontal")); firmwareLineEdit = qobject_cast(ui->centralwidget->findChild("firmwareLineEdit")); serialNumberLineEdit = qobject_cast(ui->centralwidget->findChild("serialNumberLineEdit")); typeLineEdit = qobject_cast(ui->centralwidget->findChild("typeLineEdit")); protocolLineEdit = qobject_cast(ui->centralwidget->findChild("protocolLineEdit")); deviceNodeLineEdit = qobject_cast(ui->centralwidget->findChild("deviceNodeLineEdit")); totalReadsLineEdit = qobject_cast(ui->centralwidget->findChild("totalReadsLineEdit")); totalWritesLineEdit = qobject_cast(ui->centralwidget->findChild("totalWritesLineEdit")); rotationRateLineEdit = qobject_cast(ui->centralwidget->findChild("rotationRateLineEdit")); powerOnCountLineEdit = qobject_cast(ui->centralwidget->findChild("powerOnCountLineEdit")); powerOnHoursLineEdit = qobject_cast(ui->centralwidget->findChild("powerOnHoursLineEdit")); tableWidget = qobject_cast(ui->centralwidget->findChild("dataTable")); serialNumberLineEdit->setEchoMode(QLineEdit::Password); nextButton = ui->centralwidget->findChild("nextButton"); prevButton = ui->centralwidget->findChild("previousButton"); nextButton->setShortcut(QKeySequence::Forward); prevButton->setShortcut(QKeySequence::Back); connect(nextButton, &QPushButton::clicked, this, &MainWindow::onNextButtonClicked); connect(prevButton, &QPushButton::clicked, this, &MainWindow::onPrevButtonClicked); nextButton->setFocusPolicy(Qt::NoFocus); prevButton->setFocusPolicy(Qt::NoFocus); ui->actionSave_JSON->setShortcut(QKeySequence::Save); ui->actionQuit->setShortcut(QKeySequence::Quit); ui->actionRescan_Refresh->setShortcut(QKeySequence::Refresh); menuDevice = ui->menuDevice; menuDisk = ui->menuDisk; selfTestMenu = new QMenu(tr("Start Self Test"), this); menuDevice->addMenu(selfTestMenu); selfTestMenu->setToolTipsVisible(true); selfTestLogAction = new QAction(tr("Self Test Log"), this); menuDevice->addAction(selfTestLogAction); disksGroup = new QActionGroup(this); disksGroup->setExclusive(true); goodColor = QColor(Qt::green); cautionColor = QColor(Qt::yellow); badColor = QColor(Qt::red); naColor = QColor(Qt::gray); statusLabel = new QLabel; ui->actionIgnore_C4_Reallocation_Event_Count->setChecked(settings.value("IgnoreC4", true).toBool()); ui->actionHEX->setChecked(settings.value("HEX", true).toBool()); ui->actionUse_Fahrenheit->setChecked(settings.value("Fahrenheit", false).toBool()); ui->actionCyclic_Navigation->setChecked(settings.value("CyclicNavigation", false).toBool()); ui->actionUse_GB_instead_of_TB->setChecked(settings.value("UseGB", false).toBool()); QAction *toggleEchoModeAction = serialNumberLineEdit->addAction(QIcon::fromTheme(QStringLiteral("visibility")), QLineEdit::TrailingPosition); connect(toggleEchoModeAction, &QAction::triggered, this, [=]() { if (serialNumberLineEdit->echoMode() == QLineEdit::Password) { serialNumberLineEdit->setEchoMode(QLineEdit::Normal); toggleEchoModeAction->setIcon(QIcon::fromTheme(QStringLiteral("hint"))); } else if (serialNumberLineEdit->echoMode() == QLineEdit::Normal) { serialNumberLineEdit->setEchoMode(QLineEdit::Password); toggleEchoModeAction->setIcon(QIcon::fromTheme(QStringLiteral("visibility"))); } }); QPair values = Utils.scanDevices(initializing); deviceOutputs = values.first; devices = values.second; if (!deviceOutputs.isEmpty()) { updateUI(); } this->setFocus(); initializing = false; if (!INCLUDE_OPTIONAL_RESOURCES || CHARACTER_IS_RIGHT) { QLayoutItem *leftSpacerItem = gridLayout->itemAtPosition(2, 0); if (leftSpacerItem) { gridLayout->removeItem(leftSpacerItem); if (dynamic_cast(leftSpacerItem)) { delete leftSpacerItem; } else if (QWidget *widget = leftSpacerItem->widget()) { delete widget; } else { delete leftSpacerItem; } } } if (INCLUDE_OPTIONAL_RESOURCES) { transformWindow(); } else { delete temperatureLabelHorizontal; delete healthStatusLabelHorizontal; delete temperatureValueHorizontal; delete healthStatusValueHorizontal; } } MainWindow::~MainWindow() { delete ui; } void MainWindow::onNextButtonClicked() { qsizetype currentIndex = buttonGroup->buttons().indexOf(buttonGroup->checkedButton()); qsizetype nextIndex = (currentIndex + 1) % buttonGroup->buttons().size(); buttonGroup->buttons().at(nextIndex)->click(); updateNavigationButtons(nextIndex); } void MainWindow::onPrevButtonClicked() { qsizetype currentIndex = buttonGroup->buttons().indexOf(buttonGroup->checkedButton()); qsizetype prevIndex = (currentIndex - 1 + buttonGroup->buttons().size()) % buttonGroup->buttons().size(); buttonGroup->buttons().at(prevIndex)->click(); updateNavigationButtons(prevIndex); } void MainWindow::updateNavigationButtons(qsizetype currentIndex) { prevButton->setEnabled(currentIndex > 0 || (ui->actionCyclic_Navigation->isChecked() && buttonGroup->buttons().size() > 1)); // We can use setVisible if we want to mimic CrystalDiskInfo nextButton->setEnabled(currentIndex < buttonGroup->buttons().size() - 1 || ui->actionCyclic_Navigation->isChecked()); } void MainWindow::updateUI() { bool firstTime = true; globalIsNvme = false; for (int i = 0; i < devices.size(); ++i) { QJsonObject device = devices[i].toObject(); QString deviceName = device["name"].toString(); QString allOutput; if (i >= 0 && i < deviceOutputs.size()) { allOutput = deviceOutputs[i]; } QJsonDocument localDoc = QJsonDocument::fromJson(allOutput.toUtf8()); QJsonObject localObj = localDoc.object(); QString protocol = localObj["device"].toObject()["protocol"].toString(); bool isNvme = (protocol == "NVMe"); bool isScsi = (protocol == "SCSI"); bool isAta = (protocol == "ATA"); QString modelName = localObj["model_name"].toString(); if (isScsi) { modelName = localObj["scsi_model_name"].toString(); } QJsonArray attributes = localObj["ata_smart_attributes"].toObject()["table"].toArray(); QString temperature = "-- °C"; bool healthPassed = localObj["smart_status"].toObject()["passed"].toBool(); bool caution = false; bool bad = false; QString health; QColor healthColor; double diskCapacityGB = localObj.value("user_capacity").toObject().value("bytes").toDouble() / 1e9; QString gbSymbol = locale.formattedDataSize(1 << 30, 1, QLocale::DataSizeTraditionalFormat).split(' ')[1]; QString tbSymbol = locale.formattedDataSize(qint64(1) << 40, 1, QLocale::DataSizeTraditionalFormat).split(' ')[1]; QString diskCapacityString; int diskCapacityGbInt = static_cast(diskCapacityGB); bool useGB = ui->actionUse_GB_instead_of_TB->isChecked(); if (diskCapacityGbInt < 1000 || useGB) { diskCapacityString = locale.toString(diskCapacityGB, 'f', 1) + " " + gbSymbol; } else { diskCapacityString = QString::number(diskCapacityGbInt/1000) + " " + tbSymbol; } QJsonObject temperatureObj = localObj["temperature"].toObject(); int temperatureInt = temperatureObj["current"].toInt(); if (temperatureInt > 0) { if (ui->actionUse_Fahrenheit->isChecked()) { int fahrenheit = static_cast((temperatureInt * 9.0 / 5.0) + 32.0); temperature = QString::number(fahrenheit) + " °F"; } else { temperature = QString::number(temperatureInt) + " °C"; } } QVector> nvmeSmartOrdered; if (isAta) { for (const QJsonValue &attr : std::as_const(attributes)) { QJsonObject attrObj = attr.toObject(); if ((attrObj["id"] == 5 || attrObj["id"] == 197 || attrObj["id"] == 198 || (attrObj["id"] == 196 && !(ui->actionIgnore_C4_Reallocation_Event_Count->isChecked()))) && attrObj["raw"].toObject()["value"].toDouble() > 0) { caution = true; } if (attrObj["thresh"].toInt() && (attrObj["value"].toInt() < attrObj["thresh"].toInt())) { bad = true; } } } else if (isScsi) { QJsonObject scsiErrorCounterLog = localObj.value("scsi_error_counter_log").toObject(); for (const QString key : {"read", "write", "verify"}) { if (scsiErrorCounterLog.value(key).toObject().value("total_uncorrected_errors").toInt() != 0) { caution = true; } } if (localObj.value("scsi_grown_defect_list").toInt() != 0) { caution = true; } } else { JsonParser parser; nvmeSmartOrdered = parser.parse(allOutput); int row = 1; for (const QPair &pair : std::as_const(nvmeSmartOrdered)) { QString id = QString("%1").arg(row, 2, 16, QChar('0')).toUpper(); int raw = pair.second; if (id == "01" && raw) { bad = true; } else if (id == "03") { int availableSpareThreshold = nvmeSmartOrdered.at(3).second; if (availableSpareThreshold > 100) { // Thx to crystaldiskinfo for these workarounds ; } else if (raw == 0 && availableSpareThreshold == 0) { ; } else if (raw < availableSpareThreshold) { bad = true; } else if (availableSpareThreshold != 100 && (raw == availableSpareThreshold)) { caution = true; } } else if (id == "05" && raw >= 90) { // Make this configurable, currently hardcoded to 10% caution = true; } ++row; } } if (healthPassed && !caution && !bad) { health = tr("Good"); healthColor = goodColor; } else if (healthPassed && caution && !bad) { health = tr("Caution"); healthColor = cautionColor; } else if ((bad || !healthPassed) && !modelName.isEmpty()){ health = tr("Bad"); healthColor = badColor; } else { health = tr("Unknown"); healthColor = naColor; } CustomButton *button = new CustomButton(health, temperature, deviceName, healthColor, this); button->setToolTip(tr("Disk") + " " + QString::number(i) + " : " + modelName + " : " + diskCapacityString); buttonGroup->addButton(button); horizontalLayout->addWidget(button); QAction *diskAction = new QAction("(" + QString::number(i+1) + ") " + modelName + " " + diskCapacityString, this); diskAction->setCheckable(true); menuDisk->addAction(diskAction); disksGroup->addAction(diskAction); button->setCheckable(true); button->setAutoExclusive(true); qsizetype buttonIndex = buttonGroup->buttons().indexOf(button); auto updateWindow = [=]() { if (isNvme) { populateWindow(localObj, health, nvmeSmartOrdered); } else { populateWindow(localObj, health); } updateNavigationButtons(buttonIndex); }; connect(button, &QPushButton::clicked, this, [=]() { updateWindow(); disksGroup->actions().at(buttonIndex)->setChecked(true); }); connect(diskAction, &QAction::triggered, this, [=]() { updateWindow(); }); if (firstTime) { globalObj = localObj; globalHealth = health; button->setChecked(true); diskAction->setChecked(true); firstTime = false; globalIsNvme = isNvme; if (isNvme) { globalNvmeSmartOrdered = nvmeSmartOrdered; } } } buttonStretch = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); horizontalLayout->addSpacerItem(buttonStretch); if (globalIsNvme) { populateWindow(globalObj, globalHealth, globalNvmeSmartOrdered); } else { populateWindow(globalObj, globalHealth); } updateNavigationButtons(buttonGroup->buttons().indexOf(buttonGroup->checkedButton())); } void MainWindow::populateWindow(const QJsonObject &localObj, const QString &health, const QVector>& nvmeLogOrdered) { QJsonArray attributes = localObj["ata_smart_attributes"].toObject()["table"].toArray(); QJsonObject pollingMinutes = localObj["ata_smart_data"].toObject()["self_test"].toObject()["polling_minutes"].toObject(); QJsonObject nvmeLog = localObj["nvme_smart_health_information_log"].toObject(); QString modelName = localObj["model_name"].toString(); QString firmwareVersion = localObj["firmware_version"].toString("----"); double diskCapacityGB = localObj.value("user_capacity").toObject().value("bytes").toDouble() / 1e9; int diskCapacityGbInt = static_cast(diskCapacityGB); int powerCycleCountInt = localObj["power_cycle_count"].toInt(-1); QJsonObject temperatureObj = localObj["temperature"].toObject(); int temperatureInt = temperatureObj["current"].toInt(); int totalWritesInt = 0; int totalReadsInt = 0; bool useGB = ui->actionUse_GB_instead_of_TB->isChecked(); QString gbSymbol = locale.formattedDataSize(1 << 30, 1, QLocale::DataSizeTraditionalFormat).split(' ')[1]; QString tbSymbol = locale.formattedDataSize(qint64(1) << 40, 1, QLocale::DataSizeTraditionalFormat).split(' ')[1]; QString diskCapacityString; if (diskCapacityGbInt < 1000 || useGB) { diskCapacityString = locale.toString(diskCapacityGB, 'f', 1) + " " + gbSymbol; } else { diskCapacityString = QString::number(diskCapacityGbInt/1000) + " " + tbSymbol; } QString totalReads; QString totalWrites; QString percentage = ""; QString serialNumber = localObj["serial_number"].toString(); QJsonObject deviceObj = localObj["device"].toObject(); QString protocol = deviceObj["protocol"].toString(); QString type = deviceObj["type"].toString(); QString name = deviceObj["name"].toString(); QJsonArray outputArray = localObj.value("smartctl").toObject()["output"].toArray(); QJsonArray nvmeSelfTestsTable = localObj["nvme_self_test_log"].toObject()["table"].toArray(); QJsonArray ataSelfTestsTable = localObj["ata_smart_self_test_log"].toObject()["standard"].toObject()["table"].toArray(); QJsonObject scsiErrorCounterLog; bool isNvme = (protocol == "NVMe"); bool isScsi = (protocol == "SCSI"); if (isScsi) { scsiErrorCounterLog = localObj.value("scsi_error_counter_log").toObject(); modelName = localObj["scsi_model_name"].toString(); powerCycleCountInt = localObj["scsi_start_stop_cycle_counter"].toObject().value("accumulated_load_unload_cycles").toInt(); firmwareVersion = localObj["scsi_revision"].toString("----"); totalReadsInt = scsiErrorCounterLog.value("read").toObject().value("gigabytes_processed").toString().split(",").first().toInt(); totalWritesInt = scsiErrorCounterLog.value("write").toObject().value("gigabytes_processed").toString().split(",").first().toInt(); } bool nvmeHasSelfTest = false; auto createTablePopup = [=](QJsonArray selfTestsTable) { QWidget *popup = new QWidget(); QTableWidget *selfTestsTableWidget = new QTableWidget(); selfTestsTableWidget->setFocusPolicy(Qt::NoFocus); qsizetype rowCount = selfTestsTable.size(); if (rowCount > std::numeric_limits::max()) { rowCount = std::numeric_limits::max(); } selfTestsTableWidget->setRowCount(static_cast(rowCount)); selfTestsTableWidget->setColumnCount(3); selfTestsTableWidget->verticalHeader()->setVisible(false); selfTestsTableWidget->setHorizontalHeaderLabels({tr("Type"), tr("Status"), tr("Power On Hours")}); for (int i = 0; i < rowCount; ++i) { QJsonObject entry = selfTestsTable[i].toObject(); QTableWidgetItem *item; if (isNvme) { selfTestsTableWidget->setItem(i, 0, new QTableWidgetItem(entry["self_test_code"].toObject()["string"].toString())); selfTestsTableWidget->setItem(i, 1, new QTableWidgetItem(entry["self_test_result"].toObject()["string"].toString())); item = new QTableWidgetItem(QString::number(entry["power_on_hours"].toInt())); } else { selfTestsTableWidget->setItem(i, 0, new QTableWidgetItem(entry["type"].toObject()["string"].toString())); selfTestsTableWidget->setItem(i, 1, new QTableWidgetItem(entry["status"].toObject()["string"].toString())); item = new QTableWidgetItem(QString::number(entry["lifetime_hours"].toInt())); } item->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter); selfTestsTableWidget->setItem(i, 2, item); } for (int i = 0; i < selfTestsTableWidget->columnCount(); ++i) { QTableWidgetItem *headerItem = selfTestsTableWidget->horizontalHeaderItem(i); if (headerItem) { if (i == 2) { headerItem->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter); } else { headerItem->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter); } } } selfTestsTableWidget->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch); for (int i = 0; i < selfTestsTableWidget->columnCount(); ++i) { if (i != 1) { selfTestsTableWidget->horizontalHeader()->setSectionResizeMode(i, QHeaderView::ResizeToContents); } } selfTestsTableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed); selfTestsTableWidget->verticalHeader()->setDefaultSectionSize(31); selfTestsTableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(selfTestsTableWidget); popup->setLayout(layout); popup->setWindowTitle(tr("Self Test Log")); popup->resize(400, 400); popup->show(); }; deviceJson = localObj; diskName->setText("

" + modelName + " " + diskCapacityString + "

"); firmwareLineEdit->setText(firmwareVersion); serialNumberLineEdit->setText(serialNumber); typeLineEdit->setText(type); protocolLineEdit->setText(protocol); deviceNodeLineEdit->setText(name); QStringList keys = pollingMinutes.keys(); std::sort(keys.begin(), keys.end(), [&pollingMinutes](const QString& key1, const QString& key2) { return pollingMinutes[key1].toInt() < pollingMinutes[key2].toInt(); }); int rotationRateInt = localObj["rotation_rate"].toInt(-1); QString rotationRate; if (rotationRateInt > 0) { rotationRate = QString::number(rotationRateInt); } else if (rotationRateInt == 0 || isNvme) { rotationRate = "---- (SSD)"; } else { rotationRate = "----"; } rotationRateLineEdit->setText(rotationRate); rotationRateLineEdit->setAlignment(Qt::AlignRight); QString powerCycleCount; if (powerCycleCountInt >= 0) { powerCycleCount = QString::number(powerCycleCountInt) + " " + tr("count"); } else { powerCycleCount = "Unknown"; } powerOnCountLineEdit->setText(powerCycleCount); powerOnCountLineEdit->setAlignment(Qt::AlignRight); int powerOnTimeInt = localObj["power_on_time"].toObject().value("hours").toInt(-1); QString powerOnTime; if (powerOnTimeInt >= 0) { powerOnTime = QString::number(powerOnTimeInt) + " " + tr("hours"); } else { powerOnTime = "Unknown"; } powerOnHoursLineEdit->setText(powerOnTime); powerOnHoursLineEdit->setAlignment(Qt::AlignRight); if (!isNvme) { for (const QJsonValue &attr : std::as_const(attributes)) { QJsonObject attrObj = attr.toObject(); if (attrObj["id"] == 202) { if (attrObj["name"] == "Percent_Lifetime_Remain") { int percentageUsed = 100 - attrObj["raw"].toObject()["value"].toInt(); percentage = QString::number(percentageUsed) + " %"; } } else if (attrObj["id"] == 241) { if (attrObj["name"] == "Total_Writes_GB") { int gigabytes = attrObj["raw"].toObject()["value"].toInt(); totalWritesInt = gigabytes; } else if (attrObj["name"] == "Host_Writes_32MiB") { double gigabytes = (attrObj["raw"].toObject()["value"].toInt() * 32 * 1024.0 * 1024.0) / 1e9; totalWritesInt = static_cast(gigabytes); } else if (attrObj["name"] == "Total_LBAs_Written") { int logicalBlockSize = localObj["logical_block_size"].toInt(); qlonglong lbaWritten = attrObj["raw"].toObject()["value"].toVariant().toLongLong(); qlonglong oneGB = static_cast(std::pow(2, 30)); qlonglong gigabytes = (lbaWritten * logicalBlockSize) / oneGB; totalWritesInt = static_cast(gigabytes); } else if (attrObj["name"] == "Host_Writes_GiB" || attrObj["name"] == "Lifetime_Writes_GiB") { double gibibytes = attrObj["raw"].toObject()["value"].toDouble(); double bytesPerGiB = static_cast(1ULL << 30); double bytesPerGB = 1e9; double conversionFactor = bytesPerGiB / bytesPerGB; double gigabytes = gibibytes * conversionFactor; totalWritesInt = static_cast(gigabytes); } } else if (attrObj["id"] == 242) { if (attrObj["name"] == "Total_Reads_GB") { int gigabytes = attrObj["raw"].toObject()["value"].toInt(); totalReadsInt = gigabytes; } else if (attrObj["name"] == "Host_Reads_32MiB") { double gigabytes = (attrObj["raw"].toObject()["value"].toInt() * 32 * 1024.0 * 1024.0) / 1e9; totalReadsInt = static_cast(gigabytes); } else if (attrObj["name"] == "Total_LBAs_Read") { int logicalBlockSize = localObj["logical_block_size"].toInt(); qlonglong lbaRead = attrObj["raw"].toObject()["value"].toVariant().toLongLong(); qlonglong oneGB = static_cast(std::pow(2, 30)); qlonglong gigabytes = (lbaRead * logicalBlockSize) / oneGB; totalReadsInt = static_cast(gigabytes); } else if (attrObj["name"] == "Host_Reads_GiB" || attrObj["name"] == "Lifetime_Reads_GiB") { double gibibytes = attrObj["raw"].toObject()["value"].toDouble(); double bytesPerGiB = static_cast(1ULL << 30); double bytesPerGB = 1e9; double conversionFactor = bytesPerGiB / bytesPerGB; double gigabytes = gibibytes * conversionFactor; totalReadsInt = static_cast(gigabytes); } } else if (attrObj["id"] == 246) { // MX500 if (attrObj["name"] == "Total_LBAs_Written") { int logicalBlockSize = localObj["logical_block_size"].toInt(); qlonglong lbaWritten = attrObj["raw"].toObject()["value"].toVariant().toLongLong(); qlonglong oneGB = static_cast(std::pow(2, 30)); qlonglong gigabytes = (lbaWritten * logicalBlockSize) / oneGB; totalWritesInt = static_cast(gigabytes); } } else if (attrObj["name"] == "Remaining_Lifetime_Perc") { int percentageUsed = attrObj["raw"].toObject()["value"].toInt(); percentage = QString::number(percentageUsed) + " %"; } else if (attrObj["name"] == "Media_Wearout_Indicator" || attrObj["name"] == "SSD_Life_Left") { int percentageUsed = attrObj["value"].toInt(); percentage = QString::number(percentageUsed) + " %"; } } if (percentage.isEmpty() && rotationRate == "---- (SSD)") { // Workaround for some drives which have this and another attribute for (const QJsonValue &attr : std::as_const(attributes)) { QJsonObject attrObj = attr.toObject(); if (attrObj["name"] == "Wear_Leveling_Count") { int percentageUsed = attrObj["value"].toInt(); percentage = QString::number(percentageUsed) + " %"; break; } } } } else { for (auto smartItem = nvmeLog.begin(); smartItem != nvmeLog.end(); ++smartItem) { QString key = smartItem.key(); QJsonValue value = smartItem.value(); if (key == "data_units_written") { double dataUnitsWritten = value.toDouble(); double gigabytes = (dataUnitsWritten * 512) / 1'000'000; totalWritesInt = static_cast(gigabytes); } else if (key == "data_units_read") { double dataUnitsRead = value.toDouble(); double gigabytes = (dataUnitsRead * 512) / 1'000'000; totalReadsInt = static_cast(gigabytes); } else if (key == "percentage_used") { int percentageUsed = 100 - value.toInt(); percentage = QString::number(percentageUsed) + " %"; } } } if (totalReadsInt) { if (totalReadsInt < 1000 || useGB) { totalReads = QString::number(totalReadsInt) + " " + gbSymbol; } else { totalReads = QString::number(totalReadsInt/1000) + " " + tbSymbol; } } else { totalReads = "----"; } if (totalWritesInt) { if (totalWritesInt < 1000 || useGB) { totalWrites = QString::number(totalWritesInt) + " " + gbSymbol; } else { totalWrites = QString::number(totalWritesInt/1000) + " " + tbSymbol; } } else { totalWrites = "----"; } totalReadsLineEdit->setText(totalReads); totalReadsLineEdit->setAlignment(Qt::AlignRight); totalWritesLineEdit->setText(totalWrites); totalWritesLineEdit->setAlignment(Qt::AlignRight); int warningTemperature = 55; int criticalTemperature = 60; if (isNvme) { QString stringValue; warningTemperature = 65; criticalTemperature = 70; for (const QJsonValue &value : std::as_const(outputArray)) { stringValue = value.toString(); if (stringValue.startsWith("Optional Admin Commands")) { if (stringValue.contains("Self_Test")) { nvmeHasSelfTest = true; } } else if (stringValue.startsWith("Warning Comp. Temp. Threshold")) { qsizetype pos = stringValue.indexOf(':'); if (pos != -1) { QString thresholdStr = stringValue.mid(pos + 1).trimmed(); int temperature = thresholdStr.section(' ', 0, 0).toInt(); if (temperature > 0) { warningTemperature = temperature; } } } else if (stringValue.startsWith("Critical Comp. Temp. Threshold")) { qsizetype pos = stringValue.indexOf(':'); if (pos != -1) { QString thresholdStr = stringValue.mid(pos + 1).trimmed(); int temperature = thresholdStr.section(' ', 0, 0).toInt(); if (temperature > 0) { criticalTemperature = temperature; } } } } } else if (isScsi) { int driveTripInt = temperatureObj["drive_trip"].toInt(); if (driveTripInt > 0) { criticalTemperature = driveTripInt; } } QLabel *temperatureValueLabel, *healthStatusValueLabel; if (INCLUDE_OPTIONAL_RESOURCES) { temperatureValueLabel = temperatureValueHorizontal; healthStatusValueLabel = healthStatusValueHorizontal; } else { temperatureValueLabel = temperatureValue; healthStatusValueLabel = healthStatusValue; } if (temperatureInt > warningTemperature) { // TODO: Let the user set an alarm temp. temperatureValueLabel->setStyleSheet("background-color: " + badColor.name() + ";"); } else if ((temperatureInt < criticalTemperature) && (temperatureInt > warningTemperature)){ temperatureValueLabel->setStyleSheet("background-color: " + cautionColor.name() + ";"); } else if (temperatureInt == 0) { temperatureValueLabel->setStyleSheet("background-color: " + naColor.name() + ";"); } else { temperatureValueLabel->setStyleSheet("background-color: " + goodColor.name() + ";"); } QString labelStyle = "font-size:12pt; font-weight:700; color:black"; if (temperatureInt > 0) { if (ui->actionUse_Fahrenheit->isChecked()) { int fahrenheit = static_cast((temperatureInt * 9.0 / 5.0) + 32.0); temperatureValueLabel->setText("

" + QString::number(fahrenheit) + " °F

"); } else { temperatureValueLabel->setText("

" + QString::number(temperatureInt) + " °C

"); } } else { temperatureValueLabel->setText("

" + "-- °C" + "

"); } temperatureValueLabel->setAlignment(Qt::AlignCenter); if (health == tr("Bad")) { healthStatusValueLabel->setStyleSheet("background-color: " + badColor.name() + ";"); } else if (health == tr("Caution")){ healthStatusValueLabel->setStyleSheet("background-color: " + cautionColor.name() + ";"); } else if (health == tr("Good")) { healthStatusValueLabel->setStyleSheet("background-color: " + goodColor.name() + ";"); } else { healthStatusValueLabel->setStyleSheet("background-color: " + naColor.name() + ";"); } if (INCLUDE_OPTIONAL_RESOURCES) { QPixmap statusAnimeBackground; QSize labelSize(100, 30); if (health == tr("Bad")) { statusAnimeBackground = QPixmap(":/icons/bad.png"); } else if (health == tr("Caution")){ statusAnimeBackground = QPixmap(":/icons/caution.png"); } else if (health == tr("Good")) { statusAnimeBackground = QPixmap(":/icons/good.png"); } else { statusAnimeBackground = QPixmap(":/icons/unknown.png"); } QPixmap statusAnimeBackgroundScaled = statusAnimeBackground.scaled(labelSize, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); statusLabel->setPixmap(statusAnimeBackgroundScaled); statusLabel->setToolTip(health); } QString percentageText = ""; if (!percentage.isEmpty()) { if (INCLUDE_OPTIONAL_RESOURCES) { percentageText = " (" + percentage + ")"; // 2 spaces is not a mistake } else { percentageText = "
" + percentage; } } healthStatusValueLabel->setText("

" + health + percentageText + "

"); healthStatusValueLabel->setAlignment(Qt::AlignCenter); if (protocol == "ATA") { addSmartAttributesTable(attributes); selfTestMenu->clear(); if (keys.isEmpty()) { selfTestMenu->setDisabled(true); } else { selfTestMenu->setEnabled(true); } for (const QString& key : std::as_const(keys)) { QString minutes = QString::number(pollingMinutes[key].toInt()); QString keyTranslated; if (key == "short") { keyTranslated = tr("Short"); } else if (key == "conveyance") { keyTranslated = tr("Conveyance"); } else if (key == "extended") { keyTranslated = tr("Extended"); } else { keyTranslated = key; keyTranslated[0] = keyTranslated[0].toUpper(); } QString actionLabel = keyTranslated + " (" + minutes + " " + tr("Min.)"); QAction *action = new QAction(actionLabel, this); selfTestMenu->addAction(action); QString mode; if (key == "extended") { mode = "long"; } else { mode = key; } connect(action, &QAction::triggered, this, [this, mode, name, minutes]() { Utils.selfTestHandler(mode, name, minutes); }); } if (ataSelfTestsTable.isEmpty()) { selfTestLogAction->setDisabled(true); } else { selfTestLogAction->setEnabled(true); selfTestLogAction->disconnect(); connect(selfTestLogAction, &QAction::triggered, this, [=]() { createTablePopup(ataSelfTestsTable); }); } } else if (protocol == "SCSI") { selfTestMenu->clear(); selfTestMenu->setDisabled(true); selfTestLogAction->setDisabled(true); addSCSIErrorCounterLogTable(scsiErrorCounterLog); } else { addNvmeLogTable(nvmeLogOrdered); selfTestMenu->clear(); if (nvmeHasSelfTest) { selfTestMenu->setEnabled(true); } else { selfTestMenu->setDisabled(true); } QAction *actionShort = new QAction(tr("Short"), this); selfTestMenu->addAction(actionShort); connect(actionShort, &QAction::triggered, this, [this, mode = "short", name, minutes = "0"]() { Utils.selfTestHandler(mode, name, minutes); }); QAction *actionLong = new QAction(tr("Extended"), this); selfTestMenu->addAction(actionLong); connect(actionLong , &QAction::triggered, this, [this, mode = "long", name, minutes = "0"]() { Utils.selfTestHandler(mode, name, minutes); }); if (nvmeSelfTestsTable.isEmpty()) { selfTestLogAction->setDisabled(true); } else { selfTestLogAction->setEnabled(true); selfTestLogAction->disconnect(); connect(selfTestLogAction, &QAction::triggered, this, [=]() { createTablePopup(nvmeSelfTestsTable); }); } } } void MainWindow::addSCSIErrorCounterLogTable(const QJsonObject &scsiErrorLog) { QStringList operations = {"read", "write", "verify"}; tableWidget->setRowCount(3); tableWidget->setColumnCount(9); tableWidget->verticalHeader()->setVisible(false); tableWidget->setItemDelegateForColumn(0, new StatusDot(tableWidget)); tableWidget->setHorizontalHeaderLabels({ "", "Operation", "Errors Corrected\nby ECC Fast", "Errors Corrected\nby ECC Delayed", "Errors Corrected\nby Rereads/Rewrites", "Total Errors\nCorrected", "Correction Algorithm\nInvocations", "Gigabytes\nProcessed", "Total Uncorrected\nErrors" }); int row = 0; for (const QString& operation : operations) { QColor statusColor; QJsonObject operationData = scsiErrorLog[operation].toObject(); if (operationData["total_uncorrected_errors"].toInt() == 0) { statusColor = goodColor; } else { statusColor = cautionColor; } QTableWidgetItem *statusItem = new QTableWidgetItem(); statusItem->setData(Qt::BackgroundRole, QVariant(statusColor)); tableWidget->setItem(row, 0, statusItem); QString operationTranslated; if (operation == "read") { operationTranslated = tr("Read"); } else if (operation == "write") { operationTranslated = tr("Write"); } else if (operation == "verify") { operationTranslated = tr("Verify"); } tableWidget->setItem(row, 1, new QTableWidgetItem(operationTranslated)); tableWidget->setItem(row, 2, new QTableWidgetItem(QString::number(operationData["errors_corrected_by_eccfast"].toInt()))); tableWidget->setItem(row, 3, new QTableWidgetItem(QString::number(operationData["errors_corrected_by_eccdelayed"].toInt()))); tableWidget->setItem(row, 4, new QTableWidgetItem(QString::number(operationData["errors_corrected_by_rereads_rewrites"].toInt()))); tableWidget->setItem(row, 5, new QTableWidgetItem(QString::number(operationData["total_errors_corrected"].toInt()))); tableWidget->setItem(row, 6, new QTableWidgetItem(QString::number(operationData["correction_algorithm_invocations"].toInt()))); tableWidget->setItem(row, 7, new QTableWidgetItem(operationData["gigabytes_processed"].toString())); tableWidget->setItem(row, 8, new QTableWidgetItem(QString::number(operationData["total_uncorrected_errors"].toInt()))); ++row; for (int rowNum = 0; rowNum < 3; ++rowNum) { for (int column = 0; column < 9; ++column) { QTableWidgetItem *item = tableWidget->item(rowNum, column); if (item) { if (column == 1) { item->setTextAlignment(Qt::AlignCenter | Qt::AlignVCenter); } else { item->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter); } } } } } tableWidget->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch); for (int i = 0; i < tableWidget->columnCount(); ++i) { if (i != 1) { tableWidget->horizontalHeader()->setSectionResizeMode(i, QHeaderView::ResizeToContents); } } tableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed); tableWidget->verticalHeader()->setDefaultSectionSize(31); tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); } void MainWindow::addNvmeLogTable(const QVector>& nvmeLogOrdered) { QString warningMessage = ""; qsizetype rowCount = nvmeLogOrdered.size(); if (rowCount > std::numeric_limits::max()) { rowCount = std::numeric_limits::max(); } tableWidget->setRowCount(static_cast(rowCount)); tableWidget->setColumnCount(4); tableWidget->setHorizontalHeaderLabels({"", tr("ID"), tr("Attribute Name"), tr("Raw Values")}); tableWidget->verticalHeader()->setVisible(false); tableWidget->setItemDelegateForColumn(0, new StatusDot(tableWidget)); tableWidget->horizontalHeaderItem(2)->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter); tableWidget->horizontalHeaderItem(3)->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter); int row = 0; for (const QPair &pair : std::as_const(nvmeLogOrdered)) { QString id = QString("%1").arg(row + 1, 2, 16, QChar('0')).toUpper(); QString key = pair.first; QString name = key.replace("_", " "); name = Utils.toTitleCase(name); int rawInt = pair.second; QString raw = QString::number(rawInt); if ((ui->actionHEX->isChecked())) { raw = QString("%1").arg(raw.toUInt(nullptr), 14, 16, QChar('0')).toUpper(); } QColor statusColor; if (id == "01" && rawInt) { statusColor = badColor; if (rawInt == 1) { // Still need to figure out if this is DEC or HEX in JSON warningMessage = tr("Available spare capacity has fallen below the threshold"); // THX to CrystalDiskInfo for the messages } else if (rawInt == 2) { warningMessage = tr("Temperature error (Overheat or Overcool)"); } else if (rawInt == 4) { warningMessage = tr("NVM subsystem reliability has been degraded"); } else if (rawInt == 8) { warningMessage = tr("Media has been placed in Read Only Mode"); } else if (rawInt == 10) { warningMessage = tr("Volatile memory backup device has Failed"); } else if (rawInt == 20) { warningMessage = tr("Persistent memory region has become Read-Only"); } } else if (id == "03") { int availableSpareThreshold = nvmeLogOrdered.at(3).second; if (availableSpareThreshold > 100) { // Thx to crystaldiskinfo for these workarounds statusColor = goodColor; } else if (rawInt == 0 && availableSpareThreshold == 0) { statusColor = goodColor; } else if (rawInt < availableSpareThreshold) { statusColor = badColor; } else if (availableSpareThreshold != 100 && (rawInt == availableSpareThreshold)) { statusColor = cautionColor; } else { statusColor = goodColor; } } else if (id == "05" && rawInt >= 90) { // Make this configurable, currently hardcoded to 10% statusColor = cautionColor; } else { statusColor = goodColor; } QTableWidgetItem *statusItem = new QTableWidgetItem(); statusItem->setData(Qt::BackgroundRole, QVariant(statusColor)); QTableWidgetItem *idItem = new QTableWidgetItem(id); idItem->setTextAlignment(Qt::AlignCenter); QTableWidgetItem *nameItem = new QTableWidgetItem(name); QTableWidgetItem *rawItem = new QTableWidgetItem(raw); rawItem->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter); tableWidget->setItem(row, 0, statusItem); tableWidget->setItem(row, 1, idItem); tableWidget->setItem(row, 2, nameItem); tableWidget->setItem(row, 3, rawItem); ++row; } tableWidget->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch); for (int i = 0; i < tableWidget->columnCount(); ++i) { if (i != 2) { tableWidget->horizontalHeader()->setSectionResizeMode(i, QHeaderView::ResizeToContents); } } tableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed); tableWidget->verticalHeader()->setDefaultSectionSize(31); tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); if (!warningMessage.isEmpty()) { QMessageBox::warning(nullptr, tr("Critical Warning"), warningMessage); } } void MainWindow::addSmartAttributesTable(const QJsonArray &attributes) { qsizetype rowCount = attributes.size(); if (rowCount > std::numeric_limits::max()) { rowCount = std::numeric_limits::max(); } tableWidget->setRowCount(static_cast(rowCount)); tableWidget->setColumnCount(7); tableWidget->setHorizontalHeaderLabels({"", tr("ID"), tr("Attribute Name"), tr("Current"), tr("Worst"), tr("Threshold"), tr("Raw Values")}); tableWidget->verticalHeader()->setVisible(false); tableWidget->setItemDelegateForColumn(0, new StatusDot(tableWidget)); for (int i = 0; i < tableWidget->columnCount(); ++i) { QTableWidgetItem *headerItem = tableWidget->horizontalHeaderItem(i); if (headerItem) { if (i == 2) { headerItem->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter); } else if (i > 2) { headerItem->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter); } } } int row = 0; for (const QJsonValue &attr : attributes) { QJsonObject attrObj = attr.toObject(); QString id = QString("%1").arg(attrObj["id"].toInt(), 2, 16, QChar('0')).toUpper(); QString name = attrObj["name"].toString().replace("_", " "); int value = attrObj["value"].toInt(); int worst = attrObj["worst"].toInt(); int thresh = attrObj["thresh"].toInt(); QString rawString = attrObj["raw"].toObject()["string"].toString(); QString rawHEX = rawString; qsizetype spaceIndex = rawHEX.indexOf(' '); if (spaceIndex != -1) { rawHEX = rawHEX.left(spaceIndex); } if (rawHEX.startsWith("0x") && rawHEX.length() == 14) { rawHEX = rawHEX.mid(2).toUpper(); } else { rawHEX = QString("%1").arg(rawHEX.toUInt(nullptr), 12, 16, QChar('0')).toUpper(); } QColor statusColor; if (thresh && (value < thresh)) { statusColor = badColor; } else if ((id == "05" || id == "C5" || id == "C6" || (id == "C4" && !(ui->actionIgnore_C4_Reallocation_Event_Count->isChecked()))) && (rawHEX != "000000000000")) { statusColor = cautionColor; } else { statusColor = goodColor; } QTableWidgetItem *statusItem = new QTableWidgetItem(); statusItem->setData(Qt::BackgroundRole, QVariant(statusColor)); QTableWidgetItem *idItem = new QTableWidgetItem(id); idItem->setTextAlignment(Qt::AlignCenter); QTableWidgetItem *nameItem = new QTableWidgetItem(name); QTableWidgetItem *valueItem = new QTableWidgetItem(QString::number(value)); valueItem->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter); QTableWidgetItem *worstItem = new QTableWidgetItem(QString::number(worst)); worstItem->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter); QTableWidgetItem *threshItem = new QTableWidgetItem(QString::number(thresh)); threshItem->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter); QTableWidgetItem *rawItem; if (ui->actionHEX->isChecked()) { rawItem = new QTableWidgetItem(rawHEX); } else { rawItem = new QTableWidgetItem(rawString); } rawItem->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter); tableWidget->setItem(row, 0, statusItem); tableWidget->setItem(row, 1, idItem); tableWidget->setItem(row, 2, nameItem); tableWidget->setItem(row, 3, valueItem); tableWidget->setItem(row, 4, worstItem); tableWidget->setItem(row, 5, threshItem); tableWidget->setItem(row, 6, rawItem); ++row; } tableWidget->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch); for (int i = 0; i < tableWidget->columnCount(); ++i) { if (i != 2) { tableWidget->horizontalHeader()->setSectionResizeMode(i, QHeaderView::ResizeToContents); } } tableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed); tableWidget->verticalHeader()->setDefaultSectionSize(31); tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); } void MainWindow::transformWindow() { setMaximumSize(960, 960); resize(960, 600); QLayoutItem *item; while ((item = verticalLayout->takeAt(0)) != nullptr) { QWidget *widget = item->widget(); if (widget) { delete widget; } delete item; } verticalLayout->addWidget(statusLabel); if (CHARACTER_IS_RIGHT) { QSpacerItem *spacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); gridLayout->addItem(spacer,3,3); setMinimumWidth(645); } else { setMinimumWidth(960); } QHBoxLayout *infoLayout = ui->centralwidget->findChild("info"); QSpacerItem *spacerItem = infoLayout->itemAt(1)->spacerItem(); if (spacerItem) { infoLayout->removeItem(spacerItem); delete spacerItem; } QPalette palette = QApplication::palette(); QColor backgroundColor = palette.color(QPalette::Window); int lightness = backgroundColor.lightness(); bool darkTheme = lightness < 128; QPixmap animeBackground; if (darkTheme) { animeBackground = QPixmap(":/icons/bg_dark.png"); } else { animeBackground = QPixmap(":/icons/bg_light.png"); } animeBackground = animeBackground.scaled(this->size(), Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); palette.setBrush(QPalette::Window, QBrush(animeBackground)); ui->centralwidget->setPalette(palette); ui->centralwidget->setAutoFillBackground(true); } void MainWindow::on_actionQuit_triggered() { qApp->quit(); } void MainWindow::on_actionSave_JSON_triggered() { if (deviceJson.isEmpty()) { QMessageBox::information(this, tr("Empty JSON"), tr("The JSON is empty")); return; } QString fileName = QFileDialog::getSaveFileName(this, tr("Save JSON"), "", tr("JSON (*.json);;All Files (*)")); if (fileName.isEmpty()) return; else { QFile file(fileName); if (!file.open(QIODevice::WriteOnly)) { QMessageBox::information(this, tr("Unable to open file for writing"), file.errorString()); return; } QJsonDocument doc(deviceJson); QByteArray jsonData = doc.toJson(); file.write(jsonData); file.close(); } } void MainWindow::on_actionGitHub_triggered() { QDesktopServices::openUrl(QUrl("https://github.com/edisionnano/QDiskInfo")); } void MainWindow::on_actionAbout_QDiskInfo_triggered() { QString message = tr("An ATA and NVMe S.M.A.R.T. data viewer for Linux") + "\n"; message += tr("Licensed under the GNU G.P.L. Version 3") + "\n"; message += tr("Made by Samantas5855") + "\n"; message += tr("Version") + " " + QString::number(PROJECT_VERSION_MAJOR) + "." + QString::number(PROJECT_VERSION_MINOR); QMessageBox::about(this, tr("About QDiskInfo"), message); } void MainWindow::on_actionAbout_Qt_triggered() { QMessageBox::aboutQt(this, tr("About Qt")); } void MainWindow::on_actionRescan_Refresh_triggered() { QPair values = Utils.scanDevices(initializing); deviceOutputs = values.first; devices = values.second; if (!deviceOutputs.isEmpty()) { Utils.clearButtonGroup(buttonGroup, horizontalLayout, buttonStretch, menuDisk); updateUI(); } } void MainWindow::on_actionIgnore_C4_Reallocation_Event_Count_toggled(bool enabled) { settings.setValue("IgnoreC4", enabled); if (!initializing) { Utils.clearButtonGroup(buttonGroup, horizontalLayout, buttonStretch, menuDisk); updateUI(); } } void MainWindow::on_actionHEX_toggled(bool enabled) { settings.setValue("HEX", enabled); if (!initializing) { Utils.clearButtonGroup(buttonGroup, horizontalLayout, buttonStretch, menuDisk); updateUI(); } } void MainWindow::on_actionUse_Fahrenheit_toggled(bool enabled) { settings.setValue("Fahrenheit", enabled); if (!initializing) { Utils.clearButtonGroup(buttonGroup, horizontalLayout, buttonStretch, menuDisk); updateUI(); } } void MainWindow::on_actionCyclic_Navigation_toggled(bool cyclicNavigation) { settings.setValue("CyclicNavigation", cyclicNavigation); qsizetype currentIndex = buttonGroup->buttons().indexOf(buttonGroup->checkedButton()); updateNavigationButtons(currentIndex); } void MainWindow::on_actionUse_GB_instead_of_TB_toggled(bool gigabytes) { settings.setValue("UseGB", gigabytes); if (!initializing) { Utils.clearButtonGroup(buttonGroup, horizontalLayout, buttonStretch, menuDisk); updateUI(); } } void MainWindow::mousePressEvent(QMouseEvent *event) { if (event->button() == Qt::ForwardButton && nextButton->isEnabled()) { onNextButtonClicked(); } else if (event->button() == Qt::BackButton && prevButton->isEnabled()) { onPrevButtonClicked(); } } qdiskinfo-0.2+git20240812+ds/src/mainwindow.h000066400000000000000000000055511465740756300205110ustar00rootroot00000000000000#pragma once #include #include #include #include #include #include #include #include #include #include "statusdot.h" #include "custombutton.h" #include "jsonparser.h" #include "utils.h" #include "./ui_mainwindow.h" QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QWidget *parent = nullptr); ~MainWindow(); private slots: void on_actionQuit_triggered(); void on_actionSave_JSON_triggered(); void on_actionGitHub_triggered(); void on_actionAbout_QDiskInfo_triggered(); void on_actionAbout_Qt_triggered(); void on_actionRescan_Refresh_triggered(); void on_actionIgnore_C4_Reallocation_Event_Count_toggled(bool enabled); void on_actionHEX_toggled(bool enabled); void on_actionUse_Fahrenheit_toggled(bool enabled); void on_actionCyclic_Navigation_toggled(bool arg1); void on_actionUse_GB_instead_of_TB_toggled(bool arg1); private: Ui::MainWindow *ui; QSettings settings; bool initializing; QLocale locale; utils Utils; QButtonGroup *buttonGroup; QHBoxLayout *horizontalLayout; QVBoxLayout *verticalLayout; QGridLayout *gridLayout; QLabel *diskName, *temperatureValue, *healthStatusValue; QLabel *temperatureLabelHorizontal, *healthStatusLabelHorizontal, *temperatureValueHorizontal, *healthStatusValueHorizontal; QLineEdit *firmwareLineEdit, *serialNumberLineEdit, *typeLineEdit, *protocolLineEdit, *deviceNodeLineEdit; QLineEdit *totalReadsLineEdit, *totalWritesLineEdit, *rotationRateLineEdit, *powerOnCountLineEdit, *powerOnHoursLineEdit; QTableWidget *tableWidget; QPushButton *prevButton, *nextButton; QColor goodColor, cautionColor, badColor, naColor; QLabel *statusLabel; QJsonObject deviceJson; QSpacerItem *buttonStretch; QAction *actionCyclic_Navigation; QMenu *menuDevice; QMenu *menuDisk; QMenu *selfTestMenu; QAction *selfTestLogAction; QActionGroup *disksGroup; QJsonArray devices; QStringList deviceOutputs; QJsonObject globalObj; QString globalHealth; bool globalIsNvme; QVector> globalNvmeSmartOrdered; void onNextButtonClicked(); void onPrevButtonClicked(); void updateNavigationButtons(qsizetype currentIndex); void updateUI(); void populateWindow(const QJsonObject &tempObj, const QString &health, const QVector>& nvmeLogOrdered = QVector>()); void addSCSIErrorCounterLogTable(const QJsonObject &scsiErrorCounterLog); void addNvmeLogTable(const QVector>& nvmeLogOrdered); void addSmartAttributesTable(const QJsonArray &attributes); void transformWindow(); void mousePressEvent(QMouseEvent*); }; qdiskinfo-0.2+git20240812+ds/src/mainwindow.ui000066400000000000000000000522651465740756300207030ustar00rootroot00000000000000 MainWindow Qt::WindowModality::NonModal 0 0 800 600 0 0 QDiskInfo :/icons/icon.svg:/icons/icon.svg false true true 0 <html><head/><body><p align="center">Health Status</p></body></html> 0 50 background-color: rgb(0, 255, 0); <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">Good</span></p><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">100 %</span></p></body></html> Qt::Orientation::Vertical QSizePolicy::Policy::Maximum 20 10 <html><head/><body><p align="center">Temperature</p></body></html> 16777215 35 background-color: rgb(0, 255, 0); <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">23° C</span></p></body></html> Qt::Orientation::Vertical QSizePolicy::Policy::Maximum 20 10 Qt::Orientation::Horizontal QSizePolicy::Policy::Preferred 40 20 Firmware true Serial Number true Protocol true Device Node true true true true 180 30 background-color: rgb(0, 255, 0); <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">Good 100 %</span></p></body></html> true <html><head/><body><p align="center">Health Status</p></body></html> Type true Total Host Reads true Total Host Writes true Rotation Rate true Power On Count true Power On Hours true true 135 30 background-color: rgb(0, 255, 0); <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">23° C</span></p></body></html> true <html><head/><body><p align="center">Temperature</p></body></html> Qt::Orientation::Horizontal 40 20 <html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:700;">Hard Drive Name</span></p></body></html> Qt::Orientation::Horizontal 40 20 0 0 QFrame::Shape::NoFrame Qt::ScrollBarPolicy::ScrollBarAlwaysOff true 0 0 670 16 0 0 Qt::Orientation::Horizontal 40 20 0 0 800 30 File Settings &Help De&vice Disk &Save JSON &Quit QAction::MenuRole::NoRole &Refresh Devices &GitHub :/icons/icon.svg:/icons/icon.svg &About QDiskInfo QAction::MenuRole::NoRole true &Ignore C4 (Reallocated Event Count) true &Convert Raw values to HEX true &Use Fahrenheit Self Test true Cyclic &Navigation true Use &GB instead of TB About &Qt qdiskinfo-0.2+git20240812+ds/src/resources.qrc000066400000000000000000000006531465740756300207030ustar00rootroot00000000000000 ../dist/QDiskInfo.svg ../translations/qdiskinfo_el_GR.qm ../translations/qdiskinfo_es_ES.qm ../translations/qdiskinfo_pt_BR.qm qdiskinfo-0.2+git20240812+ds/src/statusdot.cpp000066400000000000000000000011431465740756300207130ustar00rootroot00000000000000#include "statusdot.h" void StatusDot::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { QStyleOptionViewItem opt = option; initStyleOption(&opt, index); int dotSize = 15; painter->save(); painter->setRenderHint(QPainter::Antialiasing, true); QRect dotRect(opt.rect.center().x() - dotSize / 2, opt.rect.center().y() - dotSize / 2, dotSize, dotSize); QColor color = index.data(Qt::BackgroundRole).value(); painter->setBrush(color); painter->setPen(Qt::NoPen); painter->drawEllipse(dotRect); painter->restore(); } qdiskinfo-0.2+git20240812+ds/src/statusdot.h000066400000000000000000000006011465740756300203560ustar00rootroot00000000000000#pragma once #include #include #include class StatusDot : public QStyledItemDelegate { public: StatusDot(QObject *parent = nullptr) : QStyledItemDelegate(parent) {} void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; }; qdiskinfo-0.2+git20240812+ds/src/utils.cpp000066400000000000000000000174421465740756300200320ustar00rootroot00000000000000#include "utils.h" #include #include #include #include #include #include #include #include #include void utils::clearButtonGroup(QButtonGroup* buttonGroup, QHBoxLayout* horizontalLayout, QSpacerItem* buttonStretch, QMenu* menuDisk) { QList buttons = buttonGroup->buttons(); for (QAbstractButton* button : std::as_const(buttons)) { buttonGroup->removeButton(button); delete button; } horizontalLayout->removeItem(buttonStretch); delete buttonStretch; menuDisk->clear(); } QString utils::getSmartctlPath() { QStringList paths = QString::fromLocal8Bit(qgetenv("PATH")).split(QDir::listSeparator(), Qt::SkipEmptyParts); paths << "/usr/sbin" << "/usr/local/sbin"; for (const QString &path : std::as_const(paths)) { QString absolutePath = QDir(path).absoluteFilePath("smartctl"); if (QFile::exists(absolutePath) && QFileInfo(absolutePath).isExecutable()) { return absolutePath; } } return QString(); } QString utils::getSmartctlOutput(const QStringList &arguments, bool root, bool initializing) { QProcess process; QString command; if (root) { command = "pkexec"; } else { command = getSmartctlPath(); } if (!getSmartctlPath().isEmpty()) { process.start(command, arguments); process.waitForFinished(-1); } if (process.exitCode() == 126 || process.exitCode() == 127) { QMessageBox::critical(nullptr, QObject::tr("QDiskInfo Error"), QObject::tr("QDiskInfo needs root access in order to read S.M.A.R.T. data!")); if (initializing) { QTimer::singleShot(0, qApp, &QApplication::quit); } return QString(); } if (process.isOpen()) { return process.readAllStandardOutput(); } else { return QString(); } } QPair utils::scanDevices(bool initializing) { QString output = getSmartctlOutput({"--scan", "--json"}, false, initializing); QJsonDocument doc = QJsonDocument::fromJson(output.toUtf8()); QJsonObject jsonObj = doc.object(); QJsonArray devices = jsonObj["devices"].toArray(); QString smartctlPath = getSmartctlPath(); QStringList commandList; QStringList deviceOutputs; for (const QJsonValue &value : std::as_const(devices)) { QJsonObject device = value.toObject(); QString deviceName = device["name"].toString(); commandList.append((smartctlPath + " --all --json=o %1").arg(deviceName)); } QString command = commandList.join(" ; "); if (smartctlPath.isEmpty()) { QMessageBox::critical(nullptr, QObject::tr("QDiskInfo Error"), QObject::tr("smartctl was not found, please install it!")); QTimer::singleShot(0, qApp, &QApplication::quit); } QString allDevicesOutput = getSmartctlOutput({"sh", "-c", command}, true, initializing); qsizetype startIndex = 0; qsizetype endIndex = 0; static const QRegularExpression regex("\\}\\n\\{"); while ((endIndex = allDevicesOutput.indexOf(regex, startIndex)) != -1) { ++endIndex; QString jsonFragment = allDevicesOutput.mid(startIndex, endIndex - startIndex); deviceOutputs.append(jsonFragment); startIndex = endIndex; } if (startIndex < allDevicesOutput.size()) { QString jsonFragment = allDevicesOutput.mid(startIndex); deviceOutputs.append(jsonFragment); } if (!allDevicesOutput.isEmpty()) { return QPair(deviceOutputs, devices); } else { return QPair(QStringList(), QJsonArray()); } } QString utils::initiateSelfTest(const QString &testType, const QString &deviceNode) { QProcess process; QString command = getSmartctlPath(); QStringList arguments; arguments << command << "--json=o" << "-t" << testType << deviceNode; process.start("pkexec", arguments); process.waitForFinished(-1); if (process.isOpen()) { return process.readAllStandardOutput(); } else { return QString(); } } void utils::cancelSelfTest(const QString &deviceNode) { QProcess process; QString command = getSmartctlPath(); QStringList arguments; arguments << command << "-X" << deviceNode; process.start("pkexec", arguments); process.waitForFinished(-1); if (process.exitCode() == 126 || process.exitCode() == 127) { QMessageBox::critical(nullptr, QObject::tr("QDiskInfo Error"), QObject::tr("QDiskInfo needs root access in order to abort a self-test!")); } else if (process.exitCode() == QProcess::NormalExit) { QMessageBox::information(nullptr, QObject::tr("Test Requested"), QObject::tr("The self-test has been aborted")); } else { QMessageBox::critical(nullptr, QObject::tr("QDiskInfo Error"), QObject::tr("Error: Something went wrong")); } } void utils::selfTestHandler(const QString &mode, const QString &name, const QString &minutes) { QString output = initiateSelfTest(mode, name); if (output.isEmpty()) { QMessageBox::critical(nullptr, QObject::tr("QDiskInfo Error"), QObject::tr("QDiskInfo needs root access in order to request a self-test!")); } else { QJsonDocument testDoc = QJsonDocument::fromJson(output.toUtf8()); QJsonObject testObj = testDoc.object(); QJsonObject smartctlObj = testObj.value("smartctl").toObject(); int exitStatus = smartctlObj.value("exit_status").toInt(); QJsonArray outputArray = smartctlObj["output"].toArray(); static const QRegularExpression regex("\\((\\d+%)\\s*(\\w+)\\)"); QString percentage; for (const QJsonValue &value : outputArray) { QString line = value.toString(); QRegularExpressionMatch match = regex.match(line); if (match.hasMatch()) { percentage = match.captured(0); break; } } percentage.replace("remaining", QObject::tr("remaining")); percentage.replace("completed", QObject::tr("completed")); if (exitStatus == 4) { QMessageBox msgBox; msgBox.setWindowTitle(QObject::tr("Test Already Running")); msgBox.setText(QObject::tr("A self-test is already being performed") + " " + percentage + "\n" + QObject::tr("You can press the Ok button in order to abort the test that is currently running")); msgBox.setIcon(QMessageBox::Warning); msgBox.addButton(QMessageBox::Cancel); QPushButton *abortButton = msgBox.addButton(QMessageBox::Ok); msgBox.exec(); if (msgBox.clickedButton() == abortButton) { cancelSelfTest(name); } } else if (exitStatus == 0) { QString infoMessage = QObject::tr("A self-test has been requested successfully"); if (minutes != "0") { infoMessage = infoMessage + "\n" + QObject::tr("It will be completed after") + " " + minutes + " " + QObject::tr("minutes"); } QMessageBox::information(nullptr, QObject::tr("Test Requested"), infoMessage); } else { QMessageBox::critical(nullptr, QObject::tr("QDiskInfo Error"), QObject::tr("Error: Something went wrong")); } } } QString utils::toTitleCase(const QString& sentence) { QString result; bool capitalizeNext = true; for (const QChar& c : sentence) { if (c.isLetter()) { if (capitalizeNext) { result += c.toUpper(); capitalizeNext = false; } else { result += c.toLower(); } } else { result += c; if (c == ' ') { capitalizeNext = true; } } } return result; } qdiskinfo-0.2+git20240812+ds/src/utils.h000066400000000000000000000014001465740756300174620ustar00rootroot00000000000000#pragma once #include #include #include #include #include class utils { public: utils() = default; void clearButtonGroup(QButtonGroup* buttonGroup, QHBoxLayout* horizontalLayout, QSpacerItem* buttonStretch, QMenu* menuDisk); QString getSmartctlPath(); QString getSmartctlOutput(const QStringList &arguments, bool root, bool initializing); QPair scanDevices(bool initializing); QString initiateSelfTest(const QString &testType, const QString &deviceNode); void cancelSelfTest(const QString &deviceNode); void selfTestHandler(const QString &mode, const QString &name, const QString &minutes); QString toTitleCase(const QString& sentence); }; qdiskinfo-0.2+git20240812+ds/translations/000077500000000000000000000000001465740756300201105ustar00rootroot00000000000000qdiskinfo-0.2+git20240812+ds/translations/qdiskinfo_el_GR.qm000066400000000000000000000210341465740756300235060ustar00rootroot00000000000000d8fʳZ;rAOAC d^dاóS=Y[he.*d+lLGB3v _.WU n $ ?U k], la= : 0 Rd } Ɍ ՛d AQ 4N . T I RVz e S t vO, s ɠ B U n o9  Ù.^Fn:ru%Nt iit0   &QDiskInfo&About QDiskInfo MainWindowH&    &Convert Raw values to HEX MainWindow&&Help MainWindowP&  C4 (Reallocated Event Count)$&Ignore C4 (Reallocated Event Count) MainWindow&&Quit MainWindow$& &Refresh Devices MainWindow  &JSON &Save JSON MainWindow" &Fahrenheit&Use Fahrenheit MainWindow<html><head/><body><p align="center">. </p></body></html>D

Health Status

 MainWindow<html><head/><body><p align="center"></p></body></html>B

Temperature

 MainWindow"   &Qt About &Qt MainWindow.   QDiskInfoAbout QDiskInfo MainWindow    QtAbout Qt MainWindowN  S.M.A.R.T.   Linux0An ATA and NVMe S.M.A.R.T. data viewer for Linux MainWindowAttribute Name MainWindow\         7Available spare capacity has fallen below the threshold MainWindowBad MainWindowCaution MainWindow Conveyance MainWindow. Critical Warning MainWindowCurrent MainWindow"& Cyclic &Navigation MainWindow&De&vice MainWindow Device Node MainWindow&Disk MainWindow JSON Empty JSON MainWindowExtended MainWindow&File MainWindow" Firmware MainWindowGood MainWindowBJSON (*.json);;;   (*)JSON (*.json);;All Files (*) MainWindowX    GNU G.P.L.  3'Licensed under the GNU G.P.L. Version 3 MainWindowD   Samantas5855Made by Samantas5855 MainWindown       'Media has been placed in Read Only Mode MainWindow .)Min.) MainWindowD   NVMe  +NVM subsystem reliability has been degraded MainWindow        -Persistent memory region has become Read-Only MainWindow( Power On Count MainWindow  Power On Hours MainWindowProtocol MainWindow Raw Values MainWindow$  Rotation Rate MainWindow JSON Save JSON MainWindow Self Test MainWindow:&  Self Test Log MainWindow"  Serial Number MainWindow&Settings MainWindowShort MainWindow.& Start Self Test MainWindowStatus MainWindowZ  (  )(Temperature error (Overheat or Overcool) MainWindow.  JSON  The JSON is empty MainWindow Threshold MainWindow( Total Host Reads MainWindow$ Total Host Writes MainWindow Type MainWindowr         Unable to open file for writing MainWindowUnknown MainWindow* &GB   TBUse &GB instead of TB MainWindow Version MainWindow        (Volatile memory backup device has Failed MainWindowWorst MainWindowcount MainWindowhours MainWindow@   +A self-test has been requested successfullyQObjectR     &A self-test is already being performedQObject0:   Error: Something went wrongQObject*   It will be completed afterQObject  QDiskInfoQDiskInfo ErrorQObject QDiskInfo        !:QDiskInfo needs root access in order to abort a self-test!QObject QDiskInfo         S.M.A.R.T.!=QDiskInfo needs root access in order to read S.M.A.R.T. data!QObject QDiskInfo        ! MainWindow QDiskInfo <html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:700;">Hard Drive Name</span></p></body></html> <html><head/><body><p align="center">Health Status</p></body></html> <html><head/><body><p align="center">Κατάστ. Υγειας</p></body></html> <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">Good</span></p><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">100 %</span></p></body></html> <html><head/><body><p align="center">Temperature</p></body></html> <html><head/><body><p align="center">Θερμοκρασία</p></body></html> <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">23° C</span></p></body></html> Firmware Έκδοση Λογισμικού Serial Number Σειριακός Αριθμός Protocol Πρωτόκολλο Device Node Διαδρομή <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">Good 100 %</span></p></body></html> Type Τύπος Total Host Reads Συνολικές Αναγνώσεις Total Host Writes Συνολικές Εγγραφές Rotation Rate Ρυθμός Περιστροφής Power On Count Μετρητής Λειτουργίας Power On Hours Ώρες Λειτουργίας File &Αρχείο Settings &Ρυθμίσεις &Quit Έ&ξοδος &Refresh Devices &Ανανέωση Συσκευών &About QDiskInfo Σχετικά με το &QDiskInfo &Convert Raw values to HEX &Μετατροπή των τιμών σε δεκαεξαδικές Self Test Αυτοδιάγνωση Cyclic &Navigation &Κυκλική Πλοήγηση Use &GB instead of TB Χρήση &GB αντί για TB About &Qt Σχετικά με το &Qt About Qt Σχετικά με το Qt &Help &Βοήθεια De&vice &Συσκευή Disk &Δίσκος &Save JSON Αποθήκευση &JSON &GitHub &Ignore C4 (Reallocated Event Count) &Αγνόησε το C4 (Reallocated Event Count) &Use Fahrenheit Χρήση &Fahrenheit Good Καλή Caution Προσοχή Bad Κακή Unknown Άγνωστη Attribute Name Ιδιότητα Raw Values Τιμή Current Τρέχουσα Worst Χειρότερη Threshold Όριο Status Κατάσταση Self Test Log &Καταγραφολόγιο Αυτοδιάγνωσης Start Self Test &Εκκίνηση Αυτοδιάγνωσης Min.) Λεπ.) Short Σύντομο count μονάδες hours ώρες Conveyance Μεταφορά Extended Εμπεριστατωμένο ID Available spare capacity has fallen below the threshold Η υγεία του δίσκου έχει πέσει κάτω από το όριο Temperature error (Overheat or Overcool) Σφάλμα θερμοκρασίας (Υπερθέρμανση ή Υπερψύξη) NVM subsystem reliability has been degraded Η αξιοπιστία του NVMe έχει μειωθεί Media has been placed in Read Only Mode Το μέσο έχει τεθεί αποκλειστικά σε λειτουργία ανάγνωσης Volatile memory backup device has Failed Η δημιουργία αρχείου επαναφοράς της μη διατηρήσιμης μνήμης απέτυχε Persistent memory region has become Read-Only Η διατηρήσιμη μνήμη έχει μεταβεί αποκλειστικά σε λειτουργία ανάγνωσης Critical Warning Σημαντική Προειδοποίηση Empty JSON Κενό JSON The JSON is empty Αυτό το JSON είναι κενό Save JSON Αποθήκευση JSON JSON (*.json);;All Files (*) JSON (*.json);;;Όλα τα αρχεία (*) Unable to open file for writing Δεν είναι δυνατό το άνοιγμα αυτού του αρχείου για εγγραφή An ATA and NVMe S.M.A.R.T. data viewer for Linux Ένας αναγνώστης S.M.A.R.T. για τα Linux Licensed under the GNU G.P.L. Version 3 Διατίθεται υπό την άδεια GNU G.P.L. Έκδοση 3 Version Έκδοση Made by Samantas5855 Δημιουργήθηκε από τον Samantas5855 About QDiskInfo Σχετικά με το QDiskInfo QObject QDiskInfo Error Σφάλμα QDiskInfo QDiskInfo needs root access in order to read S.M.A.R.T. data! Το QDiskInfo χρειάζεται δικαιώματα υπερχρήστη για να προσπελάσει τα δεδομένα S.M.A.R.T.! smartctl was not found, please install it! Το smartctl δε βρέθηκε, παρακαλείσθε να το εγκαταστήσετε! QDiskInfo needs root access in order to abort a self-test! Το QDiskInfo χρειάζεται δικαιώματα υπερχρήστη για να ακυρώσει μία αυτοδιάγνωση! Test Requested Η αυτοδιάγνωση ξεκίνησε The self-test has been aborted Η τρέχουσα αυτοδιάγνωση ακυρώθηκε Error: Something went wrong Σφάλμα: Κάτι πήγε στραβά QDiskInfo needs root access in order to request a self-test! Το QDiskInfo χρειάζεται δικαιώματα υπερχρήστη για να εκτελέσει την αυτοδιάγνωση! remaining απομένει completed ολοκληρώθηκε Test Already Running Μία αυτοδιάγνωση είναι ήδη σε εκτέλεση A self-test is already being performed Μία αυτοδιάγνωση εκτελείτε αυτή τη στιγμή You can press the Ok button in order to abort the test that is currently running Μπορείτε να πατήσετε το κουμπί Εντάξει για να ακυρώσετε την τρέχουσα αυτοδιάγνωση A self-test has been requested successfully Η αυτοδιάγνωση ξεκίνησε επιτυχώς It will be completed after Θα τελειώσει μετά από minutes λεπτά qdiskinfo-0.2+git20240812+ds/translations/qdiskinfo_es_ES.qm000066400000000000000000000235571465740756300235300ustar00rootroot00000000000000<head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">23 C</span></p></body></html>

23° C

 MainWindow<html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">Bueno</span></p><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">100 %</span></p></body></html>

Good

100 %

 MainWindow<html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:700;">Nombre del Disco</span></p></body></html>}

Hard Drive Name

 MainWindowz<html><head/><body><p align="center">Estado</p></body></html>D

Health Status

 MainWindow<html><head/><body><p align="center">Temperatura</p></body></html>B

Temperature

 MainWindowAcerca de &Qt About &Qt MainWindow&Acerca de QDiskInfoAbout QDiskInfo MainWindowAcerca de QtAbout Qt MainWindowXUn visor de datos S.M.A.R.T. para ATA y NVMe0An ATA and NVMe S.M.A.R.T. data viewer for Linux MainWindow&Nombre del AtributoAttribute Name MainWindowtEl espacio libre disponible ha cado por debajo del umbral7Available spare capacity has fallen below the threshold MainWindowMaloBad MainWindowPrecaucinCaution MainWindowTransferencia Conveyance MainWindow Aviso ImportanteCritical Warning MainWindow ActualCurrent MainWindow&&Navegacin CclicaCyclic &Navigation MainWindowDispositi&voDe&vice MainWindow,Archivo de Dispositivo Device Node MainWindow DiscoDisk MainWindow$Archivo JSON vaco Empty JSON MainWindowExtendidoExtended MainWindowArchivoFile MainWindow BuenoGood MainWindowJJSON (*.json);;Todos los archivos (*)JSON (*.json);;All Files (*) MainWindowtLicenciado bajo Licencia Pblica General de GNU, Versin 3'Licensed under the GNU G.P.L. Version 3 MainWindow,Hecho por Samantas5855Made by Samantas5855 MainWindowdEl medio se ha configurado en Modo de Solo Lectura'Media has been placed in Read Only Mode MainWindow Min.)Min.) MainWindow^La fiabilidad del subsitema NVM se ha degradado+NVM subsystem reliability has been degraded MainWindowzUna regin de memoria no voltil se ha vuelto de Solo Lectura-Persistent memory region has become Read-Only MainWindowVeces EncendidoPower On Count MainWindowHoras EncendidoPower On Hours MainWindowProtocoloProtocol MainWindow Valores en Bruto Raw Values MainWindow(Velocidad Rotacional Rotation Rate MainWindow(Guardar archivo JSON Save JSON MainWindow"Ejecutar Autotest Self Test MainWindow*Registro del Autotest Self Test Log MainWindowNmero de Serie Serial Number MainWindowAjustesSettings MainWindow CortoShort MainWindow Iniciar AutotestStart Self Test MainWindow EstadoStatus MainWindowlError de temperatura (Sobrecalentado o Sobre-enfriado)(Temperature error (Overheat or Overcool) MainWindow4El archivo JSON est vacoThe JSON is empty MainWindow Umbral Threshold MainWindow Lecturas TotalesTotal Host Reads MainWindow$Escrituras TotalesTotal Host Writes MainWindowTipoType MainWindowZNo se ha podido abrir el archivo de escrituraUnable to open file for writing MainWindowDesconocidoUnknown MainWindow.Usar &GB en lugar de TBUse &GB instead of TB MainWindowVersinVersion MainWindow|No se pudo crear el archivo de reversin de memoria no voltil(Volatile memory backup device has Failed MainWindowPeorWorst MainWindow vecescount MainWindow horashours MainWindowVEl autotest ha sido solicitado exitosamente+A self-test has been requested successfullyQObjectHUn autotest ya est siendo realizado&A self-test is already being performedQObject2Error: Algo ha salido malError: Something went wrongQObject Se completar enIt will be completed afterQObject$Error de QDiskInfoQDiskInfo ErrorQObject~QDiskInfo necesita acceso root para poder abortar un autotest!:QDiskInfo needs root access in order to abort a self-test!QObjectQDiskInfo necesita acceso root para poder leer informacin S.M.A.R.T!=QDiskInfo needs root access in order to read S.M.A.R.T. data!QObjectQDiskInfo necesita acceso root para poder solicitar un autotest! MainWindow QDiskInfo <html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:700;">Hard Drive Name</span></p></body></html> <html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:700;">Nombre del Disco</span></p></body></html> <html><head/><body><p align="center">Health Status</p></body></html> <html><head/><body><p align="center">Estado</p></body></html> <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">Good</span></p><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">100 %</span></p></body></html> <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">Bueno</span></p><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">100 %</span></p></body></html> <html><head/><body><p align="center">Temperature</p></body></html> <html><head/><body><p align="center">Temperatura</p></body></html> <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">23° C</span></p></body></html> <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">23° C</span></p></body></html> Firmware Serial Number Número de Serie Protocol Protocolo Device Node Archivo de Dispositivo <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">Good 100 %</span></p></body></html> Type Tipo Total Host Reads Lecturas Totales Total Host Writes Escrituras Totales Rotation Rate Velocidad Rotacional Power On Count Veces Encendido Power On Hours Horas Encendido File Archivo Settings Ajustes &Help Underline in unavailable letters has been removed for simplicity Ayuda De&vice Dispositi&vo Disk Disco &Save JSON Underline in unavailable letters has been removed for simplicity Guardar Archivo JSON &Quit Underline in unavailable letters has been removed for simplicity Salir &Refresh Devices Underline in unavailable letters has been removed for simplicity Actualizar Dispositivos &GitHub &About QDiskInfo Acerca de &QDiskInfo About &Qt Acerca de &Qt About Qt Acerca de Qt &Ignore C4 (Reallocated Event Count) &Ignorar C4 (Reallocated Event Count) &Convert Raw values to HEX &Convertir valores en Bruto a HEX &Use Fahrenheit &Usar Fahrenheit Self Test Ejecutar Autotest Cyclic &Navigation &Navegación Cíclica Use &GB instead of TB Usar &GB en lugar de TB Start Self Test Iniciar Autotest Self Test Log Registro del Autotest Good Bueno Caution Precaución Bad Malo Unknown Desconocido Status Estado count veces hours horas Short Corto Conveyance Transferencia Extended Extendido Min.) Min.) ID Attribute Name Nombre del Atributo Raw Values Valores en Bruto Available spare capacity has fallen below the threshold El espacio libre disponible ha caído por debajo del umbral Temperature error (Overheat or Overcool) Error de temperatura (Sobrecalentado o Sobre-enfriado) NVM subsystem reliability has been degraded La fiabilidad del subsitema NVM se ha degradado Media has been placed in Read Only Mode El medio se ha configurado en Modo de Solo Lectura Volatile memory backup device has Failed No se pudo crear el archivo de reversión de memoria no volátil Persistent memory region has become Read-Only Una región de memoria no volátil se ha vuelto de Solo Lectura Critical Warning Aviso Importante Current Actual Worst Peor Threshold Umbral Empty JSON Archivo JSON vacío The JSON is empty El archivo JSON está vacío Save JSON Guardar archivo JSON JSON (*.json);;All Files (*) JSON (*.json);;Todos los archivos (*) Unable to open file for writing No se ha podido abrir el archivo de escritura An ATA and NVMe S.M.A.R.T. data viewer for Linux Un visor de datos S.M.A.R.T. para ATA y NVMe Licensed under the GNU G.P.L. Version 3 Licenciado bajo Licencia Pública General de GNU, Versión 3 Made by Samantas5855 Hecho por Samantas5855 Version Versión About QDiskInfo Acerca de QDiskInfo QObject QDiskInfo Error Error de QDiskInfo QDiskInfo needs root access in order to read S.M.A.R.T. data! ¡QDiskInfo necesita acceso root para poder leer información S.M.A.R.T! smartctl was not found, please install it! smartctl no ha sido encontrado. ¡Por favor, instálalo! QDiskInfo needs root access in order to abort a self-test! ¡QDiskInfo necesita acceso root para poder abortar un autotest! Test Requested Autotest Solicitado The self-test has been aborted El autotest ha sido abortado Error: Something went wrong Error: Algo ha salido mal QDiskInfo needs root access in order to request a self-test! ¡QDiskInfo necesita acceso root para poder solicitar un autotest! remaining restante completed completado Test Already Running Autotest ya ejecutándose A self-test is already being performed Un autotest ya está siendo realizado You can press the Ok button in order to abort the test that is currently running Puedes pulsar el botón 'Aceptar' para abortar el test que se está realizando A self-test has been requested successfully El autotest ha sido solicitado exitosamente It will be completed after Se completará en minutes minutos qdiskinfo-0.2+git20240812+ds/translations/qdiskinfo_pt_BR.qm000066400000000000000000000230041465740756300235230ustar00rootroot00000000000000 4N  T 8 RVG e t vO s ɠ B - o~  Ù.^Fn r%Nt"Wi#I Sobre &QDiskInfo&About QDiskInfo MainWindowB&Converter Valores Puros para HEX&Convert Raw values to HEX MainWindow &Ajuda&Help MainWindowL&Ignorar C4 (N de Eventos Realocados)$&Ignore C4 (Reallocated Event Count) MainWindow &Sair&Quit MainWindow.&Atualizar Dispositivos&Refresh Devices MainWindow&Salvar JSON &Save JSON MainWindow &Usar Fahrenheit&Use Fahrenheit MainWindow<html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">23 C</span></p></body></html>

23° C

 MainWindow<html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">Saudvel</span></p><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">100 %</span></p></body></html>

Good

100 %

 MainWindow<html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:700;">Nome do Disco Rgido</span></p></body></html>}

Hard Drive Name

 MainWindow<html><head/><body><p align="center">Status de Sade</p></body></html>D

Health Status

 MainWindow<html><head/><body><p align="center">Temperatura</p></body></html>B

Temperature

 MainWindowSobre QDiskInfoAbout QDiskInfo MainWindowSobre o QtAbout Qt MainWindow`Um visualizador ATA e NVMe S.M.A.R.T. para Linux0An ATA and NVMe S.M.A.R.T. data viewer for Linux MainWindow Nome do AtributoAttribute Name MainWindowhCapacidade restante disponvel caiu abaixo do limite7Available spare capacity has fallen below the threshold MainWindowCrticoBad MainWindow AlertaCaution MainWindow Mdio Conveyance MainWindowAviso CrticoCritical Warning MainWindow AtualCurrent MainWindow$&Navegao CclicaCyclic &Navigation MainWindow&DispositivoDe&vice MainWindow"N do Dispositivo Device Node MainWindow DiscoDisk MainWindowJSON vazio Empty JSON MainWindow LongoExtended MainWindowArquivoFile MainWindowFirmwareFirmware MainWindowSadavelGood MainWindow8JSON (*.json);;All Files (*)JSON (*.json);;All Files (*) MainWindowHLicenciado sob a GNU G.P.L. Verso 3'Licensed under the GNU G.P.L. Version 3 MainWindow,Feito por Samantas5855Made by Samantas5855 MainWindow>Media em modo de apenas leitura'Media has been placed in Read Only Mode MainWindow Min.)Min.) MainWindowTConfiabilidade do subsistema NVM degradada+NVM subsystem reliability has been degraded MainWindow|Regio de memria persistente entrou em modo de apenas leitura-Persistent memory region has become Read-Only MainWindow$N de Vezes LigadoPower On Count MainWindow$N de Horas LigadoPower On Hours MainWindow PadroProtocol MainWindowValores Puros Raw Values MainWindowTaxa de Rotao Rotation Rate MainWindowSalvar JSON Save JSON MainWindowAuto Teste Self Test MainWindow"Log do Auto Teste Self Test Log MainWindowNmero Serial Serial Number MainWindowConfiguraesSettings MainWindow RpidoShort MainWindow$Comear Auto TesteStart Self Test MainWindow StatusStatus MainWindowTErro de Temperatura (Muito Quente ou Frio)(Temperature error (Overheat or Overcool) MainWindow"O JSON est vazioThe JSON is empty MainWindow Limite Threshold MainWindowLeituras TotaisTotal Host Reads MainWindowEscritas TotaisTotal Host Writes MainWindowTipoType MainWindowXNo foi possvel abrir o aquivo para escritaUnable to open file for writing MainWindowIndefinidoUnknown MainWindow(&Usar GB invs de TBUse &GB instead of TB MainWindow VersoVersion MainWindow^Dispositivo de backup de memria voltil falhou(Volatile memory backup device has Failed MainWindowPiorWorst MainWindow vezescount MainWindow horashours MainWindowPUm auto teste foi solicitado com sucesso+A self-test has been requested successfullyQObjectBUm auto teste j est em execuo&A self-test is already being performedQObjectDErro: Algo de errado no deu certoError: Something went wrongQObjectBO teste ser completado depois deIt will be completed afterQObjectQDiskInfo ErroQDiskInfo ErrorQObjectxQDiskInfo precisa de acesso root para abortar um auto teste!:QDiskInfo needs root access in order to abort a self-test!QObjectQDiskInfo precisa de acesso root para leitura dos dados S.M.A.R.T.!=QDiskInfo needs root access in order to read S.M.A.R.T. data!QObject|QDiskInfo precisa de acesso root para solicitar um auto teste! MainWindow QDiskInfo <html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:700;">Hard Drive Name</span></p></body></html> <html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:700;">Nome do Disco Rígido</span></p></body></html> <html><head/><body><p align="center">Health Status</p></body></html> <html><head/><body><p align="center">Status de Saúde</p></body></html> <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">Good</span></p><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">100 %</span></p></body></html> <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">Saudável</span></p><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">100 %</span></p></body></html> <html><head/><body><p align="center">Temperature</p></body></html> <html><head/><body><p align="center">Temperatura</p></body></html> <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">23° C</span></p></body></html> <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">23° C</span></p></body></html> Firmware Firmware Serial Number Número Serial Protocol Padrão Device Node Nó do Dispositivo <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:700; color:#000000;">Good 100 %</span></p></body></html> Type Tipo Total Host Reads Leituras Totais Total Host Writes Escritas Totais Rotation Rate Taxa de Rotação Power On Count Nº de Vezes Ligado Power On Hours Nº de Horas Ligado File Arquivo Settings Configurações &Help &Ajuda De&vice &Dispositivo Disk Disco &Save JSON &Salvar JSON &Quit &Sair &Refresh Devices &Atualizar Dispositivos &GitHub &About QDiskInfo Sobre &QDiskInfo About &Qt Sobre o &Qt About Qt Sobre o Qt &Ignore C4 (Reallocated Event Count) &Ignorar C4 (Nº de Eventos Realocados) &Convert Raw values to HEX &Converter Valores Puros para HEX &Use Fahrenheit &Usar Fahrenheit Self Test Auto Teste Cyclic &Navigation &Navegação Cíclica Use &GB instead of TB &Usar GB invés de TB Start Self Test Começar Auto Teste Self Test Log Log do Auto Teste Good Saúdavel Caution Alerta Bad Crítico Unknown Indefinido Status Status count vezes hours horas Short Rápido Conveyance Médio Extended Longo Min.) Min.) ID Attribute Name Nome do Atributo Raw Values Valores Puros Available spare capacity has fallen below the threshold Capacidade restante disponível caiu abaixo do limite Temperature error (Overheat or Overcool) Erro de Temperatura (Muito Quente ou Frio) NVM subsystem reliability has been degraded Confiabilidade do subsistema NVM degradada Media has been placed in Read Only Mode Media em modo de apenas leitura Volatile memory backup device has Failed Dispositivo de backup de memória volátil falhou Persistent memory region has become Read-Only Região de memória persistente entrou em modo de apenas leitura Critical Warning Aviso Crítico Current Atual Worst Pior Threshold Limite Empty JSON JSON vazio The JSON is empty O JSON está vazio Save JSON Salvar JSON JSON (*.json);;All Files (*) JSON (*.json);;All Files (*) Unable to open file for writing Não foi possível abrir o aquivo para escrita An ATA and NVMe S.M.A.R.T. data viewer for Linux Um visualizador ATA e NVMe S.M.A.R.T. para Linux Licensed under the GNU G.P.L. Version 3 Licenciado sob a GNU G.P.L. Versão 3 Made by Samantas5855 Feito por Samantas5855 Version Versão About QDiskInfo Sobre QDiskInfo QObject QDiskInfo Error QDiskInfo Erro QDiskInfo needs root access in order to read S.M.A.R.T. data! QDiskInfo precisa de acesso root para leitura dos dados S.M.A.R.T.! smartctl was not found, please install it! smartctl não foi encontrado, por favor instalar! QDiskInfo needs root access in order to abort a self-test! QDiskInfo precisa de acesso root para abortar um auto teste! Test Requested Teste Solicitado The self-test has been aborted Auto teste abortado Error: Something went wrong Erro: Algo de errado não deu certo QDiskInfo needs root access in order to request a self-test! QDiskInfo precisa de acesso root para solicitar um auto teste! remaining restante completed completo Test Already Running Teste já Executando A self-test is already being performed Um auto teste já está em execução You can press the Ok button in order to abort the test that is currently running Você pode apertar o botão de Ok para abortar o auto teste em execução A self-test has been requested successfully Um auto teste foi solicitado com sucesso It will be completed after O teste será completado depois de minutes minutos