ukui-sidebar/0000755000175000017500000000000013642562542012073 5ustar fengfengukui-sidebar/translations/0000755000175000017500000000000013634067640014614 5ustar fengfengukui-sidebar/translations/notification_plugin/0000755000175000017500000000000013642562542020660 5ustar fengfengukui-sidebar/translations/notification_plugin/language.ts0000644000175000017500000000243213642562542023014 0ustar fengfeng QObject Notification center 通知中心 Important notice 重要的通知 Clean up 清空 Set up 设置 No new notifications 没有新通知 Unimportant notice 不重要的通知 ukui-sidebar/translations/notification_plugin/language.qm0000644000175000017500000000057113642562542023005 0ustar fengfeng (2014) .SH "SEE ALSO" .SS Further information may also be available at: http://wiki.ukui-desktop.org/docs ukui-sidebar/AUTHORS0000644000175000017500000000016113626422413013133 0ustar fengfengukui-sidebar authors ------------------ chenchunan liushanwen ukui-sidebar/COPYING0000644000175000017500000010451313626422413013124 0ustar fengfeng 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 . ukui-sidebar/src/0000755000175000017500000000000013642562542012662 5ustar fengfengukui-sidebar/src/plugins/0000755000175000017500000000000013635351364014343 5ustar fengfengukui-sidebar/src/plugins/Clock_deamon/0000755000175000017500000000000013642626325016721 5ustar fengfengukui-sidebar/src/plugins/Clock_deamon/background.png0000644000175000017500000003326213642562542021554 0ustar fengfengPNG  IHDRl]sBITOtEXtSoftwaregnome-screenshot> IDATxY$I&}"jf~ǙuNs!ݽ|{|Cpv<=uefe~إ*5##"3άYYfjf"?#&"1$ 19+pdVdL3x /Vݺ=(Y5Vу?8euMTJwa ]RO[[4,.e߻(MjV'ch XŘ(%+ IHh||V0EhBtς7r[7¼ߺYkpwrn pY4& :8-8 '(#TṇWd~Yɶot/)D)j_}U[atED?7uxg&+7wrÑ;fVWff^~?۷R\ij8w\5r5KHPw"ԢLRy1=m=;{pԯm }0ĿYrFÝ 17:FĜ$arfr5dX<ph);cԪ5_Ë&: ;((ݘ-`YyUk/=rs2Sd$BWȧ%"vnfd)ؤF9aAtDGG0h![aGDC9KNt'' }~fr7hq1̯ FphdȨó'sTl=ZPeckjˠ>˯\>xݳ\.783!W| @pp闋ij m{w'?ª!0G,@[|ʏWؼ%B#IJFºٗ'_'O{) @7+!Awms|zcxo""녖 QF' ϛe1=ՖDAJ'qT/IG?Y?ApDf"2\R0Ӌ?=?9]x6Т7|Xޭ;/՚q zga B:P#DEV^NϚ=zg?{xooE$e" "SI>8.ʻ$@&YrPR/?췿`v"#W>A/i %I,Λi5 ER(Jc$8Hq3GYy7:fnG׳" "|/v[j躮(bf#HJGgDzvנwktGщt2}WO5Nj9vtf{r5*PI `NSwlH< .INcJp+c\֜.doo<wyލqiƜS1=5g/W~OvB~u?/xQV~Q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1 color: rgb(255, 255, 255); background-color: rgb(102, 102, 102); Qt::Horizontal 0 120 454 541 0 178 476 100 32 color: rgb(255, 255, 255); background-color: rgb(37, 200, 124); font: 11pt "Sans Serif"; 开始 0 0 454 461 129 178 195 45 font: 36pt "Sans Serif"; 00:00:00 24 404 56 36 width:56px; height:36px; background:rgba(46,46,46,1); border-radius:4px; 5分钟 111 404 56 36 width:56px; height:36px; background:rgba(46,46,46,1); border-radius:4px; 10分钟 199 404 56 36 width:56px; height:36px; background:rgba(46,46,46,1); border-radius:4px; 20分钟 287 404 56 36 width:56px; height:36px; background:rgba(46,46,46,1); border-radius:4px; 30分钟 374 404 56 36 width:56px; height:36px; background:rgba(46,46,46,1); border-radius:4px; 60分钟 129 178 195 45 font: 36pt "Sans Serif"; 00:00:00 87 405 280 36 width:280px; height:36px; background:rgba(72,72,76,1); border-radius:4px; 默认铃声 ... 178 137 20 20 border-image: url(:/icon-4-16x16.png); 210 140 70 14 width:70px; height:14px; font-size:14px; font-family:Source Han Sans CN; font-weight:400; color:rgba(255,255,255,1); opacity:0.45; 下午05:31 193 259 68 68 color: rgb(255, 255, 255); background-color: rgb(255, 255, 255); 128 42 197 45 color: rgb(255, 255, 255); font: 36pt "Sans Serif"; 00:00:00 177 476 100 32 color: rgb(255, 255, 255); background-color: rgb(37, 200, 124); font: 11pt "Sans Serif"; 添加闹钟 142 110 173 18 color: rgb(255, 255, 255); color: rgb(148, 148, 148); font: 12pt "Sans Serif"; opacity:0.45; 点击闹钟显示剩余时间 39 140 376 280 selection-background-color: rgb(162, 162, 162); border-radius:0px 0px 6px 6px; 192 385 68 68 color: rgb(255, 255, 255); background-color: rgb(255, 255, 255); 190 110 81 20 color: rgb(255, 255, 255); color: rgb(148, 148, 148); font: 12pt "Sans Serif"; 00:00:00 128 42 197 45 color: rgb(255, 255, 255); text-decoration: underline; font: 36pt "Sans Serif"; 00:00:00 292 476 100 32 width:100px; height:32px; background:rgba(44,44,46,1); border:1px solid rgba(68,68,71,1); border-radius:4px; 复位 62 476 100 32 width:100px; height:32px; background:rgba(44,44,46,1); border:1px solid rgba(68,68,71,1); border-radius:4px; 计次 39 130 376 251 selection-background-color: rgb(162, 162, 162); border-radius:0px 0px 6px 6px; 437 8 9 10 415 8 10 9 0 30 454 633 62 557 100 32 width:100px; height:32px; background:rgba(44,44,46,1); border:1px solid rgba(68,68,71,1); border-radius:4p 删除闹铃 292 557 100 32 width:100px; height:32px; background: rgb(37, 200, 124); border:1px solid rgba(68,68,71,1); border-radius:4p 保存 0 30 454 633 332 8 60 32 75 43 42 15 color: rgb(255, 255, 255); font: 10pt "Sans Serif"; 倒计时 215 43 42 15 color: rgb(255, 255, 255); font: 10pt "Sans Serif"; 闹钟 350 43 42 15 color: rgb(255, 255, 255); font: 10pt "Sans Serif"; 秒表 63 8 60 32 197 8 60 32 0 80 660 1 color: rgb(255, 255, 255); background-color: rgb(102, 102, 102); Qt::Horizontal true :/Images/Images/NO.png:/Images/Images/NO.png On stackedWidget_2 line pushButton_5 pushButton_4 stackedWidget_3 stackedWidget ukui-sidebar/src/plugins/Clock_deamon/widget.ui0000644000175000017500000000302613635342602020537 0ustar fengfeng Widget 0 0 205 231 Widget 0 70 80 26 开始 0 110 80 26 暂停 0 150 80 26 时间选择 0 190 80 26 铃声 ukui-sidebar/src/plugins/Clock_deamon/continu.png0000644000175000017500000000624213635342602021105 0ustar fengfengPNG  IHDRDD8 iIDATx\ pTfdC T4H_+--c RFbZcu|XckQرL+NhQkGchGGE"cd7'wCٽq9w[?1 `F2"9xFmC-jҮp&Ѭ3߶) ᓑ^/H A@@ao0N4|ȋVa0ҚIp1FX8 /`1F zLQO Ǎ,co bB_۾?Z?3 jXlu!L!+8MNdkl bf3'Y9҇jdl.UR B-KH{잯(+A0^SAKJJF(Ibe /U!1.PF^bgFs*F(J\CHqUJ5e8H!ͷpBAIWuMi eWj8%K)*[+9JXHEjmpQ<|}6=kJ4卨a g$[K%.@%GJa 8c^tۤsF_nФ !.ؠy4~OgrZ2Dc G؞=5[[V*Kzg_2nN)74RVUyrz\-[?iK!#ZaԵL1CvN}G}u)?2/:_VT9>9*} Bպoҿ'S<쿻mع>nt XE%)7dZGg8.GIw<%ջܕ=ɺLrΔqK>X{һrdXSǗƈ,6k}j|GfbU [΂Ʋ&-\O;I@^2meiKGͻfl^NX1~~]rriEu?xeKFPtBܢc,*UG5ם>:9&>y.ʔ%щym+{Z!\RziӤ+>;xU*}[n[u`\B[0'oL;s.f~һ$ڑ/`ez2g> ̯\6vJ [5UIU?xkK-;ƙTGrtpEkfGW_YQ{\ue>|a$jhj,m! F@juM86܈wR-xڄTE]SKmQ& AKBQ!]k=k]~/A!E4s#5F~YOX#:AQ'k$)*YyA3N)F5sE3{AO6wphpp+@> ^p0\8$7zD#3L]0FfP\p\ 7}M"4Ꜿk_v44AgD{j̴M尽i>^1k\ҋH Bz[}XaAcPڣG bzHힰ%QF^8VM(60Z,=Y',)KaRm9~te> ~]Lv><Hzv0:iC*KAWiv-jr.7k@"Yfp8=L'jPKԜ[N* 0X0(xk eB7LVJ$W$ Japq7:BẄᵴ櫸=RFS8.|W_> ".U%eV/Kw{HoeRR:6A$௖E).ka Tf`VQV+U- t.^yydp(̛4έX#Ϳ5iI;,Ǭ1ܬMpٜss/3 |k ) lΫed9(xL_7+P]pl?bx4C0[g|k"4|A i#>e8\UN@Vh?^7i.1d_Hs~IENDB`ukui-sidebar/src/plugins/Clock_deamon/images.qrc0000644000175000017500000000140013642562542020670 0ustar fengfeng background.png clock.png deleteBtn.png alarm_off.png alarm_on.png icon-4-16x16.png icon-1.png icon-2.png icon-3.png open-menu-symbolic.png window-close-symbolic.png window-minimize-symbolic.png push_1.png push_2.png start_1.png start_2.png continu.png sax.mp3 kylin-alarm-clock.svg Clock.qm ukui-sidebar/src/plugins/Clock_deamon/icon-3.png0000644000175000017500000000043613635342602020515 0ustar fengfengPNG  IHDRH-IDAT(1AEFF&h(hX#I<ܳA1*XK c3~(?J"BF5e圩%3*SjGD\)'">n=tg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Ӄ ?yW~d:/·9"=\M^.=&,vnm:$:iG"Wed᭼"(C΃浊 `R$u}-rc{ĜFH{Ὤac?A!FHLq*x+i֕{\(PL.7YpS[U@%m-e"8!B]t!{٬O15=C RqrR9 Wn%TT=ՋfbX[[[}v9ۙ]y!QGllKߩsykw{‘Rr:>7g]rlxҶ]ٶ! }u NhUtod:MN 6|նVƾ;;OO 3-Hӻ p{Hi?=OC͓m\& .sdxij<s uۿleǸZ/IIHaU-bf[u&tռP5@Dht+"uwq/ϭiE9jTPdz=X-i\ +kʍ{@`-%d{\Lu6u߯ݪYdqls*#x}vvիeݽ P<]>:, Oө%V8*"&...}U8:tMB.;`Y٧~vRt1BǿK]7uQUG'V]'[Z2'U{ӭk=żJ߳mlTP2ّB0@ qMњv\6mdT%IK߶'QzƔx\w+pԝ"B Yƕ]Ij΢9x*eZߩw(tMۊ.s +LQܕPH u(^*cz8|jM̆d^zt{nV$$ѽ_}Z#Tmt+: vLd$eunˣX LC s5јb_r>>r7!u5yUC[W(nbΌaRGjUIQ$wB$}6;[[(F$NZ.ïOƑcd}iTHݝTY (+@.>HݷT8ry-J≄)weXr<)iF5ů4۵-Mbź]ՋɴCJ:U5YcWu5I!\tgia$\Dmc 1ђr Uhoۃ'{v]oѧBEH1軈t{A*$ЪbUyQtlo\UPQ黶ﺭٮt\e~ >vq!vT5;٠mDiwrR3V$86DԂg2fÛ2Uq6ϿVbDZVB*^b M# stopwatch 0 0 454 660 stopwatch background-color: rgb(14, 19, 22); 40 60 51 26 190 60 51 26 330 60 51 26 50 90 41 18 color: rgb(255, 255, 255); 倒计时 200 90 31 18 color: rgb(255, 255, 255); 闹钟 340 90 31 21 color: rgb(255, 255, 255); 秒表 0 120 660 1 color: rgb(255, 255, 255); background-color: rgb(102, 102, 102); Qt::Horizontal 370 10 31 31 410 10 31 31 0 130 451 531 1 180 350 80 80 color: rgb(255, 255, 255); background-color: rgb(255, 255, 255); 20 360 20 91 color: rgb(255, 255, 255); font: 24pt "Sans Serif"; background-color: rgb(14, 19, 22); 200 60 81 20 color: rgb(255, 255, 255); color: rgb(148, 148, 148); font: 12pt "Sans Serif"; 00:00:00 140 0 191 51 color: rgb(255, 255, 255); text-decoration: underline; font: 9pt "Sans Serif"; font: 36pt "Sans Serif"; 00:00:00 310 470 80 26 color: rgb(255, 255, 255); 复位 60 470 80 26 color: rgb(255, 255, 255); 计次 50 130 80 26 PushButton 250 140 55 18 TextLabel ukui-sidebar/src/plugins/Clock_deamon/item_new.ui0000644000175000017500000000073513642562542021074 0ustar fengfeng item_new 0 0 376 56 Form border-radius:12px; ukui-sidebar/src/plugins/Clock_deamon/widget.h0000644000175000017500000000312113635342602020345 0ustar fengfeng#ifndef WIDGET_H #define WIDGET_H #include #include #include #include #include #include #include namespace Ui { class Widget; } class Widget : public QWidget { Q_OBJECT public: //------------------------- void timestart(); void settime_number(int h, int m, int s); //-------------------------- explicit Widget(QWidget *parent = nullptr); ~Widget(); void paintEvent(QPaintEvent *) { QPainter painter(this); painter.fillRect(this->rect(), QColor(0, 0, 0, 0x20)); /* 设置透明颜色 */ } //Qt::FramelessWindowHint会导致窗口不能被拖动。通过捕获鼠标移动事件从而实现窗口移动 void mousePressEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) { m_startPoint = frameGeometry().topLeft() - event->globalPos(); /* 捕获按下时坐标 */ } } void mouseMoveEvent(QMouseEvent *event) { this->move(event->globalPos() + m_startPoint); /* 移动窗口 */ } private slots: void Count_down();//int Hour,int minute ,int second); void on_pushButton_Start_clicked(); void on_pushButton_pause_clicked(); // void on_pushButton_timeselect_2_clicked(); void on_pushButton_ring_clicked(); private: QPoint m_startPoint; Ui::Widget *ui; QLCDNumber *numb, *numb2, *numb3; QTimer *timer; int hour=0, minute=0, second=0, pushflag=0 ; QMediaPlayer *player = new QMediaPlayer; QString ring;//铃声名字 }; #endif // WIDGET_H ukui-sidebar/src/plugins/Clock_deamon/clock.h0000644000175000017500000001307313642562542020171 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include "stopwatch_item.h" #include class QSpinBox; class QComboBox; class QDialog; class QSpinBox; class QComboBox; class QLabel; class QFont; class QPushButton; class QMediaPlaylist; class QSqlTableModel; class QTimer; namespace Ui { class Clock; } class Clock : public QWidget { Q_OBJECT public: explicit Clock(QWidget *parent = nullptr); ~Clock(); void paintEvent(QPaintEvent *) { QPainter painter(this); painter.fillRect(this->rect(), QColor(0, 0, 0, 0x20)); /* 设置透明颜色 */ } //Qt::FramelessWindowHint会导致窗口不能被拖动。通过捕获鼠标移动事件从而实现窗口移动 void mousePressEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) { m_startPoint = frameGeometry().topLeft() - event->globalPos(); /* 捕获按下时坐标 */ } } void mouseMoveEvent(QMouseEvent *event) { this->move(event->globalPos() + m_startPoint); /* 移动窗口 */ } QPointF rotateAngle(int angle, int len); protected: void paintEvent1(QPaintEvent *); private slots: void Count_down();//int Hour,int minute ,int second); void on_pushButton_Start_clicked(); void on_pushButton_ring_clicked(); void on_pushButton_timeselect_clicked(); void on_pushButton_5_clicked(); void on_pushButton_4_clicked(); void on_pushButton_clicked(); void on_pushButton_2_clicked(); void on_pushButton_3_clicked(); void timerUpdate(); void text_timerUpdate(); void setAlarmClock(); void cancelAlarmClock(); //添加闹钟dialog关闭 void sureAlarmClock(); void updateAlarmClock(); void on_off_Alarm(); //闹钟开关 void deleteAlarm(); void stopPlayMusic(); void selectMusic(); void rePlayMusic(); void aItem_new(); void listdoubleClickslot(); void listClickslot(); void on_pushButton_7_clicked(); void stat_countdown(); void setcoutdown_number(int h, int m, int s); void startbtn_countdown(); void on_min_5btn_clicked(); void on_min_10btn_clicked(); void on_min_20btn_clicked(); void on_min_30btn_clicked(); void on_min_60btn_clicked(); void get_countdown_over_time(); void on_count_push_clicked(); void stopwatch_jg(); void change_time_NUM(int alarmHour, int alarmMinute); private: QPoint m_startPoint; Ui::Clock *ui; QTimer *timer = NULL; QTimer *countdown_timer = NULL; QTimer *timer_2 = NULL; int hour, minute, second, pushflag ; int stopwatch_hour, stopwatch_minute, stopwatch_second ; int countdown_hour, countdown_minute, countdown_second, countdown_pushflag ; bool isStarted; bool countdown_isStarted; bool countdown_isStarted_2; bool stopwatch_isStarted; QMediaPlayer *player = new QMediaPlayer; QString ring;//铃声名字 QString alarmHour_str; QString alarmMinute_str; QTimer *timer_Surplus; int alarmHour; int alarmMinute; int cPauseTime; QPixmap pixmap1; QPixmap pixmap2; QPixmap pixmap3; QPixmap pixmap4; QPixmap pixmap5; QPixmap pixmap6; QPixmap pixmap7; QPixmap pixmap8; QPixmap pixmap9; QPixmap pixmap10; QPixmap pixmap11; QPixmap pixmap12; QPixmap bgPixmap; QPixmap clockPixmap; QPixmap hourPixmap; QPixmap minutePixmap; QPixmap secondPixmap; QPixmap delBtnPixmap; QPixmap on_pixmap; QPixmap off_pixmap; QLabel *cTimeLabe; QDialog *dialog; QFont alarmFont; QSpinBox *hourBox; QSpinBox *minuteBox; QComboBox *pauseTime; QMediaPlayer *player_alarm; QMediaPlaylist *mediaList; //播放列表 QSqlTableModel *model; //数据库 QString musicPath; item_new *w1[20]; QListWidgetItem *aItem[20]; stopwatch_item *stopwatch_w[100]; QListWidgetItem *stopwatch_aItem[100]; QString stopwatch_h;QString stopwatch_m;QString stopwatch_s; QString stopwatch_jg_h ="00";QString stopwatch_jg_m= "00";QString stopwatch_jg_s= "00"; int stopwatch_item_flag = 0; int clock_num = 0; int on_off_flag = 0; int add_change_flag = 0; int change_alarm_line = 0; int n = 0; int medel_flag = 0; int continu_flag = 0; }; #endif // CLOCK_H ukui-sidebar/src/plugins/Clock_deamon/set_clock.ui0000644000175000017500000000106413635342602021222 0ustar fengfeng set_clock 0 0 454 631 Form width:454px; height:631px; background:rgba(14,255,255,1); opacity:0.95; border-radius:0px 0px 6px 6px; ukui-sidebar/src/plugins/Clock_deamon/icon-4-16x16.png0000644000175000017500000000051013635342602021272 0ustar fengfengPNG  IHDRaIDAT8?JCA I@rmVICx@*e3F b! vú/co$"!vW/0Cz`ހ0up g8Kt`KHjxd?r^^[Iݒ^Ë'I5gjYR4Q]I_!PsϿs m5=a/M-[3 2l}bIo> `NfIENDB`ukui-sidebar/src/plugins/Clock_deamon/icon-2.png0000644000175000017500000000043713635342602020515 0ustar fengfengPNG  IHDRaIDAT8 @ DW@ R;  p'=  9#a^{g"Pȁ- P琯u@+#V1s0p # k6HmHbaø#l#{jDCc.c;rBÿ찷1mX6!yc"UDʞJԧ6<@؞L{}(_bUҢnIENDB`ukui-sidebar/src/plugins/Clock_deamon/push_2.png0000644000175000017500000000726413635342602020633 0ustar fengfengPNG  IHDRDD8{IDATx\]U 3w``(ŶbTZLLX-Ii>Dy0M鋉ombjҤFmZjV[6*b0 0ށs>g׾wPNs^{1Ga,Rz0ܘO0l |/|+. x[(䳏 eu^8jUC~K 4SI{=2\!3|w\ I Ey; yg6M2#/R4OДR>LB~o4 YB8KZ¼'1!990~3JAOW Մc[g%)[` YHN9v|%2"d)0PQ׈yt_-y44Mah ״@G 1mbBPqi4,Q* |d'J0C'Ob^T%z]˜3&5.uvz #%$MxhQ̍a6xHVـ9)Uj͗EaN<7{䵡e%ɚ,DPeܣT%Z. LRi)(@!WCHۆIb )+*PTDS"D'SH#/XO%MG=it$nG!ha 87.;j]DӖ.hiР ^\H'ۂ%:%2Ķ!E΍K8!Q:[KFp1BqnnEaD֭kR@3E)|*ld6*"XQNt}MIf]Y8zDÈJrm mKgeouȻn~- Vk鹴wV{Wmc+ŭ=?v὇Fv>R[sc7ݏ+"|f(;RQ#H3/[r~^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=y{{yo_ TT0(@ | tEJ/ `K+05gH81J!!8 SEz\W^M $r)+B0"Lp#,]3 ~ c؛1BuX=e<1\$3Ja|684%d"ʥX/e=@;:aq+gB.9a wH$9 [&9qK7,]RV2`^!C `Q@98dgiX08\P !Sֺ6\]:HdHmrRZ `e!,5'KOU3gzRZH٥=Kl' 7 w!EȖۍm"4B hr.lG (!&1VsEfB)cZhOCh\?E܄#ArRck$B~(N==o@GbcL8!7*)ʓHKw"}ilV Y鶾~HHדJd, ۄm'})DZ$Y ˆ k" !%f2E/juK )pW 17:9kQEJcv\qOI8I ߃ 5|ʺH!t&zlz>_c6$ڽ+J+!H(k$d*+^(\{.r2F# )yl,gL+(j~6˛*:! >q3owvkUw,!. bҾ 'Y&B՞blȄ`ٿH wBs`YwǶ'rp;bqeҪCow8qLgM*B8 CȄɇiE%N $|)riy}FM$?gHvхB%m?Ѐ7TgCêMejuKV-ɨպfEۮג^|P?~'cZQEҚ2\mH>QhU'--sӎ|D"iKoӴo6ޣ7q&pDT>kh'"2\x=nz~[{w쌊u!}$XO|eQ_TQ`ō,S[DiS}DA{; \x%NJ=5eE˼ƎeΫl+R!F"B8'WxKIy?0'P{GvC' 8N鿿ǺSڲN;ܷV]s~Ÿ y4m:&fW,NH!?9I"@M -N$q! \'3%M[r)˂8m.߻6sMhp5u9Ws Rm6Wys )HKqVםGFCys9:^`!V:b/5@2qHH<)/sHn_lЉ:Ḍ?^:NG?_{Q+V_kIENDB`ukui-sidebar/src/plugins/Clock_deamon/stopwatch_item.cpp0000644000175000017500000000541113642562542022460 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 setupUi(this); this->setFixedSize(376, 56); stopwatch1 = new QLabel(this);//计次 stopwatch1->move(24, 9); stopwatch1->setFixedSize(100, 17); stopwatch1->setStyleSheet("font: 11pt 'Sans Serif';background-color: rgb();width:45px;\ height:17px;\ font-size:18px;\ font-family:Source Han Sans CN;\ font-weight:400;\ color:rgba(255,255,255,1);"); stopwatch1->setText(tr("起床铃")); stopwatch2 = new QLabel( this);//间隔 stopwatch2->move(24, 34); stopwatch2->setFixedSize(100, 17); stopwatch2->setStyleSheet("font: 9pt 'Sans Serif';color: rgb(148, 148, 148);background-color: rgb();width:85px;\ height:14px;\ font-size:14px;\ font-family:Source Han Sans CN;\ font-weight:400;\ opacity:0.45;"); stopwatch2->setText(tr("工作日")); stopwatch2->setVisible(true); stopwatch_line = new QFrame(this);//线 stopwatch_line->move(13, 52); stopwatch_line->setFixedSize(350, 1); stopwatch_line->setStyleSheet(QString::fromUtf8("color: rgb(255, 255, 255);background-color: rgb(102, 102, 102);")); stopwatch3 = new QLabel(this);//记次时间 stopwatch3->move(239,15); stopwatch3->setFixedSize(115, 29); stopwatch3->setStyleSheet("font: 17pt 'Sans Serif';background-color: rgb();width:114px;\ height:22px;\ font-size:30px;\ font-family:Source Han Sans CN;\ font-weight:400;\ color:rgba(255,255,255,1);"); stopwatch3->setText("00:00"); stopwatch3->setVisible(true); } stopwatch_item::~stopwatch_item() { delete ui; } ukui-sidebar/src/plugins/Clock_deamon/clock.cpp0000644000175000017500000007720013642626325020526 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "debug.h" #include #include #include #include #include "connection.h" #include #include "item_new.h" #include "set_clock.h" #include "stopwatch_item.h" const double PI=3.141592; Clock::Clock(QWidget *parent) : QWidget(parent), ui(new Ui::Clock) { ui->setupUi(this); //this->setFixedSize(400, 660); createConnection(); this->setWindowTitle(tr("闹钟")); setWindowFlags(Qt::FramelessWindowHint); /* 开启窗口无边框 */ //setAttribute(Qt::WA_TranslucentBackground);/* 开启窗口透明层 */ ui->stackedWidget_2->setAttribute(Qt::WA_TranslucentBackground); pixmap1 = QPixmap(":/icon-1.png"); pixmap2 = QPixmap(":/icon-2.png"); pixmap3 = QPixmap(":/icon-3.png"); pixmap4 = QPixmap(":/icon-4-16x16.png"); pixmap5 = QPixmap(":/window-close-symbolic.png"); pixmap6 = QPixmap(":/window-minimize-symbolic.png"); pixmap7 = QPixmap(":/open-menu-symbolic.png"); pixmap8 = QPixmap(":/start_1.png"); pixmap9 = QPixmap(":/start_2.png"); pixmap10 = QPixmap(":/push_1.png"); pixmap11 = QPixmap(":/kylin-alarm-clock.svg"); this->setWindowIcon(pixmap11); bgPixmap = QPixmap(":/background.png").scaled(size()); clockPixmap = QPixmap(":/clock.png"); delBtnPixmap = QPixmap(":/deleteBtn.png"); on_pixmap = QPixmap(":/alarm_on.png"); off_pixmap = QPixmap(":/alarm_off.png"); ui->label->move(53,43); ui->label_2->move(187,43); ui->label_3->move(322,43); ui->label->setFixedSize(80,30); ui->label_2->setFixedSize(80,30); ui->label_3->setFixedSize(80,30); ui->label_3->setAlignment(Qt::AlignHCenter); ui->label_2->setAlignment(Qt::AlignHCenter); ui->label->setAlignment(Qt::AlignHCenter); ui->label_6->setStyleSheet("font: 36pt;"); ui->label_4->setStyleSheet("font: 36pt;"); ui->label_8->setStyleSheet("font: 36pt;"); ui->label_9->setStyleSheet("font: 36pt;"); ui->pushButton->setIcon(pixmap1); ui->pushButton_2->setIcon(pixmap4); ui->pushButton_3->setIcon(pixmap2); ui->pushButton_4->setIcon(pixmap6); ui->pushButton_4->setFlat(true); ui->pushButton_4->setVisible(true); ui->pushButton_4->setFocusPolicy(Qt::NoFocus); ui->pushButton_5->setIcon(pixmap5); ui->pushButton_5->setFlat(true); ui->pushButton_5->setVisible(true); ui->pushButton_5->setFocusPolicy(Qt::NoFocus); //---------------倒计时------------------------------------------------------------------------- //初始化定时器 countdown_timer = new QTimer(); //信号和槽 connect(ui->count_stat, SIGNAL(clicked()), this, SLOT(startbtn_countdown()) ); connect(countdown_timer, SIGNAL(timeout()), this, SLOT(stat_countdown())); //设置定时器每个多少毫秒发送一个timeout()信号 countdown_timer->setInterval(1000); ui->count_push->setStyleSheet("border-image: url(:/push_1.png);"); countdown_hour = 0; countdown_minute = 0; countdown_second = 9; countdown_pushflag = 0; countdown_isStarted = 0; //------------秒表----------------------------------------------------------------------------------- // ui->pushButton_Start->setIcon(pixmap8); ui->pushButton_Start->setFlat(true); ui->pushButton_Start->setVisible(true); ui->pushButton_Start->setFocusPolicy(Qt::NoFocus); ui->pushButton_Start->setStyleSheet("border-image: url(:/start_1.png);"); //初始化定时器 timer = new QTimer(); //信号和槽 connect(timer, SIGNAL(timeout()), this, SLOT(Count_down())); //设置定时器每个多少毫秒发送一个timeout()信号 timer->setInterval(10); ui->label_4->setText("00:00.00"); isStarted = 0; hour=0; minute=0; second=0; pushflag=0 ; on_pushButton_2_clicked();//初始显示闹钟界面 //时间间隔定时器 timer_2 = new QTimer(); connect(timer_2, SIGNAL(timeout()), this, SLOT(stopwatch_jg())); timer_2->setInterval(10); stopwatch_hour = 0; stopwatch_minute = 0; stopwatch_second = 0; stopwatch_isStarted = 0; //----------------------闹钟--------------------------------- QTimer *timer_clock = new QTimer(this); connect(timer_clock, SIGNAL(timeout()), this, SLOT(timerUpdate()) );//动态获取时间 QTime time = QTime::currentTime(); ui->label_6->setText(time.toString("hh")+":"+time.toString("mm")+":"+time.toString("ss")); timer_clock->start(1000); //单击时间提示计时器 timer_Surplus = new QTimer(); connect(timer_Surplus, SIGNAL(timeout()), this, SLOT(listClickslot())); timer_Surplus->setInterval(1000); connect( ui->addAlarmBtn, SIGNAL(clicked()), this, SLOT(setAlarmClock()) );//添加闹钟 player_alarm = new QMediaPlayer(this); mediaList = new QMediaPlaylist(this); model = new QSqlTableModel(this); model->setTable("clock"); model->setEditStrategy(QSqlTableModel::OnManualSubmit); model->select(); //选取整个表的所有行 connect(ui->listWidget,SIGNAL(itemDoubleClicked(QListWidgetItem*)),this,SLOT(listdoubleClickslot())); connect(ui->listWidget,SIGNAL(itemClicked(QListWidgetItem*)),this,SLOT(listClickslot())); connect(ui->pushButton_6, SIGNAL(clicked()), this, SLOT(deleteAlarm()) ); updateAlarmClock(); } Clock::~Clock() { delete ui; } QPointF Clock::rotateAngle(int angle, int len) { int x, y; x = 150+len*sin(angle*PI/180); y = 150-len*cos(angle*PI/180); return QPointF(x, y); } //绘制时钟界面 void Clock::paintEvent1(QPaintEvent *) { QTime time = QTime::currentTime(); int timeH = time.hour(); int timeM = time.minute(); int timeS = time.second(); QDateTime dateTime = QDateTime::currentDateTime(); // cTimeLabe->setText(dateTime.toString("yyyy-MM-dd hh:mm:ss ddd")); QPainter painter(ui->page_4); QPen pen; //painter.drawPixmap(this->rect(), bgPixmap); //绘制钟面 pen.setWidth(1); pen.setColor(Qt::blue); painter.setPen(pen); for(int i=0; i<60; i++) { painter.drawLine(rotateAngle(6*i, 100), rotateAngle(6*i, 95)); } pen.setWidth(5); painter.setPen(pen); painter.drawEllipse(QPoint(150, 150), 100, 100); pen.setWidth(3); painter.setPen(pen); for(int i=0; i<12; i++) { painter.drawLine(rotateAngle(30*i, 100), rotateAngle(30*i, 90)); } //绘制指针 pen.setWidth(2); pen.setColor(Qt::black);//pen.setColor(Qt::red); painter.setPen(pen); painter.drawLine(QPointF(150, 150), rotateAngle(6*timeS, 80)); pen.setWidth(6); pen.setColor(Qt::black);//pen.setColor(Qt::blue); painter.setPen(pen); painter.drawLine(QPointF(150, 150), rotateAngle(6*timeM, 60)); pen.setWidth(8); pen.setColor(Qt::black);//pen.setColor(Qt::green); painter.setPen(pen); painter.drawLine(QPointF(150, 150), rotateAngle(0.5*(timeH*60+timeM), 40)); } //时间间隔执行 void Clock::stopwatch_jg() { if(stopwatch_hour < 10){ QString hours_str = QString::number(stopwatch_hour); stopwatch_jg_h = "0"+hours_str; }else { stopwatch_jg_h = QString::number(stopwatch_hour); } if(stopwatch_minute < 10){ QString minute_str = QString::number(stopwatch_minute); stopwatch_jg_m = "0"+minute_str; }else { stopwatch_jg_m = QString::number(stopwatch_minute); } if(stopwatch_second < 10){ QString second_str = QString::number(stopwatch_second); stopwatch_jg_s = "0"+second_str; }else { stopwatch_jg_s = QString::number(stopwatch_second); } ui->label_5->setText(stopwatch_jg_h+":"+stopwatch_jg_m+"."+stopwatch_jg_s); stopwatch_second++; if(stopwatch_second==100){ stopwatch_minute++; stopwatch_second=0;} if(stopwatch_minute==60){ stopwatch_hour++; stopwatch_minute=0;} } //秒表执行 void Clock::Count_down() { if(hour < 10){ QString hours_str = QString::number(hour); stopwatch_h = "0"+hours_str; }else { stopwatch_h = QString::number(hour); } if(minute < 10){ QString minute_str = QString::number(minute); stopwatch_m = "0"+minute_str; }else { stopwatch_m = QString::number(minute); } if(second < 10){ QString second_str = QString::number(second); stopwatch_s = "0"+second_str; }else { stopwatch_s = QString::number(second); } ui->label_4->setText(stopwatch_h+":"+stopwatch_m+"."+stopwatch_s); second++; if(second==100){ minute++; second=0;} if(minute==60){ hour++; minute=0;} } void Clock::on_pushButton_Start_clicked() { if (!isStarted){ ui->pushButton_Start->setStyleSheet("border-image: url(:/push_1.png);"); if(stopwatch_isStarted == 0) { timer_2->start(); stopwatch_isStarted = 1; } timer->start(); isStarted=1; } else { timer->stop(); if(stopwatch_isStarted == 1)//查询间隔计时器是否启动 { timer_2->stop(); stopwatch_isStarted = 0; } isStarted=0; ui->pushButton_Start->setStyleSheet("border-image: url(:/continu.png);"); } return; } //计次 void Clock::on_pushButton_ring_clicked() { if(!isStarted) { return; } if(stopwatch_isStarted == 0) { timer_2->start(); stopwatch_isStarted = 1; } if(stopwatch_item_flag < 100){ stopwatch_aItem[stopwatch_item_flag] =new QListWidgetItem; stopwatch_aItem[stopwatch_item_flag]->setSizeHint(QSize(376,56)); stopwatch_aItem[stopwatch_item_flag]->setTextColor(QColor(255, 0, 0, 255)); ui->listWidget_2->addItem(stopwatch_aItem[stopwatch_item_flag]); ui->listWidget_2->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); ui->listWidget_2->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); stopwatch_w[stopwatch_item_flag] = new stopwatch_item(ui->listWidget_2); stopwatch_w[stopwatch_item_flag]->stopwatch1->setText(tr("计次")+QString::number(stopwatch_item_flag)); stopwatch_w[stopwatch_item_flag]->stopwatch2->setText(stopwatch_jg_h+":"+stopwatch_jg_m+"."+stopwatch_jg_s); stopwatch_w[stopwatch_item_flag]->stopwatch3->setText(stopwatch_h+":"+stopwatch_m+"."+stopwatch_s); ui->listWidget_2->setItemWidget(stopwatch_aItem[stopwatch_item_flag],stopwatch_w[stopwatch_item_flag]); stopwatch_hour = 0; stopwatch_minute = 0; stopwatch_second = 0; qDebug()<< stopwatch_item_flag; stopwatch_item_flag++; } } //复位 void Clock::on_pushButton_timeselect_clicked() { if(nullptr != timer){ timer->stop(); timer_2->stop(); ui->label_4->setText("00:00.00"); ui->label_5->setText("00:00.00"); isStarted = 0; stopwatch_isStarted = 0; ui->pushButton_Start->setStyleSheet("border-image: url(:/start_1.png);"); for (int i=0; i < stopwatch_item_flag; i++) { delete stopwatch_w[i]; delete stopwatch_aItem[i]; } stopwatch_item_flag = 0; hour = 0; minute = 0; second = 0; stopwatch_hour = 0; stopwatch_minute = 0; stopwatch_second = 0; } } //窗口关闭 void Clock::on_pushButton_5_clicked() { this->close(); } //窗口最小化 void Clock::on_pushButton_4_clicked() { this->showMinimized(); } //倒计时切换 void Clock::on_pushButton_clicked() { ui->stackedWidget->setCurrentIndex(0); ui->pushButton->setStyleSheet("background-color: rgb(39, 207, 129);"); ui->label->setStyleSheet("color: rgb(39, 207, 129);"); ui->pushButton_2->setStyleSheet("background-color: rgb(14, 19, 22);"); ui->label_2->setStyleSheet("color: rgb(255, 255, 255);"); ui->pushButton_3->setStyleSheet("background-color: rgb(14, 19, 22);"); ui->label_3->setStyleSheet("color: rgb(255, 255, 255);"); ui->pushButton->setFlat(0); ui->pushButton_2->setFlat(1); ui->pushButton_3->setFlat(1); } //闹钟窗口切换 void Clock::on_pushButton_2_clicked() { ui->stackedWidget->setCurrentIndex(1); ui->pushButton_2->setStyleSheet("background-color: rgb(39, 207, 129);"); ui->label_2->setStyleSheet("color: rgb(39, 207, 129);"); ui->pushButton->setStyleSheet("background-color: rgb(14, 19, 22);"); ui->label->setStyleSheet("color: rgb(255, 255, 255);"); ui->pushButton_3->setStyleSheet("background-color: rgb(14, 19, 22);"); ui->label_3->setStyleSheet("color: rgb(255, 255, 255);"); ui->pushButton->setFlat(1); ui->pushButton_2->setFlat(0); ui->pushButton_3->setFlat(1); } //秒表窗口切换 void Clock::on_pushButton_3_clicked() { ui->stackedWidget->setCurrentIndex(2); ui->pushButton_3->setStyleSheet("background-color: rgb(39, 207, 129);"); ui->label_3->setStyleSheet("color: rgb(39, 207, 129);"); ui->pushButton_2->setStyleSheet("background-color: rgb(14, 19, 22);"); ui->label_2->setStyleSheet("color: rgb(255, 255, 255);"); ui->pushButton->setStyleSheet("background-color: rgb(14, 19, 22);"); ui->label->setStyleSheet("color: rgb(255, 255, 255);"); ui->pushButton->setFlat(1); ui->pushButton_2->setFlat(1); ui->pushButton_3->setFlat(0); } //------------------------------------------------------------闹钟---------------------------------- //闹钟上方电子表 void Clock::text_timerUpdate() { QTime time = QTime::currentTime(); ui->label_6->setText(time.toString("hh")+":"+time.toString("mm")+":"+time.toString("ss")); } //动态监控闹钟与本地时间 void Clock::timerUpdate() { //qDebug() << "timerupdate" << n++; QTime time = QTime::currentTime(); int timeH = time.hour(); int timeM = time.minute(); int timeS = time.second(); ui->label_6->setText(time.toString("hh")+":"+time.toString("mm")+":"+time.toString("ss")); int rowNum = model->rowCount(); for(int i=0; iindex(i, 3).data().toInt() == 1){ continue; } if(timeH == model->index(i, 0).data().toInt() && timeM == model->index(i, 1).data().toInt() && timeS == 0) { QMediaPlayer *music = new QMediaPlayer(this);//初始化音乐 QMediaPlaylist *playlist = new QMediaPlaylist(this);//初始化播放列表 playlist->addMedia(QUrl::fromLocalFile("/usr/share/sounds/gnome/default/alerts/glass.ogg")); playlist->setPlaybackMode(QMediaPlaylist::Loop);//设置播放模式(顺序播放,单曲循环,随机播放等) music->setPlaylist(playlist); //设置播放列表 music->play(); QMessageBox::warning(this, tr("提示"), tr("时间到!"), QMessageBox::Yes); music->stop(); } } update(); } //闹钟设置窗口 void Clock::setAlarmClock() { dialog = new QDialog(this); hourBox = new QSpinBox(dialog); minuteBox = new QSpinBox(dialog); QLabel *label1 = new QLabel(dialog); dialog->setStyleSheet("background-color: rgb(122,122,122);"); hourBox->setStyleSheet("background-color: rgb(250, 250, 250); color: rgb(0, 0, 0);"); minuteBox->setStyleSheet("background-color: rgb(250, 250, 250);color: rgb(0, 0, 0);"); label1->setText(tr("闹铃时间:")); label1->setFont(alarmFont); label1->move(20, 30); //设置时间框 hourBox->setPrefix("H: "); hourBox->setRange(0, 23); hourBox->setFixedSize(120, 40); hourBox->move(QPoint(20, 80)); hourBox->setFont(alarmFont); minuteBox->setPrefix("M: "); minuteBox->setRange(0, 59); minuteBox->setFixedSize(120, 40); minuteBox->move(QPoint(150, 80)); minuteBox->setFont(alarmFont); QPushButton *sureBtn = new QPushButton(tr("确定"), dialog); QPushButton *cancelBtn = new QPushButton(tr("取消"), dialog); sureBtn->move(50, 180); sureBtn->resize(80, 30); sureBtn->setFont(alarmFont); cancelBtn->move(170, 180); cancelBtn->resize(80, 30); cancelBtn->setFont(alarmFont); connect( sureBtn, SIGNAL(clicked()), this, SLOT(sureAlarmClock()) ); connect( cancelBtn, SIGNAL(clicked()), this, SLOT(cancelAlarmClock()) ); dialog->setWindowTitle(tr("添加闹钟")); // dialog->setWindowFlags(Qt::FramelessWindowHint); //设置固定窗口大小 dialog->setFixedSize(300, 240); //模态对话框 dialog->exec(); } //修改时间单数 为两位数 void Clock::change_time_NUM(int alarmHour, int alarmMinute) { if(alarmHour < 10){ QString hours_str = QString::number(alarmHour); alarmHour_str = "0"+hours_str; }else { alarmHour_str = QString::number(alarmHour); } if(alarmMinute < 10){ QString minute_str = QString::number(alarmMinute); alarmMinute_str = "0"+minute_str; }else { alarmMinute_str = QString::number(alarmMinute); } } //重绘窗口,更新闹钟 void Clock::updateAlarmClock() { int rowNum = model->rowCount(); for(int alarmNum=0; alarmNumsetSizeHint(QSize(376,56)); aItem[alarmNum]->setTextColor(QColor(255, 0, 0, 255)); ui->listWidget->addItem(aItem[alarmNum]); ui->listWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); ui->listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); w1[alarmNum] = new item_new(ui->listWidget); ui->listWidget->setItemWidget(aItem[alarmNum],w1[alarmNum]); change_time_NUM(model->index(alarmNum, 0).data().toInt(),model->index(alarmNum, 1).data().toInt());//转换int为QString w1[alarmNum]->alarmLabel0->setText(alarmHour_str+" : "+alarmMinute_str); //闹钟开关 if(model->index(alarmNum, 3).data().toInt() == 1){ w1[alarmNum]->alarm_on_off0->setStyleSheet("border-image: url(:/alarm_off.png);background-color: rgb();"); }else { w1[alarmNum]->alarm_on_off0->setStyleSheet("border-image: url(:/alarm_on.png);background-color: rgb();"); } connect( w1[alarmNum]->alarm_on_off0, SIGNAL(clicked()), this, SLOT(on_off_Alarm()) ); } } //增加或重新编辑闹钟 void Clock::sureAlarmClock() { int rowNum; alarmHour = hourBox->value(); alarmMinute = minuteBox->value(); /* if(add_change_flag == 1)// 如果add_change_flag == 1,编辑闹钟号 { add_change_flag = 0;//进入编辑分支后,重置flag rowNum = change_alarm_line; qDebug() << rowNum << "闹钟数"; model->setData(model->index(rowNum, 0), alarmHour); model->setData(model->index(rowNum, 1), alarmMinute); model->setData(model->index(rowNum, 2), musicPath); // alarmLabel model->submitAll(); model->setTable("clock"); model->select(); int m = model->rowCount(); for(int i=0; iindex(rowNum, 0).data().toString() << model->index(rowNum, 1).data().toString() << QFileInfo( model->index(rowNum, 2).data().toString() ).fileName(); updateAlarmClock(); dialog->close(); } else {*/ rowNum = model->rowCount(); if(rowNum < 20) { model->insertRow(rowNum); model->setData(model->index(rowNum, 0), alarmHour); model->setData(model->index(rowNum, 1), alarmMinute); model->setData(model->index(rowNum, 2), musicPath); model->setData(model->index(rowNum, 3), int(0)); model->setData(model->index(rowNum, 4), int(medel_flag++)); model->submitAll(); for(int i=0; iindex(rowNum, 0).data().toString() << model->index(rowNum, 1).data().toString() << QFileInfo( model->index(rowNum, 2).data().toString() ).fileName(); updateAlarmClock(); } else { QMessageBox::warning(this, tr("警告"), tr("闹钟数量已达上限!"), QMessageBox::Yes); } dialog->close(); // } } void Clock::cancelAlarmClock() { dialog->close(); } void Clock::stopPlayMusic() { player->stop(); } void Clock::selectMusic() { musicPath = QFileDialog::getOpenFileName(this, tr("选择铃声"), "G:/歌曲", "*.mp3"); } void Clock::rePlayMusic() { player->play(); } //增加item void Clock::aItem_new() { int rowNum = model->rowCount(); //qDebug() <setSizeHint(QSize(376,56)); aItem[rowNum]->setTextColor(QColor(255, 0, 0, 255)); ui->listWidget->addItem(aItem[rowNum]); ui->listWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); ui->listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); w1[rowNum] = new item_new(ui->listWidget); ui->listWidget->setItemWidget(aItem[rowNum],w1[rowNum]); } void Clock::listdoubleClickslot() { ui->stackedWidget_2->raise(); } //单击闹钟显示铃声剩余时间 void Clock::listClickslot() { timer_Surplus->start(); int x_h, x_m ; int num=ui->listWidget->currentRow(); // qDebug() <index(num, 0).data().toInt(); int minute_time= model->index(num, 1).data().toInt(); if(hour_time > timeH){ x_h = hour_time - timeH; }else{ x_h = hour_time + 24 - timeH; } if(minute_time > timeM){ x_m = minute_time - timeM; }else { x_m = minute_time + 60 - timeM; x_h --; } if(x_m == 60) { x_m = 0; x_h++; } if(x_h ==24) { x_h = 0; } if(num < 0){ ui->label_7->setText(QApplication::translate("Clock", "\347\202\271\345\207\273\351\227\271\351\222\237\346\230\276\347\244\272\345\211\251\344\275\231\346\227\266\351\227\264", nullptr)); }else{ ui->label_7->setText(QString::number(x_h)+tr("小时")+QString::number(x_m)+tr("分钟后铃响")); } } void Clock::deleteAlarm() { int num=ui->listWidget->currentRow(); int rowNum = model->rowCount(); //QObject::sender()返回发送信号的对象的指针 model->removeRows(num, 1); qDebug() << "delete " <revertAll(); //如果不删除, 则撤销 qDebug() << rowNum; } else { for(int i=0; isubmitAll(); //否则提交, 在数据库中删除该行 updateAlarmClock(); rowNum = model->rowCount(); qDebug() << rowNum; on_pushButton_7_clicked(); } } //闹钟开关 void Clock::on_off_Alarm() { int i=0 ; QPushButton *btn = qobject_cast(QObject::sender()); while (btn != w1[i]->alarm_on_off0) { i++; } if(model->index(i, 3).data().toInt() == 0){ btn->setStyleSheet("border-image: url(:/alarm_off.png);background-color: rgb();"); qDebug() << "off"; model->setData(model->index(i, 3), int(1)); model->submitAll(); } else { btn->setStyleSheet("border-image: url(:/alarm_off.png);background-color: rgb();"); qDebug() << "on"; model->setData(model->index(i, 3), int(0)); model->submitAll(); } int rowNum = model->rowCount(); for(int i=0; istackedWidget_3->raise(); this->raise(); ui->stackedWidget->raise();//将页面放置最前方 } //------------------------------------------------------倒计时---------------------------- //倒计时执行 void Clock::stat_countdown(){ QString h; QString m; QString s; if(countdown_hour < 10){ QString hours_str = QString::number(countdown_hour); h = "0"+hours_str; }else { h = QString::number(countdown_hour); } if(countdown_minute < 10){ QString minute_str = QString::number(countdown_minute); m = "0"+minute_str; }else { m = QString::number(countdown_minute); } if(countdown_second < 10){ QString second_str = QString::number(countdown_second); s = "0"+second_str; }else { s = QString::number(countdown_second); } ui->label_9->setText(h+":"+m+":"+s); if(countdown_hour==0 && countdown_minute==0 && countdown_second==0){ QMediaPlayer *music = new QMediaPlayer(this);//初始化音乐 QMediaPlaylist *playlist = new QMediaPlaylist(this);//初始化播放列表 playlist->addMedia(QUrl::fromLocalFile("/usr/share/sounds/gnome/default/alerts/glass.ogg")); playlist->setPlaybackMode(QMediaPlaylist::Loop);//设置播放模式(顺序播放,单曲循环,随机播放等) music->setPlaylist(playlist); //设置播放列表 music->play(); QMessageBox::warning(this, tr("时间到"), tr("该休息了")); music->stop(); countdown_timer->stop(); startbtn_countdown(); } countdown_second--; if(countdown_second==-1){ countdown_minute--; countdown_second=59; } if(countdown_minute==-1){ countdown_hour--; countdown_minute=59; } } //倒计时开始-结束 void Clock::startbtn_countdown(){ if (!countdown_isStarted){ if(countdown_hour<0){ countdown_hour = 0 ; countdown_second = 0; countdown_second = 10; } ui->count_stat->setStyleSheet("width:100px;\ height:32px;\ background:rgba(44,44,46,1);\ border:1px solid rgba(68,68,71,1);\ border-radius:4px;"); countdown_timer->start(); countdown_isStarted=1; ui->count_stat->setText(tr("结束")); ui->stackedWidget_4->setCurrentIndex(1); } else { ui->count_stat->setStyleSheet("width:100px;\ height:32px;\ color: rgb(255, 255, 255);\ background-color:rgb(37, 200, 124);\ font: 11pt 'Sans Serif';"); countdown_timer->stop(); countdown_isStarted = 0; countdown_isStarted_2 = 0; ui->count_stat->setText(tr("开始")); ui->label_9->setText("00:00:00"); ui->label_8->setText("00:00:00"); ui->stackedWidget_4->setCurrentIndex(0); countdown_hour = 0 ; countdown_second = 0; countdown_second = 0; ui->count_push->setStyleSheet("border-image: url(:/push_1.png);"); } return; } void Clock::setcoutdown_number(int h1, int m1, int s1){ countdown_hour=h1; countdown_minute=m1 ; countdown_second=s1; QString h; QString m; QString s; if(countdown_hour < 10){ QString hours_str = QString::number(countdown_hour); h = "0"+hours_str; }else { h = QString::number(countdown_hour); } if(countdown_minute < 10){ QString minute_str = QString::number(countdown_minute); m = "0"+minute_str; }else { m = QString::number(countdown_minute); } if(countdown_second < 10){ QString second_str = QString::number(countdown_second); s = "0"+second_str; }else { s = QString::number(countdown_second); } ui->label_9->setText(h+":"+m+":"+s); ui->label_8->setText(h+":"+m+":"+s); get_countdown_over_time(); } //倒计时5分钟 void Clock::on_min_5btn_clicked() { setcoutdown_number(0, 5, 0); } //倒计时10分钟 void Clock::on_min_10btn_clicked() { setcoutdown_number(0, 10, 0); } //倒计时20分钟 void Clock::on_min_20btn_clicked() { setcoutdown_number(0, 20, 0); } //倒计时30分钟 void Clock::on_min_30btn_clicked() { setcoutdown_number(0, 30, 0); } //倒计时60分钟 void Clock::on_min_60btn_clicked() { setcoutdown_number(0,60, 0); } //获取倒计时结束时间 void Clock::get_countdown_over_time() { int x_h, x_m ; QTime time = QTime::currentTime(); int timeH = time.hour(); int timeM = time.minute(); x_h = countdown_hour + timeH; x_m = countdown_minute + timeM; if(x_m >= 60){ x_m = x_m - 60; x_h ++; } if(x_h >= 24){ x_h = x_h - 24; ui->label_11->setText(tr("明日")+QString::number(x_h)+":"+QString::number(x_m)); }else if(x_h >= 12){ x_h = x_h - 12; ui->label_11->setText(tr("下午")+QString::number(x_h)+":"+QString::number(x_m)); }else { ui->label_11->setText(tr("上午")+QString::number(x_h)+":"+QString::number(x_m)); } } //倒计时-暂停开始 void Clock::on_count_push_clicked() { if (countdown_isStarted_2){ ui->count_push->setStyleSheet("border-image: url(:/push_1.png);"); countdown_timer->start(); countdown_isStarted_2=0; } else { ui->count_push->setStyleSheet("border-image: url(:/continu.png);"); countdown_timer->stop(); countdown_isStarted_2=1; } return; } ukui-sidebar/src/plugins/Clock_deamon/clock.rc0000644000175000017500000000006113635342602020332 0ustar fengfengIDI_ICON1 ICON DISCARDABLE "clock.ico"ukui-sidebar/src/plugins/Clock_deamon/clock_plugin.h0000644000175000017500000000447513642562542021555 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include "sidebarSmallPluginInterface.h" class clock_plugin : public QObject, public SidebarSmallPluginInterface { Q_OBJECT //Q_INTERFACES宏用于告诉Qt该类实现的接口 //Q_PLUGIN_METADATA宏用于描述插件元数据 Q_PLUGIN_METADATA(IID SidebarSmallPluginInterface_iid FILE "Clock.json") Q_INTERFACES(SidebarSmallPluginInterface) public: bool Clockflag = false; clock_plugin(); ~clock_plugin(); //plugin implement 统一接口 const QString name() override {return QObject::tr("闹钟");} PluginType pluginType() override {return PluginType::SmallPlugin;} const QString description() override {return QObject::tr("闹钟插件");} const QIcon icon() override {return QIcon::fromTheme("alarm-clock", QIcon::fromTheme("alarm-clock"));} void setEnable(bool enable) override {Q_UNUSED(enable)} bool isEnable() override {return true;} virtual int PluginButtonLocation_X() override {return 0;} virtual int PluginButtonLocation_Y() override {return 2;} virtual QString PluginButtonName() override {return QObject::tr("闹钟");} virtual int pluginsLoadingSequence() override {return 1;} virtual QString PluginIconName() override {return QObject::tr("闹钟");} virtual int PluginIconSize_W() override {return 48;} virtual int PluginIconSize_H() override {return 48;} virtual void PluginsShowInterface() override; QWidget *m_pClock; QWidget* centerWidget(); void onNotification() ; signals: void Clock_ification(); }; #endif // CLOCK_PLUGIN_H ukui-sidebar/src/plugins/Clock_deamon/clock.ico0000644000175000017500000024516613635342602020521 0ustar fengfeng (&@@ (BN( 2VettteV22VettteV2cccc MM MM ****6ll66ll6WWWWhihixzxz|} $3?JU`cfox||xofc`UJ?3$ |}'Gf}}fG' 5J]qq]J4 ?ih<5QnhN5ii  $nTB00BTn$ EoZD7*! !*7DZoE  x~T*'Q{x 9n{]?* )>]{n9fG  Gf$HcA$$AcH$Eb bE#tV1  1Vt##Ef33fE#Jl33lJqK&&Kq"Dd&&dB!AN''N~? bn''na  l66l $H66H$?~TT~?[]//][w w)[  [)'Nl66lN'?}99}?VuuVgZYgx{><xxM'&K66*TxxT*9rccr9CTTCMDDMWn72VetzzteV27nW`T*cc*T`i? MM ?hq****ov6ll6sz WW w} hi zxz}|z}z}| i zx W wul6sq***oiA!M !Ah`W,b,W`Wo8yrcT18oWMDDMCUUC9reer9*TyyT*66M''Mx{>>{xgZ|}ZhVuxzuW@~9gi9@)Ql6VW6lQ),[ 5il6 [,z '* z'  ^]/ LM /]^  ''N?0ATbbTA0?N'G{i5%J81TcrrrcT18J%5i{GfQ o88o Qfl  do''od  l 0 DN''ND 0ZN(%Je''eJ%(NZ-D xN''Nx DBhOo88oOgQ&Ko88oK&_b1&xV1  1Vx&1`iSKb bKSr{#'NdB$$BdN'!zwE#kH  Hk!B{Q =u}^?+ +?^}u= P|~ ~~V--V~~ ~}e3Hq[E9,#"*8E[qH2cyZ$qWE33DTo$YuB! MM ?kB$$?~`{5 H}~I 5zRi5 tu5iDcn) =ll=)nc2?Q) NP )Q? m3'JxyK(3m lf3'NN'3flKzA!'OuuO'!AzK*TA GG AT**Z3 $BccB$ 3Z*be KK eb:r~Q# &B]ww]B& #Q~r:!E#)N}}N)#E! S{S1'?VgxxgV?'1S{S ?b6SooS6b?  ^gD' *8BMXcefr~~rfecXMB8* 'Dg^  ?N N?  SmQ5 5QmS ri00ir9cq99qc9)QxB!!BxT*)KluW<!!<WulK*-V~T$$T~V-?????????????????????????????????>>>88>>??>>??????????????(@ @****'ff'?<ii$T00T$~*'{ EffEKKNN~ll~~NllN{x66rrTT*******WWrr66{{QllQ'*N00Noo0NN0 NN KooKE B~--~$W33T$$$~ii?Q Q?fNNfT T!ENNE!?6oo6???00QBBT-~$$~- 0????99?pp?x<<ukui-sidebar/src/plugins/Clock_deamon/set_clock.cpp0000644000175000017500000000032013635342602021361 0ustar fengfeng#include "set_clock.h" #include "ui_set_clock.h" set_clock::set_clock(QWidget *parent) : QWidget(parent), ui(new Ui::set_clock) { ui->setupUi(this); } set_clock::~set_clock() { delete ui; } ukui-sidebar/src/plugins/Clock_deamon/Clock.json0000644000175000017500000000002513635342602020637 0ustar fengfeng{ "Keys" : [ ] } ukui-sidebar/src/plugins/Clock_deamon/Clock.ts0000644000175000017500000002452413642562542020333 0ustar fengfeng Clock Clock 开始 start start 00:00:00 5分钟 5min 5min 10分钟 10min 10min 20分钟 20min 20min 30分钟 30min 30min 60分钟 60min 60min 默认铃声 ring ring ... 下午05:31 PM PM 添加闹钟 add alarm add alarm 点击闹钟显示剩余时间 Time reminder Time reminder 复位 reset reset 计次 times count times count 删除闹铃 del del 保存 Preservation Preservation 倒计时 count down count down 闹钟 alarm clock alarm clock 秒表 stopwatch stopwatch On 提示 Tips Tips 时间到! time out time out 闹铃时间: alarm time alarm time 确定 sure sure 取消 cel cel 警告 warning warning 闹钟数量已达上限! 选择铃声 小时 hour hour 分钟后铃响 min bell rings min bell rings 删除当前闹钟! del! del! 您确定删除当前闹钟吗? are you sure? are you sure? 时间到 time out time out 该休息了 It's time to rest. It's time to rest. 结束 over over 明日 T T 下午 PM PM 上午 AM AM QObject 闹钟 Clock Alarm Clock Alarm 闹钟插件 Clock Alarm Clock Alarm item_new Form 闹钟 alarm alarm 工作日 work work stopwatch_item Form 起床铃 ring ring 工作日 work work ukui-sidebar/src/plugins/Clock_deamon/start_1.png0000644000175000017500000000566313635342602021011 0ustar fengfengPNG  IHDRDD8 zIDATx\}UGo.[hjۍC+EQFkFS@KЦŶQKҚ (RJh[B. {o9Ξ33o$7޹goΜ;w{?904PgLp)GpkGʮp| %<2E3dM@zV/ GY EjS4}#ߚ6J bґyX{Xh8S68s;꺎]32\] V`*x%/46$* 6XºRq2>X-L~iЮ" g{B|Ṇʸ$m֊R@_HrUrcl][B!4q@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՚ ٠㘥5=ݩ=ۛ94S ?iڛϙܳ%?AYsR/Л[/>gHMZ2+C"Ƙ,X$|^)t46 оm篤\MD#yĚ~)㱤GBfx\p6i~qP4[,  ImEӅFXZ9#f9mnW CQTMlrm m$WJ,$|L[APAۧc? a#r`D䡤rKQY 1o4r,w$[p<>~b|} ī1i<fa2-H :Fu[v"0d@f22K%"͚ BHNR =`q A?aW䍐gB@SYA{zI)b8MzbVg &ɫb`NdY|[ēQ|Ys;?y½[О VF3E Fck[KrM·BoECf1gDJ!{(;6]|R*aVm~D7:SUܻmw$,A-Hm[^&V9׏bz'6:U`oq +O&cj%UlȨkTT HD.}-M29/).!t*~W|aeYibqmN9#UP1)oiiW=5FT@gl̟7 Q>#4ͶoC >͉ŘZ1:#Ɲֲ`X|ye,UE0e'wQ ASi/w=bc22([\ ,17ш\6I|׵ ╭*ɣe%2ly#ij k~n̵=5`>%7?;L&#Lmw51#|M5W JT:x㪊qMY_儧D@ďYL[B;@FͨQ3%i"n-4<3%e;w' 0w6YC&S\)9_l<&YtUd;/"(վEbl=So9gm_6w8ϽnmK_fM%Gg5Is8{j9hU #+Ky^Ci -?s;-oFǹǺl;ZD# G,ePIENDB`ukui-sidebar/src/plugins/Clock_deamon/item_new.h0000644000175000017500000000240713642562542020704 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include namespace Ui { class item_new; } class item_new : public QWidget { Q_OBJECT public: explicit item_new(QWidget *parent = nullptr); ~item_new(); //private: Ui::item_new *ui; QPushButton *deleteAlarmBtn0; QLabel *alarmLabel0; QLabel *alarmLabel_w0; QLabel *alarmLabel_s0; QPushButton *alarm_on_off0; QPushButton *alarm_changed0; QPushButton *alarm_edit0; QFrame *alarm_line0; }; #endif // ITEM_NEW_H ukui-sidebar/src/plugins/Clock_deamon/debug.h0000644000175000017500000000367213642561377020175 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include static void outputMessage(QtMsgType type, const QMessageLogContext &context, const QString &msg) { static QMutex mutex; mutex.lock(); QString text; switch(type) { case QtDebugMsg: text = QString("Debug:"); break; case QtWarningMsg: text = QString("Warning:"); break; case QtCriticalMsg: text = QString("Critical:"); break; case QtFatalMsg: text = QString("Fatal:"); } QString contextInfo = QString("File:(%1) Line:(%2)").arg(QString(context.file)).arg(context.line); QString cDataTime = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss ddd"); QString cDate = QString("(%1)").arg(cDataTime); QString message = QString("%1 %2 %3 %4").arg(text).arg(contextInfo).arg(msg).arg(cDate); QFile file("log.txt"); file.open(QIODevice::WriteOnly | QIODevice::Append); QTextStream textStream(&file); textStream << message << "\r\n"; file.flush(); file.close(); mutex.unlock(); } #endif // DEBUG_H ukui-sidebar/src/plugins/Clock_deamon/countdown.cpp0000644000175000017500000000602213635342602021440 0ustar fengfeng#include "countdown.h" #include "ui_countdown.h" #include #include #include #include #include countdown::countdown(QWidget *parent) : QWidget(parent), ui(new Ui::countdown) { ui->setupUi(this); // setWindowFlags(Qt::FramelessWindowHint); /* 开启窗口无边框 */ // setAttribute(Qt::WA_TranslucentBackground);/* 开启窗口透明层 */ numb=new QLCDNumber(this); numb2=new QLCDNumber(this); numb3=new QLCDNumber(this); numb->setAutoFillBackground(true);//设置lcd背景 numb2->setAutoFillBackground(true); numb3->setAutoFillBackground(true); // QPalette pal=numb->palette(); // pal.setBrush(numb->backgroundRole(),QBrush(QColor(0,0,0)));//lcd背景颜色 //numb->setPalette(pal); numb->resize(10,5); numb->setGeometry(12,10,60,30); numb2->setGeometry(72,10,60,30); numb3->setGeometry(132,10,60,30); numb->setSegmentStyle(QLCDNumber::Outline); numb->setDecMode(); numb->setSmallDecimalPoint(1); } void countdown::settime_number(int h, int m, int s){ hour=h; minute=m ; second=s; } void countdown::timestart(){ //定时器--------------------------------- //新建一个QTimer对象 timer = new QTimer(); //设置定时器每个多少毫秒发送一个timeout()信号 timer->setInterval(1000); //启动定时器 timer->start(); QVBoxLayout *layout = new QVBoxLayout(); layout->addWidget(numb); layout->addWidget(numb2); layout->addWidget(numb3); //信号和槽 connect(timer, SIGNAL(timeout()), this, SLOT(Count_down())); return ; } countdown::~countdown() { delete ui; } //倒计时执行 void countdown::Count_down() { /* //获取系统当前时间 QTime time = QTime::currentTime(); //设置晶体管控件QLCDNumber上显示的内容 numb->display(time.toString("hh")); numb2->display(time.toString("mm")); numb3->display(time.toString("ss")); */ numb->display(hour); numb2->display(minute); numb3->display(second); if(hour==0 && minute==0 && second==0){ player->play(); QMessageBox::warning(this, "Warning", "该休息了"); player->stop(); timer->stop(); // exit(0); } second--; if(second==-1){ minute--; second=59;} if(minute==-1){ hour--; minute=59;} } void countdown::on_pushButton_Start_clicked() { settime_number(0,0,6); timestart(); } void countdown::on_pushButton_pause_clicked() { if(nullptr != timer && pushflag ==0){ timer->stop(); pushflag = 1; ui->pushButton_pause->setText("继续"); }else{ timer->start(); pushflag = 0; ui->pushButton_pause->setText("暂停"); } } void countdown::on_pushButton_ring_clicked() { player->setVolume(60); player->setMedia(QUrl::fromLocalFile("/home/hyd/桌面/sax.mp3")); } //void countdown::on_pushButton_timeselect_2_clicked() //{ // //settime_number(hour, minute , second); //} ukui-sidebar/src/plugins/Clock_deamon/countdown.h0000644000175000017500000000314613635342602021111 0ustar fengfeng#ifndef COUNTDOWN_H #define COUNTDOWN_H #include #include #include #include #include #include #include namespace Ui { class countdown; } class countdown : public QWidget { Q_OBJECT public: //------------------------- void timestart(); void settime_number(int h, int m, int s); //-------------------------- explicit countdown(QWidget *parent = nullptr); ~countdown(); void paintEvent(QPaintEvent *) { QPainter painter(this); painter.fillRect(this->rect(), QColor(0, 0, 0, 0x20)); /* 设置透明颜色 */ } //Qt::FramelessWindowHint会导致窗口不能被拖动。通过捕获鼠标移动事件从而实现窗口移动 void mousePressEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) { m_startPoint = frameGeometry().topLeft() - event->globalPos(); /* 捕获按下时坐标 */ } } void mouseMoveEvent(QMouseEvent *event) { this->move(event->globalPos() + m_startPoint); /* 移动窗口 */ } private slots: void Count_down();//int Hour,int minute ,int second); void on_pushButton_Start_clicked(); void on_pushButton_pause_clicked(); // void on_pushButton_timeselect_2_clicked(); void on_pushButton_ring_clicked(); private: QPoint m_startPoint; Ui::countdown *ui; QLCDNumber *numb, *numb2, *numb3; QTimer *timer; int hour=0, minute=0, second=0, pushflag=0 ; QMediaPlayer *player = new QMediaPlayer; QString ring;//铃声名字 }; #endif // COUNTDOWN_H ukui-sidebar/src/plugins/Clock_deamon/stopwatch.cpp0000644000175000017500000001242313635342602021436 0ustar fengfeng#include "stopwatch.h" #include "ui_stopwatch.h" #include #include #include #include #include "countdown.h" #include stopwatch::stopwatch(QWidget *parent) : QWidget(parent), ui(new Ui::stopwatch) { ui->setupUi(this); setWindowFlags(Qt::FramelessWindowHint); /* 开启窗口无边框 */ // setAttribute(Qt::WA_TranslucentBackground);/* 开启窗口透明层 */ pixmap1 = QPixmap(":/icon-1.png"); pixmap2 = QPixmap(":/icon-2.png"); pixmap3 = QPixmap(":/icon-3.png"); pixmap4 = QPixmap(":/icon-4-16x16.png"); pixmap5 = QPixmap(":/window-close-symbolic.png"); pixmap6 = QPixmap(":/window-minimize-symbolic.png"); pixmap7 = QPixmap(":/open-menu-symbolic.png"); pixmap8 = QPixmap(":/start_1.png"); pixmap9 = QPixmap(":/start_2.png"); pixmap10 = QPixmap(":/push_1.png"); pixmap11 = QPixmap(":/push_2.png"); ui->pushButton->setIcon(pixmap1); ui->pushButton_2->setIcon(pixmap4); ui->pushButton_3->setIcon(pixmap2); ui->pushButton_4->setIcon(pixmap6); ui->pushButton_4->setFlat(true); ui->pushButton_4->setVisible(true); ui->pushButton_4->setFocusPolicy(Qt::NoFocus); ui->pushButton_5->setIcon(pixmap5); ui->pushButton_5->setFlat(true); ui->pushButton_5->setVisible(true); ui->pushButton_5->setFocusPolicy(Qt::NoFocus); // ui->pushButton_Start->setIcon(pixmap8); ui->pushButton_Start->setFlat(true); ui->pushButton_Start->setVisible(true); ui->pushButton_Start->setFocusPolicy(Qt::NoFocus); ui->pushButton_Start->setStyleSheet("border-image: url(:/start_1.png);"); //初始化定时器 timer = new QTimer(); //信号和槽 connect(timer, SIGNAL(timeout()), this, SLOT(Count_down())); //设置定时器每个多少毫秒发送一个timeout()信号 timer->setInterval(10); ui->label_4->setText("00:00:00"); isStarted = 0; hour=0; minute=0; second=0; pushflag=0 ; } stopwatch::~stopwatch() { delete ui; } //倒计时执行 void stopwatch::Count_down() { QString h;QString m;QString s; if(hour < 10){ QString hours_str = QString::number(hour); h = "0"+hours_str; }else { h = QString::number(hour); } if(minute < 10){ QString minute_str = QString::number(minute); m = "0"+minute_str; }else { m = QString::number(minute); } if(second < 10){ QString second_str = QString::number(second); s = "0"+second_str; }else { s = QString::number(second); } ui->label_4->setText(h+":"+m+":"+s); second++; if(second==100){ minute++; second=0;} if(minute==60){ hour++; minute=0;} } void stopwatch::on_pushButton_Start_clicked() { if (!isStarted){ ui->pushButton_Start->setStyleSheet("border-image: url(:/push_1.png);"); timer->start(); isStarted=1; } else { timer->stop(); isStarted=0; ui->pushButton_Start->setStyleSheet("border-image: url(:/start_1.png);"); } return; } //计次 void stopwatch::on_pushButton_ring_clicked() { if (isStarted){ ui->textEdit->append((QString::number(hour,10)+":"+QString::number(minute,10)+":"+QString::number(second,10))); } } //复位 void stopwatch::on_pushButton_timeselect_clicked() { if(nullptr != timer){ timer->stop(); ui->label_4->setText("00:00:00"); isStarted=0; ui->textEdit->setText(""); ui->pushButton_Start->setStyleSheet("border-image: url(:/start_1.png);"); } } //窗口最大话 void stopwatch::on_pushButton_5_clicked() { this->close(); } //窗口最小化 void stopwatch::on_pushButton_4_clicked() { this->showMinimized(); } //倒计时切换 background-color: rgb(14, 19, 22); void stopwatch::on_pushButton_clicked() { ui->stackedWidget->setCurrentIndex(0); ui->pushButton->setStyleSheet("background-color: rgb(0, 107, 0);"); ui->label->setStyleSheet("color: rgb(0, 107, 0);"); ui->pushButton_2->setStyleSheet("background-color: rgb(14, 19, 22);"); ui->label_2->setStyleSheet("color: rgb(255, 255, 255);"); ui->pushButton_3->setStyleSheet("background-color: rgb(14, 19, 22);"); ui->label_3->setStyleSheet("color: rgb(255, 255, 255);"); //countdown= new countdown; } //闹钟窗口切换 void stopwatch::on_pushButton_2_clicked() { ui->stackedWidget->setCurrentIndex(1); ui->pushButton_2->setStyleSheet("background-color: rgb(0, 107, 0);"); ui->label_2->setStyleSheet("color: rgb(0, 107, 0);"); ui->pushButton->setStyleSheet("background-color: rgb(14, 19, 22);"); ui->label->setStyleSheet("color: rgb(255, 255, 255);"); ui->pushButton_3->setStyleSheet("background-color: rgb(14, 19, 22);"); ui->label_3->setStyleSheet("color: rgb(255, 255, 255);"); } //秒表窗口切换 void stopwatch::on_pushButton_3_clicked() { ui->stackedWidget->setCurrentIndex(2); ui->pushButton_3->setStyleSheet("background-color: rgb(0, 107, 0);"); ui->label_3->setStyleSheet("color: rgb(0, 107, 0);"); ui->pushButton_2->setStyleSheet("background-color: rgb(14, 19, 22);"); ui->label_2->setStyleSheet("color: rgb(255, 255, 255);"); ui->pushButton->setStyleSheet("background-color: rgb(14, 19, 22);"); ui->label->setStyleSheet("color: rgb(255, 255, 255);"); } ukui-sidebar/src/plugins/Clock_deamon/window-close-symbolic.png0000644000175000017500000000031013635342602023645 0ustar fengfengPNG  IHDR ftIDAT0 Ell)eT`zzq9~up;p3RjXSJ}'"_""r.DJUcΡ  qOXa5Pof-@ Mnq؈kIENDB`ukui-sidebar/src/plugins/Clock_deamon/set_clock.h0000644000175000017500000000043113635342602021031 0ustar fengfeng#ifndef SET_CLOCK_H #define SET_CLOCK_H #include namespace Ui { class set_clock; } class set_clock : public QWidget { Q_OBJECT public: explicit set_clock(QWidget *parent = nullptr); ~set_clock(); private: Ui::set_clock *ui; }; #endif // SET_CLOCK_H ukui-sidebar/src/plugins/Clock_deamon/open-menu-symbolic.png0000644000175000017500000000014013635342602023137 0ustar fengfengPNG  IHDR  'IDATc~"HQ QD*Í V wIENDB`ukui-sidebar/src/plugins/Clock_deamon/stopwatch_item.h0000644000175000017500000000216313642562542022126 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include namespace Ui { class stopwatch_item; } class stopwatch_item : public QWidget { Q_OBJECT public: explicit stopwatch_item(QWidget *parent = nullptr); ~stopwatch_item(); QLabel *stopwatch1; QLabel *stopwatch2; QLabel *stopwatch3; QFrame *stopwatch_line; private: Ui::stopwatch_item *ui; }; #endif // STOPWATCH_ITEM_H ukui-sidebar/src/plugins/Clock_deamon/sax.mp30000644000175000017500000031325013635342602020134 0ustar fengfengID3TENC Lavf52.32.0@I(`l6J b c.sڜ!B7y'ɑ'7FwC?J\@,lƣal6RB* _8\'BD{<%F?S(d7YշP8eCSy3ԂJ:qI@ +_82  6\%rf"Cz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JBğlDLEhVK3vI6{{\vh6&.eC"_>wsoV$ IVWuE v@ī^)ʺEE်X=:ԑy$^)3[Q$RR_w&?^2h%R:S&5e4SG6Kݒht"BĮ.t*bĘt姧8@|t*ԟ7ؕ'ڠѯjڈkmB{kCަ"]}@T*ְ$S'ĵ>@ĸz&dcJxLu)1S&|sw7E3UNKr꒦fVȢȭ78*RfIh̒;t䉑,jZS.I\kAB2`+LPW OlhIdtZu-?ZMi]um96@fΆqeƵ 9Rj?>GMZ- kaCH@%dhbŖsN3@Be3Y5 Uͼz6u( ?Vk?Z+gDZZRݙVTG1BĖ_hdzP³ꋪ=a BOsj1C#"Ji9h]ΞXªa>eF.-L:?@ğ"TyļH Le?d}BEnI[ț 嗻Y U2M5&-Đ/TZ( Թ[ǭBīAz^Dk*uD(J4ۦ 'k)75YgkɂZ )TJ5*DO,0{P4@ĺ2,*XEOW!#Xi*XAPZ+%@Pk%= phLAME3.97UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUB"<~qUUUUUUUUUUUUUUUUUUUULAME3.97UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU@UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUBHUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUukui-sidebar/src/plugins/Clock_deamon/kylin-alarm-clock.svg0000644000175000017500000001034013642561377022756 0ustar fengfeng 画板 18 ukui-sidebar/src/plugins/Clock_deamon/Clock.qm0000644000175000017500000000452113642562542020315 0ustar fengfeng #include #include #include #include Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); // setWindowFlags(Qt::FramelessWindowHint); /* 开启窗口无边框 */ // setAttribute(Qt::WA_TranslucentBackground);/* 开启窗口透明层 */ numb=new QLCDNumber(this); numb2=new QLCDNumber(this); numb3=new QLCDNumber(this); numb->setAutoFillBackground(true);//设置lcd背景 numb2->setAutoFillBackground(true); numb3->setAutoFillBackground(true); // QPalette pal=numb->palette(); // pal.setBrush(numb->backgroundRole(),QBrush(QColor(0,0,0)));//lcd背景颜色 //numb->setPalette(pal); numb->resize(10,5); numb->setGeometry(12,10,60,30); numb2->setGeometry(72,10,60,30); numb3->setGeometry(132,10,60,30); numb->setSegmentStyle(QLCDNumber::Outline); numb->setDecMode(); numb->setSmallDecimalPoint(1); } void Widget::settime_number(int h, int m, int s){ hour=h; minute=m ; second=s; } void Widget::timestart(){ //定时器--------------------------------- //新建一个QTimer对象 timer = new QTimer(); //设置定时器每个多少毫秒发送一个timeout()信号 timer->setInterval(1000); //启动定时器 timer->start(); QVBoxLayout *layout = new QVBoxLayout(); layout->addWidget(numb); layout->addWidget(numb2); layout->addWidget(numb3); //信号和槽 connect(timer, SIGNAL(timeout()), this, SLOT(Count_down())); return ; } Widget::~Widget() { delete ui; } //倒计时执行 void Widget::Count_down() { /* //获取系统当前时间 QTime time = QTime::currentTime(); //设置晶体管控件QLCDNumber上显示的内容 numb->display(time.toString("hh")); numb2->display(time.toString("mm")); numb3->display(time.toString("ss")); */ numb->display(hour); numb2->display(minute); numb3->display(second); if(hour==0 && minute==0 && second==0){ player->play(); QMessageBox::warning(this, "Warning", "该休息了"); player->stop(); timer->stop(); // exit(0); } second--; if(second==-1){ minute--; second=59;} if(minute==-1){ hour--; minute=59;} } void Widget::on_pushButton_Start_clicked() { settime_number(0,0,6); timestart(); } void Widget::on_pushButton_pause_clicked() { if(nullptr != timer && pushflag ==0){ timer->stop(); pushflag = 1; ui->pushButton_pause->setText("继续"); }else{ timer->start(); pushflag = 0; ui->pushButton_pause->setText("暂停"); } } void Widget::on_pushButton_ring_clicked() { player->setVolume(60); player->setMedia(QUrl::fromLocalFile("/home/hyd/桌面/sax.mp3")); // ring="/home/hyd/桌面/sax.mp3"; } //void Widget::on_pushButton_timeselect_2_clicked() //{ // //settime_number(hour, minute , second); //} ukui-sidebar/src/plugins/Clock_deamon/main.cpp0000644000175000017500000000034313642562542020351 0ustar fengfeng#include "clock.h" #include #include "connection.h" #include "debug.h" #include "item_new.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); Clock w; w.show(); return a.exec(); } ukui-sidebar/src/plugins/Clock_deamon/alarm_on.png0000644000175000017500000000215013635342602021210 0ustar fengfengPNG  IHDR2/IDATXX]lTEfm\ m!<Ѻ7P Q"| lh - MԠ &k FM4$6Ѯ/uiiZzwٝΝvٽ'{͙se#@:` Q(kn#BNx~z.4}zK9kdGT܇3Y^$4tHYH_2)xk*66cOÖ?ֱ7Adz%opYA/}+{Z`ԒWڷƥރ\1}uǿn XQj$Įx/+I%+FZeKYNGC:nw]D6hx[9lYTTBЏ Bz:!ݚlXX2yXddVΤ$4 5c\ u{cЋGE%P*ƗB#bzIYI뽀sR瑹q;," hKCc֔9߰Uy14;fK߻JEj{nЖ>P3OFYˢK?!`A/p1o0s[d{ 88\U #3=5Of~i|=lduC`<.V%L _nGNq= nߔ-Ard8U">Lիn-IOyܘ%ؓaUٺXy)>m0>A.pd?Uyٿyoj~h=a'\f픠Dה>m2 _IgGL #include #include #include #include class aItem :public QWidget { public: aItem(); private: QPushButton *deleteAlarmBtn0; QLabel *alarmLabel0; QLabel *alarmLabel_w0; QLabel *alarmLabel_s0; QPushButton *alarm_on_off0; QPushButton *alarm_changed0; QPushButton *alarm_edit0; QFrame *alarm_line0; }; #endif // AITEM_H ukui-sidebar/src/plugins/Clock_deamon/icon-1.png0000644000175000017500000000057213635342602020514 0ustar fengfengPNG  IHDRaAIDAT8=/aKn-Ebb4X;"$~_c&H$"\riUՓ stopwatch_item 0 0 376 56 Form ukui-sidebar/src/plugins/Clock_deamon/window-minimize-symbolic.png0000644000175000017500000000012113635342602024361 0ustar fengfengPNG  IHDR aaMIDATc~"HAu ,IENDB`ukui-sidebar/src/plugins/Clock_deamon/clock_plugin.cpp0000644000175000017500000000354013642562542022100 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include "clock.h" #include "connection.h" #include "debug.h" #include "qdebug.h" #include #include #include clock_plugin::clock_plugin() { // m_pClock = new Clock; QString locale = QLocale::system().name(); QTranslator *translator_clock; translator_clock = new QTranslator(); //英文环境加载en.qm if(locale == "en_US"){ translator_clock->load(QString(":/Clock.qm")); //选择翻译文件 QApplication::installTranslator(translator_clock); } } void clock_plugin::onNotification() { qDebug()<< "onNotification"; } void clock_plugin::PluginsShowInterface() { // if(Clockflag) m_pClock = new Clock; QDesktopWidget *desk = QApplication::desktop(); QRect deskRect = desk->availableGeometry(); m_pClock->show(); m_pClock->move((deskRect.width()-m_pClock->width())/2, (deskRect.height()-m_pClock->height())/2); // Clockflag = true; } clock_plugin::~clock_plugin() { if( m_pClock) { delete m_pClock; } m_pClock = nullptr; } QWidget* clock_plugin::centerWidget() { return m_pClock; } ukui-sidebar/src/plugins/Clock_deamon/music.qrc0000644000175000017500000000014313635342602020541 0ustar fengfeng music/FallenDown.mp3 ukui-sidebar/src/plugins/Clock_deamon/aitem.cpp0000644000175000017500000000364713635342602020531 0ustar fengfeng#include "aitem.h" #include "clock.h" aItem::aItem() { aItem->setFixedSize(376, 56); alarmLabel_w0 = new QLabel();//闹钟用途 alarmLabel_w0->move(22, 9); alarmLabel_w0->setFixedSize(100, 17); alarmLabel_w0->setStyleSheet("font: 11pt 'Sans Serif';"); // alarmLabel_w[alarmNum]->setText(model->index(alarmNum, 5).data().toString()); alarmLabel_w0->setText("起床铃"); alarmLabel_w0->setVisible(true); alarmLabel_s0 = new QLabel( );//闹钟重复 alarmLabel_s0->move(24, 34); alarmLabel_s0->setFixedSize(100, 17); alarmLabel_s0->setStyleSheet("font: 9pt 'Sans Serif';color: rgb(148, 148, 148);"); // alarmLabel_w[alarmNum]->setText(model->index(alarmNum, 6).data().toString()); alarmLabel_s0->setText("工作日"); alarmLabel_s0->setVisible(true); alarm_line0 = new QFrame(); alarm_line0->move(13, 52); alarm_line0->setFixedSize(350, 1); //alarm_line[alarmNum]->setStyleSheet("color: rgb(255, 255, 255);"); alarm_line0->setStyleSheet(QString::fromUtf8("color: rgb(255, 255, 255);background-color: rgb(102, 102, 102);")); alarmLabel0 = new QLabel();//闹钟,音乐, alarmLabel0->move(213,15); alarmLabel0->setFixedSize(78, 20); alarmLabel0->setStyleSheet("font: 17pt 'Sans Serif';"); alarmLabel0->setText("00:00"); alarmLabel0->setVisible(true); alarmLabel0->show(); alarm_on_off0 = new QPushButton();//闹钟开关 alarm_on_off0->move(305,14); alarm_on_off0->setFixedSize(50, 24); alarm_on_off0->setFlat(true); alarm_on_off0->setVisible(true); // if(model->index(0, 3).data().toInt() == 1){ // alarm_on_off0->setStyleSheet("border-image: url(:/alarm_off.png);"); // }else { alarm_on_off0->setStyleSheet("border-image: url(:/alarm_on.png);"); // } // connect( alarm_on_off0, SIGNAL(clicked()), this, SLOT(on_off_Alarm()) ); //w1->setStyleSheet("background-color: rgb(39, 207, 129);"); } ukui-sidebar/src/plugins/Clock_deamon/clock.png0000644000175000017500000003326213642562542020530 0ustar fengfengPNG  IHDRl]sBITOtEXtSoftwaregnome-screenshot> IDATxY$I&}"jf~ǙuNs!ݽ|{|Cpv<=uefe~إ*5##"3άYYfjf"?#&"1$ 19+pdVdL3x /Vݺ=(Y5Vу?8euMTJwa ]RO[[4,.e߻(MjV'ch XŘ(%+ IHh||V0EhBtς7r[7¼ߺYkpwrn pY4& :8-8 '(#TṇWd~Yɶot/)D)j_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]>:, Oө%V8*"&...}U8:tMB.;`Y٧~vRt1BǿK]7uQUG'V]'[Z2'U{ӭk=żJ߳mlTP2ّB0@ qMњv\6mdT%IK߶'QzƔx\w+pԝ"B Yƕ]Ij΢9x*eZߩw(tMۊ.s +LQܕPH u(^*cz8|jM̆d^zt{nV$$ѽ_}Z#Tmt+: vLd$eunˣX LC s5јb_r>>r7!u5yUC[W(nbΌaRGjUIQ$wB$}6;[[(F$NZ.ïOƑcd}iTHݝTY (+@.>HݷT8ry-J≄)weXr<)iF5ů4۵-Mbź]ՋɴCJ:U5YcWu5I!\tgia$\Dmc 1ђr Uhoۃ'{v]oѧBEH1軈t{A*$ЪbUyQtlo\UPQ黶ﺭٮt\e~ >vq!vT5;٠mDiwrR3V$86DԂg2fÛ2Uq6ϿVbDZVB*^b M#setupUi(this); this->setFixedSize(376, 56); alarmLabel_w0 = new QLabel(this);//闹钟用途 alarmLabel_w0->move(22, 9); alarmLabel_w0->setFixedSize(100, 17); alarmLabel_w0->setStyleSheet("font: 11pt ;background-color: rgb();"); alarmLabel_w0->setText(tr("闹钟")); alarmLabel_s0 = new QLabel( this);//闹钟重复 alarmLabel_s0->move(24, 34); alarmLabel_s0->setFixedSize(100, 17); alarmLabel_s0->setStyleSheet("font: 9pt ;color: rgb(148, 148, 148);background-color: rgb();"); alarmLabel_s0->setText(tr("工作日")); alarmLabel_s0->setVisible(true); alarm_line0 = new QFrame(this); alarm_line0->move(13, 52); alarm_line0->setFixedSize(350, 1); alarm_line0->setStyleSheet(QString::fromUtf8("color: rgb(255, 255, 255);background-color: rgb(102, 102, 102);")); alarmLabel0 = new QLabel(this);//闹钟,音乐, alarmLabel0->move(213,15); alarmLabel0->setFixedSize(78, 20); alarmLabel0->setStyleSheet("font: 17pt ;background-color: rgb();"); alarmLabel0->setText("00:00"); alarmLabel0->setVisible(true); alarmLabel0->show(); alarm_on_off0 = new QPushButton(this);//闹钟开关 alarm_on_off0->move(305,14); alarm_on_off0->setFixedSize(50, 24); alarm_on_off0->setFlat(true); alarm_on_off0->setVisible(true); alarm_on_off0->setStyleSheet("border-image: url(:/alarm_on.png);background-color: rgb();"); } item_new::~item_new() { delete ui; } ukui-sidebar/src/plugins/Clock_deamon/connection.h0000644000175000017500000000251213642562542021231 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include static bool createConnection() { QString url_filepath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation) +"/.config/ukui/Clock_database.db"; QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); db.setDatabaseName(url_filepath); if(!db.open()) return false; QSqlQuery query; query.exec(QString( "create table clock (Hour int, Minute int, Music QString, onoroff int, NUM int)")); //提示:主键不能相同 return true; } #endif // CONNECTION_H ukui-sidebar/src/plugins/Clock_deamon/alarm_off.png0000644000175000017500000000144413635342602021353 0ustar fengfengPNG  IHDR2IDATXŘOQa5 ;ˣ@KY7uF01FD@h\U"q"P n(5L t:~s||9s={A,'PXK`a; !CFOONy9/Ĕ̓6_/SZz KK?c4ΩāCÔ#Jip\sFr&Uw#oDnooXB&'?RpV5eqG" ȷaNT.HHΠڕ]qUkJ&#%%άw:45ka7g"W14把ܸn0l&Wpjs,8sbDRGD|2̛<33cW!Ac^84搉\i`DS^GF6[D"+#V{ 'kG]VnQ4NEvQ[S#ցCCvv;HyBFCȪj#OJU95>;UUï%[!BPKc5_x countdown 0 0 1035 682 countdown 20 100 80 26 开始 20 220 80 26 铃声 20 140 80 26 暂停 20 180 80 26 时间选择 637 470 80 80 color: rgb(255, 255, 255); background-color: rgb(255, 255, 255); 550 210 241 231 color: rgb(255, 255, 255); font: 24pt "Sans Serif"; background-color: rgb(14, 19, 22); 630 170 81 20 color: rgb(255, 255, 255); color: rgb(148, 148, 148); font: 12pt "Sans Serif"; 00:00:00 570 110 191 51 color: rgb(255, 255, 255); text-decoration: underline; font: 9pt "Sans Serif"; font: 36pt "Sans Serif"; 00:00:00 760 580 80 26 color: rgb(255, 255, 255); 复位 510 580 80 26 color: rgb(255, 255, 255); 计次 ukui-sidebar/src/plugins/ukui_notebook/0000755000175000017500000000000013642562542017220 5ustar fengfengukui-sidebar/src/plugins/ukui_notebook/translations/0000755000175000017500000000000013642562542021741 5ustar fengfengukui-sidebar/src/plugins/ukui_notebook/translations/ukui_notebook_zh_CN.qm0000644000175000017500000000335213642562542026241 0ustar fengfeng Widget 0 0 568 542 Widget width:568px; height:542px; background-color: rgb(0, 0, 0); border-radius:6px; opacity:0.7; 530 10 30 30 background-color: rgb(0, 0, 0); border-width:0; 480 10 30 30 background-color: rgb(0, 0, 0); border-width:0; color: rgb(255, 255, 255); hover:color(0,0,255); 20 10 47 23 Noto Sans CJK SC -1 50 false width:47px; height:23px; font-size:20px; font-family:Noto Sans CJK SC; font-weight:400; line-height:40px; background-color: rgb(0, 0, 0); color: rgb(255, 255, 255); Note 0 50 568 397 background-color:rgb(0,0,0); 260 480 48 48 background-color: rgb(0, 0, 0); border-width:0; border-style:outset; ukui-sidebar/src/plugins/ukui_notebook/widget.h0000644000175000017500000000442113642562542020655 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include "ukui_notebook.h" #include "singleitemwidget.h" #include #include #include #include #include #include "ui_ukui_notebook.h" #include "ui_singleitemwidget.h" #include "sql_create.h" namespace Ui { class Widget; } class Widget : public QWidget { Q_OBJECT public: explicit Widget(QWidget *parent = nullptr); ~Widget(); signals: void listItemClicked(int); public: QTranslator *translator; //国际化 static bool ukui_sql_load(); private: Ui::Widget *ui; ukui_NoteBook *ukui_notebook; ukui_NoteBook *ukui_notebookOpen; QSqlTableModel *model; //数据库 QPoint m_lastPoint;//记录鼠标位置 SingleItemWidget *s; QListWidgetItem *aItem; int index; int txtNum; int rowNum; QString ukui_textEdit; QString filename; QListWidgetItem *item[100]; SingleItemWidget *singleItem[100]; //QString fileContent;//读到的文件内容 //QDateTime dateTime; void ukui_init(); void ukui_conn(); void ukui_sql_init(); void ukui_addItem(); //更新Item列表 void ukui_updateItem(); void mouseMoveEvent(QMouseEvent *event); void mousePressEvent(QMouseEvent *event); private slots: void exitSlot(); void miniSlot(); void editSlot(); void newSlot(); void listDoubleClickSlot(); void listDelSingleSlot(); void fileSavedSlot(QString data); }; #endif // WIDGET_H ukui-sidebar/src/plugins/ukui_notebook/ukui_notebook.cpp0000644000175000017500000002630713642562542022611 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 setupUi(this); ukuiNoteBook_init(); ukuiNoteBook_connect(); } ukui_NoteBook::~ukui_NoteBook() { if(notebook == nullptr){ qDebug() <<"notebook == null"; } else { notebook = nullptr; qDebug() << "notebook = null"; } delete ui; qDebug() << "delete ui"; delete ui; } void ukui_NoteBook::ukuiNoteBook_init() { qDebug() << "ukuiNoteBook_init"; //字体初始化 setting = new QSettings("config.ini",QSettings::IniFormat); setWindowFlags(Qt::FramelessWindowHint);//开启窗口无边框 this->setWindowTitle(tr("NoteBook")); setWindowIcon(QIcon(":/new/prefix1/SVG/kylin-notebook.svg")); } void ukui_NoteBook::ukuiNoteBook_connect() { qDebug() << "ukuiNoteBook_connect"; connect(ui->ukui_NoteNew,SIGNAL(clicked()),this,SLOT(newWindowsSlot())); connect(ui->ukui_NoteClose,SIGNAL(clicked()),this,SLOT(exitFileSlot())); connect(ui->ukui_NoteSave,SIGNAL(clicked()),this,SLOT(saveFileSlot())); connect(ui->ukui_NoteSaveAs,SIGNAL(clicked()),this,SLOT(saveFileAsSlot())); connect(ui->ukui_NoteFont,SIGNAL(clicked()),this,SLOT(fontChooseSlot())); connect(ui->ukui_NoteDate,SIGNAL(clicked()),this,SLOT(insertTimeDateSlot())); connect(ui->ukui_NotePdf,SIGNAL(clicked()),this,SLOT(exportPdfSlot())); connect(ui->ukui_NoteJpg,SIGNAL(clicked()),this,SLOT(exportJpgSlot())); } void ukui_NoteBook::realOpenFile() { qDebug() << ".."; } void ukui_NoteBook::saveFile() { qDebug() << "saveFile"; qDebug() << fileName;//路径+文件名 QFile file(fileName); if (file.open(QIODevice::WriteOnly)){ QTextStream out(&file); out << ui->textEdit->document()->toPlainText(); file.close(); //this->setWindowTitle(fileName.mid(fileName.lastIndexOf('/')+1)+" - Note"); fileContent = ui->textEdit->document()->toPlainText(); qDebug() << "fileContent = " <textEdit->document()->toPlainText() ; }else{ QMessageBox box(QMessageBox::Question,tr("Tips"),tr("Failed to save file!")); box.setIcon(QMessageBox::Warning); box.setStandardButtons (QMessageBox::Ok); box.setButtonText (QMessageBox::Ok,QString(tr("OK"))); box.exec(); } // QFileInfo info(fileName); // qDebug() << info.created(); // qDebug() << info.lastModified(); // qDebug() << info.fileName(); emit fileSaved(fileName); qDebug() << "fileName = " << fileName; qDebug() << "emid filesaved"; } void ukui_NoteBook::saveTextToFile() { qDebug() << ".."; } void ukui_NoteBook::ukui_setShortCut() { qDebug() << ".."; } void ukui_NoteBook::mousePressEvent(QMouseEvent *event) { if(event->button() == Qt::LeftButton) { emit this->listItemClicked(index); } if (event->button() == Qt::LeftButton) { m_lastPoint = event->globalPos() - frameGeometry().topLeft(); event->accept(); } } void ukui_NoteBook::paintEvent(QPaintEvent *) { QStyleOption opt; opt.init(this); QPainter p(this); p.setBrush(QBrush(QColor("#161617"))); p.setOpacity(0.42); p.setPen(Qt::NoPen); p.drawRoundedRect(opt.rect,0,0); p.drawRect(opt.rect); style()->drawPrimitive(QStyle::PE_Widget,&opt,&p,this); } void ukui_NoteBook::mouseMoveEvent(QMouseEvent *event) { if (event->buttons() & Qt::LeftButton) { move(event->globalPos() - m_lastPoint); event->accept(); } } /***************Slots**************/ void ukui_NoteBook::newFileSlot() { qDebug() << ".."; } void ukui_NoteBook::exitFileSlot() { qDebug() << "exitFileSlot"; //文档已经修改 if(ui->textEdit->document()->isModified()&& !ui->textEdit->document()->isEmpty() && fileContent != ui->textEdit->document()->toPlainText()){ QMessageBox box(QMessageBox::Question,tr("NoteBook"),tr("Save current text")); box.setIcon(QMessageBox::NoIcon); box.setStandardButtons (QMessageBox::Ok|QMessageBox::Ignore|QMessageBox::Cancel); box.setButtonText (QMessageBox::Ok,QString(tr("Yes"))); box.setButtonText (QMessageBox::Ignore,QString(tr("No"))); box.setButtonText (QMessageBox::Cancel,QString(tr("Cancel"))); int result = box.exec(); if(result == QMessageBox::Ok){ if(fileName.isEmpty()){//新建 //弹出保存文件对话框 fileName = QFileDialog::getSaveFileName(this, tr("Save File"),QDir::homePath(),tr("Text File (*.txt*);;")); if(!fileName.isEmpty()){ if(QFileInfo(fileName).suffix().isEmpty()){ fileName.append(".txt"); qDebug() << fileName; } //保存文件 this->saveFile(); // else if (!(QFileInfo(fileName).suffix() == ".txt")) { // QMessageBox box(QMessageBox::Question,"提示","保存文件失败!"); // box.setIcon(QMessageBox::Warning); // box.setStandardButtons (QMessageBox::Ok); // box.setButtonText (QMessageBox::Ok,QString("确定")); // box.exec(); // } } }else{ this->saveFile(); } }else if(result == QMessageBox::Ignore){ //不保存 关闭 this->close(); } }else{ this->close(); } } void ukui_NoteBook::insertTimeDateSlot() { qDebug() << ".."; QDateTime time = QDateTime::currentDateTime();//获取当前系统时间 ui->textEdit->append(time.toString("hh:mm yyyy-MM-dd")); } void ukui_NoteBook::newWindowsSlot() { qDebug() << "newWindowsSlot"; notebook = new ukui_NoteBook; notebook->show(); } void ukui_NoteBook::openFileSlot() { qDebug() << ".."; } void ukui_NoteBook::saveFileSlot() { qDebug() << "saveFileSlot"; if(ui->textEdit->document()->isModified() && !ui->textEdit->document()->isEmpty() && fileContent != ui->textEdit->document()->toPlainText()) { //判断是新建还是读取的文本 if(fileName.isEmpty()) {//新建 //弹出保存文件对话框 //this->setStyleSheet("QFileDialog{background-color:rgb(0,0,0);}"); fileName = QFileDialog::getSaveFileName(this, tr("Save File"),QDir::homePath(),tr("Text File(*.txt*);;")); if(!fileName.isEmpty()) { if(QFileInfo(fileName).suffix().isEmpty()) { fileName.append(".txt"); } //保存文件 this->saveFile(); } }else{//读取的文本 this->saveFile(); } } else if(ui->textEdit->document()->isEmpty()){ QMessageBox box(QMessageBox::Question,tr("Tips"),tr("Text content is empty")); box.setIcon(QMessageBox::Warning); box.setStandardButtons (QMessageBox::Ok); box.setButtonText (QMessageBox::Ok,QString(tr("OK"))); box.exec(); } else if (fileContent == ui->textEdit->document()->toPlainText()) { QMessageBox box(QMessageBox::Question,tr("Tips"),tr("Text not modified")); box.setIcon(QMessageBox::Warning); box.setStandardButtons (QMessageBox::Ok); box.setButtonText (QMessageBox::Ok,QString(tr("OK"))); box.exec(); } else if(!ui->textEdit->document()->isModified()) { QMessageBox box(QMessageBox::Question,tr("Tips"),tr("Text not modified")); box.setIcon(QMessageBox::Warning); box.setStandardButtons (QMessageBox::Ok); box.setButtonText (QMessageBox::Ok,QString(tr("OK"))); box.exec(); } } void ukui_NoteBook::saveFileAsSlot() { qDebug() << "saveFileAsSlot"; if(ui->textEdit->document()->isEmpty()){ QMessageBox box(QMessageBox::Question,tr("Tips"),tr("Text content is empty")); box.setIcon(QMessageBox::Warning); box.setStandardButtons (QMessageBox::Ok); box.setButtonText (QMessageBox::Ok,QString(tr("OK"))); box.exec(); } //如果文本不为空 else{ //弹出保存文件对话框 fileName = QFileDialog::getSaveFileName(this, tr("Open file"),QDir::homePath(),tr("Text file (*.*);;")); if(!fileName.isEmpty()){ //添加文件名后缀 if(QFileInfo(fileName).suffix().isEmpty()) { fileName.append(".txt"); } //保存文件 this->saveFile(); } } } void ukui_NoteBook::textStatusSlot() { qDebug() << ".."; } void ukui_NoteBook::exportPdfSlot() { qDebug() << ".."; QString file = QFileDialog::getSaveFileName(this, tr("Export pdf"), "", tr("Pdf file(*.pdf);;")); if(!file.isEmpty()){ if(QFileInfo(file).suffix().isEmpty()){ file.append(".pdf"); } } QPrinter printer(QPrinter::HighResolution); printer.setOutputFormat(QPrinter::PdfFormat); printer.setOutputFileName(file); ui->textEdit->document()->print(&printer); } void ukui_NoteBook::exportJpgSlot() { qDebug() << "export jpg"; int w,h; w = ui->textEdit->width(); h = ui->textEdit->height(); QPixmap exportImage(w,h); exportImage.fill(Qt::white); QPainter painter(&exportImage); QPixmap axisPixmap = ui->textEdit->grab(QRect(0,0,-1,-1)); painter.drawPixmap(0,0,axisPixmap); QString pic = QFileDialog::getSaveFileName(this,tr("Export picture"),"",tr("Images(*.jpg)")); if(!pic.isEmpty()){ if(QFileInfo(pic).suffix().isEmpty()){ pic.append(".jpg"); } exportImage.save(pic); } } void ukui_NoteBook::fontChooseSlot() { qDebug() << ".."; QFont textFont= ui->textEdit->font(); bool ok; QFont font = QFontDialog::getFont(&ok, textFont,this,tr("Font selection")); if (ok) { ui->textEdit->setFont(font); setting->beginGroup("config");//beginGroup与下面endGroup 相对应,“config”是标记 setting->setValue("family",QVariant(font.family())); setting->setValue("point_size",QVariant(font.pointSize())); setting->setValue("italic",QVariant(font.italic() == true ?"1":"0")); setting->setValue("bold",QVariant(font.bold()== true ?"1":"0")); setting->setValue("overline",QVariant(font.overline()== true ?"1":"0")); setting->setValue("underline",QVariant(font.underline()== true ?"1":"0")); setting->endGroup(); } } ukui-sidebar/src/plugins/ukui_notebook/ukui_notboot.json0000644000175000017500000000002513642562542022631 0ustar fengfeng{ "Keys" : [ ] } ukui-sidebar/src/plugins/ukui_notebook/sql_create.h0000644000175000017500000000232413642562542021514 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include static bool createSql() { QString url_filepath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation) +"/.config/ukui/notebookSql.db"; QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); db.setDatabaseName(url_filepath); if(!db.open()) return false; QSqlQuery query; query.exec(QString( "create table fileInfo (fileName QString)")); return true; } #endif // SQL_CREATE_H ukui-sidebar/src/plugins/ukui_notebook/singleitemwidget.h0000644000175000017500000000234613642562542022742 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include namespace Ui { class SingleItemWidget; } class SingleItemWidget : public QWidget { Q_OBJECT public: explicit SingleItemWidget(QWidget *parent = nullptr); ~SingleItemWidget(); signals: void childDelEvent(); public: Ui::SingleItemWidget *ui; private slots: void clickDelBtn(); private: void SingleItem_init(); void SingleItem_conn(); }; #endif // SINGLEITEMWIDGET_H ukui-sidebar/src/plugins/ukui_notebook/SVG/0000755000175000017500000000000013642562542017657 5ustar fengfengukui-sidebar/src/plugins/ukui_notebook/SVG/new-b.svg0000644000175000017500000000123213636027500021377 0ustar fengfeng画板 140ukui-sidebar/src/plugins/ukui_notebook/SVG/删除-悬停.svg0000644000175000017500000000113413642562542024644 0ustar fengfeng画板 134 副本 3ukui-sidebar/src/plugins/ukui_notebook/SVG/new-s.svg0000644000175000017500000000114713636027500021425 0ustar fengfeng画板 140 副本 3ukui-sidebar/src/plugins/ukui_notebook/SVG/删除-b-点击.svg0000644000175000017500000000121313642562542025144 0ustar fengfeng画板 149 副本 14ukui-sidebar/src/plugins/ukui_notebook/SVG/new-s-click.svg0000644000175000017500000000115513636027500022507 0ustar fengfeng画板 140 副本 5ukui-sidebar/src/plugins/ukui_notebook/SVG/插入时间-普通.svg0000644000175000017500000000137113642562542027013 0ustar fengfeng画板 149 副本 9ukui-sidebar/src/plugins/ukui_notebook/SVG/导出jpg-点击.svg0000644000175000017500000000314013642562542025532 0ustar fengfeng画板 149 副本 5ukui-sidebar/src/plugins/ukui_notebook/SVG/new-s-hover.svg0000644000175000017500000000114613636027500022545 0ustar fengfeng画板 140 副本 4ukui-sidebar/src/plugins/ukui_notebook/SVG/导出jpg-悬停.svg0000644000175000017500000000314113642562542025450 0ustar fengfeng画板 149 副本 4ukui-sidebar/src/plugins/ukui_notebook/SVG/字体-点击.svg0000644000175000017500000000042013642562542024776 0ustar fengfeng画板 149 副本 2ukui-sidebar/src/plugins/ukui_notebook/SVG/插入时间-点击.svg0000644000175000017500000000137113642562542027044 0ustar fengfeng画板 149 副本 11ukui-sidebar/src/plugins/ukui_notebook/SVG/exportPDF-click.svg0000644000175000017500000000242013636027500023325 0ustar fengfeng画板 149 副本 8ukui-sidebar/src/plugins/ukui_notebook/SVG/深色主题/0000755000175000017500000000000013642562542024311 5ustar fengfengukui-sidebar/src/plugins/ukui_notebook/SVG/深色主题/最小化-普通.svg0000644000175000017500000000041313642562542032321 0ustar fengfeng画板 109 副本ukui-sidebar/src/plugins/ukui_notebook/SVG/深色主题/最小化-悬停.svg0000644000175000017500000000052713642562542032275 0ustar fengfeng画板 109 副本 6ukui-sidebar/src/plugins/ukui_notebook/SVG/深色主题/关闭-普通.svg0000644000175000017500000000071013642562542031356 0ustar fengfeng画板 109 副本 2ukui-sidebar/src/plugins/ukui_notebook/SVG/深色主题/关闭-悬停.svg0000644000175000017500000000076513642562542031336 0ustar fengfeng画板 109 副本 7ukui-sidebar/src/plugins/ukui_notebook/SVG/深色主题/最大化-悬停.svg0000644000175000017500000000067613642562542032316 0ustar fengfeng画板 109 副本 8ukui-sidebar/src/plugins/ukui_notebook/SVG/深色主题/最大化-普通.svg0000644000175000017500000000056413642562542032344 0ustar fengfeng画板 109 副本 3ukui-sidebar/src/plugins/ukui_notebook/SVG/深色主题/最小化-点击.svg0000644000175000017500000000053013642562542032352 0ustar fengfeng画板 109 副本 11ukui-sidebar/src/plugins/ukui_notebook/SVG/深色主题/更多-悬停.svg0000644000175000017500000000073013642562542031344 0ustar fengfeng画板 109 副本 5ukui-sidebar/src/plugins/ukui_notebook/SVG/深色主题/更多-普通.svg0000644000175000017500000000064213642562542031400 0ustar fengfeng画板 109ukui-sidebar/src/plugins/ukui_notebook/SVG/深色主题/最大化-点击.svg0000644000175000017500000000067713642562542032402 0ustar fengfeng画板 109 副本 13ukui-sidebar/src/plugins/ukui_notebook/SVG/深色主题/更多-点击.svg0000644000175000017500000000073113642562542031430 0ustar fengfeng画板 109 副本 10ukui-sidebar/src/plugins/ukui_notebook/SVG/深色主题/还原-普通.svg0000644000175000017500000000074313642562542031373 0ustar fengfeng画板 109 副本 4ukui-sidebar/src/plugins/ukui_notebook/SVG/深色主题/还原-悬停.svg0000644000175000017500000000105513642562542031336 0ustar fengfeng画板 109 副本 9ukui-sidebar/src/plugins/ukui_notebook/SVG/深色主题/关闭-点击.svg0000644000175000017500000000076613642562542031422 0ustar fengfeng画板 109 副本 12ukui-sidebar/src/plugins/ukui_notebook/SVG/深色主题/还原-点击.svg0000644000175000017500000000105613642562542031422 0ustar fengfeng画板 109 副本 14ukui-sidebar/src/plugins/ukui_notebook/SVG/delete-hover.svg0000644000175000017500000000113413636027500022753 0ustar fengfeng画板 134 副本 3ukui-sidebar/src/plugins/ukui_notebook/SVG/新建-s-普通.svg0000644000175000017500000000114713642562542025265 0ustar fengfeng画板 140 副本 3ukui-sidebar/src/plugins/ukui_notebook/SVG/导出pdf-点击.svg0000644000175000017500000000242013642562542025523 0ustar fengfeng画板 149 副本 8ukui-sidebar/src/plugins/ukui_notebook/SVG/新建-b-普通.svg0000644000175000017500000000123213642562542025237 0ustar fengfeng画板 140ukui-sidebar/src/plugins/ukui_notebook/SVG/insertTime.svg0000644000175000017500000000137113636027500022516 0ustar fengfeng画板 149 副本 9ukui-sidebar/src/plugins/ukui_notebook/SVG/浅色主题/0000755000175000017500000000000013642562542024233 5ustar fengfengukui-sidebar/src/plugins/ukui_notebook/SVG/浅色主题/最小化-普通.svg0000644000175000017500000000040413642562542032243 0ustar fengfeng画板 109 副本 16ukui-sidebar/src/plugins/ukui_notebook/SVG/浅色主题/关闭-普通.svg0000644000175000017500000000063313642562542031304 0ustar fengfeng画板 109 副本 17ukui-sidebar/src/plugins/ukui_notebook/SVG/浅色主题/最大化-普通.svg0000644000175000017500000000055313642562542032264 0ustar fengfeng画板 109 副本 18ukui-sidebar/src/plugins/ukui_notebook/SVG/浅色主题/更多-普通.svg0000644000175000017500000000056013642562542031321 0ustar fengfeng画板 109 副本 15ukui-sidebar/src/plugins/ukui_notebook/SVG/浅色主题/还原-普通.svg0000644000175000017500000000073213642562542031313 0ustar fengfeng画板 109 副本 19ukui-sidebar/src/plugins/ukui_notebook/SVG/dark_theme/0000755000175000017500000000000013636027500021753 5ustar fengfengukui-sidebar/src/plugins/ukui_notebook/SVG/dark_theme/more.svg0000644000175000017500000000064213636027500023440 0ustar fengfeng画板 109ukui-sidebar/src/plugins/ukui_notebook/SVG/dark_theme/max-click.svg0000644000175000017500000000067713636027500024356 0ustar fengfeng画板 109 副本 13ukui-sidebar/src/plugins/ukui_notebook/SVG/dark_theme/max.svg0000644000175000017500000000056413636027500023266 0ustar fengfeng画板 109 副本 3ukui-sidebar/src/plugins/ukui_notebook/SVG/dark_theme/reduction-click.svg0000644000175000017500000000105613636027500025555 0ustar fengfeng画板 109 副本 14ukui-sidebar/src/plugins/ukui_notebook/SVG/dark_theme/max-hover.svg0000644000175000017500000000067613636027500024413 0ustar fengfeng画板 109 副本 8ukui-sidebar/src/plugins/ukui_notebook/SVG/dark_theme/close-hover.svg0000644000175000017500000000076513636027500024732 0ustar fengfeng画板 109 副本 7ukui-sidebar/src/plugins/ukui_notebook/SVG/dark_theme/more-click.svg0000644000175000017500000000073113636027500024522 0ustar fengfeng画板 109 副本 10ukui-sidebar/src/plugins/ukui_notebook/SVG/dark_theme/reduction-hover.svg0000644000175000017500000000105513636027500025612 0ustar fengfeng画板 109 副本 9ukui-sidebar/src/plugins/ukui_notebook/SVG/dark_theme/min-hover.svg0000644000175000017500000000052713636027500024404 0ustar fengfeng画板 109 副本 6ukui-sidebar/src/plugins/ukui_notebook/SVG/dark_theme/reduction.svg0000644000175000017500000000074313636027500024474 0ustar fengfeng画板 109 副本 4ukui-sidebar/src/plugins/ukui_notebook/SVG/dark_theme/close-click.svg0000644000175000017500000000076613636027500024675 0ustar fengfeng画板 109 副本 12ukui-sidebar/src/plugins/ukui_notebook/SVG/dark_theme/min.svg0000644000175000017500000000041313636027500023255 0ustar fengfeng画板 109 副本ukui-sidebar/src/plugins/ukui_notebook/SVG/dark_theme/close.svg0000644000175000017500000000071013636027500023577 0ustar fengfeng画板 109 副本 2ukui-sidebar/src/plugins/ukui_notebook/SVG/dark_theme/min-click.svg0000644000175000017500000000053013636027500024340 0ustar fengfeng画板 109 副本 11ukui-sidebar/src/plugins/ukui_notebook/SVG/dark_theme/more-hover.svg0000644000175000017500000000073013636027500024557 0ustar fengfeng画板 109 副本 5ukui-sidebar/src/plugins/ukui_notebook/SVG/delete-click.svg0000644000175000017500000000113413636027500022715 0ustar fengfeng画板 134 副本 5ukui-sidebar/src/plugins/ukui_notebook/SVG/new-b-hover.svg0000644000175000017500000000124013636027500022517 0ustar fengfeng画板 140 副本ukui-sidebar/src/plugins/ukui_notebook/SVG/字体-普通.svg0000644000175000017500000000041013642562542024744 0ustar fengfeng画板 149ukui-sidebar/src/plugins/ukui_notebook/SVG/新建-b-悬停.svg0000644000175000017500000000124013642562542025204 0ustar fengfeng画板 140 副本ukui-sidebar/src/plugins/ukui_notebook/SVG/插入时间-悬停.svg0000644000175000017500000000137213642562542026762 0ustar fengfeng画板 149 副本 10ukui-sidebar/src/plugins/ukui_notebook/SVG/insertTime-click.svg0000644000175000017500000000137113636027500023601 0ustar fengfeng画板 149 副本 11ukui-sidebar/src/plugins/ukui_notebook/SVG/font-hover.svg0000644000175000017500000000041713636027500022462 0ustar fengfeng画板 149 副本ukui-sidebar/src/plugins/ukui_notebook/SVG/font-click.svg0000644000175000017500000000042013636027500022416 0ustar fengfeng画板 149 副本 2ukui-sidebar/src/plugins/ukui_notebook/SVG/exportJPG-hover.svg0000644000175000017500000000314113636027500023373 0ustar fengfeng画板 149 副本 4ukui-sidebar/src/plugins/ukui_notebook/SVG/light_theme/0000755000175000017500000000000013636027500022141 5ustar fengfengukui-sidebar/src/plugins/ukui_notebook/SVG/light_theme/more.svg0000644000175000017500000000056013636027500023625 0ustar fengfeng画板 109 副本 15ukui-sidebar/src/plugins/ukui_notebook/SVG/light_theme/max.svg0000644000175000017500000000055313636027500023452 0ustar fengfeng画板 109 副本 18ukui-sidebar/src/plugins/ukui_notebook/SVG/light_theme/reduction.svg0000644000175000017500000000073213636027500024660 0ustar fengfeng画板 109 副本 19ukui-sidebar/src/plugins/ukui_notebook/SVG/light_theme/min.svg0000644000175000017500000000040413636027500023443 0ustar fengfeng画板 109 副本 16ukui-sidebar/src/plugins/ukui_notebook/SVG/light_theme/close.svg0000644000175000017500000000063313636027500023771 0ustar fengfeng画板 109 副本 17ukui-sidebar/src/plugins/ukui_notebook/SVG/kylin-notebook.svg0000644000175000017500000003116213642561057023347 0ustar fengfeng ukui-sidebar/src/plugins/ukui_notebook/SVG/新建-s-点击.svg0000644000175000017500000000115513642562542025315 0ustar fengfeng画板 140 副本 5ukui-sidebar/src/plugins/ukui_notebook/SVG/上锁-点击.svg0000644000175000017500000000050413642562542024710 0ustar fengfeng画板 134 副本 4ukui-sidebar/src/plugins/ukui_notebook/SVG/导出jpg-普通.svg0000644000175000017500000000314113642562542025502 0ustar fengfeng画板 149 副本 3ukui-sidebar/src/plugins/ukui_notebook/SVG/勾.svg0000644000175000017500000000042513642562542021536 0ustar fengfeng画板 167ukui-sidebar/src/plugins/ukui_notebook/SVG/exportJPG.svg0000644000175000017500000000314113636027500022252 0ustar fengfeng画板 149 副本 3ukui-sidebar/src/plugins/ukui_notebook/SVG/new-b-click.svg0000644000175000017500000000127213636027500022466 0ustar fengfeng画板 140 副本 2ukui-sidebar/src/plugins/ukui_notebook/SVG/font.svg0000644000175000017500000000041013636027500021332 0ustar fengfeng画板 149ukui-sidebar/src/plugins/ukui_notebook/SVG/删除-b-悬停.svg0000644000175000017500000000121413642562542025062 0ustar fengfeng画板 149 副本 13ukui-sidebar/src/plugins/ukui_notebook/SVG/lock-hover.svg0000644000175000017500000000050413636027500022441 0ustar fengfeng画板 134 副本 2ukui-sidebar/src/plugins/ukui_notebook/SVG/exportPDF.svg0000644000175000017500000000242113636027500022243 0ustar fengfeng画板 149 副本 6ukui-sidebar/src/plugins/ukui_notebook/SVG/delete-b.svg0000644000175000017500000000121413636027500022050 0ustar fengfeng画板 149 副本 12ukui-sidebar/src/plugins/ukui_notebook/SVG/删除-普通.svg0000644000175000017500000000113213642562542024674 0ustar fengfeng画板 134 副本ukui-sidebar/src/plugins/ukui_notebook/SVG/check.svg0000644000175000017500000000042513636027500021447 0ustar fengfeng画板 167ukui-sidebar/src/plugins/ukui_notebook/SVG/delete.svg0000644000175000017500000000113213636027500021630 0ustar fengfeng画板 134 副本ukui-sidebar/src/plugins/ukui_notebook/SVG/删除-点击.svg0000644000175000017500000000113413642562542024727 0ustar fengfeng画板 134 副本 5ukui-sidebar/src/plugins/ukui_notebook/SVG/新建-b-点击.svg0000644000175000017500000000127213642562542025274 0ustar fengfeng画板 140 副本 2ukui-sidebar/src/plugins/ukui_notebook/SVG/字体-悬停.svg0000644000175000017500000000041713642562542024721 0ustar fengfeng画板 149 副本ukui-sidebar/src/plugins/ukui_notebook/SVG/删除-b-普通.svg0000644000175000017500000000121413642562542025114 0ustar fengfeng画板 149 副本 12ukui-sidebar/src/plugins/ukui_notebook/SVG/导出pdf-悬停.svg0000644000175000017500000000242113642562542025441 0ustar fengfeng画板 149 副本 7ukui-sidebar/src/plugins/ukui_notebook/SVG/上锁-普通.svg0000644000175000017500000000047313642562542024664 0ustar fengfeng画板 134ukui-sidebar/src/plugins/ukui_notebook/SVG/上锁-悬停.svg0000644000175000017500000000050413642562542024625 0ustar fengfeng画板 134 副本 2ukui-sidebar/src/plugins/ukui_notebook/SVG/lock.svg0000644000175000017500000000047313636027500021325 0ustar fengfeng画板 134ukui-sidebar/src/plugins/ukui_notebook/SVG/新建-s-悬停.svg0000644000175000017500000000114613642562542025232 0ustar fengfeng画板 140 副本 4ukui-sidebar/src/plugins/ukui_notebook/SVG/exportPDF-hover.svg0000644000175000017500000000242113636027500023364 0ustar fengfeng画板 149 副本 7ukui-sidebar/src/plugins/ukui_notebook/SVG/导出pdf-普通.svg0000644000175000017500000000242113642562542025473 0ustar fengfeng画板 149 副本 6ukui-sidebar/src/plugins/ukui_notebook/SVG/exportJPG-click.svg0000644000175000017500000000314013636027500023334 0ustar fengfeng画板 149 副本 5ukui-sidebar/src/plugins/ukui_notebook/SVG/delete-b-hover.svg0000644000175000017500000000121413636027500023171 0ustar fengfeng画板 149 副本 13ukui-sidebar/src/plugins/ukui_notebook/SVG/delete-b-click.svg0000644000175000017500000000121313636027500023132 0ustar fengfeng画板 149 副本 14ukui-sidebar/src/plugins/ukui_notebook/SVG/insertTime-hover.svg0000644000175000017500000000137213636027500023640 0ustar fengfeng画板 149 副本 10ukui-sidebar/src/plugins/ukui_notebook/SVG/lock-click.svg0000644000175000017500000000050413636027500022403 0ustar fengfeng画板 134 副本 4ukui-sidebar/src/plugins/ukui_notebook/notebook_plugin.cpp0000644000175000017500000000275013637056631023127 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include notebook_plugin::notebook_plugin() { mp_notebook = new Widget; } void notebook_plugin::onNotification() { qDebug()<< "onNotification"; } void notebook_plugin::PluginsShowInterface() { if(Notebookflag) mp_notebook = new Widget; QDesktopWidget *desk = QApplication::desktop(); QRect deskRect = desk->availableGeometry(); mp_notebook->show(); mp_notebook->move((deskRect.width()-mp_notebook->width())/2, (deskRect.height()-mp_notebook->height())/2); Notebookflag = true; } notebook_plugin::~notebook_plugin() { if( mp_notebook) { delete mp_notebook; } mp_notebook = nullptr; } QWidget* notebook_plugin::centerWidget() { return mp_notebook; } ukui-sidebar/src/plugins/ukui_notebook/ukui_notebook.pro0000644000175000017500000000304713642562542022623 0ustar fengfeng#------------------------------------------------- # # Project created by QtCreator 2020-03-17T10:53:26 # #------------------------------------------------- QT += core gui printsupport sql greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = ukui_notebook TEMPLATE = lib CONFIG += plugin # The following define makes your compiler emit warnings if you use # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 DESTDIR = ../sidebarSmallPlugins INCLUDEPATH += ../../plugin-interface DISTFILES += notebook.json \ ukui_notebook_zh_CN.ts CONFIG += c++11 TRANSLATIONS += \ ukui_notebook_zh_CN.ts SOURCES += \ widget.cpp \ singleitemwidget.cpp \ ukui_notebook.cpp \ notebook_plugin.cpp HEADERS += \ widget.h \ singleitemwidget.h \ ukui_notebook.h \ sql_create.h \ notebook_plugin.h FORMS += \ widget.ui \ singleitemwidget.ui \ ukui_notebook.ui RESOURCES += \ ukui_notebook.qrc unix { target.path = /usr/lib/ukui-sidebar/sidebarSmallPlugins INSTALLS += target } ukui-sidebar/src/plugins/ukui_notebook/ukui_notebook_zh_CN.ts0000644000175000017500000001673313642562542023540 0ustar fengfeng QObject NoteBook 笔记本 笔记本 Open a notebook 新建笔记本 新建笔记本 SingleItemWidget Form Form Form Widget Widget Widget Widget Note 笔记 笔记 ukui_NoteBook Form Form Form Save 保存 保存 SaveAs 另存为 另存为 NoteBook 笔记本 笔记本 Tips 警告 警告 Failed to save file! 保存文件失败 保存文件失败 OK 确定 确定 Save current text 保存当前文本 保存当前文本 Yes No Cancel 取消 取消 Save File 保存文件 保存文件 Text File (*.txt*);; 文本文件 (*.txt*);; 文本文件 (*.txt*);; Text File(*.txt*);; 文本文件(*.txt*);; 文本文件(*.txt*);; Text content is empty 文本为空 文本为空 Text not modified 文本未修改 文本未修改 Open file 打开文件 打开文件 Text file (*.*);; 文本文件 (*.txt*);; 文本文件 (*.txt*);; Export pdf 导出Pdf 导出Pdf Pdf file(*.pdf);; Pdf文件(*.pdf);; Pdf文件(*.pdf);; Export picture 导出图片 导出图片 Images(*.jpg) 图片(*.jpg) 图片(*.jpg) Font selection 字体选择 字体选择 ukui-sidebar/src/plugins/ukui_notebook/widget.cpp0000644000175000017500000003007413642562542021213 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 load(QString(":/new/prefix1/translations/ukui_notebook_zh_CN.qm")); //选择翻译文件 QApplication::installTranslator(translator); } ui->setupUi(this); //createSql(); this->ukui_init(); this->ukui_conn(); //ukui_sql_init(); } Widget::~Widget() { delete ui; } void Widget::ukui_init() { //窗口属性 setWindowFlags(Qt::FramelessWindowHint);//开启窗口无边框 setWindowOpacity(0.8);//窗口透明度 this->setWindowTitle(tr("Note")); setWindowIcon(QIcon(":/new/prefix1/SVG/kylin-notebook.svg")); //组件属性 //ui->listWidget->setAttribute(Qt::WA_TranslucentBackground);//设置透明度 //ui->toolButton->setAttribute(Qt::WA_TranslucentBackground); //标题 ui->ukui_labelTitle->setStyleSheet("color:#ffffff; \ background-color: rgb(0, 0, 0);"); //按钮 ui->pushButton_Mini->setStyleSheet("QPushButton#pushButton_Mini{image: \ url(:/new/prefix1/SVG/dark_theme/min.svg);}" "QPushButton#pushButton_Mini:hover{image: \ url(:/new/prefix1/SVG/dark_theme/min-hover.svg);}" "QPushButton#pushButton_Mini:pressed{image: \ url(:/new/prefix1/SVG/dark_theme/min-click.svg);}" "border-radius:4px;"); ui->pushButton_Exit->setStyleSheet("QPushButton#pushButton_Exit{image: \ url(:/new/prefix1/SVG/dark_theme/close.svg);}" "QPushButton#pushButton_Exit:hover{image: \ url(:/new/prefix1/SVG/dark_theme/close-hover.svg);}" "QPushButton#pushButton_Exit:pressed{image: \ url(:/new/prefix1/SVG/dark_theme/close-click.svg);}" "border-radius:4px;"); ui->toolButton->setStyleSheet("QToolButton#toolButton{image:url(:/new/prefix1/SVG/new-b.svg);}" "QToolButton#toolButton:hover{image:url(:/new/prefix1/SVG/new-b-hover.svg);}" "QToolButton#toolButton:pressed{image:url(:/new/prefix1/SVG/new-b-click.svg);}"); //全局new ukui_notebook = new ukui_NoteBook; ukui_notebookOpen = new ukui_NoteBook; //搜索框 //ui->ukui_SearchLine->setToolTip(tr("搜索")); //ui->ukui_SearchLine->setText(tr("搜索")); /*********ListWidget init ************/ //ui->listWidget->setIconSize(QSize(16,16)); //ui->listWidget->setViewMode(QListWidget::IconMode);//设置图片文本 垂直显示 ui->listWidget->setMovement(QListWidget::Static); //ui->listWidget->openPersistentEditor();//设置item可编辑 //设置滚动条样式(使用.qss) //ui->listWidget->verticalScrollBar()->setCursor(Qt::PointingHandCursor); ui->listWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);//隐藏垂直滚动条 ui->listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);//隐藏水平滚动条 //ui->listWidget->verticalScrollBar()->setStyleSheet("QScrollBar{width:1px;}"); } void Widget::ukui_conn() { qDebug() << "conn"; connect(ui->pushButton_Exit,SIGNAL(clicked()),this,SLOT(exitSlot())); connect(ui->pushButton_Mini,SIGNAL(clicked()),this,SLOT(miniSlot())); //connect(ui->pushButton_Func,SIGNAL(clicked()),this,SLOT(editSlot())); connect(ui->toolButton,SIGNAL(clicked()),this,SLOT(newSlot())); connect(ui->listWidget,SIGNAL(itemDoubleClicked(QListWidgetItem*)),this,SLOT(listDoubleClickSlot())); //接收子窗口文件已保存信号 // qDebug() << "filesaved"; // connect(ukui_notebook,SIGNAL(fileSaved(QString)),this,SLOT(fileSavedSlot(QString))); qDebug() << "connect end"; } void Widget::ukui_sql_init(){ qDebug() << "ukui_sql_init"; model = new QSqlTableModel(this); model->setTable("fileInfo"); model->setEditStrategy(QSqlTableModel::OnManualSubmit); model->select(); //选取整个表的所有行 ukui_updateItem(); } //读取数据库,更新Item void Widget::ukui_updateItem(){ int rowNum = model->rowCount(); qDebug() << "ukui_updateItem" << rowNum; QString currentFileName; for(int txtNum = 0; txtNum < rowNum; txtNum++){ qDebug() << "txtNum = " << txtNum; item[txtNum] =new QListWidgetItem(); item[txtNum]->setSizeHint(QSize(569,74)); ui->listWidget->addItem(item[txtNum]); singleItem[txtNum]= new SingleItemWidget(ui->listWidget); ui->listWidget->setItemWidget(item[txtNum],singleItem[txtNum]); //读取数据库,设置label值 QDateTime dateTime = QDateTime::currentDateTime();//获取当前系统时间 currentFileName = model->index(txtNum,0).data().toString(); QFile currentFile(currentFileName); qDebug() << "currentFile """ << currentFile; qDebug() << "currentfilename ::" << currentFileName; if(!currentFile.open(QIODevice::ReadOnly | QIODevice::Text)) qDebug() << "open file failed"; QTextStream aStream(¤tFile);//用文本流读取文件 aStream.setAutoDetectUnicode(true);//自动检测unicode,才能显示汉字 singleItem[txtNum]->ui->textEdit_Item->setPlainText(aStream.readAll()); qDebug() << "文本内容" << singleItem[txtNum]->ui->textEdit_Item->document()->toPlainText(); singleItem[txtNum]->ui->textEdit_ItemDate->setText(dateTime.toString("yyyy/MM/dd hh:mm")); //singleItem[txtNum]->ui->textEdit_ItemDate->setText(model->index(txtNum,1).data().toString()); qDebug() << "时间" << singleItem[txtNum]->ui->textEdit_ItemDate->document()->toPlainText(); currentFile.close(); //子窗口Del点击事件 connect(singleItem[txtNum],SIGNAL(childDelEvent()),this,SLOT(listDelSingleSlot())); } } //添加Item,保存到数据库 void Widget::ukui_addItem(){ rowNum = model->rowCount(); QDateTime dateTime = QDateTime::currentDateTime();//获取当前系统时间 qDebug() << "添加Item,保存到数据库"; qDebug() << "ukui_addItem rowNum = " << rowNum; qDebug() << "ukui_addItem filename = " << filename; model->insertRow(rowNum); model->setData(model->index(rowNum, 0), filename); //model->setData(model->index(rowNum, 1), dateTime); model->submitAll(); model->setTable("fileInfo"); model->select(); qDebug() << "model->rowNum 0 = " << model->index(rowNum, 0).data().toString(); //qDebug() << "model->rowNum 1 = " << model->index(rowNum, 1).data().toString(); for(int i=0; i < rowNum; i++) { delete item[i]; delete singleItem[i]; } ukui_updateItem(); } void Widget::mouseMoveEvent(QMouseEvent *event) { if (event->buttons() & Qt::LeftButton) { move(event->globalPos() - m_lastPoint); event->accept(); } } void Widget::mousePressEvent(QMouseEvent *event) { if(event->button() == Qt::LeftButton) { emit this->listItemClicked(index); } if (event->button() == Qt::LeftButton) { m_lastPoint = event->globalPos() - frameGeometry().topLeft(); event->accept(); } } //********************Slots************************// void Widget::exitSlot(){ this->close(); } void Widget::miniSlot() { this->showMinimized(); } void Widget::editSlot() { qDebug() << "edit"; } void Widget::newSlot() { qDebug() << "widget new"; //aItem = new QListWidgetItem; //aItem->setText("new"); //aItem->setIcon(QIcon(":/计时器.png")); //aItem->setCheckState(Qt::Unchecked); //aItem->setTextAlignment(Qt::AlignCenter);//文本居中 // aItem = new QListWidgetItem; // aItem->setSizeHint(QSize(569,74)); // ui->listWidget->addItem(aItem); // SingleItemWidget *s= new SingleItemWidget(ui->listWidget); // ui->listWidget->setItemWidget(aItem,s); //新建一个笔记本 ukui_notebook = new ukui_NoteBook; ukui_notebook->show(); qDebug() << "子窗口向父窗口传filename参数"; connect(ukui_notebook,SIGNAL(fileSaved(QString)),this,SLOT(fileSavedSlot(QString))); } void Widget::listDoubleClickSlot() { connect(ukui_notebook,SIGNAL(fileSaved(QString)),this,SLOT(fileSavedSlot(QString))); QString currentFileName; qDebug() << "listDoubleclick"; qDebug() << "currentRow" << ui->listWidget->currentRow(); //获取当前选中的item下标 //打开下标对应数据库中存储的文件路径加名称 currentFileName = model->index(ui->listWidget->currentRow(), 0).data().toString(); QFile currentFile(currentFileName); qDebug() << "listDoubleclick currentFileName = " << currentFileName; if(!currentFile.open(QIODevice::ReadOnly | QIODevice::Text)) qDebug() << "open file failed"; QTextStream aStream(¤tFile);//用文本流读取文件 aStream.setAutoDetectUnicode(true);//自动检测unicode,才能显示汉字 ukui_notebookOpen->ui->textEdit->setPlainText(aStream.readAll()); currentFile.close(); ukui_notebookOpen->show(); // //得到路径不为空 // if(!currentFileName.isEmpty()){ // QFile *file = new QFile; // file->setFileName(currentFileName); // qDebug() << "!!!!!!!!!"; // bool isOpen = file->open(QIODevice::ReadOnly); // qDebug() << "isopen = "<< isOpen; // if(isOpen){ // qDebug() << "adsqweqdqwd"; // ukui_notebook->textEdit->clear(); // qDebug() << "adsqwe1111111111"; // QTextStream in(file); // qDebug() << "adsqwe"; // while (!in.atEnd()) { // ukui_notebook->textEdit->append(in.readLine()); // //光标移动到开始位置 // ukui_notebook->textEdit->moveCursor(QTextCursor::Start); // } // //已读完 // fileContent = ukui_notebook->textEdit->document()->toPlainText(); // qDebug() << "adsqwe!!!!!!!!!!!1"; // file->close(); // } // } } void Widget::listDelSingleSlot(){ qDebug() << "del list"; //获取列表项的指针 //QListWidgetItem *item = ui->listWidget->takeItem(ui->listWidget->currentRow()); int num=ui->listWidget->currentRow(); int rowNum = model->rowCount(); qDebug() << rowNum <<" ======================================----"; qDebug() << num<<" ====================================="; //QObject::sender()返回发送信号的对象的指针 //QPushButton *btn = qobject_cast(QObject::sender()); model->removeRows(num, 1); qDebug() << "delete " <submitAll(); //提交 ukui_updateItem(); rowNum = model->rowCount(); qDebug() << rowNum; //delete item; //释放指针所指向的列表项 } void Widget::fileSavedSlot(QString data) { qDebug() << "fileSavedSlot"; filename = data; qDebug() << "fileSavedSlot filename = " << data; //ukui_addItem(); } ukui-sidebar/src/plugins/ukui_notebook/main.cpp0000644000175000017500000000042513642562542020651 0ustar fengfeng#include "widget.h" #include #include "sql_create.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); if(!createConnection()) return 1; Widget w; w.setAttribute(Qt::WA_TranslucentBackground); w.show(); return a.exec(); } ukui-sidebar/src/plugins/ukui_notebook/ukui_notebook.ui0000644000175000017500000001205713642562542022441 0ustar fengfeng ukui_NoteBook 0 0 400 342 Form background-color: rgb(0, 0, 0); border:1px solid rgba(255, 255, 255, 0.05); 20 10 30 30 image: url(:/new/prefix1/SVG/new-b.svg); border-width:0; border-style:outset 350 10 30 30 image: url(:/new/prefix1/SVG/dark_theme/close.svg); border-width:0; border-style:outset; background-color: rgb(0, 0, 0); 10 60 380 204 background-color: rgb(165, 165, 165); border-radius:4px; 10 280 380 48 background-color: rgb(141, 141, 141); 10 10 24 24 image: url(:/new/prefix1/SVG/font.svg); border-width:0; border-style:outset; 50 10 24 24 image: url(:/new/prefix1/SVG/exportJPG.svg); border-width:0; border-style:outset; 90 10 24 24 image: url(:/new/prefix1/SVG/exportPDF.svg); border-width:0; border-style:outset; 130 10 24 24 image: url(:/new/prefix1/SVG/insertTime.svg); border-width:0; border-style:outset; 170 10 24 24 image: url(:/new/prefix1/SVG/delete.svg); border-width:0; border-style:outset; 210 10 70 30 background:rgba(61,107,229,1); border-radius:4px; Save 300 10 70 30 background:rgba(61,107,229,1); border-radius:4px; SaveAs ukui-sidebar/src/plugins/ukui_notebook/singleitemwidget.cpp0000644000175000017500000000374013642562542023274 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 setupUi(this); SingleItem_init(); SingleItem_conn(); } SingleItemWidget::~SingleItemWidget() { delete ui; } void SingleItemWidget::SingleItem_conn() { connect(ui->toolButtonDel,SIGNAL(clicked()),this,SLOT(clickDelBtn())); } //void SingleItemWidget::paintEvent(QPaintEvent *) //{ // QStyleOption opt; // opt.init(this); // QPainter p(this); // p.setBrush(QBrush(QColor("#161617"))); // p.setOpacity(0.42); // p.setPen(Qt::NoPen); // p.drawRoundedRect(opt.rect,0,0); // p.drawRect(opt.rect); // style()->drawPrimitive(QStyle::PE_Widget,&opt,&p,this); //} /****************Slots*******************/ void SingleItemWidget::clickDelBtn() { qDebug() << "child click del"; emit childDelEvent(); } void SingleItemWidget::SingleItem_init() { qDebug() << ""; // //设置图片大小 // ui->toolButtonDel->setIconSize(QSize(12,16)); // ui->toolButtonLock->setIconSize(QSize(12,16)); //文本框属性 ui->textEdit_Item->setReadOnly(true);//只读 //ui->textEdit_Item->setFocusPolicy(Qt::NoFocus);//无焦点 ui->textEdit_ItemDate->setReadOnly(true); } ukui-sidebar/src/plugins/ukui_notebook/singleitemwidget.ui0000644000175000017500000000406713642562542023132 0ustar fengfeng SingleItemWidget 0 0 569 74 Form width:569px; height:74px; background:rgba(255,255,255,1); opacity:0.04; 490 20 34 34 border-image: url(:/new/prefix1/SVG/删除-b-普通.svg); background-color: rgb(0, 0, 0); opacity:0.12; border-radius:3px; 0 74 571 1 border:1px solid rgba(255,255,255,1); color: rgb(255, 255, 255); opacity:0.08; QFrame::StyledPanel QFrame::Raised 160 20 271 31 20 20 111 31 ukui-sidebar/src/plugins/ukui_notebook/ukui_notebook.qrc0000644000175000017500000000435313642562542022611 0ustar fengfeng SVG/new-s.svg SVG/new-s-hover.svg SVG/new-s-click.svg SVG/new-b.svg SVG/new-b-hover.svg SVG/new-b-click.svg SVG/lock.svg SVG/lock-hover.svg SVG/lock-click.svg SVG/insertTime.svg SVG/insertTime-hover.svg SVG/insertTime-click.svg SVG/font.svg SVG/font-hover.svg SVG/font-click.svg SVG/exportPDF.svg SVG/exportPDF-hover.svg SVG/exportPDF-click.svg SVG/exportJPG.svg SVG/exportJPG-hover.svg SVG/exportJPG-click.svg SVG/delete.svg SVG/delete-hover.svg SVG/delete-click.svg SVG/delete-b.svg SVG/delete-b-hover.svg SVG/delete-b-click.svg SVG/check.svg SVG/light_theme/reduction.svg SVG/light_theme/more.svg SVG/light_theme/min.svg SVG/light_theme/max.svg SVG/light_theme/close.svg SVG/dark_theme/reduction.svg SVG/dark_theme/reduction-hover.svg SVG/dark_theme/reduction-click.svg SVG/dark_theme/more.svg SVG/dark_theme/more-hover.svg SVG/dark_theme/more-click.svg SVG/dark_theme/min.svg SVG/dark_theme/min-hover.svg SVG/dark_theme/min-click.svg SVG/dark_theme/max.svg SVG/dark_theme/max-hover.svg SVG/dark_theme/max-click.svg SVG/dark_theme/close.svg SVG/dark_theme/close-hover.svg SVG/dark_theme/close-click.svg SVG/kylin-notebook.svg translations/ukui_notebook_zh_CN.qm ukui-sidebar/src/plugins/ukui_notebook/ukui_notebook.h0000644000175000017500000000473213642562542022254 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include #include #include #include #include #include #include #include #include namespace Ui { class ukui_NoteBook; } class ukui_NoteBook : public QWidget { Q_OBJECT public: explicit ukui_NoteBook(QWidget *parent = nullptr); ~ukui_NoteBook(); signals: void listItemClicked(int); void fileSaved(QString); public: QString fileName;//文件路径 Ui::ukui_NoteBook *ui; private slots: //新建文件 void newFileSlot(); //退出软件 void exitFileSlot(); //插入时间/日期 void insertTimeDateSlot(); //新建窗口 void newWindowsSlot(); //打开文件前的判断 void openFileSlot(); //保存文件 void saveFileSlot(); //文件另存为 void saveFileAsSlot(); //文本保存状态 void textStatusSlot(); //导出pdf void exportPdfSlot(); //导出jpg/png void exportJpgSlot(); //字体 void fontChooseSlot(); private: //Ui::ukui_NoteBook *ui; ukui_NoteBook *notebook; QString fileContent;//读到的文件内容 QSettings *setting; int index; QPoint m_lastPoint;//记录鼠标位置 //保存文本到文件 void saveTextToFile(); //初始化 void ukuiNoteBook_init(); //关联槽函数 void ukuiNoteBook_connect(); //打开文件 void realOpenFile(); //保存文件 void saveFile(); //设置快捷键 void ukui_setShortCut(); void mouseMoveEvent(QMouseEvent *event); void mousePressEvent(QMouseEvent *event); void paintEvent(QPaintEvent *); }; #endif // UKUI_NOTEBOOK_H ukui-sidebar/src/plugins/ukui_notebook/notebook.json0000644000175000017500000000002513635342602021723 0ustar fengfeng{ "Keys" : [ ] } ukui-sidebar/src/plugins/ukui_notebook/notebook_plugin.h0000644000175000017500000000455713637056631022603 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 class notebook_plugin : public QObject, public SidebarSmallPluginInterface { Q_OBJECT //Q_INTERFACES宏用于告诉Qt该类实现的接口 Q_INTERFACES(SidebarSmallPluginInterface) //Q_PLUGIN_METADATA宏用于描述插件元数据 Q_PLUGIN_METADATA(IID SidebarSmallPluginInterface_iid FILE "notebook.json") public: bool Notebookflag = false; notebook_plugin(); ~notebook_plugin(); //plugin implement 统一接口 const QString name() override {return QObject::tr("NoteBook");} PluginType pluginType() override {return PluginType::SmallPlugin;} const QString description() override {return QObject::tr("Open a notebook");} const QIcon icon() override {return QIcon::fromTheme("notebook", QIcon::fromTheme("noteBook",QIcon(":/new/prefix1/SVG/kylin-notebook.svg")));} void setEnable(bool enable) override {Q_UNUSED(enable)} bool isEnable() override {return true;} virtual int PluginButtonLocation_X() override {return 0;} virtual int PluginButtonLocation_Y() override {return 3;} virtual QString PluginButtonName() override {return QObject::tr("NoteBook");} virtual int pluginsLoadingSequence() override {return 2;} virtual QString PluginIconName() override {return QObject::tr("NoteBook");} virtual int PluginIconSize_W() override {return 48;} virtual int PluginIconSize_H() override {return 48;} virtual void PluginsShowInterface() override; QWidget* mp_notebook; QWidget* centerWidget(); void onNotification() ; signals: void notebook_ification(); }; #endif // NOTEBOOK_PLAGIN_H ukui-sidebar/src/plugins/notification_plugin/0000755000175000017500000000000013642562542020407 5ustar fengfengukui-sidebar/src/plugins/notification_plugin/scrollareawidget.cpp0000644000175000017500000001025713634067640024453 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 verticalScrollBar()->setStyleSheet("QScrollBar::vertical {width:10px;padding-left:3px;padding-top:0px;padding-right:3px;padding-bottom:0px;background:transparent;border-radius:6px;}" "QScrollBar::handle:vertical {width:4px;background-color:rgba(61,61,65,1);border-radius:2px;}" "QScrollBar::sub-line:vertical {background-color:transparent;height:0px;width:0px;}" "QScrollBar::add-line:vertical {background-color:transparent;height:0px;width:0px;}"); return; } void ScrollAreaWidget::leaveEvent(QEvent *event) { Q_UNUSED(event); this->verticalScrollBar()->setStyleSheet("QScrollBar::vertical {width:10px;padding-left:3px;padding-top:0px;padding-right:3px;padding-bottom:0px;background:transparent;border-radius:6px;}" "QScrollBar::handle:vertical {width:4px;background-color:transparent;border-radius:2px;}" "QScrollBar::sub-line:vertical {background-color:transparent;height:0px;width:0px;}" "QScrollBar::add-line:vertical {background-color:transparent;height:0px;width:0px;}"); return; } ukui-sidebar/src/plugins/notification_plugin/qss/0000755000175000017500000000000013642562542021215 5ustar fengfengukui-sidebar/src/plugins/notification_plugin/qss/notification_plugin.css0000755000175000017500000001365213642562542026005 0ustar fengfeng/*QPalette{background:#1A1A1A;}*{outline:1px;color:rgba(255, 255, 255, 0.05);}*/ QWidget{ margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; /* background:rgba(26,26,26,0.95);*/ } QWidget#NotificationCenter{ background:rgba(19,19,20,0.7); } QWidget#SingleNotification{ background:rgba(255,255,255,0.12); border-radius:6px; } QWidget#QScrollAreaInQWidget{ background:rgba(19,19,20,0.7); } QWidget#BaseMap{ background:rgba(255,255,255,0.06); width:360px; height:6px; border-radius:0px 0px 6px 6px; } /*QWidget#NotificationCenter{ margin-left: 10px; margin-top: 21px; margin-right: 0px; margin-bottom: 0px; width:400px; }*/ /*QWidget#NotificationName{ margin-left: 11px; margin-top: 0px; margin-right: 28px; margin-bottom: 0px; width:390px; }*/ QToolButton#takein{ border:0px solid #242424; padding:0px; background:transparent; /* background:rgba(238,238,238,1);*/ /* width:24px; height:30px;*/ } QPushButton{ color:rgba(255,255,255,1); font-size:14px; font-family:Noto Sans CJK SC; /* background:transparent;*/ } QPushButton#clearall{ color:rgba(255,255,255,0.91); font-weight:400; border:0px; line-height:24px; /* padding:0px;*/ font-size:14px; width:80px; height:34px; } QPushButton:hover#clearall{ color:rgba(255,255,255,0.91); font-weight:400; border:0px; line-height:24px; background:rgba(255,255,255,0.12); font-size:14px; width:80px; height:34px; border-radius:3px; } QPushButton:pressed#clearall{ color:rgba(255,255,255,0.91); font-weight:400; border:0px; line-height:24px; background:rgba(255,255,255,0.08); font-size:14px; width:80px; height:34px; border-radius:3px; } QPushButton#setting{ color:rgba(255,255,255,0.91); font-weight:400; border:0px; line-height:24px; font-size:14px; width:80px; height:34px; } QPushButton:hover#setting{ color:rgba(255,255,255,0.91); font-weight:400; border:0px; line-height:24px; background:rgba(255,255,255,0.12); font-size:14px; width:80px; height:34px; border-radius:3px; } QPushButton:pressed#setting{ color:rgba(255,255,255,0.91); font-weight:400; border:0px; line-height:24px; background:rgba(255,255,255,0.08); font-size:14px; width:80px; height:34px; border-radius:3px; } QPushButton#takein{ color:rgba(255,255,255,231); font-weight:400; border:0px; /* background:transparent; background:rgba(238,238,238,1);*/ width:184px; height:34px; } QPushButton:hover#takein{ color:rgba(255,255,255,231); font-weight:400; border:0px; background:rgba(255,255,255,0.12); width:184px; height:34px; } QPushButton#delete{ color:rgba(255,255,255,231); font-weight:400; border:0px; /* background:transparent; background:rgba(238,238,238,1);*/ width:184px; height:34px; } QPushButton:hover#delete{ color:rgba(255,255,255,231); font-weight:400; border:0px; background:rgba(255,255,255,0.12); width:184px; height:34px; } QPushButton#fold{ color:rgba(107,142,235,0.91); font-weight:400; border:0px; font-size:14px; } QPushButton:hover#fold{ color:rgba(151,175,241,0.91); font-weight:400; border:0px; font-size:14px; } QPushButton:pressed#fold{ color:rgba(61,107,229,0.91); font-weight:400; border:0px; font-size:14px; } QLabel{ color:#FFFFFF; /*文字颜色*/ font-family:NotoSansCJKsc-Regular; background-color:transparent; } QLabel#notificationcentername{ color:rgba(255,255,255,247); /*文字颜色*/ font-family : NotoSansCJKsc-Regular; font-size:20px; } QLabel#importantnotification{ color:rgba(255,255,255,0.91); /*文字颜色*/ font-family : NotoSansCJKsc-Regular; font-size:14px; } QLabel#AppName{ color:rgba(255,255,255,0.57); /*文字颜色*/ font-size:14px; background-color:transparent; width:84px; } QLabel#pushtime{ color:rgba(255,255,255,0.57); /*文字颜色*/ font-size:14px; } QLabel#Summary{ color:rgba(255,255,255,0.97); /*文字颜色*/ font-size:16px; } QLabel#body{ color:rgba(255,255,255,0.57); /*文字颜色*/ font-size:14px; background-color:transparent; padding:0px; /* height:24px;*/ } QLabel#ShowLeftItem{ color:rgba(255,255,255,0.35); font-size:14px; padding:0px; } QLabel#takeincout{ font-size:11px; background-color:rgba(61,107,229,1); border-radius:6px; } QScrollBar:horizontal{ background:#484848; padding:0px; border-radius:6px; max-height:12px; } QScrollBar::handle:horizontal{ background:#242424; min-width:50px; border-radius:6px; } QScrollBar::handle:horizontal:hover{ background:#00BB9E; } QScrollBar::handle:horizontal:pressed{ background:#00BB9E; } QScrollBar::add-page:horizontal{ background:none; } QScrollBar::sub-page:horizontal{ background:none; } QScrollBar::add-line:horizontal{ background:none; } QScrollBar::sub-line:horizontal{ background:none; } QScrollBar:vertical{ background:#484848; padding:0px; border-radius:6px; max-width:12px; } QScrollBar::handle:vertical{ background:#242424; min-height:50px; border-radius:6px; } QScrollBar::handle:vertical:hover{ background:#00BB9E; } QScrollBar::handle:vertical:pressed{ background:#00BB9E; } QScrollBar::add-page:vertical{ background:none; } QScrollBar::sub-page:vertical{ background:none; } QScrollBar::add-line:vertical{ background:none; } QScrollBar::sub-line:vertical{ background:none; } QScrollArea{ border:0px; } ukui-sidebar/src/plugins/notification_plugin/diypropertyanimation.h0000644000175000017500000000220513634067640025051 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 class DiyPropertyAnimation : public QPropertyAnimation { Q_OBJECT public: explicit DiyPropertyAnimation(QObject *target, const QByteArray &propertyName, QObject *parent = nullptr); protected: virtual void updateCurrentValue(const QVariant &value) override; signals: void Sig_currentRect(int, int, int, int); }; #endif // DIYPROPERTYANIMATION_H ukui-sidebar/src/plugins/notification_plugin/notification_plugin.qrc0000644000175000017500000000107213634067640025162 0ustar fengfeng qss/notification_plugin.css images/hover.svg images/hover-translucent.svg images/box-14-translucent.svg images/box-16-translucent.svg images/box-16.svg images/box-24.svg images/exitbox-14-translucent.svg images/exitbox-16-translucent.svg images/exitbox-16.svg images/exitbox-24.svg ukui-sidebar/src/plugins/notification_plugin/buttonwidget.h0000644000175000017500000000324013642562542023276 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include class SingleMsg; class QSvgRenderer; class ButtonWidget : public QWidget { Q_OBJECT public: explicit ButtonWidget(QString strIcon, QString strHoverIcon, QString strPressIcon); protected: virtual void enterEvent(QEvent *event) override; virtual void leaveEvent(QEvent *event) override; virtual void mousePressEvent(QMouseEvent *event) override; virtual void mouseReleaseEvent(QMouseEvent *event) override; private: QLabel* m_ToolButton; QSvgRenderer* m_pTakeinSvgRender; QPixmap* m_pTakeinPixmap; //收纳默认或悬停时的像素 QPixmap* m_pTakeinPressPixmap; //收纳点击时的像素 bool m_bTakeInFlag; QString m_strIcon; QString m_strHoverIcon; QString m_strPressIcon; signals: void Sig_clicked(); public slots: }; #endif // BUTTONWIDGET_H ukui-sidebar/src/plugins/notification_plugin/scrollareawidget.h0000644000175000017500000000245113626422413024107 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include class ScrollBarWidget : public QScrollBar { Q_OBJECT public: explicit ScrollBarWidget(); protected: virtual void enterEvent(QEvent *event) override; virtual void leaveEvent(QEvent *event) override; signals: public slots: }; class ScrollAreaWidget : public QScrollArea { Q_OBJECT public: explicit ScrollAreaWidget(); protected: virtual void enterEvent(QEvent *event) override; virtual void leaveEvent(QEvent *event) override; signals: public slots: }; #endif // SCROLLAREAWIDGET_H ukui-sidebar/src/plugins/notification_plugin/monitorthread.h0000644000175000017500000000257013642562542023443 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include class NotificationPlugin; class QProcess; class QTimer; class MonitorThread : public QThread { Q_OBJECT public: MonitorThread(NotificationPlugin *parent); void run(); //线程入口函数(工作线程的主函数) void extractData(QString strOutput); private: NotificationPlugin* m_parent; //传一个插件对象指针,用来回传槽函数 QProcess* m_pProcess; signals: void Sig_Notify(QString, QString, QString, QString, QDateTime, bool); public slots: void readOutputData(); }; #endif // MONITORTHREAD_H ukui-sidebar/src/plugins/notification_plugin/diypropertyanimation.cpp0000644000175000017500000000221613634067640025406 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include DiyPropertyAnimation::DiyPropertyAnimation(QObject *target, const QByteArray &propertyName, QObject *parent) : QPropertyAnimation(target, propertyName, parent) { } void DiyPropertyAnimation::updateCurrentValue(const QVariant &value) { QRect rect = value.value(); int x1, y1, x2, y2; rect.getRect(&x1, &y1, &x2, &y2); emit Sig_currentRect(x1, y1, x2, y2); return; } ukui-sidebar/src/plugins/notification_plugin/takeinboxtoolbutton.h0000644000175000017500000000226313634067640024701 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include class TakeInBoxToolButton : public QToolButton { Q_OBJECT public: explicit TakeInBoxToolButton(); void setEnterFlags(bool bFlags) {m_bEnterTakeInBox = bFlags;} protected: virtual void enterEvent(QEvent *event) override; virtual void leaveEvent(QEvent *event) override; private: bool m_bEnterTakeInBox; }; #endif // TAKEINBOXTOOLBUTTON_H ukui-sidebar/src/plugins/notification_plugin/buttonwidget.cpp0000644000175000017500000000631513642562542023637 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include #include #include ButtonWidget::ButtonWidget(QString strIcon, QString strHoverIcon, QString strPressIcon) { m_strIcon = strIcon; m_strHoverIcon = strHoverIcon; m_strPressIcon = strPressIcon; this->setFixedWidth(24); this->setFixedHeight(24); this->setStyleSheet("border:none;border-style:none;padding:0px;background:transparent;width:24px;height:24px;"); QVBoxLayout* pVBoxLayout = new QVBoxLayout; pVBoxLayout->setContentsMargins(0,0,0,0); pVBoxLayout->setSpacing(0); m_ToolButton = new QLabel; m_pTakeinSvgRender = new QSvgRenderer(m_ToolButton); m_pTakeinSvgRender->load(m_strIcon); m_pTakeinPixmap = new QPixmap(16, 16); m_pTakeinPressPixmap = new QPixmap(14, 14); m_pTakeinPixmap->fill(Qt::transparent); QPainter takeinPainter(m_pTakeinPixmap); m_pTakeinSvgRender->render(&takeinPainter); m_ToolButton->setPixmap(*m_pTakeinPixmap); pVBoxLayout->addWidget(m_ToolButton, 0, Qt::AlignHCenter | Qt::AlignVCenter); this->setLayout(pVBoxLayout); return; } void ButtonWidget::enterEvent(QEvent *event) { Q_UNUSED(event); m_pTakeinSvgRender->load(m_strHoverIcon); m_pTakeinPixmap->fill(Qt::transparent); QPainter takeinPainter(m_pTakeinPixmap); m_pTakeinSvgRender->render(&takeinPainter); m_ToolButton->setPixmap(*m_pTakeinPixmap); return; } void ButtonWidget::leaveEvent(QEvent *event) { Q_UNUSED(event); m_pTakeinSvgRender->load(m_strIcon); m_pTakeinPixmap->fill(Qt::transparent); QPainter takeinPainter(m_pTakeinPixmap); m_pTakeinSvgRender->render(&takeinPainter); m_ToolButton->setPixmap(*m_pTakeinPixmap); return; } //鼠标点击事件 void ButtonWidget::mousePressEvent(QMouseEvent *event) { if (event->buttons() == Qt::LeftButton) { m_pTakeinSvgRender->load(m_strPressIcon); m_pTakeinPressPixmap->fill(Qt::transparent); QPainter takeinPainter(m_pTakeinPressPixmap); m_pTakeinSvgRender->render(&takeinPainter); m_ToolButton->setPixmap(*m_pTakeinPressPixmap); } return; } void ButtonWidget::mouseReleaseEvent(QMouseEvent *event) { int x = event->x(); int y = event->y(); qDebug()<<"ButtonWidget::mouseReleaseEvent" <= 0 && x <= 24 && y >= 0 && y<=24) { emit Sig_clicked(); } return; } ukui-sidebar/src/plugins/notification_plugin/takeinboxtoolbutton.cpp0000644000175000017500000000264413642562542025237 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 TakeInBoxToolButton::TakeInBoxToolButton() { m_bEnterTakeInBox = false; } void TakeInBoxToolButton::enterEvent(QEvent *event) { Q_UNUSED(event); //设置边框, 边框色, 背景色, 字体色, 字号 setStyleSheet("QToolTip{border:1px solid rgba(255, 255, 255, 0.2); background-color: #1A1A1A; color:#FFFFFF; padding:4px; border-radius:6px; font-size:12px;}"); if(false == m_bEnterTakeInBox) { this->setToolTip(QString::fromLocal8Bit("进入收纳盒")); } else { this->setToolTip(QString::fromLocal8Bit("退出收纳盒")); } return; } void TakeInBoxToolButton::leaveEvent(QEvent *event) { Q_UNUSED(event); return; } ukui-sidebar/src/plugins/notification_plugin/notification_plugin.h0000644000175000017500000000720213640375251024622 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 class AppMsg; class SingleMsg; class ScrollAreaWidget; class QSvgRenderer; class TakeInBoxToolButton; class NotificationPlugin : public QObject, public NotificationInterface { Q_OBJECT //Q_INTERFACES宏用于告诉Qt该类实现的接口 Q_INTERFACES(NotificationInterface) //Q_PLUGIN_METADATA宏用于描述插件元数据 Q_PLUGIN_METADATA(IID NotificationInterface_iid FILE "notification_plugin.json") //申明该类有D-BUS服务接口 //Q_CLASSINFO("D-Bus Interface", "com.scorpio.test.value") public: NotificationPlugin(); virtual QWidget* centerWidget() override; virtual void showNotification() override; virtual void hideNotification() override; AppMsg* getAppMsgAndIndexByName(QString strAppName, int& nIndex); AppMsg* getTakeinAppMsgAndIndexByName(QString strAppName, int& nIndex); private: QWidget* m_pMainWidget; QList m_listAppMsg; //对于SingleMsg类对象用list表记录 QList m_listTakeInAppMsg; ScrollAreaWidget* m_pQScrollAreaNotify; //通知列表ScrollAreaWidget QVBoxLayout* m_pScrollAreaNotifyVBoxLayout; ScrollAreaWidget* m_pQScrollAreaTakeIn; //收纳列表ScrollAreaWidget QVBoxLayout* m_pScrollAreaTakeInVBoxLayout; QLabel* m_pMessageCenterLabel; QLabel* m_pTakeinMessageCenterLabel; bool m_bShowTakeIn; QLabel* m_pNotificationLabel; //重要的通知和不重要的通知标签 QSvgRenderer* m_pSvgRender; TakeInBoxToolButton* m_pTakeInBoxToolButton; QPixmap* m_pPixmap; QLabel* m_pTakeInCoutLabel; //收纳盒计数统计Label signals: void Sig_onNewNotification(); private slots: uint onAddSingleNotify(QString strAppName, QString strIconPath, QString strSummary, QString strBody, QDateTime dateTime, bool bNewNotificationFlag); //处理新增单条通知 void onTakeInSingleNotify(QString strAppName, QString strIcon, QString strSummary, QString strBody, QDateTime dateTime); //处理收纳单条通知 void onClearAllMessage(); //清除所有消息 void onClearAppMsg(AppMsg* pAppMsg); //处理删除通知应用消息槽函数 void onClearTakeInAppMsg(AppMsg* pAppMsg); //处理删除收纳应用的槽函数 void onShowTakeInMessage(); //切换至收纳盒 void onCallControlPanel(); //调用控制面板 void onCountTakeInBitAndUpate(); //统计收纳位数并更新至右上角提示 }; #endif // NOTIFICATION_PLUGIN_H ukui-sidebar/src/plugins/notification_plugin/notification_plugin.json0000644000175000017500000000002513626422413025335 0ustar fengfeng{ "Keys" : [ ] } ukui-sidebar/src/plugins/notification_plugin/monitorthread.cpp0000644000175000017500000000726013642562542023777 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 moveToThread(this); } void MonitorThread::extractData(QString strOutput) { QString strOutputTmp = strOutput; //app名的获取 int nIndex = strOutputTmp.indexOf("\""); if(-1 == nIndex) { return; } strOutputTmp = strOutputTmp.mid(nIndex + 1); nIndex = strOutputTmp.indexOf("\""); if(-1 == nIndex) { return; } QString strAppName = strOutputTmp.mid(0, nIndex); strOutputTmp = strOutputTmp.mid(nIndex + 1); if("notify-send" == strAppName) { strAppName = "未知来源"; } //图标路径的获取 nIndex = strOutputTmp.indexOf("\""); if(-1 == nIndex) { return; } strOutputTmp = strOutputTmp.mid(nIndex + 1); nIndex = strOutputTmp.indexOf("\""); if(-1 == nIndex) { return; } QString strIcon = strOutputTmp.mid(0, nIndex); strOutputTmp = strOutputTmp.mid(nIndex + 1); if("" == strIcon) { strIcon = "/usr/share/icons/ukui-icon-theme/24x24/mimetypes/application-x-desktop.png"; } //主题的获取 nIndex = strOutputTmp.indexOf("\""); if(-1 == nIndex) { return; } strOutputTmp = strOutputTmp.mid(nIndex + 1); nIndex = strOutputTmp.indexOf("\""); if(-1 == nIndex) { return; } QString strSummary = strOutputTmp.mid(0, nIndex); strOutputTmp = strOutputTmp.mid(nIndex + 1); //正文的获取 nIndex = strOutputTmp.indexOf("\""); if(-1 == nIndex) { return; } strOutputTmp = strOutputTmp.mid(nIndex + 1); nIndex = strOutputTmp.indexOf("\""); if(-1 == nIndex) { return; } QString strBody = strOutputTmp.mid(0, nIndex); strOutputTmp = strOutputTmp.mid(nIndex + 1); QDateTime dateTime(QDateTime::currentDateTime()); emit Sig_Notify(strAppName, strIcon, strSummary, strBody, dateTime, true); return; } void MonitorThread::readOutputData() { QByteArray output = m_pProcess->readAllStandardOutput(); QString str_output = output; if(str_output.isEmpty()) { return; } //qDebug()< 0); return; } void MonitorThread::run() { system("killall dbus-monitor"); m_pProcess = new QProcess(); m_pProcess->start("dbus-monitor interface=org.freedesktop.Notifications"); QTimer* pTimer = new QTimer(); connect(pTimer, SIGNAL(timeout()), this, SLOT(readOutputData())); pTimer->start(1000); connect(this, SIGNAL(Sig_Notify(QString, QString, QString, QString, QDateTime, bool)), m_parent, SLOT(onAddSingleNotify(QString, QString, QString, QString, QDateTime, bool))); exec(); } ukui-sidebar/src/plugins/notification_plugin/notification_plugin.cpp0000644000175000017500000004541113642562542025164 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 NotificationPlugin::NotificationPlugin() { m_bShowTakeIn = false; m_pMainWidget = new QWidget; m_pMainWidget->setObjectName("NotificationCenter"); //获取系统语言环境,加载语言翻译 QLocale locale; if (locale.language() == QLocale::Chinese) { QTranslator *qtTranslator = new QTranslator(this); qtTranslator->load("/usr/share/ukui-sidebar-notification/language.qm"); QApplication::installTranslator(qtTranslator); } //加载样式表 QFile file(":/qss/notification_plugin.css"); if (file.open(QFile::ReadOnly)) { QString strQss = QLatin1String(file.readAll()); file.close(); m_pMainWidget->setStyleSheet(strQss); } //插件的总VBoxLayout布局器 QVBoxLayout* pNotificationVBoxLayout = new QVBoxLayout; pNotificationVBoxLayout->setContentsMargins(10,21,0,0); pNotificationVBoxLayout->setSpacing(0); //装第一行通知中心的Widget QWidget* pWidget1= new QWidget; pWidget1->setObjectName("NotificationName"); //第一行通知中心标题栏,左侧标题“通知中心”,右侧收纳按钮 QHBoxLayout* pQHBoxLayout1 = new QHBoxLayout; pQHBoxLayout1->setContentsMargins(11,0,28,0); pQHBoxLayout1->setSpacing(0); QLabel* pLabel = new QLabel(QObject::tr("Notification center")); pLabel->setObjectName("notificationcentername"); //收纳按钮 m_pTakeInBoxToolButton = new TakeInBoxToolButton(); m_pTakeInBoxToolButton->setObjectName("takein"); connect(m_pTakeInBoxToolButton, SIGNAL(clicked()), this, SLOT(onShowTakeInMessage())); //QToolButton添加svg图片 m_pSvgRender = new QSvgRenderer(pWidget1); m_pSvgRender->load(QString(":/images/box-24.svg")); m_pPixmap = new QPixmap(24, 24); m_pPixmap->fill(Qt::transparent); QPainter painter(m_pPixmap); m_pSvgRender->render(&painter); m_pTakeInBoxToolButton->setIcon(QIcon(*m_pPixmap)); pQHBoxLayout1->addWidget(pLabel, 0, Qt::AlignLeft); pQHBoxLayout1->addWidget(m_pTakeInBoxToolButton, 0, Qt::AlignRight); pWidget1->setLayout(pQHBoxLayout1); pNotificationVBoxLayout->addWidget(pWidget1); //悬浮收纳数标签 m_pTakeInCoutLabel = new QLabel(m_pMainWidget); m_pTakeInCoutLabel->setObjectName("takeincout"); m_pTakeInCoutLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); m_pTakeInCoutLabel->setVisible(false); QSpacerItem* pVFixedSpacer = new QSpacerItem(10, 24, QSizePolicy::Fixed, QSizePolicy::Fixed); pNotificationVBoxLayout->addSpacerItem(pVFixedSpacer); //装第二行重要通知中的Widget QWidget* pWidget2= new QWidget; pWidget2->setFixedWidth(390); //第二行左侧标签“重要的信息”,右侧一个清空按钮,一个设置按钮 QHBoxLayout* pQHBoxLayout2 = new QHBoxLayout; pQHBoxLayout2->setContentsMargins(12,0,10,8); m_pNotificationLabel = new QLabel(QObject::tr("Important notice")); m_pNotificationLabel->setObjectName("importantnotification"); QSpacerItem* pHSpacer = new QSpacerItem(300, 10, QSizePolicy::Expanding, QSizePolicy::Fixed); QPushButton* pClearAllToolButton = new QPushButton(); pClearAllToolButton->setObjectName("clearall"); connect(pClearAllToolButton, SIGNAL(clicked()), this, SLOT(onClearAllMessage())); pClearAllToolButton->setText(QObject::tr("Clean up")); QSpacerItem* pFixSpacer = new QSpacerItem(5, 10, QSizePolicy::Fixed, QSizePolicy::Fixed); QPushButton* pSettingToolButton = new QPushButton(); pSettingToolButton->setObjectName("setting"); connect(pSettingToolButton, SIGNAL(clicked()), this, SLOT(onCallControlPanel())); pSettingToolButton->setText(QObject::tr("Set up")); pQHBoxLayout2->addWidget(m_pNotificationLabel, 0, Qt::AlignLeft); pQHBoxLayout2->addSpacerItem(pHSpacer); pQHBoxLayout2->addWidget(pClearAllToolButton, 0, Qt::AlignRight); pQHBoxLayout2->addSpacerItem(pFixSpacer); pQHBoxLayout2->addWidget(pSettingToolButton, 0, Qt::AlignRight); pWidget2->setLayout(pQHBoxLayout2); pNotificationVBoxLayout->addWidget(pWidget2, 0); //通知列表 m_pQScrollAreaNotify = new ScrollAreaWidget(); m_pQScrollAreaNotify->setStyleSheet("QWidget{background:transparent;}"); m_pScrollAreaNotifyVBoxLayout = new QVBoxLayout(); m_pScrollAreaNotifyVBoxLayout->setContentsMargins(0,0,0,0); m_pScrollAreaNotifyVBoxLayout->setSpacing(0); //通知列表的最内层部件 QWidget* pInQWidget = new QWidget(); pInQWidget->setObjectName("QScrollAreaInQWidget"); pInQWidget->setLayout(m_pScrollAreaNotifyVBoxLayout); m_pQScrollAreaNotify->setWidget(pInQWidget); m_pMessageCenterLabel = new QLabel(QObject::tr("No new notifications")); m_pMessageCenterLabel->setStyleSheet("QLabel{color:rgba(255,255,255,0.91);padding:119px 0px 0px 0px;font-size:14px;}"); m_pScrollAreaNotifyVBoxLayout->addWidget(m_pMessageCenterLabel, 0, Qt::AlignHCenter); QSpacerItem* pVSpacer = new QSpacerItem(10, 1, QSizePolicy::Fixed, QSizePolicy::Expanding); m_pScrollAreaNotifyVBoxLayout->addSpacerItem(pVSpacer); pNotificationVBoxLayout->addWidget(m_pQScrollAreaNotify, 0); //收纳列表 m_pQScrollAreaTakeIn = new ScrollAreaWidget(); m_pQScrollAreaTakeIn->setStyleSheet("QWidget{background:transparent;}"); m_pScrollAreaTakeInVBoxLayout = new QVBoxLayout(); m_pScrollAreaTakeInVBoxLayout->setContentsMargins(0,0,0,0); m_pScrollAreaTakeInVBoxLayout->setSpacing(0); //收纳列表的最内层部件 QWidget* pTakeInQWidget = new QWidget(); pTakeInQWidget->setObjectName("QScrollAreaInQWidget"); pTakeInQWidget->setLayout(m_pScrollAreaTakeInVBoxLayout); m_pQScrollAreaTakeIn->setWidget(pTakeInQWidget); m_pQScrollAreaTakeIn->setVisible(false); m_pTakeinMessageCenterLabel = new QLabel(QObject::tr("No unimportant notice")); m_pTakeinMessageCenterLabel->setStyleSheet("QLabel{color:rgba(255,255,255,0.91);padding:119px 0px 0px 0px;font-size:14px;}"); m_pScrollAreaTakeInVBoxLayout->addWidget(m_pTakeinMessageCenterLabel, 0, Qt::AlignHCenter); QSpacerItem* pVSpacer2 = new QSpacerItem(10, 1, QSizePolicy::Fixed, QSizePolicy::Expanding); m_pScrollAreaTakeInVBoxLayout->addSpacerItem(pVSpacer2); pNotificationVBoxLayout->addWidget(m_pQScrollAreaTakeIn, 0); //通知中心最底部固定9px的空白 QSpacerItem* pVBottomSpacer = new QSpacerItem(9, 9, QSizePolicy::Fixed, QSizePolicy::Fixed); pNotificationVBoxLayout->addSpacerItem(pVBottomSpacer); m_pMainWidget->setLayout(pNotificationVBoxLayout); //新建一个监控dbus消息的线程 MonitorThread* pMonitorThread = new MonitorThread(this); pMonitorThread->start(); return; } QWidget* NotificationPlugin::centerWidget() { return m_pMainWidget; } void NotificationPlugin::showNotification() { //上面不需要判断,因为在隐藏时,已经切换至通知中心,m_bShowTakeIn为false for(int i = 0; i < m_listAppMsg.count(); i++) { AppMsg* pAppMsg = m_listAppMsg.at(i); pAppMsg->updateAppPushTime(); } } void NotificationPlugin::hideNotification() { //侧边栏隐藏时,如果已经显示收纳盒,则切换至通知列表 if(true == m_bShowTakeIn) { onShowTakeInMessage(); } //隐藏时,因为上面已切换至通知列表,所以只需将通知列表都折叠即可 for(int i = 0; i < m_listAppMsg.count(); i++) { AppMsg* pAppMsg = m_listAppMsg.at(i); pAppMsg->setAppFold(); } } AppMsg* NotificationPlugin::getAppMsgAndIndexByName(QString strAppName, int& nIndex) { AppMsg* pAppMsg = NULL; for(int i = 0; i < m_listAppMsg.count(); i++) { AppMsg* pTmpAppMsg = m_listAppMsg.at(i); if(strAppName == pTmpAppMsg->getAppName()) { pAppMsg = pTmpAppMsg; nIndex = i; break; } } return pAppMsg; } uint NotificationPlugin::onAddSingleNotify(QString strAppName, QString strIconPath, QString strSummary, QString strBody, QDateTime dateTime, bool bNewNotificationFlag) { qDebug() <<"NotificationPlugin::onAddSingleNotify strAppName=" <count()) { m_pScrollAreaNotifyVBoxLayout->removeWidget(m_pMessageCenterLabel); m_pMessageCenterLabel->setVisible(false); } int nIndex = -1; //通过查找m_listAppMsg列表看该app是否已存在 AppMsg* pAppMsg = getAppMsgAndIndexByName(strAppName, nIndex); //如果不存在,则新建一个AppMsg消息,并且直接置顶 if(NULL == pAppMsg) { pAppMsg = new AppMsg(this, strAppName); } else { m_listAppMsg.removeAt(nIndex); m_pScrollAreaNotifyVBoxLayout->removeWidget(pAppMsg); } //在strAppName对应的AppMsg中添加单条信息 pAppMsg->addSingleMsg(strIconPath, strSummary, dateTime, strBody); int uIndex = m_listAppMsg.count(); for(int i = m_listAppMsg.count() - 1; i >= 0; i--) { AppMsg* pTmpAppMsg = m_listAppMsg.at(i); if(pAppMsg->getAppPushTime() < pTmpAppMsg->getAppPushTime()) { break; } uIndex = i; } m_listAppMsg.insert(uIndex, pAppMsg); m_pScrollAreaNotifyVBoxLayout->insertWidget(uIndex, pAppMsg); //如果是新通知,有必要对通知列表更新推送时间;如果是恢复,说明在收纳盒中,所以更新收纳盒中的推送时间 if(true == bNewNotificationFlag) { for(int i = 0; i < m_listAppMsg.count(); i++) { AppMsg* pTmpAppMsg = m_listAppMsg.at(i); pTmpAppMsg->updateAppPushTime(); } } else { for(int i = 0; i < m_listTakeInAppMsg.count(); i++) { AppMsg* pTmpAppMsg = m_listTakeInAppMsg.at(i); pTmpAppMsg->updateAppPushTime(); } } return 1; } void NotificationPlugin::onCountTakeInBitAndUpate() //统计收纳位数并更新至右上角提示 { int nCount = 0; for(int i = 0; i < m_listTakeInAppMsg.count(); i++) { AppMsg* pTmpAppMsg = m_listTakeInAppMsg.at(i); nCount = nCount + pTmpAppMsg->getSingleMsgCount(); } QString strCount = QString::number(nCount); //收纳数的位数 int nBit = 1; if(nCount > 999) { nBit = 3; strCount = "..."; } else { while(nCount >= 10) { nCount = nCount / 10; nBit++; } } m_pTakeInCoutLabel->setGeometry(361, 21, (6 + 6 * nBit), 12); m_pTakeInCoutLabel->setText(strCount); if(false == m_bShowTakeIn) { m_pTakeInCoutLabel->setVisible(true); } return; } void NotificationPlugin::onClearAppMsg(AppMsg* pAppMsg) { int nIndex = m_listAppMsg.indexOf(pAppMsg); if(-1 == nIndex) { qDebug()<<"NotificationPlugin::onClearAppMsg 在通知链表中未找到pSingleMsg指针"; return; } m_listAppMsg.removeAt(nIndex); m_pScrollAreaNotifyVBoxLayout->removeWidget(pAppMsg); pAppMsg->deleteLater(); if(0 == m_listAppMsg.count() && 1 == m_pScrollAreaNotifyVBoxLayout->count()) { m_pMessageCenterLabel->setVisible(true); m_pScrollAreaNotifyVBoxLayout->insertWidget(0, m_pMessageCenterLabel, 0, Qt::AlignHCenter); } return; } void NotificationPlugin::onClearAllMessage() { //当展示通知列表时 if(false == m_bShowTakeIn) { while (m_listAppMsg.count() > 0) { AppMsg* pSingleMsg = m_listAppMsg.at(0); m_pScrollAreaNotifyVBoxLayout->removeWidget(pSingleMsg); pSingleMsg->deleteLater(); m_listAppMsg.removeAt(0); } if(1 == m_pScrollAreaNotifyVBoxLayout->count()) { m_pMessageCenterLabel->setVisible(true); m_pScrollAreaNotifyVBoxLayout->insertWidget(0, m_pMessageCenterLabel, 0, Qt::AlignHCenter); } } else { while (m_listTakeInAppMsg.count() > 0) { AppMsg* pSingleMsg = m_listTakeInAppMsg.at(0); m_pScrollAreaTakeInVBoxLayout->removeWidget(pSingleMsg); pSingleMsg->deleteLater(); m_listTakeInAppMsg.removeAt(0); } if(1 == m_pScrollAreaTakeInVBoxLayout->count()) { m_pTakeinMessageCenterLabel->setVisible(true); m_pScrollAreaTakeInVBoxLayout->insertWidget(0, m_pTakeinMessageCenterLabel, 0, Qt::AlignHCenter); } onCountTakeInBitAndUpate(); m_pTakeInCoutLabel->setVisible(false); } return; } AppMsg* NotificationPlugin::getTakeinAppMsgAndIndexByName(QString strAppName, int& nIndex) { AppMsg* pAppMsg = NULL; for(int i = 0; i < m_listTakeInAppMsg.count(); i++) { AppMsg* pTmpAppMsg = m_listTakeInAppMsg.at(i); if(strAppName == pTmpAppMsg->getAppName()) { pAppMsg = pTmpAppMsg; nIndex = i; break; } } return pAppMsg; } void NotificationPlugin::onTakeInSingleNotify(QString strAppName, QString strIcon, QString strSummary, QString strBody, QDateTime dateTime) { //当列表信息为空表明第一次来通知,列表个数为2,一个表面是“没有新通知标签”,一个是底部弹簧 if(0 == m_listTakeInAppMsg.count() && 2 == m_pScrollAreaTakeInVBoxLayout->count()) { m_pScrollAreaTakeInVBoxLayout->removeWidget(m_pTakeinMessageCenterLabel); m_pTakeinMessageCenterLabel->setVisible(false); } int nIndex = -1; //通过查找m_listTakeInAppMsg列表看该app是否已存在 AppMsg* pAppMsg = getTakeinAppMsgAndIndexByName(strAppName, nIndex); //如果不存在,则新建一个AppMsg消息 if(NULL == pAppMsg) { pAppMsg = new AppMsg(this, strAppName, true); } else { //如果找到该收纳应用,则先移除,后面根据时间插入 m_listTakeInAppMsg.removeAt(nIndex); m_pScrollAreaTakeInVBoxLayout->removeWidget(pAppMsg); } pAppMsg->addSingleMsg(strIcon, strSummary, dateTime, strBody); int uIndex = m_listTakeInAppMsg.count(); for(int i = m_listTakeInAppMsg.count() - 1; i >= 0; i--) { AppMsg* pTmpAppMsg = m_listTakeInAppMsg.at(i); if(pAppMsg->getAppPushTime() < pTmpAppMsg->getAppPushTime()) { break; } uIndex = i; } m_listTakeInAppMsg.insert(uIndex, pAppMsg); m_pScrollAreaTakeInVBoxLayout->insertWidget(uIndex, pAppMsg); //收纳的时候没必要对收纳列表更新,可以对通知列表更新时间,反正点击进入收纳盒时,会更新收纳列表 for(int i = 0; i < m_listAppMsg.count(); i++) { AppMsg* pTmpAppMsg = m_listAppMsg.at(i); pTmpAppMsg->updateAppPushTime(); } onCountTakeInBitAndUpate(); return; } //处理删除收纳应用的槽函数 void NotificationPlugin::onClearTakeInAppMsg(AppMsg* pAppMsg) { int nIndex = m_listTakeInAppMsg.indexOf(pAppMsg); if(-1 == nIndex) { qDebug()<<"NotificationPlugin::onClearTakeInAppMsg 在收纳链表中未找到pSingleMsg指针"; return; } m_listTakeInAppMsg.removeAt(nIndex); m_pScrollAreaTakeInVBoxLayout->removeWidget(pAppMsg); pAppMsg->deleteLater(); onCountTakeInBitAndUpate(); if(0 == m_listTakeInAppMsg.count() && 1 == m_pScrollAreaTakeInVBoxLayout->count()) { m_pTakeinMessageCenterLabel->setVisible(true); m_pScrollAreaTakeInVBoxLayout->insertWidget(0, m_pTakeinMessageCenterLabel, 0, Qt::AlignHCenter); } return; } void NotificationPlugin::onCallControlPanel() { QProcess p(0); p.startDetached("ukui-control-center"); p.waitForStarted(); return; } void NotificationPlugin::onShowTakeInMessage() { if(false == m_bShowTakeIn) { m_bShowTakeIn = true; m_pQScrollAreaNotify->setVisible(false); m_pQScrollAreaTakeIn->setVisible(true); m_pNotificationLabel->setText(QObject::tr("Unimportant notice")); m_pSvgRender->load(QString(":/images/exitbox-24.svg")); m_pPixmap->fill(Qt::transparent); QPainter painter(m_pPixmap); m_pSvgRender->render(&painter); m_pTakeInBoxToolButton->setIcon(QIcon(*m_pPixmap)); m_pTakeInBoxToolButton->setEnterFlags(m_bShowTakeIn); m_pTakeInCoutLabel->setVisible(false); //当切换至收纳盒时,先将各个收纳应用更新下时间 for(int i = 0; i < m_listTakeInAppMsg.count(); i++) { AppMsg* pAppMsg = m_listTakeInAppMsg.at(i); pAppMsg->updateAppPushTime(); } //再将各个通知应用折叠起来 for(int i = 0; i < m_listAppMsg.count(); i++) { AppMsg* pAppMsg = m_listAppMsg.at(i); pAppMsg->setAppFold(); } } else { m_bShowTakeIn = false; m_pQScrollAreaNotify->setVisible(true); m_pQScrollAreaTakeIn->setVisible(false); m_pNotificationLabel->setText(QObject::tr("Important notice")); m_pSvgRender->load(QString(":/images/box-24.svg")); m_pPixmap->fill(Qt::transparent); QPainter painter(m_pPixmap); m_pSvgRender->render(&painter); m_pTakeInBoxToolButton->setIcon(QIcon(*m_pPixmap)); m_pTakeInBoxToolButton->setEnterFlags(m_bShowTakeIn); if(m_listTakeInAppMsg.count() > 0) { m_pTakeInCoutLabel->setVisible(true); } //当切换至通知列表时,先将各个通知应用更新下时间 for(int i = 0; i < m_listAppMsg.count(); i++) { AppMsg* pAppMsg = m_listAppMsg.at(i); pAppMsg->updateAppPushTime(); } //再将各个收纳应用折叠起来 for(int i = 0; i < m_listTakeInAppMsg.count(); i++) { AppMsg* pAppMsg = m_listTakeInAppMsg.at(i); pAppMsg->setAppFold(); } } } ukui-sidebar/src/plugins/notification_plugin/appmsg.cpp0000644000175000017500000003203713634067640022407 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 setFixedWidth(380); this->adjustSize(); //App信息中的总的垂直布局器 m_pMainVLaout = new QVBoxLayout(); m_pMainVLaout->setContentsMargins(0,0,0,0); m_pMainVLaout->setSpacing(0); //当出现多条消息时,增加底图 m_pAppBaseMapWidget = new QWidget; QVBoxLayout* pBaseMapVLaout = new QVBoxLayout(); pBaseMapVLaout->setContentsMargins(0,0,0,6); pBaseMapVLaout->setSpacing(0); m_pBaseMapWidget = new QWidget; m_pBaseMapWidget->setObjectName("BaseMap"); m_pBaseMapWidget->setFixedWidth(360); m_pBaseMapWidget->setFixedHeight(6); m_pBaseMapWidget->setStyleSheet("QWidget{background:rgba(255,255,255,0.04);border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-left-radius:6px;border-bottom-right-radius:6px;}"); pBaseMapVLaout->addWidget(m_pBaseMapWidget, 0 , Qt::AlignHCenter); m_pAppBaseMapWidget->setLayout(pBaseMapVLaout); m_pMainVLaout->addWidget(m_pAppBaseMapWidget, 0 , Qt::AlignHCenter); m_pAppBaseMapWidget->setVisible(false); this->setLayout(m_pMainVLaout); //发个信号通知插件删除该通知应用消息 connect(this, SIGNAL(Sig_onDeleteAppMsg(AppMsg*)), parent, SLOT(onClearAppMsg(AppMsg*))); //发个信号通知插件删除该收纳应用消息 connect(this, SIGNAL(Sig_onDeleteTakeInAppMsg(AppMsg*)), parent, SLOT(onClearTakeInAppMsg(AppMsg*))); //发个信号通知插件收纳单条应用消息 connect(this, SIGNAL(Sig_SendTakeInSingleMsg(QString, QString, QString, QString, QDateTime)), parent, SLOT(onTakeInSingleNotify(QString, QString, QString, QString, QDateTime))); //发个信号通知插件恢复单条应用消息 connect(this, SIGNAL(Sig_SendAddSingleMsg(QString, QString, QString, QString, QDateTime, bool)), parent, SLOT(onAddSingleNotify(QString, QString, QString, QString, QDateTime, bool))); //发个统计收纳数更新信号 connect(this, SIGNAL(Sig_countTakeInBitAndUpate()), parent, SLOT(onCountTakeInBitAndUpate())); return; } //统计应用剩余显示条数 void AppMsg::statisticLeftItem() { //小于1时,表示列表为空,直接返回 if(m_listSingleMsg.count() < 1) { return; } int nShowLeftCount = m_listSingleMsg.count() - 1; //当应用处于折叠状态,且剩余条数大于0时,应用底图部件显示 if((true == m_bFold) && (nShowLeftCount > 0)) { m_pAppBaseMapWidget->setVisible(true); } else { m_pAppBaseMapWidget->setVisible(false); } SingleMsg* pTopSingleMsg = m_listSingleMsg.at(0); pTopSingleMsg->setLeftItem(nShowLeftCount); return; } //新增单条消息至通知列表,崭新消息需要new,然后添加至列表最上面 void AppMsg::addSingleMsg(QString strIconPath, QString strSummary, QDateTime dateTime, QString strBody) { SingleMsg* pSingleMsg = new SingleMsg(this, strIconPath, m_strAppName, strSummary, dateTime, strBody, m_bTakeInFlag); int uIndex = m_listSingleMsg.count(); for(int i = m_listSingleMsg.count() - 1; i >= 0; i--) { SingleMsg* pTmpSingleMsg = m_listSingleMsg.at(i); if(pSingleMsg->getPushTime() < pTmpSingleMsg->getPushTime()) { break; } uIndex = i; } //当新增的消息将插入最顶部时,将已有列表最顶部的老主消息正文设置一行缩略显示 if((0 == uIndex) && (m_listSingleMsg.count() > 0)) { SingleMsg* pFirstMsg = m_listSingleMsg.at(0); pFirstMsg->setMainFlag(false); pFirstMsg->setShowLeftItemFlag(false); //只有已经折叠的才需要将现有的正文设置为缩略显示 if(true == m_bFold) { pFirstMsg->setBodyLabelWordWrap(false); pFirstMsg->setVisible(false); //将SingleMsg底部设置0px空隙,当其展开时,让他完全从0展开 pFirstMsg->setSingleMsgContentsMargins(0, 0, 0, 0); } } //如果插入第0条,并且已展开,则将新增消息设置自动换行,并且折叠标志设为false if((0 == uIndex) && (false == m_bFold)) { pSingleMsg->setBodyLabelWordWrap(true); pSingleMsg->setFoldFlag(m_bFold); } //如果插入的不是第0条,则自己不能为主 if(0 != uIndex) { pSingleMsg->setMainFlag(false); //并且已经折叠的自己不可见 if(true == m_bFold) { pSingleMsg->setVisible(false); } } m_listSingleMsg.insert(uIndex, pSingleMsg); m_pMainVLaout->insertWidget(uIndex, pSingleMsg); //将该应用中最顶上的一条消息的时间赋给应用 SingleMsg* pTopSingleMsg = m_listSingleMsg.at(0); m_uNotifyTime = pTopSingleMsg->getPushTime(); m_dateTime = pTopSingleMsg->getPushDateTime(); //统计应用剩余显示条数 statisticLeftItem(); return; } void AppMsg::updateAppPushTime() { for(int i = 0; i < m_listSingleMsg.count(); i++) { SingleMsg* pTmpSingleMsg = m_listSingleMsg.at(i); pTmpSingleMsg->updatePushTime(); } return; } int AppMsg::getSingleMsgCount() { return m_listSingleMsg.count(); } void AppMsg::onDeleteAppMsg() { if(false == m_bTakeInFlag) { emit Sig_onDeleteAppMsg(this); //是通知应用就通知插件删该通知应用 } else { emit Sig_onDeleteTakeInAppMsg(this); //是收纳应用就通知插件删该收纳应用 } return; } void AppMsg::onTakeinWholeApp() { while(m_listSingleMsg.count() > 0) { SingleMsg* pSingleMsg = m_listSingleMsg.at(0); m_pMainVLaout->removeWidget(pSingleMsg); m_listSingleMsg.removeAt(0); emit Sig_SendTakeInSingleMsg(m_strAppName, pSingleMsg->getIcon(), pSingleMsg->getSummary(), pSingleMsg->getBody(), pSingleMsg->getPushDateTime()); } emit Sig_onDeleteAppMsg(this); return; } void AppMsg::onRecoverWholeApp() { while(m_listSingleMsg.count() > 0) { SingleMsg* pSingleMsg = m_listSingleMsg.at(0); m_pMainVLaout->removeWidget(pSingleMsg); m_listSingleMsg.removeAt(0); emit Sig_SendAddSingleMsg(m_strAppName, pSingleMsg->getIcon(), pSingleMsg->getSummary(), pSingleMsg->getBody(), pSingleMsg->getPushDateTime(), false); } emit Sig_onDeleteTakeInAppMsg(this); return; } void AppMsg::onDeleSingleMsg(SingleMsg* pSingleMsg) { int nIndex = m_listSingleMsg.indexOf(pSingleMsg); if(-1 == nIndex) { qDebug()<<"AppMsg::onDeleSingleMsg 在通知链表中未找到pSingleMsg指针"; return; } m_listSingleMsg.removeAt(nIndex); m_pMainVLaout->removeWidget(pSingleMsg); pSingleMsg->deleteLater(); //当本次删除为应用首条时,且该应用不止一条,则需将新的首条设置为顶部消息状态 if(0 == nIndex) { setTopWithSecondItem(); } //统计剩余显示条数,看情况显示 statisticLeftItem(); //当删除一条消息后,如果应用列表为空 if(0 == m_listSingleMsg.count()) { if(false == m_bTakeInFlag) { emit Sig_onDeleteAppMsg(this); //是通知应用就通知插件删该通知应用 } else { emit Sig_onDeleteTakeInAppMsg(this); //是收纳应用就通知插件删该收纳应用 } } //只有当该应用属于收纳应用对象时,每删除一条都要更新收纳计数 if(true == m_bTakeInFlag) { emit Sig_countTakeInBitAndUpate(); } return; } //当应用最顶条被删除后,将第二条置顶 void AppMsg::setTopWithSecondItem() { if(m_listSingleMsg.count() > 0) { SingleMsg* pFirstMsg = m_listSingleMsg.at(0); pFirstMsg->setMainFlag(true); pFirstMsg->setFoldFlag(m_bFold); //都是在删除单挑、收纳单挑和恢复单挑的情况下调用的setTopWithSecondItem,此时App应该都是展开状态 pFirstMsg->setBodyLabelWordWrap(true); pFirstMsg->setVisible(true); } return; } //来自SingleMsg下的事件,处理收纳事件 void AppMsg::onTakeInSingleMsg(SingleMsg* pSingleMsg) { int nIndex = m_listSingleMsg.indexOf(pSingleMsg); if(-1 == nIndex) { qDebug()<<"AppMsg::onTakeInSingleMsg 在通知链表中未找到pSingleMsg指针"; return; } m_listSingleMsg.removeAt(nIndex); m_pMainVLaout->removeWidget(pSingleMsg); emit Sig_SendTakeInSingleMsg(m_strAppName, pSingleMsg->getIcon(), pSingleMsg->getSummary(), pSingleMsg->getBody(), pSingleMsg->getPushDateTime()); pSingleMsg->deleteLater(); //当本次收纳为应用首条时,且该应用不止一条,考虑将新的首条设置为顶部消息状态 if(0 == nIndex) { setTopWithSecondItem(); } //统计剩余显示条数,看情况显示 statisticLeftItem(); if(0 == m_listSingleMsg.count()) { emit Sig_onDeleteAppMsg(this); } } //来自SingleMsg下的事件,处理恢复事件 void AppMsg::onRecoverSingleMsg(SingleMsg* pSingleMsg) { int nIndex = m_listSingleMsg.indexOf(pSingleMsg); if(-1 == nIndex) { qDebug()<<"AppMsg::onTakeInSingleMsg 在通知链表中未找到pSingleMsg指针"; return; } m_listSingleMsg.removeAt(nIndex); m_pMainVLaout->removeWidget(pSingleMsg); emit Sig_SendAddSingleMsg(m_strAppName, pSingleMsg->getIcon(), pSingleMsg->getSummary(), pSingleMsg->getBody(), pSingleMsg->getPushDateTime(), false); pSingleMsg->deleteLater(); //当本次收纳为应用首条时,且该应用不止一条,考虑将新的首条设置为顶部消息状态 if(0 == nIndex) { setTopWithSecondItem(); } //统计剩余显示条数,看情况显示 statisticLeftItem(); if(0 == m_listSingleMsg.count()) { emit Sig_onDeleteTakeInAppMsg(this); } //只有当该应用属于收纳应用对象时,每恢复一条都要更新收纳计数 if(true == m_bTakeInFlag) { emit Sig_countTakeInBitAndUpate(); } } void AppMsg::setAppFoldFlag(bool bFlag) { m_bFold = bFlag; //当应用处于展开状态,或者总条数小于等于1时,应用底图部件隐藏 if((false == m_bFold) || (m_listSingleMsg.count() <= 1)) { m_pAppBaseMapWidget->setVisible(false); } //false表示应用展开 if(false == m_bFold) { //展开时,索引从第1条开始,消息全部可见 for(int i = 1; i < m_listSingleMsg.count(); i++) { SingleMsg* pTmpSingleMsg = m_listSingleMsg.at(i); pTmpSingleMsg->startAnimationUnfold(); } } else { //折叠时,索引从第1条开始,消息全部不可见 for(int i = 1; i < m_listSingleMsg.count(); i++) { SingleMsg* pTmpSingleMsg = m_listSingleMsg.at(i); pTmpSingleMsg->startAnimationFold(); } } } //当app展开时,将app设置折叠 void AppMsg::setAppFold() { if(false == m_bFold) { //假如应用展开,则将应用主消息设置折叠 SingleMsg* pFirstSingleMsg = m_listSingleMsg.at(0); pFirstSingleMsg->mainMsgSetFold(); } } //应用主消息进入 void AppMsg::onMainMsgEnter() { m_pBaseMapWidget->setStyleSheet("QWidget{background:rgba(255,255,255,0.1);border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-left-radius:6px;border-bottom-right-radius:6px;}"); } //应用主消息离开 void AppMsg::onMainMsgLeave() { m_pBaseMapWidget->setStyleSheet("QWidget{background:rgba(255,255,255,0.04);border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-left-radius:6px;border-bottom-right-radius:6px;}"); } void AppMsg::onShowBaseMap() { //当应用处于折叠状态,且总条数大于1时,应用底图部件显示 if((true == m_bFold) && (m_listSingleMsg.count() > 1)) { SingleMsg* pTmpSingleMsg = m_listSingleMsg.at(0); pTmpSingleMsg->setSingleMsgContentsMargins(0, 0, 0, 0); //假如折叠,剩余条目显示将可见,则SingleMsg的内容均无空隙 pTmpSingleMsg->setShowLeftItemFlag(true); m_pAppBaseMapWidget->setVisible(true); } } //隐藏底图部件 void AppMsg::onHideBaseMap() { m_pAppBaseMapWidget->setVisible(false); } ukui-sidebar/src/plugins/notification_plugin/singlemsg.h0000644000175000017500000001363013642562542022553 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include class AppMsg; class ButtonWidget; class DiyPropertyAnimation; class SingleMsg : public QWidget { Q_OBJECT public: SingleMsg(AppMsg* pParent, QString strIconPath, QString strAppName, QString strSummary, QDateTime dateTime, QString strBody, bool bTakeInFlag = false); void updatePushTime(); void setBodyLabelWordWrap(bool bFlag); void setLeftItem(int nShowLeftCount); void setMainFlag(bool bFlag) {m_bMain = bFlag;} void setFoldFlag(bool bFlag) {m_bFold = bFlag;} void setShowLeftItemFlag(bool bFlag); void setSingleMsgContentsMargins(int left, int top, int right, int bottom); void mainMsgSetFold(); void startAnimationUnfold(); //开启展开动画 void startAnimationFold(); //开启折叠动画 void startAnimationDeleUpperMove(); //开启删除上移动画 uint getPushTime() {return m_uNotifyTime;} QDateTime getPushDateTime() {return m_dateTime;} QString getIcon() {return m_strIconPath;} QString getSummary() {return m_strSummary;} QString getBody() {return m_strBody;} protected: virtual void enterEvent(QEvent *event) override; virtual void leaveEvent(QEvent *event) override; virtual void mousePressEvent(QMouseEvent *event) override; virtual void resizeEvent(QResizeEvent *event) override; private: QVBoxLayout* m_pAppVLaout; QWidget* m_pSingleWidget; //除去底部6px的空白之外的一个内框部件 QWidget* m_pAnimationBaseMapWidget; //动画底图动态模拟大小替身部件 QWidget* m_pIconWidget; //在动画中暂定高38px QLabel* m_pTimeLabel; //时间标签 ButtonWidget* m_pSingleTakeinButton; //单条消息中的收纳按钮 ButtonWidget* m_pSingleDeleteButton; //单条消息中的删除按钮 QLabel* m_pSummaryLabel; //在动画中暂定高26px QLabel* m_pBodyLabel; //正文标签,收缩时,在动画中暂定高24px QWidget* m_pShowLeftWidget; //显示该应用未展开部件 QLabel* m_pShowLeftItemLabel; //显示该应用未展开条数 QString m_strIconPath; //图标路径 QString m_strSummary; //保存主题 QString m_strBody; //保存正文 QDateTime m_dateTime; //保存推送时间 uint m_uNotifyTime; //保存推送时间的绝对时间 bool m_bTakeInFlag; //收纳标志 bool m_bFold; //是否折叠 bool m_bMain; //是否为主窗口 int m_nShowLeftCount; //为主窗口时,剩余显示条数 bool m_bTimeFormat; //time制式,0代表12小时制,1代表24小时制 signals: void Sig_onDeleSingleMsg(SingleMsg* p); void Sig_onTakeInSingleMsg(SingleMsg* p); void Sig_onRecoverSingleMsg(SingleMsg* p); void Sig_onDeleteAppMsg(); void Sig_onTakeinWholeApp(); void Sig_onRecoverWholeApp(); void Sig_setAppFoldFlag(bool bFoldFlag); void Sig_onMainEnter(); //应用主消息鼠标进入信号,发送至App,让分层底图变色 void Sig_onMainLeave(); //应用主消息鼠标离开信号,发送至App,让分层底图背景变回来 void Sig_notifyAppShowBaseMap(); //当动画折叠后,通知主app考虑显示底图 void Sig_notifyAppHideBaseMap(); //通知隐藏应用的底图部件 public slots: void onDele(); //通知中心或者收纳盒中的删除 void onTakeIn(); //通知中心消息收纳至收纳盒 void onRecover(); //收纳盒消息恢复至通知中心 void updateUnfoldMove(int x1, int y1, int x2, int y2); //更新展开的移动数据 void onUnfoldFinish(); //处理展开完成时的函数 void updateFoldMove(int x1, int y1, int x2, int y2); //更新折叠的移动数据 void onFoldFinish(); //处理折叠完成时的函数 void updateDeleLeftMove(int x1, int y1, int x2, int y2); //更新删除左移时的移动数据 void onDeleLeftMoveFinish(); //处理删除左移完成时的函数 void updateDeleUpperMove(int x1, int y1, int x2, int y2); //更新删除上移时的移动数据 void onDeleUpperMoveFinish(); //处理删除上移完成时的函数 void startAnimationDeleLeftMove(); //开启删除左移动画 }; #endif // SINGLEMSG_H ukui-sidebar/src/plugins/notification_plugin/appmsg.h0000644000175000017500000001043613634067640022053 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include #include #include #include #include class NotificationPlugin; class SingleMsg; class AppMsg : public QWidget { Q_OBJECT public: AppMsg(NotificationPlugin *parent, QString strAppName, bool bTakeInFlag = false); uint getAppPushTime() {return m_uNotifyTime;} QString getAppName() {return m_strAppName;} void addSingleMsg(QString strIconPath, QString strSummary, QDateTime dateTime, QString strBody); void updateAppPushTime(); //更新应用最新的推送时间 int getSingleMsgCount(); //获取应用消息数 void statisticLeftItem(); //统计应用剩余显示条数 void setTopWithSecondItem(); //当应用最顶条被删除后,将第二条置顶 void setAppFold(); //当app展开时,将app设置折叠 private: QVBoxLayout* m_pMainVLaout; //App信息中的总的垂直布局器 QWidget* m_pAppBaseMapWidget; //多条消息时,底图部件包括底部6个px的空白 QWidget* m_pBaseMapWidget; //多条消息时,底图部件不包括底部6个px的空白 QList m_listSingleMsg; //对于SingleMsg类对象用list表记录 QString m_strAppName; //保存发送方的应用名 QDateTime m_dateTime; //保存推送时间 uint m_uNotifyTime; //保存推送时间的绝对时间 bool m_bTakeInFlag; //转变为收纳消息吗,默认为false bool m_bFold; //折叠标志 signals: void Sig_onDeleteAppMsg(AppMsg* p); //该对象属于通知应用,发出删除应用的信号 void Sig_onDeleteTakeInAppMsg(AppMsg* p); //当该对象属于收纳应用时,发出删除收纳应用的信号 void Sig_countTakeInBitAndUpate(); //发个统计收纳数信号 void Sig_SendTakeInSingleMsg(QString strAppName, QString strIcon, QString strSummary, QString strBody, QDateTime dateTime); void Sig_SendAddSingleMsg(QString strAppName, QString strIcon, QString strSummary, QString strBody, QDateTime dateTime, bool bNewNotificationFlag); public slots: void onDeleteAppMsg(); //删除一个应用消息 void onTakeinWholeApp(); //收纳整个应用消息 void onRecoverWholeApp(); //恢复整个应用消息 void onDeleSingleMsg(SingleMsg* pSingleMsg); //删除单条消息 void onTakeInSingleMsg(SingleMsg* pSingleMsg); //收纳单条消息 void onRecoverSingleMsg(SingleMsg* pSingleMsg); //恢复单条消息 void setAppFoldFlag(bool bFlag); //设置应用折叠标志 void onMainMsgEnter(); //应用主消息进入 void onMainMsgLeave(); //应用主消息离开 void onShowBaseMap(); //显示应用底图 void onHideBaseMap(); //隐藏底图部件 }; #endif // APPMSG_H ukui-sidebar/src/plugins/notification_plugin/singlemsg.cpp0000644000175000017500000006122213642562542023106 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include #include "diypropertyanimation.h" #include #include SingleMsg::SingleMsg(AppMsg* pParent, QString strIconPath, QString strAppName, QString strSummary, QDateTime dateTime, QString strBody, bool bTakeInFlag) { m_bMain = true; //默认是主窗口 m_bFold = true; //默认折叠状态 m_strIconPath = strIconPath; m_strSummary = strSummary; m_strBody = strBody; m_dateTime = dateTime; m_uNotifyTime = dateTime.toTime_t(); m_bTakeInFlag = bTakeInFlag; m_bTimeFormat = true; this->adjustSize(); connect(this, SIGNAL(Sig_setAppFoldFlag(bool)), pParent, SLOT(setAppFoldFlag(bool))); connect(this, SIGNAL(Sig_onDeleSingleMsg(SingleMsg*)), pParent, SLOT(onDeleSingleMsg(SingleMsg*))); connect(this, SIGNAL(Sig_onDeleteAppMsg()), pParent, SLOT(onDeleteAppMsg())); connect(this, SIGNAL(Sig_onTakeInSingleMsg(SingleMsg*)), pParent, SLOT(onTakeInSingleMsg(SingleMsg*))); connect(this, SIGNAL(Sig_onTakeinWholeApp()), pParent, SLOT(onTakeinWholeApp())); connect(this, SIGNAL(Sig_onRecoverSingleMsg(SingleMsg*)), pParent, SLOT(onRecoverSingleMsg(SingleMsg*))); connect(this, SIGNAL(Sig_onRecoverWholeApp()), pParent, SLOT(onRecoverWholeApp())); connect(this, SIGNAL(Sig_onMainEnter()), pParent, SLOT(onMainMsgEnter())); connect(this, SIGNAL(Sig_onMainLeave()), pParent, SLOT(onMainMsgLeave())); connect(this, SIGNAL(Sig_notifyAppShowBaseMap()), pParent, SLOT(onShowBaseMap())); connect(this, SIGNAL(Sig_notifyAppHideBaseMap()), pParent, SLOT(onHideBaseMap())); //为了设置SingleMsg的6px圆角的样式,在里面套了一个QWidget m_pAppVLaout = new QVBoxLayout(); m_pAppVLaout->setContentsMargins(0,0,0,0); m_pAppVLaout->setSpacing(0); m_pSingleWidget = new QWidget(this); m_pSingleWidget->setObjectName("SingleNotification"); m_pAnimationBaseMapWidget = new QWidget(this); m_pAnimationBaseMapWidget->setStyleSheet("background:transparent;"); //单条消息总体垂直布局器 QVBoxLayout* pMainVLaout = new QVBoxLayout; pMainVLaout->setContentsMargins(0, 0, 0, 0); pMainVLaout->setSpacing(0); //图标和时间行的水平布局部件 m_pIconWidget = new QWidget; m_pIconWidget->setStyleSheet("background:transparent;"); //图标和时间行的水平布局器 QHBoxLayout* pIconHLayout = new QHBoxLayout(); pIconHLayout->setContentsMargins(12,11,26,0); pIconHLayout->setSpacing(0); //设置通知消息中的Icon,使用QToolButton QToolButton* pIconToolButton = new QToolButton(); pIconToolButton->setStyleSheet("QToolButton{border:none;border-style:none;padding:0px;background:transparent;}"); pIconToolButton->setIconSize(QSize(24,24)); pIconToolButton->setIcon(QPixmap(strIconPath)); //设置应用名标签,采用省略模式 QLabel* pAppNameLabel = new QLabel(); pAppNameLabel->setObjectName("AppName"); pAppNameLabel->setFixedWidth(84); QFont font14; font14.setPixelSize(14); pAppNameLabel->setFont(font14); QFontMetrics fontMetrics1(pAppNameLabel->font()); QString formatAppName = fontMetrics1.elidedText(strAppName, Qt::ElideRight, pAppNameLabel->width()); pAppNameLabel->setText(formatAppName); //设置通知消息中的弹簧,水平任意伸缩使主题和时间分开 QSpacerItem* pHExpandSpacer = new QSpacerItem(400, 10, QSizePolicy::Expanding, QSizePolicy::Fixed); //设置通知消息中的通知时间 m_pTimeLabel = new QLabel(); m_pTimeLabel->setObjectName("pushtime"); m_pTimeLabel->setText("现在"); m_pTimeLabel->setStyleSheet("background-color:transparent;"); //单独收纳按钮 if(false == m_bTakeInFlag) { QString strIcon = ":/images/box-16-translucent.svg"; QString strHoverIcon = ":/images/box-16.svg"; QString strPressIcon = ":/images/box-14-translucent.svg"; m_pSingleTakeinButton = new ButtonWidget(strIcon, strHoverIcon, strPressIcon); connect(m_pSingleTakeinButton, SIGNAL(Sig_clicked()), this, SLOT(onTakeIn())); } else { QString strIcon = ":/images/exitbox-16-translucent.svg"; QString strHoverIcon = ":/images/exitbox-16.svg"; QString strPressIcon = ":/images/exitbox-14-translucent.svg"; m_pSingleTakeinButton = new ButtonWidget(strIcon, strHoverIcon, strPressIcon); connect(m_pSingleTakeinButton, SIGNAL(Sig_clicked()), this, SLOT(onRecover())); } m_pSingleTakeinButton->setVisible(false); //单独删除按钮 QString strIcon = ":/images/hover-translucent.svg"; QString strHoverIcon = ":/images/hover.svg"; m_pSingleDeleteButton = new ButtonWidget(strIcon, strHoverIcon, strIcon); connect(m_pSingleDeleteButton, SIGNAL(Sig_clicked()), this, SLOT(onDele())); m_pSingleDeleteButton->setVisible(false); pIconHLayout->addWidget(pIconToolButton, 0, Qt::AlignLeft); pIconHLayout->addWidget(pAppNameLabel, 0, Qt::AlignLeft|Qt::AlignVCenter); pIconHLayout->addSpacerItem(pHExpandSpacer); pIconHLayout->addWidget(m_pTimeLabel, 0, Qt::AlignRight); pIconHLayout->addWidget(m_pSingleTakeinButton, 0, Qt::AlignRight); pIconHLayout->addWidget(m_pSingleDeleteButton, 0, Qt::AlignRight); m_pIconWidget->setLayout(pIconHLayout); pMainVLaout->addWidget(m_pIconWidget, 0); //内容部件,将主题正文以及剩余条数显示装入内容部件 QWidget* pContextWidget = new QWidget; pContextWidget->setStyleSheet("background-color:transparent;"); //内容部件的垂直布局器 QVBoxLayout* pVContextLayout = new QVBoxLayout(); pVContextLayout->setContentsMargins(40,0,26,0); pVContextLayout->setSpacing(0); //设置通知消息中的主题,采用省略模式 m_pSummaryLabel = new QLabel(); m_pSummaryLabel->setFixedWidth(314); m_pSummaryLabel->setStyleSheet("color:rgba(255,255,255,0.97);font-weight:400;font-size:16px;background-color:transparent;line-height:26px;padding:0px;"); QFont font16; font16.setPixelSize(16); m_pSummaryLabel->setFont(font16); QString formatSummary; formatSummary.append("

").append(m_strSummary).append("

"); QFontMetrics fontMetrics(m_pSummaryLabel->font()); int nFontSize = fontMetrics.width(formatSummary); QString strformatSummary = formatSummary; if(nFontSize > (m_pSummaryLabel->width() + 239)) { strformatSummary = fontMetrics.elidedText(formatSummary, Qt::ElideRight, m_pSummaryLabel->width() + 210); } m_pSummaryLabel->setText(strformatSummary); pVContextLayout->addWidget(m_pSummaryLabel, 0, Qt::AlignLeft); //设置通知消息中的正文QLabel,行高24px,采用自动换行模式 if(false == m_strBody.isEmpty()) { QString strLineHeight24Body; strLineHeight24Body.append("

").append(m_strBody).append("

"); m_pBodyLabel = new QLabel(); m_pBodyLabel->setFixedWidth(315); m_pBodyLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); m_pBodyLabel->adjustSize(); m_pBodyLabel->setStyleSheet("color:rgba(255,255,255,0.57);font-weight:400;font-size:14px;background-color:transparent;line-height:24px;padding:0px;"); QFontMetrics fontMetrics(m_pBodyLabel->font()); int fontSize = fontMetrics.width(strLineHeight24Body); QString formatBody = strLineHeight24Body; m_pBodyLabel->setWordWrap(false); if(fontSize > (m_pBodyLabel->width() + 209)) { formatBody = fontMetrics.elidedText(strLineHeight24Body, Qt::ElideRight, m_pBodyLabel->width() + 180); } m_pBodyLabel->setText(formatBody); pVContextLayout->addWidget(m_pBodyLabel, 0, Qt::AlignLeft); } //显示该应用未展开部件 m_pShowLeftWidget = new QWidget; QVBoxLayout* pVShowLeftLayout = new QVBoxLayout(); pVShowLeftLayout->setContentsMargins(0,6,0,14); m_pShowLeftItemLabel = new QLabel; m_pShowLeftItemLabel->setObjectName("ShowLeftItem"); m_pShowLeftItemLabel->setVisible(false); pVShowLeftLayout->addWidget(m_pShowLeftItemLabel, 0, Qt::AlignLeft); m_pShowLeftWidget->setLayout(pVShowLeftLayout); pVContextLayout->addWidget(m_pShowLeftWidget, 0, Qt::AlignLeft); pContextWidget->setLayout(pVContextLayout); pMainVLaout->addWidget(pContextWidget); m_pSingleWidget->setLayout(pMainVLaout); m_pAppVLaout->addWidget(m_pSingleWidget); this->setLayout(m_pAppVLaout); setStyleSheet("background-color:rgba(255,255,255,0.12);"); return; } void SingleMsg::updatePushTime() { QDateTime currentDateTime(QDateTime::currentDateTime()); if(currentDateTime.toTime_t() < (m_uNotifyTime + 60)) { return; } QString strPushDate; if(m_dateTime.date() == currentDateTime.date()) { if(true == m_bTimeFormat) { strPushDate = m_dateTime.toString("hh:mm"); //24小时制 } else { strPushDate = m_dateTime.toString("AP h:mm"); //12小时制 } m_pTimeLabel->setText(strPushDate); return; } if(1 == (currentDateTime.date().toJulianDay() - m_dateTime.date().toJulianDay())) { strPushDate = "昨天 "; if(true == m_bTimeFormat) { strPushDate = strPushDate + m_dateTime.toString("hh:mm"); //24小时制 } else { strPushDate = strPushDate + m_dateTime.toString("AP h:mm"); //12小时制 } m_pTimeLabel->setText(strPushDate); return; } //一周以内 if((currentDateTime.date().toJulianDay() - m_dateTime.date().toJulianDay()) < 7) { if(true == m_bTimeFormat) { strPushDate = m_dateTime.toString("ddd hh:mm"); //24小时制 } else { strPushDate = m_dateTime.toString("ddd AP h:mm"); //12小时制 } m_pTimeLabel->setText(strPushDate); } else { strPushDate = m_dateTime.toString("yyyy/MM/dd"); //一周以外 m_pTimeLabel->setText(strPushDate); } return; } void SingleMsg::setBodyLabelWordWrap(bool bFlag) { if(true == m_strBody.isEmpty()) { return; } m_pBodyLabel->setWordWrap(bFlag); QFont font14; font14.setPixelSize(14); m_pBodyLabel->setFont(font14); QFontMetrics fontMetrics(m_pBodyLabel->font()); QString strLineHeight24Body; strLineHeight24Body.append("

").append(m_strBody).append("

"); int fontSize = fontMetrics.width(strLineHeight24Body); QString formatBody = strLineHeight24Body; if(true == bFlag) { //如果展开,就超过四行末尾显示省略号 //if(fontSize > (m_pBodyLabel->width() * 4 + 181)) { formatBody = fontMetrics.elidedText(strLineHeight24Body, Qt::ElideRight, m_pBodyLabel->width() * 4 + 152); } } else { //如果不展开,就超过一行末尾显示省略号 if(fontSize > (m_pBodyLabel->width() + 209)) { formatBody = fontMetrics.elidedText(strLineHeight24Body, Qt::ElideRight, m_pBodyLabel->width() + 180); } } m_pBodyLabel->setText(formatBody); return; } //将应用的总的剩余条数设置剩余标签显示内容,根据具体情况显示,该函数只有顶部消息才执行 void SingleMsg::setLeftItem(int nShowLeftCount) { m_nShowLeftCount = nShowLeftCount; QString strShowLeft = "还有" + QString::number(nShowLeftCount) + "则通知"; m_pShowLeftItemLabel->setText(strShowLeft); //当剩余条数大于0, 且是折叠状态则显示剩余标签 if((true == m_bFold) && (m_nShowLeftCount > 0)) { m_pAppVLaout->setContentsMargins(0,0,0,0); //假如折叠,剩余条目显示将可见,则SingleMsg的内容均无空隙 m_pShowLeftItemLabel->setVisible(true); } else { m_pAppVLaout->setContentsMargins(0,0,0,6); //假如展开,剩余条目显示不可见,则SingleMsg的内容空白恢复正常,即底部多出6个px的空隙 m_pShowLeftItemLabel->setVisible(false); } } void SingleMsg::setShowLeftItemFlag(bool bFlag) { m_pShowLeftItemLabel->setVisible(bFlag); } void SingleMsg::setSingleMsgContentsMargins(int left, int top, int right, int bottom) { m_pAppVLaout->setContentsMargins(left, top, right, bottom); } void SingleMsg::enterEvent(QEvent *event) { Q_UNUSED(event); if((true == m_bMain) && (false == m_bFold) && (m_nShowLeftCount > 0)) { setStyleSheet("background-color:rgba(255,255,255,0.28);"); } else { setStyleSheet("background-color:rgba(255,255,255,0.2);"); } m_pSingleTakeinButton->setVisible(true); m_pSingleDeleteButton->setVisible(true); m_pTimeLabel->setVisible(false); if((true == m_bMain) && (true == m_bFold) && (m_nShowLeftCount > 0)) { emit Sig_onMainEnter(); } return; } void SingleMsg::leaveEvent(QEvent *event) { Q_UNUSED(event); if((true == m_bMain) && (false == m_bFold) && (m_nShowLeftCount > 0)) { setStyleSheet("background-color:rgba(255,255,255,0.2);"); } else { setStyleSheet("background-color:rgba(255,255,255,0.12);"); } m_pSingleTakeinButton->setVisible(false); m_pSingleDeleteButton->setVisible(false); m_pTimeLabel->setVisible(true); if((true == m_bMain) && (true == m_bFold) && (m_nShowLeftCount > 0)) { emit Sig_onMainLeave(); } return; } //鼠标点击事件 void SingleMsg::mousePressEvent(QMouseEvent *event) { if (event->buttons() == Qt::LeftButton) { if(true == m_bFold) { m_bFold = false; //置为false,表示展开 setBodyLabelWordWrap(true); } else { m_bFold = true; //置为true,表示折叠 setBodyLabelWordWrap(false); } if((true == m_bMain) && (false == m_bFold) && (m_nShowLeftCount > 0)) { setStyleSheet("background-color:rgba(255,255,255,0.28);"); } else { setStyleSheet("background-color:rgba(255,255,255,0.2);"); } //当消息为主窗口时,发送折叠信息给App if(true == m_bMain) { //当剩余条数大于0, 且是折叠状态则显示剩余标签 if((true == m_bFold) && (m_nShowLeftCount > 0)) { emit Sig_onMainEnter(); } else { emit Sig_onMainLeave(); //点击后也让app的分层底图恢复原色 m_pAppVLaout->setContentsMargins(0,0,0,6); //假如展开,剩余条目显示不可见,则SingleMsg的内容空白恢复正常,即底部多出6个px的空隙 m_pShowLeftItemLabel->setVisible(false); } emit Sig_setAppFoldFlag(m_bFold); } } return; } void SingleMsg::resizeEvent(QResizeEvent *event) { Q_UNUSED(event); } void SingleMsg::mainMsgSetFold() { //当消息为主窗口时,由主消息设置折叠 if(true == m_bMain) { //置为true,表示折叠 m_bFold = true; setBodyLabelWordWrap(false); //当剩余条数大于0, 且是折叠状态则显示剩余标签 if(m_nShowLeftCount > 0) { m_pAppVLaout->setContentsMargins(0,0,0,0); //假如折叠,剩余条目显示将可见,则SingleMsg的内容均无空隙 m_pShowLeftItemLabel->setVisible(true); } emit Sig_setAppFoldFlag(true); } } //开启多消息展开时动画 void SingleMsg::startAnimationUnfold() { int width = this->width(); int height = this->height(); qDebug()<<"SingleMsg::startAnimationUnfold"<removeWidget(m_pSingleWidget); m_pAnimationBaseMapWidget->setFixedSize(width, 0); m_pAnimationBaseMapWidget->setVisible(true); m_pAppVLaout->addWidget(m_pAnimationBaseMapWidget, 0, Qt::AlignHCenter); this->setVisible(true); if(true == m_strBody.isEmpty()) { height = 90; } else { height = 114; } //设置show动画 DiyPropertyAnimation* pAnimation = new DiyPropertyAnimation(m_pSingleWidget, "geometry"); pAnimation->setDuration(300); connect(pAnimation, SIGNAL(Sig_currentRect(int, int, int, int)), this, SLOT(updateUnfoldMove(int, int, int, int))); connect(pAnimation, SIGNAL(finished()), this, SLOT(onUnfoldFinish())); pAnimation->setStartValue(QRect(0, 0, width, height)); pAnimation->setEndValue(QRect(0, height, width, height)); pAnimation->start(QAbstractAnimation::DeleteWhenStopped); } //开启多消息折叠时动画 void SingleMsg::startAnimationFold() { int width = this->width(); int height = this->height(); qDebug()<<"SingleMsg::startAnimationFold"<setFixedSize(380, (height - 6)); m_pAnimationBaseMapWidget->setVisible(true); m_pAppVLaout->removeWidget(m_pSingleWidget); m_pAppVLaout->addWidget(m_pAnimationBaseMapWidget, 0, Qt::AlignHCenter); //设置show动画 DiyPropertyAnimation* pAnimation = new DiyPropertyAnimation(m_pSingleWidget, "geometry"); pAnimation->setDuration(300); connect(pAnimation, SIGNAL(Sig_currentRect(int, int, int, int)), this, SLOT(updateFoldMove(int, int, int, int))); connect(pAnimation, SIGNAL(finished()), this, SLOT(onFoldFinish())); pAnimation->setStartValue(QRect(0, 0, width, height)); pAnimation->setEndValue(QRect(0, height, width, height)); pAnimation->start(QAbstractAnimation::DeleteWhenStopped); } //开启删除左移动画 void SingleMsg::startAnimationDeleLeftMove() { int nWidth = this->width(); int nHeight = this->height(); QDateTime currentDateTime(QDateTime::currentDateTime()); QString strCurrentTime = currentDateTime.toString("hh:mm:ss.zzz"); qDebug()<removeWidget(m_pSingleWidget); m_pAnimationBaseMapWidget->setFixedSize(nWidth, nHeight); m_pAnimationBaseMapWidget->setVisible(true); m_pAppVLaout->addWidget(m_pAnimationBaseMapWidget, 0, Qt::AlignHCenter); //设置show动画 DiyPropertyAnimation* pAnimation = new DiyPropertyAnimation(m_pSingleWidget, "geometry"); pAnimation->setDuration(150); connect(pAnimation, SIGNAL(Sig_currentRect(int, int, int, int)), this, SLOT(updateDeleLeftMove(int, int, int, int))); connect(pAnimation, SIGNAL(finished()), this, SLOT(onDeleLeftMoveFinish())); pAnimation->setStartValue(QRect(0, 0, nWidth, nHeight)); pAnimation->setEndValue(QRect(0 - nWidth, 0, nWidth, nHeight)); pAnimation->start(QAbstractAnimation::DeleteWhenStopped); } //开启删除上移动画 void SingleMsg::startAnimationDeleUpperMove() { int width = this->width(); int height = this->height(); QDateTime currentDateTime(QDateTime::currentDateTime()); QString strCurrentTime = currentDateTime.toString("hh:mm:ss.zzz"); qDebug()<setDuration(150); connect(pAnimation, SIGNAL(Sig_currentRect(int, int, int, int)), this, SLOT(updateDeleUpperMove(int, int, int, int))); connect(pAnimation, SIGNAL(finished()), this, SLOT(onDeleUpperMoveFinish())); pAnimation->setStartValue(QRect(0, 0, width, height)); pAnimation->setEndValue(QRect(0, 0 - height, width, height)); pAnimation->start(QAbstractAnimation::DeleteWhenStopped); } //通知中心或者收纳盒中的删除 void SingleMsg::onDele() { if((true == m_bMain) && (true == m_bFold) && (m_nShowLeftCount > 0)) { m_pAppVLaout->setContentsMargins(0,0,0,6); emit Sig_notifyAppHideBaseMap(); //通知隐藏应用的底图部件,但保留显示底部6px的空白 } QTimer* pSetDeleDelayTimer = new QTimer(this); pSetDeleDelayTimer->setSingleShot(true); //设置一个单次定时器,只为延迟2毫秒执行删除 connect(pSetDeleDelayTimer, SIGNAL(timeout()), this, SLOT(startAnimationDeleLeftMove())); pSetDeleDelayTimer->start(2); return; } //通知中心消息收纳至收纳盒 void SingleMsg::onTakeIn() { if((true == m_bMain) && (true == m_bFold) && (m_nShowLeftCount > 0)) { emit Sig_onTakeinWholeApp(); } else { emit Sig_onTakeInSingleMsg(this); } return; } //收纳盒消息恢复至通知中心 void SingleMsg::onRecover() { if((true == m_bMain) && (true == m_bFold) && (m_nShowLeftCount > 0)) { emit Sig_onRecoverWholeApp(); } else { emit Sig_onRecoverSingleMsg(this); } return; } //更新展开的移动数据 void SingleMsg::updateUnfoldMove(int x1, int y1, int x2, int y2) { Q_UNUSED(x1); //首先将填充控件的高度不断增加直至6 if(y1 <= 6) { m_pAppVLaout->setContentsMargins(0, 0, 0, y1); } else { m_pAppVLaout->setContentsMargins(0, 0, 0, 6); //当填充控件增加直至6以后 m_pSingleWidget->setGeometry(0, (y1 - y2), x2, (y2 - 6)); //(y2 - 6)即为m_pSingleWidget的本来高度 m_pAnimationBaseMapWidget->setFixedSize(x2, (y1 - 6)); } return; } //更新折叠的移动数据 void SingleMsg::updateFoldMove(int x1, int y1, int x2, int y2) { Q_UNUSED(x1); //m_pSingleWidget的本来高度 int nHeight = y2 - 6; //首先将m_pSingleWidget慢慢消失 if(y1 <= nHeight) { m_pSingleWidget->setGeometry(0, (0 - y1), x2, nHeight); m_pAnimationBaseMapWidget->setFixedSize(x2, (nHeight - y1)); } else { m_pSingleWidget->setGeometry(0, (0 - nHeight), x2, nHeight); //当m_pSingleWidget消失后,开始将底部6个px的空白消失 m_pAnimationBaseMapWidget->setFixedSize(x2, 0); m_pAppVLaout->setContentsMargins(0, 0, 0, (6 - (y1 - nHeight))); } return; } //处理展开完成时的函数 void SingleMsg::onUnfoldFinish() { m_pAppVLaout->removeWidget(m_pAnimationBaseMapWidget); m_pAnimationBaseMapWidget->setVisible(false); m_pAppVLaout->addWidget(m_pSingleWidget); } //处理折叠完成时的函数 void SingleMsg::onFoldFinish() { this->setVisible(false); m_pAppVLaout->removeWidget(m_pAnimationBaseMapWidget); m_pAnimationBaseMapWidget->setVisible(false); m_pAppVLaout->addWidget(m_pSingleWidget); setFoldFlag(true); setBodyLabelWordWrap(false); emit Sig_notifyAppShowBaseMap(); } //更新删除左移时的移动数据 void SingleMsg::updateDeleLeftMove(int x1, int y1, int x2, int y2) { Q_UNUSED(y1); m_pSingleWidget->setGeometry(x1, 0, x2, y2); } //处理删除左移完成时的函数 void SingleMsg::onDeleLeftMoveFinish() { startAnimationDeleUpperMove(); } //更新删除上移时的移动数据 void SingleMsg::updateDeleUpperMove(int x1, int y1, int x2, int y2) { Q_UNUSED(x1); //y2-6表示填充控件的高度,y1为负数,首先将填充控件的高度不断减少直至0 if((y2 - 6 + y1) >= 0) { m_pAnimationBaseMapWidget->setFixedSize(x2, (y2 - 6 + y1)); } else { m_pAnimationBaseMapWidget->setVisible(false); //当填充控件减至0以后,就需要减少底部6个px的空白 m_pAppVLaout->setContentsMargins(0,0,0,(y2 + y1)); } } //处理删除上移完成时的函数 void SingleMsg::onDeleUpperMoveFinish() { if((true == m_bMain) && (true == m_bFold) && (m_nShowLeftCount > 0)) { emit Sig_onDeleteAppMsg(); } else { emit Sig_onDeleSingleMsg(this); } } ukui-sidebar/src/plugins/notification_plugin/notification_plugin.pro0000644000175000017500000000336213642562542025201 0ustar fengfeng#------------------------------------------------- # # Project created by QtCreator 2020-01-08T16:23:49 # #------------------------------------------------- QT += core gui widgets svg TARGET = notification_plugin TEMPLATE = lib CONFIG += plugin DESTDIR = ../notification_plugins # The following define makes your compiler emit warnings if you use # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ diypropertyanimation.cpp \ notification_plugin.cpp \ appmsg.cpp \ scrollareawidget.cpp \ takeinboxtoolbutton.cpp \ monitorthread.cpp \ singlemsg.cpp \ buttonwidget.cpp INCLUDEPATH += ../../plugin-interface HEADERS += \ diypropertyanimation.h \ notification_plugin.h \ appmsg.h \ scrollareawidget.h \ takeinboxtoolbutton.h \ monitorthread.h \ singlemsg.h \ buttonwidget.h DISTFILES += notification_plugin.json unix { target.path = /usr/lib/ukui-sidebar/notification INSTALLS += target translation.path = /usr/share/ukui-sidebar-notification translation.files += ../../../translations/notification_plugin/*.ts translation.files += ../../../translations/notification_plugin/*.qm INSTALLS += translation } RESOURCES += \ notification_plugin.qrc ukui-sidebar/src/plugins/notification_plugin/images/0000755000175000017500000000000013634067640021654 5ustar fengfengukui-sidebar/src/plugins/notification_plugin/images/box-24.svg0000644000175000017500000000110013634067640023400 0ustar fengfeng ukui-sidebar/src/plugins/notification_plugin/images/exitbox-24.svg0000644000175000017500000000120413634067640024277 0ustar fengfeng ukui-sidebar/src/plugins/notification_plugin/images/hover.svg0000644000175000017500000000104713626422413023514 0ustar fengfeng ukui-sidebar/src/plugins/notification_plugin/images/box-14-translucent.svg0000644000175000017500000000113513634067640025747 0ustar fengfeng ukui-sidebar/src/plugins/notification_plugin/images/hover-translucent.svg0000644000175000017500000000103113626422413026045 0ustar fengfeng ukui-sidebar/src/plugins/notification_plugin/images/box-16.svg0000644000175000017500000000110413634067640023405 0ustar fengfeng ukui-sidebar/src/plugins/notification_plugin/images/exitbox-16-translucent.svg0000644000175000017500000000122113634067640026637 0ustar fengfeng ukui-sidebar/src/plugins/notification_plugin/images/exitbox-14-translucent.svg0000644000175000017500000000124213634067640026640 0ustar fengfeng ukui-sidebar/src/plugins/notification_plugin/images/box-16-translucent.svg0000644000175000017500000000112013634067640025743 0ustar fengfeng ukui-sidebar/src/plugins/notification_plugin/images/exitbox-16.svg0000644000175000017500000000120513634067640024301 0ustar fengfeng ukui-sidebar/src/plugins/clipboardPlugin/0000755000175000017500000000000013642562542017461 5ustar fengfengukui-sidebar/src/plugins/clipboardPlugin/translations/0000755000175000017500000000000013642562542022202 5ustar fengfengukui-sidebar/src/plugins/clipboardPlugin/translations/test_zh_CN.qm0000644000175000017500000000115313642562542024601 0ustar fengfeng #include #include #include #include ClipboardSignal *globalClipboardSignal; SidebarClipboardPlugin::SidebarClipboardPlugin(QObject *parent) { Q_UNUSED(parent); translator = new QTranslator; QLocale locale; //获取系统语言环境 if ( locale.language() == QLocale::Chinese ) { qDebug() << "中文环境" ; translator->load(QString(":/translations/test_zh_CN.qm")); //选择翻译文件 QApplication::installTranslator(translator); } installEventFilter(this); m_pSidebarClipboardWidget = new QWidget(); m_pSidebarClipboardWidget->setObjectName("ClipboardWidget"); m_pSidebarClipboardWidget->setContentsMargins(0,0,0,0); m_pClipboardLaout = new QVBoxLayout; m_pClipboardLaout->setContentsMargins(0,0,0,0); m_pShortcutOperationListWidget = new ClipBoardLisetWidget; m_pSearchWidgetListWidget = new QListWidget; m_pSideBarClipboardLable = new QLabel(tr("No clip content")); connect(this, &SidebarClipboardPlugin::Itemchange, this, &SidebarClipboardPlugin::ItemNumchagedSlots); m_pSearchWidgetListWidget->setFixedSize(400, 42); m_pShortcutOperationListWidget->setContentsMargins(0,0,0,0); m_pSearchWidgetListWidget->setContentsMargins(0,0,0,0); createFindClipboardWidgetItem(); m_pClipboardLaout->addWidget(m_pSearchWidgetListWidget); m_pClipboardLaout->addWidget(m_pShortcutOperationListWidget); m_pClipboardLaout->addWidget(m_pSideBarClipboardLable); m_pSidebarClipboardWidget->setLayout(m_pClipboardLaout); m_pShortcutOperationListWidget->setVisible(false); m_pShortcutOperationListWidget->setObjectName("ShortcutOperationList"); m_pSearchWidgetListWidget->setObjectName("SearchWidgetListWidget"); m_pSideBarClipboardLable->setObjectName("SideBarClipboardLable"); m_pSidebarClipboard = QApplication::clipboard(); connect(m_pSidebarClipboard, &QClipboard::dataChanged, this, [=]() { const QMimeData *mimeData = new QMimeData(); mimeData = m_pSidebarClipboard->mimeData(); createWidgetEntry(mimeData); }); /* 加载样式表 */ QFile file(SIDEBAR_CLIPBOARD_QSS_PATH); if (file.open(QFile::ReadOnly)) { QString strQss = QLatin1String(file.readAll()); m_pSidebarClipboardWidget->setStyleSheet(strQss); file.close(); } } /* 构造原型的QMimeData数据类型 */ QMimeData * SidebarClipboardPlugin::copyMinedata(const QMimeData* mimeReference) { QMimeData *mimecopy = new QMimeData(); foreach (QString format, mimeReference->formats()) { QByteArray data = mimeReference->data(format); // if (format.startsWith("x-special/ukui-copied-files")) { // int indexBegin = format.indexOf('""') + 1; // int indexEnd = format.indexOf('""', indexBegin); // format = format.mid(indexBegin, indexEnd - indexBegin); // } mimecopy->setData(format, data); // qDebug() << "剪贴板数据的格式" << format; } return mimecopy; } /* 获取剪贴板的中widgetItem这一条目 */ QListWidget* SidebarClipboardPlugin::getClipbaordListWidget() { if (m_pShortcutOperationListWidget == nullptr) { return nullptr; } else { return m_pShortcutOperationListWidget; } } /* 创建与侧边栏主app通信类 */ SidebarClipBoardSignal* SidebarClipboardPlugin :: createClipSignal() { m_pClipSignal = new ClipboardSignal; globalClipboardSignal = m_pClipSignal; return m_pClipSignal; } /* 侧边栏接口,将整个剪贴板界面set进入侧边栏 */ QWidget* SidebarClipboardPlugin::getClipbaordGroupBox() { if (m_pSidebarClipboardWidget == nullptr) { return nullptr; } else { return m_pSidebarClipboardWidget; } } /* 创建查找条目 */ void SidebarClipboardPlugin::createFindClipboardWidgetItem() { QListWidgetItem *pListWidgetItem = new QListWidgetItem; pListWidgetItem->setFlags(Qt::NoItemFlags); m_pSearchArea = new SearchWidgetItemContent; connect(m_pSearchArea->m_pClearListWidgetButton, &QPushButton::clicked, this, &SidebarClipboardPlugin::removeAllWidgetItem); connect(m_pSearchArea->m_pLineEditArea, SIGNAL(textChanged(QString)), this, SLOT(searchClipboardLableTextSlots(QString))); pListWidgetItem->setSizeHint(QSize(400,38)); m_pSearchWidgetListWidget->insertItem(0,pListWidgetItem); m_pSearchWidgetListWidget->setItemWidget(pListWidgetItem, m_pSearchArea); } /*创建Widgetitem条目*/ void SidebarClipboardPlugin::createWidgetEntry(const QMimeData *mimeData) { if (nullptr == mimeData) { qWarning() << "createWidgetEntry形参mimeData为空, 不创建"; return; } QString text; QListWidgetItem *pListWidgetItem = new QListWidgetItem; ClipboardWidgetEntry *w = new ClipboardWidgetEntry; w->setFixedSize(397, 42); if (nullptr == mimeData->urls().value(0).toString()) { text = mimeData->text(); qDebug() << "text文本数据为:" << text; } else if(mimeData->urls().value(0).toString() != ""){ QList fileUrls = mimeData->urls(); for (int i = 0; i < fileUrls.size(); ++i) { text += fileUrls.value(i).toString(); } qDebug() << "text文本URL为:" << text; } else { qWarning() << "剪贴板数据为空"; return; } if (text == "") { qWarning() << "text文本为空"; return ; } /* 当有重复的时候将会置顶 */ if(booleanExistWidgetItem(text)) { qDebug() << "此条内容已存在,就是当前置顶的条数"; delete pListWidgetItem; delete w; return; } /* hash插入QMimeData,保留原数据 */ registerMimeData(w, copyMinedata(mimeData)); registerLabelText(w, text); /* 当超过一定数目的WidgetItem数目时,删除最后一条消息 */ if (m_pShortcutOperationListWidget->count() >= WIDGET_ENTRY_COUNT) { removeLastWidgetItem(); } pListWidgetItem->setSizeHint(QSize(397,42)); pListWidgetItem->setFlags(Qt::NoItemFlags); //设置...字样 QFontMetrics fontMetrics(w->m_pCopyDataLabal->font()); int fontSize = fontMetrics.width(text); QString formatBody = text; if(fontSize > (200 - 70)) { QStringList list = formatBody.split("\n"); if (list.size() >= 2) { //当有几行时,只需要截取第一行就行,在第一行后面加... formatBody = list.at(0); int oneFontSize = fontMetrics.width(formatBody); if (oneFontSize > (200 - 50)) { formatBody = fontMetrics.elidedText(formatBody, Qt::ElideRight, 200 - 50); } formatBody = fontMetrics.elidedText(formatBody, Qt::ElideRight, oneFontSize - 1); } else { //说明只存在一行,在最后面加...就行 formatBody = fontMetrics.elidedText(formatBody, Qt::ElideRight, 200 - 50); } } else { QStringList list = formatBody.split("\n"); if (list.size() >= 2) { formatBody = list.at(0); qDebug() << "第一端" << formatBody; int oneFontSize = fontMetrics.width(formatBody); formatBody = fontMetrics.elidedText(formatBody, Qt::ElideRight, oneFontSize - 1); } } w->m_pCopyDataLabal->setText(formatBody); connect(w->m_pPopButton, &QPushButton::clicked, this, [=](){ this->popButtonSlots(w); }); connect(w->m_pEditButon, &QPushButton::clicked, this, [=](){ this->editButtonSlots(w); }); connect(w->m_pRemoveButton, &QPushButton::clicked, this, [=](){ this->removeButtonSlots(w); }); m_pShortcutOperationListWidget->insertItem(0, pListWidgetItem); m_pShortcutOperationListWidget->setItemWidget(pListWidgetItem, w); registerWidgetItem(w, pListWidgetItem); emit Itemchange(); } /* 注册WidgetItem条目与widgetItem的键值对关系 */ void SidebarClipboardPlugin::registerWidgetItem(ClipboardWidgetEntry *key, QListWidgetItem *value) { if (nullptr == key || nullptr == value) { qWarning() << "注册:ClipboardWidgetEntry *key," << key << "QListWidgetItem *value值有问题" << value; return; } if (m_pclipboardEntryItem.value(key)) { qWarning() << "注册:value已存在"; return; } m_pclipboardEntryItem.insert(key, value); return; } /* 从hash表中获取QListWidgetItem */ QListWidgetItem *SidebarClipboardPlugin::getWidgetItem(ClipboardWidgetEntry *key) { if (key == nullptr) { qWarning() << "获取:lipboardWidgetEntry *key为空"; return nullptr; } return m_pclipboardEntryItem.value(key); } void SidebarClipboardPlugin::removeWidgetItem(ClipboardWidgetEntry *key) { if (nullptr == key) { qWarning() << "删除:lipboardWidgetEntry *key 为空"; return; } m_pclipboardEntryItem.remove(key); return; } //移除所有的widgetItem的值 void SidebarClipboardPlugin::removeHashAllWidgetItem() { QHash::const_iterator iter1 = m_pclipboardEntryItem.constBegin(); //遍历hash,方法1 QHash::const_iterator delIndex = iter1; while ((delIndex = iter1) != m_pclipboardEntryItem.constEnd()) { ++iter1; m_pclipboardEntryItem.remove(delIndex.key()); } return; } /* 注册Mindata数据类型,保存到hash表中 */ void SidebarClipboardPlugin::registerMimeData(ClipboardWidgetEntry *key, const QMimeData *value) { if (key == nullptr || value == nullptr) { qWarning() << "key == nullptr || value == nullptr:" << key << value; return; } if (m_pclipbordMimeData.value(key)) { qWarning() << "hash表中已存在"; return; } m_pclipbordMimeData.insert(key, value); return; } /* 获取Mindata数据类型 */ const QMimeData* SidebarClipboardPlugin::getMimeData(ClipboardWidgetEntry *key) { if (key == nullptr) { qWarning() << "ClipboardWidgetEntry *key为空" << key; return nullptr; } return m_pclipbordMimeData.value(key); } /* 移除Mindata数据类型 */ void SidebarClipboardPlugin::removeMimeData(ClipboardWidgetEntry *key) { if (nullptr == key) { qWarning() << "删除:ClipboardWidgetEntry *key 为空"; return; } m_pclipbordMimeData.remove(key); return; } //移除所有的Mindata数据类型 void SidebarClipboardPlugin::removeHashAllMimeData() { QHash::const_iterator iter1 = m_pclipbordMimeData.constBegin(); //遍历hash,方法1 QHash::const_iterator delIndex = iter1; while ((delIndex = iter1) != m_pclipbordMimeData.constEnd()) { const QMimeData* userInfo = (const QMimeData*)delIndex.value(); if (userInfo != NULL) { delete userInfo; userInfo = NULL; } ++iter1; m_pclipbordMimeData.remove(delIndex.key()); } return; } //注册条目中的lable与条目中的原始字符串文本相对应关系 void SidebarClipboardPlugin::registerLabelText(ClipboardWidgetEntry*key, QString value) { if (nullptr == key || nullptr == value) { qWarning() << "QLabel *key," << key << "QString *value值有问题" << value; return; } if (m_pLabelText.value(key) != nullptr) { qWarning() << "注册:value已存在"; return; } m_pLabelText.insert(key, value); return; } //获取Label中的原始文本 QString SidebarClipboardPlugin::getLabelText(ClipboardWidgetEntry *key) { if (key == nullptr) { qWarning() << "QLabel *key为空" << key; return nullptr; } return m_pLabelText.value(key); } //删除label中保存在hash表中的原始文本 void SidebarClipboardPlugin::removeLabelText(ClipboardWidgetEntry *key) { if (nullptr == key) { qWarning() << "删除:QLabel *key 为空"; return; } m_pLabelText.remove(key); return; } //移除lable hash表中所有键值对 void SidebarClipboardPlugin::removeHashAllLabelText() { QHash::const_iterator iter1 = m_pLabelText.constBegin(); //遍历hash,方法1 QHash::const_iterator delIndex = iter1; while ((delIndex = iter1) != m_pLabelText.constEnd()) { ++iter1; m_pLabelText.remove(delIndex.key()); } return; } /* 将新置顶widget写入到剪贴板中去 */ void SidebarClipboardPlugin::WhetherTopFirst() { qDebug() << "进入了此函数WhetherTopFirst"; /* 获取第一个条目 */ //当删除为第一项时,则自动将第二项置顶 int count = m_pShortcutOperationListWidget->count(); qDebug() << "当前还剩多少条目" << count; QListWidgetItem *PopWidgetItem = m_pShortcutOperationListWidget->item(0); qDebug() << "QListWidgetItem *PopWidgetItem" << PopWidgetItem; if (PopWidgetItem == nullptr) { qWarning() << "从剪贴板获取的PopWidgetItem指针为空"; return; } ClipboardWidgetEntry *tmpWidget = (ClipboardWidgetEntry*)m_pShortcutOperationListWidget->itemWidget(PopWidgetItem); qDebug() << "QWidget *tmpWidget" << tmpWidget; if (tmpWidget == nullptr) { qWarning() << "从剪贴板获取的ClipboardWidgetEntry指针为空"; return; } //获取hash表中minmete数据 const QMimeData* pMimeData = getMimeData(tmpWidget); qDebug() << "dasdasdasdasdasdasd" << pMimeData; m_pSidebarClipboard->setMimeData((QMimeData*)pMimeData, QClipboard::Clipboard); m_pSidebarClipboard->setMimeData((QMimeData*)pMimeData, QClipboard::Selection); return; } /* 置顶槽函数 */ void SidebarClipboardPlugin::popButtonSlots(ClipboardWidgetEntry *w) { if (w == nullptr) { qDebug() << "置顶槽函数ClipboardWidgetEntry *w 为空"; return; } const QMimeData* pMimeData = getMimeData(w); if (nullptr == pMimeData) { qDebug() << "剪贴板元数据不存在"; return; } QListWidgetItem *p = getWidgetItem(w); //获取Item removeWidgetItem(w); //移除hash表中保存的Widget和Item键值对 removeMimeData(w); removeLabelText(w); delete w; w = nullptr; QListWidgetItem *Item = m_pShortcutOperationListWidget->takeItem(m_pShortcutOperationListWidget->row(p)); //删除Item; delete Item; m_pSidebarClipboard->setMimeData((QMimeData*)pMimeData, QClipboard::Clipboard); m_pSidebarClipboard->setMimeData((QMimeData*)pMimeData, QClipboard::Selection); return; } /* 删除槽函数 */ void SidebarClipboardPlugin::removeButtonSlots(ClipboardWidgetEntry *w) { if (w == nullptr) { qWarning() << "删除槽函数ClipboardWidgetEntry *w 为空"; return; } QListWidgetItem *p = getWidgetItem(w); //获取Item int tmp = m_pShortcutOperationListWidget->row(p); //记录删除时哪一行 qDebug() << "在删除中行数removeButtonSlots:" << tmp; removeWidgetItem(w); //移除hash表中保存的Widget和Item键值对 removeMimeData(w); removeLabelText(w); delete w; //释放掉ClipboardWidgetEntry; w = nullptr; QListWidgetItem *item = m_pShortcutOperationListWidget->takeItem(tmp); //删除Item; delete item; /* 判断当前删除的是不是第一个条目 */ if (0 == tmp) { qDebug() << "删除当前的条目为第一个条目"; /* 将新的第一个条目中的内容重新写到剪贴板中去 */ WhetherTopFirst(); } emit Itemchange(); return; } /* 编辑槽函数 */ void SidebarClipboardPlugin::editButtonSlots(ClipboardWidgetEntry *w) { qDebug() << "ClipboardWidgetEntry:::" << w; /* 防止重复创建 */ if (w == nullptr) { qDebug() << "传入值为空"; return; } EditorWidget EditWidget; /* 获取保存在hash表中的数据,改变之前保存的数据 */ QMimeData* pMimeData = (QMimeData*)getMimeData(w); if (nullptr == pMimeData) { qDebug() << "剪贴板元数据不存在"; return; } QListWidgetItem* p_wItem = (QListWidgetItem*)getWidgetItem(w); QString text = getLabelText(w); EditWidget.m_pEditingArea->setText(text); int nRet = EditWidget.exec(); if (nRet == QDialog::Accepted) { QFontMetrics fontMetrics(w->m_pCopyDataLabal->font()); int fontSize = fontMetrics.width(text); QString formatBody = EditWidget.m_pEditingArea->toPlainText(); if(fontSize > (200 - 70)) { QStringList list = formatBody.split("\n"); if (list.size() >= 2) { //当有几行时,只需要截取第一行就行,在第一行后面加... formatBody = list.at(0); int oneFontSize = fontMetrics.width(formatBody); if (oneFontSize > (200 - 50)) { formatBody = fontMetrics.elidedText(formatBody, Qt::ElideRight, 200-50); } formatBody = fontMetrics.elidedText(formatBody, Qt::ElideRight, oneFontSize - 1); } else { //说明只存在一行,在最后面加...就行 formatBody = fontMetrics.elidedText(formatBody, Qt::ElideRight, 200 - 50); } } else { QStringList list = formatBody.split("\n"); if (list.size() >= 2) { formatBody = list.at(0); int oneFontSize = fontMetrics.width(formatBody); formatBody = fontMetrics.elidedText(formatBody, Qt::ElideRight, oneFontSize - 1); } } w->m_pCopyDataLabal->setText(formatBody); pMimeData->setText(EditWidget.m_pEditingArea->toPlainText()); if (EditWidget.m_pEditingArea->toPlainText() != text) { //当编辑后数据改变时,就需要将m_pLabelText中的value改变 removeLabelText(w); registerLabelText(w, EditWidget.m_pEditingArea->toPlainText()); } //获取当前条目所在位置,是不是在第一 int row_num = m_pShortcutOperationListWidget->row(p_wItem); if (row_num == 0) { popButtonSlots(w); } qDebug() << "d当前所在的条木" << row_num; } else if (nRet == QDialog::Rejected) { qDebug() << "不需要做其余操作"; } } /* 当超过限制条数时删除最后一条消息 */ void SidebarClipboardPlugin::removeLastWidgetItem() { ClipboardWidgetEntry *w = (ClipboardWidgetEntry*)m_pShortcutOperationListWidget->itemWidget(m_pShortcutOperationListWidget->item(m_pShortcutOperationListWidget->count()-1)); qDebug() << "当前条目数目" << m_pShortcutOperationListWidget->count(); removeWidgetItem(w); removeMimeData(w); removeLabelText(w); delete w; w = nullptr; QListWidgetItem *tmp = m_pShortcutOperationListWidget->takeItem(m_pShortcutOperationListWidget->count()-1); delete tmp; } /* 判断在ListWidget是否存在,如果不存在则返回fasle,创建,返回true,不创建 */ bool SidebarClipboardPlugin::booleanExistWidgetItem(QString Text) { int tmp = m_pShortcutOperationListWidget->count(); for (int i = 0; i < tmp; i++) { ClipboardWidgetEntry *w = (ClipboardWidgetEntry*)m_pShortcutOperationListWidget->itemWidget(m_pShortcutOperationListWidget->item(i)); QString WidgetText = getLabelText(w); if (WidgetText == Text) { if(i == 0) { qDebug() << "当前的数据就是置顶数据"; return true; } removeButtonSlots(w); return false; } } return false; } /* 删除所有的WidgetItem */ void SidebarClipboardPlugin::removeAllWidgetItem() { int tmp = m_pShortcutOperationListWidget->count(); qDebug() << "m_pShortcutOperationListWidget->count()" << tmp; for (int i = 0; i < tmp; i++) { ClipboardWidgetEntry *w = (ClipboardWidgetEntry*)m_pShortcutOperationListWidget->itemWidget(m_pShortcutOperationListWidget->item(0)); qDebug() << "w--> " << w; removeWidgetItem(w); removeMimeData(w); removeLabelText(w); delete w; QListWidgetItem *tmp = m_pShortcutOperationListWidget->takeItem(0); delete tmp; } emit Itemchange(); } /* 搜索 槽函数 */ void SidebarClipboardPlugin::searchClipboardLableTextSlots(QString Text) { if (Text == "") { return; } qDebug() << "Text" << Text; QHash::const_iterator iter1 = m_pLabelText.constBegin(); while (iter1 != m_pLabelText.constEnd()) { if (iter1.value().contains(Text, Qt::CaseSensitive)) { ClipboardWidgetEntry *p = iter1.key(); ++iter1; popButtonSlots(p); } else { // iter1.key()->hide(); ++iter1; } } return; } /* Item数目发生变化 */ void SidebarClipboardPlugin::ItemNumchagedSlots() { int num = m_pShortcutOperationListWidget->count(); qDebug() << "Item数目发生变化, 当前Item数目" << num; if (num > 0) { m_pSideBarClipboardLable->setVisible(false); m_pShortcutOperationListWidget->setVisible(true); } else { m_pSideBarClipboardLable->setVisible(true); m_pShortcutOperationListWidget->setVisible(false); } } ukui-sidebar/src/plugins/clipboardPlugin/clipboardlisetwidget.h0000644000175000017500000000204513642562542024037 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include "clipboardsignal.h" extern ClipboardSignal *globalClipboardSignal; class ClipBoardLisetWidget :public QListWidget { public: ClipBoardLisetWidget(); protected: void mousePressEvent(QMouseEvent *event); }; #endif // CLIPBOARDLISETWIDGET_H ukui-sidebar/src/plugins/clipboardPlugin/qss/0000755000175000017500000000000013642562542020267 5ustar fengfengukui-sidebar/src/plugins/clipboardPlugin/qss/sideBarSearchArea.css0000644000175000017500000000266513634067640024302 0ustar fengfeng/* 搜索栏的Widget */ QWidget#SearhWidget{ width:380px; height:40; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-right: 0px; padding-top: 0px; padding-bottom:0px; padding-left:0px; background:rgba(19, 19, 20, 1); opacity:0; border: 0px solid rgba(255,255,0,1); } /* 清空所有的WidgetItem按扭 */ QWidget#SearhWidget>QPushButton#CleanList { width:80px; height:34px; margin-top:0px; margin-left:5px; margin-bottom:0px; margin-right:10px; font-size:11px; font-family:Noto Sans CJK SC; font-weight:400; color:rgba(255,255,255,1); line-height:24px; opacity:0.91; border:0px solid rgba(255,0,0,1); } /* 清空所有的WidgetItem按扭悬浮时的效果 */ QWidget#SearhWidget>QPushButton#CleanList:hover{ background-color:rgba(255,255,255,36); /*改变背景色*/ border-style:inset; /*改变边框风格*/ border: 0px solid rgba(255,0,0,1); } /* 清空所有的WidgetItem按扭按下时的效果 */ QWidget#SearhWidget>QPushButton#CleanList:pressed{ background-color:rgba(255,255,255,25); /*改变背景色*/ border-style:inset;/*改变边框风格*/ border: 0px solid rgba(255,0,0,1); } /* 清空所有的QlineEdit按扭 */ QLineEdit#SearchLabel>QPushButton#ClearTextButton { width:9px; height:9px; border-radius:9px; border:0px solid rgba(255,255,0,1); } ukui-sidebar/src/plugins/clipboardPlugin/qss/sideBarEditArea.css0000644000175000017500000000702313642562542023753 0ustar fengfeng/* 编辑的Widget */ QWidget#EditorWidget { width:400px; height:338px; border:0px solid rgba(255, 255, 255, 75%); border-radius:6px; } /* 编辑区域 */ QGroupBox#EditBox { width:362px; height:200px; margin-right: 20px; margin-bottom: 5px; margin-left: 3px; margin-top: 45px; padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px; background:rgba(255,255,255,0.06); opacity:0.06; border-radius:3px; border: 0px solid rgba(255,255,0,1); font-size:24px; font-family:Noto Sans CJK SC; font-weight:400; line-height:34px; color:rgba(255,255,255,1); opacity:0.97; } /* 操作区域,确认取消 */ QGroupBox#OperationBox { width:362px; height:40px; margin-right: 0px; margin-bottom: 0px; margin-left: 20px; margin-top: 0px; border-radius:0px; padding-top:0px; padding-bottom:0px; color:rgba(255,255,255,1); border: 0px; } /* 编辑区域确认按钮 */ QGroupBox#OperationBox>QPushButton#ConfirmButton { width:120px; height:34px; background:rgba(61,107,229,1); margin-top:1px; margin-left:5px; margin-bottom:1px; margin-right:10px; color:rgba(255,255,255,1); border: 0px solid rgba(255,0,0,1); font-size:14px; font-family:Noto Sans CJK SC; font-weight:400; color:rgba(255,255,255,1); line-height:24px; border-radius:4px; } /* 编辑区鼠标悬浮时的效果 */ QGroupBox#OperationBox>QPushButton#ConfirmButton:hover { background-color:rgba(107,142,235,1); /*改变背景色*/ border-style:inset;/*改变边框风格*/ margin-top:1px; /* margin-left:161px;*/ margin-bottom:1px; /* margin-right:20px;*/ border-radius:4px; border: 0px solid rgba(255,0,0,1); } /*编辑区鼠标按下时的效果*/ QGroupBox#OperationBox>QPushButton#ConfirmButton:pressed { background-color:rgba(50,87,202,1); /*改变背景色*/ border-style:inset;/*改变边框风格*/ margin-top:1px; /* margin-left:161px;*/ margin-bottom:1px; /* margin-right:20px;*/ border-radius:4px; border: 0px solid rgba(255,0,0,1); } /* 编辑区域取消按钮 */ QGroupBox#OperationBox>QPushButton#CancelButton { width:120px; height:34px; margin-top:0px; margin-left:124px; margin-bottom:0px; margin-right:5px; border-radius:4px; background-color:rgba(255,255,255,30); opacity:0.12; border: 0px solid rgba(255,0,0,1); color:rgba(255,255,255,1); font-size:14px; font-family:Noto Sans CJK SC; font-weight:400; color:rgba(255,255,255,1); line-height:24px; opacity:0.12; } /* 编辑区域取消按扭悬浮时的效果 */ QGroupBox#OperationBox>QPushButton#CancelButton:hover{ background-color:rgba(255,255,255,36); /*改变背景色*/ border-style:inset; /*改变边框风格*/ border: 0px solid rgba(255,0,0,1); } /* 编辑区域取消按钮按下时的效果 */ QGroupBox#OperationBox>QPushButton#CancelButton:pressed{ background-color:rgba(255,255,255,25); /*改变背景色*/ border-style:inset;/*改变边框风格*/ border: 0px solid rgba(255,0,0,1); } /* 编辑WIdget的编辑区域 */ QGroupBox#EditBox>QTextEdit#EditingArea { font-size:14px; font-weight:400; font-family:Noto Sans CJK SC; color:rgba(255,255,255,1); width:340px; height:180px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; margin-top: 0px; background-color:rgba(255,255,255,0.01); border: 0px solid rgba(255,0,0,1); } ukui-sidebar/src/plugins/clipboardPlugin/qss/sidebarClipboard.css0000644000175000017500000001770113642562542024240 0ustar fengfengQPalette{background:#131314;} /* 搜索栏的Widget */ QWidget#SearhWidget { margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-right: 0px; padding-top: 0px; padding-bottom:0px; padding-left:0px; width:380px; height:40; background:rgba(19, 19, 20, 0); opacity:0; border: 1px solid rgba(255,255,0,1); } /* listWidget的中的widgetitem */ QWidget#WidgetEntry { width:400px; height:42px; margin-top: 0px; margin-bottom: 0px; margin-right: 0px; margin-left: 0px; padding-right: 0px; padding-top: 0px; padding-bottom:0px; padding-left:0px; background:rgba(255, 255, 255, 0); border: 0px solid rgba(255,0,0,1); opacity:0.08; border-bottom: 1px solid rgba(255,255,255,0.08); } /* 设置listWidget的中的widgetitem悬乎状态 */ QWidget#WidgetEntry:hover { background:rgba(255, 255, 255, 36); } /* 显示内容条目Widget中的置顶按钮 */ QWidget#WidgetEntry>QPushButton#PopButton { width:34px; height:34px; margin-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-left: 0px; border: 0px solid rgba(255,0,0,1); background:rgba(255,255,255,30); opacity:0.12; border-radius:3px; } /* 显示内容条目Widget中的置顶按钮悬乎 */ QWidget#WidgetEntry>QPushButton#PopButton:hover { background-color:rgba(255,255,255,36); /*改变背景色*/ opacity:0.2; border: 0px solid rgba(255,0,0,1); } /* 显示内容条目Widget中的置顶按钮按下 */ QWidget#WidgetEntry>QPushButton#PopButton:pressed { background-color:rgba(255,255,255,0.08); /*改变背景色*/ opacity:0.08; border: 0px solid rgba(255,0,0,1); } /* 显示内容条目Widget中的编辑按钮 */ QWidget#WidgetEntry>QPushButton#EditButon { width:34px; height:34px; margin-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-left: 0px; border: 0px solid rgba(255,0,0,1); background:rgba(255,255,255,30); opacity:0.12; border-radius:3px; } /* 显示内容条目Widget中的置编辑钮悬乎 */ QWidget#WidgetEntry>QPushButton#EditButon:hover { background-color:rgba(255,255,255,36); /*改变背景色*/ border-radius:3px; opacity:0.2; border: 0px solid rgba(255,0,0,1); } /* 显示内容条目Widget中的编辑按钮按下 */ QWidget#WidgetEntry>QPushButton#EditButon:pressed { background-color:rgba(255,255,255,25); /*改变背景色*/ border-radius:3px; opacity:0.08; border: 0px solid rgba(255,0,0,1); } /* 显示内容条目Widget中的删除按钮 */ QWidget#WidgetEntry>QPushButton#RemoveButton { width: 34px; height: 34px; margin-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-left: 0px; border: 0px solid rgba(255,0,0,1); background:rgba(255,255,255,30); opacity: 0.12; border-radius: 3px; } /* 显示内容条目Widget中的删除按钮悬乎 */ QWidget#WidgetEntry>QPushButton#RemoveButton:hover { background-color:rgba(255,255,255,36); /*改变背景色*/ opacity:0.2; border-radius:3px; border: 0px solid rgba(255,0,0,1); } /* 显示内容条目Widget中的删除按钮按下 */ QWidget#WidgetEntry>QPushButton#RemoveButton:pressed { background-color:rgba(255,255,255,0.08); /*改变背景色*/ opacity:0.08; border: 0px solid rgba(255,0,0,1); } /* 清空所有的WidgetItem按扭 */ QWidget#SearhWidget>QPushButton#CleanList { width:80px; height:34px; margin-top:0px; margin-left:0px; margin-bottom:0px; margin-right:0px; padding-right: 0px; padding-top: 0px; padding-bottom:0px; padding-left:0px; border-radius:4px; font-size:14px; font-family:Noto Sans CJK SC; font-weight:400; color:rgba(255,255,255,1); line-height:24px; opacity:0.91; border:0px solid rgba(255,0,0,1); } /* 清空所有的WidgetItem按扭悬浮时的效果 */ QWidget#SearhWidget>QPushButton#CleanList:hover{ background-color:rgba(255,255,255,36); /*改变背景色*/ border-style:inset; /*改变边框风格*/ border: 0px solid rgba(255,0,0,1); } /* 清空所有的WidgetItem按扭按下时的效果 */ QWidget#SearhWidget>QPushButton#CleanList:pressed{ background-color:rgba(255,255,255,25); /*改变背景色*/ border-style:inset;/*改变边框风格*/ border: 0px solid rgba(255,0,0,1); } /* 清空所有的QlineEdit按扭 */ QLineEdit#SearchLabel>QPushButton#ClearTextButton { /* width:21px; height:21px;*/ margin-top:0px; margin-left:0px; margin-bottom:2px; margin-right:0px; padding-right: 0px; padding-top: 0px; padding-bottom:0px; padding-left:0px; border-radius:0.5px; border:0px solid rgba(255,255,0,1); } /* 查找栏的Lable */ QWidget#SearhWidget>QLineEdit#SearchLabel { width:280px; height:30px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-right: 0px; padding-top: 0px; padding-bottom:0px; padding-left:3px; background:rgba(0,0,0,0.2); border:0px solid rgba(61,107,229,1); border-radius:4px; font-size:14px; font-family:Noto Sans CJK SC; font-weight:400; color:rgba(255,255,255,1); line-height:24px; opacity:0.91; } /* 查找栏的Lable悬乎状态 */ QWidget#SearhWidget>QLineEdit#SearchLabel:hover { border-style:inset; /*改变边框风格*/ border: 1px solid rgba(61,107,229,1); border-radius:4px; } /* 查找栏的Lable焦点状态 */ QWidget#SearhWidget>QLineEdit#SearchLabel:focus { border-style:inset; /*改变边框风格*/ border: 1px solid rgba(28, 47, 146, 1); border-radius:4px; } /* 显示所有剪贴内容的WidgetList大小 */ QListWidget#ShortcutOperationList { width:400px; height:760px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; margin-top: 0px; padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px; background:rgba(19, 19, 20, 0); opacity:0; border:0px; } QListWidget#SearchWidgetListWidget { width:400px; height:34px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; margin-top: 2px; padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px; background:rgba(19, 19, 20, 0); opacity:0; border: 0px solid rgba(255,0,255,0); border:0px; } /* 显示内容的groupbox大小 */ QGroupBox { width:400px; height:400px; margin-top:0px; margin-left:0px; margin-bottom:0px; margin-right:0px; padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px; border: 0px solid rgba(255,0,0,1); background:rgba(19, 19, 20, 0); opacity:0.05; width:59px; height:19px; font-size:20px; font-family:Noto Sans CJK SC; font-weight:400; color:rgba(255,255,255,1); line-height:34px; opacity:0.97; } /* widget条目的Lable */ QWidget#WidgetEntry>QLabel#EntryLable{ width:200px; height:34px; font-size:15px; font-weight:400; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-right: 0px; padding-top: 0px; padding-bottom:0px; padding-left:3px; font-family:Noto Sans CJK SC; color:rgba(255,255,255,1); line-height:10px; opacity:0.91; border: 0px solid rgba(255,255,0,1); } QListWidget:Item{ margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-right: 0px; padding-top: 0px; padding-bottom:0px; padding-left:0px; background:rgba(19, 19, 20, 0); border: 0px solid rgba(255,255,0,1); } /* 无剪贴板内容字样 */ QLabel#SideBarClipboardLable{ width:70px; height:14px; margin-top:50px; margin-left:165px; margin-bottom:100px; margin-right:132px; font-size:14px; font-family:Noto Sans CJK SC; font-weight:400; color:rgba(255,255,255,1); line-height:28px; opacity:0.57; } ukui-sidebar/src/plugins/clipboardPlugin/clipboardsignal.h0000644000175000017500000000167413634067640022777 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 ClipboardWidgetEntry Pop 置顶 EditButton 编辑 Remove 移除 EditorWidget Edit 编辑内容 Confirm 确认 Cancel 取消 QObject ClipBoard 剪贴板 Show the folder children as icons. SearchWidgetItemContent Clear 清空 search... 搜索... SidebarClipboardPlugin No clip content 无剪贴内容 ukui-sidebar/src/plugins/clipboardPlugin/clipboardPlugin.json0000644000175000017500000000002513626422413023461 0ustar fengfeng{ "Keys" : [ ] } ukui-sidebar/src/plugins/clipboardPlugin/image/0000755000175000017500000000000013642562542020543 5ustar fengfengukui-sidebar/src/plugins/clipboardPlugin/image/editor.svg0000644000175000017500000000165313626422413022551 0ustar fengfeng ukui-sidebar/src/plugins/clipboardPlugin/image/button-close-default-add-background-three.svg0000644000175000017500000000103713626422413031267 0ustar fengfeng ukui-sidebar/src/plugins/clipboardPlugin/image/button-close-hover-click-add-background-one.svg0000644000175000017500000000116613626422413031526 0ustar fengfeng ukui-sidebar/src/plugins/clipboardPlugin/image/delete.svg0000644000175000017500000000151513626422413022522 0ustar fengfeng ukui-sidebar/src/plugins/clipboardPlugin/image/button-close-hover-click-two.svg0000644000175000017500000000104713626422413026711 0ustar fengfeng ukui-sidebar/src/plugins/clipboardPlugin/image/copy.svg0000644000175000017500000000163413626422413022234 0ustar fengfeng ukui-sidebar/src/plugins/clipboardPlugin/clipboardwidgetentry.h0000644000175000017500000000332513642562542024062 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include #include #include #include #include #include #include #define EDIT_SVG_PATH ":/image/editor.svg" #define COPY_SVG_PATH ":/image/copy.svg" #define REMOVE_SVG_PATH ":/image/delete.svg" #define SEARCH_SVG_CLEAN ":/image/button-close-hover-click-two.svg" #define SEARCH_SVG_CLEAN_BACK ":/image/button-close-hover-click-add-background-one.svg" class ClipboardWidgetEntry : public QWidget { public: ClipboardWidgetEntry(QWidget *parent = nullptr); QPushButton *m_pPopButton; QPushButton *m_pEditButon; QPushButton *m_pRemoveButton; QLabel *m_pCopyDataLabal; QHBoxLayout *m_pHLayout; protected: void enterEvent(QEvent *); //进入QWidget瞬间事件 void leaveEvent(QEvent *); //离开QWidget瞬间事件 }; #endif // CLIPBOARDWIDGETENTRY_H ukui-sidebar/src/plugins/clipboardPlugin/searchwidgetitemcontent.h0000644000175000017500000000255413642562542024563 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include #include #include #include "clipboardwidgetentry.h" #define SIDEBAR_SEARCH_QSS_PATH ":/qss/sideBarSearchArea.css" class SearchWidgetItemContent:public QWidget { Q_OBJECT public: SearchWidgetItemContent(QWidget *parent = nullptr); QPushButton *m_pClearTextButton; QPushButton *m_pClearListWidgetButton; QLineEdit *m_pLineEditArea; QHBoxLayout *m_pHBoxLayout; private slots: void textChageSlots(const QString &text); }; #endif // SEARCHWIDGETITEMCONTENT_H ukui-sidebar/src/plugins/clipboardPlugin/clipboardwidgetentry.cpp0000644000175000017500000000546213642562542024421 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 setObjectName("WidgetEntry"); this->setContentsMargins(0,0,0,0); QIcon EditIcon; EditIcon.addFile(EDIT_SVG_PATH); QIcon PopIcon; PopIcon.addFile(COPY_SVG_PATH); QIcon RemoveIcon; RemoveIcon.addFile(REMOVE_SVG_PATH); m_pPopButton = new QPushButton(); // m_pPopButton->setToolTip(tr("Pop")); m_pPopButton->setFixedSize(34, 34); m_pPopButton->setIcon(PopIcon); m_pPopButton->setObjectName("PopButton"); m_pEditButon = new QPushButton(); // m_pEditButon->setToolTip(tr("EditButton")); m_pEditButon->setFixedSize(34, 34); m_pEditButon->setIcon(EditIcon); m_pEditButon->setObjectName("EditButon"); m_pRemoveButton = new QPushButton(); // m_pRemoveButton->setToolTip(tr("Remove")); m_pRemoveButton->setFixedSize(34, 34); m_pRemoveButton->setIcon(RemoveIcon); m_pRemoveButton->setObjectName("RemoveButton"); m_pCopyDataLabal = new QLabel(); m_pCopyDataLabal->setObjectName("EntryLable"); m_pCopyDataLabal->setFixedSize(260, 34); m_pHLayout = new QHBoxLayout(); m_pHLayout->setContentsMargins(0,0,0,0); m_pHLayout->addItem(new QSpacerItem(10,20)); m_pHLayout->addWidget(m_pCopyDataLabal); m_pHLayout->addItem(new QSpacerItem(118, 20)); m_pHLayout->addWidget(m_pPopButton); m_pHLayout->addWidget(m_pEditButon); m_pHLayout->addWidget(m_pRemoveButton); m_pHLayout->addItem(new QSpacerItem(10,20)); m_pHLayout->setSpacing(5); m_pPopButton->setVisible(false); m_pEditButon->setVisible(false); m_pRemoveButton->setVisible(false); this->setLayout(m_pHLayout); } void ClipboardWidgetEntry::enterEvent(QEvent *e) { if(e == nullptr) { return; } m_pPopButton->setVisible(true); m_pEditButon->setVisible(true); m_pRemoveButton->setVisible(true); } void ClipboardWidgetEntry::leaveEvent(QEvent *e) { if(e == nullptr) { return; } m_pPopButton->setVisible(false); m_pEditButon->setVisible(false); m_pRemoveButton->setVisible(false); } ukui-sidebar/src/plugins/clipboardPlugin/clipboardPlugin.pro0000644000175000017500000000307713642562542023330 0ustar fengfeng#------------------------------------------------- # # Project created by QtCreator 2020-01-08T10:30:22 # #------------------------------------------------- QT += core gui QT += widgets TARGET = clipboardPlugin TEMPLATE = lib CONFIG += plugin DESTDIR = ../sidebar_clipboardPlugin_plugins # The following define makes your compiler emit warnings if you use # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 RESOURCES += clipboardPlugin.qrc SOURCES += \ sidebarclipboardplugin.cpp \ clipboardwidgetentry.cpp \ editorwidget.cpp \ searchwidgetitemcontent.cpp \ clipboardlisetwidget.cpp INCLUDEPATH += ../../plugin-interface ../../plugin-signals HEADERS += \ sidebarclipboardplugin.h \ clipboardwidgetentry.h \ clipboardsignal.h \ editorwidget.h \ searchwidgetitemcontent.h \ ../../plugin-signals/sidebarclipboardsignal.h \ clipboardlisetwidget.h DISTFILES += clipboardPlugin.json TRANSLATIONS += test_zh_CN.ts unix { target.path = /usr/lib/ukui-sidebar/sidebar_clipboardPlugin_plugins INSTALLS += target } ukui-sidebar/src/plugins/clipboardPlugin/editorwidget.h0000644000175000017500000000342013642562542022323 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define SIDEBAR_EDITAREA_QSS_PATH ":/qss/sideBarEditArea.css" class EditorWidget : public QDialog { Q_OBJECT public: explicit EditorWidget(); QPushButton *m_pConfirmButton; QPushButton *m_pCancelButton; QTextEdit *m_pEditingArea; QLabel *m_ptileLable; QGroupBox *m_pTitleBox; QGroupBox *m_pEditBox; QGroupBox *m_pOperationBox; QVBoxLayout *m_pMainQVBoxLayout; //主界面垂直布局器 QHBoxLayout *m_ptileLayout; QHBoxLayout *m_pEditLaout; QHBoxLayout *m_pOperationLayout; void titleBox(); void editBox(); void operationBox(); protected: void paintEvent(QPaintEvent *); }; #endif // EDITORWIDGET_H ukui-sidebar/src/plugins/clipboardPlugin/editorwidget.cpp0000644000175000017500000000620113642562542022656 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 EditorWidget::EditorWidget() { installEventFilter(this); m_pMainQVBoxLayout = new QVBoxLayout(); editBox(); operationBox(); m_pConfirmButton->setObjectName("ConfirmButton"); m_pCancelButton->setObjectName("CancelButton"); connect(m_pConfirmButton, &QPushButton::clicked, this, &EditorWidget::accept); connect(m_pCancelButton, &QPushButton::clicked, this, &EditorWidget::reject); m_pEditingArea->setObjectName("EditingArea"); m_pEditBox->setObjectName("EditBox"); m_pOperationBox->setObjectName("OperationBox"); this->setObjectName("EditorWidget"); m_pMainQVBoxLayout->addWidget(m_pEditBox); m_pMainQVBoxLayout->addWidget(m_pOperationBox); this->setWindowFlags(Qt::FramelessWindowHint); QScreen* pScreen = QGuiApplication::primaryScreen(); QRect ScreenSize = pScreen->availableGeometry(); int m_nScreenWidth = ScreenSize.width(); //屏幕分辨率的宽 int m_nScreenHeight = ScreenSize.height(); //屏幕分辨率的高 move(m_nScreenWidth/2-130, m_nScreenHeight/2-180); setLayout(m_pMainQVBoxLayout); setAttribute(Qt::WA_TranslucentBackground); QFile file(SIDEBAR_EDITAREA_QSS_PATH); if (file.open(QFile::ReadOnly)) { QString strQss = QLatin1String(file.readAll()); QString strPaletteColor = strQss.mid(20, 7); this->setPalette(QPalette(QColor(strPaletteColor))); this->setStyleSheet(strQss); file.close(); } } void EditorWidget::editBox() { m_pEditingArea = new QTextEdit(); m_pEditLaout = new QHBoxLayout; m_pEditLaout->addWidget(m_pEditingArea); m_pEditBox = new QGroupBox(tr("Edit")); m_pEditBox->setLayout(m_pEditLaout); } void EditorWidget::operationBox() { m_pConfirmButton = new QPushButton(tr("Confirm")); m_pCancelButton = new QPushButton(tr("Cancel")); m_pOperationLayout = new QHBoxLayout; m_pOperationLayout->addWidget(m_pCancelButton); m_pOperationLayout->addWidget(m_pConfirmButton); m_pOperationBox = new QGroupBox(); m_pOperationBox->setLayout(m_pOperationLayout); } void EditorWidget::paintEvent(QPaintEvent *) { QStyleOption opt; opt.init(this); QPainter p(this); p.setBrush(QBrush(QColor("#131314"))); p.setOpacity(0.7); p.setPen(Qt::NoPen); p.setRenderHint(QPainter::Antialiasing); // 反锯齿; p.drawRoundedRect(opt.rect,6,6); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } ukui-sidebar/src/plugins/clipboardPlugin/searchwidgetitemcontent.cpp0000644000175000017500000000655313642562542025121 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include SearchWidgetItemContent::SearchWidgetItemContent(QWidget *parent) { Q_UNUSED(parent); this->setObjectName("SearhWidget"); this->setContentsMargins(0,0,0,0); m_pClearListWidgetButton = new QPushButton(tr("Clear")); m_pClearListWidgetButton->setObjectName("CleanList"); m_pClearTextButton = new QPushButton; m_pClearTextButton->setFixedSize(19, 21); m_pClearTextButton->setIconSize(QSize(9, 9)); m_pClearTextButton->setObjectName("ClearTextButton"); m_pClearTextButton->setStyleSheet("QPushButton:pressed{border-image:url(:/image/button-close-hover-click-add-background-one.svg)}"); m_pClearTextButton->setStyleSheet("QPushButton:hover{border-image:url(:/image/button-close-hover-click-add-background-one.svg)}"); QIcon ClearTextEditIcon; ClearTextEditIcon.addFile(SEARCH_SVG_CLEAN); m_pClearTextButton->setIcon(ClearTextEditIcon); m_pClearTextButton->setCursor(Qt::ArrowCursor); m_pHBoxLayout = new QHBoxLayout; m_pHBoxLayout->setContentsMargins(0,0,0,0); m_pLineEditArea = new QLineEdit; m_pLineEditArea->setFixedSize(290, 30); m_pLineEditArea->setObjectName("SearchLabel"); m_pLineEditArea->setContentsMargins(0,0,0,0); m_pLineEditArea->setPlaceholderText(tr("search...")); connect(m_pLineEditArea, &QLineEdit::textChanged, this, &SearchWidgetItemContent::textChageSlots); /* Sets the font color of the placeholder */ QBrush LineEditBrush; QPalette paletteLineEdit; QColor ColorPlaceholderText(255,255,255,89); LineEditBrush = paletteLineEdit.placeholderText(); LineEditBrush.setColor(ColorPlaceholderText); paletteLineEdit.setBrush(QPalette::PlaceholderText, LineEditBrush); m_pLineEditArea->setPalette(paletteLineEdit); QWidgetAction* action = new QWidgetAction(m_pLineEditArea); action->setDefaultWidget(m_pClearTextButton); m_pLineEditArea->addAction(action, QLineEdit::TrailingPosition); m_pClearTextButton->setVisible(false); connect(m_pClearTextButton, &QPushButton::clicked, this, [=](){ m_pLineEditArea->setText(""); }); QSpacerItem *item = new QSpacerItem(10,20); QSpacerItem *item1 = new QSpacerItem(10,20); m_pHBoxLayout->addItem(item); m_pHBoxLayout->addWidget(m_pLineEditArea); m_pHBoxLayout->addWidget(m_pClearListWidgetButton); m_pHBoxLayout->addItem(item1); m_pHBoxLayout->setSpacing(10); this->setLayout(m_pHBoxLayout); } void SearchWidgetItemContent::textChageSlots(const QString &text) { if (text != "") { m_pClearTextButton->setVisible(true); } else { m_pClearTextButton->setVisible(false); } } ukui-sidebar/src/plugins/clipboardPlugin/sidebarclipboardplugin.h0000644000175000017500000001163013642562542024343 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "clipboardpluginiface.h" #include "clipboardwidgetentry.h" #include "sidebarclipboardsignal.h" #include "searchwidgetitemcontent.h" #include "editorwidget.h" #include "clipboardsignal.h" #include "clipboardlisetwidget.h" #define WIDGET_ENTRY_COUNT 5 #define SIDEBAR_CLIPBOARD_QSS_PATH ":/qss/sidebarClipboard.css" //static SidebarClipboardPlugin *global_instance = nullptr; class SidebarClipboardPlugin:public QObject, public ClipboardInterface { Q_OBJECT Q_PLUGIN_METADATA(IID "org.ukui.sidebar-qt.plugin-iface.ClipboardInterface" FILE "clipboardPlugin.json") Q_INTERFACES(ClipboardInterface) public: SidebarClipboardPlugin(QObject *parent = 0); //plugin implement 统一接口 const QString name() override {return QObject::tr("ClipBoard");} PluginType pluginType() override {return PluginType::ClipBoard;} const QString description() override {return QObject::tr("Show the folder children as icons.");} const QIcon icon() override {return QIcon::fromTheme("view-grid-symbolic", QIcon::fromTheme("folder"));} void setEnable(bool enable) override {Q_UNUSED(enable)} bool isEnable() override {return true;} /* 剪贴板接口 */ virtual QListWidget* getClipbaordListWidget() override; virtual SidebarClipBoardSignal* createClipSignal() override; virtual QWidget* getClipbaordGroupBox() override; // static SidebarClipboardPlugin *getInstance(); /* 剪贴板成员和成员函数 */ QHash m_pclipboardEntryItem; QHash m_pclipbordMimeData; //保留从剪贴板拿到原数据 QHash m_pLabelText; //条目中Label与label中的text对应关系 QListWidget *m_pShortcutOperationListWidget; QListWidget *m_pSearchWidgetListWidget; QGroupBox *m_pSidebarClipboardBox; QWidget *m_pSidebarClipboardWidget; QLabel *m_pSideBarClipboardLable; QVBoxLayout *m_pClipboardLaout; QClipboard *m_pSidebarClipboard; ClipboardSignal *m_pClipSignal; SearchWidgetItemContent *m_pSearchArea; QMimeData mineData; QTranslator *translator; /* 注册Widget条目界面和Item的hash表 */ void registerWidgetItem(ClipboardWidgetEntry *key, QListWidgetItem *value); QListWidgetItem* getWidgetItem(ClipboardWidgetEntry *key); void removeWidgetItem(ClipboardWidgetEntry *key); void removeHashAllWidgetItem(); /* 注册Widget条目和剪贴板数据的关系 */ void registerMimeData(ClipboardWidgetEntry *key, const QMimeData *value); const QMimeData* getMimeData(ClipboardWidgetEntry *key); void removeMimeData(ClipboardWidgetEntry *key); void removeHashAllMimeData(); /* 注册Widget界面和lable中的文本的关系 */ void registerLabelText(ClipboardWidgetEntry *key, QString value); //注册条目中的lable与条目中的原始字符串文本相对应关系 QString getLabelText(ClipboardWidgetEntry *key); void removeLabelText(ClipboardWidgetEntry *key); void removeHashAllLabelText(); void removeLastWidgetItem(); //限制复制条数 bool booleanExistWidgetItem(QString Text); void createFindClipboardWidgetItem(); /* 创建查找条目 */ void WhetherTopFirst(); /* 设置新置顶的条目写入到剪贴版中去 */ QMimeData *copyMinedata(const QMimeData* mimeReference); signals: void Itemchange(); void EditConfirmButtonSignal(ClipboardWidgetEntry *, EditorWidget*); public slots: void createWidgetEntry(const QMimeData *mimeData); void popButtonSlots(ClipboardWidgetEntry *w); void editButtonSlots(ClipboardWidgetEntry *w); void removeButtonSlots(ClipboardWidgetEntry *w); void removeAllWidgetItem(); void searchClipboardLableTextSlots(QString Text); void ItemNumchagedSlots(); }; #endif // SIDEBARCLIPBOARDPLUGIN_H ukui-sidebar/src/plugins/clipboardPlugin/clipboardlisetwidget.cpp0000644000175000017500000000223013635342602024361 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include ClipBoardLisetWidget::ClipBoardLisetWidget() { installEventFilter(this); } void ClipBoardLisetWidget::mousePressEvent(QMouseEvent *event) { if (event->buttons() == Qt::LeftButton) { auto pos = event->pos(); if (!this->indexAt(pos).isValid()) //发送信号 emit globalClipboardSignal->ClipboardHideSignal(); } } ukui-sidebar/src/plugins/clipboardPlugin/clipboardPlugin.qrc0000644000175000017500000000102613642562542023305 0ustar fengfeng image/editor.svg image/copy.svg image/delete.svg image/button-close-hover-click-two.svg image/button-close-hover-click-add-background-one.svg image/button-close-default-add-background-three.svg qss/sidebarClipboard.css qss/sideBarEditArea.css qss/sideBarSearchArea.css translations/test_zh_CN.qm ukui-sidebar/src/plugins/feedback/0000755000175000017500000000000013642626325016067 5ustar fengfengukui-sidebar/src/plugins/feedback/feedback.h0000644000175000017500000001072713642562542017773 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include class QPushButton; class QLabel; using namespace std; QT_BEGIN_NAMESPACE namespace Ui { class feedback; } QT_END_NAMESPACE class feedback : public QMainWindow { Q_OBJECT public: feedback(QWidget *parent = nullptr); ~feedback(); void window_ui_init(); void systeminfo_show(); void systeminfo_hide(); void add_systeminfo(); void add_file_change_window(); void del_file_change_window(); void feedback_info_init(); void add_fileinfo_model(); void update_add_file_window(); void update_linedit_add_or_del_file(); bool all_file_size_than_10M(); void httpclient_init(); void set_request_header(); void send_file_httpserver(QString uid); QFile* add_file_to_Part(QString filepath,QString file_type,QString file_name); vector m_filesArray; signals: void syslog(); private slots: void on_pushButton_clicked(); void on_textEdit_textChanged(); void on_checkBox_stateChanged(int state); void on_checkBox_2_stateChanged(int state); void on_checkBox_3_stateChanged(int state); void on_checkBox_4_stateChanged(int state); void on_comboBox_currentIndexChanged(const QString &arg1); void on_pushButton_2_clicked(); void on_textEdit_2_textChanged(); void del_file_button_clicked(); void finishedSlot(QNetworkReply*); private: Ui::feedback *ui; submit_fail * fail_dialog; submit_success * success_dialog; //logflag int syslogflag = 0; int apportlogflag = 0; int dpkglogflag = 0; int describeflag = 0; int emailflag = 0; int get_systeminfoflag = 0; QString feedback_type = "系统问题"; //反馈类型 QString email_str; //邮箱 QString filename; QString textContent;// 详细描述 QString all_systeminfo; //控件坐标变量 //window size int window_w = 600; int window_h =695; //checkBox_4 int checkbox4_x = 35; int checkbox4_y = 570; int checkbox4_w = 121; int checkbox4_h = 24; //pushButton_3 int pushbutton3_x = 140; int pushbutton3_y = 570; int pushbutton3_w = 70; int pushbutton3_h = 24; //verticalWidget int widget_x = 100; int widget_y = 593; int widget_w = 240; int widget_h = 130; //pushButton_2 int pushbutton2_x = 440; int pushbutton2_y = 600; int pushbutton2_w = 120; int pushbutton2_h = 45; //文件名字宽度 //int filename_width; //int filesize_width; int filename_x = 140; int filename_y = 480; int filename_w = 200; int filename_h = 24; QString system_info_str; //系统版本信息 QString encoding_info_str; //系统编码格式 QString desktop_info_str; //系统桌面环境 QString send_os_info; QString send_encoding_info; QString send_dekstop_info; QPushButton *deletefileBtn[5]; QLabel *filename_label[5]; QLabel *filesize_label[5]; //httpclient QNetworkAccessManager *accessManager; QNetworkAccessManager *accessManager_file; QNetworkRequest request; QNetworkRequest request_file; QString urlstring; int send_fail_flags = 0; QHttpMultiPart *multiPart; QList file_name_list; QList file_size_list; QList file_path_list; }; #endif // FEEDBACK_H ukui-sidebar/src/plugins/feedback/systeminfo_button.h0000644000175000017500000000217413642562542022037 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include class feedback; class systeminfo_button :public QPushButton { Q_OBJECT; public: systeminfo_button(QWidget *parent = 0); ~systeminfo_button(); public: void enterEvent(QEvent *e); //鼠标进入事件 void leaveEvent(QEvent *e);//鼠标离开事件 void setFeedBack(feedback *p); feedback* pfeedback; }; #endif // systeminfo_button_H ukui-sidebar/src/plugins/feedback/feedback_plugin.h0000644000175000017500000000456513637056631021355 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include "sidebarSmallPluginInterface.h" class feedback_plugin : public QObject, public SidebarSmallPluginInterface { Q_OBJECT //Q_INTERFACES宏用于告诉Qt该类实现的接口 //Q_PLUGIN_METADATA宏用于描述插件元数据 Q_PLUGIN_METADATA(IID SidebarSmallPluginInterface_iid FILE "feedback.json") Q_INTERFACES(SidebarSmallPluginInterface) public: feedback_plugin(); bool FeedBackFlag; ~feedback_plugin(); const QString name() override {return QObject::tr("用户反馈");} PluginType pluginType() override {return PluginType::SmallPlugin;} const QString description() override {return QObject::tr("用户反馈问题的插件");} const QIcon icon() override {return QIcon::fromTheme("feedback", QIcon::fromTheme("feedback",QIcon("://image/kylin-feedback.png")));} void setEnable(bool enable) override {Q_UNUSED(enable)} bool isEnable() override {return true;} virtual int PluginButtonLocation_X() override {return 0;} virtual int PluginButtonLocation_Y() override {return 3;} virtual QString PluginButtonName() override {return QObject::tr("用户反馈");} virtual int pluginsLoadingSequence() override {return 3;} virtual QString PluginIconName() override {return QObject::tr("用户反馈");} virtual int PluginIconSize_W() override {return 48;} virtual int PluginIconSize_H() override {return 48;} virtual void PluginsShowInterface() override; QWidget * mp_feedback; QWidget* centerWidget(); void onNotification() ; // void UI_in_sidebar(); signals: void feedback_ification(); }; #endif // FEEDBACK_PLUGIN_H ukui-sidebar/src/plugins/feedback/feedback.ui0000644000175000017500000003676613642562542020174 0ustar fengfeng feedback 0 0 600 917 0 0 600 695 600 1000 0 0 feedback background-color: rgb(255, 255, 255); 35 50 160 41 font: 24px "Sans Serif"; color: rgb(68, 68, 68); 问题反馈 140 125 320 30 系统问题 意见建议 商务合作 其他 35 165 61 20 font: 14px ; color: rgb(68, 68, 68); 问题描述 140 170 320 140 background-color: rgb(246, 255, 250); QFrame::StyledPanel QFrame::Raised 10 10 300 120 <html><head/><body><p>dfddfd</p></body></html> <html><head/><body><p>uyghjg</p></body></html> background-color: rgb(244, 244, 244); QFrame::NoFrame <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'DejaVu Sans'; font-size:12pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"><br /></p></body></html> 35 331 32 23 font: 14px; color: rgb(68, 68, 68); 邮箱 93 166 16 16 font: 11pt "Sans Serif"; color: rgb(255, 0, 0); * 68 333 16 16 font: 11pt "Sans Serif"; color: rgb(255, 0, 0); * 140 330 320 30 background-color: rgb(244, 244, 244); QFrame::NoFrame 35 440 61 30 font: 14px ; color: rgb(68, 68, 68); 上传附件 140 440 320 30 background-color: rgb(244,244,244); 490 440 80 30 font: 14px; background-color: rgb(233, 233, 233); color: rgb(68, 68, 68); border:4px ; 浏览... 35 570 121 24 121 24 121 24 font: 14px; 同意获取我的 440 600 120 45 120 45 120 45 font: 18px; color: rgb(255, 255, 255); background-color: rgb(233, 233, 233); border:4px ; 提交 140 570 68 24 51 24 71 24 font: 14px; color: rgb(85, 85, 255); 系统信息 35 125 61 20 font: 14px; color: rgb(68, 68, 68); 问题类型 100 593 240 130 240 130 240 130 background-color: rgb(255, 255, 255); border-top-left-radius:4px; border-top-right-radius:4px; border-bottom-left-radius:4px; border-bottom-right-radius:4px; 10 10 220 80 QFrame::StyledPanel QFrame::Raised 15 10 200 20 border-color: rgb(255, 255, 255); 15 30 200 20 border-color: rgb(255, 255, 255); 15 50 200 20 border-color: rgb(255, 255, 255); 143 396 311 31 QLayout::SetMinAndMaxSize font: 14px; spacing: 5px; syslog font: 14px ; spacing: 5px; apport.log font: 14px; spacing: 5px; dpkg.log 35 400 71 23 font: 14px; background-color: rgb(255, 255, 255); color: rgb(68, 68, 68); 日志文件 470 170 44 18 color: rgb(136, 136, 136); font: 12px; 限200字 140 470 241 16 color: rgb(255, 0, 0); 文件大小超过了3MB或文件格式不支持 true 140 360 201 21 color:rgb(255,0,0) 请输入正确的邮箱格式 true systeminfo_button QPushButton
systeminfo_button.h
browse_button QPushButton
browse_button.h
ukui-sidebar/src/plugins/feedback/feedback.pro0000644000175000017500000000264313642562542020342 0ustar fengfengQT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++11 TARGET = feedback TEMPLATE = lib CONFIG += plugin QT += core gui network # The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 TRANSLATIONS += Resource/feedback_en.ts SOURCES += \ browse_button.cpp \ feedback.cpp \ submit_fail.cpp \ submit_success.cpp \ systeminfo_button.cpp \ feedback_plugin.cpp INCLUDEPATH += ../../plugin-interface HEADERS += \ browse_button.h \ feedback.h \ submit_fail.h \ submit_success.h \ systeminfo_button.h \ feedback_plugin.h DESTDIR = ../sidebarSmallPlugins DISTFILES += feedback.json FORMS += \ feedback.ui \ submit_fail.ui \ submit_success.ui RESOURCES += \ feedback.qrc DISTFILES += unix { target.path = /usr/lib/ukui-sidebar/sidebarSmallPlugins INSTALLS += target } ukui-sidebar/src/plugins/feedback/Resource/0000755000175000017500000000000013642562542017656 5ustar fengfengukui-sidebar/src/plugins/feedback/Resource/feedback_en.ts0000644000175000017500000003130513642562542022436 0ustar fengfeng QObject 用户反馈 feedback feedback 用户反馈问题的插件 feedback issue plugin feedback issue plugin feedback feedback feedback feedback 问题反馈 feedback feedback 系统问题 system issue system issue 意见建议 suggestions suggestions 商务合作 Business Cooperation Business Cooperation 其他 other other 问题描述 Problem Problem <html><head/><body><p>dfddfd</p></body></html> <html><head/><body><p>uyghjg</p></body></html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'DejaVu Sans'; font-size:12pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"><br /></p></body></html> 邮箱 Email Email * 上传附件 Upload Upload 浏览... Browse Browse 同意获取我的 Agreegetmy Agreegetmy 提交 Submit Submit 系统信息 osinfo osinfo 问题类型 Question Question syslog apport.log dpkg.log 日志文件 Logfile Logfile 限200字 200words 200words 文件大小超过了3MB或文件格式不支持 File size exceeds 3MB or file format is not supported File size exceeds 3MB or file format is not supported 请输入正确的邮箱格式 Please enter the correct email format Please enter the correct email format 用户反馈 feedback feedback 请输入内容 Please enter content Please enter content 文件大小不能超过3MB File size cannot exceed 10MB File size cannot exceed 10MB select image select image select image 删除 delete delete submit_fail Dialog Dialog Dialog 问题提交失败! submit failed! submit failed! 退出 Quit Quit 退出 drop out 提交失败 Submission Failed Submission Failed 远程服务器拒绝连接 The remote server refused the connection The remote server refused the connection 服务器关闭 Server down Server down 找不到远程主机名(无效的主机名) Cannot find remote host name Cannot find remote host name 与远程服务器的连接超时 Connection with remote server timed out Connection with remote server timed out 未知错误 unknown mistake unknown mistake submit_success Dialog 问题提交成功! submit successfully! submit successfully! 继续反馈问题 Continue feedback Continue feedback 退出 Quit Quit 继续反馈问题 Continue feedback 退出 drop out 提交成功 Submitted successfully Submitted successfully ukui-sidebar/src/plugins/feedback/Resource/feedback_en.qm0000644000175000017500000000624413642562542022431 0ustar fengfengsetupUi(this); setWindowTitle(tr("提交失败")); ui->pushButton_2->setFlat(true); ui->label->setStyleSheet("font: 30px;"); ui->label_3->setStyleSheet(""); } void submit_fail::show_faillinfo(int error_code) { switch (error_code) { case 1: ui->label_3->setText(tr("远程服务器拒绝连接")); break; case 2: ui->label_3->setText(tr("服务器关闭")); break; case 3: ui->label_3->setText(tr("找不到远程主机名(无效的主机名)")); break; case 4: ui->label_3->setText(tr("与远程服务器的连接超时")); break; default: ui->label_3->setText(tr("未知错误")); break; } } submit_fail::~submit_fail() { delete ui; } void submit_fail::on_pushButton_2_clicked() { this->close(); } ukui-sidebar/src/plugins/feedback/feedback.json0000644000175000017500000000002513635342602020476 0ustar fengfeng{ "Keys" : [ ] } ukui-sidebar/src/plugins/feedback/image/0000755000175000017500000000000013642626325017151 5ustar fengfengukui-sidebar/src/plugins/feedback/image/kylin-feedback.png0000644000175000017500000000246713642626325022540 0ustar fengfengPNG  IHDR00W pHYs  ~IDAThZkUݙnjk vEhO"4(Eъ`_G[!`lЀG?`El_% tSm7U76I7ݙ#:lٝ{s97p+Cd˥~}GPpRۚ[!&/oU-[GloU3WrҔyxp%O5Z Pg`BQoT#kq|!ЀckAAHleg QҀ5;o>',<(ʍH5aI(YO/'&?ĽE`ɿjlL'ƟrCW:rbk sUHҦ'G2-- Rڞ6঳GOYF21ܳ=>| Oai`ZLKI#Q8!Iijx}o:BLjxS*D=N]5frJ`|OB %OF!KfU.IMdK=PhAhYލ ?`ʅK+ĸM֥Ob߉v‘K?GryoCr/A){N:Xii-/`癷ֽȦD^<cvmP\wdc+,܀e:Gi8iLXVBu6k2~4g#(thGm#iw 0iyG<ǝ@FFIy !-[TCXsb9*}p+|^> `zEq9)%7BF &dk⡒Iui=n7yH9q+#{)?Ċb4rn+|=xl\@}T%yzX]hqU˽7F^~꘴! P ɌxwۢƦ"(ZZ)J+Ɣ;2ѐoq|yD-w3& zן)w`ݗCbxWLndJ䒯x|~dNrZ?kV?2^ts%碻bm/ok ±vMIENDB`ukui-sidebar/src/plugins/feedback/submit_fail.h0000644000175000017500000000210013642562542020527 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 namespace Ui { class submit_fail; } class submit_fail : public QDialog { Q_OBJECT public: explicit submit_fail(QWidget *parent = nullptr); ~submit_fail(); void show_faillinfo(int errorcode); private slots: void on_pushButton_2_clicked(); private: Ui::submit_fail *ui; }; #endif // SUBMIT_FAIL_H ukui-sidebar/src/plugins/feedback/fail.png0000644000175000017500000000265613635342602017514 0ustar fengfengPNG  IHDR22?uIDATh͚ilTUN lPĀT1Q#ѸѢ 6AYBҰ)nD".D01DbA.jEŠ#iN޹3LM&gYsVC &c*l>߅hO ETr/@;MD푳~X|!R〓3%J 1"M./ˁ7%_ \LnwЋ.&`1P 'a0hUY 2< S?+T,ڲ6C* ^0\gRf}ڲ6[ġ\!GkĜ_AQW{a8"IH?m8`cpبkI,I%2`k)'c8K'r 9OKbAS\i4D3D }> V~ǵZPuڨl1/Zq큿!-CΖ3~1v;%DFPa6(F 0"=*Y"" 31qg|!fի7ZT4CC^1q"kOB&q U_`v}G 1I"d$a,k Ei{FKIB0t@ $ ^O X& 5'p{aYE M1J6!_aTŁ Mut%,o4;mhhh8M߷L.Qa. yWUq%D8S-ΆOl<"M1Ź28 -9l81ƥ1xf2Uz}Eyl ٮi0%,b&u-+tapPN15bhv-XMhN,3!\q\Di_~eܥHc(4ɝءy4q5H Sl!ըTYW:DXqj |^'o#+5;b˘$ą#?۰.=5 R/nC;p%bw7)s1W[oMs+9FyޜDdqlW4d4gꚣ;Im'VOLydLZe]mE{K5c#j\?:#wCFN7bMwj5GTBykkN9\Ͳ58(xf˴3w¿xfq3Pٷ[xhIENDB`ukui-sidebar/src/plugins/feedback/dialog.ui0000644000175000017500000000121413635342602017656 0ustar fengfeng Dialog 0 0 400 300 Dialog 100 100 121 31 1111111111 ukui-sidebar/src/plugins/feedback/feedback.cpp0000644000175000017500000006303013642626325020321 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include feedback::feedback(QWidget *parent) : QMainWindow(parent) , ui(new Ui::feedback) { ui->setupUi(this); window_ui_init(); } feedback::~feedback() { //程序结束时删除所有数据------ //--------------------------- delete ui; } void feedback::window_ui_init() { //http客户端初始化 httpclient_init(); setWindowTitle(tr("用户反馈")); setFixedSize(600,695); setWindowIcon(QIcon(":/image/kylin-feedback.png")); ui->lineEdit->setReadOnly(true); ui->pushButton_3->setFeedBack(this); ui->pushButton_3->setFlat(true); //隐藏按钮边框 //ui->pushButton_3->setCursor(QCursor(Qt::PointingHandCursor)); //设置鼠标接触按钮变为手形 ui->verticalWidget->hide(); ui->verticalWidget->setStyleSheet(QString::fromUtf8("border:0.5px solid black")); ui->label_13->hide(); add_systeminfo();//将系统信息添加到信息框 ui->pushButton_2->setEnabled(false); //----- ui->verticalWidget->setAttribute(Qt::WA_TranslucentBackground);//设置窗口透明 QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect; effect->setOffset(4,4); effect->setColor(QColor(0,0,0)); effect->setBlurRadius(10); ui->frame_2->setGraphicsEffect(effect); //数据库初始化 //设置描述邮箱输入框提示信息 ui->textEdit->setPlaceholderText(tr("请输入内容"));//设置详细输入框的提示信息 ui->lineEdit->setPlaceholderText(tr("文件大小不能超过3MB")); ui->checkBox_4->setStyleSheet(" spacing: 6px;"); //设置反馈类型的样式 ui->errorMailMessage->setVisible(false); ui->textEdit_2->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); this->setStyleSheet("background-color:rgb();"); ui->label->setStyleSheet("font: 24px;color: rgb()"); ui->label_2->setStyleSheet("font: 14px;color: rgb()"); ui->label_3->setStyleSheet("font: 14px;color: rgb()"); ui->label_4->setStyleSheet("font: 14px;color: rgb()"); ui->label_8->setStyleSheet("font: 14px;color: rgb()"); ui->label_9->setStyleSheet("font: 12px;color: rgb()"); ui->label_7->setStyleSheet("font: 14px;color: rgb()"); ui->label_10->setStyleSheet("font: 14px;color: rgb()"); ui->label_11->setStyleSheet("font: 14px;color: rgb()"); ui->label_12->setStyleSheet("font: 14px;color: rgb()"); ui->checkBox_4->setStyleSheet("font: 14px;color: rgb()"); ui->verticalWidget->setStyleSheet(""); ui->pushButton_2->setStyleSheet(""); ui->pushButton->setStyleSheet(""); ui->lineEdit->setStyleSheet(""); ui->textEdit->setStyleSheet(""); ui->textEdit_2->setStyleSheet(""); ui->frame->setStyleSheet(""); if(QStyleFactory::keys().contains("ukui")){ QTimer::singleShot(500, this, [=](){ ui->comboBox->view()->setStyle(QStyleFactory::create("ukui")); }); } } //获取图片 void feedback::on_pushButton_clicked() { filename=QFileDialog::getOpenFileName(this,tr("select image"),"/","Image file(*.gif *.jpg *.png)",0); //判断文件是否重复添加 if (file_name_list.size() ==0) { //添加附件框改变 ui->lineEdit->setText(filename); add_fileinfo_model(); } //最多传五个附件 else if(file_name_list.size() >= 5) { return ; } else{ int file_diff_flags = 0; for(int fileNum=0; fileNumlineEdit->setText(filename); add_fileinfo_model(); } } } //设置详细描述框最大字符数 void feedback::on_textEdit_textChanged() { textContent = ui->textEdit->toPlainText(); if (textContent.isEmpty()){ describeflag = 0; } else describeflag = 1;//详细描述是否填写 if (emailflag == 1 && describeflag == 1){//邮箱和详细描述都已经填写 ui->pushButton_2->setEnabled(true);//设置提交按钮属性 // ui->pushButton_2->setStyleSheet("font: 18px ;border-radius:4px;background-color:rgb(61,107,229);color: rgb(255, 255, 255)"); } else { ui->pushButton_2->setEnabled(false);//设置提交按钮属性 } int length = textContent.count(); int maxLength = 200; // 最大字符数 if(length > maxLength) { QTextCursor cursor = ui->textEdit->textCursor(); cursor.movePosition(QTextCursor::End); if(cursor.hasSelection()) { cursor.clearSelection(); } cursor.deletePreviousChar(); //设置当前的光标为更改后的光标ing> ui->textEdit->setTextCursor(cursor); } length = ui->textEdit->toPlainText().count(); } //系统信息显示 void feedback::systeminfo_show() { ui->verticalWidget->show(); } //系统信息隐藏 void feedback::systeminfo_hide() { ui->verticalWidget->hide(); } //添加系统信息 void feedback::add_systeminfo() { string encoding_info = "系统语言: "; string desktop_info = "桌面环境: "; string os_info = "操作系统: "; if((QLocale::system().name()) == "en_US"){ encoding_info = "Lang: "; desktop_info = "Deskenv: "; os_info= "Osrelease: "; } //获取系统信息 //1.获取系统版本 string system_info; string system_name; string system_version_id; string s; ifstream fp("/etc/os-release"); if(!fp){ system_info = "None"; } else{ while (getline(fp,s)){ string::size_type idx; idx = s.find("=");//字符串中查找字符串 if (idx == string::npos){//不存在 } else{ string str2 = s.substr(0,idx);//截取字符串中=前面的内容 if(str2 == "NAME"){ system_name = s.substr(5);//截取"NAME="后面的内容 } else if(str2 =="VERSION_ID"){ system_version_id = s.substr(11);//截取"VERSION_ID="后面的内容 } } } system_info = os_info +system_name +" " + system_version_id; } send_os_info = QString::fromStdString(system_name +" " + system_version_id); system_info_str = QString::fromStdString(system_info);//string 转QString system_info_str.remove(QChar('"'), Qt::CaseInsensitive); //将字符串中"字符删除 ui->label_10->setText(system_info_str); //2.获取桌面环境信息 char * desktop = getenv("DESKTOP_SESSION"); desktop_info.append(desktop); send_dekstop_info.append(desktop); desktop_info_str = QString::fromStdString(desktop_info); ui->label_12->setText(desktop_info_str); //3.获取编码格式 char * encoding = getenv("GDM_LANG"); encoding_info.append(encoding); send_encoding_info.append(encoding); encoding_info_str = QString::fromStdString(encoding_info); ui->label_11->setText(encoding_info_str); } //syslog点选 void feedback::on_checkBox_stateChanged(int state) { if (state == Qt::Checked) // "选中" { emit syslog(); syslogflag = 1; } else // 未选中 - Qt::Unchecked { syslogflag = 0; } } //apport.log点选 void feedback::on_checkBox_2_stateChanged(int state) { if (state == Qt::Checked) // "选中" { emit syslog(); apportlogflag = 1; } else // 未选中 - Qt::Unchecked { apportlogflag = 0; } } //dpkglog点选 void feedback::on_checkBox_3_stateChanged(int state) { if (state == Qt::Checked) // "选中" { emit syslog(); dpkglogflag = 1; } else // 未选中 - Qt::Unchecked { dpkglogflag = 0; } } //是否获取系统信息 void feedback::on_checkBox_4_stateChanged(int state) { if (state == Qt::Checked) // "选中" { get_systeminfoflag = 1; } else // 未选中 - Qt::Unchecked { get_systeminfoflag = 0; } } //获取反馈类型 void feedback::on_comboBox_currentIndexChanged(const QString &arg1) { feedback_type = ui->comboBox->currentText(); } //提交按钮 void feedback::on_pushButton_2_clicked() { ui->pushButton_2->setEnabled(false); // ui->pushButton_2->setStyleSheet("font: 18px;border-radius:4px;background-color:rgb(65,95,196);color: rgb(255, 255, 255)"); //判断文件总大小是否超过10M,如果超过,提示 if(all_file_size_than_10M() == true) { ui->label_13->show(); return; } QJsonObject feedback_info_json; //反馈信息类型 feedback_info_json.insert("subject",feedback_type); //详细描述 feedback_info_json.insert("description",textContent); //邮箱 feedback_info_json.insert("email",email_str); //系统信息发送 if(get_systeminfoflag == 1){ feedback_info_json.insert("version",send_os_info); feedback_info_json.insert("desktop",send_dekstop_info); feedback_info_json.insert("language",send_encoding_info); } QString url_filepath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation) +"/.config/ukui/url.conf"; //从配置文件中读服务器地址 QFile file_url(url_filepath); QFileInfo url_fileinfo(url_filepath); if(!url_fileinfo.isFile()) { file_url.open(QIODevice::ReadWrite | QIODevice::Text); file_url.write("http://feedback.ubuntukylin.com/v1/issue/"); urlstring.append("http://feedback.ubuntukylin.com/v1/issue/"); } else{ file_url.open(QIODevice::ReadWrite | QIODevice::Text); urlstring = file_url.readLine(); } file_url.close(); //去掉从配置文件中读出的换行符(删除最后一个字符) //urlstring.remove(urlstring.length()-1,1); //设置request属性 set_request_header(); request.setUrl(QUrl(urlstring)); //发送JSON表单 QJsonDocument json_doc; json_doc.setObject(feedback_info_json); QByteArray post_feedback_info_array = json_doc.toJson(QJsonDocument::Compact); qDebug()<post(request,post_feedback_info_array); } QFile* feedback::add_file_to_Part(QString filepath,QString file_type,QString file_name) { qDebug()<<"this is add_file_to_Part"; QHttpPart upload_part; upload_part.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant(QString("form-data; name=\"%1\";filename=\"%2\"").arg(file_type).arg(file_name))); QFile *upload_file = new QFile(filepath); if(!(upload_file->open(QIODevice::ReadOnly))){ qDebug()<<"file open fail"; } upload_part.setBody(upload_file->readAll()); multiPart->append(upload_part); return upload_file; } void feedback::send_file_httpserver(QString uid) { //初始化http发送文件请求 accessManager_file = new QNetworkAccessManager(this); connect(accessManager_file, SIGNAL(finished(QNetworkReply*)), this, SLOT(sendfile_finished(QNetworkReply* ))); //设置请求头 request_file.setHeader(QNetworkRequest::ContentTypeHeader,"multipart/form-data"); //设置url QString urlstring_file = urlstring + "annex/"; request_file.setUrl(QUrl(urlstring_file)); qDebug()<setBoundary(bd.toLatin1()); request_file.setHeader(QNetworkRequest::ContentTypeHeader,"multipart/form-data;boundary="+bd); //把发送反馈信息服务器返回的uid 加入此次发送中 QHttpPart uid_part; uid_part.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"issue_uid\"")); uid_part.setBody(uid.toUtf8()); multiPart->append(uid_part); //判断三个log文件哪个点选了 if(dpkglogflag ==1){ //var/log/dpkg.log QFile *file_dpkglog = add_file_to_Part("/var/log/dpkg.log","dpkg","dpkg.log"); m_filesArray.push_back(file_dpkglog); } if(apportlogflag == 1){ //var/log/apport.log QFile *file_apportlog = add_file_to_Part("/var/log/apport.log","apport","apport.log"); m_filesArray.push_back(file_apportlog); } if(syslogflag== 1){ //var/log/syslog.log QFile *file_syslog = add_file_to_Part("/var/log/syslog","syslog","syslog"); m_filesArray.push_back(file_syslog); } //获取添加的附件,文件名 for(int filenum=0; filenumpost(request_file,multiPart); } //邮箱是否填写 void feedback::on_textEdit_2_textChanged() { email_str = ui->textEdit_2->toPlainText(); if (email_str.isEmpty()){ emailflag = 0; } else{ //使用正则表达式来判断邮箱地址 QRegExp rx("^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+"); int pos=0; QRegExpValidator v(rx, 0); if(2==v.validate(email_str,pos)){ ui->errorMailMessage->setVisible(false); emailflag = 1; } else{ ui->errorMailMessage->setVisible(true); emailflag=0; } } if (describeflag == 1 && emailflag == 1){//邮箱和详细描述都已经填写 ui->pushButton_2->setEnabled(true); } else { ui->pushButton_2->setEnabled(false);//设置提交按钮属性 // ui->pushButton_2->setStyleSheet("font: 18px;border-radius:4px;background-color:rgb(233, 233, 233);color: rgb(255, 255, 255)"); } } //删除文件按钮槽函数 void feedback::del_file_button_clicked() { int rowNum =file_name_list.size(); //QObject::sender()返回发送信号的对象的指针 QPushButton *btn = qobject_cast(QObject::sender()); if( btn == deletefileBtn[0] ) { file_name_list.removeAt(0); file_size_list.removeAt(0); file_path_list.removeAt(0); qDebug() << "delete 0"; } else if( btn == deletefileBtn[1] ) { file_name_list.removeAt(1); file_size_list.removeAt(1); file_path_list.removeAt(1); qDebug() << "delete 1"; } else if( btn == deletefileBtn[2] ) { file_name_list.removeAt(2); file_size_list.removeAt(2); file_path_list.removeAt(2); qDebug() << "delete 2"; } else if( btn == deletefileBtn[3] ) { file_name_list.removeAt(3); file_size_list.removeAt(3); file_path_list.removeAt(3); } else if( btn == deletefileBtn[4]) { file_name_list.removeAt(4); file_size_list.removeAt(4); file_path_list.removeAt(4); } for(int i=0; ipushButton_2->setGeometry(pushbutton2_x,pushbutton2_y,pushbutton2_w,pushbutton2_h); ui->pushButton_3->setGeometry(pushbutton3_x,pushbutton3_y,pushbutton3_w,pushbutton3_h); ui->checkBox_4->setGeometry(checkbox4_x,checkbox4_y,checkbox4_w,checkbox4_h); ui->verticalWidget->setGeometry(widget_x,widget_y,widget_w,widget_h); setFixedSize(600,window_h); } //添加附件后调整窗口 void feedback::add_file_change_window() { if(filename.isEmpty()){ return; } window_h += 29; pushbutton2_y += 29; pushbutton3_y += 29; checkbox4_y += 29; widget_y += 29; ui->pushButton_2->setGeometry(pushbutton2_x,pushbutton2_y,pushbutton2_w,pushbutton2_h); ui->pushButton_3->setGeometry(pushbutton3_x,pushbutton3_y,pushbutton3_w,pushbutton3_h); ui->checkBox_4->setGeometry(checkbox4_x,checkbox4_y,checkbox4_w,checkbox4_h); ui->verticalWidget->setGeometry(widget_x,widget_y,widget_w,widget_h); setFixedSize(600,window_h); } //点击继续反馈信息之后 清空程序内所有信息 void feedback::feedback_info_init(){ ui->comboBox->setCurrentIndex(0); ui->textEdit->setText(""); ui->label_9->show(); ui->checkBox->setChecked(false); ui->checkBox_2->setChecked(false); ui->checkBox_3->setChecked(false); ui->lineEdit->setText(""); ui->textEdit_2->setText(""); for(int i=0; icheckBox_4->setChecked(false); //变量初始化 //控件坐标变量 //window size window_w = 600; window_h =695; //checkBox_4 checkbox4_x = 35; checkbox4_y = 570; checkbox4_w = 121; checkbox4_h = 24; //pushButton_3 pushbutton3_x = 140; pushbutton3_y = 570; pushbutton3_w = 60; pushbutton3_h = 24; //verticalWidget widget_x = 100; widget_y = 593; widget_w = 240; widget_h = 130; //pushButton_2 pushbutton2_x = 440; pushbutton2_y = 600; pushbutton2_w = 120; pushbutton2_h = 45; //文件名字宽度 //int filename_width; //int filesize_width; filename_x = 140; filename_y = 480; filename_w = 200; filename_h = 24; syslogflag = 0; apportlogflag = 0; dpkglogflag = 0; describeflag = 0; emailflag = 0; get_systeminfoflag = 0; send_fail_flags = 0; ui->pushButton_2->setGeometry(pushbutton2_x,pushbutton2_y,pushbutton2_w,pushbutton2_h); ui->pushButton_3->setGeometry(pushbutton3_x,pushbutton3_y,pushbutton3_w,pushbutton3_h); ui->checkBox_4->setGeometry(checkbox4_x,checkbox4_y,checkbox4_w,checkbox4_h); ui->verticalWidget->setGeometry(widget_x,widget_y,widget_w,widget_h); setFixedSize(600,window_h); } //添加文件后把文件信息加入数据库 void feedback::add_fileinfo_model() { if(filename.isEmpty()){ return; } //获取文件名字 int nIndex = filename.lastIndexOf('/'); QString file_name = filename.mid(nIndex+1); //获取文件大小 QFileInfo info; QString file_size; info.setFile(filename); //判断文件大小单位是K 还是M file_size = QString::number((float)info.size()/(float)1000,'f',1) + "K"; if((float)info.size()/(float)1000 > 1000) file_size = QString::number((float)info.size()/(float)1000000,'f',1) + "M"; if(file_name_list.size() < 5){ file_name_list.append(file_name); file_size_list.append(file_size); file_path_list.append(filename); } for(int i=0; imove(filename_x,filename_y+(filenum * 29)); filename_label[filenum]->setText(file_name_list.at(filenum)); filename_label[filenum]->setStyleSheet("font: 12px ;color: rgb(68,68,68);"); filename_label[filenum]->adjustSize(); filename_label[filenum]->show(); int filename_width = filename_label[filenum]->geometry().width(); filesize_label[filenum] = new QLabel(this); filesize_label[filenum]->setGeometry(filename_x+filename_width+20,filename_y+ (filenum * 29),filename_w,filename_h); filesize_label[filenum]->setText(("( "+file_size_list.at(filenum)+" )")); filesize_label[filenum]->setStyleSheet("font: 12px;color: rgb(179,179,179)"); filesize_label[filenum]->adjustSize(); filesize_label[filenum]->show(); int filesize_width = filesize_label[filenum]->geometry().width(); deletefileBtn[filenum] = new QPushButton(this); deletefileBtn[filenum]->setGeometry(filename_x+filename_width+20+filesize_width+20,filename_y+ (filenum * 29),31,26); deletefileBtn[filenum]->setText(tr("删除")); deletefileBtn[filenum]->setStyleSheet("font: 12px ;color: rgb(61,107,229)"); deletefileBtn[filenum]->setFlat(true); deletefileBtn[filenum]->show(); connect( deletefileBtn[filenum], SIGNAL(clicked()), this, SLOT(del_file_button_clicked()) ); } } //在删除文件之后更新文件信息框 void feedback::update_linedit_add_or_del_file() { int rowNum = file_name_list.size(); if (rowNum == 0){ ui->lineEdit->setText(""); } else{ ui->lineEdit->setText(file_name_list.at(rowNum -1)); } } //判断总文件大小是否超过10M bool feedback::all_file_size_than_10M() { int all_filesize = 0; QFileInfo file_info; int rowNum = file_name_list.size(); for(int filenum=0; filenum 10*1024*1024) { return true; } else return false; } void feedback::httpclient_init() { accessManager = new QNetworkAccessManager(this); connect(accessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(finishedSlot(QNetworkReply* ))); } void feedback::finishedSlot(QNetworkReply *reply) { // 获取http状态码 QVariant statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute); if(statusCode.isValid()) qDebug() << "status code=" << statusCode.toInt(); if(statusCode.toInt() == 201){ QVariant reason = reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString(); if(reason.isValid()) qDebug() << "reason=" << reason.toString(); QByteArray bytes = reply->readAll(); //panduan ==200 qDebug() << bytes; send_fail_flags = 0; success_dialog = new submit_success(this); success_dialog->setModal(true); success_dialog->show(); //解析JSON 获取uid annex_uid QString uid_value; QJsonParseError jsonerror; QJsonDocument document = QJsonDocument::fromJson(bytes,&jsonerror); if(!document.isNull() &&(jsonerror.error == QJsonParseError::NoError)) { if(document.isObject()){ QJsonObject object = document.object(); uid_value = object["uid"].toString(); } } //发送文件 send_file_httpserver(uid_value); } else { send_fail_flags = 1; qDebug() << "finishedSlot errors here"; qDebug( "found error .... code: %d\n", (int)reply->error()); qDebug()<errorString()); fail_dialog = new submit_fail(this); //判断错误类型 fail_dialog->show_faillinfo((int)reply->error()); fail_dialog->setModal(true); fail_dialog->show(); } reply->deleteLater(); for (auto iter = m_filesArray.cbegin(); iter != m_filesArray.cend(); iter++) { (*iter)->close() ; } m_filesArray.clear(); } void feedback::set_request_header() { request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); } ukui-sidebar/src/plugins/feedback/submit_fail.ui0000644000175000017500000000375713642562542020740 0ustar fengfeng submit_fail 0 0 430 260 Dialog border:2px; 130 85 281 60 font: 30px; color: rgb(68, 68, 68); 问题提交失败! 130 160 111 26 color: rgb(61, 107, 229); 退出 70 94 50 50 background-image: url(:/new/prefix1/fail.png); 130 140 291 16 font: 12px; color: rgb(33, 33, 33); ukui-sidebar/src/plugins/feedback/submit_success.ui0000644000175000017500000000401613642562542021462 0ustar fengfeng submit_success 0 0 430 260 Dialog border 2px; 130 85 291 60 font: 30px; color: rgb(68, 68, 68); 问题提交成功! 130 165 131 26 color: rgb(61, 107, 229); 继续反馈问题 270 165 81 26 color: rgb(61, 107, 229); 退出 70 94 50 50 background-image: url(:/new/prefix1/success.png); ukui-sidebar/src/plugins/feedback/submit_success.h0000644000175000017500000000217413642562542021277 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 class feedback; namespace Ui { class submit_success; } class submit_success : public QDialog { Q_OBJECT public: explicit submit_success(QWidget *parent = nullptr); ~submit_success(); private slots: void on_pushButton_2_clicked(); void on_pushButton_clicked(); private: Ui::submit_success *ui; feedback *parentWnd; }; #endif // SUBMIT_SUCCESS_H ukui-sidebar/src/plugins/feedback/browse_button.cpp0000644000175000017500000000163613642562542021475 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include class browse_button :public QPushButton { Q_OBJECT; public: browse_button(QWidget *parent = 0); ~browse_button(); public: void enterEvent(QEvent *e); //鼠标进入事件 void leaveEvent(QEvent *e);//鼠标离开事件 }; #endif // BROWSE_BUTTON_H ukui-sidebar/src/plugins/feedback/feedback.qrc0000644000175000017500000000032313642562542020320 0ustar fengfeng success.png fail.png image/kylin-feedback.png Resource/feedback_en.qm ukui-sidebar/src/plugins/feedback/feedback_plugin.cpp0000644000175000017500000000365713642562542021710 0ustar fengfeng /* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include feedback_plugin::feedback_plugin() { QString locale = QLocale::system().name(); QTranslator *translator_feedback; translator_feedback = new QTranslator(); //英文环境加载en.qm if(locale == "en_US"){ translator_feedback->load(QString(":/Resource/feedback_en.qm")); //选择翻译文件 QApplication::installTranslator(translator_feedback); } mp_feedback = new feedback ; FeedBackFlag = false; } void feedback_plugin::onNotification() { qDebug()<< "onNotification"; } void feedback_plugin::PluginsShowInterface() { if (FeedBackFlag) { mp_feedback = new feedback ; } QDesktopWidget *desk = QApplication::desktop(); QRect deskRect = desk->availableGeometry(); mp_feedback->show(); mp_feedback->move((deskRect.width()-mp_feedback->width())/2, (deskRect.height()-mp_feedback->height())/2); FeedBackFlag = true; } feedback_plugin::~feedback_plugin() { if( mp_feedback) { delete mp_feedback; } mp_feedback = nullptr; } QWidget* feedback_plugin::centerWidget() { return mp_feedback; } ukui-sidebar/src/plugins/feedback/success.png0000644000175000017500000000312513635342602020241 0ustar fengfengPNG  IHDR22?IDATh͚ylUm,`#jBAAДM jkDqA UK *[4 D-*ŭh5~aoys.ߙ{眹yT_F  " h~[OSO&3=N3+oE@ CDRshS^`%(R{}zn3s"ppp p1p < hAL`e?: p(+U3M/"1mS LjSUWdR.|`1P  *)Uk58%HW]V,X6-5UAœہ1Wc(A-\4C5Y .DY .f:r4 &829EКXwJ}'dJAAٳ5/GiC\yV,ș;ؚbgyӁ A]G`F۱ Bʉ,rroP|0\mh5'>*xUGH6G1 <( J.Sq]g=0l*Q.lvcuL]?M!by$>򲮓bvS*"P^"5@vQs0\N>:(]%Q2(4]zw:73M.e&Nbj^1?CB ~ZҩGL18-BtZ4! 4ZWKfBĭP\A-Hڦ0HHo{7hSĭQ\#xIk*vf!2z9GEډr K½%N!y#wj7w;[?eB ~:s s N}ĥ\܎B{bD颩߆KUIoZ9G;Ri9Κ(Hĉ]cӼQ!o `}V߾CE2'OT {QP5kq܎R=T3H{Q*WDW{N G,PJPcNaC993ӖG/܃g'00U\~:IENDB`ukui-sidebar/src/plugins/feedback/systeminfo_button.cpp0000644000175000017500000000217113642562542022367 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 systeminfo_show(); } void systeminfo_button::leaveEvent(QEvent *e) { pfeedback->systeminfo_hide(); } //Resource/feedback_en.qm void systeminfo_button::setFeedBack(feedback *p) { pfeedback = p; } ukui-sidebar/src/plugins/feedback/submit_success.cpp0000644000175000017500000000247013642562542021631 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 setupUi(this); parentWnd =dynamic_cast(parent); setWindowTitle(tr("提交成功 ")); ui->pushButton->setFlat(true); ui->pushButton_2->setFlat(true); ui->label->setStyleSheet("font: 30px;"); } submit_success::~submit_success() { delete ui; } void submit_success::on_pushButton_2_clicked() { close(); } void submit_success::on_pushButton_clicked() { parentWnd ->feedback_info_init(); close(); } ukui-sidebar/src/realtimepropertyanimation.h0000644000175000017500000000223713634067640020346 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 class RealtimePropertyAnimation : public QPropertyAnimation { Q_OBJECT public: explicit RealtimePropertyAnimation(QObject *target, const QByteArray &propertyName, QObject *parent = nullptr); protected: virtual void updateCurrentValue(const QVariant &value) override; signals: void Sig_currentRect(int, int, int, int); }; #endif // REALTIMEPROPERTYANIMATION_H ukui-sidebar/src/smallpluginsbutton.cpp0000644000175000017500000000060413642562542017334 0ustar fengfeng#include "smallpluginsbutton.h" #include SmallPluginsButton::SmallPluginsButton() { } SmallPluginsButton::~SmallPluginsButton() { } void SmallPluginsButton::enterEvent(QEvent *e) { Q_UNUSED(e); emit enterButtonSignal(); } void SmallPluginsButton::leaveEvent(QEvent *e) { Q_UNUSED(e); } void SmallPluginsButton::SendSingal() { emit enterButtonSignal(); } ukui-sidebar/src/sidebar_app_log.h0000644000175000017500000000206313626422413016140 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #define LOG_FILE_NAME QString("/SidebarLog/") + QDateTime::currentDateTime().toString("yyyy-MM-dd") + QString(".log") static QMutex s_logMutex; static QString s_logPath; void setLogPath(const QString &path); void setLogLevel(int level); void customLogMessageHandler(QtMsgType type, const QMessageLogContext& ctx, const QString& msg); ukui-sidebar/src/plugin-signals/0000755000175000017500000000000013642562542015616 5ustar fengfengukui-sidebar/src/plugin-signals/sidebarclipboardsignal.h0000644000175000017500000000210613642562542022455 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 class SidebarClipBoardSignal : public QObject { Q_OBJECT public: explicit SidebarClipBoardSignal() {} signals: void finishSignal(); void removeSignal(); void popSignal(); void ClipboardHideSignal(); void CLipBoardEditSignal(); public slots: }; #endif // SIDEBARCLIPBOARDSIGNAL_H ukui-sidebar/src/plugin-signals/plugin-signals.pri0000644000175000017500000000013113642562542021261 0ustar fengfengINCLUDEPATH += $$PWD HEADERS += \ $$PWD/sidebarclipboardsignal.h SOURCES += \ ukui-sidebar/src/sidebartranslat/0000755000175000017500000000000013642562542016044 5ustar fengfengukui-sidebar/src/sidebartranslat/Sidebar_zh_CN.qm0000644000175000017500000000067713642562542021047 0ustar fengfeng #include #include #include #include "clipboardpluginiface.h" #include "sidebarSmallPluginInterface.h" #include "realtimepropertyanimation.h" #include "mostgrandwidget.h" #define TRAY_ICON ":/data/images/kylin-tool-box.svg" #define TRAY_NULL_ICON ":/data/images/kylin-tool-box-null.svg" #define PANEL_DBUS_SERVICE "com.ukui.panel.desktop" #define PANEL_DBUS_PATH "/" #define PANEL_DBUS_INTERFACE "com.ukui.panel.desktop" class QGroupBox; class QGridLayout; class QVBoxLayout; class Widget : public QWidget { Q_OBJECT //申明该类有D-BUS服务接口 Q_CLASSINFO("D-Bus Interface", "com.ukui.panel.sidebar.value") public: explicit Widget(QWidget *parent = nullptr); ~Widget(); enum PanelStatePosition { PanelDown = 0, PanelUp, PanelLeft, PanelRight }; //主界面 void showAnimation(); //show动作 void hideAnimation(); //hide动作 int ListenClipboardSignal(); //监听剪贴板发送的信号 int connectTaskBarDbus(); //连接任务栏dbus接口,获取任务栏高度 int getPanelSite(); //获取任务栏位置 int setClipBoardWidgetScaleFactor(); //获取通知中心下半部分高度比例系数 //系统托盘 void createAction(); //连接信号和槽函数,设置其动作; void createSystray(); //设置menu界面、添加动作 和 创建sysytray实例 void setIcon(QString strIcon); //设置图标和提示信息; void iconActivated(QSystemTrayIcon::ActivationReason reason); //获取点击事件 bool loadNotificationPlugin(); //加载通知中心插件 bool loadClockPlugin(); //加载闹钟插件 bool loadfeedbackPlugin(); //加载用户反馈程序 bool loadnotebookPlugin(); void GetsAvailableAreaScreen(); //获取屏幕可用区域高度 void MostGrandWidgetCoordinates(); //根据任务栏位置调整侧边栏位置 void ModifyScreenNeeds(); //修改屏幕分辨率或者主屏需要做的事情 void InitializeHomeScreenGeometry(); //初始化主屏的X坐标 protected: void mousePressEvent(QMouseEvent *event); //鼠标点击事件 bool eventFilter(QObject *obj, QEvent *event); //设置过滤事件 private: //主界面 QVBoxLayout* m_pMainOuterBoxLayout; //主界面最外框布局器 QWidget* m_pMainOuterWidget; //主界面最外框架部件 QWidget* m_pMainOuterReplaceWidget; //主界面最外框架动画时替代部件 QVBoxLayout* m_pMainQVBoxLayout; //主界面垂直布局器 QDBusInterface* m_pServiceInterface; //获取任务栏的高度 bool m_bShowFlag; //控制托盘栏点击事件的标志位 int m_nScreenWidth; //屏幕分辨率的宽 int m_nScreenHeight; //屏幕分辨率的高 int m_nScreen_x; int m_nScreen_y; QObject* m_pNotificationPluginObject; //通知中心插件对象 QObject* m_pclock_PluginObject; //闹钟插件第一次加载插件对象 QObject* m_pfeedback_PluginObject; QObject* m_pnotebook_PluginObject; SidebarSmallPluginInterface *m_pclock_Plugin; //闹钟插件全局变量 SidebarSmallPluginInterface *m_pPlugin_Plugin; //问题反馈全局变量 SidebarSmallPluginInterface *m_pnotebookPluginObject; int m_nInitalXPosition; QTranslator *m_pTranslator; QPropertyAnimation *m_pAnimationShowSidebarWidget; QPropertyAnimation *m_pAnimationHideSidebarWidget; QDesktopWidget *m_pDeskWgt; //桌面问题 //快捷操作面板 ClipboardInterface* m_pSidebarClipboard; //侧边栏剪贴板指针 SidebarClipBoardSignal* m_pSidebarSignal; //剪贴板通信类 //系统托盘 QSystemTrayIcon* trayIcon; QMenu* trayIconMenu; QAction* minimizeAction; QAction* maximizeAction; QAction* restoreAction; QAction* quitAction; QTimer* m_pTimer; //新通知闪烁定时器 bool m_bFwinkleFlag; //新通知闪烁标志 private slots : void onResolutionChanged(int); //当改变屏幕分辨率时重新获取屏幕分辨率 void onNewNotification(); //当没展开时,来了新通知才提示 void twinkle(); //新消息闪烁设置 void updateAnimationPosition(int, int, int, int); //更新动画坐标动态 void showAnimationFinish(); //展开动画完成 void hideAnimationFinish(); //隐藏动画完成 void showAnimationAction(const QVariant &value); //展开动画开始 void primaryScreenChangedSLot(); //主屏发生变化 void screenCountChangedSlots(int count); }; #endif // WIDGET_H ukui-sidebar/src/mostgrandwidget.h0000644000175000017500000000107713642562542016242 0ustar fengfeng#ifndef MOSTGRANDWIDGET_H #define MOSTGRANDWIDGET_H #include #include #include #include class mostGrandWidget : public QWidget { Q_OBJECT public: mostGrandWidget(QWidget *parent = nullptr); ~mostGrandWidget(); static void mostGrandWidgetInit(); static mostGrandWidget* getInstancemostGrandWidget(); void LaoutSidebarWidget(); void setMostGrandwidgetSize(int w, int h); void setMostGrandwidgetCoordinates(int x, int y); QVBoxLayout *m_pmostGrandWidgetVLaout; }; #endif // MOSTGRANDWIDGET_H ukui-sidebar/src/sidebar_app_log.cpp0000644000175000017500000000532613626422413016500 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include #include static int s_logLevel = QtDebugMsg; void setLogPath(const QString & path) { s_logPath = path; qDebug() << "path ::::" << s_logPath; } void setLogLevel(int level) { s_logLevel = level; } bool static ensureDirExist(const QString &dirPath) { QDir dir(dirPath); if (dir.exists()) { return true; } return dir.mkpath(dirPath); } void customLogMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg) { Q_UNUSED(context); if (type < s_logLevel) { return; } QString logInfo; QString logTime = QDateTime::currentDateTime().toString("yyyy-MM-dd-hh-mm-ss"); switch (type) { case QtDebugMsg: logInfo = QString("%1 [Debug] %2 %3 %4 %5").arg(logTime, context.file, QString::number(context.line), context.function, msg); break; case QtWarningMsg: logInfo = QString("%1 [Warning] %2 %3 %4 %5").arg(logTime, context.file, QString::number(context.line), context.function, msg); break; case QtCriticalMsg: logInfo = QString("%1 [Critical] %2 %3 %4 %5").arg(logTime, context.file, QString::number(context.line), context.function, msg); break; case QtFatalMsg: logInfo = QString("%1 [Fatal] %2 %3 %4 %5").arg(logTime, context.file, QString::number(context.line), context.function, msg); abort(); case QtInfoMsg: logInfo = QString("%1 [Info] %2 %3 %4 %5").arg(logTime, context.file, QString::number(context.line), context.function, msg); break; } s_logMutex.lock(); QFile outFile(s_logPath); QFileInfo fileInfo(outFile); if (!ensureDirExist(fileInfo.absoluteDir().absolutePath())) return; if (!outFile.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text)) return; QTextStream ts(&outFile); ts << logInfo.toUtf8() << endl; outFile.close(); s_logMutex.unlock(); } ukui-sidebar/src/sidebarpluginswidgets.cpp0000644000175000017500000003604613642562542020001 0ustar fengfeng#include "sidebarpluginswidgets.h" static sidebarPluginsWidgets *global_Plugin_Widgets_instance = nullptr; sidebarPluginsWidgets::sidebarPluginsWidgets(QWidget *parent) : QWidget(parent) { Q_UNUSED(parent); this->setContentsMargins(0,0,0,0); this->setFixedSize(400,300); this->setStyleSheet("QWidget{background:rgba(255, 255, 0, 0);}"); flagnumClipboardState = 0; m_pBoolStates = true; resizeFlagOne = true; ClipBoardBool = false; SmallPluginsBool = false; m_pWidgetOutVLayout = new QVBoxLayout(); m_pWidgetOutVLayout->setContentsMargins(0,0,0,0); /* 上半部分 剪贴板 小插件 俩按钮 groupBox初始化布局 */ initUpGroupBoxButton(); /* 下半部分 显示插件的界面 */ initUnGroupBox(); initLableBackgroundAnimation(); QFile file(KYLIN_SIDEBAR_SMALL_PLUGINS); if (file.open(QFile::ReadOnly)) { QString strQss = QLatin1String(file.readAll()); this->setStyleSheet(strQss); file.close(); } } sidebarPluginsWidgets::~sidebarPluginsWidgets() { } /* 返回全局的Widget指针 */ sidebarPluginsWidgets* sidebarPluginsWidgets::getInstancePluinsWidgets() { if (global_Plugin_Widgets_instance == nullptr) { global_Plugin_Widgets_instance = new sidebarPluginsWidgets(); } return global_Plugin_Widgets_instance; } /* 初始化sidebarPluginsWidgets类 */ void sidebarPluginsWidgets::initPluginsWidgets() { getInstancePluinsWidgets(); } /* 上半部分 剪贴板 小插件 俩按钮 groupBox初始化布局 */ void sidebarPluginsWidgets::initUpGroupBoxButton() { m_pButtonWidget = new QWidget(this); m_pButtonWidget->setContentsMargins(0,0,0,0); m_pButtonWidget->setFixedSize(400, 60); m_pGrouBoxUpButtonHLayout = new QHBoxLayout; m_pGrouBoxUpButtonHLayout->setContentsMargins(0,5,0,0); m_pClipboardButton = new SmallPluginsButton(); m_pClipboardButton->setText(tr("Clipboard")); m_pClipboardButton->setObjectName("ClipboardButton"); m_pClipboardButton->setFixedSize(90,34); m_pSidebarPluginButton = new SmallPluginsButton(); m_pSidebarPluginButton->setText(tr("Plugins")); m_pSidebarPluginButton->setObjectName("SidebarPluginButton"); m_pSidebarPluginButton->setFixedSize(90,34); m_pBlueBackgroundButton = new QPushButton(); m_pBlueBackgroundButton->setFixedSize(90, 34); m_pBlueBackgroundButton->setObjectName("BlueBackgroundButton"); m_pBlueBackgroundButton->setChecked(false); m_pBlueBackgroundButton->setVisible(false); QSpacerItem *item1 = new QSpacerItem(10, 20); QSpacerItem *item2 = new QSpacerItem(10, 20); QSpacerItem *item3 = new QSpacerItem(202,20); m_pGrouBoxUpButtonHLayout->addItem(item1); m_pGrouBoxUpButtonHLayout->addWidget(m_pClipboardButton); m_pGrouBoxUpButtonHLayout->addItem(item2); m_pGrouBoxUpButtonHLayout->addWidget(m_pSidebarPluginButton); m_pGrouBoxUpButtonHLayout->addItem(item1); m_pGrouBoxUpButtonHLayout->addWidget(m_pBlueBackgroundButton); m_pGrouBoxUpButtonHLayout->addItem(item3); m_pButtonWidget->setLayout(m_pGrouBoxUpButtonHLayout); m_pGrouBoxUpButtonHLayout->setSpacing(0); } /* 显示插件的界面下半部分 */ void sidebarPluginsWidgets::initUnGroupBox() { /* 小插件GroupBox指针 */ m_pPluginsButtonWidget = new QWidget(); m_pPluginsButtonWidget->setFixedSize(400, 250); m_pPluginsButtonWidget->setContentsMargins(0,0,0,0); /* 设置按钮图表 */ m_pGroupBoxUnSmallPluginsGLayout = new QGridLayout(); m_pPluginsButtonWidget->setLayout(m_pGroupBoxUnSmallPluginsGLayout); m_pGroupBoxUnSmallPluginsGLayout->setSpacing(0); } /* 最后将所有空间加入到Widget中 */ void sidebarPluginsWidgets::AddPluginWidgetInterface() { m_pWidgetOutVLayout->addWidget(m_pButtonWidget); //加载俩个按钮界面 m_pWidgetOutVLayout->addWidget(m_pClipboardWidget); //剪贴板Widget m_pWidgetOutVLayout->addWidget(m_pPluginsButtonWidget); //显示小插件的Widget m_pWidgetOutVLayout->setSpacing(0); this->setLayout(m_pWidgetOutVLayout); /* 状态机初始化 */ m_pMachine = new QStateMachine(); m_pClipBoardState = new QState(m_pMachine); m_pSmallPluginsState = new QState(m_pMachine); /* 给状态机分配属性 状态一,剪贴板状态 */ m_pClipBoardState->assignProperty(m_pClipboardWidget, "geometry", QRectF(0, 50, 400, 250)); m_pClipBoardState->assignProperty(m_pPluginsButtonWidget, "geometry", QRectF(400, 50, 400, 250)); /* 给状态机分配属性 状态二,小插件页面状态 */ m_pSmallPluginsState->assignProperty(m_pClipboardWidget, "geometry", QRectF(400, 50, 400, 250)); m_pSmallPluginsState->assignProperty(m_pPluginsButtonWidget, "geometry", QRectF(0, 50, 400, 250)); /* 给状态机配置状态转换信号 */ QAbstractTransition *t1 = m_pClipBoardState->addTransition(m_pSidebarPluginButton, SIGNAL(enterButtonSignal()), m_pSmallPluginsState); t1->addAnimation(new QPropertyAnimation(m_pPluginsButtonWidget, "geometry")); QAbstractTransition *t2 = m_pSmallPluginsState->addTransition(m_pClipboardButton, SIGNAL(enterButtonSignal()), m_pClipBoardState); t2->addAnimation(new QPropertyAnimation(m_pClipboardWidget, "geometry")); /* 初始化状态机时所要做的事情 */ connect(m_pClipBoardState, &QState::propertiesAssigned, this, [=]{ if (resizeFlagOne) { m_pPluginsButtonWidget->setVisible(true); m_pPluginsButtonWidget->show(); resizeFlagOne = false; m_pSidebarPluginButton->SendSingal(); qDebug() << "剪贴板界面 --> 进入小插件界面"; } if (ClipBoardBool) { qDebug() << "修改分辨率后状态已转换完成,当前状态在剪贴板界面"; mostGrandWidget::getInstancemostGrandWidget()->hide(); ClipBoardBool = false; } }); connect(m_pSmallPluginsState, &QState::propertiesAssigned, this, [=]{ if (m_pBoolStates) { m_pPluginsButtonWidget->setVisible(true); m_pBoolStates = false; m_pClipboardButton->SendSingal(); qDebug() << "小插件界面 --> 进入剪贴板界面"; mostGrandWidget::getInstancemostGrandWidget()->hide(); } if (SmallPluginsBool) { qDebug() << "修改分辨率后状态已转换完成,当前状态在小插件界面"; mostGrandWidget::getInstancemostGrandWidget()->hide(); SmallPluginsBool = false; } }); /* 进入状态机一需要将小插件按钮的背景设置成空白 */ connect(m_pClipBoardState, &QState::entered, this, [=](){ setSmallPluginsButtonBackgroudIsBlank(); m_pBlueBackgroundButton->setVisible(true); m_pAnimationRightLeft->start(); m_statusFlag = KYLIN_STATE_CLIPBOARD; }); /* 进入状态机二时将按钮小插件的背景设置成空白 */ connect(m_pSmallPluginsState, &QState::entered, this, [=](){ setClipboardButtonBackgroundIsBlank(); m_pBlueBackgroundButton->setVisible(true); m_pAnimationLeftRight->start(); m_statusFlag = KYLIN_STATE_SMALL_PLUGINS; }); m_pPluginsButtonWidget->setVisible(false); m_pMachine->setInitialState(m_pClipBoardState); m_pMachine->start(); } /* 移动到剪贴板按钮需要修改的界面 */ void sidebarPluginsWidgets::m_pClipBoardStateSlots() { m_pBlueBackgroundButton->setVisible(false); setClipboardButtonBackgroundIsBlue(); setSmallPluginsButtonBackgroudIsBlank(); } /* 移动到小插件界面按钮需要做的界面修改 */ void sidebarPluginsWidgets::m_pSmallPluginsStateSlots() { m_pBlueBackgroundButton->setVisible(false); setClipboardButtonBackgroundIsBlank(); setSmallPluginsButtonBackgroudIsBlue(); } /* 新建Lable的动画类 */ void sidebarPluginsWidgets::initLableBackgroundAnimation() { m_pAnimationLeftRight = new QPropertyAnimation(m_pBlueBackgroundButton, "geometry"); m_pAnimationLeftRight->setDuration(200); m_pAnimationLeftRight->setStartValue(QRect(10, 15, 90, 34)); m_pAnimationLeftRight->setEndValue(QRect(108, 15, 90, 34)); m_pAnimationRightLeft = new QPropertyAnimation(m_pBlueBackgroundButton, "geometry"); m_pAnimationRightLeft->setDuration(200); m_pAnimationRightLeft->setStartValue(QRect(108, 15, 90, 34)); m_pAnimationRightLeft->setEndValue(QRect(10, 15, 90, 34)); connect(m_pAnimationLeftRight, &QPropertyAnimation::finished, this, &sidebarPluginsWidgets::m_pSmallPluginsStateSlots); connect(m_pAnimationRightLeft, &QPropertyAnimation::finished, this, &sidebarPluginsWidgets::m_pClipBoardStateSlots); } /* 设置侧边栏的按钮背景色为蓝色 */ void sidebarPluginsWidgets::setClipboardButtonBackgroundIsBlue() { m_pClipboardButton->setStyleSheet("QPushButton#ClipboardButton{background:rgba(61,107,229,1);\ width:41px; \ height:14px; \ font-size:14px; \ font-family:Noto Sans CJK SC; \ font-weight:400; \ color:rgba(255,255,255,1); \ line-height:34px; \ opacity:0.97;}"); } void sidebarPluginsWidgets::setSmallPluginsButtonBackgroudIsBlue() { m_pSidebarPluginButton->setStyleSheet("QPushButton#SidebarPluginButton{background:rgba(61,107,229,1);\ width:41px; \ height:14px; \ font-size:14px; \ font-family:Noto Sans CJK SC; \ font-weight:400; \ color:rgba(255,255,255,1); \ line-height:34px; \ opacity:0.97;}"); } void sidebarPluginsWidgets::setClipboardButtonBackgroundIsBlank() { m_pClipboardButton->setStyleSheet("QPushButton#ClipboardButton{background:rgba(61,107,229,0);\ width:41px; \ height:14px; \ font-size:14px; \ font-family:Noto Sans CJK SC; \ font-weight:400; \ color:rgba(255,255,255,1); \ line-height:34px; \ opacity:0.97;}"); } void sidebarPluginsWidgets::setSmallPluginsButtonBackgroudIsBlank() { m_pSidebarPluginButton->setStyleSheet("QPushButton#SidebarPluginButton{background:rgba(61,107,229,0);\ width:41px; \ height:14px; \ font-size:14px; \ font-family:Noto Sans CJK SC; \ font-weight:400; \ color:rgba(255,255,255,1); \ line-height:34px; \ opacity:0.97;}"); } void sidebarPluginsWidgets::setClipboardWidgetSize(int ClipHight) { qDebug() << "设置小剪贴板的界面大小---->" << ClipHight; this->setFixedSize(400, ClipHight); m_pClipboardWidget->setFixedSize(400, ClipHight - 60); return; } //重新绘制背景色 void sidebarPluginsWidgets::paintEvent(QPaintEvent *) { QStyleOption opt; opt.init(this); QPainter p(this); p.setBrush(QBrush(QColor("#161617"))); p.setOpacity(0.42); p.setPen(Qt::NoPen); p.setRenderHint(QPainter::Antialiasing); //反锯齿 p.drawRoundedRect(opt.rect,0,0); p.drawRect(opt.rect); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } void sidebarPluginsWidgets::loadSmallPlugins() { /* Iterative m_pSmallPluginsHash hash table */ int pluginsNum = SmallPluginsManage::getInstance()->m_PluginsNum; qDebug() << "1111111111111-->pluginsNum" << pluginsNum; int Sequence = 1; int add_x = 0; int add_y = 1; QSpacerItem *item1 = new QSpacerItem(10, 20); while (pluginsNum) { QHash ::const_iterator iter1 = SmallPluginsManage::getInstance()->m_pSmallPluginsHash.constBegin(); while (iter1 != SmallPluginsManage::getInstance()->m_pSmallPluginsHash.constEnd()) { qDebug() << "iter1.value()->pluginsLoadingSequence() --> " << iter1.value()->pluginsLoadingSequence(); if (iter1.value()->pluginsLoadingSequence() == Sequence) { QToolButton *p_ToolButton = new QToolButton(); p_ToolButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); p_ToolButton->setFixedSize(90,90); p_ToolButton->setIcon(iter1.value()->icon()); p_ToolButton->setText(iter1.value()->PluginButtonName()); qDebug() << "jiekoumingzi4560000000" << iter1.value()->PluginButtonName(); p_ToolButton->setIconSize(QSize(iter1.value()->PluginIconSize_W(), iter1.value()->PluginIconSize_H())); m_pGroupBoxUnSmallPluginsGLayout->addItem(item1, add_x, add_y - 1); m_pGroupBoxUnSmallPluginsGLayout->addWidget(p_ToolButton, add_x, add_y); connect(p_ToolButton, &QToolButton::clicked, this, [=]() { iter1.value()->PluginsShowInterface(); }); pluginsNum--; add_y += 2; if (add_y > 8) { add_x++; add_y = 1; } break; } ++iter1; } Sequence++; if (Sequence > KYLIN_PLUGINS_NUM) { break; } } qDebug() << "x -->" << add_x << "y -->" << add_y; QSpacerItem *item2 = new QSpacerItem(400 - 100*(add_y/2), 20); m_pGroupBoxUnSmallPluginsGLayout->addItem(item2, add_x, add_y - 1); m_pGroupBoxUnSmallPluginsGLayout->setContentsMargins(0, 19, 0, 250 - 90*(add_x + 1)); } ukui-sidebar/src/pluginmanage.cpp0000644000175000017500000000634513637056631016046 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include static PluginManager *global_instance = nullptr; PluginManager::PluginManager(QObject *parent) : QObject(parent) { QDir pluginsDir("/usr/lib/ukui-sidebar/sidebarSmallPlugins"); pluginsDir.setFilter(QDir::Files); qDebug()<(pPlugin); if (!pPluginInterface) { continue; } qDebug()<name(); m_PluginInterfaceHash.insert(pPluginInterface->name(), pPluginInterface); switch (pPluginInterface->pluginType()) { case PluginInterface::SmallPlugin: { /* Plugins Num++, add Hash SmallPlugins pPluginInterface-->SmallPluginsInterface */ qDebug() << "Plugins Num++, add Hash SmallPlugins pPluginInterface-->SmallPluginsInterface"; SidebarSmallPluginInterface *p_SmallPluginsInterface = dynamic_cast(pPluginInterface); SmallPluginsManage::getInstance()->registerSmallplugin(pPluginInterface, p_SmallPluginsInterface); break; } case PluginInterface::ClipBoard: { break; } case PluginInterface::PushBtton3: { break; } default: break; } } } PluginManager::~PluginManager() { m_PluginInterfaceHash.clear(); } PluginManager *PluginManager::getInstance() { if (!global_instance) { global_instance = new PluginManager; } return global_instance; } void PluginManager::setPluginEnableByName(const QString &name, bool enable) { m_PluginInterfaceHash.value(name)->setEnable(enable); } void PluginManager::close() { if (global_instance) global_instance->deleteLater(); } void PluginManager::init() { PluginManager::getInstance(); } ukui-sidebar/src/ukui-sidebar-core.pro0000644000175000017500000000372413642562542016724 0ustar fengfeng#------------------------------------------------- # # Project created by QtCreator 2019-11-16T14:05:00 # #------------------------------------------------- QT += core gui dbus widgets TARGET = ukui-sidebar TEMPLATE = app CONFIG += c++11 # The following define makes your compiler emit warnings if you use # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS DEFINES += QT_MESSAGELOGCONTEXT # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 include(./plugin-signals/plugin-signals.pri) include(./plugin-interface/plugin-interface.pri) RESOURCES += sidebar.qrc SOURCES += \ main.cpp \ mostgrandwidget.cpp \ realtimepropertyanimation.cpp \ sidebarpluginswidgets.cpp \ smallpluginsbutton.cpp \ smallpluginsmanage.cpp \ widget.cpp \ pluginmanage.cpp \ sidebar_app_log.cpp INCLUDEPATH += ./plugin-interface HEADERS += \ mostgrandwidget.h \ realtimepropertyanimation.h \ sidebarpluginswidgets.h \ smallpluginsbutton.h \ smallpluginsmanage.h \ widget.h \ pluginmanage.h \ sidebar_app_log.h INCLUDEPATH +=./plugin-interface ./plugin-sub-manager TRANSLATIONS += Sidebar_zh_CN.ts CONFIG += link_pkgconfig PKGCONFIG +=gio-2.0 glib-2.0 gio-unix-2.0 LIBS += -lgio-2.0 -lgobject-2.0 -lglib-2.0 desktopfile.files = data/ukui-sidebar.desktop desktopfile.path = /etc/xdg/autostart/ # Default rules for deployment. target.path = /usr/bin/ !isEmpty(target.path): INSTALLS += target INSTALLS += desktopfile ukui-sidebar/src/smallpluginsmanage.cpp0000644000175000017500000000460613637056631017260 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 key PluginInterface =nullptr || SidebarSmallPluginInterface = nullptr"; return; } if (m_pSmallPluginsHash.value(key)) { qDebug() << "m_pSmallPluginsHash has key PluginInterface"; return; } qDebug() << "zhangsan"; m_pSmallPluginsHash.insert(key, value); m_PluginsNum++; return; } SidebarSmallPluginInterface* SmallPluginsManage::getSmallplugin(PluginInterface *key) { if (key == nullptr) { qDebug() << "getSmallplugin --> PluginInterface key = nullptr"; return nullptr; } return m_pSmallPluginsHash.value(key); } void SmallPluginsManage::removeSmallplugin(PluginInterface *key) { if (key == nullptr) { qDebug() << "removeSmallplugin --> PluginInterface key = nullptr"; return; } m_pSmallPluginsHash.remove(key); return; } ukui-sidebar/src/customstyle.cpp0000644000175000017500000001212213634067640015757 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include CustomStyle::CustomStyle(const QString &proxyStyleName, QObject *parent) : QProxyStyle (proxyStyleName) { } void CustomStyle::drawComplexControl(QStyle::ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const { return QProxyStyle::drawComplexControl(control, option, painter, widget); } void CustomStyle::drawControl(QStyle::ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const { return QProxyStyle::drawControl(element, option, painter, widget); } void CustomStyle::drawItemPixmap(QPainter *painter, const QRect &rectangle, int alignment, const QPixmap &pixmap) const { return QProxyStyle::drawItemPixmap(painter, rectangle, alignment, pixmap); } void CustomStyle::drawItemText(QPainter *painter, const QRect &rectangle, int alignment, const QPalette &palette, bool enabled, const QString &text, QPalette::ColorRole textRole) const { return QProxyStyle::drawItemText(painter, rectangle, alignment, palette, enabled, text, textRole); } void CustomStyle::drawPrimitive(QStyle::PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const { return QProxyStyle::drawPrimitive(element, option, painter, widget); } QPixmap CustomStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *option) const { return QProxyStyle::generatedIconPixmap(iconMode, pixmap, option); } QStyle::SubControl CustomStyle::hitTestComplexControl(QStyle::ComplexControl control, const QStyleOptionComplex *option, const QPoint &position, const QWidget *widget) const { return QProxyStyle::hitTestComplexControl(control, option, position, widget); } QRect CustomStyle::itemPixmapRect(const QRect &rectangle, int alignment, const QPixmap &pixmap) const { return QProxyStyle::itemPixmapRect(rectangle, alignment, pixmap); } QRect CustomStyle::itemTextRect(const QFontMetrics &metrics, const QRect &rectangle, int alignment, bool enabled, const QString &text) const { return QProxyStyle::itemTextRect(metrics, rectangle, alignment, enabled, text); } int CustomStyle::pixelMetric(QStyle::PixelMetric metric, const QStyleOption *option, const QWidget *widget) const { return QProxyStyle::pixelMetric(metric, option, widget); } void CustomStyle::polish(QWidget *widget) { if (widget) { if (widget->inherits("QTipLabel")) { widget->setAttribute(Qt::WA_TranslucentBackground); QPainterPath path; auto rect = widget->rect(); rect.adjust(0, 0, -0, -0); path.addRoundedRect(rect, 6, 6); widget->setProperty("blurRegion", (QVariant)QRegion(path.toFillPolygon().toPolygon())); } } return QProxyStyle::polish(widget); } void CustomStyle::polish(QApplication *application) { return QProxyStyle::polish(application); } void CustomStyle::polish(QPalette &palette) { return QProxyStyle::polish(palette); } void CustomStyle::unpolish(QWidget *widget) { return QProxyStyle::unpolish(widget); } void CustomStyle::unpolish(QApplication *application) { return QProxyStyle::unpolish(application); } QSize CustomStyle::sizeFromContents(QStyle::ContentsType type, const QStyleOption *option, const QSize &contentsSize, const QWidget *widget) const { return QProxyStyle::sizeFromContents(type, option, contentsSize, widget); } QIcon CustomStyle::standardIcon(QStyle::StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const { return QProxyStyle::standardIcon(standardIcon, option, widget); } QPalette CustomStyle::standardPalette() const { return QProxyStyle::standardPalette(); } int CustomStyle::styleHint(QStyle::StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const { return QProxyStyle::styleHint(hint, option, widget, returnData); } QRect CustomStyle::subControlRect(QStyle::ComplexControl control, const QStyleOptionComplex *option, QStyle::SubControl subControl, const QWidget *widget) const { return QProxyStyle::subControlRect(control, option, subControl, widget); } QRect CustomStyle::subElementRect(QStyle::SubElement element, const QStyleOption *option, const QWidget *widget) const { return QProxyStyle::subElementRect(element, option, widget); } ukui-sidebar/src/mostgrandwidget.cpp0000644000175000017500000000227513642562542016576 0ustar fengfeng#include "mostgrandwidget.h" static mostGrandWidget* global_Most_Grand_Widgets_instance = nullptr; mostGrandWidget::mostGrandWidget(QWidget *parent) { Q_UNUSED(parent) this->setContentsMargins(0,0,0,0); m_pmostGrandWidgetVLaout = new QVBoxLayout(); m_pmostGrandWidgetVLaout->setContentsMargins(0,0,0,0); this->setWindowFlags(Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint); this->setAttribute(Qt::WA_TranslucentBackground); } mostGrandWidget::~mostGrandWidget() { } void mostGrandWidget::mostGrandWidgetInit() { mostGrandWidget::getInstancemostGrandWidget(); return; } mostGrandWidget* mostGrandWidget::getInstancemostGrandWidget() { if (global_Most_Grand_Widgets_instance == nullptr) { global_Most_Grand_Widgets_instance = new mostGrandWidget(); } return global_Most_Grand_Widgets_instance; } /* last Laout MostGrand Widget */ void mostGrandWidget::LaoutSidebarWidget() { this->setLayout(m_pmostGrandWidgetVLaout); return; } void mostGrandWidget::setMostGrandwidgetSize(int w, int h) { this->setFixedSize(w,h); return; } void mostGrandWidget::setMostGrandwidgetCoordinates(int x, int y) { this->move(x, y); return; } ukui-sidebar/src/sidebar.qrc0000644000175000017500000000073313635342602015000 0ustar fengfeng data/qss/psblack.css data/qss/SidebarSmallPlugins.css data/images/kylin-tool-box.svg data/images/kylin-tool-box-null.svg data/images/kylin-alarm-clock.svg data/images/kylin-notebook.svg data/images/kylin-feedback.png sidebartranslat/Sidebar_zh_CN.qm ukui-sidebar/src/Sidebar_zh_CN.ts0000644000175000017500000000442213642562542015666 0ustar fengfeng QObject Display debug information Widget ClipBoard 剪贴板 Mi&nimize Ma&ximize normal &Quit Sidebar 侧边栏 sidebarPluginsWidgets Clipboard 剪贴板 Plugins 小插件 Notebook 笔记本 Alarm clock 闹钟 Feedback 用户反馈 ukui-sidebar/src/smallpluginsbutton.h0000644000175000017500000000213213635342602016772 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 class SmallPluginsButton :public QPushButton { Q_OBJECT public: SmallPluginsButton(); ~SmallPluginsButton(); void SendSingal(); protected: void enterEvent(QEvent *e); //鼠标进入事件 void leaveEvent(QEvent *e);//鼠标离开事件 signals: void enterButtonSignal(); }; #endif // SMALLPLUGINSBUTTON_H ukui-sidebar/src/customstyle.h0000644000175000017500000001712613634067640015435 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 // * \brief The CustomStyle class // * \details // * 自定义QStyle // * 基于QProxyStyle,默认使用QProxyStyle的实例绘制控件,你需要针对某一个控件重新实现若干对应的接口。 // * QProxyStyle可以从现有的qt style实例化,我们只需要知道这个style的名字即可。 // * 这种做法带来了不错的扩展性和自由度,因为我们不需要将某个style的代码直接引入我们的项目中, // * 也能够“继承”这个style类进行二次开发。 // * // * 下面的方法展现了QStyle的所有的接口,使用QStyle进行控件的绘制使得qt应用能够进行风格的切换, // * 从而达到不修改项目源码却对应用外观产生巨大影响的效果。 // * // * \note // * 需要注意QStyle与QSS并不兼容,因为QSS本身其实上也是QStyle的一种实现,对一个控件而言,本身理论上只能 // * 在同一时间调用唯一一个QStyle进行绘制。 class CustomStyle : public QProxyStyle { Q_OBJECT public: explicit CustomStyle(const QString &proxyStyleName = "windows", QObject *parent = nullptr); // * \brief drawComplexControl // * \param control 比如ScrollBar,对应CC枚举类型 // * \param option // * \param painter // * \param widget // * \details // * drawComplexControl用于绘制具有子控件的复杂控件,它本身一般不直接绘制控件, // * 而是通过QStyle的其它方法将复杂控件分解成子控件再调用其它的draw方法绘制。 // * 如果你需要重新实现一个复杂控件的绘制方法,首先考虑的应该是在不改变它原有的绘制流程的情况下, // * 对它调用到的其它方法进行重写。 // * // * 如果你不想使用原有的绘制流程,那你需要重写这个接口,然后自己实现一切, // * 包括背景的绘制,子控件的位置和状态计算,子控件的绘制等。 // * 所以,你需要对这个控件有足够的了解之后再尝试直接重写这个接口。 virtual void drawComplexControl(QStyle::ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget = nullptr) const; // * \brief drawControl // * \param element 比如按钮,对应CE枚举类型 // * \param option // * \param painter // * \param widget // * \details // * drawControl用于绘制基本控件元素,它本身一般只负责绘制控件的一部分或者一层。 // * 如果你想要知道控件具体如何绘制,你需要同时研究这个控件的源码和QStyle中的源码, // * 因为它们都有可能改变控件的绘制流程。 // * // * QStyle一般会遵循QCommonStyle的绘制流程,QCommenStyle是大部分主流style的最基类, // * 它本身不能完全称之为一个主题,如果你直接使用它,你的控件将不能被正常绘制,因为它有可能只是 // * 在特定的时候执行了特定却未实现的绘制方法,它更像一个框架或者规范。 virtual void drawControl(QStyle::ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = nullptr) const; virtual void drawItemPixmap(QPainter *painter, const QRect &rectangle, int alignment, const QPixmap &pixmap) const; virtual void drawItemText(QPainter *painter, const QRect &rectangle, int alignment, const QPalette &palette, bool enabled, const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const; // * \brief drawPrimitive // * \param element 背景绘制,对应PE枚举类型 // * \param option // * \param painter // * \param widget // * \details // * drawPrimitive用于绘制控件背景,比如按钮和菜单的背景, // * 我们一般需要判断控件的状态来绘制不同的背景, // * 比如按钮的hover和点击效果。 virtual void drawPrimitive(QStyle::PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = nullptr) const; virtual QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *option) const; virtual QStyle::SubControl hitTestComplexControl(QStyle::ComplexControl control, const QStyleOptionComplex *option, const QPoint &position, const QWidget *widget = nullptr) const; virtual QRect itemPixmapRect(const QRect &rectangle, int alignment, const QPixmap &pixmap) const; virtual QRect itemTextRect(const QFontMetrics &metrics, const QRect &rectangle, int alignment, bool enabled, const QString &text) const; virtual int pixelMetric(QStyle::PixelMetric metric, const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const; // * \brief polish // * \param widget // * \details // * polish用于对widget进行预处理,一般我们可以在polish中修改其属性, // * 另外,polish是对动画和特效实现而言十分重要的一个方法, // * 通过polish我们能够使widget和特效和动画形成对应关系。 virtual void polish(QWidget *widget); virtual void polish(QApplication *application); virtual void polish(QPalette &palette); virtual void unpolish(QWidget *widget); virtual void unpolish(QApplication *application); virtual QSize sizeFromContents(QStyle::ContentsType type, const QStyleOption *option, const QSize &contentsSize, const QWidget *widget = nullptr) const; virtual QIcon standardIcon(QStyle::StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const; virtual QPalette standardPalette() const; // * \brief styleHint // * \param hint 对应的枚举是SH // * \param option // * \param widget // * \param returnData // * \return // * \details // * styleHint比较特殊,通过它我们能够改变一些控件的绘制流程或者方式,比如说QMenu是否可以滚动。 virtual int styleHint(QStyle::StyleHint hint, const QStyleOption *option = nullptr, const QWidget *widget = nullptr, QStyleHintReturn *returnData = nullptr) const; // * \brief subControlRect // * \param control // * \param option // * \param subControl // * \param widget // * \return // * \details // * subControlRect返回子控件的位置和大小信息,这个方法一般在内置流程中调用, // * 如果我们要重写某个绘制方法,可能需要用到它 virtual QRect subControlRect(QStyle::ComplexControl control, const QStyleOptionComplex *option, QStyle::SubControl subControl, const QWidget *widget = nullptr) const; // * \brief subElementRect // * \param element // * \param option // * \param widget // * \return // * \details // * 与subControlRect类似 virtual QRect subElementRect(QStyle::SubElement element, const QStyleOption *option, const QWidget *widget = nullptr) const; }; #endif // CUSTOMSTYLE_H ukui-sidebar/src/widget.cpp0000644000175000017500000006036713642562542014665 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include "customstyle.h" Widget::Widget(QWidget *parent) : QWidget (parent) { m_pTranslator = new QTranslator; QLocale locale; if( locale.language() == QLocale::Chinese ) //获取系统语言环境 { m_pTranslator->load(QString(":sidebartranslat/Sidebar_zh_CN.qm")); //选择翻译文件 QApplication::installTranslator(m_pTranslator); } m_bShowFlag = false; m_bFwinkleFlag = true; //监听屏幕分辨率是否变化 m_pDeskWgt = QApplication::desktop(); // qDebug() << "dasdasdas" << m_pDeskWgt->width(); // qDebug() << "dasdasdas" << m_pDeskWgt->height(); connect(m_pDeskWgt, SIGNAL(resized(int)), this, SLOT(onResolutionChanged(int))); connect(m_pDeskWgt, &QDesktopWidget::primaryScreenChanged, this, &Widget::primaryScreenChangedSLot); connect(m_pDeskWgt, &QDesktopWidget::screenCountChanged, this, &Widget::screenCountChangedSlots); m_pServiceInterface = new QDBusInterface(PANEL_DBUS_SERVICE, PANEL_DBUS_PATH, PANEL_DBUS_INTERFACE, QDBusConnection::sessionBus()); m_pServiceInterface->setTimeout(2147483647); //主界面最外框布局器 m_pMainOuterBoxLayout = new QVBoxLayout; m_pMainOuterBoxLayout->setContentsMargins(0,0,0,0); m_pMainOuterBoxLayout->setSpacing(0); //主界面最外框架部件 m_pMainOuterWidget = new QWidget(this); m_pMainOuterWidget->setStyleSheet("QWidget#MainOuterWidget{background:rgba(255, 255, 0, 0);}"); m_pMainOuterReplaceWidget = new QWidget(this); m_pMainOuterReplaceWidget->setStyleSheet("background:transparent;"); m_pMainOuterReplaceWidget->setVisible(false); //主界面显示 m_pMainQVBoxLayout = new QVBoxLayout; m_pMainQVBoxLayout->setContentsMargins(0,0,0,0); m_pMainQVBoxLayout->setSpacing(0); /* 初始化剪贴板与小插件界面 */ sidebarPluginsWidgets::initPluginsWidgets(); sidebarPluginsWidgets::getInstancePluinsWidgets()->loadSmallPlugins(); InitializeHomeScreenGeometry(); //加载通知中心插件 if (false == loadNotificationPlugin()) { qDebug() << "通知中心插件加载失败"; } //加载剪贴板插件, 将剪贴板插件加入到sidebarPluginsWidgets的GroupBox中 if (ListenClipboardSignal()) { qDebug() << "剪贴板插件加载失败"; } m_pMainOuterWidget->setLayout(m_pMainQVBoxLayout); // this->setLayout(m_pMainOuterBoxLayout); this->setLayout(m_pMainQVBoxLayout); //系统托盘栏显示 createAction(); createSystray(); setIcon(TRAY_ICON); //安装事件过滤器 installEventFilter(this); m_pAnimationShowSidebarWidget = new QPropertyAnimation(this, "geometry"); m_pAnimationHideSidebarWidget = new QPropertyAnimation(this, "geometry"); connect(m_pAnimationHideSidebarWidget, &QPropertyAnimation::finished, this, &Widget::hideAnimationFinish); connect(m_pAnimationShowSidebarWidget, &QPropertyAnimation::finished, this, &Widget::showAnimationFinish); connect(m_pAnimationShowSidebarWidget, &QPropertyAnimation::valueChanged, this, &Widget::showAnimationAction); //将托盘栏图标和widget联系起来 connect(trayIcon, &QSystemTrayIcon::activated, this, &Widget::iconActivated); trayIcon->setVisible(true); this->setWindowFlags(Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint); qInfo() << "---------------------------主界面加载完毕---------------------------"; m_pTimer = new QTimer(); connect(m_pTimer, SIGNAL(timeout()), this, SLOT(twinkle())); } Widget::~Widget() { } //加载通知中心插件 bool Widget::loadNotificationPlugin() { QDir pluginsDir("/usr/lib/ukui-sidebar/notification"); QPluginLoader pluginLoader(pluginsDir.absoluteFilePath("libnotification_plugin.so")); m_pNotificationPluginObject = pluginLoader.instance(); if(nullptr == m_pNotificationPluginObject) { return false; } NotificationInterface* pNotificationPluginObject = qobject_cast(m_pNotificationPluginObject); if(nullptr == pNotificationPluginObject) { return false; } connect(m_pNotificationPluginObject, SIGNAL(Sig_onNewNotification()), this, SLOT(onNewNotification())); m_pMainQVBoxLayout->addWidget(pNotificationPluginObject->centerWidget(), 1); return true; } //加载剪贴板插件 int Widget::ListenClipboardSignal() { QDir pluginsDir("/usr/lib/ukui-sidebar/sidebar_clipboardPlugin_plugins"); pluginsDir.setFilter(QDir::Files); QPluginLoader pluginLoader(pluginsDir.absoluteFilePath("libclipboardPlugin.so")); QObject *pClipPlugin = pluginLoader.instance(); m_pSidebarClipboard = dynamic_cast(pClipPlugin); //获取剪贴版插件指针; if (nullptr == m_pSidebarClipboard) { qWarning() << "剪贴板插件插件加载失败"; return 1; } m_pSidebarSignal = m_pSidebarClipboard->createClipSignal(); //获取剪贴板的信号类指针 /* 点击剪贴板空白区域时,隐藏侧边栏 */ connect(m_pSidebarSignal, &SidebarClipBoardSignal::ClipboardHideSignal, this, [=]() { mostGrandWidget::getInstancemostGrandWidget()->topLevelWidget()->setProperty("blurRegion", QRegion(QRect(1, 1, 1, 1))); hideAnimation(); }); sidebarPluginsWidgets::getInstancePluinsWidgets()->m_pClipboardWidget = m_pSidebarClipboard->getClipbaordGroupBox(); //获取剪贴板的Groubox指针; GetsAvailableAreaScreen(); //获取屏幕可用高度区域 int clipboardhight = setClipBoardWidgetScaleFactor(); qDebug() << "剪贴板高度" << clipboardhight; sidebarPluginsWidgets::getInstancePluinsWidgets()->setClipboardWidgetSize(clipboardhight); //设定剪贴板高度 sidebarPluginsWidgets::getInstancePluinsWidgets()->AddPluginWidgetInterface(); //将下半部分所有控件加入到sidebarPluginsWidgets中 m_pMainQVBoxLayout->addWidget(sidebarPluginsWidgets::getInstancePluinsWidgets(), 0); return 0; } //创建动作 void Widget::createAction() { minimizeAction = new QAction(tr("Mi&nimize"), this); connect(minimizeAction, &QAction::triggered, this, &QWidget::hide); maximizeAction = new QAction(tr("Ma&ximize"), this); connect(maximizeAction, &QAction::triggered, this, &QWidget::showMaximized); restoreAction = new QAction(tr("normal"), this); connect(restoreAction, &QAction::triggered, this, &QWidget::showNormal); quitAction = new QAction(tr("&Quit"), this); connect(quitAction, &QAction::triggered, qApp, &QCoreApplication::quit); } //添加动作和创建 systray实例 void Widget::createSystray() { trayIconMenu = new QMenu(this); if (trayIconMenu == nullptr) { qWarning() << "分配空间trayIconMenu失败"; return ; } // trayIconMenu->addAction(minimizeAction); // trayIconMenu->addAction(maximizeAction); // trayIconMenu->addAction(restoreAction); // trayIconMenu->addSeparator(); // trayIconMenu->addAction(quitAction); trayIcon = new QSystemTrayIcon(this); if (nullptr == trayIcon) { qWarning()<< "分配空间trayIcon失败"; return ; } trayIcon->setContextMenu(trayIconMenu); } //设置托盘栏的图标 void Widget::setIcon(QString strIcon) { QIcon icon = QIcon(strIcon); trayIcon->setIcon(icon); setWindowIcon(icon); trayIcon->setToolTip(tr("Sidebar")); } //设置activated信号 void Widget::iconActivated(QSystemTrayIcon::ActivationReason reason) { switch (reason) { case QSystemTrayIcon::Trigger: { if (m_bShowFlag) { qDebug() << "Widget::iconActivated 隐藏"; mostGrandWidget::getInstancemostGrandWidget()->topLevelWidget()->setProperty("blurRegion", QRegion(QRect(1, 1, 1, 1))); hideAnimation(); } else { mostGrandWidget::getInstancemostGrandWidget()->hide(); MostGrandWidgetCoordinates(); qDebug() << "Widget::iconActivated 展开"; mostGrandWidget::getInstancemostGrandWidget()->show(); showAnimation(); m_bShowFlag = true; m_pTimer->stop(); //当侧边栏展开时,停止闪烁定时器,并且设置有图标的托盘图标 setIcon(TRAY_ICON); } break; } // case QSystemTrayIcon::DoubleClick: // { // mostGrandWidget::getInstancemostGrandWidget()->hide(); // MostGrandWidgetCoordinates(); // qDebug() << "Widget::iconActivated 展开"; // mostGrandWidget::getInstancemostGrandWidget()->show(); // showAnimation(); // m_bShowFlag = true; // m_pTimer->stop(); //当侧边栏展开时,停止闪烁定时器,并且设置有图标的托盘图标 // setIcon(TRAY_ICON); // break; // } default: break; } } //链接任务栏dbus获取高度的接口 int Widget::connectTaskBarDbus() { QDBusMessage msg = m_pServiceInterface->call("GetPanelSize", QVariant("Hight")); int panelHight = msg.arguments().at(0).toInt(); return panelHight; } //获取任务栏状态位置下上左右 int Widget::getPanelSite() { QDBusMessage msg = m_pServiceInterface->call("GetPanelPosition", QVariant("Site")); int PanelSite = msg.arguments().at(0).toInt(); qDebug() << "panel所在的位置" << PanelSite; return PanelSite; } void Widget::mousePressEvent(QMouseEvent *event) { if (event->buttons() == Qt::LeftButton) { mostGrandWidget::getInstancemostGrandWidget()->topLevelWidget()->setProperty("blurRegion", QRegion(QRect(1, 1, 1, 1))); hideAnimation(); } } //获取屏幕的可用区域高度和宽度 void Widget::GetsAvailableAreaScreen() { //如果取不到任务栏的高度,还是优先获取桌面分辨率,可用区域 if((0 == connectTaskBarDbus()) && (0 == getPanelSite())) { QScreen* pScreen = QGuiApplication::primaryScreen(); QRect DeskSize = pScreen->availableGeometry(); m_nScreenWidth = DeskSize.width(); //桌面分辨率的宽 m_nScreenHeight = DeskSize.height(); //桌面分辨率的高 } else { //如果取到任务栏的高度,则取屏幕分辨率的高度 QRect screenRect = m_pDeskWgt->screenGeometry(); m_nScreenWidth = screenRect.width(); m_nScreenHeight = screenRect.height(); } } /* 设定剪贴板高度 */ int Widget::setClipBoardWidgetScaleFactor() { int x , y; x = m_nScreenWidth; y = m_nScreenHeight; if ((x >= 800 && x <= 1280)&&(y >= 600 && y <= 768)) { qDebug() << "800 <= x <= 1280 && 600 <= y <= 720 "; return m_nScreenHeight/2 - connectTaskBarDbus(); } else if ((x >= 1280 && x <= 2048)&&(y >= 900 && y <= 1080)) { qDebug() << "1280 <= x <= 2048 && 900 <= y <= 1080"; return m_nScreenHeight/3; } else if ((x >= 1920 && x <= 3840)&&(y >= 1200 && y <= 2160)) { qDebug() << "1920 <= x 3840 && y >= 1200 && y <= 2160"; return m_nScreenHeight/4; } else { return m_nScreenHeight/2 - connectTaskBarDbus(); qDebug() << "y <= 600 || y>= 2160"; } } //动画展开 void Widget::showAnimation() { NotificationInterface* pNotificationPluginObject = qobject_cast(m_pNotificationPluginObject); if(nullptr != pNotificationPluginObject) { pNotificationPluginObject->showNotification(); //当动画展开时给插件一个通知 } int AnimaStartSideBarSite[4]; //侧边栏动画开始位置 int AnimaStopSidebarSite[4]; //侧边栏动画结束位置 switch (getPanelSite()) { case Widget::PanelDown : { //起始位置的坐标 AnimaStartSideBarSite[0] = 400; AnimaStartSideBarSite[1] = 0; AnimaStartSideBarSite[2] = 400; AnimaStartSideBarSite[3] = m_nScreenHeight - connectTaskBarDbus(); //结束位置坐标 AnimaStopSidebarSite[0] = 0; AnimaStopSidebarSite[1] = 0; AnimaStopSidebarSite[2] = 400; AnimaStopSidebarSite[3] = m_nScreenHeight - connectTaskBarDbus(); } break; case Widget::PanelUp: { //起始位置的坐标 AnimaStartSideBarSite[0] = 400; AnimaStartSideBarSite[1] = 0; AnimaStartSideBarSite[2] = 400; AnimaStartSideBarSite[3] = m_nScreenHeight - connectTaskBarDbus(); //结束位置坐标 AnimaStopSidebarSite[0] = 0; AnimaStopSidebarSite[1] = 0;; AnimaStopSidebarSite[2] = 400; AnimaStopSidebarSite[3] = m_nScreenHeight - connectTaskBarDbus(); } break; case Widget::PanelLeft: { //起始位置的坐标 AnimaStartSideBarSite[0] = 400; AnimaStartSideBarSite[1] = 0; AnimaStartSideBarSite[2] = 400; AnimaStartSideBarSite[3] = m_nScreenHeight; //结束位置坐标 AnimaStopSidebarSite[0] = 0; AnimaStopSidebarSite[1] = 0; AnimaStopSidebarSite[2] = 400; AnimaStopSidebarSite[3] = m_nScreenHeight; } break; case Widget::PanelRight: { //起始位置的坐标 AnimaStartSideBarSite[0] = 400; AnimaStartSideBarSite[1] = 0; AnimaStartSideBarSite[2] = 400; AnimaStartSideBarSite[3] = m_nScreenHeight; //结束位置坐标 AnimaStopSidebarSite[0] = 0; AnimaStopSidebarSite[1] = 0; AnimaStopSidebarSite[2] = 400; AnimaStopSidebarSite[3] = m_nScreenHeight; } break; default: break; } m_pAnimationShowSidebarWidget->setDuration(400); m_pAnimationShowSidebarWidget->setStartValue(QRect(AnimaStartSideBarSite[0], AnimaStartSideBarSite[1], AnimaStartSideBarSite[2], AnimaStartSideBarSite[3])); m_pAnimationShowSidebarWidget->setEndValue(QRect(AnimaStopSidebarSite[0], AnimaStopSidebarSite[1], AnimaStopSidebarSite[2], AnimaStopSidebarSite[3])); m_pAnimationShowSidebarWidget->start(); } void Widget::updateAnimationPosition(int x1, int y1, int x2, int y2) { this->setGeometry(x1, y1, m_nInitalXPosition - x1, y2); m_pMainOuterReplaceWidget->setFixedSize(m_nInitalXPosition - x1, y2); } void Widget::showAnimationFinish() { } void Widget::showAnimationAction(const QVariant &value) { QRect Rect = value.value(); int x = Rect.x(); mostGrandWidget::getInstancemostGrandWidget()->setProperty("blurRegion", QRegion(QRect(x, 0, 400, m_nScreenHeight - connectTaskBarDbus()))); } //隐藏动画 void Widget::hideAnimation() { m_bShowFlag = false; NotificationInterface* pNotificationPluginObject = qobject_cast(m_pNotificationPluginObject); if(nullptr != pNotificationPluginObject) { pNotificationPluginObject->hideNotification(); //当动画隐藏时给插件一个通知 } int AnimaStartSideBarSite[4]; //侧边栏动画开始位置 int AnimaStopSidebarSite[4]; //侧边栏动画结束位置 switch (getPanelSite()) { case Widget::PanelDown : { //起始位置的坐标 AnimaStartSideBarSite[0] = 0; AnimaStartSideBarSite[1] = 0; AnimaStartSideBarSite[2] = 400; AnimaStartSideBarSite[3] = m_nScreenHeight - connectTaskBarDbus(); //结束位置坐标 AnimaStopSidebarSite[0] = 450; AnimaStopSidebarSite[1] = 0; AnimaStopSidebarSite[2] = 400; AnimaStopSidebarSite[3] = m_nScreenHeight - connectTaskBarDbus(); } break; case Widget::PanelUp: { //起始位置的坐标 AnimaStartSideBarSite[0] = 0; AnimaStartSideBarSite[1] = 0; AnimaStartSideBarSite[2] = 400; AnimaStartSideBarSite[3] = m_nScreenHeight - connectTaskBarDbus(); //结束位置坐标 AnimaStopSidebarSite[0] = 450; AnimaStopSidebarSite[1] = 0; AnimaStopSidebarSite[2] = 400; AnimaStopSidebarSite[3] = m_nScreenHeight - connectTaskBarDbus(); } break; case Widget::PanelLeft: { //起始位置的坐标 AnimaStartSideBarSite[0] = 0; AnimaStartSideBarSite[1] = 0; AnimaStartSideBarSite[2] = 400; AnimaStartSideBarSite[3] = m_nScreenHeight; //结束位置坐标 AnimaStopSidebarSite[0] = 450; AnimaStopSidebarSite[1] = 0; AnimaStopSidebarSite[2] = 400; AnimaStopSidebarSite[3] = m_nScreenHeight; } break; case Widget::PanelRight: { //起始位置的坐标 AnimaStartSideBarSite[0] = 0; AnimaStartSideBarSite[1] = 0; AnimaStartSideBarSite[2] = 400; AnimaStartSideBarSite[3] = m_nScreenHeight; //结束位置坐标 AnimaStopSidebarSite[0] = 450; AnimaStopSidebarSite[1] = 0; AnimaStopSidebarSite[2] = 400; AnimaStopSidebarSite[3] = m_nScreenHeight; } break; default: break; } m_pAnimationHideSidebarWidget->setDuration(200); m_pAnimationHideSidebarWidget->setStartValue(QRect(AnimaStartSideBarSite[0], AnimaStartSideBarSite[1], AnimaStartSideBarSite[2], AnimaStartSideBarSite[3])); m_pAnimationHideSidebarWidget->setEndValue(QRect(AnimaStopSidebarSite[0], AnimaStopSidebarSite[1], AnimaStopSidebarSite[2], AnimaStopSidebarSite[3])); m_pAnimationHideSidebarWidget->start(); } void Widget::hideAnimationFinish() { mostGrandWidget::getInstancemostGrandWidget()->hide(); } //当改变屏幕分辨率时重新获取屏幕分辨率 void Widget::onResolutionChanged(int argc) { Q_UNUSED(argc); GetsAvailableAreaScreen(); //获取屏幕可用高度区域 ModifyScreenNeeds(); return; } /* 修改屏幕分辨率或者主屏需要做的事情 */ void Widget::ModifyScreenNeeds() { int clipboardhight = setClipBoardWidgetScaleFactor(); qDebug() << "剪贴板高度" << clipboardhight; sidebarPluginsWidgets::getInstancePluinsWidgets()->setClipboardWidgetSize(clipboardhight); //设定剪贴板高度 /* 先将侧边栏show出来,改变一次状态机,将修改分辨率后,对布局的影响去掉 */ mostGrandWidget::getInstancemostGrandWidget()->setMostGrandwidgetCoordinates(-500, 0); mostGrandWidget::getInstancemostGrandWidget()->show(); if (sidebarPluginsWidgets::getInstancePluinsWidgets()->m_statusFlag == KYLIN_STATE_CLIPBOARD) { sidebarPluginsWidgets::getInstancePluinsWidgets()->m_pSidebarPluginButton->SendSingal(); sidebarPluginsWidgets::getInstancePluinsWidgets()->m_pClipboardButton->SendSingal(); sidebarPluginsWidgets::getInstancePluinsWidgets()->ClipBoardBool = true; } else if (sidebarPluginsWidgets::getInstancePluinsWidgets()->m_statusFlag == KYLIN_STATE_SMALL_PLUGINS) { sidebarPluginsWidgets::getInstancePluinsWidgets()->m_pClipboardButton->SendSingal(); sidebarPluginsWidgets::getInstancePluinsWidgets()->m_pSidebarPluginButton->SendSingal(); sidebarPluginsWidgets::getInstancePluinsWidgets()->SmallPluginsBool = true; } } /* 主屏发生变化槽函数 */ void Widget::primaryScreenChangedSLot() { GetsAvailableAreaScreen(); InitializeHomeScreenGeometry(); } /* 屏幕数量改变时对应槽函数 */ void Widget::screenCountChangedSlots(int count) { Q_UNUSED(count); qDebug() << "屏幕数量发生变化"; GetsAvailableAreaScreen(); InitializeHomeScreenGeometry(); } /* 初始化主屏的X坐标 */ void Widget::InitializeHomeScreenGeometry() { QList screen = QGuiApplication::screens(); int count = m_pDeskWgt->screenCount(); if (count > 1) { m_nScreen_x = screen[0]->availableGeometry().x(); m_nScreen_y = screen[0]->availableGeometry().y(); } else { m_nScreen_x = 0; m_nScreen_y = 0; } } /* 根据任务栏位置调整侧边栏位置 */ void Widget::MostGrandWidgetCoordinates() { switch (getPanelSite()) { case Widget::PanelDown : { mostGrandWidget::getInstancemostGrandWidget()->setMostGrandwidgetSize(400, m_nScreenHeight - connectTaskBarDbus()); mostGrandWidget::getInstancemostGrandWidget()->setMostGrandwidgetCoordinates(m_nScreen_x + m_nScreenWidth - 400, m_nScreen_y); } break; case Widget::PanelUp: { mostGrandWidget::getInstancemostGrandWidget()->setMostGrandwidgetSize(400, m_nScreenHeight - connectTaskBarDbus()); mostGrandWidget::getInstancemostGrandWidget()->setMostGrandwidgetCoordinates(m_nScreen_x + m_nScreenWidth - 400, connectTaskBarDbus() + m_nScreen_y); } break; case Widget::PanelLeft: { mostGrandWidget::getInstancemostGrandWidget()->setMostGrandwidgetSize(400, m_nScreenHeight); mostGrandWidget::getInstancemostGrandWidget()->setMostGrandwidgetCoordinates(m_nScreen_x + m_nScreenWidth - 400, m_nScreen_y); } break; case Widget::PanelRight: { mostGrandWidget::getInstancemostGrandWidget()->setMostGrandwidgetSize(400, m_nScreenHeight); mostGrandWidget::getInstancemostGrandWidget()->setMostGrandwidgetCoordinates(m_nScreen_x + m_nScreenWidth - 400 - connectTaskBarDbus(), m_nScreen_y); } break; default: break; } } //当没展开时,来了新通知才提示 void Widget::onNewNotification() { if(false == m_bShowFlag) { m_bFwinkleFlag = true; m_pTimer->start(500); } return; } void Widget::twinkle() { if(true == m_bFwinkleFlag) { m_bFwinkleFlag = false; setIcon(TRAY_NULL_ICON); } else { m_bFwinkleFlag = true; setIcon(TRAY_ICON); } } /* 事件过滤器 */ bool Widget::eventFilter(QObject *obj, QEvent *event) { Q_UNUSED(obj); Q_UNUSED(event); if (obj == this) { if (event->type() == QEvent::WindowDeactivate && true == m_bShowFlag) { qDebug() << "事件类型" << event->type(); qDebug() << "Widget::eventFilter 消失"; mostGrandWidget::getInstancemostGrandWidget()->topLevelWidget()->setProperty("blurRegion", QRegion(QRect(1, 1, 1, 1))); hideAnimation(); m_bShowFlag = false; return true; } else if (event->type() == QEvent::StyleChange) { ModifyScreenNeeds(); } } if (!isActiveWindow()) { activateWindow(); } return false; } ukui-sidebar/src/main.cpp0000644000175000017500000000635213640375251014315 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include #include #include #include #include #include #include #include "sidebarpluginswidgets.h" #include "smallpluginsmanage.h" #include "mostgrandwidget.h" int main(int argc, char *argv[]) { /* 如果系统中有实例在运行则退出 */ QStringList strlistHomePath = QStandardPaths::standardLocations(QStandardPaths::HomeLocation); QString strLockPath = strlistHomePath.at(0) + "/.config/ukui-sidebar"; int fd = open(strLockPath.toUtf8().data(), O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); if (fd < 0) { exit(1); } if (lockf(fd, F_TLOCK, 0)) { syslog(LOG_ERR, "Can't lock single file, ukui-sidebar is already running!"); qDebug()<<"Can't lock single file, ukui-sidebar is already running!"; exit(0); } QApplication a(argc, argv); QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QCommandLineParser parser; QCommandLineOption debugOption({"d", "debug"}, QObject::tr("Display debug information")); parser.addOptions({debugOption}); parser.process(a); if(parser.isSet(debugOption)) { setLogLevel(QtDebugMsg); /* 根据命令行设定日志等级 */ } else { setLogLevel(QtWarningMsg); } QString LogFilePath = QCoreApplication::applicationDirPath(); /* 获取文件运行的当前路径 */ setLogPath(LogFilePath + LOG_FILE_NAME); /* 绑定打印日志文件路径 */ QApplication::setQuitOnLastWindowClosed(false); SmallPluginsManage::SmallPluginsManageInit(); /* 初始化侧边栏小插件管理容器 */ PluginManager::init(); /* 初始化插件管理器 */ mostGrandWidget::mostGrandWidgetInit(); /* 初始化最里层Widget空白界面 */ Widget *w = new Widget; w->setObjectName("SidebarWidget"); w->setAttribute(Qt::WA_TranslucentBackground); mostGrandWidget::getInstancemostGrandWidget()->m_pmostGrandWidgetVLaout->addWidget(w); mostGrandWidget::getInstancemostGrandWidget()->LaoutSidebarWidget(); mostGrandWidget::getInstancemostGrandWidget()->setMostGrandwidgetCoordinates(-500, 0); mostGrandWidget::getInstancemostGrandWidget()->setVisible(true); return a.exec(); } ukui-sidebar/src/sidebarpluginswidgets.h0000644000175000017500000001143213640375251017433 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include #include #include #include #include #include "smallpluginsbutton.h" #include "smallpluginsmanage.h" #include "mostgrandwidget.h" class sidebarPluginsWidgets : public QWidget { Q_OBJECT public: explicit sidebarPluginsWidgets(QWidget *parent = nullptr); ~sidebarPluginsWidgets(); static sidebarPluginsWidgets* getInstancePluinsWidgets(); static void initPluginsWidgets(); void AddPluginWidgetInterface(); void initUpGroupBoxButton(); //上半部分 剪贴板 小插件 俩按钮 groupBox初始化布局 void initUnGroupBox(); //下半部分 剪贴板的界面 小插件按钮详情界面 初始化 void initLableBackgroundAnimation(); //初始化动画 void setClipboardButtonBackgroundIsBlue(); //设置侧边栏按钮背景色为蓝色 void setSmallPluginsButtonBackgroudIsBlue(); //设置小插件按钮背景色为蓝色 void setClipboardButtonBackgroundIsBlank(); //设置侧边栏按钮背景色为空白 void setSmallPluginsButtonBackgroudIsBlank(); //设置小插件按钮背景色为空白 void setClipboardWidgetSize(int ClipHight); //设置此窗口的大小 void loadSmallPlugins(); //加载小插件,放置到sidebar界面 QVBoxLayout *m_pWidgetOutVLayout; //最外层布局 QHBoxLayout *m_pGrouBoxUpButtonHLayout; //GroupBox中Button中的布局 QGridLayout *m_pGroupBoxUnSmallPluginsGLayout; //闹钟,便签本布局 QWidget *m_pButtonWidget; //放置按钮Box QWidget *m_pClipboardWidget; //放置剪贴板的Box QWidget *m_pPluginsButtonWidget; //放置小插件按钮Box QPushButton *m_pBlueBackgroundButton; //蓝色背景块 SmallPluginsButton *m_pClipboardButton; //剪贴板 界面显示按钮 SmallPluginsButton *m_pSidebarPluginButton; //插件 界面显示按钮 QToolButton *m_pNotebookButton; //笔记本 按钮 QToolButton *m_pAlarmClockButton; //闹钟 按钮 QToolButton *m_pFeedbackButtom; //用户反馈按钮 QPropertyAnimation *m_pAnimationLeftRight; QPropertyAnimation *m_pAnimationRightLeft; //状态机 QStateMachine *m_pMachine; //状态机 QState *m_pClipBoardState; //剪贴板状态 QState *m_pSmallPluginsState; //小插件状态 bool m_pBoolStates; //第一次初始化状态机bool值 bool resizeFlagOne; //第一次初始化状态机bool值 bool ClipBoardBool; //剪贴板修改屏幕分辨率bool值 bool SmallPluginsBool; //插件按钮修改屏幕分辨率bool值 int m_statusFlag; //状态机位置 int flagnumClipboardState; signals: private slots: void m_pClipBoardStateSlots(); void m_pSmallPluginsStateSlots(); protected: void paintEvent(QPaintEvent *); }; #endif // SIDEBARPLUGINSWIDGETS_H ukui-sidebar/src/plugin-interface/0000755000175000017500000000000013637056631016117 5ustar fengfengukui-sidebar/src/plugin-interface/plugin-interface.pri0000644000175000017500000000025713637056631022073 0ustar fengfengINCLUDEPATH += $$PWD HEADERS += \ $$PWD/plugin-iface.h \ $$PWD/clipboardpluginiface.h \ $$PWD/notification_interface.h \ $$PWD/sidebarSmallPluginInterface.h ukui-sidebar/src/plugin-interface/sidebarSmallPluginInterface.h0000644000175000017500000000272513637056631023700 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 //定义接口 class NotificationInterface { public: virtual ~NotificationInterface() {} //返回一个Widget设置到centerwidget中进行显示 virtual QWidget* centerWidget() = 0; //当侧边栏展开时给通知中心一个通知 virtual void showNotification() = 0; //当侧边栏隐藏时给通知中心一个通知 virtual void hideNotification() = 0; // virtual void Notify(QString strAppName, QString strIconPath, QString strSummary, QString strTime, QString strBody) = 0; }; //声明接口 #define NotificationInterface_iid "org.qt-project.Qt.QGenericPluginFactoryInterface" Q_DECLARE_INTERFACE(NotificationInterface, NotificationInterface_iid) #endif // NOTIFICATION_INTERFACE_H ukui-sidebar/src/plugin-interface/clipboardpluginiface.h0000644000175000017500000000246613635342602022440 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include #include "plugin-iface.h" #include "sidebarclipboardsignal.h" class ClipboardInterface : public PluginInterface { public: virtual ~ClipboardInterface() {} virtual QListWidget* getClipbaordListWidget() = 0; virtual SidebarClipBoardSignal* createClipSignal() = 0; virtual QWidget* getClipbaordGroupBox() = 0; }; #define ClipboardInterface_iid "org.ukui.sidebar-qt.plugin-iface.ClipboardInterface" Q_DECLARE_INTERFACE(ClipboardInterface, ClipboardInterface_iid) #endif // CLIPBOARDPLUGINIFACE_H ukui-sidebar/src/plugin-interface/plugin-iface.h0000644000175000017500000000257613637056631020645 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include class PluginInterface { public: enum PluginType { PushBtton1 = 1, PushBtton2, PushBtton3, SmallPlugin, ClipBoard, Other }; virtual ~PluginInterface() {} virtual PluginType pluginType() = 0; virtual const QString name() = 0; virtual const QString description() = 0; virtual const QIcon icon() = 0; virtual void setEnable(bool enable) = 0; virtual bool isEnable() = 0; }; //#define PluginInterface_iid "org.ukui.peony-qt.plugin-iface.PluginInterface" //Q_DECLARE_INTERFACE(PluginInterface, PluginInterface_iid) #endif // PLUGINIFACE_H ukui-sidebar/src/pluginmanage.h0000644000175000017500000000245613637056631015512 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include "plugin-iface.h" #include "sidebarSmallPluginInterface.h" class PluginManager : public QObject { Q_OBJECT public: static void init(); static PluginManager *getInstance(); void close(); QHash m_PluginInterfaceHash; Q_SIGNALS: void pluginStateChanged(const QString &pluginName, bool enable); private: explicit PluginManager(QObject *parent = nullptr); ~PluginManager(); public Q_SLOTS: void setPluginEnableByName(const QString &pluginName, bool enable); }; #endif // PLUGINMANAGE_H ukui-sidebar/src/realtimepropertyanimation.cpp0000644000175000017500000000224213634067640020675 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include RealtimePropertyAnimation::RealtimePropertyAnimation(QObject *target, const QByteArray &propertyName, QObject *parent) : QPropertyAnimation(target, propertyName, parent) { } void RealtimePropertyAnimation::updateCurrentValue(const QVariant &value) { QRect rect = value.value(); int x1, y1, x2, y2; rect.getRect(&x1, &y1, &x2, &y2); emit Sig_currentRect(x1, y1, x2, y2); return; } ukui-sidebar/src/smallpluginsmanage.h0000644000175000017500000000260613637056631016723 0ustar fengfeng/* * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. * * 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, 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 #include #include "sidebarSmallPluginInterface.h" #include "plugin-iface.h" class SmallPluginsManage : public QObject { Q_OBJECT public: SmallPluginsManage(); ~SmallPluginsManage(); static void SmallPluginsManageInit(); static SmallPluginsManage *getInstance(); QHash m_pSmallPluginsHash; void registerSmallplugin(PluginInterface *key, SidebarSmallPluginInterface *value); SidebarSmallPluginInterface* getSmallplugin(PluginInterface *key); void removeSmallplugin(PluginInterface *key); int m_PluginsNum; }; #endif // SMALLPLUGINSMANAGE_H ukui-sidebar/src/data/0000755000175000017500000000000013640375251013570 5ustar fengfengukui-sidebar/src/data/qss/0000755000175000017500000000000013637056631014402 5ustar fengfengukui-sidebar/src/data/qss/SidebarSmallPlugins.css0000644000175000017500000000147713637056631021031 0ustar fengfengQPushButton#SidebarPluginButton:hover{ width:90px; height:34px; background:rgba(61,107,229,0); border-radius:4px; } QPushButton#SidebarPluginButton:pressed { background-color:rgba(255,255,255,0.08); /*改变背景色*/ opacity:0.08; border: 0px solid rgba(255,0,0,1); } QPushButton#ClipboardButton:hover{ width:90px; height:34px; background:rgba(61,107,229,0); border-radius:4px; } QPushButton#ClipboardButton:pressed{ width:90px; height:34px; background:rgba(61,107,229,0); border-radius:4px; } QPushButton#BlueBackgroundButton{ width:90px; height:34px; background:rgba(61,107,229,1); border-radius:4px; } QToolButton{ font-size:14px; font-family:Noto Sans CJK SC; font-weight:400; color:rgba(255,255,255,1); line-height:34px; } ukui-sidebar/src/data/qss/psblack.css0000644000175000017500000003667513635342602016546 0ustar fengfengQPalette{background:#444444;}*{outline:0px;color:#DCDCDC;} QWidget[form="true"],QLabel[frameShape="1"]{ border:1px solid #242424; border-radius:0px; } QWidget[form="bottom"]{ background:#484848; } QWidget[form="bottom"] .QFrame{ border:1px solid #DCDCDC; } QWidget[form="bottom"] QLabel,QWidget[form="title"] QLabel{ border-radius:0px; color:#DCDCDC; background:none; border-style:none; } QWidget[form="title"],QWidget[nav="left"],QWidget[nav="top"] QAbstractButton{ border-style:none; border-radius:0px; padding:5px; color:#DCDCDC; background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); } QWidget[nav="top"] QAbstractButton:hover,QWidget[nav="top"] QAbstractButton:pressed,QWidget[nav="top"] QAbstractButton:checked{ border-style:solid; border-width:0px 0px 2px 0px; padding:4px 4px 2px 4px; border-color:#00BB9E; background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); } QWidget[nav="left"] QAbstractButton{ border-radius:0px; color:#DCDCDC; background:none; border-style:none; } QWidget[nav="left"] QAbstractButton:hover{ color:#FFFFFF; background-color:#00BB9E; } QWidget[nav="left"] QAbstractButton:checked,QWidget[nav="left"] QAbstractButton:pressed{ color:#DCDCDC; border-style:solid; border-width:0px 0px 0px 2px; padding:4px 4px 4px 2px; border-color:#00BB9E; background-color:#444444; } QWidget[video="true"] QLabel{ color:#DCDCDC; border:1px solid #242424; background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); } QWidget[video="true"] QLabel:focus{ border:1px solid #00BB9E; background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); } QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QDoubleSpinBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit{ border:1px solid #242424; border-radius:3px; padding:2px; background:none; selection-background-color:#484848; selection-color:#DCDCDC; } QLineEdit:focus,QTextEdit:focus,QPlainTextEdit:focus,QSpinBox:focus,QDoubleSpinBox:focus,QComboBox:focus,QDateEdit:focus,QTimeEdit:focus,QDateTimeEdit:focus,QLineEdit:hover,QTextEdit:hover,QPlainTextEdit:hover,QSpinBox:hover,QDoubleSpinBox:hover,QComboBox:hover,QDateEdit:hover,QTimeEdit:hover,QDateTimeEdit:hover{ border:1px solid #242424; } QLineEdit[echoMode="2"]{ lineedit-password-character:9679; } .QFrame{ border:1px solid #242424; border-radius:3px; } .QGroupBox{ border:1px solid #242424; border-radius:5px; margin-top:3ex; } .QGroupBox::title{ subcontrol-origin:margin; position:relative; left:10px; } .QPushButton,.QToolButton{ border-style:none; border:1px solid #242424; color:#DCDCDC; padding:5px; min-height:15px; border-radius:5px; background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); } .QPushButton:hover,.QToolButton:hover{ background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); } .QPushButton:pressed,.QToolButton:pressed{ background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); } .QToolButton::menu-indicator{ image:None; } QToolButton#btnMenu,QPushButton#btnMenu_Min,QPushButton#btnMenu_Max,QPushButton#btnMenu_Close{ border-radius:3px; color:#DCDCDC; padding:3px; margin:0px; background:none; border-style:none; } QToolButton#btnMenu:hover,QPushButton#btnMenu_Min:hover,QPushButton#btnMenu_Max:hover{ color:#FFFFFF; margin:1px 1px 2px 1px; background-color:rgba(51,127,209,230); } QPushButton#btnMenu_Close:hover{ color:#FFFFFF; margin:1px 1px 2px 1px; background-color:rgba(238,0,0,128); } QRadioButton::indicator{ width:15px; height:15px; } QRadioButton::indicator::unchecked{ image:url(:/qss/psblack/radiobutton_unchecked.png); } QRadioButton::indicator::unchecked:disabled{ image:url(:/qss/psblack/radiobutton_unchecked_disable.png); } QRadioButton::indicator::checked{ image:url(:/qss/psblack/radiobutton_checked.png); } QRadioButton::indicator::checked:disabled{ image:url(:/qss/psblack/radiobutton_checked_disable.png); } QGroupBox::indicator,QTreeWidget::indicator,QListWidget::indicator{ padding:0px -3px 0px 3px; } QCheckBox::indicator,QGroupBox::indicator,QTreeWidget::indicator,QListWidget::indicator{ width:13px; height:13px; } QCheckBox::indicator:unchecked,QGroupBox::indicator:unchecked,QTreeWidget::indicator:unchecked,QListWidget::indicator:unchecked{ image:url(:/qss/psblack/checkbox_unchecked.png); } QCheckBox::indicator:unchecked:disabled,QGroupBox::indicator:unchecked:disabled,QTreeWidget::indicator:unchecked:disabled,QListWidget::indicator:disabled{ image:url(:/qss/psblack/checkbox_unchecked_disable.png); } QCheckBox::indicator:checked,QGroupBox::indicator:checked,QTreeWidget::indicator:checked,QListWidget::indicator:checked{ image:url(:/qss/psblack/checkbox_checked.png); } QCheckBox::indicator:checked:disabled,QGroupBox::indicator:checked:disabled,QTreeWidget::indicator:checked:disabled,QListWidget::indicator:checked:disabled{ image:url(:/qss/psblack/checkbox_checked_disable.png); } QCheckBox::indicator:indeterminate,QGroupBox::indicator:indeterminate,QTreeWidget::indicator:indeterminate,QListWidget::indicator:indeterminate{ image:url(:/qss/psblack/checkbox_parcial.png); } QCheckBox::indicator:indeterminate:disabled,QGroupBox::indicator:indeterminate:disabled,QTreeWidget::indicator:indeterminate:disabled,QListWidget::indicator:indeterminate:disabled{ image:url(:/qss/psblack/checkbox_parcial_disable.png); } QTimeEdit::up-button,QDateEdit::up-button,QDateTimeEdit::up-button,QDoubleSpinBox::up-button,QSpinBox::up-button{ image:url(:/qss/psblack/add_top.png); width:10px; height:10px; padding:2px 5px 0px 0px; } QTimeEdit::down-button,QDateEdit::down-button,QDateTimeEdit::down-button,QDoubleSpinBox::down-button,QSpinBox::down-button{ image:url(:/qss/psblack/add_bottom.png); width:10px; height:10px; padding:0px 5px 2px 0px; } QTimeEdit::up-button:pressed,QDateEdit::up-button:pressed,QDateTimeEdit::up-button:pressed,QDoubleSpinBox::up-button:pressed,QSpinBox::up-button:pressed{ top:-2px; } QTimeEdit::down-button:pressed,QDateEdit::down-button:pressed,QDateTimeEdit::down-button:pressed,QDoubleSpinBox::down-button:pressed,QSpinBox::down-button:pressed,QSpinBox::down-button:pressed{ bottom:-2px; } QComboBox::down-arrow,QDateEdit[calendarPopup="true"]::down-arrow,QTimeEdit[calendarPopup="true"]::down-arrow,QDateTimeEdit[calendarPopup="true"]::down-arrow{ image:url(:/qss/psblack/add_bottom.png); width:10px; height:10px; right:2px; } QComboBox::drop-down,QDateEdit::drop-down,QTimeEdit::drop-down,QDateTimeEdit::drop-down{ subcontrol-origin:padding; subcontrol-position:top right; width:15px; border-left-width:0px; border-left-style:solid; border-top-right-radius:3px; border-bottom-right-radius:3px; border-left-color:#242424; } QComboBox::drop-down:on{ top:1px; } QMenuBar::item{ color:#DCDCDC; background-color:#484848; margin:0px; padding:3px 10px; } QMenu,QMenuBar,QMenu:disabled,QMenuBar:disabled{ color:#DCDCDC; background-color:#484848; border:1px solid #242424; margin:0px; } QMenu::item{ padding:3px 20px; } QMenu::indicator{ width:13px; height:13px; } QMenu::item:selected,QMenuBar::item:selected{ color:#DCDCDC; border:0px solid #242424; background:#646464; } QMenu::separator{ height:1px; background:#242424; } QProgressBar{ min-height:10px; background:#484848; border-radius:5px; text-align:center; border:1px solid #484848; } QProgressBar:chunk{ border-radius:5px; background-color:#242424; } QSlider::groove:horizontal{ background:#484848; height:8px; border-radius:4px; } QSlider::add-page:horizontal{ background:#484848; height:8px; border-radius:4px; } QSlider::sub-page:horizontal{ background:#242424; height:8px; border-radius:4px; } QSlider::handle:horizontal{ width:13px; margin-top:-3px; margin-bottom:-3px; border-radius:6px; background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #444444,stop:0.8 #242424); } QSlider::groove:vertical{ width:8px; border-radius:4px; background:#484848; } QSlider::add-page:vertical{ width:8px; border-radius:4px; background:#484848; } QSlider::sub-page:vertical{ width:8px; border-radius:4px; background:#242424; } QSlider::handle:vertical{ height:14px; margin-left:-3px; margin-right:-3px; border-radius:6px; background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #444444,stop:0.8 #242424); } QScrollBar:horizontal{ background:#484848; padding:0px; border-radius:6px; max-height:12px; } QScrollBar::handle:horizontal{ background:#242424; min-width:50px; border-radius:6px; } QScrollBar::handle:horizontal:hover{ background:#00BB9E; } QScrollBar::handle:horizontal:pressed{ background:#00BB9E; } QScrollBar::add-page:horizontal{ background:none; } QScrollBar::sub-page:horizontal{ background:none; } QScrollBar::add-line:horizontal{ background:none; } QScrollBar::sub-line:horizontal{ background:none; } QScrollBar:vertical{ background:#484848; padding:0px; border-radius:6px; max-width:12px; } QScrollBar::handle:vertical{ background:#242424; min-height:50px; border-radius:6px; } QScrollBar::handle:vertical:hover{ background:#00BB9E; } QScrollBar::handle:vertical:pressed{ background:#00BB9E; } QScrollBar::add-page:vertical{ background:none; } QScrollBar::sub-page:vertical{ background:none; } QScrollBar::add-line:vertical{ background:none; } QScrollBar::sub-line:vertical{ background:none; } QScrollArea{ border:0px; } QTreeView,QListView,QTableView,QTabWidget::pane{ border:1px solid #242424; selection-background-color:#646464; selection-color:#DCDCDC; alternate-background-color:#525252; gridline-color:#242424; } QTreeView::branch:closed:has-children{ margin:4px; border-image:url(:/qss/psblack/branch_open.png); } QTreeView::branch:open:has-children{ margin:4px; border-image:url(:/qss/psblack/branch_close.png); } QTreeView,QListView,QTableView,QSplitter::handle,QTreeView::branch{ background:#444444; } QTableView::item:selected,QListView::item:selected,QTreeView::item:selected{ color:#DCDCDC; background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); } QTableView::item:hover,QListView::item:hover,QTreeView::item:hover{ color:#DCDCDC; background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); } QTableView::item,QListView::item,QTreeView::item{ padding:1px; margin:0px; } QHeaderView::section,QTableCornerButton:section{ padding:3px; margin:0px; color:#DCDCDC; border:1px solid #242424; border-left-width:0px; border-right-width:1px; border-top-width:0px; border-bottom-width:1px; background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); } QTabBar::tab{ border:1px solid #242424; color:#DCDCDC; margin:0px; background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); } QTabBar::tab:selected,QTabBar::tab:hover{ border-style:solid; border-color:#00BB9E; background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); } QTabBar::tab:top,QTabBar::tab:bottom{ padding:3px 8px 3px 8px; } QTabBar::tab:left,QTabBar::tab:right{ padding:8px 3px 8px 3px; } QTabBar::tab:top:selected,QTabBar::tab:top:hover{ border-width:2px 0px 0px 0px; } QTabBar::tab:right:selected,QTabBar::tab:right:hover{ border-width:0px 0px 0px 2px; } QTabBar::tab:bottom:selected,QTabBar::tab:bottom:hover{ border-width:0px 0px 2px 0px; } QTabBar::tab:left:selected,QTabBar::tab:left:hover{ border-width:0px 2px 0px 0px; } QTabBar::tab:first:top:selected,QTabBar::tab:first:top:hover,QTabBar::tab:first:bottom:selected,QTabBar::tab:first:bottom:hover{ border-left-width:1px; border-left-color:#242424; } QTabBar::tab:first:left:selected,QTabBar::tab:first:left:hover,QTabBar::tab:first:right:selected,QTabBar::tab:first:right:hover{ border-top-width:1px; border-top-color:#242424; } QTabBar::tab:last:top:selected,QTabBar::tab:last:top:hover,QTabBar::tab:last:bottom:selected,QTabBar::tab:last:bottom:hover{ border-right-width:1px; border-right-color:#242424; } QTabBar::tab:last:left:selected,QTabBar::tab:last:left:hover,QTabBar::tab:last:right:selected,QTabBar::tab:last:right:hover{ border-bottom-width:1px; border-bottom-color:#242424; } QStatusBar::item{ border:0px solid #484848; border-radius:3px; } QToolBox::tab,QGroupBox#gboxDevicePanel,QGroupBox#gboxDeviceTitle,QFrame#gboxDevicePanel,QFrame#gboxDeviceTitle{ padding:3px; border-radius:5px; color:#DCDCDC; background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); } QToolTip{ border:0px solid #DCDCDC; padding:1px; color:#DCDCDC; background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); } QToolBox::tab:selected{ background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); } QPrintPreviewDialog QToolButton{ border:0px solid #DCDCDC; border-radius:0px; margin:0px; padding:3px; background:none; } QColorDialog QPushButton,QFileDialog QPushButton{ min-width:80px; } QToolButton#qt_calendar_prevmonth{ icon-size:0px; min-width:20px; image:url(:/qss/psblack/calendar_prevmonth.png); } QToolButton#qt_calendar_nextmonth{ icon-size:0px; min-width:20px; image:url(:/qss/psblack/calendar_nextmonth.png); } QToolButton#qt_calendar_prevmonth,QToolButton#qt_calendar_nextmonth,QToolButton#qt_calendar_monthbutton,QToolButton#qt_calendar_yearbutton{ border:0px solid #DCDCDC; border-radius:3px; margin:3px 3px 3px 3px; padding:3px; background:none; } QToolButton#qt_calendar_prevmonth:hover,QToolButton#qt_calendar_nextmonth:hover,QToolButton#qt_calendar_monthbutton:hover,QToolButton#qt_calendar_yearbutton:hover,QToolButton#qt_calendar_prevmonth:pressed,QToolButton#qt_calendar_nextmonth:pressed,QToolButton#qt_calendar_monthbutton:pressed,QToolButton#qt_calendar_yearbutton:pressed{ border:1px solid #242424; } QCalendarWidget QSpinBox#qt_calendar_yearedit{ margin:2px; } QCalendarWidget QToolButton::menu-indicator{ image:None; } QCalendarWidget QTableView{ border-width:0px; } QCalendarWidget QWidget#qt_calendar_navigationbar{ border:1px solid #242424; border-width:1px 1px 0px 1px; background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1 #383838); } QComboBox QAbstractItemView::item{ min-height:20px; min-width:10px; } QTableView[model="true"]::item{ padding:0px; margin:0px; } QTableView QLineEdit,QTableView QComboBox,QTableView QSpinBox,QTableView QDoubleSpinBox,QTableView QDateEdit,QTableView QTimeEdit,QTableView QDateTimeEdit{ border-width:0px; border-radius:0px; } QTableView QLineEdit:focus,QTableView QComboBox:focus,QTableView QSpinBox:focus,QTableView QDoubleSpinBox:focus,QTableView QDateEdit:focus,QTableView QTimeEdit:focus,QTableView QDateTimeEdit:focus{ border-width:0px; border-radius:0px; } QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QDoubleSpinBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit{ background:#444444; } *:disabled{ background:#444444; border-color:#484848; color:#242424; } /*TextColor:#DCDCDC*/ /*PanelColor:#444444*/ /*BorderColor:#242424*/ /*NormalColorStart:#484848*/ /*NormalColorEnd:#383838*/ /*DarkColorStart:#646464*/ /*DarkColorEnd:#525252*/ /*HighColor:#00BB9E*/ ukui-sidebar/src/data/ukui-sidebar.desktop0000644000175000017500000000072713640375251017555 0ustar fengfeng[Desktop Entry] Name=ukui-sidebar Name[zh_CN]=侧边栏 Comment=ukui-sidebar Exec=ukui-sidebar Terminal=false Type=Application #Categories= Keywords=UKUI; NoDisplay=true OnlyShowIn=UKUI; X-UKUI-Autostart-Phase=Application X-UKUI-Bugzilla-Bugzilla=UKUI X-UKUI-Bugzilla-Product=ukui-media X-UKUI-Bugzilla-Component=ukui-sidebar X-MATE-Autostart-Phase=Applications X-KDE-autostart-after=panel X-UKUI-Autostart-Notify=true X-UKUI-Autostart-Delay=3 #X-UKUI-AutoRestart=true ukui-sidebar/src/data/images/0000755000175000017500000000000013642562542015040 5ustar fengfengukui-sidebar/src/data/images/kylin-tool-box-null.svg0000644000175000017500000000054413642562542021423 0ustar fengfeng ukui-sidebar/src/data/images/kylin-tool-box.svg0000644000175000017500000000132213642562542020446 0ustar fengfeng ukui-sidebar/src/data/images/kylin-feedback.png0000644000175000017500000000246713635342602020422 0ustar fengfengPNG  IHDR00W pHYs  ~IDAThZkUݙnjk vEhO"4(Eъ`_G[!`lЀG?`El_% tSm7U76I7ݙ#:lٝ{s97p+Cd˥~}GPpRۚ[!&/oU-[GloU3WrҔyxp%O5Z Pg`BQoT#kq|!ЀckAAHleg QҀ5;o>',<(ʍH5aI(YO/'&?ĽE`ɿjlL'ƟrCW:rbk sUHҦ'G2-- Rڞ6঳GOYF21ܳ=>| Oai`ZLKI#Q8!Iijx}o:BLjxS*D=N]5frJ`|OB %OF!KfU.IMdK=PhAhYލ ?`ʅK+ĸM֥Ob߉v‘K?GryoCr/A){N:Xii-/`癷ֽȦD^<cvmP\wdc+,܀e:Gi8iLXVBu6k2~4g#(thGm#iw 0iyG<ǝ@FFIy !-[TCXsb9*}p+|^> `zEq9)%7BF &dk⡒Iui=n7yH9q+#{)?Ċb4rn+|=xl\@}T%yzX]hqU˽7F^~꘴! P ɌxwۢƦ"(ZZ)J+Ɣ;2ѐoq|yD-w3& zן)w`ݗCbxWLndJ䒯x|~dNrZ?kV?2^ts%碻bm/ok ±vMIENDB`ukui-sidebar/src/data/images/kylin-notebook.svg0000644000175000017500000003116213635342602020523 0ustar fengfeng ukui-sidebar/src/data/images/kylin-alarm-clock.svg0000644000175000017500000001034013635342602021063 0ustar fengfeng 画板 18 ukui-sidebar/ukui-sidebar.pro0000644000175000017500000000061013635342602015171 0ustar fengfeng#! [0] TEMPLATE = subdirs SUBDIRS = ./src/ukui-sidebar-core.pro \ ./src/plugins/notification_plugin/notification_plugin.pro \ ./src/plugins/clipboardPlugin/clipboardPlugin.pro \ ./src/plugins/Clock_deamon/Clock.pro \ ./src/plugins/feedback/feedback.pro \ ./src/plugins/ukui_notebook/ukui_notebook.pro ukui-sidebar/README.md0000644000175000017500000000432513634067640013356 0ustar fengfeng# ukui-sidebar The sidebar mainly consists of two parts: notification center and cutting board. It starts from the start-up and is placed in the tray bar in the form of a tray. After clicking, it can pop up dynamically from the right side of the screen. + The notification center can display the pop-up messages sent by each application to mate notification teamon in a list form. Unimportant information can be stored in the storage box for viewing. At the same time, it can call the control panel directly. + The main function of the clipboard is to save the latest cutting information, and display it under the sidebar in the form of a list. At the same time, it can also put the previous cutting information at the top, so that it can be pasted directly. In addition, it can record the cut text information as well as the URL. The ukui-sidebar is a shortcut tool on the right side of the screen for UKUI. # How to test notification-center `notify-send -a wechat -i "/home/ccn/heart.png" Summary Body` # How to report bugs Bugs should be reported to the UKUI bug tracking system: https://github.com/ukui/ukui-sidebar/issues You will need to create an account for yourself. Please read the HACKING file for information on where to send changes or bugfixes for this package. # How to build ## Preparation You can build pre-depends with such command: `sudo apt install libglib2.0-dev qtbase5-dev libqt5svg5-dev qttools5-dev-tools` Note: build-depends references the paragraph in debian/control. ## Build from source and test > git clone https://github.com/ukui/ukui-sidebar > cd ukui-sidebar && mkdir build && cd build > qmake .. && make > sudo make install Note: If you want to run ukui-sidebar, you need to make some changes in the code after build. + Find `libnotification_plugin.so` in your build path like `/home/XX/ukui-sidebar/build/src/plugins/notification_plugins`. Then set this path as pluginDir in file widget.cpp fuction `bool Widget::loadNotificationPlugin()`. + Find `libclipboardPlugin.so` in your build path like `/home/XX/ukui-sidebar/build/src/plugins/sidebar_pushbutton_plugins`. Then set this path as pluginDir in file pluginmanage.cpp fuction `PluginManager::PluginManager(QObject *parent) : QObject(parent)`.