├── .gitignore ├── LICENSE ├── MCLib_Bar_icon.png ├── MCLib_DB.py ├── MCLib_Main_Window.py ├── MCLib_UI.py ├── MCLib_icon.icns ├── MCLib_icon.ico ├── MCLib_icon.png ├── MCLib_icon_transparent.png ├── MCLib_widgets.py ├── MCLib_widgets_UI.py ├── MyCaseLib.py ├── MyCaseLib.spec ├── README.md ├── example └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .DS_Store 3 | 4 | build/ 5 | dist/ 6 | MCLib/ 7 | __pycache__/ 8 | _UI/ 9 | .eggs/ 10 | apps/ 11 | MCLib_Bar_icon_white.png 12 | MyCaseLib.spec 13 | setup.py 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /MCLib_Bar_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoodTheme/MyCaseLib/80e99e054db8798a2ad9672564f4f8829279a925/MCLib_Bar_icon.png -------------------------------------------------------------------------------- /MCLib_DB.py: -------------------------------------------------------------------------------- 1 | #coding=utf-8 2 | import sqlite3 3 | import os 4 | from shutil import copyfile 5 | from datetime import datetime, timedelta 6 | 7 | class DataBase(object): 8 | def __init__(self, PATH, DB_NAME, DB_PATH): 9 | self.PATH = PATH 10 | self.DB_NAME = DB_NAME 11 | self.DB_PATH = DB_PATH 12 | if not os.path.exists(self.DB_PATH): 13 | self.init() 14 | 15 | # 基本 16 | def trans(self, s): 17 | if not s: 18 | return '' 19 | trans = '' 20 | for t in str(s): 21 | trans = trans + "''" if t == "'" else trans + t 22 | return trans 23 | 24 | def execute(self, s): 25 | conn = sqlite3.connect(self.DB_PATH) 26 | cursor = conn.cursor() 27 | s = self.trans(s) 28 | 29 | try: 30 | cursor.execute(s) 31 | finally: 32 | results = cursor.fetchall() 33 | cursor.close() 34 | conn.commit() 35 | conn.close() 36 | return results 37 | 38 | def add_column(self, table_name, column_name, column_type): 39 | conn = sqlite3.connect(self.DB_PATH) 40 | cursor = conn.cursor() 41 | table_name, column_name, column_type = map(trans, [table_name, column_name, column_type]) 42 | 43 | try: 44 | cursor.execute(f"alter table {table_name} add column {column_name} {column_type}") 45 | finally: 46 | cursor.close() 47 | conn.commit() 48 | conn.close() 49 | 50 | def delete_column(self, table_name, column_name): 51 | conn = sqlite3.connect(self.DB_PATH) 52 | cursor = conn.cursor() 53 | table_name, column_name = map(self.trans, [table_name, column_name]) 54 | 55 | try: 56 | cursor.execute(f"alter table {table_name} drop column {column_name}") 57 | finally: 58 | cursor.close() 59 | conn.commit() 60 | conn.close() 61 | 62 | def insert(self, table_name, column_name, value): 63 | conn = sqlite3.connect(self.DB_PATH) 64 | cursor = conn.cursor() 65 | table_name, column_name, value = map(self.trans, [table_name, column_name, value]) 66 | 67 | cursor.execute(f"insert into {table_name} ({column_name}) values ('{value}')") 68 | cursor.close() 69 | 70 | conn.commit() 71 | conn.close() 72 | 73 | def delete(self, table_name, column_name, value): 74 | conn = sqlite3.connect(self.DB_PATH) 75 | cursor = conn.cursor() 76 | table_name, column_name, value = map(self.trans, [table_name, column_name, value]) 77 | 78 | try: 79 | cursor.execute(f"delete from {table_name} where {column_name} = '{value}'") 80 | finally: 81 | cursor.close() 82 | conn.commit() 83 | conn.close() 84 | 85 | def delete_multi_condition(self, table_name, condition): 86 | conn = sqlite3.connect(self.DB_PATH) 87 | cursor = conn.cursor() 88 | table_name = self.trans(table_name) 89 | 90 | try: 91 | cursor.execute(f"delete from {table_name} where {condition}") 92 | finally: 93 | cursor.close() 94 | conn.commit() 95 | conn.close() 96 | 97 | ## update的条件均在前面 98 | def update(self, table_name, p_column, p_value, column_name, value): 99 | conn = sqlite3.connect(self.DB_PATH) 100 | cursor = conn.cursor() 101 | table_name, p_column, p_value, column_name, value = map(self.trans, 102 | [table_name, p_column, p_value, column_name, value]) 103 | 104 | cursor.execute(f"update {table_name} set {column_name} = '{value}'"\ 105 | f"where {p_column} = '{p_value}'") 106 | cursor.close() 107 | 108 | conn.commit() 109 | conn.close() 110 | 111 | def update_multi_condition(self, table_name, condition, column_name, value): 112 | conn = sqlite3.connect(self.DB_PATH) 113 | cursor = conn.cursor() 114 | 115 | cursor.execute(f"update {table_name} set {column_name} = '{value}' where {condition}") 116 | cursor.close() 117 | 118 | conn.commit() 119 | conn.close() 120 | 121 | def update_latest(self, table_name, column_name, value): 122 | conn = sqlite3.connect(self.DB_PATH) 123 | cursor = conn.cursor() 124 | table_name, column_name, value = map(self.trans, [table_name, column_name, value]) 125 | 126 | cursor.execute(f"select max(id) from {table_name}") 127 | p_id=cursor.fetchone()[0] 128 | 129 | try: 130 | cursor.execute(f"update {table_name} set {column_name} = '{value}' where id = '{p_id}'") 131 | except: 132 | print("更新数据出错", table_name, column_name, value) 133 | finally: 134 | cursor.close() 135 | conn.commit() 136 | conn.close() 137 | 138 | def select(self, table_name, column, c_col = None, c_value = None, c_cp = '='): 139 | if c_col and not c_value: 140 | print('select wrong!!') 141 | return 142 | conn = sqlite3.connect(self.DB_PATH) 143 | table_name, column, c_col, c_value = map(self.trans, [table_name, column, c_col, c_value]) 144 | 145 | def dict_factory(cursor, row): 146 | d = {} 147 | for idx, col in enumerate(cursor.description): 148 | d[col[0]] = row[idx] 149 | return d 150 | 151 | conn.row_factory = dict_factory 152 | cursor = conn.cursor() 153 | if c_col: 154 | cursor.execute(f"select {column} from {table_name} where {c_col} {c_cp} '{c_value}'") 155 | else: 156 | cursor.execute(f"select {column} from {table_name}") 157 | values = cursor.fetchall() 158 | cursor.close() 159 | 160 | conn.close() 161 | return values 162 | 163 | def select_by_order(self, table_name, column, value, flag = None): 164 | order = '' if flag == None else 'desc' 165 | table_name, column, value = map(self.trans, [table_name, column, value]) 166 | 167 | def dict_factory(cursor, row): 168 | d = {} 169 | for idx, col in enumerate(cursor.description): 170 | d[col[0]] = row[idx] 171 | return d 172 | 173 | conn = sqlite3.connect(self.DB_PATH) 174 | conn.row_factory = dict_factory 175 | 176 | cursor = conn.cursor() 177 | cursor.execute(f"select {column} from {table_name} order by {value} {order}" ) 178 | values = cursor.fetchall() 179 | cursor.close() 180 | 181 | conn.close() 182 | return values 183 | 184 | def select_all(self, table_name, column_name = None, value = None): 185 | if column_name and value: 186 | return self.select(table_name, "*", column_name, value) 187 | else: 188 | return self.select(table_name, "*") 189 | 190 | def select_multi_condition(self, table_name, column, condition): 191 | def dict_factory(cursor, row): 192 | d = {} 193 | for idx, col in enumerate(cursor.description): 194 | d[col[0]] = row[idx] 195 | return d 196 | 197 | conn = sqlite3.connect(self.DB_PATH) 198 | conn.row_factory = dict_factory 199 | cursor = conn.cursor() 200 | cursor.execute(f"select {column} from {table_name} where {condition}") 201 | values = cursor.fetchall() 202 | cursor.close() 203 | conn.close() 204 | return values 205 | 206 | def count_rows(self, table_name, column_name = None, value = None): 207 | if column_name and value: 208 | return self.select(table_name, "count(*) num", column_name, value)[0]['num'] 209 | else: 210 | return self.select(table_name, "count(*) num")[0]['num'] 211 | 212 | def swap(self, table_name, column_name, id1, id2): 213 | t1 = self.select_all(table_name, 'id', id1) 214 | t2 = self.select_all(table_name, 'id', id2) 215 | self.update(table_name, 'id', id1, column_name, t2[0][column_name]) 216 | self.update(table_name, 'id', id2, column_name, t1[0][column_name]) 217 | 218 | def get_id_unique(self, table_name, column_name, value): 219 | s = self.select_all(table_name, column_name, value) 220 | return s[0]['id'] 221 | 222 | def get_id_latest(self, table_name): 223 | s = self.select(table_name, 'max(id) maxid') 224 | return s[0]['maxid'] 225 | 226 | # 案件类型 227 | def new_type(self, type_name, project_or_study): 228 | self.insert('type_list', 'type_name', type_name) 229 | self.update_latest('type_list', 'projectorstudy', project_or_study) 230 | 231 | def delete_type(self, type_name): 232 | for s in self.select_all('case_list', 'case_type', type_name): 233 | self.delete_case(s['case_name']) 234 | for s in self.select_all('case_type', 'type_name', type_name): 235 | self.delete_type_item(type_name, s['item']) 236 | self.delete('type_list', 'type_name', type_name) 237 | 238 | def add_type_item(self, type_name, item_name, item_form): 239 | for s in self.select_all('case_type', 'type_name', type_name): 240 | if s['item'] == item_name: 241 | return False 242 | try: 243 | self.insert('case_type', 'type_name', type_name) 244 | except: 245 | return False 246 | else: 247 | self.update_latest('case_type', 'item', item_name) 248 | self.update_latest('case_type', 'item_form', item_form) 249 | return True 250 | 251 | def delete_type_item(self, type_name, item_name): 252 | for s in self.select_all('case_list', 'case_type', type_name): 253 | case_name = s['case_name'] 254 | self.delete_multi_condition('case_info', f"case_name = '{self.trans(case_name)}' and item = '{self.trans(item_name)}'") 255 | 256 | self.delete_multi_condition('case_type', f"type_name = '{self.trans(type_name)}' and item = '{self.trans(item_name)}'") 257 | 258 | def update_type(self, type_name, new_value): 259 | self.update('case_list', 'case_type', type_name, 'case_type', new_value) 260 | self.update('case_type', 'type_name', type_name, 'type_name', new_value) 261 | self.update('type_list', 'type_name', type_name, 'type_name', new_value) 262 | 263 | def update_type_item(self, type_name, item_name, new_value): 264 | for s in self.select_all('case_list', 'case_type', type_name): 265 | case_name = s['case_name'] 266 | self.update_multi_condition('case_info', f"case_name = '{self.trans(case_name)}' and item = '{self.trans(item_name)}'", \ 267 | 'item', new_value) 268 | 269 | self.update_multi_condition('case_type', f"type_name = '{self.trans(type_name)}' and item = '{self.trans(item_name)}'", \ 270 | 'item', new_value) 271 | 272 | # 项目 273 | def new_project(self, project_name, project_num = None, file_path = None, label = None): 274 | try: 275 | self.insert('project_list', 'project_name', project_name) 276 | except: 277 | pass 278 | else: 279 | if project_num: 280 | self.update_latest('project_list', 'project_num', project_num) 281 | if file_path: 282 | self.update_latest('project_list', 'file_path', file_path) 283 | if label: 284 | self.update_latest('project_list', 'label', label) 285 | 286 | def delete_project(self, project_name): 287 | for s in self.select_all('case_list', 'project_name', project_name): 288 | self.delete_case(s['case_name']) 289 | self.delete('project_list', 'project_name', project_name) 290 | 291 | def rename_project(self, project_name, new_name): 292 | self.update('project_list', 'project_name', project_name, 'project_name', new_name) 293 | self.update('case_list', 'project_name', project_name, 'project_name', new_name) 294 | 295 | # 案件 296 | def change_project(self, case_name, project_name, new_project): 297 | self.update('case_list', 'case_name', case_name, 'project_name', new_project) 298 | 299 | def new_case(self, project_name, case_name, case_type): 300 | try: 301 | self.insert('case_list', 'project_name', project_name) 302 | except: 303 | pass 304 | else: 305 | self.update_latest('case_list', 'case_name', case_name) 306 | self.update_latest('case_list', 'case_type', case_type) 307 | 308 | def rename_case(self, case_name, new_name): 309 | try: 310 | self.update('case_list', 'case_name', case_name, 'case_name', new_name) 311 | except: 312 | pass 313 | else: 314 | self.update('case_info', 'case_name', case_name, 'case_name', new_name) 315 | self.update('todo_list', 'case_name', case_name, 'case_name', new_name) 316 | self.update('event_list', 'case_name', case_name, 'case_name', new_name) 317 | 318 | def delete_case(self, case_name): 319 | self.delete('case_list', 'case_name', case_name) 320 | self.delete('case_info', 'case_name', case_name) 321 | self.delete('todo_list', 'case_name', case_name) 322 | self.delete('event_list', 'case_name', case_name) 323 | 324 | def insert_value(self, case_name, item_name, item_form, *value): 325 | self.insert('case_info', 'case_name', case_name) 326 | self.update_latest('case_info', 'item', item_name) 327 | self.update_latest('case_info', 'value_form', item_form) 328 | if item_form == 'text': 329 | self.update_latest('case_info', 'value', value[0]) 330 | elif item_form == 'contact' or item_form == 'party': 331 | self.update_latest('case_info', 'value', value[0]) 332 | self.update_latest('case_info', 'value2', value[1]) 333 | 334 | # 当事人和联系人 335 | def new_party_contact_class(self, which_type, class_name, fisrt_item): 336 | self.insert(f"{which_type}_class", 'class', class_name) 337 | self.update_latest(f"{which_type}_class", 'item', fisrt_item) 338 | 339 | def new_party_contact_item(self, which_type, which_class, item_name): 340 | if item_name in [p['item'] for p in self.select(f"{which_type}_class", 'item', 'class', which_class)]: 341 | return False 342 | else: 343 | self.insert(f"{which_type}_class", 'class', which_class) 344 | self.update_latest(f"{which_type}_class", 'item', item_name) 345 | li = [] 346 | for p in self.select(f"{which_type}_info", f"{which_type}_id, class", 'class', which_class): 347 | if p[f"{which_type}_id"] not in li and p['class'] == which_class: 348 | li.append(p[f"{which_type}_id"]) 349 | self.insert(f"{which_type}_info", f"{which_type}_id", p[f"{which_type}_id"]) 350 | self.update_latest(f"{which_type}_info", 'class', which_class) 351 | self.update_latest(f"{which_type}_info", 'item', item_name) 352 | return True 353 | 354 | def new_person(self, which_type, which_class, name): 355 | self.insert(f"{which_type}_list", 'class', which_class) 356 | self.update_latest(f"{which_type}_list", 'name', name) 357 | 358 | items = self.select(f"{which_type}_class", 'item', 'class', which_class) 359 | pid = self.get_id_latest(f"{which_type}_list") 360 | 361 | self.insert(f"{which_type}_info", f"{which_type}_id", pid) 362 | self.update_latest(f"{which_type}_info", 'class', which_class) 363 | self.update_latest(f"{which_type}_info", 'item', items[0]['item']) 364 | self.update_latest(f"{which_type}_info", 'value', name) 365 | for s in items[1:]: 366 | self.insert(f"{which_type}_info", f"{which_type}_id", pid) 367 | self.update_latest(f"{which_type}_info", 'class', which_class) 368 | self.update_latest(f"{which_type}_info", 'item', s['item']) 369 | 370 | def delete_party_contact_class(self, which_type, which_class): 371 | for s in self.select(f"{which_type}_list", 'id', 'class', which_class): 372 | self.delete_person(which_type, s['id']) 373 | self.delete(f"{which_type}_class", 'class', which_class) 374 | self.delete(f"{which_type}_list", 'class', which_class) 375 | self.delete(f"{which_type}_info", 'class', which_class) 376 | 377 | def delete_party_contact_item(self, which_type, which_class, which_item): 378 | self.delete_multi_condition(f"{which_type}_class", f"class = '{self.trans(which_class)}' "\ 379 | f"and item = '{self.trans(which_item)}'") 380 | self.delete_multi_condition(f"{which_type}_info", f"class = '{self.trans(which_class)}' "\ 381 | f"and item = '{self.trans(which_item)}'") 382 | 383 | def delete_person(self, which_type, pid): 384 | self.delete(f"{which_type}_list", 'id', pid) 385 | self.delete(f"{which_type}_info", f"{which_type}_id", pid) 386 | self.delete_multi_condition('case_info', f"value_form = '{which_type}' and value2 = '{pid}'") 387 | 388 | def update_party_contact_class(self, which_type, which_class, new_value): 389 | self.update(f"{which_type}_class", 'class', which_class, 'class', new_value) 390 | self.update(f"{which_type}_list", 'class', which_class, 'class', new_value) 391 | self.update(f"{which_type}_info", 'class', which_class, 'class', new_value) 392 | 393 | def update_party_contact_item(self, which_type, which_class, which_item, new_value): 394 | self.update_multi_condition(f"{which_type}_class", f"class = '{self.trans(which_class)}' "\ 395 | f"and item = '{self.trans(which_item)}'", 'item', new_value) 396 | self.update_multi_condition(f"{which_type}_info", f"class = '{self.trans(which_class)}' "\ 397 | f"and item = '{self.trans(which_item)}'", 'item', new_value) 398 | 399 | # 数据库文件 400 | def delete_DB(self): 401 | if os.path.exists(self.DB_PATH): 402 | os.remove(self.DB_PATH) 403 | 404 | def init(self): 405 | self.delete_DB() 406 | example_path = os.path.join(os.path.abspath('.'), 'example') 407 | if os.path.exists(example_path): 408 | copyfile(example_path, self.DB_PATH) 409 | 410 | # 生成讯息 411 | def generate_project_info_html(self, project, project_or_study, color): 412 | s = ''' 413 | 414 | 429 | 430 | 431 | ''' % (color) 432 | s = s + f"

{project}

" 433 | project_info = self.select_all('project_list', 'project_name', project) 434 | if project_info and project_info[0]['project_num']: 435 | s = s + f"

{'项目号' if project_or_study == 'project' else '备注'}:\ 436 | {project_info[0]['project_num']}

" 437 | labels = ('进行中(置顶)', '进行中', '搁置', '已结', '其他', '案例') 438 | if int(project_info[0]['label']) < 5: 439 | s = s + f"

当前状态:{labels[int(project_info[0]['label'])]}

" 440 | s = s + "" 441 | return s 442 | 443 | def generate_project_info_all(self, project): 444 | s = '' 445 | case_list = self.select('case_list', 'case_name, case_type', 'project_name', project) 446 | case_types = [] 447 | for case in case_list: 448 | if case['case_type'] not in case_types: 449 | case_types.append(case['case_type']) 450 | for case_type in case_types: 451 | items = [x['item'] for x in self.select('case_type', 'item', 'type_name', case_type)] 452 | for item in items: 453 | s = s + item + '\t' 454 | s = s + '\n' 455 | 456 | for case in case_list: 457 | if case['case_type'] == case_type: 458 | case_infos = self.select_all('case_info', 'case_name', case['case_name']) 459 | for item in items: 460 | for info in case_infos: 461 | if info['item'] == item: 462 | s = s + info['value'] 463 | if info['value_form'] != 'text': 464 | s = s + ':' + self.select(f"{info['value_form']}_info", 'value', 465 | f"{info['value_form']}_id", info['value2'])[0]['value'] + ';' 466 | s = s + '\t' 467 | s = s + '\n' 468 | return s 469 | 470 | def generate_case_info_html(self, case, color1, color2): 471 | project = self.select('case_list', 'project_name', 'case_name', case)[0]['project_name'] 472 | case_type = self.select('case_list', 'case_type', 'case_name', case)[0]['case_type'] 473 | type_item = self.select_all('case_type', 'type_name', case_type) 474 | 475 | s = ''' 476 | 477 | 514 | 515 | 516 | ''' % (color1, color2) 517 | s = s + f"

{case}

" 518 | s = s + f"

项目:{project}

" 519 | 520 | s = s + "" 521 | s = s + "" 522 | for i in [x for x in type_item if x['item_form'] == 'text']: 523 | this_item = i['item'] 524 | items = self.select_multi_condition('case_info', "id, value_form, value, value2", 525 | f"case_name = '{self.trans(case)}' and item = '{self.trans(this_item)}'") 526 | if items and items[0]['value']: 527 | value_form = items[0]['value_form'] 528 | for k in items: 529 | s = s + f""\ 530 | f"" 531 | for i in [x for x in type_item if (x['item_form'] == 'party' or x['item_form'] == 'contact')]: 532 | this_item = i['item'] 533 | items = self.select_multi_condition('case_info', "id, value_form, value, value2", 534 | f"case_name = '{self.trans(case)}' and item = '{self.trans(this_item)}'") 535 | if items and items[0]['value']: 536 | value_form = items[0]['value_form'] 537 | s = s + f"" 538 | if value_form == 'contact': 539 | for k in items: 540 | name = self.select(f"{value_form}_info", 'value', f"{value_form}_id", k['value2'])[0]['value'] 541 | p = self.select_multi_condition(f"{value_form}_info", 'value', 542 | f"{value_form}_id = '{str(k['value2'])}' and item = '联系电话'") 543 | if p and p[0]['value']: 544 | s = s + f""\ 545 | f"" 546 | else: 547 | s = s + f""\ 548 | f"" 549 | else: 550 | for k in items: 551 | name = self.select(f"{value_form}_info", 'value', f"{value_form}_id", k['value2'])[0]['value'] 552 | s = s + f""\ 553 | f"" 554 | s = s + "
基本信息
{this_item} {k['value']}
{this_item}
{k['value']} {name} ({p[0]['value']})
{k['value']} {name}
{k['value']} {name}
" 555 | return s 556 | 557 | def generate_report_html(self, color1, color2, color3): 558 | s = ''' 559 | 560 | 597 | 598 | 599 | ''' % (color1, color2, color3) 600 | 601 | def date_to_string(d): 602 | return f"{d.strftime('%Y')}年{d.strftime('%m')}月{d.strftime('%d')}日" 603 | 604 | def if_blank(s): 605 | return s if s else ' ' 606 | 607 | weekday = ['星期' + d for d in ('日', '一', '二', '三', '四', '五', '六')] 608 | today_year = f"{datetime.now().strftime('%Y')}年" 609 | today_month = f"{datetime.now().strftime('%m')}月" 610 | today_day = f"{datetime.now().strftime('%d')}日" 611 | today_week = weekday[int(datetime.now().strftime('%w'))] 612 | s = s + "

今日简报

" 613 | s = s + f"

{today_year}{today_month}{today_day} {today_week}

" 614 | 615 | s = s + "

今日计划

" 616 | s = s + "
" 617 | today = datetime.now().strftime('%Y-%m-%d') 618 | todos = sorted(self.select('todo_list', 'case_name, date, things'), 619 | key = lambda x: (x['date'])) 620 | for todo in todos: 621 | if todo['date'] == today: 622 | s = s + f" "\ 623 | f"" 624 | elif todo['date'] > today: 625 | break 626 | s = s + "
{todo['case_name']}{if_blank(todo['things'])}

" 627 | 628 | s = s + "

未来十五日

" 629 | s = s + "" 630 | after_15 = (datetime.now() + timedelta(days = 15)).strftime('%Y-%m-%d') 631 | for todo in todos: 632 | if todo['date'] > today and todo['date'] < after_15: 633 | todo_date = datetime.strptime(todo['date'], '%Y-%m-%d') 634 | s = s + f" "\ 635 | f" "\ 636 | f"" 637 | s =s + "
{date_to_string(todo_date)}{if_blank(todo['case_name'])}{todo['things']}
" 638 | return s 639 | 640 | def generate_mail_address(self, pid): 641 | infos = [[x['item'], x['value']] for x in self.select('contact_info', 'item, value', 'contact_id', pid)] 642 | s = '' 643 | for t in infos: 644 | if t[0] == '邮寄地址' or t[0] == '联系地址': 645 | if t[1]: 646 | s = s + t[1] 647 | else: 648 | s = s + "(缺少邮寄或联系地址)" 649 | break 650 | s = s + f" {infos[0][1]}(收) " 651 | for t in infos: 652 | if t[0] == '联系电话': 653 | if t[1]: 654 | s = s + t[1] 655 | else: 656 | s = s + "(缺少联系电话)" 657 | break 658 | return s 659 | 660 | def generate_party_info(self, pid): 661 | infos = [[x['item'], x['value']] for x in self.select('party_info', 'item, value', 'party_id', pid)] 662 | s = infos[0][1] + '\n' 663 | for t in infos: 664 | if t[0] in ('身份证号', '法定代表人', '地址', '注册地址', '居住地址', '联系电话'): 665 | if t[1]: 666 | s = s + f"{t[0]}:{t[1]}\n" 667 | return s 668 | 669 | def generate_todo_info(self, case): 670 | infos = [x for x in self.select('todo_list', 'date, things', 'case_name', case)] 671 | s = '' 672 | for t in infos: 673 | d = datetime.strptime(t['date'], '%Y-%m-%d') 674 | date = f"{d.strftime('%Y')}年{d.strftime('%m')}月{d.strftime('%d')}日" 675 | s = s + f"{date}\t{t['things']}\n" 676 | return s 677 | 678 | def generate_event_info(self, case): 679 | infos = [x for x in self.select('event_list', 'date, things', 'case_name', case)] 680 | s = '' 681 | for t in infos: 682 | d = datetime.strptime(t['date'], '%Y-%m-%d') 683 | date = f"{d.strftime('%Y')}年{d.strftime('%m')}月{d.strftime('%d')}日" 684 | s = s + f"{date}\t{t['things']}\n" 685 | return s 686 | 687 | def generate_person_info_html(self, which_type, which_class, pid): 688 | s = ''' 689 | 690 | 700 | 701 | 702 | ''' 703 | 704 | item_list = self.select(f"{which_type}_class", 'item', 'class', which_class) 705 | all_values = self.select(f"{which_type}_info", 'item, value', f"{which_type}_id", pid) 706 | 707 | s = s + f"" 708 | for item in item_list: 709 | for t in all_values: 710 | if t['item'] == item['item']: 711 | if t['value']: 712 | s = s + f" "\ 713 | f"" 714 | break 715 | s =s + "
{which_class}
{t['item']}{t['value']}
" 716 | return s 717 | 718 | def generate_case_info(self, case, abbr): 719 | case_info = self.select_all('case_info', 'case_name', case) 720 | project = self.select('case_list', 'project_name', 'case_name', case)[0]['project_name'] 721 | case_type = self.select('case_list', 'case_type', 'case_name', case)[0]['case_type'] 722 | type_item = self.select_all('case_type', 'type_name', case_type) 723 | s = '' 724 | last_status = '' 725 | flag = False 726 | flag_2 = False 727 | for i in [x for x in type_item if (x['item_form'] == 'party')]: 728 | this_item = i['item'] 729 | items = self.select_multi_condition('case_info', "id, value_form, value, value2", 730 | f"case_name = '{self.trans(case)}' and item = '{self.trans(this_item)}'") 731 | if items: 732 | for k in items: 733 | status = k['value'] 734 | infos = self.select(f"party_info", 'item, value', f"party_id", k['value2']) 735 | name = infos[0]['value'] 736 | if status != last_status and not flag: 737 | s = s + status + name 738 | flag = True 739 | last_status = status 740 | elif status != last_status: 741 | if not flag_2: 742 | s = s + f"与{status}{name}" 743 | flag_2 = True 744 | else: 745 | s = s + f",{status}{name}" 746 | last_status = status 747 | elif status == status: 748 | s = s + f"、{name}" 749 | if abbr: 750 | abbreviation = [x['value'] for x in infos if x['item'] == '简称'] + [[]][0] 751 | if abbreviation and abbreviation[0]: 752 | s = s + f"(以下简称“{abbreviation[0]}”)" 753 | 754 | if '仲裁协议' in [x['item'] for x in type_item]: 755 | contract = [x['value'] for x in case_info if x['item'] == '仲裁协议'] + [[]][0] 756 | if contract: 757 | if abbr: 758 | abbreviation = [x['value'] for x in case_info if x['item'] == '仲裁协议简称'] + [[]][0] 759 | if abbreviation and abbreviation[0]: 760 | s = s + f"之间因{contract[0]}(以下简称“{abbreviation[0]}”)所引起的争议仲裁案" 761 | else: 762 | s = s + f"之间因{contract[0]}所引起的争议仲裁案" 763 | else: 764 | s = s + f"之间因{contract[0]}所引起的争议仲裁案" 765 | elif '案由' in [x['item'] for x in type_item]: 766 | cause = [x['value'] for x in case_info if (x['item'] == '案由')] + [[]][0] 767 | if cause: 768 | grade = [x['value'] for x in case_info if (x['item'] == '审级')] + [[]][0] 769 | if grade and grade != "一审": 770 | s = s + f"之间的{cause[0]}{grade[0]}案件" 771 | else: 772 | s = s + f"之间的{cause[0]}案件" 773 | 774 | num = [x['value'] for x in case_info if (x['item'] == '案号')] + [[]][0] 775 | if num: 776 | s = s + f"[案号:{num[0]}]" 777 | 778 | return s 779 | 780 | 781 | -------------------------------------------------------------------------------- /MCLib_UI.py: -------------------------------------------------------------------------------- 1 | # Form implementation generated from reading ui file '/Users/l/Documents/Adobe & GTP/python/MyCaseLib/UI/MCLib_UI.ui' 2 | # 3 | # Created by: PyQt6 UI code generator 6.4.2 4 | # 5 | # WARNING: Any manual changes made to this file will be lost when pyuic6 is 6 | # run again. Do not edit this file unless you know what you are doing. 7 | 8 | 9 | from PyQt6 import QtCore, QtGui, QtWidgets 10 | 11 | 12 | class Ui_MainWindow(object): 13 | def setupUi(self, MainWindow): 14 | MainWindow.setObjectName("MainWindow") 15 | MainWindow.resize(845, 490) 16 | MainWindow.setMinimumSize(QtCore.QSize(600, 400)) 17 | self.stylesheet = QtWidgets.QWidget(parent=MainWindow) 18 | self.stylesheet.setStyleSheet("") 19 | self.stylesheet.setObjectName("stylesheet") 20 | self.gridLayout_6 = QtWidgets.QGridLayout(self.stylesheet) 21 | self.gridLayout_6.setContentsMargins(0, 0, 0, 0) 22 | self.gridLayout_6.setSpacing(0) 23 | self.gridLayout_6.setObjectName("gridLayout_6") 24 | self.left_frame = QtWidgets.QFrame(parent=self.stylesheet) 25 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Preferred) 26 | sizePolicy.setHorizontalStretch(0) 27 | sizePolicy.setVerticalStretch(0) 28 | sizePolicy.setHeightForWidth(self.left_frame.sizePolicy().hasHeightForWidth()) 29 | self.left_frame.setSizePolicy(sizePolicy) 30 | self.left_frame.setMinimumSize(QtCore.QSize(60, 0)) 31 | self.left_frame.setFrameShape(QtWidgets.QFrame.Shape.NoFrame) 32 | self.left_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) 33 | self.left_frame.setObjectName("left_frame") 34 | self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.left_frame) 35 | self.verticalLayout_3.setContentsMargins(0, 0, 0, 0) 36 | self.verticalLayout_3.setSpacing(0) 37 | self.verticalLayout_3.setObjectName("verticalLayout_3") 38 | self.btn_frame = QtWidgets.QFrame(parent=self.left_frame) 39 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Preferred) 40 | sizePolicy.setHorizontalStretch(0) 41 | sizePolicy.setVerticalStretch(0) 42 | sizePolicy.setHeightForWidth(self.btn_frame.sizePolicy().hasHeightForWidth()) 43 | self.btn_frame.setSizePolicy(sizePolicy) 44 | self.btn_frame.setFrameShape(QtWidgets.QFrame.Shape.NoFrame) 45 | self.btn_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) 46 | self.btn_frame.setObjectName("btn_frame") 47 | self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.btn_frame) 48 | self.verticalLayout_5.setContentsMargins(0, 0, 0, 0) 49 | self.verticalLayout_5.setSpacing(6) 50 | self.verticalLayout_5.setObjectName("verticalLayout_5") 51 | self.icon_label = QtWidgets.QLabel(parent=self.btn_frame) 52 | self.icon_label.setMinimumSize(QtCore.QSize(0, 65)) 53 | self.icon_label.setText("") 54 | self.icon_label.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) 55 | self.icon_label.setObjectName("icon_label") 56 | self.verticalLayout_5.addWidget(self.icon_label) 57 | self.my_project_btn = QtWidgets.QToolButton(parent=self.btn_frame) 58 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed) 59 | sizePolicy.setHorizontalStretch(0) 60 | sizePolicy.setVerticalStretch(0) 61 | sizePolicy.setHeightForWidth(self.my_project_btn.sizePolicy().hasHeightForWidth()) 62 | self.my_project_btn.setSizePolicy(sizePolicy) 63 | self.my_project_btn.setMinimumSize(QtCore.QSize(0, 0)) 64 | self.my_project_btn.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) 65 | self.my_project_btn.setToolTip("") 66 | self.my_project_btn.setText("") 67 | self.my_project_btn.setObjectName("my_project_btn") 68 | self.verticalLayout_5.addWidget(self.my_project_btn) 69 | self.case_study_btn = QtWidgets.QToolButton(parent=self.btn_frame) 70 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed) 71 | sizePolicy.setHorizontalStretch(0) 72 | sizePolicy.setVerticalStretch(0) 73 | sizePolicy.setHeightForWidth(self.case_study_btn.sizePolicy().hasHeightForWidth()) 74 | self.case_study_btn.setSizePolicy(sizePolicy) 75 | self.case_study_btn.setMinimumSize(QtCore.QSize(0, 0)) 76 | self.case_study_btn.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) 77 | self.case_study_btn.setText("") 78 | self.case_study_btn.setObjectName("case_study_btn") 79 | self.verticalLayout_5.addWidget(self.case_study_btn) 80 | self.party_contact_btn = QtWidgets.QToolButton(parent=self.btn_frame) 81 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed) 82 | sizePolicy.setHorizontalStretch(0) 83 | sizePolicy.setVerticalStretch(0) 84 | sizePolicy.setHeightForWidth(self.party_contact_btn.sizePolicy().hasHeightForWidth()) 85 | self.party_contact_btn.setSizePolicy(sizePolicy) 86 | self.party_contact_btn.setMinimumSize(QtCore.QSize(0, 0)) 87 | self.party_contact_btn.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) 88 | self.party_contact_btn.setText("") 89 | self.party_contact_btn.setObjectName("party_contact_btn") 90 | self.verticalLayout_5.addWidget(self.party_contact_btn) 91 | self.templete_btn = QtWidgets.QToolButton(parent=self.btn_frame) 92 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed) 93 | sizePolicy.setHorizontalStretch(0) 94 | sizePolicy.setVerticalStretch(0) 95 | sizePolicy.setHeightForWidth(self.templete_btn.sizePolicy().hasHeightForWidth()) 96 | self.templete_btn.setSizePolicy(sizePolicy) 97 | self.templete_btn.setMinimumSize(QtCore.QSize(0, 0)) 98 | self.templete_btn.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) 99 | self.templete_btn.setText("") 100 | self.templete_btn.setObjectName("templete_btn") 101 | self.verticalLayout_5.addWidget(self.templete_btn) 102 | self.option_btn = QtWidgets.QToolButton(parent=self.btn_frame) 103 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed) 104 | sizePolicy.setHorizontalStretch(0) 105 | sizePolicy.setVerticalStretch(0) 106 | sizePolicy.setHeightForWidth(self.option_btn.sizePolicy().hasHeightForWidth()) 107 | self.option_btn.setSizePolicy(sizePolicy) 108 | self.option_btn.setMinimumSize(QtCore.QSize(0, 0)) 109 | self.option_btn.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) 110 | self.option_btn.setText("") 111 | self.option_btn.setObjectName("option_btn") 112 | self.verticalLayout_5.addWidget(self.option_btn) 113 | self.verticalLayout_3.addWidget(self.btn_frame) 114 | spacerItem = QtWidgets.QSpacerItem(20, 182, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) 115 | self.verticalLayout_3.addItem(spacerItem) 116 | self.gridLayout_6.addWidget(self.left_frame, 0, 0, 1, 1) 117 | self.right_frame = QtWidgets.QFrame(parent=self.stylesheet) 118 | self.right_frame.setFrameShape(QtWidgets.QFrame.Shape.NoFrame) 119 | self.right_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) 120 | self.right_frame.setObjectName("right_frame") 121 | self.gridLayout_3 = QtWidgets.QGridLayout(self.right_frame) 122 | self.gridLayout_3.setContentsMargins(0, 7, 3, 7) 123 | self.gridLayout_3.setSpacing(0) 124 | self.gridLayout_3.setObjectName("gridLayout_3") 125 | self.main_stacked_widget = QtWidgets.QStackedWidget(parent=self.right_frame) 126 | self.main_stacked_widget.setObjectName("main_stacked_widget") 127 | self.my_project_page = QtWidgets.QWidget() 128 | self.my_project_page.setObjectName("my_project_page") 129 | self.gridLayout = QtWidgets.QGridLayout(self.my_project_page) 130 | self.gridLayout.setContentsMargins(0, 0, 0, 0) 131 | self.gridLayout.setSpacing(0) 132 | self.gridLayout.setObjectName("gridLayout") 133 | self.my_project_page_splitter = QtWidgets.QSplitter(parent=self.my_project_page) 134 | self.my_project_page_splitter.setLineWidth(0) 135 | self.my_project_page_splitter.setOrientation(QtCore.Qt.Orientation.Horizontal) 136 | self.my_project_page_splitter.setHandleWidth(0) 137 | self.my_project_page_splitter.setObjectName("my_project_page_splitter") 138 | self.project_frame = QtWidgets.QFrame(parent=self.my_project_page_splitter) 139 | self.project_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) 140 | self.project_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) 141 | self.project_frame.setObjectName("project_frame") 142 | self.gridLayout_2 = QtWidgets.QGridLayout(self.project_frame) 143 | self.gridLayout_2.setContentsMargins(0, 0, 0, 0) 144 | self.gridLayout_2.setSpacing(0) 145 | self.gridLayout_2.setObjectName("gridLayout_2") 146 | self.verticalLayout_2 = QtWidgets.QVBoxLayout() 147 | self.verticalLayout_2.setSpacing(0) 148 | self.verticalLayout_2.setObjectName("verticalLayout_2") 149 | self.project_search_bar_frame = QtWidgets.QFrame(parent=self.project_frame) 150 | self.project_search_bar_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) 151 | self.project_search_bar_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) 152 | self.project_search_bar_frame.setObjectName("project_search_bar_frame") 153 | self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.project_search_bar_frame) 154 | self.horizontalLayout_2.setSpacing(5) 155 | self.horizontalLayout_2.setObjectName("horizontalLayout_2") 156 | self.project_search_bar = QtWidgets.QLineEdit(parent=self.project_search_bar_frame) 157 | self.project_search_bar.setObjectName("project_search_bar") 158 | self.horizontalLayout_2.addWidget(self.project_search_bar) 159 | self.project_filter_btn = QtWidgets.QToolButton(parent=self.project_search_bar_frame) 160 | self.project_filter_btn.setText("") 161 | self.project_filter_btn.setObjectName("project_filter_btn") 162 | self.horizontalLayout_2.addWidget(self.project_filter_btn) 163 | self.project_add_btn = QtWidgets.QToolButton(parent=self.project_search_bar_frame) 164 | self.project_add_btn.setText("") 165 | self.project_add_btn.setObjectName("project_add_btn") 166 | self.horizontalLayout_2.addWidget(self.project_add_btn) 167 | self.verticalLayout_2.addWidget(self.project_search_bar_frame) 168 | self.p_c_treeview = QtWidgets.QTreeWidget(parent=self.project_frame) 169 | self.p_c_treeview.setTabletTracking(False) 170 | self.p_c_treeview.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu) 171 | self.p_c_treeview.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarPolicy.ScrollBarAsNeeded) 172 | self.p_c_treeview.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarPolicy.ScrollBarAsNeeded) 173 | self.p_c_treeview.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection) 174 | self.p_c_treeview.setColumnCount(0) 175 | self.p_c_treeview.setObjectName("p_c_treeview") 176 | self.p_c_treeview.header().setVisible(False) 177 | self.verticalLayout_2.addWidget(self.p_c_treeview) 178 | self.gridLayout_2.addLayout(self.verticalLayout_2, 0, 0, 1, 1) 179 | self.case_frame = QtWidgets.QFrame(parent=self.my_project_page_splitter) 180 | self.case_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) 181 | self.case_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) 182 | self.case_frame.setObjectName("case_frame") 183 | self.gridLayout_9 = QtWidgets.QGridLayout(self.case_frame) 184 | self.gridLayout_9.setContentsMargins(0, 0, 0, 0) 185 | self.gridLayout_9.setSpacing(0) 186 | self.gridLayout_9.setObjectName("gridLayout_9") 187 | self.case_info_tab = QtWidgets.QTabWidget(parent=self.case_frame) 188 | self.case_info_tab.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu) 189 | self.case_info_tab.setObjectName("case_info_tab") 190 | self.info_tab = QtWidgets.QWidget() 191 | self.info_tab.setObjectName("info_tab") 192 | self.gridLayout_7 = QtWidgets.QGridLayout(self.info_tab) 193 | self.gridLayout_7.setContentsMargins(0, 0, 0, 0) 194 | self.gridLayout_7.setSpacing(0) 195 | self.gridLayout_7.setObjectName("gridLayout_7") 196 | self.gridLayout_5 = QtWidgets.QGridLayout() 197 | self.gridLayout_5.setSpacing(0) 198 | self.gridLayout_5.setObjectName("gridLayout_5") 199 | self.info_view = QtWidgets.QTextBrowser(parent=self.info_tab) 200 | self.info_view.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu) 201 | self.info_view.setObjectName("info_view") 202 | self.gridLayout_5.addWidget(self.info_view, 0, 0, 4, 2) 203 | self.gridLayout_10 = QtWidgets.QGridLayout() 204 | self.gridLayout_10.setContentsMargins(30, 30, 30, 20) 205 | self.gridLayout_10.setSpacing(18) 206 | self.gridLayout_10.setObjectName("gridLayout_10") 207 | self.info_view_export_btn = QtWidgets.QToolButton(parent=self.info_tab) 208 | self.info_view_export_btn.setText("") 209 | self.info_view_export_btn.setObjectName("info_view_export_btn") 210 | self.gridLayout_10.addWidget(self.info_view_export_btn, 3, 2, 1, 1) 211 | spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) 212 | self.gridLayout_10.addItem(spacerItem1, 5, 2, 1, 1) 213 | spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 214 | self.gridLayout_10.addItem(spacerItem2, 3, 0, 1, 1) 215 | self.info_view_edit_btn = QtWidgets.QToolButton(parent=self.info_tab) 216 | self.info_view_edit_btn.setMinimumSize(QtCore.QSize(0, 0)) 217 | self.info_view_edit_btn.setText("") 218 | self.info_view_edit_btn.setObjectName("info_view_edit_btn") 219 | self.gridLayout_10.addWidget(self.info_view_edit_btn, 2, 2, 1, 1) 220 | self.info_view_detail_btn = QtWidgets.QToolButton(parent=self.info_tab) 221 | self.info_view_detail_btn.setText("") 222 | self.info_view_detail_btn.setObjectName("info_view_detail_btn") 223 | self.gridLayout_10.addWidget(self.info_view_detail_btn, 1, 2, 1, 1) 224 | self.gridLayout_5.addLayout(self.gridLayout_10, 1, 0, 1, 1) 225 | self.gridLayout_7.addLayout(self.gridLayout_5, 0, 0, 1, 1) 226 | self.case_info_tab.addTab(self.info_tab, "") 227 | self.todo_tab = QtWidgets.QWidget() 228 | self.todo_tab.setObjectName("todo_tab") 229 | self.gridLayout_12 = QtWidgets.QGridLayout(self.todo_tab) 230 | self.gridLayout_12.setContentsMargins(0, 0, 0, 0) 231 | self.gridLayout_12.setSpacing(0) 232 | self.gridLayout_12.setObjectName("gridLayout_12") 233 | self.gridLayout_11 = QtWidgets.QGridLayout() 234 | self.gridLayout_11.setSpacing(0) 235 | self.gridLayout_11.setObjectName("gridLayout_11") 236 | self.todo_view = QtWidgets.QTableWidget(parent=self.todo_tab) 237 | self.todo_view.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu) 238 | self.todo_view.setTabKeyNavigation(True) 239 | self.todo_view.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection) 240 | self.todo_view.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows) 241 | self.todo_view.setColumnCount(3) 242 | self.todo_view.setObjectName("todo_view") 243 | self.todo_view.setRowCount(0) 244 | self.gridLayout_11.addWidget(self.todo_view, 0, 0, 3, 2) 245 | self.gridLayout_8 = QtWidgets.QGridLayout() 246 | self.gridLayout_8.setContentsMargins(-1, -1, 30, 20) 247 | self.gridLayout_8.setSpacing(18) 248 | self.gridLayout_8.setObjectName("gridLayout_8") 249 | spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) 250 | self.gridLayout_8.addItem(spacerItem3, 0, 1, 1, 1) 251 | spacerItem4 = QtWidgets.QSpacerItem(13, 17, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 252 | self.gridLayout_8.addItem(spacerItem4, 1, 0, 1, 1) 253 | self.todo_delete_btn = QtWidgets.QToolButton(parent=self.todo_tab) 254 | self.todo_delete_btn.setText("") 255 | self.todo_delete_btn.setObjectName("todo_delete_btn") 256 | self.gridLayout_8.addWidget(self.todo_delete_btn, 2, 1, 1, 1) 257 | self.todo_add_btn = QtWidgets.QToolButton(parent=self.todo_tab) 258 | self.todo_add_btn.setText("") 259 | self.todo_add_btn.setObjectName("todo_add_btn") 260 | self.gridLayout_8.addWidget(self.todo_add_btn, 1, 1, 1, 1) 261 | self.todo_export_btn = QtWidgets.QToolButton(parent=self.todo_tab) 262 | self.todo_export_btn.setText("") 263 | self.todo_export_btn.setObjectName("todo_export_btn") 264 | self.gridLayout_8.addWidget(self.todo_export_btn, 3, 1, 1, 1) 265 | self.gridLayout_11.addLayout(self.gridLayout_8, 1, 0, 1, 1) 266 | self.gridLayout_12.addLayout(self.gridLayout_11, 0, 0, 1, 1) 267 | self.case_info_tab.addTab(self.todo_tab, "") 268 | self.event_tab = QtWidgets.QWidget() 269 | self.event_tab.setObjectName("event_tab") 270 | self.gridLayout_16 = QtWidgets.QGridLayout(self.event_tab) 271 | self.gridLayout_16.setContentsMargins(0, 0, 0, 0) 272 | self.gridLayout_16.setSpacing(0) 273 | self.gridLayout_16.setObjectName("gridLayout_16") 274 | self.gridLayout_15 = QtWidgets.QGridLayout() 275 | self.gridLayout_15.setSpacing(0) 276 | self.gridLayout_15.setObjectName("gridLayout_15") 277 | self.event_view = QtWidgets.QTableWidget(parent=self.event_tab) 278 | self.event_view.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu) 279 | self.event_view.setTabKeyNavigation(True) 280 | self.event_view.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection) 281 | self.event_view.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows) 282 | self.event_view.setColumnCount(3) 283 | self.event_view.setObjectName("event_view") 284 | self.event_view.setRowCount(0) 285 | self.gridLayout_15.addWidget(self.event_view, 0, 0, 2, 2) 286 | self.gridLayout_4 = QtWidgets.QGridLayout() 287 | self.gridLayout_4.setContentsMargins(-1, -1, 30, 20) 288 | self.gridLayout_4.setSpacing(18) 289 | self.gridLayout_4.setObjectName("gridLayout_4") 290 | spacerItem5 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) 291 | self.gridLayout_4.addItem(spacerItem5, 0, 1, 1, 1) 292 | spacerItem6 = QtWidgets.QSpacerItem(13, 17, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 293 | self.gridLayout_4.addItem(spacerItem6, 1, 0, 1, 1) 294 | self.event_delete_btn = QtWidgets.QToolButton(parent=self.event_tab) 295 | self.event_delete_btn.setText("") 296 | self.event_delete_btn.setObjectName("event_delete_btn") 297 | self.gridLayout_4.addWidget(self.event_delete_btn, 2, 1, 1, 1) 298 | self.event_add_btn = QtWidgets.QToolButton(parent=self.event_tab) 299 | self.event_add_btn.setText("") 300 | self.event_add_btn.setObjectName("event_add_btn") 301 | self.gridLayout_4.addWidget(self.event_add_btn, 1, 1, 1, 1) 302 | self.event_export_btn = QtWidgets.QToolButton(parent=self.event_tab) 303 | self.event_export_btn.setText("") 304 | self.event_export_btn.setObjectName("event_export_btn") 305 | self.gridLayout_4.addWidget(self.event_export_btn, 3, 1, 1, 1) 306 | self.gridLayout_15.addLayout(self.gridLayout_4, 1, 1, 1, 1) 307 | self.gridLayout_16.addLayout(self.gridLayout_15, 0, 0, 1, 1) 308 | self.case_info_tab.addTab(self.event_tab, "") 309 | self.note_tab = QtWidgets.QWidget() 310 | self.note_tab.setObjectName("note_tab") 311 | self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.note_tab) 312 | self.verticalLayout_7.setContentsMargins(12, 12, 12, 12) 313 | self.verticalLayout_7.setSpacing(0) 314 | self.verticalLayout_7.setObjectName("verticalLayout_7") 315 | self.notepad = QtWidgets.QTextEdit(parent=self.note_tab) 316 | self.notepad.setObjectName("notepad") 317 | self.verticalLayout_7.addWidget(self.notepad) 318 | self.case_info_tab.addTab(self.note_tab, "") 319 | self.gridLayout_9.addWidget(self.case_info_tab, 0, 0, 1, 1) 320 | self.gridLayout.addWidget(self.my_project_page_splitter, 0, 0, 1, 1) 321 | self.main_stacked_widget.addWidget(self.my_project_page) 322 | self.option_page = QtWidgets.QWidget() 323 | self.option_page.setObjectName("option_page") 324 | self.gridLayout_29 = QtWidgets.QGridLayout(self.option_page) 325 | self.gridLayout_29.setContentsMargins(0, 0, 0, 0) 326 | self.gridLayout_29.setSpacing(0) 327 | self.gridLayout_29.setObjectName("gridLayout_29") 328 | self.option_frame = QtWidgets.QFrame(parent=self.option_page) 329 | self.option_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) 330 | self.option_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) 331 | self.option_frame.setObjectName("option_frame") 332 | self.gridLayout_32 = QtWidgets.QGridLayout(self.option_frame) 333 | self.gridLayout_32.setContentsMargins(35, 35, 35, 35) 334 | self.gridLayout_32.setObjectName("gridLayout_32") 335 | self.option_table = QtWidgets.QTableWidget(parent=self.option_frame) 336 | self.option_table.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu) 337 | self.option_table.setTabKeyNavigation(True) 338 | self.option_table.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.NoSelection) 339 | self.option_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows) 340 | self.option_table.setShowGrid(False) 341 | self.option_table.setColumnCount(4) 342 | self.option_table.setObjectName("option_table") 343 | self.option_table.setRowCount(0) 344 | self.option_table.horizontalHeader().setVisible(False) 345 | self.option_table.verticalHeader().setVisible(False) 346 | self.gridLayout_32.addWidget(self.option_table, 0, 0, 1, 1) 347 | self.gridLayout_29.addWidget(self.option_frame, 0, 0, 1, 1) 348 | self.main_stacked_widget.addWidget(self.option_page) 349 | self.party_contact_page = QtWidgets.QWidget() 350 | self.party_contact_page.setObjectName("party_contact_page") 351 | self.gridLayout_22 = QtWidgets.QGridLayout(self.party_contact_page) 352 | self.gridLayout_22.setContentsMargins(0, 0, 0, 0) 353 | self.gridLayout_22.setSpacing(0) 354 | self.gridLayout_22.setObjectName("gridLayout_22") 355 | self.gridLayout_23 = QtWidgets.QGridLayout() 356 | self.gridLayout_23.setSpacing(0) 357 | self.gridLayout_23.setObjectName("gridLayout_23") 358 | self.party_contact_top_frame = QtWidgets.QFrame(parent=self.party_contact_page) 359 | self.party_contact_top_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) 360 | self.party_contact_top_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) 361 | self.party_contact_top_frame.setObjectName("party_contact_top_frame") 362 | self.gridLayout_20 = QtWidgets.QGridLayout(self.party_contact_top_frame) 363 | self.gridLayout_20.setContentsMargins(0, 0, 0, 0) 364 | self.gridLayout_20.setSpacing(0) 365 | self.gridLayout_20.setObjectName("gridLayout_20") 366 | self.gridLayout_14 = QtWidgets.QGridLayout() 367 | self.gridLayout_14.setSpacing(0) 368 | self.gridLayout_14.setObjectName("gridLayout_14") 369 | self.horizontalLayout = QtWidgets.QHBoxLayout() 370 | self.horizontalLayout.setContentsMargins(-1, -1, -1, 0) 371 | self.horizontalLayout.setSpacing(0) 372 | self.horizontalLayout.setObjectName("horizontalLayout") 373 | self.horizontalLayout_3 = QtWidgets.QHBoxLayout() 374 | self.horizontalLayout_3.setSpacing(0) 375 | self.horizontalLayout_3.setObjectName("horizontalLayout_3") 376 | spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 377 | self.horizontalLayout_3.addItem(spacerItem7) 378 | self.party_contact_search_bar = QtWidgets.QLineEdit(parent=self.party_contact_top_frame) 379 | self.party_contact_search_bar.setMinimumSize(QtCore.QSize(300, 0)) 380 | self.party_contact_search_bar.setObjectName("party_contact_search_bar") 381 | self.horizontalLayout_3.addWidget(self.party_contact_search_bar) 382 | spacerItem8 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 383 | self.horizontalLayout_3.addItem(spacerItem8) 384 | self.horizontalLayout.addLayout(self.horizontalLayout_3) 385 | spacerItem9 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 386 | self.horizontalLayout.addItem(spacerItem9) 387 | self.party_btn = QtWidgets.QToolButton(parent=self.party_contact_top_frame) 388 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed) 389 | sizePolicy.setHorizontalStretch(0) 390 | sizePolicy.setVerticalStretch(0) 391 | sizePolicy.setHeightForWidth(self.party_btn.sizePolicy().hasHeightForWidth()) 392 | self.party_btn.setSizePolicy(sizePolicy) 393 | self.party_btn.setMinimumSize(QtCore.QSize(0, 50)) 394 | self.party_btn.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) 395 | self.party_btn.setToolTip("") 396 | self.party_btn.setText("") 397 | self.party_btn.setObjectName("party_btn") 398 | self.horizontalLayout.addWidget(self.party_btn) 399 | self.contact_btn = QtWidgets.QToolButton(parent=self.party_contact_top_frame) 400 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed) 401 | sizePolicy.setHorizontalStretch(0) 402 | sizePolicy.setVerticalStretch(0) 403 | sizePolicy.setHeightForWidth(self.contact_btn.sizePolicy().hasHeightForWidth()) 404 | self.contact_btn.setSizePolicy(sizePolicy) 405 | self.contact_btn.setMinimumSize(QtCore.QSize(0, 50)) 406 | self.contact_btn.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) 407 | self.contact_btn.setToolTip("") 408 | self.contact_btn.setText("") 409 | self.contact_btn.setObjectName("contact_btn") 410 | self.horizontalLayout.addWidget(self.contact_btn) 411 | spacerItem10 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 412 | self.horizontalLayout.addItem(spacerItem10) 413 | self.gridLayout_14.addLayout(self.horizontalLayout, 0, 0, 1, 1) 414 | self.gridLayout_14.setColumnStretch(0, 4) 415 | self.gridLayout_20.addLayout(self.gridLayout_14, 0, 0, 1, 1) 416 | self.gridLayout_23.addWidget(self.party_contact_top_frame, 0, 0, 1, 1) 417 | self.party_contact_bottom_frame = QtWidgets.QFrame(parent=self.party_contact_page) 418 | self.party_contact_bottom_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) 419 | self.party_contact_bottom_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) 420 | self.party_contact_bottom_frame.setObjectName("party_contact_bottom_frame") 421 | self.gridLayout_17 = QtWidgets.QGridLayout(self.party_contact_bottom_frame) 422 | self.gridLayout_17.setContentsMargins(0, 0, 0, 0) 423 | self.gridLayout_17.setSpacing(0) 424 | self.gridLayout_17.setObjectName("gridLayout_17") 425 | self.party_contact_splitter = QtWidgets.QSplitter(parent=self.party_contact_bottom_frame) 426 | self.party_contact_splitter.setOrientation(QtCore.Qt.Orientation.Horizontal) 427 | self.party_contact_splitter.setHandleWidth(0) 428 | self.party_contact_splitter.setObjectName("party_contact_splitter") 429 | self.person_list_frame = QtWidgets.QFrame(parent=self.party_contact_splitter) 430 | self.person_list_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) 431 | self.person_list_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) 432 | self.person_list_frame.setObjectName("person_list_frame") 433 | self.gridLayout_19 = QtWidgets.QGridLayout(self.person_list_frame) 434 | self.gridLayout_19.setContentsMargins(0, 0, 0, 0) 435 | self.gridLayout_19.setSpacing(0) 436 | self.gridLayout_19.setObjectName("gridLayout_19") 437 | self.person_list_view = QtWidgets.QTableWidget(parent=self.person_list_frame) 438 | self.person_list_view.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu) 439 | self.person_list_view.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) 440 | self.person_list_view.setColumnCount(2) 441 | self.person_list_view.setObjectName("person_list_view") 442 | self.person_list_view.setRowCount(0) 443 | self.person_list_view.horizontalHeader().setVisible(False) 444 | self.person_list_view.verticalHeader().setVisible(False) 445 | self.gridLayout_19.addWidget(self.person_list_view, 0, 0, 4, 2) 446 | self.gridLayout_18 = QtWidgets.QGridLayout() 447 | self.gridLayout_18.setContentsMargins(-1, -1, 30, 20) 448 | self.gridLayout_18.setSpacing(18) 449 | self.gridLayout_18.setObjectName("gridLayout_18") 450 | spacerItem11 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) 451 | self.gridLayout_18.addItem(spacerItem11, 0, 1, 1, 1) 452 | spacerItem12 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 453 | self.gridLayout_18.addItem(spacerItem12, 3, 0, 1, 1) 454 | self.person_list_delete_btn = QtWidgets.QToolButton(parent=self.person_list_frame) 455 | self.person_list_delete_btn.setText("") 456 | self.person_list_delete_btn.setObjectName("person_list_delete_btn") 457 | self.gridLayout_18.addWidget(self.person_list_delete_btn, 2, 1, 1, 1) 458 | self.person_list_add_btn = QtWidgets.QToolButton(parent=self.person_list_frame) 459 | self.person_list_add_btn.setText("") 460 | self.person_list_add_btn.setObjectName("person_list_add_btn") 461 | self.gridLayout_18.addWidget(self.person_list_add_btn, 1, 1, 1, 1) 462 | self.person_list_export_btn = QtWidgets.QToolButton(parent=self.person_list_frame) 463 | self.person_list_export_btn.setText("") 464 | self.person_list_export_btn.setObjectName("person_list_export_btn") 465 | self.gridLayout_18.addWidget(self.person_list_export_btn, 3, 1, 1, 1) 466 | self.gridLayout_19.addLayout(self.gridLayout_18, 1, 0, 1, 1) 467 | self.person_info_frame = QtWidgets.QFrame(parent=self.party_contact_splitter) 468 | self.person_info_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) 469 | self.person_info_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) 470 | self.person_info_frame.setObjectName("person_info_frame") 471 | self.gridLayout_21 = QtWidgets.QGridLayout(self.person_info_frame) 472 | self.gridLayout_21.setContentsMargins(0, 0, 0, 0) 473 | self.gridLayout_21.setSpacing(0) 474 | self.gridLayout_21.setObjectName("gridLayout_21") 475 | self.person_info_view = QtWidgets.QTableWidget(parent=self.person_info_frame) 476 | font = QtGui.QFont() 477 | font.setPointSize(11) 478 | self.person_info_view.setFont(font) 479 | self.person_info_view.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu) 480 | self.person_info_view.setColumnCount(2) 481 | self.person_info_view.setObjectName("person_info_view") 482 | self.person_info_view.setRowCount(0) 483 | self.person_info_view.horizontalHeader().setVisible(False) 484 | self.person_info_view.verticalHeader().setVisible(False) 485 | self.person_info_view.verticalHeader().setCascadingSectionResizes(True) 486 | self.person_info_view.verticalHeader().setDefaultSectionSize(30) 487 | self.person_info_view.verticalHeader().setMinimumSectionSize(30) 488 | self.gridLayout_21.addWidget(self.person_info_view, 0, 0, 1, 1) 489 | self.gridLayout_17.addWidget(self.party_contact_splitter, 0, 0, 1, 1) 490 | self.gridLayout_23.addWidget(self.party_contact_bottom_frame, 1, 0, 1, 1) 491 | self.gridLayout_23.setRowStretch(1, 1) 492 | self.gridLayout_22.addLayout(self.gridLayout_23, 0, 0, 1, 1) 493 | self.main_stacked_widget.addWidget(self.party_contact_page) 494 | self.templete_page = QtWidgets.QWidget() 495 | self.templete_page.setObjectName("templete_page") 496 | self.verticalLayout = QtWidgets.QVBoxLayout(self.templete_page) 497 | self.verticalLayout.setContentsMargins(0, 0, 0, 0) 498 | self.verticalLayout.setSpacing(0) 499 | self.verticalLayout.setObjectName("verticalLayout") 500 | self.templete_top_frame = QtWidgets.QFrame(parent=self.templete_page) 501 | self.templete_top_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) 502 | self.templete_top_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) 503 | self.templete_top_frame.setObjectName("templete_top_frame") 504 | self.gridLayout_25 = QtWidgets.QGridLayout(self.templete_top_frame) 505 | self.gridLayout_25.setObjectName("gridLayout_25") 506 | self.horizontalLayout_4 = QtWidgets.QHBoxLayout() 507 | self.horizontalLayout_4.setObjectName("horizontalLayout_4") 508 | spacerItem13 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 509 | self.horizontalLayout_4.addItem(spacerItem13) 510 | self.project_templete_btn = QtWidgets.QToolButton(parent=self.templete_top_frame) 511 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed) 512 | sizePolicy.setHorizontalStretch(0) 513 | sizePolicy.setVerticalStretch(0) 514 | sizePolicy.setHeightForWidth(self.project_templete_btn.sizePolicy().hasHeightForWidth()) 515 | self.project_templete_btn.setSizePolicy(sizePolicy) 516 | self.project_templete_btn.setMinimumSize(QtCore.QSize(0, 50)) 517 | self.project_templete_btn.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) 518 | self.project_templete_btn.setToolTip("") 519 | self.project_templete_btn.setText("") 520 | self.project_templete_btn.setObjectName("project_templete_btn") 521 | self.horizontalLayout_4.addWidget(self.project_templete_btn) 522 | self.study_templete_btn = QtWidgets.QToolButton(parent=self.templete_top_frame) 523 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed) 524 | sizePolicy.setHorizontalStretch(0) 525 | sizePolicy.setVerticalStretch(0) 526 | sizePolicy.setHeightForWidth(self.study_templete_btn.sizePolicy().hasHeightForWidth()) 527 | self.study_templete_btn.setSizePolicy(sizePolicy) 528 | self.study_templete_btn.setMinimumSize(QtCore.QSize(0, 50)) 529 | self.study_templete_btn.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) 530 | self.study_templete_btn.setToolTip("") 531 | self.study_templete_btn.setText("") 532 | self.study_templete_btn.setObjectName("study_templete_btn") 533 | self.horizontalLayout_4.addWidget(self.study_templete_btn) 534 | self.party_templete_btn = QtWidgets.QToolButton(parent=self.templete_top_frame) 535 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed) 536 | sizePolicy.setHorizontalStretch(0) 537 | sizePolicy.setVerticalStretch(0) 538 | sizePolicy.setHeightForWidth(self.party_templete_btn.sizePolicy().hasHeightForWidth()) 539 | self.party_templete_btn.setSizePolicy(sizePolicy) 540 | self.party_templete_btn.setMinimumSize(QtCore.QSize(0, 50)) 541 | self.party_templete_btn.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) 542 | self.party_templete_btn.setToolTip("") 543 | self.party_templete_btn.setText("") 544 | self.party_templete_btn.setObjectName("party_templete_btn") 545 | self.horizontalLayout_4.addWidget(self.party_templete_btn) 546 | self.contact_templete_btn = QtWidgets.QToolButton(parent=self.templete_top_frame) 547 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed) 548 | sizePolicy.setHorizontalStretch(0) 549 | sizePolicy.setVerticalStretch(0) 550 | sizePolicy.setHeightForWidth(self.contact_templete_btn.sizePolicy().hasHeightForWidth()) 551 | self.contact_templete_btn.setSizePolicy(sizePolicy) 552 | self.contact_templete_btn.setMinimumSize(QtCore.QSize(0, 50)) 553 | self.contact_templete_btn.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.PointingHandCursor)) 554 | self.contact_templete_btn.setToolTip("") 555 | self.contact_templete_btn.setText("") 556 | self.contact_templete_btn.setObjectName("contact_templete_btn") 557 | self.horizontalLayout_4.addWidget(self.contact_templete_btn) 558 | spacerItem14 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 559 | self.horizontalLayout_4.addItem(spacerItem14) 560 | self.gridLayout_25.addLayout(self.horizontalLayout_4, 0, 0, 1, 1) 561 | self.verticalLayout.addWidget(self.templete_top_frame) 562 | self.templete_bottom_frame = QtWidgets.QFrame(parent=self.templete_page) 563 | self.templete_bottom_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) 564 | self.templete_bottom_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) 565 | self.templete_bottom_frame.setObjectName("templete_bottom_frame") 566 | self.gridLayout_24 = QtWidgets.QGridLayout(self.templete_bottom_frame) 567 | self.gridLayout_24.setContentsMargins(0, 0, 0, 0) 568 | self.gridLayout_24.setSpacing(0) 569 | self.gridLayout_24.setObjectName("gridLayout_24") 570 | self.templete_splitter = QtWidgets.QSplitter(parent=self.templete_bottom_frame) 571 | self.templete_splitter.setOrientation(QtCore.Qt.Orientation.Horizontal) 572 | self.templete_splitter.setHandleWidth(0) 573 | self.templete_splitter.setObjectName("templete_splitter") 574 | self.type_list_frame = QtWidgets.QFrame(parent=self.templete_splitter) 575 | self.type_list_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) 576 | self.type_list_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) 577 | self.type_list_frame.setObjectName("type_list_frame") 578 | self.gridLayout_28 = QtWidgets.QGridLayout(self.type_list_frame) 579 | self.gridLayout_28.setContentsMargins(15, 15, 15, 15) 580 | self.gridLayout_28.setSpacing(0) 581 | self.gridLayout_28.setObjectName("gridLayout_28") 582 | self.gridLayout_27 = QtWidgets.QGridLayout() 583 | self.gridLayout_27.setContentsMargins(0, 0, 0, 0) 584 | self.gridLayout_27.setSpacing(0) 585 | self.gridLayout_27.setObjectName("gridLayout_27") 586 | self.gridLayout_30 = QtWidgets.QGridLayout() 587 | self.gridLayout_30.setContentsMargins(-1, -1, 30, 20) 588 | self.gridLayout_30.setSpacing(18) 589 | self.gridLayout_30.setObjectName("gridLayout_30") 590 | self.type_list_delete_btn = QtWidgets.QToolButton(parent=self.type_list_frame) 591 | self.type_list_delete_btn.setText("") 592 | self.type_list_delete_btn.setObjectName("type_list_delete_btn") 593 | self.gridLayout_30.addWidget(self.type_list_delete_btn, 2, 1, 1, 1) 594 | spacerItem15 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) 595 | self.gridLayout_30.addItem(spacerItem15, 0, 1, 1, 1) 596 | spacerItem16 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 597 | self.gridLayout_30.addItem(spacerItem16, 2, 0, 1, 1) 598 | self.type_list_add_btn = QtWidgets.QToolButton(parent=self.type_list_frame) 599 | self.type_list_add_btn.setText("") 600 | self.type_list_add_btn.setObjectName("type_list_add_btn") 601 | self.gridLayout_30.addWidget(self.type_list_add_btn, 1, 1, 1, 1) 602 | self.type_list_edit_btn = QtWidgets.QToolButton(parent=self.type_list_frame) 603 | self.type_list_edit_btn.setText("") 604 | self.type_list_edit_btn.setObjectName("type_list_edit_btn") 605 | self.gridLayout_30.addWidget(self.type_list_edit_btn, 3, 1, 1, 1) 606 | self.gridLayout_27.addLayout(self.gridLayout_30, 1, 1, 1, 1) 607 | self.type_list_view = QtWidgets.QTableWidget(parent=self.type_list_frame) 608 | font = QtGui.QFont() 609 | font.setPointSize(13) 610 | self.type_list_view.setFont(font) 611 | self.type_list_view.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) 612 | self.type_list_view.setColumnCount(1) 613 | self.type_list_view.setObjectName("type_list_view") 614 | self.type_list_view.setRowCount(0) 615 | self.type_list_view.horizontalHeader().setVisible(False) 616 | self.type_list_view.verticalHeader().setVisible(False) 617 | self.gridLayout_27.addWidget(self.type_list_view, 0, 0, 2, 2) 618 | self.gridLayout_28.addLayout(self.gridLayout_27, 0, 0, 1, 1) 619 | self.item_list_frame = QtWidgets.QFrame(parent=self.templete_splitter) 620 | self.item_list_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) 621 | self.item_list_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) 622 | self.item_list_frame.setObjectName("item_list_frame") 623 | self.gridLayout_26 = QtWidgets.QGridLayout(self.item_list_frame) 624 | self.gridLayout_26.setContentsMargins(15, 15, 15, 15) 625 | self.gridLayout_26.setSpacing(0) 626 | self.gridLayout_26.setObjectName("gridLayout_26") 627 | self.gridLayout_13 = QtWidgets.QGridLayout() 628 | self.gridLayout_13.setSpacing(0) 629 | self.gridLayout_13.setObjectName("gridLayout_13") 630 | self.item_list_view = QtWidgets.QTableWidget(parent=self.item_list_frame) 631 | self.item_list_view.setMinimumSize(QtCore.QSize(0, 0)) 632 | font = QtGui.QFont() 633 | font.setPointSize(12) 634 | self.item_list_view.setFont(font) 635 | self.item_list_view.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) 636 | self.item_list_view.setShowGrid(True) 637 | self.item_list_view.setGridStyle(QtCore.Qt.PenStyle.DotLine) 638 | self.item_list_view.setRowCount(0) 639 | self.item_list_view.setColumnCount(2) 640 | self.item_list_view.setObjectName("item_list_view") 641 | self.item_list_view.horizontalHeader().setVisible(False) 642 | self.item_list_view.verticalHeader().setVisible(True) 643 | self.item_list_view.verticalHeader().setDefaultSectionSize(25) 644 | self.item_list_view.verticalHeader().setMinimumSectionSize(18) 645 | self.gridLayout_13.addWidget(self.item_list_view, 0, 0, 2, 2) 646 | self.gridLayout_31 = QtWidgets.QGridLayout() 647 | self.gridLayout_31.setContentsMargins(-1, -1, 30, 20) 648 | self.gridLayout_31.setSpacing(18) 649 | self.gridLayout_31.setObjectName("gridLayout_31") 650 | spacerItem17 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) 651 | self.gridLayout_31.addItem(spacerItem17, 0, 1, 1, 1) 652 | spacerItem18 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 653 | self.gridLayout_31.addItem(spacerItem18, 2, 0, 1, 1) 654 | self.item_list_delete_btn = QtWidgets.QToolButton(parent=self.item_list_frame) 655 | self.item_list_delete_btn.setText("") 656 | self.item_list_delete_btn.setObjectName("item_list_delete_btn") 657 | self.gridLayout_31.addWidget(self.item_list_delete_btn, 2, 1, 1, 1) 658 | self.item_list_add_btn = QtWidgets.QToolButton(parent=self.item_list_frame) 659 | self.item_list_add_btn.setText("") 660 | self.item_list_add_btn.setObjectName("item_list_add_btn") 661 | self.gridLayout_31.addWidget(self.item_list_add_btn, 1, 1, 1, 1) 662 | self.item_list_edit_btn = QtWidgets.QToolButton(parent=self.item_list_frame) 663 | self.item_list_edit_btn.setText("") 664 | self.item_list_edit_btn.setObjectName("item_list_edit_btn") 665 | self.gridLayout_31.addWidget(self.item_list_edit_btn, 3, 1, 1, 1) 666 | self.item_list_up_down_btn = QtWidgets.QToolButton(parent=self.item_list_frame) 667 | self.item_list_up_down_btn.setText("") 668 | self.item_list_up_down_btn.setObjectName("item_list_up_down_btn") 669 | self.gridLayout_31.addWidget(self.item_list_up_down_btn, 4, 1, 1, 1) 670 | self.gridLayout_13.addLayout(self.gridLayout_31, 1, 1, 1, 1) 671 | self.gridLayout_26.addLayout(self.gridLayout_13, 0, 0, 1, 1) 672 | self.item_list_view.raise_() 673 | self.gridLayout_24.addWidget(self.templete_splitter, 0, 0, 1, 1) 674 | self.verticalLayout.addWidget(self.templete_bottom_frame) 675 | self.verticalLayout.setStretch(1, 1) 676 | self.main_stacked_widget.addWidget(self.templete_page) 677 | self.gridLayout_3.addWidget(self.main_stacked_widget, 0, 0, 1, 1) 678 | self.gridLayout_6.addWidget(self.right_frame, 0, 1, 1, 1) 679 | self.gridLayout_6.setColumnStretch(1, 1) 680 | MainWindow.setCentralWidget(self.stylesheet) 681 | self.menubar = QtWidgets.QMenuBar(parent=MainWindow) 682 | self.menubar.setGeometry(QtCore.QRect(0, 0, 845, 24)) 683 | self.menubar.setObjectName("menubar") 684 | MainWindow.setMenuBar(self.menubar) 685 | self.actionx1 = QtGui.QAction(parent=MainWindow) 686 | self.actionx1.setObjectName("actionx1") 687 | self.actionx2 = QtGui.QAction(parent=MainWindow) 688 | self.actionx2.setObjectName("actionx2") 689 | self.actionm1 = QtGui.QAction(parent=MainWindow) 690 | self.actionm1.setObjectName("actionm1") 691 | self.menu_close = QtGui.QAction(parent=MainWindow) 692 | self.menu_close.setObjectName("menu_close") 693 | self.actionS1 = QtGui.QAction(parent=MainWindow) 694 | self.actionS1.setObjectName("actionS1") 695 | self.actions2 = QtGui.QAction(parent=MainWindow) 696 | self.actions2.setObjectName("actions2") 697 | self.menu_execute = QtGui.QAction(parent=MainWindow) 698 | self.menu_execute.setObjectName("menu_execute") 699 | self.menu_init = QtGui.QAction(parent=MainWindow) 700 | self.menu_init.setObjectName("menu_init") 701 | self.menu_backup = QtGui.QAction(parent=MainWindow) 702 | self.menu_backup.setObjectName("menu_backup") 703 | self.menu_restore = QtGui.QAction(parent=MainWindow) 704 | self.menu_restore.setObjectName("menu_restore") 705 | self.menu_types = QtGui.QAction(parent=MainWindow) 706 | self.menu_types.setObjectName("menu_types") 707 | self.menu_new_project = QtGui.QAction(parent=MainWindow) 708 | self.menu_new_project.setObjectName("menu_new_project") 709 | self.menu_new_case = QtGui.QAction(parent=MainWindow) 710 | self.menu_new_case.setObjectName("menu_new_case") 711 | self.menu_contact = QtGui.QAction(parent=MainWindow) 712 | self.menu_contact.setObjectName("menu_contact") 713 | self.menu_parties = QtGui.QAction(parent=MainWindow) 714 | self.menu_parties.setObjectName("menu_parties") 715 | self.menu_contacts = QtGui.QAction(parent=MainWindow) 716 | self.menu_contacts.setObjectName("menu_contacts") 717 | self.menu_manage_type_item = QtGui.QAction(parent=MainWindow) 718 | self.menu_manage_type_item.setObjectName("menu_manage_type_item") 719 | self.menu_manage_party_class = QtGui.QAction(parent=MainWindow) 720 | self.menu_manage_party_class.setObjectName("menu_manage_party_class") 721 | self.menu_manage_contact_class = QtGui.QAction(parent=MainWindow) 722 | self.menu_manage_contact_class.setObjectName("menu_manage_contact_class") 723 | self.menu_delete_project = QtGui.QAction(parent=MainWindow) 724 | self.menu_delete_project.setObjectName("menu_delete_project") 725 | self.menu_delete_case = QtGui.QAction(parent=MainWindow) 726 | self.menu_delete_case.setObjectName("menu_delete_case") 727 | self.menu_color_today = QtGui.QAction(parent=MainWindow) 728 | self.menu_color_today.setObjectName("menu_color_today") 729 | self.menu_color_project = QtGui.QAction(parent=MainWindow) 730 | self.menu_color_project.setObjectName("menu_color_project") 731 | self.menu_color_case = QtGui.QAction(parent=MainWindow) 732 | self.menu_color_case.setObjectName("menu_color_case") 733 | self.menu_default_filepath = QtGui.QAction(parent=MainWindow) 734 | self.menu_default_filepath.setObjectName("menu_default_filepath") 735 | self.menu_today_news = QtGui.QAction(parent=MainWindow) 736 | self.menu_today_news.setObjectName("menu_today_news") 737 | self.menu_about = QtGui.QAction(parent=MainWindow) 738 | self.menu_about.setObjectName("menu_about") 739 | 740 | self.retranslateUi(MainWindow) 741 | self.main_stacked_widget.setCurrentIndex(3) 742 | self.case_info_tab.setCurrentIndex(1) 743 | QtCore.QMetaObject.connectSlotsByName(MainWindow) 744 | 745 | def retranslateUi(self, MainWindow): 746 | _translate = QtCore.QCoreApplication.translate 747 | MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow")) 748 | self.case_info_tab.setTabText(self.case_info_tab.indexOf(self.info_tab), _translate("MainWindow", "信息")) 749 | self.todo_view.setSortingEnabled(False) 750 | self.case_info_tab.setTabText(self.case_info_tab.indexOf(self.todo_tab), _translate("MainWindow", "计划")) 751 | self.event_view.setSortingEnabled(False) 752 | self.case_info_tab.setTabText(self.case_info_tab.indexOf(self.event_tab), _translate("MainWindow", "记录")) 753 | self.case_info_tab.setTabText(self.case_info_tab.indexOf(self.note_tab), _translate("MainWindow", "记事")) 754 | self.option_table.setSortingEnabled(False) 755 | self.actionx1.setText(_translate("MainWindow", "新的项目")) 756 | self.actionx2.setText(_translate("MainWindow", "新的案件")) 757 | self.actionm1.setText(_translate("MainWindow", "模板..")) 758 | self.menu_close.setText(_translate("MainWindow", "关闭")) 759 | self.actionS1.setText(_translate("MainWindow", "删除项目")) 760 | self.actions2.setText(_translate("MainWindow", "删除案件")) 761 | self.menu_execute.setText(_translate("MainWindow", "execute..")) 762 | self.menu_init.setText(_translate("MainWindow", "初始化")) 763 | self.menu_backup.setText(_translate("MainWindow", "备份")) 764 | self.menu_restore.setText(_translate("MainWindow", "还原")) 765 | self.menu_types.setText(_translate("MainWindow", "模板..")) 766 | self.menu_new_project.setText(_translate("MainWindow", "新的项目")) 767 | self.menu_new_case.setText(_translate("MainWindow", "新的案件")) 768 | self.menu_contact.setText(_translate("MainWindow", "联系人库")) 769 | self.menu_parties.setText(_translate("MainWindow", "当事人")) 770 | self.menu_contacts.setText(_translate("MainWindow", "自然人")) 771 | self.menu_manage_type_item.setText(_translate("MainWindow", "案件类型")) 772 | self.menu_manage_party_class.setText(_translate("MainWindow", "当事人")) 773 | self.menu_manage_contact_class.setText(_translate("MainWindow", "联系人")) 774 | self.menu_delete_project.setText(_translate("MainWindow", "删除项目")) 775 | self.menu_delete_case.setText(_translate("MainWindow", "删除案件")) 776 | self.menu_color_today.setText(_translate("MainWindow", "配色-今日简报")) 777 | self.menu_color_project.setText(_translate("MainWindow", "配色-项目信息")) 778 | self.menu_color_case.setText(_translate("MainWindow", "配色-案件信息")) 779 | self.menu_default_filepath.setText(_translate("MainWindow", "默认项目文件夹")) 780 | self.menu_today_news.setText(_translate("MainWindow", "今日简报")) 781 | self.menu_about.setText(_translate("MainWindow", "关于")) 782 | -------------------------------------------------------------------------------- /MCLib_icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoodTheme/MyCaseLib/80e99e054db8798a2ad9672564f4f8829279a925/MCLib_icon.icns -------------------------------------------------------------------------------- /MCLib_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoodTheme/MyCaseLib/80e99e054db8798a2ad9672564f4f8829279a925/MCLib_icon.ico -------------------------------------------------------------------------------- /MCLib_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoodTheme/MyCaseLib/80e99e054db8798a2ad9672564f4f8829279a925/MCLib_icon.png -------------------------------------------------------------------------------- /MCLib_icon_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoodTheme/MyCaseLib/80e99e054db8798a2ad9672564f4f8829279a925/MCLib_icon_transparent.png -------------------------------------------------------------------------------- /MCLib_widgets.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from PyQt6.QtGui import * 3 | from PyQt6.QtWidgets import * 4 | from PyQt6.QtCore import * 5 | from MCLib_widgets_UI import * 6 | from functools import partial, reduce 7 | import qtawesome 8 | 9 | class ui_execute(QDialog, Ui_execute_window): 10 | close_signal = pyqtSignal() 11 | def __init__(self, DB, parent = None): 12 | super(ui_execute, self).__init__(parent) 13 | self.setupUi(self) 14 | self.DB = DB 15 | self.execute_btn.clicked.connect(self.show_execute_result) 16 | 17 | def show_execute_result(self): 18 | s = self.execute_line.text() 19 | result = self.DB.execute(s) 20 | self.execute_result.clear() 21 | for t in result: 22 | self.execute_result.append(str(result)) 23 | 24 | def reject(self): 25 | self.close() 26 | 27 | def closeEvent(self, event): 28 | self.close_signal.emit() 29 | 30 | class ui_edit_case_persons(QDialog, Ui_edit_case_persons_window): 31 | close_signal = pyqtSignal() 32 | def __init__(self, DB, which_type, case, item, color1, color2, color3, parent = None, flag = False): 33 | super(ui_edit_case_persons, self).__init__(parent) 34 | self.setupUi(self) 35 | self.DB = DB 36 | self.which_type = which_type 37 | self.which_type_c = '当事人' if which_type == 'party' else '联系人' 38 | self.case = case 39 | self.item = item 40 | self.headers = ['id', '当事人地位', '名称'] if self.which_type == 'party' else ['id', '身份', '名字'] 41 | self.setWindowTitle(self.item) 42 | self.color1 = color1 43 | self.color2 = color2 44 | self.color3 = color3 45 | 46 | self.setStyleSheet(""" 47 | QWidget { 48 | background-color: %s; 49 | } 50 | QTableWidget { 51 | border: 1px solid rgb(190, 190, 190); 52 | border-radius: 10px; 53 | background-color: %s; 54 | } 55 | QToolButton { 56 | background: qlineargradient(x1:0, y1:0, x2:1, y2:1, 57 | stop:0 rgb(233, 233, 233), stop:0.5 transparent); 58 | border: 1px solid rgb(190, 190, 190); 59 | border-radius: 15px; 60 | border-style: outset; 61 | } 62 | QTableWidget QHeaderView { 63 | border: 1px solid rgb(100, 100, 100); 64 | background-color: %s; 65 | } 66 | QToolButton::menu-indicator { 67 | image: none; 68 | } 69 | """ % (self.color1, self.color2, self.color3)) 70 | 71 | def set_btn_icon(btn, icon, tooltip = ""): 72 | btn.setIconSize(QSize(28, 28)) 73 | btn.setIcon(qtawesome.icon(icon, color = ('black', 160))) 74 | btn.setToolTip(tooltip) 75 | btn.raise_() 76 | 77 | set_btn_icon(self.add_btn, 'msc.add', "添加") 78 | self.add_btn.clicked.connect(self.add_person) 79 | 80 | set_btn_icon(self.delete_btn, 'mdi.minus', "删除") 81 | self.delete_btn.setPopupMode(QToolButton.InstantPopup) 82 | newMenu = QMenu(self.persons_view) 83 | newAction = QAction("删除该项", self) 84 | newAction.triggered.connect(self.delete_person) 85 | newMenu.addAction(newAction) 86 | self.delete_btn.setMenu(newMenu) 87 | 88 | set_btn_icon(self.up_down_btn, 'ph.arrows-down-up-light', "移动") 89 | self.up_down_btn.setPopupMode(QToolButton.InstantPopup) 90 | newMenu = QMenu(self.persons_view) 91 | newAction = QAction("上移", self) 92 | newAction.triggered.connect(self.item_move_up) 93 | newMenu.addAction(newAction) 94 | newAction = QAction("下移", self) 95 | newAction.triggered.connect(self.item_move_down) 96 | newMenu.addAction(newAction) 97 | self.up_down_btn.setMenu(newMenu) 98 | 99 | if flag: 100 | self.close_btn.hide() 101 | else: 102 | self.close_btn.setText("继续..") 103 | self.close_btn.setStyleSheet(""" 104 | font: 14pt; 105 | border: 1px solid rgb(190, 190, 190); 106 | border-radius: 5px; 107 | background-color: none; 108 | """) 109 | self.close_btn.clicked.connect(self.close) 110 | 111 | self.persons_view.setSelectionBehavior(QTableWidget.SelectionBehavior.SelectRows) 112 | self.persons_view.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeMode.Stretch) 113 | self.persons_view.setHorizontalHeaderLabels(self.headers) 114 | self.persons_view.setColumnHidden(0, True) 115 | self.persons_view_refresh() 116 | 117 | def get_name(self, pid): 118 | return self.DB.select(f"{self.which_type}_info", 'value', f"{self.which_type}_id", pid)[0]['value'] 119 | 120 | def persons_view_refresh(self): 121 | def trans(s): 122 | if not s: 123 | return '' 124 | trans = '' 125 | for t in str(s): 126 | trans = trans + t if t != "'" else trans + "''" 127 | return trans 128 | 129 | self.persons_view.setRowCount(0) 130 | values = self.DB.select_multi_condition('case_info', 'id, value, value2', f"case_name = '{trans(self.case)}'"\ 131 | f"and item = '{trans(self.item)}'") 132 | for k in values: 133 | rows = self.persons_view.rowCount() 134 | self.persons_view.insertRow(rows) 135 | self.persons_view.setItem(rows, 0, QTableWidgetItem(str(k['id']))) 136 | self.persons_view.setItem(rows, 1, QTableWidgetItem(k['value'])) 137 | self.persons_view.setItem(rows, 2, QTableWidgetItem(self.get_name(k['value2']))) 138 | 139 | def add_person(self): 140 | value, flag = QInputDialog.getText(self, self.headers[1], f"该{self.which_type_c}在本案中的身份/地位:") 141 | if flag: 142 | self.window_person = ui_persons(DB = self.DB, which_type = self.which_type, \ 143 | color1 = self.color1, color2 = self.color2, color3 = self.color3, parent = self) 144 | chosen_id = self.window_person.exec() 145 | if chosen_id > 0: 146 | self.DB.insert_value(self.case, self.item, self.which_type, value, chosen_id) 147 | self.setResult(1) 148 | self.persons_view_refresh() 149 | 150 | def delete_person(self): 151 | if self.persons_view.selectedItems(): 152 | pid = self.persons_view.item(self.persons_view.currentRow(), 0).text() 153 | self.DB.delete('case_info', 'id', pid) 154 | self.persons_view_refresh() 155 | 156 | def item_move_up(self): 157 | if self.persons_view.selectedItems(): 158 | c_row = self.persons_view.currentRow() 159 | if c_row > 0: 160 | c_id = self.persons_view.item(c_row, 0).text() 161 | up_id = self.persons_view.item(c_row - 1, 0).text() 162 | self.DB.swap('case_info', 'value', c_id, up_id) 163 | self.DB.swap('case_info', 'value2', c_id, up_id) 164 | self.persons_view_refresh() 165 | 166 | def item_move_down(self): 167 | if self.persons_view.selectedItems(): 168 | c_row = self.persons_view.currentRow() 169 | rows = self.persons_view.rowCount() 170 | if c_row + 1 < rows: 171 | c_id = self.persons_view.item(c_row, 0).text() 172 | down_id = self.persons_view.item(c_row + 1, 0).text() 173 | self.DB.swap('case_info', 'value', c_id, down_id) 174 | self.DB.swap('case_info', 'value2', c_id, down_id) 175 | self.persons_view_refresh() 176 | 177 | def reject(self): 178 | self.close() 179 | 180 | def closeEvent(self, event): 181 | self.close_signal.emit() 182 | 183 | class ui_persons(QDialog, Ui_persons_window): 184 | close_signal = pyqtSignal() 185 | def __init__(self, DB, which_type, color1, color2, color3, parent = None): 186 | super(ui_persons, self).__init__(parent) 187 | self.setupUi(self) 188 | self.DB = DB 189 | self.which_type = which_type 190 | self.which_type_c = '当事人' if which_type == 'party' else '联系人' 191 | self.chosen_id = -1 192 | 193 | self.setStyleSheet(""" 194 | Qwidget { 195 | background-color: %s; 196 | } 197 | #search_bar { 198 | border: 1px solid rgb(223, 223, 223); 199 | } 200 | QTableWidget { 201 | border: 1px solid rgb(190, 190, 190); 202 | border-radius: 10px; 203 | background-color: %s; 204 | } 205 | QTableWidget QHeaderView { 206 | border: 1px solid rgb(100, 100, 100); 207 | background-color: %s; 208 | } 209 | #add_btn { 210 | background: qlineargradient(x1:0, y1:0, x2:1, y2:1, 211 | stop:0 rgb(233, 233, 233), stop:0.5 transparent); 212 | border: 1px solid rgb(190, 190, 190); 213 | border-radius: 15px; 214 | border-style: outset; 215 | } 216 | #add_btn::menu-indicator { 217 | image: none; 218 | } 219 | #choose_btn { 220 | font: 14pt; 221 | border: 1px solid rgb(190, 190, 190); 222 | border-radius: 5px; 223 | background-color: none; 224 | } 225 | """ % (color1, color2, color3)) 226 | 227 | newAction = QAction(self.search_bar) 228 | newAction.setIcon(qtawesome.icon('fa.search')) 229 | self.search_bar.addAction(newAction, QLineEdit.LeadingPosition) 230 | self.search_bar.textChanged.connect(self.results_view_refresh) 231 | 232 | self.add_btn.setIconSize(QSize(28, 28)) 233 | self.add_btn.setIcon(qtawesome.icon('msc.add', color = ('black', 160))) 234 | self.add_btn.setToolTip("添加") 235 | self.add_btn.clicked.connect(self.add_person) 236 | 237 | self.splitter.setStretchFactor(0, 2) 238 | self.splitter.setStretchFactor(1, 3) 239 | 240 | self.results_view.itemSelectionChanged.connect(self.infos_view_refresh) 241 | self.infos_view.cellChanged.connect(self.edit_info) 242 | self.results_view_refresh() 243 | self.infos_view_refresh() 244 | self.view_menu_init() 245 | self.results_view.customContextMenuRequested.connect(partial(self.view_showmenu, self.results_menu)) 246 | self.infos_view.customContextMenuRequested.connect(partial(self.view_showmenu, self.infos_menu)) 247 | 248 | self.results_view.itemDoubleClicked.connect(self.choose_it) 249 | self.choose_btn.clicked.connect(self.choose_it) 250 | self.setWindowTitle(f"双击选择一名{self.which_type_c}..") 251 | 252 | def results_view_refresh(self): 253 | self.search_bar.textChanged.disconnect() 254 | self.results_view.setRowCount(0) 255 | self.results_view.setColumnHidden(0, True) 256 | self.results_view.horizontalHeader().setSectionResizeMode(1, QHeaderView.ResizeMode.Stretch) 257 | 258 | keywords = self.search_bar.text() 259 | if keywords: 260 | all_items = self.DB.select_all(f"{self.which_type}_info") 261 | items = [] 262 | for item in all_items: 263 | if isinstance(item['value'], str) and item['value'].find(keywords) != -1: 264 | pid = item[f"{self.which_type}_id"] 265 | item_name = self.DB.select(f"{self.which_type}_list", 'name', 'id', pid)[0]['name'] 266 | new_item = {'id': pid, 'name': item_name} 267 | if new_item not in items: 268 | items.append(new_item) 269 | items_sorted = sorted(items, key = lambda x:(x['id']), reverse = True) 270 | else: 271 | items_sorted = sorted(self.DB.select_all(f"{self.which_type}_list"), key = lambda x:(x['id']), reverse = True) 272 | 273 | for k in items_sorted: 274 | rows = self.results_view.rowCount() 275 | self.results_view.insertRow(rows) 276 | self.results_view.setItem(rows, 0, QTableWidgetItem(str(k['id']))) 277 | self.results_view.setItem(rows, 1, QTableWidgetItem(k['name'])) 278 | 279 | self.search_bar.textChanged.connect(self.results_view_refresh) 280 | 281 | def infos_view_refresh(self): 282 | self.infos_view.setRowCount(0) 283 | self.infos_view.setColumnHidden(0, True) 284 | self.infos_view.horizontalHeader().setSectionResizeMode(1, QHeaderView.ResizeMode.Stretch) 285 | if self.results_view.selectedItems(): 286 | c_row = self.results_view.currentRow() 287 | current_pid = self.results_view.item(c_row, 0).text() 288 | current_class = self.DB.select(f"{self.which_type}_list", 'class', 'id', current_pid)[0]['class'] 289 | item_list = self.DB.select(f"{self.which_type}_class", 'item', 'class', current_class) 290 | 291 | self.infos_view.setRowCount(len(item_list)) 292 | self.infos_view.setVerticalHeaderLabels([x['item'] for x in item_list]) 293 | self.infos_view.verticalHeader().setMinimumWidth(120) 294 | all_values = self.DB.select(f"{self.which_type}_info", 'id, item, value', f"{self.which_type}_id", current_pid) 295 | 296 | i = 0 297 | for item in item_list: 298 | for s in all_values: 299 | if s['item'] == item['item']: 300 | self.infos_view.setItem(i, 0, QTableWidgetItem(str(s['id']))) 301 | self.infos_view.setItem(i, 1, QTableWidgetItem(s['value'])) 302 | break 303 | i = i + 1 304 | 305 | def add_person(self): 306 | self.results_view.itemSelectionChanged.disconnect() 307 | class_list = self.DB.select(f"{self.which_type}_class", 'class') 308 | class_list_uni = [x['class'] for x in reduce(lambda x, y: x if y in x else x + [y], [[]] + class_list)] 309 | which_class, flag = QInputDialog.getItem(self, self.which_type_c, f"请选择{self.which_type_c}类别", 310 | class_list_uni, 0, False) 311 | if flag: 312 | name, flag2 = QInputDialog.getText(self, f"新的{self.which_type_c}", 313 | f"请输入该{self.which_type_c}的名字:") 314 | if flag2: 315 | self.DB.new_person(self.which_type, which_class, name) 316 | self.results_view_refresh() 317 | self.results_view.itemSelectionChanged.connect(self.infos_view_refresh) 318 | 319 | def delete_person(self): 320 | if self.results_view.selectedItems(): 321 | c_row = self.results_view.currentRow() 322 | pid = self.results_view.item(c_row, 0).text() 323 | self.DB.delete_person(self.which_type, pid) 324 | self.results_view_refresh() 325 | 326 | def edit_info(self, row_n, col_n): 327 | self.infos_view.cellChanged.disconnect() 328 | if self.infos_view.selectedItems(): 329 | pid = self.infos_view.item(row_n, 0).text() 330 | new_data = self.infos_view.item(row_n, 1).text() 331 | self.DB.update(f"{self.which_type}_info", 'id', pid, 'value', new_data) 332 | self.infos_view_refresh() 333 | if row_n == 0: 334 | self.results_view.itemSelectionChanged.disconnect() 335 | list_pid = self.results_view.item(self.results_view.currentRow(), 0).text() 336 | self.DB.update(f"{self.which_type}_list", 'id', list_pid, 'name', new_data) 337 | self.results_view_refresh() 338 | self.infos_view_refresh() 339 | self.results_view.itemSelectionChanged.connect(self.infos_view_refresh) 340 | self.infos_view.cellChanged.connect(self.edit_info) 341 | 342 | def view_showmenu(self, menu): 343 | menu.move(QCursor().pos()) 344 | menu.show() 345 | 346 | def view_menu_init(self): 347 | self.results_menu = QMenu(self.results_view) 348 | newAction = QAction('复制详情', self) 349 | newAction.triggered.connect(self.info_show) 350 | self.results_menu.addAction(newAction) 351 | newAction = QAction('删除', self) 352 | newAction.triggered.connect(self.delete_person) 353 | self.results_menu.addAction(newAction) 354 | 355 | self.infos_menu = QMenu(self.results_view) 356 | newAction = QAction('复制详情', self) 357 | newAction.triggered.connect(self.info_show) 358 | self.infos_menu.addAction(newAction) 359 | 360 | def info_show(self): 361 | if self.results_view.selectedItems(): 362 | c_row = self.results_view.currentRow() 363 | pid = self.results_view.item(c_row, 0).text() 364 | infos = self.DB.select(f"{self.which_type}_info", "item, value", f"{self.which_type}_id", pid) 365 | s = '' 366 | for x in infos: 367 | if x['value']: 368 | s = s + f"{x['item']}:{x['value']}\n" 369 | QMessageBox.about(self, infos[0]['value'], s) 370 | QApplication.clipboard().setText(s) 371 | 372 | def choose_it(self): 373 | if self.results_view.selectedItems(): 374 | self.setResult(int(self.results_view.item(self.results_view.currentRow(), 0).text())) 375 | self.close() 376 | 377 | def reject(self): 378 | self.close() 379 | 380 | def closeEvent(self, event): 381 | self.close_signal.emit() 382 | 383 | class ui_today_news(QDialog, Ui_today_news_window): 384 | close_signal = pyqtSignal() 385 | def __init__(self, DB, color0, color1, color2, color3, parent = None): 386 | super(ui_today_news, self).__init__(parent) 387 | self.setupUi(self) 388 | self.setStyleSheet(f'background-color: {color0};') 389 | self.message_view.setStyleSheet(f'background-color: {color0};') 390 | self.message_view.setHtml(DB.generate_report_html(color1, color2, color3)) 391 | 392 | def reject(self): 393 | self.close() 394 | 395 | def closeEvent(self, event): 396 | self.close_signal.emit() 397 | 398 | class ui_person_info(QDialog, Ui_person_info_window): 399 | close_signal = pyqtSignal() 400 | def __init__(self, DB, which_type, which_class, pid, parent = None): 401 | super(ui_person_info, self).__init__(parent) 402 | self.setupUi(self) 403 | self.DB = DB 404 | self.which_type = which_type 405 | self.which_class = which_class 406 | self.pid = pid 407 | 408 | name = self.DB.select(f"{self.which_type}_info", 'value', f"{self.which_type}_id", self.pid)[0]['value'] 409 | self.setWindowTitle(name) 410 | self.infos_view.cellChanged.connect(self.edit_info) 411 | self.infos_view_refresh() 412 | 413 | def infos_view_refresh(self): 414 | self.infos_view.setRowCount(0) 415 | self.infos_view.setColumnHidden(0, True) 416 | self.infos_view.setColumnHidden(2, True) 417 | self.infos_view.horizontalHeader().setSectionResizeMode(1, QHeaderView.ResizeMode.Stretch) 418 | 419 | current_pid = self.pid 420 | current_class = self.which_class 421 | item_list = self.DB.select(f"{self.which_type}_class", 'item', 'class', current_class) 422 | 423 | self.infos_view.setRowCount(len(item_list)) 424 | self.infos_view.setVerticalHeaderLabels([x['item'] for x in item_list]) 425 | self.infos_view.verticalHeader().setMinimumWidth(120) 426 | all_values = self.DB.select(f"{self.which_type}_info", f"id, item, value, {self.which_type}_id", f"{self.which_type}_id", current_pid) 427 | 428 | i = 0 429 | for item in item_list: 430 | for s in all_values: 431 | if s['item'] == item['item']: 432 | self.infos_view.setItem(i, 0, QTableWidgetItem(str(s['id']))) 433 | self.infos_view.setItem(i, 1, QTableWidgetItem(s['value'])) 434 | self.infos_view.setItem(i, 2, QTableWidgetItem(str(s[f"{self.which_type}_id"]))) 435 | break 436 | i = i + 1 437 | 438 | def edit_info(self, row_n, col_n): 439 | self.infos_view.cellChanged.disconnect() 440 | if self.infos_view.selectedItems(): 441 | new_data = self.infos_view.item(row_n, 1).text() 442 | pid = self.infos_view.item(row_n, 0).text() 443 | self.DB.update(f"{self.which_type}_info", 'id', pid, 'value', new_data) 444 | if row_n == 0: 445 | list_pid = self.infos_view.item(row_n, 2).text() 446 | self.DB.update(f"{self.which_type}_list", 'id', list_pid, 'name', new_data) 447 | self.infos_view_refresh() 448 | self.infos_view.cellChanged.connect(self.edit_info) 449 | 450 | def reject(self): 451 | self.close() 452 | 453 | def closeEvent(self, event): 454 | self.close_signal.emit() 455 | 456 | class ui_case_info_edit(QDialog, Ui_person_info_window): 457 | close_signal = pyqtSignal() 458 | def __init__(self, DB, case_name, parent = None): 459 | super(ui_case_info_edit, self).__init__(parent) 460 | self.setupUi(self) 461 | self.DB = DB 462 | self.case_name = case_name 463 | self.type_name = self.DB.select('case_list', 'case_type', 'case_name', self.case_name)[0]['case_type'] 464 | 465 | self.setWindowTitle(case_name) 466 | self.infos_view.cellChanged.connect(self.edit_info) 467 | self.infos_view_refresh() 468 | 469 | def trans(self, s): 470 | if not s: 471 | return '' 472 | trans = '' 473 | for t in str(s): 474 | trans = trans + t if t != "'" else trans + "''" 475 | return trans 476 | 477 | def infos_view_refresh(self): 478 | self.infos_view.setRowCount(0) 479 | self.infos_view.setColumnHidden(0, True) 480 | self.infos_view.setColumnHidden(2, True) 481 | self.infos_view.horizontalHeader().setSectionResizeMode(1, QHeaderView.ResizeMode.Stretch) 482 | item_list = self.DB.select_multi_condition('case_type', 'item', 483 | f"type_name = '{self.trans(self.type_name)}' and item_form = 'text'") 484 | 485 | self.infos_view.setRowCount(len(item_list)) 486 | self.infos_view.setVerticalHeaderLabels([x['item'] for x in item_list]) 487 | self.infos_view.verticalHeader().setMinimumWidth(120) 488 | all_values = self.DB.select('case_info', 'id, item, value', 'case_name', self.case_name) 489 | 490 | i = 0 491 | for item in item_list: 492 | self.infos_view.setItem(i, 0, QTableWidgetItem(item['item'])) 493 | for s in all_values: 494 | if s['item'] == item['item']: 495 | self.infos_view.setItem(i, 1, QTableWidgetItem(s['value'])) 496 | break 497 | i = i + 1 498 | 499 | def edit_info(self, row_n, col_n): 500 | self.infos_view.cellChanged.disconnect() 501 | if self.infos_view.selectedItems(): 502 | item = self.infos_view.item(row_n, 0).text() 503 | new_data = self.infos_view.item(row_n, 1).text() 504 | current = self.DB.select_multi_condition('case_info', 'value', 505 | f"case_name = '{self.trans(self.case_name)}' and item = '{self.trans(item)}'") 506 | if current: 507 | self.DB.update_multi_condition('case_info', f"case_name = '{self.trans(self.case_name)}' and "\ 508 | f"item = '{self.trans(item)}'", 'value', new_data) 509 | else: 510 | self.DB.insert_value(self.case_name, item, 'text', new_data) 511 | self.infos_view_refresh() 512 | self.infos_view.cellChanged.connect(self.edit_info) 513 | 514 | def reject(self): 515 | self.close() 516 | 517 | def closeEvent(self, event): 518 | self.close_signal.emit() 519 | 520 | -------------------------------------------------------------------------------- /MCLib_widgets_UI.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from PyQt6 import QtCore, QtGui, QtWidgets 3 | 4 | class Ui_execute_window(object): 5 | def setupUi(self, execute_window): 6 | execute_window.setObjectName("execute_window") 7 | execute_window.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal) 8 | execute_window.resize(400, 300) 9 | execute_window.setMinimumSize(QtCore.QSize(400, 300)) 10 | self.verticalLayout_2 = QtWidgets.QVBoxLayout(execute_window) 11 | self.verticalLayout_2.setObjectName("verticalLayout_2") 12 | self.verticalLayout = QtWidgets.QVBoxLayout() 13 | self.verticalLayout.setContentsMargins(10, 10, 10, 10) 14 | self.verticalLayout.setObjectName("verticalLayout") 15 | self.horizontalLayout = QtWidgets.QHBoxLayout() 16 | self.horizontalLayout.setSpacing(20) 17 | self.horizontalLayout.setObjectName("horizontalLayout") 18 | self.execute_line = QtWidgets.QLineEdit(execute_window) 19 | self.execute_line.setObjectName("execute_line") 20 | self.horizontalLayout.addWidget(self.execute_line) 21 | self.execute_btn = QtWidgets.QPushButton(execute_window) 22 | self.execute_btn.setObjectName("execute_btn") 23 | self.horizontalLayout.addWidget(self.execute_btn) 24 | self.verticalLayout.addLayout(self.horizontalLayout) 25 | self.execute_result = QtWidgets.QTextBrowser(execute_window) 26 | self.execute_result.setObjectName("execute_result") 27 | self.verticalLayout.addWidget(self.execute_result) 28 | self.verticalLayout_2.addLayout(self.verticalLayout) 29 | 30 | self.retranslateUi(execute_window) 31 | QtCore.QMetaObject.connectSlotsByName(execute_window) 32 | 33 | def retranslateUi(self, execute_window): 34 | _translate = QtCore.QCoreApplication.translate 35 | execute_window.setWindowTitle(_translate("execute_window", "Execute..")) 36 | self.execute_btn.setText(_translate("execute_window", "execute")) 37 | 38 | class Ui_edit_case_persons_window(object): 39 | def setupUi(self, edit_case_persons_window): 40 | edit_case_persons_window.setObjectName("edit_case_persons_window") 41 | edit_case_persons_window.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal) 42 | edit_case_persons_window.resize(349, 393) 43 | edit_case_persons_window.setMinimumSize(QtCore.QSize(250, 300)) 44 | self.gridLayout_3 = QtWidgets.QGridLayout(edit_case_persons_window) 45 | self.gridLayout_3.setContentsMargins(12, 12, 12, 12) 46 | self.gridLayout_3.setHorizontalSpacing(0) 47 | self.gridLayout_3.setVerticalSpacing(5) 48 | self.gridLayout_3.setObjectName("gridLayout_3") 49 | self.gridLayout_2 = QtWidgets.QGridLayout() 50 | self.gridLayout_2.setSpacing(0) 51 | self.gridLayout_2.setObjectName("gridLayout_2") 52 | self.gridLayout = QtWidgets.QGridLayout() 53 | self.gridLayout.setContentsMargins(-1, -1, 0, 12) 54 | self.gridLayout.setHorizontalSpacing(9) 55 | self.gridLayout.setVerticalSpacing(0) 56 | self.gridLayout.setObjectName("gridLayout") 57 | self.add_btn = QtWidgets.QToolButton(parent=edit_case_persons_window) 58 | self.add_btn.setText("") 59 | self.add_btn.setObjectName("add_btn") 60 | self.gridLayout.addWidget(self.add_btn, 1, 1, 1, 1) 61 | self.delete_btn = QtWidgets.QToolButton(parent=edit_case_persons_window) 62 | self.delete_btn.setText("") 63 | self.delete_btn.setObjectName("delete_btn") 64 | self.gridLayout.addWidget(self.delete_btn, 1, 2, 1, 1) 65 | spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 66 | self.gridLayout.addItem(spacerItem, 1, 0, 1, 1) 67 | spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) 68 | self.gridLayout.addItem(spacerItem1, 0, 2, 1, 1) 69 | spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 70 | self.gridLayout.addItem(spacerItem2, 1, 5, 1, 1) 71 | self.up_down_btn = QtWidgets.QToolButton(parent=edit_case_persons_window) 72 | self.up_down_btn.setText("") 73 | self.up_down_btn.setObjectName("up_down_btn") 74 | self.gridLayout.addWidget(self.up_down_btn, 1, 3, 1, 1) 75 | self.gridLayout_2.addLayout(self.gridLayout, 1, 1, 1, 1) 76 | self.persons_view = QtWidgets.QTableWidget(parent=edit_case_persons_window) 77 | self.persons_view.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu) 78 | self.persons_view.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) 79 | self.persons_view.setColumnCount(3) 80 | self.persons_view.setObjectName("persons_view") 81 | self.persons_view.setRowCount(0) 82 | self.persons_view.horizontalHeader().setVisible(True) 83 | self.persons_view.horizontalHeader().setCascadingSectionResizes(False) 84 | self.persons_view.verticalHeader().setVisible(False) 85 | self.gridLayout_2.addWidget(self.persons_view, 0, 0, 2, 2) 86 | self.gridLayout_3.addLayout(self.gridLayout_2, 0, 0, 1, 1) 87 | self.horizontalLayout = QtWidgets.QHBoxLayout() 88 | self.horizontalLayout.setContentsMargins(-1, -1, -1, 0) 89 | self.horizontalLayout.setSpacing(0) 90 | self.horizontalLayout.setObjectName("horizontalLayout") 91 | spacerItem3 = QtWidgets.QSpacerItem(40, 0, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 92 | self.horizontalLayout.addItem(spacerItem3) 93 | self.close_btn = QtWidgets.QToolButton(parent=edit_case_persons_window) 94 | self.close_btn.setMinimumSize(QtCore.QSize(65, 30)) 95 | self.close_btn.setText("") 96 | self.close_btn.setObjectName("close_btn") 97 | self.horizontalLayout.addWidget(self.close_btn) 98 | spacerItem4 = QtWidgets.QSpacerItem(40, 0, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 99 | self.horizontalLayout.addItem(spacerItem4) 100 | self.gridLayout_3.addLayout(self.horizontalLayout, 1, 0, 1, 1) 101 | 102 | self.retranslateUi(edit_case_persons_window) 103 | QtCore.QMetaObject.connectSlotsByName(edit_case_persons_window) 104 | 105 | def retranslateUi(self, edit_case_persons_window): 106 | _translate = QtCore.QCoreApplication.translate 107 | edit_case_persons_window.setWindowTitle(_translate("edit_case_persons_window", "Form")) 108 | 109 | class Ui_persons_window(object): 110 | def setupUi(self, persons_window): 111 | persons_window.setObjectName("persons_window") 112 | persons_window.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal) 113 | persons_window.resize(600, 400) 114 | persons_window.setMinimumSize(QtCore.QSize(400, 300)) 115 | self.gridLayout_3 = QtWidgets.QGridLayout(persons_window) 116 | self.gridLayout_3.setContentsMargins(9, 9, 9, 9) 117 | self.gridLayout_3.setHorizontalSpacing(0) 118 | self.gridLayout_3.setVerticalSpacing(7) 119 | self.gridLayout_3.setObjectName("gridLayout_3") 120 | self.splitter = QtWidgets.QSplitter(parent=persons_window) 121 | self.splitter.setOrientation(QtCore.Qt.Orientation.Horizontal) 122 | self.splitter.setObjectName("splitter") 123 | self.widget = QtWidgets.QWidget(parent=self.splitter) 124 | self.widget.setObjectName("widget") 125 | self.gridLayout_2 = QtWidgets.QGridLayout(self.widget) 126 | self.gridLayout_2.setContentsMargins(0, 0, 0, 0) 127 | self.gridLayout_2.setObjectName("gridLayout_2") 128 | self.results_view = QtWidgets.QTableWidget(parent=self.widget) 129 | self.results_view.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu) 130 | self.results_view.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) 131 | self.results_view.setColumnCount(2) 132 | self.results_view.setObjectName("results_view") 133 | self.results_view.setRowCount(0) 134 | self.results_view.horizontalHeader().setVisible(False) 135 | self.results_view.verticalHeader().setVisible(False) 136 | self.gridLayout_2.addWidget(self.results_view, 0, 0, 2, 2) 137 | self.gridLayout = QtWidgets.QGridLayout() 138 | self.gridLayout.setContentsMargins(-1, -1, 15, 15) 139 | self.gridLayout.setSpacing(0) 140 | self.gridLayout.setObjectName("gridLayout") 141 | spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) 142 | self.gridLayout.addItem(spacerItem, 0, 1, 1, 1) 143 | spacerItem1 = QtWidgets.QSpacerItem(13, 27, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 144 | self.gridLayout.addItem(spacerItem1, 1, 0, 1, 1) 145 | self.add_btn = QtWidgets.QToolButton(parent=self.widget) 146 | self.add_btn.setText("") 147 | self.add_btn.setObjectName("add_btn") 148 | self.gridLayout.addWidget(self.add_btn, 1, 1, 1, 1) 149 | self.gridLayout_2.addLayout(self.gridLayout, 1, 1, 1, 1) 150 | self.infos_view = QtWidgets.QTableWidget(parent=self.splitter) 151 | font = QtGui.QFont() 152 | font.setPointSize(11) 153 | self.infos_view.setFont(font) 154 | self.infos_view.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu) 155 | self.infos_view.setColumnCount(2) 156 | self.infos_view.setObjectName("infos_view") 157 | self.infos_view.setRowCount(0) 158 | self.infos_view.horizontalHeader().setVisible(False) 159 | self.infos_view.verticalHeader().setCascadingSectionResizes(True) 160 | self.infos_view.verticalHeader().setDefaultSectionSize(30) 161 | self.infos_view.verticalHeader().setMinimumSectionSize(30) 162 | self.gridLayout_3.addWidget(self.splitter, 1, 0, 1, 1) 163 | self.horizontalLayout_2 = QtWidgets.QHBoxLayout() 164 | self.horizontalLayout_2.setSpacing(0) 165 | self.horizontalLayout_2.setObjectName("horizontalLayout_2") 166 | spacerItem2 = QtWidgets.QSpacerItem(13, 27, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 167 | self.horizontalLayout_2.addItem(spacerItem2) 168 | self.choose_btn = QtWidgets.QToolButton(parent=persons_window) 169 | self.choose_btn.setMinimumSize(QtCore.QSize(65, 30)) 170 | self.choose_btn.setObjectName("choose_btn") 171 | self.horizontalLayout_2.addWidget(self.choose_btn) 172 | spacerItem3 = QtWidgets.QSpacerItem(13, 27, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) 173 | self.horizontalLayout_2.addItem(spacerItem3) 174 | self.gridLayout_3.addLayout(self.horizontalLayout_2, 2, 0, 1, 1) 175 | self.horizontalLayout = QtWidgets.QHBoxLayout() 176 | self.horizontalLayout.setSpacing(0) 177 | self.horizontalLayout.setObjectName("horizontalLayout") 178 | self.search_bar = QtWidgets.QLineEdit(parent=persons_window) 179 | self.search_bar.setObjectName("search_bar") 180 | self.horizontalLayout.addWidget(self.search_bar) 181 | self.gridLayout_3.addLayout(self.horizontalLayout, 0, 0, 1, 1) 182 | self.gridLayout_3.setRowStretch(1, 1) 183 | 184 | self.retranslateUi(persons_window) 185 | QtCore.QMetaObject.connectSlotsByName(persons_window) 186 | 187 | def retranslateUi(self, persons_window): 188 | _translate = QtCore.QCoreApplication.translate 189 | persons_window.setWindowTitle(_translate("persons_window", "Form")) 190 | self.choose_btn.setText(_translate("persons_window", "选择")) 191 | 192 | class Ui_today_news_window(object): 193 | def setupUi(self, today_news_window): 194 | today_news_window.setObjectName("today_news_window") 195 | today_news_window.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal) 196 | today_news_window.resize(550, 400) 197 | self.gridLayout = QtWidgets.QGridLayout(today_news_window) 198 | self.gridLayout.setObjectName("gridLayout") 199 | self.message_view = QtWidgets.QTextBrowser(today_news_window) 200 | self.message_view.setObjectName("message_view") 201 | self.gridLayout.addWidget(self.message_view, 0, 0, 1, 1) 202 | 203 | self.retranslateUi(today_news_window) 204 | QtCore.QMetaObject.connectSlotsByName(today_news_window) 205 | 206 | def retranslateUi(self, today_news_window): 207 | _translate = QtCore.QCoreApplication.translate 208 | today_news_window.setWindowTitle(_translate("today_news_window", "TODO LIST")) 209 | 210 | class Ui_person_info_window(object): 211 | def setupUi(self, person_info_window): 212 | person_info_window.setObjectName("person_info_window") 213 | person_info_window.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal) 214 | person_info_window.resize(550, 400) 215 | self.gridLayout = QtWidgets.QGridLayout(person_info_window) 216 | self.gridLayout.setObjectName("gridLayout") 217 | self.infos_view = QtWidgets.QTableWidget(person_info_window) 218 | font = QtGui.QFont() 219 | font.setPointSize(13) 220 | self.infos_view.setFont(font) 221 | self.infos_view.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu) 222 | self.infos_view.setColumnCount(3) 223 | self.infos_view.setObjectName("infos_view") 224 | self.infos_view.setRowCount(0) 225 | self.infos_view.horizontalHeader().setVisible(False) 226 | self.infos_view.verticalHeader().setCascadingSectionResizes(True) 227 | self.infos_view.verticalHeader().setDefaultSectionSize(30) 228 | self.infos_view.verticalHeader().setMinimumSectionSize(30) 229 | self.gridLayout.addWidget(self.infos_view, 0, 0, 1, 1) 230 | self.retranslateUi(person_info_window) 231 | QtCore.QMetaObject.connectSlotsByName(person_info_window) 232 | 233 | def retranslateUi(self, person_info_window): 234 | _translate = QtCore.QCoreApplication.translate 235 | person_info_window.setWindowTitle(_translate("person_info_window", "Form")) 236 | 237 | 238 | -------------------------------------------------------------------------------- /MyCaseLib.py: -------------------------------------------------------------------------------- 1 | #coding=utf-8 2 | import os 3 | import sys 4 | 5 | from MCLib_DB import DataBase 6 | from MCLib_Main_Window import ui_main 7 | from PyQt6.QtWidgets import QApplication 8 | 9 | if os.name == 'posix': 10 | from AppKit import NSSearchPathForDirectoriesInDomains 11 | 12 | if __name__ == '__main__': 13 | if os.name == 'posix': 14 | PATH = os.path.join(NSSearchPathForDirectoriesInDomains(14, 1, 1).objectAtIndex_(0), 'MyCaseLib') 15 | else: 16 | PATH = os.path.join(os.environ['APPDATA'], 'MCLib') 17 | if not os.path.isdir(PATH): 18 | os.mkdir(PATH) 19 | 20 | DB_NAME = 'DB_MyCaseLib.db' 21 | DB_PATH = os.path.join(PATH, DB_NAME) 22 | DB = DataBase(PATH, DB_NAME, DB_PATH) 23 | SETTING_PATH = os.path.join(PATH, 'SETTING_MyCaseLib') 24 | VERSION = 'v 1.0' 25 | 26 | app = QApplication(sys.argv) 27 | app.setQuitOnLastWindowClosed(False) 28 | window_main = ui_main(DB = DB, DB_PATH = DB_PATH, VERSION = VERSION, SETTING_PATH = SETTING_PATH) 29 | 30 | window_main.show() 31 | sys.exit(app.exec()) 32 | 33 | -------------------------------------------------------------------------------- /MyCaseLib.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python ; coding: utf-8 -*- 2 | 3 | 4 | block_cipher = None 5 | 6 | 7 | a = Analysis( 8 | ['MyCaseLib.py'], 9 | pathex=[], 10 | binaries=[], 11 | datas=[('MCLib_icon.png', '.'), ('MCLib_icon_transparent.png', '.'), ('example', '.')], 12 | hiddenimports=[], 13 | hookspath=[], 14 | hooksconfig={}, 15 | runtime_hooks=[], 16 | excludes=[], 17 | win_no_prefer_redirects=False, 18 | win_private_assemblies=False, 19 | cipher=block_cipher, 20 | noarchive=False, 21 | ) 22 | pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) 23 | 24 | exe = EXE( 25 | pyz, 26 | a.scripts, 27 | [], 28 | exclude_binaries=True, 29 | name='MyCaseLib', 30 | debug=False, 31 | bootloader_ignore_signals=False, 32 | strip=False, 33 | upx=True, 34 | console=False, 35 | disable_windowed_traceback=False, 36 | argv_emulation=False, 37 | target_arch=None, 38 | codesign_identity=None, 39 | entitlements_file=None, 40 | icon=['MCLib_icon.ico'], 41 | ) 42 | coll = COLLECT( 43 | exe, 44 | a.binaries, 45 | a.zipfiles, 46 | a.datas, 47 | strip=False, 48 | upx=True, 49 | upx_exclude=[], 50 | name='MyCaseLib', 51 | ) 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MyCaseLib 2 | 3 |
4 | 这是一个诉讼案件管理工具(数据库),用于记录案件的基本信息、待办事项和事件记录,方便随时检索、查看。同时,并可以查看当日(及15日内)todo-list,也可按既定套路快速生成并复制一些信息。 5 |
6 | 软件里预设了一些模板,包括民事诉讼、仲裁两种案件类型,用于知识管理的案例库,以及相应的当事人和联系人类型,可以通过自定义添加或修改这些模板。 7 |
8 | 除了诉讼案件以外,也许也可以用于管理其他事务。 9 |


10 | mac版软件为状态栏app,仅在主界面出现时显示在dock栏中。windows版本无状态栏部分。 11 |
12 | 此外,windows版本全部数据文件存储于文件夹内,更新、覆盖文件前请善用备份功能,以防丢失现有数据。 13 |


14 | 因为是自用为主,因此大部分功能基于个人习惯设计,加上mac版无正常菜单栏(有也不好用,距离太远),因此许多交互都是是通过右键实现,如实际使用请多尝试右键。 15 |
16 | 未来版本在修bug的之余,可能对ui进行美化,基本功能可能无太大变化。 17 | -------------------------------------------------------------------------------- /example: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoodTheme/MyCaseLib/80e99e054db8798a2ad9672564f4f8829279a925/example -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | """ 2 | This is a setup.py script generated by py2applet 3 | 4 | Usage: 5 | python setup.py py2app 6 | """ 7 | 8 | from setuptools import setup 9 | 10 | APP = ['MyCaseLib.py'] 11 | DATA_FILES = [ 12 | 'example', 13 | 'MCLib_Bar_icon.png', 14 | 'MCLib_icon_transparent.png', 15 | ] 16 | 17 | OPTIONS = { 18 | 'iconfile': 'MCLib_icon.png', 19 | 'packages':[ 20 | 'sqlite3', 21 | 'PyQt6', 22 | 'qtawesome', 23 | ], 24 | 'includes': [ 25 | 'PyQt6', 26 | 'qtawesome', 27 | 'sqlite3' 28 | ] 29 | } 30 | 31 | setup( 32 | app=APP, 33 | data_files=DATA_FILES, 34 | options={'py2app': OPTIONS}, 35 | setup_requires=['py2app'], 36 | ) 37 | --------------------------------------------------------------------------------